Skip to content

Open-source personal finance manager. Self-hosted, privacy-first.

Initial commit

Tássio Noronhac6d5bd3f405a
diff --git a/.env.example b/.env.example
new file mode 100644
index 00000000..cf64477a
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,9 @@
+# Required
+SECRET_KEY=change-me-in-production
+
+# Bank sync — Pluggy (https://pluggy.ai)
+# 1. Create an account at https://dashboard.pluggy.ai
+# 2. Copy your Client ID and Client Secret
+# 3. Add http://localhost:3000/oauth/callback as an allowed redirect URI
+PLUGGY_CLIENT_ID=
+PLUGGY_CLIENT_SECRET=
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000..d766d1d0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,39 @@
+---
+name: Bug Report
+about: Report a bug to help us improve Securo
+title: "[Bug] "
+labels: bug
+assignees: ""
+---
+
+## Description
+
+A clear description of what the bug is.
+
+## Steps to Reproduce
+
+1. Go to '...'
+2. Click on '...'
+3. See error
+
+## Expected Behavior
+
+What you expected to happen.
+
+## Actual Behavior
+
+What actually happened.
+
+## Environment
+
+- Deployment: [Docker / Manual]
+- Browser: [e.g. Chrome 120]
+- OS: [e.g. macOS 14, Ubuntu 22.04]
+
+## Screenshots
+
+If applicable, add screenshots to help explain the problem.
+
+## Additional Context
+
+Any other context about the problem.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 00000000..20e9aa83
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,23 @@
+---
+name: Feature Request
+about: Suggest an idea for Securo
+title: "[Feature] "
+labels: enhancement
+assignees: ""
+---
+
+## Problem
+
+What problem does this feature solve? E.g. "I'm always frustrated when..."
+
+## Proposed Solution
+
+A clear description of what you want to happen.
+
+## Alternatives Considered
+
+Any alternative solutions or features you've considered.
+
+## Additional Context
+
+Any other context, mockups, or screenshots about the feature request.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..1403cdc5
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,21 @@
+## What
+
+Brief description of the changes.
+
+## Why
+
+Why are these changes needed?
+
+## How to Test
+
+Steps to verify the changes work:
+
+1. ...
+2. ...
+
+## Checklist
+
+- [ ] Backend tests pass (`pytest`)
+- [ ] Frontend lints clean (`npm run lint`)
+- [ ] Frontend builds (`npm run build`)
+- [ ] Translations updated (if user-facing strings changed)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 00000000..fcc13bed
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,68 @@
+name: CI
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ branches: [main]
+
+jobs:
+ backend-tests:
+ name: Backend Tests
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: backend
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.13"
+ cache: pip
+
+ - name: Install dependencies
+ run: |
+ pip install -e ".[dev]"
+
+ - name: Lint with Ruff
+ run: ruff check .
+
+ - name: Run tests with coverage
+ run: |
+ pytest --cov=app --cov-report=xml --cov-report=term-missing --cov-fail-under=60
+
+ - name: Upload coverage report
+ if: always()
+ uses: actions/upload-artifact@v4
+ with:
+ name: coverage-report
+ path: backend/coverage.xml
+
+ frontend-checks:
+ name: Frontend Checks
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: frontend
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "22"
+ cache: npm
+ cache-dependency-path: frontend/package-lock.json
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Lint
+ run: npm run lint
+
+ - name: Type check & Build
+ run: npm run build
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..6c848a3a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+.env
+.worktrees/
+.DS_Store
+.playwright-mcp/
+docs/plans/
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 00000000..dcfc833c
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,38 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment:
+
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
+
+Examples of unacceptable behavior:
+
+- Trolling, insulting or derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the project maintainers. All complaints will be reviewed and
+investigated and will result in a response that is deemed necessary and
+appropriate to the circumstances.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..bf15ace9
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,71 @@
+# Contributing to Securo
+
+Thanks for your interest in contributing to Securo! This guide will help you get started.
+
+## Getting Started
+
+1. Fork the repository
+2. Clone your fork: `git clone https://github.com/your-username/finanseu.git`
+3. Start the stack: `docker compose up --build`
+4. Open [http://localhost:3000](http://localhost:3000)
+
+## Development Workflow
+
+1. Create a branch from `main`: `git checkout -b feature/your-feature`
+2. Make your changes
+3. Run backend tests: `docker compose exec backend pytest`
+4. Run frontend lint: `cd frontend && npm run lint`
+5. Commit with a clear message (see below)
+6. Push your branch and open a Pull Request
+
+## Commit Messages
+
+Use clear, descriptive commit messages:
+
+- `feat: add CSV export for transactions`
+- `fix: correct balance calculation on account closure`
+- `docs: update setup instructions`
+- `refactor: simplify rule engine matching`
+
+## Running Tests
+
+```bash
+# Backend tests
+docker compose exec backend pytest
+
+# Backend tests with coverage
+docker compose exec backend pytest --cov=app --cov-report=term-missing
+
+# Frontend lint
+cd frontend && npm run lint
+
+# Frontend build check
+cd frontend && npm run build
+```
+
+## Pull Request Guidelines
+
+- Keep PRs focused — one feature or fix per PR
+- Include a clear description of what changed and why
+- Make sure CI passes (tests + lint)
+- Add tests for new backend functionality
+- Update translations if adding user-facing strings (EN + PT-BR)
+
+## Project Structure
+
+```
+backend/ → FastAPI + SQLAlchemy + Celery
+frontend/ → React + TypeScript + Vite + Tailwind
+docs/ → Design and implementation docs
+scripts/ → Development utilities
+```
+
+## Reporting Issues
+
+- Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) for bugs
+- Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md) for ideas
+- Check existing issues before opening a new one
+
+## License
+
+By contributing, you agree that your contributions will be licensed under the [AGPL-3.0 License](LICENSE).
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..be3f7b28
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,661 @@
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<https://www.gnu.org/licenses/>.
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..967db4ea
--- /dev/null
+++ b/README.md
@@ -0,0 +1,67 @@
+# Securo
+
+[![CI](https://github.com/tassionoronha/finanseu/actions/workflows/ci.yml/badge.svg)](https://github.com/tassionoronha/finanseu/actions/workflows/ci.yml)
+[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
+
+Open-source personal finance manager. Track accounts, categorize transactions, and understand your spending — with optional bank sync.
+
+## Quick Start
+
+```bash
+docker compose up --build
+```
+
+Open [http://localhost:3000](http://localhost:3000) and create an account. That's it.
+
+## Features
+
+- Multi-account management with running balances
+- Transaction management with search, filters, and CSV export
+- File import (OFX, QIF, CAMT, CSV)
+- Auto-categorization rules engine
+- Recurring transactions and budgets
+- Dashboard with spending analytics and projections
+- Bank sync via providers (Pluggy supported, extensible)
+- Dark/light theme, multi-language support, privacy mode
+
+## Bank Sync (Optional)
+
+Create a `.env` file with your [Pluggy](https://pluggy.ai) credentials:
+
+```
+PLUGGY_CLIENT_ID=your-client-id
+PLUGGY_CLIENT_SECRET=your-client-secret
+```
+
+Then restart: `docker compose up`
+
+See the [full setup guide](https://securo.dev/getting-started/pluggy-setup/) for step-by-step instructions.
+
+## Tech Stack
+
+| Layer | Stack |
+|-------|-------|
+| Backend | FastAPI, SQLAlchemy, Alembic, Celery |
+| Frontend | React, TypeScript, Vite, Tailwind CSS |
+| Database | PostgreSQL |
+| Queue | Redis + Celery |
+
+## Development
+
+```bash
+# Run backend tests
+docker compose exec backend pytest
+
+# Rebuild after dependency changes
+docker compose up --build
+```
+
+## Contributing
+
+See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
+
+## License
+
+This project is licensed under the [GNU Affero General Public License v3.0](LICENSE).
+
+This means you can freely use, modify, and distribute this software, but any modifications — including when used as a network service (SaaS) — must also be released under the AGPL-3.0.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 00000000..723e10d6
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,36 @@
+# Security Policy
+
+## Reporting a Vulnerability
+
+If you discover a security vulnerability in Securo, please report it responsibly.
+
+**Do NOT open a public GitHub issue for security vulnerabilities.**
+
+Instead, please email: **[email protected]** (or open a private security advisory on GitHub)
+
+### What to include
+
+- Description of the vulnerability
+- Steps to reproduce
+- Potential impact
+- Suggested fix (if any)
+
+### Response timeline
+
+- Acknowledgment within 48 hours
+- Status update within 7 days
+- Fix and disclosure coordinated with the reporter
+
+## Supported Versions
+
+| Version | Supported |
+|---------|-----------|
+| latest | Yes |
+
+## Best Practices for Self-Hosting
+
+- Always change the default `SECRET_KEY` in production
+- Use HTTPS in production
+- Keep dependencies updated
+- Restrict database access to the backend service only
+- Review environment variables before deploying
diff --git a/backend/.dockerignore b/backend/.dockerignore
new file mode 100644
index 00000000..d9c16897
--- /dev/null
+++ b/backend/.dockerignore
@@ -0,0 +1,10 @@
+.venv/
+venv/
+__pycache__/
+*.py[cod]
+.pytest_cache/
+.coverage
+htmlcov/
+.ruff_cache/
+.env
+*.egg-info/
diff --git a/backend/.env.example b/backend/.env.example
new file mode 100644
index 00000000..22ce6d37
--- /dev/null
+++ b/backend/.env.example
@@ -0,0 +1,8 @@
+DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/securo
+SECRET_KEY=change-me-in-production
+DEBUG=true
+PLUGGY_CLIENT_ID=
+PLUGGY_CLIENT_SECRET=
+PLUGGY_OAUTH_REDIRECT_URI=http://localhost:5173/oauth/callback
+FRONTEND_URL=http://localhost:5173
+REDIS_URL=redis://localhost:6379/0
diff --git a/backend/.gitignore b/backend/.gitignore
new file mode 100644
index 00000000..caa3807e
--- /dev/null
+++ b/backend/.gitignore
@@ -0,0 +1,15 @@
+__pycache__/
+*.py[cod]
+.env
+.venv/
+venv/
+*.egg-info/
+dist/
+build/
+.pytest_cache/
+.coverage
+htmlcov/
+.ruff_cache/
+celerybeat-schedule
+celerybeat-schedule-shm
+celerybeat-schedule-wal
diff --git a/backend/Dockerfile b/backend/Dockerfile
new file mode 100644
index 00000000..9ac4c1ab
--- /dev/null
+++ b/backend/Dockerfile
@@ -0,0 +1,18 @@
+FROM python:3.13-slim
+
+WORKDIR /app
+
+# Install system deps for asyncpg
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ gcc \
+ libpq-dev \
+ && rm -rf /var/lib/apt/lists/*
+
+COPY pyproject.toml .
+RUN pip install --no-cache-dir -e .
+
+COPY . .
+
+EXPOSE 8000
+
+CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
diff --git a/backend/alembic.ini b/backend/alembic.ini
new file mode 100644
index 00000000..807ded2d
--- /dev/null
+++ b/backend/alembic.ini
@@ -0,0 +1,149 @@
+# A generic, single database configuration.
+
+[alembic]
+# path to migration scripts.
+# this is typically a path given in POSIX (e.g. forward slashes)
+# format, relative to the token %(here)s which refers to the location of this
+# ini file
+script_location = %(here)s/alembic
+
+# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
+# Uncomment the line below if you want the files to be prepended with date and time
+# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
+# for all available tokens
+# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
+# Or organize into date-based subdirectories (requires recursive_version_locations = true)
+# file_template = %%(year)d/%%(month).2d/%%(day).2d_%%(hour).2d%%(minute).2d_%%(second).2d_%%(rev)s_%%(slug)s
+
+# sys.path path, will be prepended to sys.path if present.
+# defaults to the current working directory. for multiple paths, the path separator
+# is defined by "path_separator" below.
+prepend_sys_path = .
+
+
+# timezone to use when rendering the date within the migration file
+# as well as the filename.
+# If specified, requires the tzdata library which can be installed by adding
+# `alembic[tz]` to the pip requirements.
+# string value is passed to ZoneInfo()
+# leave blank for localtime
+# timezone =
+
+# max length of characters to apply to the "slug" field
+# truncate_slug_length = 40
+
+# set to 'true' to run the environment during
+# the 'revision' command, regardless of autogenerate
+# revision_environment = false
+
+# set to 'true' to allow .pyc and .pyo files without
+# a source .py file to be detected as revisions in the
+# versions/ directory
+# sourceless = false
+
+# version location specification; This defaults
+# to <script_location>/versions. When using multiple version
+# directories, initial revisions must be specified with --version-path.
+# The path separator used here should be the separator specified by "path_separator"
+# below.
+# version_locations = %(here)s/bar:%(here)s/bat:%(here)s/alembic/versions
+
+# path_separator; This indicates what character is used to split lists of file
+# paths, including version_locations and prepend_sys_path within configparser
+# files such as alembic.ini.
+# The default rendered in new alembic.ini files is "os", which uses os.pathsep
+# to provide os-dependent path splitting.
+#
+# Note that in order to support legacy alembic.ini files, this default does NOT
+# take place if path_separator is not present in alembic.ini. If this
+# option is omitted entirely, fallback logic is as follows:
+#
+# 1. Parsing of the version_locations option falls back to using the legacy
+# "version_path_separator" key, which if absent then falls back to the legacy
+# behavior of splitting on spaces and/or commas.
+# 2. Parsing of the prepend_sys_path option falls back to the legacy
+# behavior of splitting on spaces, commas, or colons.
+#
+# Valid values for path_separator are:
+#
+# path_separator = :
+# path_separator = ;
+# path_separator = space
+# path_separator = newline
+#
+# Use os.pathsep. Default configuration used for new projects.
+path_separator = os
+
+# set to 'true' to search source files recursively
+# in each "version_locations" directory
+# new in Alembic version 1.10
+# recursive_version_locations = false
+
+# the output encoding used when revision files
+# are written from script.py.mako
+# output_encoding = utf-8
+
+# database URL. This is consumed by the user-maintained env.py script only.
+# other means of configuring database URLs may be customized within the env.py
+# file.
+sqlalchemy.url = driver://user:pass@localhost/dbname
+
+
+[post_write_hooks]
+# post_write_hooks defines scripts or Python functions that are run
+# on newly generated revision scripts. See the documentation for further
+# detail and examples
+
+# format using "black" - use the console_scripts runner, against the "black" entrypoint
+# hooks = black
+# black.type = console_scripts
+# black.entrypoint = black
+# black.options = -l 79 REVISION_SCRIPT_FILENAME
+
+# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
+# hooks = ruff
+# ruff.type = module
+# ruff.module = ruff
+# ruff.options = check --fix REVISION_SCRIPT_FILENAME
+
+# Alternatively, use the exec runner to execute a binary found on your PATH
+# hooks = ruff
+# ruff.type = exec
+# ruff.executable = ruff
+# ruff.options = check --fix REVISION_SCRIPT_FILENAME
+
+# Logging configuration. This is also consumed by the user-maintained
+# env.py script only.
+[loggers]
+keys = root,sqlalchemy,alembic
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = WARNING
+handlers = console
+qualname =
+
+[logger_sqlalchemy]
+level = WARNING
+handlers =
+qualname = sqlalchemy.engine
+
+[logger_alembic]
+level = INFO
+handlers =
+qualname = alembic
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(levelname)-5.5s [%(name)s] %(message)s
+datefmt = %H:%M:%S
diff --git a/backend/alembic/README b/backend/alembic/README
new file mode 100644
index 00000000..98e4f9c4
--- /dev/null
+++ b/backend/alembic/README
@@ -0,0 +1 @@
+Generic single-database configuration.
\ No newline at end of file
diff --git a/backend/alembic/env.py b/backend/alembic/env.py
new file mode 100644
index 00000000..a794a8ac
--- /dev/null
+++ b/backend/alembic/env.py
@@ -0,0 +1,65 @@
+import asyncio
+from logging.config import fileConfig
+
+from sqlalchemy import pool
+from sqlalchemy.engine import Connection
+from sqlalchemy.ext.asyncio import async_engine_from_config
+
+from alembic import context
+
+from app.core.config import get_settings
+from app.core.database import Base
+from app.models import * # noqa: F401,F403
+
+config = context.config
+settings = get_settings()
+
+config.set_main_option("sqlalchemy.url", settings.database_url)
+
+if config.config_file_name is not None:
+ fileConfig(config.config_file_name)
+
+target_metadata = Base.metadata
+
+
+def run_migrations_offline() -> None:
+ url = config.get_main_option("sqlalchemy.url")
+ context.configure(
+ url=url,
+ target_metadata=target_metadata,
+ literal_binds=True,
+ dialect_opts={"paramstyle": "named"},
+ )
+
+ with context.begin_transaction():
+ context.run_migrations()
+
+
+def do_run_migrations(connection: Connection) -> None:
+ context.configure(connection=connection, target_metadata=target_metadata)
+
+ with context.begin_transaction():
+ context.run_migrations()
+
+
+async def run_async_migrations() -> None:
+ connectable = async_engine_from_config(
+ config.get_section(config.config_ini_section, {}),
+ prefix="sqlalchemy.",
+ poolclass=pool.NullPool,
+ )
+
+ async with connectable.connect() as connection:
+ await connection.run_sync(do_run_migrations)
+
+ await connectable.dispose()
+
+
+def run_migrations_online() -> None:
+ asyncio.run(run_async_migrations())
+
+
+if context.is_offline_mode():
+ run_migrations_offline()
+else:
+ run_migrations_online()
diff --git a/backend/alembic/script.py.mako b/backend/alembic/script.py.mako
new file mode 100644
index 00000000..11016301
--- /dev/null
+++ b/backend/alembic/script.py.mako
@@ -0,0 +1,28 @@
+"""${message}
+
+Revision ID: ${up_revision}
+Revises: ${down_revision | comma,n}
+Create Date: ${create_date}
+
+"""
+from typing import Sequence, Union
+
+from alembic import op
+import sqlalchemy as sa
+${imports if imports else ""}
+
+# revision identifiers, used by Alembic.
+revision: str = ${repr(up_revision)}
+down_revision: Union[str, Sequence[str], None] = ${repr(down_revision)}
+branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
+depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
+
+
+def upgrade() -> None:
+ """Upgrade schema."""
+ ${upgrades if upgrades else "pass"}
+
+
+def downgrade() -> None:
+ """Downgrade schema."""
+ ${downgrades if downgrades else "pass"}
diff --git a/backend/alembic/versions/.gitkeep b/backend/alembic/versions/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/alembic/versions/001_initial_schema.py b/backend/alembic/versions/001_initial_schema.py
new file mode 100644
index 00000000..c1b83175
--- /dev/null
+++ b/backend/alembic/versions/001_initial_schema.py
@@ -0,0 +1,108 @@
+"""initial schema
+
+Revision ID: 001
+Revises:
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "001"
+down_revision: Union[str, None] = None
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ # Users (FastAPI Users base table + our extras)
+ op.create_table(
+ "users",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("email", sa.String(320), nullable=False, unique=True, index=True),
+ sa.Column("hashed_password", sa.String(1024), nullable=False),
+ sa.Column("is_active", sa.Boolean(), nullable=False, server_default=sa.text("true")),
+ sa.Column("is_superuser", sa.Boolean(), nullable=False, server_default=sa.text("false")),
+ sa.Column("is_verified", sa.Boolean(), nullable=False, server_default=sa.text("false")),
+ sa.Column("preferences", sa.JSON(), nullable=True),
+ )
+
+ # Categories
+ op.create_table(
+ "categories",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("name", sa.String(100), nullable=False),
+ sa.Column("icon", sa.String(10), nullable=False, server_default="❓"),
+ sa.Column("color", sa.String(7), nullable=False, server_default="#6B7280"),
+ sa.Column("is_system", sa.Boolean(), nullable=False, server_default=sa.text("false")),
+ )
+ op.create_index("ix_categories_user_id", "categories", ["user_id"])
+
+ # Bank Connections
+ op.create_table(
+ "bank_connections",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("provider", sa.String(50), nullable=False),
+ sa.Column("external_id", sa.String(255), nullable=False),
+ sa.Column("institution_name", sa.String(255), nullable=False),
+ sa.Column("credentials", sa.JSON(), nullable=True),
+ sa.Column("status", sa.String(50), nullable=False, server_default="active"),
+ sa.Column("last_sync_at", sa.DateTime(timezone=True), nullable=True),
+ sa.Column("created_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()),
+ )
+ op.create_index("ix_bank_connections_user_id", "bank_connections", ["user_id"])
+
+ # Accounts
+ op.create_table(
+ "accounts",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("connection_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("bank_connections.id"), nullable=False),
+ sa.Column("external_id", sa.String(255), nullable=False),
+ sa.Column("name", sa.String(255), nullable=False),
+ sa.Column("type", sa.String(50), nullable=False),
+ sa.Column("balance", sa.Numeric(precision=15, scale=2), nullable=False, server_default="0.00"),
+ sa.Column("currency", sa.String(3), nullable=False, server_default="BRL"),
+ )
+ op.create_index("ix_accounts_connection_id", "accounts", ["connection_id"])
+
+ # Transactions
+ op.create_table(
+ "transactions",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("account_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("accounts.id"), nullable=False),
+ sa.Column("category_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("categories.id"), nullable=True),
+ sa.Column("external_id", sa.String(255), nullable=True),
+ sa.Column("description", sa.String(500), nullable=False),
+ sa.Column("amount", sa.Numeric(precision=15, scale=2), nullable=False),
+ sa.Column("date", sa.Date(), nullable=False),
+ sa.Column("type", sa.String(10), nullable=False),
+ sa.Column("source", sa.String(20), nullable=False),
+ sa.Column("created_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()),
+ )
+ op.create_index("ix_transactions_account_id", "transactions", ["account_id"])
+ op.create_index("ix_transactions_category_id", "transactions", ["category_id"])
+ op.create_index("ix_transactions_date", "transactions", ["date"])
+
+ # Categorization Rules
+ op.create_table(
+ "categorization_rules",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("pattern", sa.String(255), nullable=False),
+ sa.Column("category_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("categories.id"), nullable=False),
+ sa.Column("priority", sa.Integer(), nullable=False, server_default="100"),
+ )
+ op.create_index("ix_categorization_rules_user_id", "categorization_rules", ["user_id"])
+
+
+def downgrade() -> None:
+ op.drop_table("categorization_rules")
+ op.drop_table("transactions")
+ op.drop_table("accounts")
+ op.drop_table("bank_connections")
+ op.drop_table("categories")
+ op.drop_table("users")
diff --git a/backend/alembic/versions/002_transaction_user_id_and_currency.py b/backend/alembic/versions/002_transaction_user_id_and_currency.py
new file mode 100644
index 00000000..04173f65
--- /dev/null
+++ b/backend/alembic/versions/002_transaction_user_id_and_currency.py
@@ -0,0 +1,49 @@
+"""add user_id and currency to transactions, make account_id nullable
+
+Revision ID: 002
+Revises: 001
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "002"
+down_revision: Union[str, None] = "001"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ # Add user_id column (not null with FK)
+ op.add_column("transactions", sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=True))
+ op.create_foreign_key("fk_transactions_user_id", "transactions", "users", ["user_id"], ["id"])
+
+ # Backfill user_id from account -> bank_connection -> user
+ op.execute("""
+ UPDATE transactions t
+ SET user_id = bc.user_id
+ FROM accounts a
+ JOIN bank_connections bc ON a.connection_id = bc.id
+ WHERE t.account_id = a.id AND t.user_id IS NULL
+ """)
+
+ # Now make it NOT NULL
+ op.alter_column("transactions", "user_id", nullable=False)
+ op.create_index("ix_transactions_user_id", "transactions", ["user_id"])
+
+ # Add currency column
+ op.add_column("transactions", sa.Column("currency", sa.String(3), nullable=False, server_default="BRL"))
+
+ # Make account_id nullable
+ op.alter_column("transactions", "account_id", nullable=True)
+
+
+def downgrade() -> None:
+ op.alter_column("transactions", "account_id", nullable=False)
+ op.drop_column("transactions", "currency")
+ op.drop_index("ix_transactions_user_id", "transactions")
+ op.drop_constraint("fk_transactions_user_id", "transactions", type_="foreignkey")
+ op.drop_column("transactions", "user_id")
diff --git a/backend/alembic/versions/003_manual_accounts.py b/backend/alembic/versions/003_manual_accounts.py
new file mode 100644
index 00000000..8d32e489
--- /dev/null
+++ b/backend/alembic/versions/003_manual_accounts.py
@@ -0,0 +1,48 @@
+"""add user_id to accounts, make connection_id and external_id nullable
+
+Revision ID: 003
+Revises: 002
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "003"
+down_revision: Union[str, None] = "002"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ # Add user_id column (nullable first for backfill)
+ op.add_column("accounts", sa.Column("user_id", postgresql.UUID(as_uuid=True), nullable=True))
+ op.create_foreign_key("fk_accounts_user_id", "accounts", "users", ["user_id"], ["id"])
+
+ # Backfill user_id from bank_connection
+ op.execute("""
+ UPDATE accounts a
+ SET user_id = bc.user_id
+ FROM bank_connections bc
+ WHERE a.connection_id = bc.id AND a.user_id IS NULL
+ """)
+
+ # Now make it NOT NULL
+ op.alter_column("accounts", "user_id", nullable=False)
+ op.create_index("ix_accounts_user_id", "accounts", ["user_id"])
+
+ # Make connection_id nullable (manual accounts have no connection)
+ op.alter_column("accounts", "connection_id", nullable=True)
+
+ # Make external_id nullable (manual accounts have no external ID)
+ op.alter_column("accounts", "external_id", nullable=True)
+
+
+def downgrade() -> None:
+ op.alter_column("accounts", "external_id", nullable=False)
+ op.alter_column("accounts", "connection_id", nullable=False)
+ op.drop_index("ix_accounts_user_id", "accounts")
+ op.drop_constraint("fk_accounts_user_id", "accounts", type_="foreignkey")
+ op.drop_column("accounts", "user_id")
diff --git a/backend/alembic/versions/004_recurring_transactions.py b/backend/alembic/versions/004_recurring_transactions.py
new file mode 100644
index 00000000..477d2ab7
--- /dev/null
+++ b/backend/alembic/versions/004_recurring_transactions.py
@@ -0,0 +1,44 @@
+"""create recurring_transactions table
+
+Revision ID: 004
+Revises: 003
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "004"
+down_revision: Union[str, None] = "003"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.create_table(
+ "recurring_transactions",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("account_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("accounts.id"), nullable=True),
+ sa.Column("category_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("categories.id"), nullable=True),
+ sa.Column("description", sa.String(500), nullable=False),
+ sa.Column("amount", sa.Numeric(precision=15, scale=2), nullable=False),
+ sa.Column("currency", sa.String(3), nullable=False, server_default="BRL"),
+ sa.Column("type", sa.String(10), nullable=False), # debit, credit
+ sa.Column("frequency", sa.String(20), nullable=False), # monthly, weekly, yearly
+ sa.Column("day_of_month", sa.Integer, nullable=True),
+ sa.Column("start_date", sa.Date, nullable=False),
+ sa.Column("end_date", sa.Date, nullable=True),
+ sa.Column("is_active", sa.Boolean, nullable=False, server_default="true"),
+ sa.Column("next_occurrence", sa.Date, nullable=False),
+ sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
+ sa.UniqueConstraint("user_id", "description", "frequency", "start_date", name="uq_recurring_tx"),
+ )
+ op.create_index("ix_recurring_transactions_user_id", "recurring_transactions", ["user_id"])
+
+
+def downgrade() -> None:
+ op.drop_index("ix_recurring_transactions_user_id", "recurring_transactions")
+ op.drop_table("recurring_transactions")
diff --git a/backend/alembic/versions/005_budgets.py b/backend/alembic/versions/005_budgets.py
new file mode 100644
index 00000000..6098af43
--- /dev/null
+++ b/backend/alembic/versions/005_budgets.py
@@ -0,0 +1,35 @@
+"""create budgets table
+
+Revision ID: 005
+Revises: 004
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "005"
+down_revision: Union[str, None] = "004"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.create_table(
+ "budgets",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("category_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("categories.id"), nullable=False),
+ sa.Column("amount", sa.Numeric(precision=15, scale=2), nullable=False),
+ sa.Column("month", sa.Date, nullable=False), # First day of month
+ sa.Column("created_at", sa.DateTime(timezone=True), server_default=sa.func.now()),
+ sa.UniqueConstraint("user_id", "category_id", "month", name="uq_budget_per_category_month"),
+ )
+ op.create_index("ix_budgets_user_id", "budgets", ["user_id"])
+
+
+def downgrade() -> None:
+ op.drop_index("ix_budgets_user_id", "budgets")
+ op.drop_table("budgets")
diff --git a/backend/alembic/versions/006_rules_and_notes.py b/backend/alembic/versions/006_rules_and_notes.py
new file mode 100644
index 00000000..2b6c3dc9
--- /dev/null
+++ b/backend/alembic/versions/006_rules_and_notes.py
@@ -0,0 +1,53 @@
+# backend/alembic/versions/006_rules_and_notes.py
+"""add rules table and notes to transactions
+
+Revision ID: 006
+Revises: 005
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "006"
+down_revision: Union[str, None] = "005"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ # 1. Add notes column to transactions
+ op.add_column("transactions", sa.Column("notes", sa.Text(), nullable=True))
+
+ # 2. Create new rules table
+ op.create_table(
+ "rules",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("name", sa.String(255), nullable=False),
+ sa.Column("conditions_op", sa.String(3), nullable=False, server_default="and"),
+ sa.Column("conditions", sa.JSON(), nullable=False, server_default="[]"),
+ sa.Column("actions", sa.JSON(), nullable=False, server_default="[]"),
+ sa.Column("priority", sa.Integer(), nullable=False, server_default="0"),
+ sa.Column("is_active", sa.Boolean(), nullable=False, server_default="true"),
+ )
+ op.create_index("ix_rules_user_id", "rules", ["user_id"])
+
+ # 3. Drop old categorization_rules table
+ op.drop_table("categorization_rules")
+
+
+def downgrade() -> None:
+ op.create_table(
+ "categorization_rules",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("pattern", sa.String(255), nullable=False),
+ sa.Column("category_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("categories.id"), nullable=False),
+ sa.Column("priority", sa.Integer(), nullable=False, server_default="100"),
+ )
+ op.drop_index("ix_rules_user_id", "rules")
+ op.drop_table("rules")
+ op.drop_column("transactions", "notes")
diff --git a/backend/alembic/versions/007_import_logs.py b/backend/alembic/versions/007_import_logs.py
new file mode 100644
index 00000000..1d198291
--- /dev/null
+++ b/backend/alembic/versions/007_import_logs.py
@@ -0,0 +1,43 @@
+"""add import_logs table and import_id to transactions
+
+Revision ID: 007
+Revises: 006
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "007"
+down_revision: Union[str, None] = "006"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.create_table(
+ "import_logs",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("account_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("accounts.id"), nullable=False),
+ sa.Column("filename", sa.String(255), nullable=False),
+ sa.Column("format", sa.String(10), nullable=False),
+ sa.Column("transaction_count", sa.Integer(), nullable=False),
+ sa.Column("total_credit", sa.Numeric(15, 2), nullable=False, server_default="0"),
+ sa.Column("total_debit", sa.Numeric(15, 2), nullable=False, server_default="0"),
+ sa.Column("created_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()),
+ )
+ op.create_index("ix_import_logs_user_id", "import_logs", ["user_id"])
+
+ op.add_column(
+ "transactions",
+ sa.Column("import_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("import_logs.id"), nullable=True),
+ )
+
+
+def downgrade() -> None:
+ op.drop_column("transactions", "import_id")
+ op.drop_index("ix_import_logs_user_id", "import_logs")
+ op.drop_table("import_logs")
diff --git a/backend/alembic/versions/008_category_lucide_icons.py b/backend/alembic/versions/008_category_lucide_icons.py
new file mode 100644
index 00000000..cf64e312
--- /dev/null
+++ b/backend/alembic/versions/008_category_lucide_icons.py
@@ -0,0 +1,69 @@
+"""convert category icons from emojis to Lucide icon names
+
+Revision ID: 008
+Revises: 007
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from alembic import op
+
+revision: str = "008"
+down_revision: Union[str, None] = "007"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.alter_column(
+ "categories",
+ "icon",
+ existing_type=sa.String(10),
+ type_=sa.String(50),
+ )
+
+ op.execute(
+ """
+ UPDATE categories SET icon = CASE icon
+ WHEN '🏠' THEN 'house'
+ WHEN '🍔' THEN 'utensils-crossed'
+ WHEN '🚗' THEN 'car'
+ WHEN '🛒' THEN 'shopping-cart'
+ WHEN '💊' THEN 'pill'
+ WHEN '🎮' THEN 'gamepad-2'
+ WHEN '📱' THEN 'smartphone'
+ WHEN '📚' THEN 'book-open'
+ WHEN '💸' THEN 'arrow-left-right'
+ WHEN '❓' THEN 'circle-help'
+ ELSE icon
+ END
+ """
+ )
+
+
+def downgrade() -> None:
+ op.execute(
+ """
+ UPDATE categories SET icon = CASE icon
+ WHEN 'house' THEN '🏠'
+ WHEN 'utensils-crossed' THEN '🍔'
+ WHEN 'car' THEN '🚗'
+ WHEN 'shopping-cart' THEN '🛒'
+ WHEN 'pill' THEN '💊'
+ WHEN 'gamepad-2' THEN '🎮'
+ WHEN 'smartphone' THEN '📱'
+ WHEN 'book-open' THEN '📚'
+ WHEN 'arrow-left-right' THEN '💸'
+ WHEN 'circle-help' THEN '❓'
+ ELSE icon
+ END
+ """
+ )
+
+ op.alter_column(
+ "categories",
+ "icon",
+ existing_type=sa.String(50),
+ type_=sa.String(10),
+ )
diff --git a/backend/alembic/versions/009_category_groups.py b/backend/alembic/versions/009_category_groups.py
new file mode 100644
index 00000000..a51b2a06
--- /dev/null
+++ b/backend/alembic/versions/009_category_groups.py
@@ -0,0 +1,97 @@
+"""add category_groups table and group_id to categories
+
+Revision ID: 009
+Revises: 008
+Create Date: 2026-02-25
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "009"
+down_revision: Union[str, None] = "008"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+# Default groups: (name, icon, color, position)
+DEFAULT_GROUPS = [
+ ("Moradia", "house", "#8B5CF6", 0),
+ ("Alimentação", "utensils-crossed", "#F59E0B", 1),
+ ("Transporte", "car", "#3B82F6", 2),
+ ("Estilo de Vida", "sparkles", "#EC4899", 3),
+ ("Outros", "circle-help", "#64748B", 4),
+]
+
+# Map category name -> group name
+CATEGORY_TO_GROUP = {
+ "Moradia": "Moradia",
+ "Alimentação": "Alimentação",
+ "Mercado": "Alimentação",
+ "Transporte": "Transporte",
+ "Saúde": "Estilo de Vida",
+ "Lazer": "Estilo de Vida",
+ "Educação": "Estilo de Vida",
+ "Assinaturas": "Outros",
+ "Transferências": "Outros",
+ "Outros": "Outros",
+}
+
+
+def upgrade() -> None:
+ # 1. Create category_groups table
+ op.create_table(
+ "category_groups",
+ sa.Column("id", postgresql.UUID(as_uuid=True), primary_key=True, server_default=sa.text("gen_random_uuid()")),
+ sa.Column("user_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("users.id"), nullable=False),
+ sa.Column("name", sa.String(100), nullable=False),
+ sa.Column("icon", sa.String(50), nullable=False, server_default="folder"),
+ sa.Column("color", sa.String(7), nullable=False, server_default="#6B7280"),
+ sa.Column("position", sa.Integer(), nullable=False, server_default="0"),
+ sa.Column("is_system", sa.Boolean(), nullable=False, server_default="true"),
+ )
+ op.create_index("ix_category_groups_user_id", "category_groups", ["user_id"])
+
+ # 2. Add group_id column to categories
+ op.add_column(
+ "categories",
+ sa.Column("group_id", postgresql.UUID(as_uuid=True), sa.ForeignKey("category_groups.id"), nullable=True),
+ )
+
+ # 3. Seed default groups for each existing user and assign categories
+ conn = op.get_bind()
+
+ users = conn.execute(sa.text("SELECT id FROM users")).fetchall()
+
+ for (user_id,) in users:
+ # Create groups for this user
+ group_ids = {}
+ for name, icon, color, position in DEFAULT_GROUPS:
+ result = conn.execute(
+ sa.text(
+ "INSERT INTO category_groups (id, user_id, name, icon, color, position, is_system) "
+ "VALUES (gen_random_uuid(), :user_id, :name, :icon, :color, :position, true) "
+ "RETURNING id"
+ ),
+ {"user_id": user_id, "name": name, "icon": icon, "color": color, "position": position},
+ )
+ group_ids[name] = result.scalar()
+
+ # Assign categories to groups
+ for cat_name, group_name in CATEGORY_TO_GROUP.items():
+ group_id = group_ids.get(group_name)
+ if group_id:
+ conn.execute(
+ sa.text(
+ "UPDATE categories SET group_id = :group_id "
+ "WHERE user_id = :user_id AND name = :cat_name"
+ ),
+ {"group_id": group_id, "user_id": user_id, "cat_name": cat_name},
+ )
+
+
+def downgrade() -> None:
+ op.drop_column("categories", "group_id")
+ op.drop_index("ix_category_groups_user_id", "category_groups")
+ op.drop_table("category_groups")
diff --git a/backend/alembic/versions/010_transfer_pairs.py b/backend/alembic/versions/010_transfer_pairs.py
new file mode 100644
index 00000000..db3fa5ac
--- /dev/null
+++ b/backend/alembic/versions/010_transfer_pairs.py
@@ -0,0 +1,45 @@
+"""add transfer_pair_id to transactions for linked transfer detection
+
+Revision ID: 010
+Revises: 009
+Create Date: 2026-03-02
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "010"
+down_revision: Union[str, None] = "009"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.add_column(
+ "transactions",
+ sa.Column("transfer_pair_id", postgresql.UUID(as_uuid=True), nullable=True),
+ )
+
+ # Partial index for fast partner lookups (only rows that are paired)
+ op.create_index(
+ "ix_transactions_transfer_pair_id",
+ "transactions",
+ ["transfer_pair_id"],
+ postgresql_where=sa.text("transfer_pair_id IS NOT NULL"),
+ )
+
+ # Composite index for the matching algorithm
+ op.create_index(
+ "ix_transactions_transfer_match",
+ "transactions",
+ ["user_id", "amount", "date"],
+ postgresql_where=sa.text("transfer_pair_id IS NULL"),
+ )
+
+
+def downgrade() -> None:
+ op.drop_index("ix_transactions_transfer_match", "transactions")
+ op.drop_index("ix_transactions_transfer_pair_id", "transactions")
+ op.drop_column("transactions", "transfer_pair_id")
diff --git a/backend/alembic/versions/011_transaction_status_payee_rawdata.py b/backend/alembic/versions/011_transaction_status_payee_rawdata.py
new file mode 100644
index 00000000..cc3c2c97
--- /dev/null
+++ b/backend/alembic/versions/011_transaction_status_payee_rawdata.py
@@ -0,0 +1,42 @@
+"""add status, payee, and raw_data columns to transactions
+
+Revision ID: 011
+Revises: 010
+Create Date: 2026-03-02
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+from alembic import op
+
+revision: str = "011"
+down_revision: Union[str, None] = "010"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ # Pending vs booked status (default "posted" for all existing transactions)
+ op.add_column(
+ "transactions",
+ sa.Column("status", sa.String(10), nullable=False, server_default="posted"),
+ )
+
+ # Smart payee extracted from merchant/payment data
+ op.add_column(
+ "transactions",
+ sa.Column("payee", sa.String(500), nullable=True),
+ )
+
+ # Full raw provider response for debugging and audit
+ op.add_column(
+ "transactions",
+ sa.Column("raw_data", postgresql.JSONB(), nullable=True),
+ )
+
+
+def downgrade() -> None:
+ op.drop_column("transactions", "raw_data")
+ op.drop_column("transactions", "payee")
+ op.drop_column("transactions", "status")
diff --git a/backend/alembic/versions/012_phase2_sync_polish.py b/backend/alembic/versions/012_phase2_sync_polish.py
new file mode 100644
index 00000000..2cea3c41
--- /dev/null
+++ b/backend/alembic/versions/012_phase2_sync_polish.py
@@ -0,0 +1,27 @@
+"""phase2 sync polish
+
+Revision ID: 012
+Revises: 011
+Create Date: 2026-03-02
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from alembic import op
+
+revision: str = "012"
+down_revision: Union[str, None] = "011"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.add_column("accounts", sa.Column("is_closed", sa.Boolean(), nullable=False, server_default=sa.text("false")))
+ op.add_column("accounts", sa.Column("closed_at", sa.DateTime(timezone=True), nullable=True))
+ op.add_column("bank_connections", sa.Column("settings", sa.JSON(), nullable=True, server_default=sa.text("'{}'")))
+
+
+def downgrade() -> None:
+ op.drop_column("bank_connections", "settings")
+ op.drop_column("accounts", "closed_at")
+ op.drop_column("accounts", "is_closed")
diff --git a/backend/alembic/versions/013_require_account_carteira.py b/backend/alembic/versions/013_require_account_carteira.py
new file mode 100644
index 00000000..2bfcbf47
--- /dev/null
+++ b/backend/alembic/versions/013_require_account_carteira.py
@@ -0,0 +1,81 @@
+"""require account — create Carteira default accounts and make account_id NOT NULL
+
+Revision ID: 013
+Revises: 012
+Create Date: 2026-03-02
+"""
+from typing import Sequence, Union
+
+import uuid as _uuid
+
+import sqlalchemy as sa
+from alembic import op
+
+revision: str = "013"
+down_revision: Union[str, None] = "012"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ conn = op.get_bind()
+
+ # 1. Find all users who have orphan transactions (account_id IS NULL)
+ orphan_users = conn.execute(
+ sa.text("SELECT DISTINCT user_id FROM transactions WHERE account_id IS NULL")
+ ).fetchall()
+
+ for (user_id,) in orphan_users:
+ # Check if user already has a "Carteira" account
+ existing = conn.execute(
+ sa.text(
+ "SELECT id FROM accounts WHERE user_id = :uid AND name = 'Carteira' AND connection_id IS NULL"
+ ),
+ {"uid": user_id},
+ ).fetchone()
+
+ if existing:
+ carteira_id = existing[0]
+ else:
+ carteira_id = str(_uuid.uuid4())
+ conn.execute(
+ sa.text(
+ "INSERT INTO accounts (id, user_id, name, type, balance, currency, is_closed) "
+ "VALUES (:id, :uid, 'Carteira', 'checking', 0, 'BRL', false)"
+ ),
+ {"id": carteira_id, "uid": user_id},
+ )
+
+ # Reassign orphan transactions to the Carteira account
+ conn.execute(
+ sa.text(
+ "UPDATE transactions SET account_id = :aid WHERE user_id = :uid AND account_id IS NULL"
+ ),
+ {"aid": carteira_id, "uid": user_id},
+ )
+
+ # 2. Create Carteira for users who don't have any account yet
+ users_without_accounts = conn.execute(
+ sa.text(
+ "SELECT id FROM users WHERE id NOT IN (SELECT DISTINCT user_id FROM accounts WHERE user_id IS NOT NULL)"
+ )
+ ).fetchall()
+
+ for (user_id,) in users_without_accounts:
+ carteira_id = str(_uuid.uuid4())
+ conn.execute(
+ sa.text(
+ "INSERT INTO accounts (id, user_id, name, type, balance, currency, is_closed) "
+ "VALUES (:id, :uid, 'Carteira', 'checking', 0, 'BRL', false)"
+ ),
+ {"id": carteira_id, "uid": user_id},
+ )
+
+ # 3. Make account_id NOT NULL
+ with op.batch_alter_table("transactions") as batch_op:
+ batch_op.alter_column("account_id", existing_type=sa.Uuid(), nullable=False)
+
+
+def downgrade() -> None:
+ with op.batch_alter_table("transactions") as batch_op:
+ batch_op.alter_column("account_id", existing_type=sa.Uuid(), nullable=True)
diff --git a/backend/alembic/versions/014_recurring_budgets.py b/backend/alembic/versions/014_recurring_budgets.py
new file mode 100644
index 00000000..2fd159a3
--- /dev/null
+++ b/backend/alembic/versions/014_recurring_budgets.py
@@ -0,0 +1,45 @@
+"""add recurring budgets support
+
+Revision ID: 014
+Revises: 013
+Create Date: 2026-03-04
+"""
+from typing import Sequence, Union
+
+import sqlalchemy as sa
+from alembic import op
+
+revision: str = "014"
+down_revision: Union[str, None] = "013"
+branch_labels: Union[str, Sequence[str], None] = None
+depends_on: Union[str, Sequence[str], None] = None
+
+
+def upgrade() -> None:
+ op.add_column(
+ "budgets",
+ sa.Column("is_recurring", sa.Boolean(), nullable=False, server_default="false"),
+ )
+ op.drop_constraint("uq_budget_per_category_month", "budgets", type_="unique")
+ op.create_unique_constraint(
+ "uq_budget_per_category_month_type",
+ "budgets",
+ ["user_id", "category_id", "month", "is_recurring"],
+ )
+ op.create_index(
+ "ix_budgets_recurring_lookup",
+ "budgets",
+ ["user_id", "category_id", "month"],
+ postgresql_where=sa.text("is_recurring = true"),
+ )
+
+
+def downgrade() -> None:
+ op.drop_index("ix_budgets_recurring_lookup", "budgets")
+ op.drop_constraint("uq_budget_per_category_month_type", "budgets", type_="unique")
+ op.create_unique_constraint(
+ "uq_budget_per_category_month",
+ "budgets",
+ ["user_id", "category_id", "month"],
+ )
+ op.drop_column("budgets", "is_recurring")
diff --git a/backend/app/__init__.py b/backend/app/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/app/api/__init__.py b/backend/app/api/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/app/api/accounts.py b/backend/app/api/accounts.py
new file mode 100644
index 00000000..a79b0586
--- /dev/null
+++ b/backend/app/api/accounts.py
@@ -0,0 +1,140 @@
+import uuid
+from datetime import date
+from typing import Optional
+
+from fastapi import APIRouter, Depends, HTTPException, Query, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.account import AccountCreate, AccountRead, AccountUpdate, AccountSummary
+from app.services import account_service
+
+router = APIRouter(prefix="/api/accounts", tags=["accounts"])
+
+
[email protected]("", response_model=list[AccountRead])
+async def list_accounts(
+ include_closed: bool = False,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await account_service.get_accounts(session, user.id, include_closed=include_closed)
+
+
[email protected]("/{account_id}/summary", response_model=AccountSummary)
+async def get_account_summary(
+ account_id: uuid.UUID,
+ date_from: Optional[str] = Query(None, alias="from", description="YYYY-MM-DD"),
+ date_to: Optional[str] = Query(None, alias="to", description="YYYY-MM-DD"),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ from_date = date.fromisoformat(date_from) if date_from else None
+ to_date = date.fromisoformat(date_to) if date_to else None
+ summary = await account_service.get_account_summary(
+ session, account_id, user.id, date_from=from_date, date_to=to_date,
+ )
+ if not summary:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+ return summary
+
+
[email protected]("/{account_id}/balance-history")
+async def get_account_balance_history(
+ account_id: uuid.UUID,
+ date_from: Optional[str] = Query(None, alias="from", description="YYYY-MM-DD"),
+ date_to: Optional[str] = Query(None, alias="to", description="YYYY-MM-DD"),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ from_date = date.fromisoformat(date_from) if date_from else None
+ to_date = date.fromisoformat(date_to) if date_to else None
+ history = await account_service.get_account_balance_history(
+ session, account_id, user.id, date_from=from_date, date_to=to_date,
+ )
+ if history is None:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+ return history
+
+
[email protected]("/{account_id}", response_model=AccountRead)
+async def get_account(
+ account_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ account = await account_service.get_account(session, account_id, user.id)
+ if not account:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+ return account
+
+
[email protected]("", response_model=AccountRead, status_code=status.HTTP_201_CREATED)
+async def create_account(
+ data: AccountCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await account_service.create_account(session, user.id, data)
+
+
[email protected]("/{account_id}", response_model=AccountRead)
+async def update_account(
+ account_id: uuid.UUID,
+ data: AccountUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ account = await account_service.update_account(session, account_id, user.id, data)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+ if not account:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+ return account
+
+
[email protected]("/{account_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_account(
+ account_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ deleted = await account_service.delete_account(session, account_id, user.id)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+ if not deleted:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+
+
[email protected]("/{account_id}/close", response_model=AccountRead)
+async def close_account(
+ account_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ account = await account_service.close_account(session, account_id, user.id)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+ if not account:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+ return account
+
+
[email protected]("/{account_id}/reopen", response_model=AccountRead)
+async def reopen_account(
+ account_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ account = await account_service.reopen_account(session, account_id, user.id)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+ if not account:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+ return account
diff --git a/backend/app/api/budgets.py b/backend/app/api/budgets.py
new file mode 100644
index 00000000..d135e6b2
--- /dev/null
+++ b/backend/app/api/budgets.py
@@ -0,0 +1,68 @@
+import uuid
+from datetime import date
+from typing import Optional
+
+from fastapi import APIRouter, Depends, HTTPException, Query, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.budget import BudgetCreate, BudgetRead, BudgetUpdate, BudgetVsActual
+from app.services import budget_service
+
+router = APIRouter(prefix="/api/budgets", tags=["budgets"])
+
+
[email protected]("", response_model=list[BudgetRead])
+async def list_budgets(
+ month: Optional[date] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await budget_service.get_budgets(session, user.id, month)
+
+
[email protected]("", response_model=BudgetRead, status_code=status.HTTP_201_CREATED)
+async def create_budget(
+ data: BudgetCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ return await budget_service.create_budget(session, user.id, data)
+ except Exception as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+
+
[email protected]("/{budget_id}", response_model=BudgetRead)
+async def update_budget(
+ budget_id: uuid.UUID,
+ data: BudgetUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ budget = await budget_service.update_budget(session, budget_id, user.id, data)
+ if not budget:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Budget not found")
+ return budget
+
+
[email protected]("/{budget_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_budget(
+ budget_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await budget_service.delete_budget(session, budget_id, user.id)
+ if not deleted:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Budget not found")
+
+
[email protected]("/comparison", response_model=list[BudgetVsActual])
+async def budget_comparison(
+ month: Optional[date] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await budget_service.get_budget_vs_actual(session, user.id, month)
diff --git a/backend/app/api/categories.py b/backend/app/api/categories.py
new file mode 100644
index 00000000..d098fe49
--- /dev/null
+++ b/backend/app/api/categories.py
@@ -0,0 +1,61 @@
+import uuid
+
+from fastapi import APIRouter, Depends, HTTPException, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.category import CategoryCreate, CategoryRead, CategoryUpdate
+from app.services import category_service
+
+router = APIRouter(prefix="/api/categories", tags=["categories"])
+
+
[email protected]("", response_model=list[CategoryRead])
+async def list_categories(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ categories = await category_service.get_categories(session, user.id)
+ if not categories:
+ # Create default categories for new users in the user's preferred language
+ lang = (user.preferences or {}).get("language", "pt-BR")
+ categories = await category_service.create_default_categories(session, user.id, lang)
+ return categories
+
+
[email protected]("", response_model=CategoryRead, status_code=status.HTTP_201_CREATED)
+async def create_category(
+ data: CategoryCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await category_service.create_category(session, user.id, data)
+
+
[email protected]("/{category_id}", response_model=CategoryRead)
+async def update_category(
+ category_id: uuid.UUID,
+ data: CategoryUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ category = await category_service.update_category(session, category_id, user.id, data)
+ if not category:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Category not found")
+ return category
+
+
[email protected]("/{category_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_category(
+ category_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await category_service.delete_category(session, category_id, user.id)
+ if not deleted:
+ raise HTTPException(
+ status_code=status.HTTP_400_BAD_REQUEST,
+ detail="Category not found or is a system category",
+ )
diff --git a/backend/app/api/category_groups.py b/backend/app/api/category_groups.py
new file mode 100644
index 00000000..18a809dd
--- /dev/null
+++ b/backend/app/api/category_groups.py
@@ -0,0 +1,62 @@
+import uuid
+
+from fastapi import APIRouter, Depends, HTTPException, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.category_group import CategoryGroupCreate, CategoryGroupRead, CategoryGroupUpdate
+from app.services import category_group_service, category_service
+
+router = APIRouter(prefix="/api/category-groups", tags=["category-groups"])
+
+
[email protected]("", response_model=list[CategoryGroupRead])
+async def list_groups(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ groups = await category_group_service.get_groups(session, user.id)
+ if not groups:
+ # Create default categories + groups for new users in the user's preferred language
+ lang = (user.preferences or {}).get("language", "pt-BR")
+ await category_service.create_default_categories(session, user.id, lang)
+ groups = await category_group_service.get_groups(session, user.id)
+ return groups
+
+
[email protected]("", response_model=CategoryGroupRead, status_code=status.HTTP_201_CREATED)
+async def create_group(
+ data: CategoryGroupCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await category_group_service.create_group(session, user.id, data)
+
+
[email protected]("/{group_id}", response_model=CategoryGroupRead)
+async def update_group(
+ group_id: uuid.UUID,
+ data: CategoryGroupUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ group = await category_group_service.update_group(session, group_id, user.id, data)
+ if not group:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Group not found")
+ return group
+
+
[email protected]("/{group_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_group(
+ group_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await category_group_service.delete_group(session, group_id, user.id)
+ if not deleted:
+ raise HTTPException(
+ status_code=status.HTTP_400_BAD_REQUEST,
+ detail="Group not found or is a system group",
+ )
diff --git a/backend/app/api/connections.py b/backend/app/api/connections.py
new file mode 100644
index 00000000..1f88eb55
--- /dev/null
+++ b/backend/app/api/connections.py
@@ -0,0 +1,184 @@
+import uuid
+
+from fastapi import APIRouter, Depends, HTTPException, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.providers import all_known_providers
+from app.schemas.bank_connection import (
+ BankConnectionRead,
+ OAuthUrlRequest,
+ OAuthUrlResponse,
+ OAuthCallbackRequest,
+ ConnectTokenRequest,
+ ConnectTokenResponse,
+ ReconnectTokenResponse,
+ ConnectionSettingsUpdate,
+)
+from app.services import connection_service
+from app.services.transfer_detection_service import detect_transfer_pairs, unlink_transfer_pair
+
+router = APIRouter(prefix="/api/connections", tags=["connections"])
+
+
[email protected]("/providers")
+async def get_available_providers():
+ """List all known open finance providers with configuration status."""
+ return {"providers": all_known_providers()}
+
+
[email protected]("/connect-token", response_model=ConnectTokenResponse)
+async def create_connect_token(
+ data: ConnectTokenRequest,
+ user: User = Depends(current_active_user),
+):
+ """Create a connect token for widget-based bank connection flows."""
+ try:
+ token_data = await connection_service.create_connect_token(data.provider, user.id)
+ return ConnectTokenResponse(**token_data)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+ except Exception as e:
+ raise HTTPException(
+ status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
+ detail=f"Failed to create connect token: {str(e)}",
+ )
+
+
[email protected]("", response_model=list[BankConnectionRead])
+async def list_connections(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await connection_service.get_connections(session, user.id)
+
+
[email protected]("/oauth/url", response_model=OAuthUrlResponse)
+async def get_oauth_url(
+ data: OAuthUrlRequest,
+ user: User = Depends(current_active_user),
+):
+ try:
+ url = connection_service.get_oauth_url(data.provider, user.id)
+ return OAuthUrlResponse(url=url)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+
+
[email protected]("/oauth/callback", response_model=BankConnectionRead)
+async def oauth_callback(
+ data: OAuthCallbackRequest,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ connection = await connection_service.handle_oauth_callback(
+ session, user.id, data.code, data.provider
+ )
+ return connection
+ except Exception as e:
+ raise HTTPException(
+ status_code=status.HTTP_400_BAD_REQUEST,
+ detail=f"Failed to connect: {str(e)}",
+ )
+
+
[email protected]("/{connection_id}/sync")
+async def sync_connection(
+ connection_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ connection, merged_count = await connection_service.sync_connection(session, connection_id, user.id)
+ result = BankConnectionRead.model_validate(connection)
+ return {**result.model_dump(mode="json"), "merged_count": merged_count}
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e))
+ except Exception as e:
+ raise HTTPException(
+ status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
+ detail=f"Sync failed: {str(e)}",
+ )
+
+
[email protected]("/{connection_id}/reconnect-token", response_model=ReconnectTokenResponse)
+async def get_reconnect_token(
+ connection_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ """Get a connect token for reconnecting an errored/expired connection."""
+ connection = await connection_service.get_connection(session, connection_id, user.id)
+ if not connection:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Connection not found")
+
+ item_id = connection.credentials.get("item_id") if connection.credentials else None
+ if not item_id:
+ raise HTTPException(
+ status_code=status.HTTP_400_BAD_REQUEST,
+ detail="Connection has no item_id for reconnection",
+ )
+
+ try:
+ token_data = await connection_service.create_connect_token(
+ connection.provider, user.id, item_id=item_id
+ )
+ return ReconnectTokenResponse(**token_data)
+ except Exception as e:
+ raise HTTPException(
+ status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
+ detail=f"Failed to create reconnect token: {str(e)}",
+ )
+
+
[email protected]("/{connection_id}/settings", response_model=BankConnectionRead)
+async def update_settings(
+ connection_id: uuid.UUID,
+ data: ConnectionSettingsUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ connection = await connection_service.update_connection_settings(
+ session, connection_id, user.id, data.model_dump(exclude_unset=True)
+ )
+ if not connection:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Connection not found")
+ return connection
+
+
[email protected]("/{connection_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_connection(
+ connection_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await connection_service.delete_connection(session, connection_id, user.id)
+ if not deleted:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Connection not found")
+
+
[email protected]("/transfers/detect")
+async def detect_transfers(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ """One-time backfill scan: detect transfer pairs across all existing transactions."""
+ pairs_created = await detect_transfer_pairs(session, user.id)
+ await session.commit()
+ return {"pairs_created": pairs_created}
+
+
[email protected]("/transfers/{pair_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def unlink_transfer(
+ pair_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ """Manual unlink: remove a transfer pair link so both transactions are treated normally."""
+ unlinked = await unlink_transfer_pair(session, user.id, pair_id)
+ if not unlinked:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Transfer pair not found")
+ await session.commit()
diff --git a/backend/app/api/dashboard.py b/backend/app/api/dashboard.py
new file mode 100644
index 00000000..56e4f47d
--- /dev/null
+++ b/backend/app/api/dashboard.py
@@ -0,0 +1,59 @@
+from datetime import date
+from typing import Optional
+
+from fastapi import APIRouter, Depends, Query
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.dashboard import DashboardSummary, SpendingByCategory, MonthlyTrend, ProjectedTransaction, BalanceHistory
+from app.services import dashboard_service
+
+router = APIRouter(prefix="/api/dashboard", tags=["dashboard"])
+
+
[email protected]("/summary", response_model=DashboardSummary)
+async def get_summary(
+ month: Optional[date] = Query(None),
+ balance_date: Optional[date] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await dashboard_service.get_summary(session, user.id, month, balance_date)
+
+
[email protected]("/spending-by-category", response_model=list[SpendingByCategory])
+async def get_spending_by_category(
+ month: Optional[date] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await dashboard_service.get_spending_by_category(session, user.id, month)
+
+
[email protected]("/monthly-trend", response_model=list[MonthlyTrend])
+async def get_monthly_trend(
+ months: int = Query(6, ge=1, le=12),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await dashboard_service.get_monthly_trend(session, user.id, months)
+
+
[email protected]("/balance-history", response_model=BalanceHistory)
+async def get_balance_history(
+ month: Optional[date] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await dashboard_service.get_balance_history(session, user.id, month)
+
+
[email protected]("/projected-transactions", response_model=list[ProjectedTransaction])
+async def get_projected_transactions(
+ month: Optional[date] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await dashboard_service.get_projected_transactions(session, user.id, month)
diff --git a/backend/app/api/import_logs.py b/backend/app/api/import_logs.py
new file mode 100644
index 00000000..240eb74e
--- /dev/null
+++ b/backend/app/api/import_logs.py
@@ -0,0 +1,66 @@
+from fastapi import APIRouter, Depends, HTTPException, status
+from sqlalchemy import delete, select
+from sqlalchemy.ext.asyncio import AsyncSession
+from sqlalchemy.orm import joinedload
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.import_log import ImportLog
+from app.models.transaction import Transaction
+from app.models.user import User
+from app.schemas.import_log import ImportLogRead
+
+router = APIRouter(prefix="/api/import-logs", tags=["import-logs"])
+
+
[email protected]("", response_model=list[ImportLogRead])
+async def list_import_logs(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ result = await session.execute(
+ select(ImportLog)
+ .options(joinedload(ImportLog.account))
+ .where(ImportLog.user_id == user.id)
+ .order_by(ImportLog.created_at.desc())
+ )
+ logs = result.scalars().unique().all()
+ return [
+ ImportLogRead(
+ id=log.id,
+ user_id=log.user_id,
+ account_id=log.account_id,
+ account_name=log.account.name if log.account else None,
+ filename=log.filename,
+ format=log.format,
+ transaction_count=log.transaction_count,
+ total_credit=log.total_credit,
+ total_debit=log.total_debit,
+ created_at=log.created_at,
+ )
+ for log in logs
+ ]
+
+
[email protected]("/{import_log_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_import_log(
+ import_log_id: str,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ import uuid as _uuid
+ log_id = _uuid.UUID(import_log_id)
+
+ result = await session.execute(
+ select(ImportLog).where(ImportLog.id == log_id, ImportLog.user_id == user.id)
+ )
+ log = result.scalar_one_or_none()
+ if not log:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Import log not found")
+
+ # Delete all transactions from this import
+ await session.execute(
+ delete(Transaction).where(Transaction.import_id == log_id)
+ )
+ await session.delete(log)
+ await session.commit()
diff --git a/backend/app/api/import_transactions.py b/backend/app/api/import_transactions.py
new file mode 100644
index 00000000..3bd9e7e9
--- /dev/null
+++ b/backend/app/api/import_transactions.py
@@ -0,0 +1,88 @@
+from typing import Optional
+
+from fastapi import APIRouter, Depends, File, Form, HTTPException, UploadFile, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.transaction import TransactionImportPreview, TransactionImportRequest
+from app.services import import_service
+from app.services import account_service
+
+router = APIRouter(prefix="/api/transactions", tags=["import"])
+
+
[email protected]("/import/preview", response_model=TransactionImportPreview)
+async def preview_import(
+ file: UploadFile = File(...),
+ date_format: Optional[str] = Form(None),
+ flip_amount: bool = Form(False),
+ inflow_column: Optional[str] = Form(None),
+ outflow_column: Optional[str] = Form(None),
+ user: User = Depends(current_active_user),
+):
+ content = await file.read()
+ filename = file.filename or ""
+
+ try:
+ if filename.lower().endswith('.ofx') or filename.lower().endswith('.qfx'):
+ transactions = import_service.parse_ofx(content)
+ detected_format = "ofx"
+ elif filename.lower().endswith('.qif'):
+ transactions = import_service.parse_qif(content)
+ detected_format = "qif"
+ elif filename.lower().endswith('.xml') or filename.lower().endswith('.camt'):
+ transactions = import_service.parse_camt(content)
+ detected_format = "camt"
+ elif filename.lower().endswith('.csv'):
+ transactions = import_service.parse_csv(
+ content,
+ date_format=date_format,
+ flip_amount=flip_amount,
+ inflow_column=inflow_column,
+ outflow_column=outflow_column,
+ )
+ detected_format = "csv"
+ else:
+ # Try to detect format
+ try:
+ transactions = import_service.parse_ofx(content)
+ detected_format = "ofx"
+ except Exception:
+ try:
+ transactions = import_service.parse_qif(content)
+ detected_format = "qif"
+ except Exception:
+ try:
+ transactions = import_service.parse_camt(content)
+ detected_format = "camt"
+ except Exception:
+ transactions = import_service.parse_csv(content)
+ detected_format = "csv"
+ except Exception as e:
+ raise HTTPException(
+ status_code=status.HTTP_400_BAD_REQUEST,
+ detail=f"Failed to parse file: {str(e)}",
+ )
+
+ return TransactionImportPreview(transactions=transactions, detected_format=detected_format)
+
+
[email protected]("/import", status_code=status.HTTP_201_CREATED)
+async def import_transactions(
+ data: TransactionImportRequest,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ # Verify account belongs to user
+ account = await account_service.get_account(session, data.account_id, user.id)
+ if not account:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Account not found")
+
+ imported, skipped, import_log_id = await import_service.import_transactions(
+ session, user.id, data.account_id, data.transactions, "import",
+ filename=data.filename, detected_format=data.detected_format,
+ )
+
+ return {"imported": imported, "skipped": skipped, "import_log_id": str(import_log_id)}
diff --git a/backend/app/api/recurring_transactions.py b/backend/app/api/recurring_transactions.py
new file mode 100644
index 00000000..83a1e008
--- /dev/null
+++ b/backend/app/api/recurring_transactions.py
@@ -0,0 +1,68 @@
+import uuid
+
+from fastapi import APIRouter, Depends, HTTPException, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.recurring_transaction import (
+ RecurringTransactionCreate,
+ RecurringTransactionRead,
+ RecurringTransactionUpdate,
+)
+from app.services import recurring_transaction_service
+
+router = APIRouter(prefix="/api/recurring-transactions", tags=["recurring-transactions"])
+
+
[email protected]("", response_model=list[RecurringTransactionRead])
+async def list_recurring_transactions(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await recurring_transaction_service.get_recurring_transactions(session, user.id)
+
+
[email protected]("", response_model=RecurringTransactionRead, status_code=status.HTTP_201_CREATED)
+async def create_recurring_transaction(
+ data: RecurringTransactionCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ return await recurring_transaction_service.create_recurring_transaction(session, user.id, data)
+
+
[email protected]("/{recurring_id}", response_model=RecurringTransactionRead)
+async def update_recurring_transaction(
+ recurring_id: uuid.UUID,
+ data: RecurringTransactionUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ recurring = await recurring_transaction_service.update_recurring_transaction(
+ session, recurring_id, user.id, data
+ )
+ if not recurring:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Recurring transaction not found")
+ return recurring
+
+
[email protected]("/{recurring_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_recurring_transaction(
+ recurring_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await recurring_transaction_service.delete_recurring_transaction(session, recurring_id, user.id)
+ if not deleted:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Recurring transaction not found")
+
+
[email protected]("/generate")
+async def generate_recurring_transactions(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ count = await recurring_transaction_service.generate_pending(session, user.id)
+ return {"generated": count}
diff --git a/backend/app/api/rules.py b/backend/app/api/rules.py
new file mode 100644
index 00000000..d09ad243
--- /dev/null
+++ b/backend/app/api/rules.py
@@ -0,0 +1,114 @@
+import uuid
+
+from fastapi import APIRouter, Depends, HTTPException, status
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.rule import RuleCreate, RuleRead, RuleUpdate
+from app.services import rule_service
+from app.services.rule_service import DuplicateRuleError
+
+router = APIRouter(prefix="/api/rules", tags=["rules"])
+
+
[email protected]("", response_model=list[RuleRead])
+async def list_rules(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ rules = await rule_service.get_rules(session, user.id)
+ if not rules:
+ lang = (user.preferences or {}).get("language", "pt-BR")
+ rules = await rule_service.create_default_rules(session, user.id, lang)
+ rules = await rule_service.get_rules(session, user.id)
+ return rules
+
+
[email protected]("", response_model=RuleRead, status_code=status.HTTP_201_CREATED)
+async def create_rule(
+ data: RuleCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ return await rule_service.create_rule(session, user.id, data)
+ except DuplicateRuleError:
+ raise HTTPException(
+ status_code=status.HTTP_409_CONFLICT,
+ detail="A rule with this name already exists",
+ )
+
+
[email protected]("/{rule_id}", response_model=RuleRead)
+async def update_rule(
+ rule_id: uuid.UUID,
+ data: RuleUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ rule = await rule_service.update_rule(session, rule_id, user.id, data)
+ except DuplicateRuleError:
+ raise HTTPException(
+ status_code=status.HTTP_409_CONFLICT,
+ detail="A rule with this name already exists",
+ )
+ if not rule:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Rule not found")
+ return rule
+
+
[email protected]("/{rule_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_rule(
+ rule_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await rule_service.delete_rule(session, rule_id, user.id)
+ if not deleted:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Rule not found")
+
+
[email protected]("/packs", response_model=list[dict])
+async def list_rule_packs(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ """List available country-specific rule packs with installed status."""
+ installed_map = await rule_service.get_installed_packs(session, user.id)
+ packs = []
+ for code, pack in rule_service.RULE_PACKS.items():
+ packs.append({
+ "code": code,
+ "name": pack["name"],
+ "flag": pack["flag"],
+ "rule_count": len(pack["rules"]),
+ "installed": installed_map.get(code, False),
+ })
+ return packs
+
+
[email protected]("/packs/{pack_code}/install", response_model=dict)
+async def install_rule_pack(
+ pack_code: str,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ """Install a country-specific rule pack."""
+ if pack_code not in rule_service.RULE_PACKS:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Rule pack not found")
+ lang = (user.preferences or {}).get("language", "pt-BR")
+ rules = await rule_service.install_rule_pack(session, user.id, pack_code, lang)
+ return {"installed": len(rules)}
+
+
[email protected]("/apply-all", response_model=dict)
+async def apply_all_rules(
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ """Re-apply all active rules to all existing transactions."""
+ count = await rule_service.apply_all_rules(session, user.id)
+ return {"applied": count}
diff --git a/backend/app/api/setup.py b/backend/app/api/setup.py
new file mode 100644
index 00000000..4c8c5439
--- /dev/null
+++ b/backend/app/api/setup.py
@@ -0,0 +1,86 @@
+from decimal import Decimal
+
+from fastapi import APIRouter, Depends, HTTPException
+from pydantic import BaseModel, EmailStr
+from sqlalchemy import select, func, update as sql_update
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import get_jwt_strategy, get_user_manager, UserManager
+from app.core.database import get_async_session
+from app.models.account import Account
+from app.models.user import User
+
+router = APIRouter(prefix="/api/setup", tags=["setup"])
+
+
+class SetupStatus(BaseModel):
+ has_users: bool
+
+
+class CreateAdminRequest(BaseModel):
+ email: EmailStr
+ password: str
+ currency: str = "BRL"
+ name: str = ""
+ language: str = "pt-BR"
+
+
[email protected]("/status", response_model=SetupStatus)
+async def get_setup_status(session: AsyncSession = Depends(get_async_session)):
+ result = await session.execute(select(func.count(User.id)))
+ count = result.scalar() or 0
+ return SetupStatus(has_users=count > 0)
+
+
[email protected]("/create-admin")
+async def create_admin(
+ body: CreateAdminRequest,
+ session: AsyncSession = Depends(get_async_session),
+ user_manager: UserManager = Depends(get_user_manager),
+):
+ # Check if users already exist
+ result = await session.execute(select(func.count(User.id)))
+ count = result.scalar() or 0
+ if count > 0:
+ raise HTTPException(status_code=403, detail="Setup already completed")
+
+ from fastapi_users import schemas
+
+ user_create = schemas.BaseUserCreate(
+ email=body.email,
+ password=body.password,
+ is_superuser=True,
+ )
+ user = await user_manager.create(user_create)
+
+ # Build preferences dict
+ prefs = {"currency_display": body.currency, "language": body.language}
+ if body.name:
+ prefs["display_name"] = body.name
+
+ # Use direct SQL update to avoid session expiry issues after user_manager.create() commits
+ db_session = user_manager.user_db.session
+ await db_session.execute(
+ sql_update(User).where(User.id == user.id).values(preferences=prefs)
+ )
+
+ # Create default wallet with the chosen currency
+ wallet_name = "Carteira" if body.language.startswith("pt") else "Wallet"
+ wallet = Account(
+ user_id=user.id,
+ name=wallet_name,
+ type="checking",
+ balance=Decimal("0.00"),
+ currency=body.currency,
+ )
+ db_session.add(wallet)
+ await db_session.commit()
+
+ # Refresh user to get updated preferences for token generation
+ await db_session.refresh(user)
+
+ # Generate access token
+ strategy = get_jwt_strategy()
+ token = await strategy.write_token(user)
+
+ return {"access_token": token, "token_type": "bearer"}
diff --git a/backend/app/api/transactions.py b/backend/app/api/transactions.py
new file mode 100644
index 00000000..d3eea40d
--- /dev/null
+++ b/backend/app/api/transactions.py
@@ -0,0 +1,153 @@
+import csv
+import io
+import uuid
+from datetime import date
+from typing import Optional
+
+from fastapi import APIRouter, Depends, HTTPException, Query, status
+from fastapi.responses import StreamingResponse
+from pydantic import BaseModel
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.auth import current_active_user
+from app.core.database import get_async_session
+from app.models.user import User
+from app.schemas.transaction import BulkCategorizeRequest, TransactionCreate, TransactionRead, TransactionUpdate
+from app.services import transaction_service
+
+router = APIRouter(prefix="/api/transactions", tags=["transactions"])
+
+
+class PaginatedTransactions(BaseModel):
+ items: list[TransactionRead]
+ total: int
+ page: int
+ limit: int
+
+
[email protected]("", response_model=PaginatedTransactions)
+async def list_transactions(
+ account_id: Optional[uuid.UUID] = Query(None),
+ category_id: Optional[uuid.UUID] = Query(None),
+ from_date: Optional[date] = Query(None, alias="from"),
+ to_date: Optional[date] = Query(None, alias="to"),
+ q: Optional[str] = Query(None),
+ uncategorized: bool = Query(False),
+ type: Optional[str] = Query(None),
+ page: int = Query(1, ge=1),
+ limit: int = Query(50, ge=1, le=500),
+ include_opening_balance: bool = Query(False),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ transactions, total = await transaction_service.get_transactions(
+ session, user.id, account_id, category_id, from_date, to_date, page, limit,
+ include_opening_balance, search=q, uncategorized=uncategorized, txn_type=type,
+ )
+ return PaginatedTransactions(items=transactions, total=total, page=page, limit=limit)
+
+
+async def export_transactions(
+ account_id: Optional[uuid.UUID] = Query(None),
+ category_id: Optional[uuid.UUID] = Query(None),
+ from_date: Optional[date] = Query(None, alias="from"),
+ to_date: Optional[date] = Query(None, alias="to"),
+ q: Optional[str] = Query(None),
+ uncategorized: bool = Query(False),
+ type: Optional[str] = Query(None),
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ transactions, _ = await transaction_service.get_transactions(
+ session, user.id, account_id, category_id, from_date, to_date,
+ search=q, uncategorized=uncategorized, txn_type=type, skip_pagination=True,
+ )
+
+ output = io.StringIO()
+ output.write("\ufeff") # UTF-8 BOM for Excel
+ writer = csv.writer(output)
+ writer.writerow(["date", "description", "amount", "type", "currency", "category", "account", "payee", "notes", "status", "source"])
+ for tx in transactions:
+ writer.writerow([
+ tx.date.isoformat(),
+ tx.description,
+ str(tx.amount),
+ tx.type,
+ tx.currency,
+ tx.category.name if tx.category else "",
+ tx.account.name if tx.account else "",
+ tx.payee or "",
+ tx.notes or "",
+ tx.status,
+ tx.source,
+ ])
+
+ output.seek(0)
+ today = date.today().isoformat()
+ return StreamingResponse(
+ iter([output.getvalue()]),
+ media_type="text/csv",
+ headers={"Content-Disposition": f'attachment; filename="transactions-{today}.csv"'},
+ )
+
+
[email protected]("/bulk-categorize")
+async def bulk_categorize(
+ data: BulkCategorizeRequest,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ count = await transaction_service.bulk_update_category(
+ session, user.id, data.transaction_ids, data.category_id
+ )
+ return {"updated": count}
+
+
[email protected]("/{transaction_id}", response_model=TransactionRead)
+async def get_transaction(
+ transaction_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ transaction = await transaction_service.get_transaction(session, transaction_id, user.id)
+ if not transaction:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Transaction not found")
+ return transaction
+
+
[email protected]("", response_model=TransactionRead, status_code=status.HTTP_201_CREATED)
+async def create_transaction(
+ data: TransactionCreate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ try:
+ transaction = await transaction_service.create_transaction(session, user.id, data)
+ return await transaction_service.get_transaction(session, transaction.id, user.id)
+ except ValueError as e:
+ raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e))
+
+
[email protected]("/{transaction_id}", response_model=TransactionRead)
+async def update_transaction(
+ transaction_id: uuid.UUID,
+ data: TransactionUpdate,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ transaction = await transaction_service.update_transaction(session, transaction_id, user.id, data)
+ if not transaction:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Transaction not found")
+ return transaction
+
+
[email protected]("/{transaction_id}", status_code=status.HTTP_204_NO_CONTENT)
+async def delete_transaction(
+ transaction_id: uuid.UUID,
+ session: AsyncSession = Depends(get_async_session),
+ user: User = Depends(current_active_user),
+):
+ deleted = await transaction_service.delete_transaction(session, transaction_id, user.id)
+ if not deleted:
+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Transaction not found")
diff --git a/backend/app/cli.py b/backend/app/cli.py
new file mode 100644
index 00000000..3b20a581
--- /dev/null
+++ b/backend/app/cli.py
@@ -0,0 +1,85 @@
+"""CLI commands for managing the application."""
+import asyncio
+import sys
+import uuid
+
+from sqlalchemy import select
+
+from app.core.database import async_session_maker
+from app.models.user import User
+
+
+async def generate_recurring() -> None:
+ """Generate pending recurring transactions for all users."""
+ from app.models.user import User as UserModel
+ from app.services import recurring_transaction_service
+
+ async with async_session_maker() as session:
+ result = await session.execute(select(UserModel))
+ users = result.scalars().all()
+ total = 0
+ for user in users:
+ count = await recurring_transaction_service.generate_pending(session, user.id)
+ if count > 0:
+ print(f"Generated {count} transactions for {user.email}")
+ total += count
+ print(f"Total generated: {total}")
+
+
+async def create_user(email: str, password: str) -> None:
+ """Create a new user with the given email and password."""
+ from pwdlib import PasswordHash
+
+ hasher = PasswordHash.recommended()
+
+ async with async_session_maker() as session:
+ # Check if user already exists
+ result = await session.execute(select(User).where(User.email == email))
+ existing = result.scalar_one_or_none()
+ if existing:
+ print(f"Error: User with email '{email}' already exists.")
+ sys.exit(1)
+
+ user = User(
+ id=uuid.uuid4(),
+ email=email,
+ hashed_password=hasher.hash(password),
+ is_active=True,
+ is_superuser=False,
+ is_verified=True,
+ preferences={
+ "language": "pt-BR",
+ "date_format": "DD/MM/YYYY",
+ "timezone": "America/Sao_Paulo",
+ "currency_display": "BRL",
+ },
+ )
+ session.add(user)
+ await session.commit()
+ print(f"User created successfully: {email}")
+
+
+def main() -> None:
+ if len(sys.argv) < 2:
+ print("Usage:")
+ print(" python -m app.cli create-user <email> <password>")
+ sys.exit(1)
+
+ command = sys.argv[1]
+
+ if command == "create-user":
+ if len(sys.argv) != 4:
+ print("Usage: python -m app.cli create-user <email> <password>")
+ sys.exit(1)
+ email, password = sys.argv[2], sys.argv[3]
+ asyncio.run(create_user(email, password))
+ elif command == "generate-recurring":
+ asyncio.run(generate_recurring())
+ else:
+ print(f"Unknown command: {command}")
+ print("Available commands: create-user, generate-recurring")
+ sys.exit(1)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/backend/app/core/__init__.py b/backend/app/core/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/app/core/auth.py b/backend/app/core/auth.py
new file mode 100644
index 00000000..0f106a16
--- /dev/null
+++ b/backend/app/core/auth.py
@@ -0,0 +1,75 @@
+import uuid
+from decimal import Decimal
+from typing import Optional
+
+from fastapi import Depends, Request
+from fastapi_users import BaseUserManager, FastAPIUsers, UUIDIDMixin
+from fastapi_users.authentication import (
+ AuthenticationBackend,
+ BearerTransport,
+ JWTStrategy,
+)
+from fastapi_users.db import SQLAlchemyUserDatabase
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.core.config import get_settings
+from app.core.database import get_async_session
+from app.models.user import User
+
+settings = get_settings()
+
+
+async def get_user_db(session: AsyncSession = Depends(get_async_session)):
+ yield SQLAlchemyUserDatabase(session, User)
+
+
+class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]):
+ reset_password_token_secret = settings.secret_key
+ verification_token_secret = settings.secret_key
+
+ async def on_after_register(self, user: User, request: Optional[Request] = None):
+ print(f"User {user.id} has registered.")
+ # If request is None, this was called programmatically (e.g., from setup endpoint)
+ # which handles wallet creation and preferences itself.
+ if request is None:
+ return
+ # Create default wallet for users registered via /auth/register.
+ from app.models.account import Account
+ session = self.user_db.session
+ currency = (user.preferences or {}).get("currency_display", "BRL")
+ lang = (user.preferences or {}).get("language", "en")
+ wallet_name = "Carteira" if lang.startswith("pt") else "Wallet"
+ wallet = Account(
+ user_id=user.id,
+ name=wallet_name,
+ type="checking",
+ balance=Decimal("0.00"),
+ currency=currency,
+ )
+ session.add(wallet)
+ await session.commit()
+
+
+async def get_user_manager(user_db: SQLAlchemyUserDatabase = Depends(get_user_db)):
+ yield UserManager(user_db)
+
+
+bearer_transport = BearerTransport(tokenUrl="api/auth/login")
+
+
+def get_jwt_strategy() -> JWTStrategy:
+ return JWTStrategy(
+ secret=settings.secret_key,
+ lifetime_seconds=settings.access_token_expire_minutes * 60,
+ )
+
+
+auth_backend = AuthenticationBackend(
+ name="jwt",
+ transport=bearer_transport,
+ get_strategy=get_jwt_strategy,
+)
+
+fastapi_users = FastAPIUsers[User, uuid.UUID](get_user_manager, [auth_backend])
+
+current_active_user = fastapi_users.current_user(active=True)
diff --git a/backend/app/core/config.py b/backend/app/core/config.py
new file mode 100644
index 00000000..a377f9df
--- /dev/null
+++ b/backend/app/core/config.py
@@ -0,0 +1,34 @@
+from pydantic_settings import BaseSettings, SettingsConfigDict
+from functools import lru_cache
+
+
+class Settings(BaseSettings):
+ # App
+ app_name: str = "Securo"
+ debug: bool = False
+
+ # Database
+ database_url: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/securo"
+
+ # Auth
+ secret_key: str = "change-me-in-production"
+ algorithm: str = "HS256"
+ access_token_expire_minutes: int = 60 * 24 * 7 # 7 days
+
+ # Pluggy
+ pluggy_client_id: str = ""
+ pluggy_client_secret: str = ""
+ pluggy_oauth_redirect_uri: str = "http://localhost:5173/oauth/callback"
+
+ # Frontend
+ frontend_url: str = "http://localhost:5173"
+
+ # Celery
+ redis_url: str = "redis://localhost:6379/0"
+
+ model_config = SettingsConfigDict(env_file=".env")
+
+
+@lru_cache
+def get_settings() -> Settings:
+ return Settings()
diff --git a/backend/app/core/database.py b/backend/app/core/database.py
new file mode 100644
index 00000000..25c591ff
--- /dev/null
+++ b/backend/app/core/database.py
@@ -0,0 +1,18 @@
+from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine, async_sessionmaker
+from sqlalchemy.orm import DeclarativeBase
+
+from app.core.config import get_settings
+
+settings = get_settings()
+
+engine = create_async_engine(settings.database_url, echo=settings.debug)
+async_session_maker = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
+
+
+class Base(DeclarativeBase):
+ pass
+
+
+async def get_async_session() -> AsyncSession:
+ async with async_session_maker() as session:
+ yield session
diff --git a/backend/app/main.py b/backend/app/main.py
new file mode 100644
index 00000000..84d36e32
--- /dev/null
+++ b/backend/app/main.py
@@ -0,0 +1,94 @@
+import logging
+from contextlib import asynccontextmanager
+
+from fastapi import FastAPI
+from fastapi.middleware.cors import CORSMiddleware
+
+from app.api.accounts import router as accounts_router
+from app.api.budgets import router as budgets_router
+from app.api.categories import router as categories_router
+from app.api.category_groups import router as category_groups_router
+from app.api.connections import router as connections_router
+from app.api.dashboard import router as dashboard_router
+from app.api.import_logs import router as import_logs_router
+from app.api.import_transactions import router as import_router
+from app.api.recurring_transactions import router as recurring_router
+from app.api.rules import router as rules_router
+from app.api.setup import router as setup_router
+from app.api.transactions import router as transactions_router
+from app.core.auth import auth_backend, fastapi_users
+from app.core.config import get_settings
+from app.schemas.user import UserCreate, UserRead, UserUpdate
+
+logger = logging.getLogger(__name__)
+settings = get_settings()
+
+
+@asynccontextmanager
+async def lifespan(app: FastAPI):
+ # Startup: dispatch sync for all stale bank connections
+ try:
+ from app.worker import celery_app # noqa: F811
+
+ celery_app.send_task("app.tasks.sync_tasks.sync_all_connections")
+ logger.info("Startup: dispatched sync_all_connections task to Celery")
+ except Exception:
+ logger.exception("Startup: failed to dispatch sync task")
+ yield
+
+
+app = FastAPI(
+ title=settings.app_name,
+ openapi_url="/api/openapi.json",
+ docs_url="/api/docs",
+ lifespan=lifespan,
+)
+
+app.add_middleware(
+ CORSMiddleware,
+ allow_origins=[settings.frontend_url],
+ allow_credentials=True,
+ allow_methods=["*"],
+ allow_headers=["*"],
+)
+
+# Auth routes
+app.include_router(
+ fastapi_users.get_auth_router(auth_backend),
+ prefix="/api/auth",
+ tags=["auth"],
+)
+app.include_router(
+ fastapi_users.get_register_router(UserRead, UserCreate),
+ prefix="/api/auth",
+ tags=["auth"],
+)
+app.include_router(
+ fastapi_users.get_reset_password_router(),
+ prefix="/api/auth",
+ tags=["auth"],
+)
+app.include_router(
+ fastapi_users.get_users_router(UserRead, UserUpdate),
+ prefix="/api/users",
+ tags=["users"],
+)
+
+# Domain routes
+app.include_router(categories_router)
+app.include_router(category_groups_router)
+app.include_router(rules_router)
+app.include_router(transactions_router)
+app.include_router(import_router)
+app.include_router(import_logs_router)
+app.include_router(accounts_router)
+app.include_router(connections_router)
+app.include_router(recurring_router)
+app.include_router(budgets_router)
+app.include_router(dashboard_router)
+app.include_router(setup_router)
+
+
[email protected]("/api/health")
+async def health_check():
+ return {"status": "healthy"}
diff --git a/backend/app/models/__init__.py b/backend/app/models/__init__.py
new file mode 100644
index 00000000..fda8af1d
--- /dev/null
+++ b/backend/app/models/__init__.py
@@ -0,0 +1,23 @@
+from app.models.user import User
+from app.models.category import Category
+from app.models.category_group import CategoryGroup
+from app.models.bank_connection import BankConnection
+from app.models.account import Account
+from app.models.transaction import Transaction
+from app.models.rule import Rule
+from app.models.recurring_transaction import RecurringTransaction
+from app.models.budget import Budget
+from app.models.import_log import ImportLog
+
+__all__ = [
+ "User",
+ "Category",
+ "CategoryGroup",
+ "BankConnection",
+ "Account",
+ "Transaction",
+ "Rule",
+ "RecurringTransaction",
+ "Budget",
+ "ImportLog",
+]
diff --git a/backend/app/models/account.py b/backend/app/models/account.py
new file mode 100644
index 00000000..8443428b
--- /dev/null
+++ b/backend/app/models/account.py
@@ -0,0 +1,32 @@
+import uuid
+from datetime import datetime
+from decimal import Decimal
+from typing import TYPE_CHECKING, Optional
+
+from sqlalchemy import Boolean, DateTime, ForeignKey, Numeric, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.bank_connection import BankConnection
+ from app.models.transaction import Transaction
+
+
+class Account(Base):
+ __tablename__ = "accounts"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ connection_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), ForeignKey("bank_connections.id"), nullable=True)
+ external_id: Mapped[Optional[str]] = mapped_column(String(255), nullable=True)
+ name: Mapped[str] = mapped_column(String(255))
+ type: Mapped[str] = mapped_column(String(50)) # checking, savings, credit_card
+ balance: Mapped[Decimal] = mapped_column(Numeric(precision=15, scale=2), default=Decimal("0.00"))
+ currency: Mapped[str] = mapped_column(String(3), default="BRL")
+ is_closed: Mapped[bool] = mapped_column(Boolean, default=False)
+ closed_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), nullable=True)
+
+ connection: Mapped[Optional["BankConnection"]] = relationship(back_populates="accounts")
+ transactions: Mapped[list["Transaction"]] = relationship(back_populates="account", cascade="all, delete-orphan")
diff --git a/backend/app/models/bank_connection.py b/backend/app/models/bank_connection.py
new file mode 100644
index 00000000..76701670
--- /dev/null
+++ b/backend/app/models/bank_connection.py
@@ -0,0 +1,31 @@
+import uuid
+from datetime import datetime, timezone
+from typing import TYPE_CHECKING, Optional
+
+from sqlalchemy import DateTime, ForeignKey, JSON, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.user import User
+ from app.models.account import Account
+
+
+class BankConnection(Base):
+ __tablename__ = "bank_connections"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ provider: Mapped[str] = mapped_column(String(50)) # "pluggy", "belvo", etc.
+ external_id: Mapped[str] = mapped_column(String(255)) # Provider's item ID
+ institution_name: Mapped[str] = mapped_column(String(255))
+ credentials: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True) # Encrypted tokens
+ settings: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True, default=dict)
+ status: Mapped[str] = mapped_column(String(50), default="active") # active, error, expired
+ last_sync_at: Mapped[Optional[datetime]] = mapped_column(DateTime(timezone=True), nullable=True)
+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
+
+ user: Mapped["User"] = relationship(back_populates="bank_connections")
+ accounts: Mapped[list["Account"]] = relationship(back_populates="connection", cascade="all, delete-orphan")
diff --git a/backend/app/models/budget.py b/backend/app/models/budget.py
new file mode 100644
index 00000000..9dc0dc0a
--- /dev/null
+++ b/backend/app/models/budget.py
@@ -0,0 +1,33 @@
+import uuid
+from datetime import date, datetime
+from decimal import Decimal
+from typing import TYPE_CHECKING
+
+from sqlalchemy import Boolean, Date, DateTime, ForeignKey, Numeric, UniqueConstraint
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+from sqlalchemy.sql import func
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.category import Category
+ from app.models.user import User
+
+
+class Budget(Base):
+ __tablename__ = "budgets"
+ __table_args__ = (
+ UniqueConstraint("user_id", "category_id", "month", "is_recurring", name="uq_budget_per_category_month_type"),
+ )
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ category_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("categories.id"))
+ amount: Mapped[Decimal] = mapped_column(Numeric(precision=15, scale=2))
+ month: Mapped[date] = mapped_column(Date) # First day of month
+ is_recurring: Mapped[bool] = mapped_column(Boolean, default=False, server_default="false")
+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
+
+ user: Mapped["User"] = relationship()
+ category: Mapped["Category"] = relationship()
diff --git a/backend/app/models/category.py b/backend/app/models/category.py
new file mode 100644
index 00000000..67015d67
--- /dev/null
+++ b/backend/app/models/category.py
@@ -0,0 +1,27 @@
+import uuid
+from typing import TYPE_CHECKING, Optional
+
+from sqlalchemy import Boolean, ForeignKey, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.category_group import CategoryGroup
+ from app.models.user import User
+
+
+class Category(Base):
+ __tablename__ = "categories"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ group_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), ForeignKey("category_groups.id"), nullable=True)
+ name: Mapped[str] = mapped_column(String(100))
+ icon: Mapped[str] = mapped_column(String(50), default="circle-help")
+ color: Mapped[str] = mapped_column(String(7), default="#6B7280")
+ is_system: Mapped[bool] = mapped_column(Boolean, default=False)
+
+ user: Mapped["User"] = relationship(back_populates="categories")
+ group: Mapped[Optional["CategoryGroup"]] = relationship(back_populates="categories")
diff --git a/backend/app/models/category_group.py b/backend/app/models/category_group.py
new file mode 100644
index 00000000..0267ca50
--- /dev/null
+++ b/backend/app/models/category_group.py
@@ -0,0 +1,27 @@
+import uuid
+from typing import TYPE_CHECKING
+
+from sqlalchemy import Boolean, ForeignKey, Integer, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.category import Category
+ from app.models.user import User
+
+
+class CategoryGroup(Base):
+ __tablename__ = "category_groups"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ name: Mapped[str] = mapped_column(String(100))
+ icon: Mapped[str] = mapped_column(String(50), default="folder")
+ color: Mapped[str] = mapped_column(String(7), default="#6B7280")
+ position: Mapped[int] = mapped_column(Integer, default=0)
+ is_system: Mapped[bool] = mapped_column(Boolean, default=False)
+
+ user: Mapped["User"] = relationship(back_populates="category_groups")
+ categories: Mapped[list["Category"]] = relationship(back_populates="group")
diff --git a/backend/app/models/import_log.py b/backend/app/models/import_log.py
new file mode 100644
index 00000000..c14689e9
--- /dev/null
+++ b/backend/app/models/import_log.py
@@ -0,0 +1,31 @@
+import uuid
+from datetime import datetime, timezone
+from decimal import Decimal
+from typing import TYPE_CHECKING, Optional
+
+from sqlalchemy import DateTime, ForeignKey, Integer, Numeric, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.account import Account
+ from app.models.transaction import Transaction
+
+
+class ImportLog(Base):
+ __tablename__ = "import_logs"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ account_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("accounts.id"))
+ filename: Mapped[str] = mapped_column(String(255))
+ format: Mapped[str] = mapped_column(String(10))
+ transaction_count: Mapped[int] = mapped_column(Integer)
+ total_credit: Mapped[Decimal] = mapped_column(Numeric(precision=15, scale=2), default=Decimal("0"))
+ total_debit: Mapped[Decimal] = mapped_column(Numeric(precision=15, scale=2), default=Decimal("0"))
+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
+
+ account: Mapped[Optional["Account"]] = relationship()
+ transactions: Mapped[list["Transaction"]] = relationship(back_populates="import_log")
diff --git a/backend/app/models/recurring_transaction.py b/backend/app/models/recurring_transaction.py
new file mode 100644
index 00000000..e35ecb1d
--- /dev/null
+++ b/backend/app/models/recurring_transaction.py
@@ -0,0 +1,43 @@
+import uuid
+from datetime import date, datetime
+from decimal import Decimal
+from typing import TYPE_CHECKING, Optional
+
+from sqlalchemy import Boolean, Date, DateTime, ForeignKey, Integer, Numeric, String, UniqueConstraint
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+from sqlalchemy.sql import func
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.account import Account
+ from app.models.category import Category
+ from app.models.user import User
+
+
+class RecurringTransaction(Base):
+ __tablename__ = "recurring_transactions"
+ __table_args__ = (
+ UniqueConstraint("user_id", "description", "frequency", "start_date", name="uq_recurring_tx"),
+ )
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ account_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), ForeignKey("accounts.id"), nullable=True)
+ category_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), ForeignKey("categories.id"), nullable=True)
+ description: Mapped[str] = mapped_column(String(500))
+ amount: Mapped[Decimal] = mapped_column(Numeric(precision=15, scale=2))
+ currency: Mapped[str] = mapped_column(String(3), default="BRL")
+ type: Mapped[str] = mapped_column(String(10)) # debit, credit
+ frequency: Mapped[str] = mapped_column(String(20)) # monthly, weekly, yearly
+ day_of_month: Mapped[Optional[int]] = mapped_column(Integer, nullable=True)
+ start_date: Mapped[date] = mapped_column(Date)
+ end_date: Mapped[Optional[date]] = mapped_column(Date, nullable=True)
+ is_active: Mapped[bool] = mapped_column(Boolean, default=True)
+ next_occurrence: Mapped[date] = mapped_column(Date)
+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
+
+ user: Mapped["User"] = relationship()
+ account: Mapped[Optional["Account"]] = relationship()
+ category: Mapped[Optional["Category"]] = relationship()
diff --git a/backend/app/models/rule.py b/backend/app/models/rule.py
new file mode 100644
index 00000000..48fe67ec
--- /dev/null
+++ b/backend/app/models/rule.py
@@ -0,0 +1,26 @@
+import uuid
+from typing import TYPE_CHECKING
+
+from sqlalchemy import Boolean, ForeignKey, Integer, JSON, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.user import User
+
+
+class Rule(Base):
+ __tablename__ = "rules"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ name: Mapped[str] = mapped_column(String(255))
+ conditions_op: Mapped[str] = mapped_column(String(3), default="and") # "and" | "or"
+ conditions: Mapped[list] = mapped_column(JSON, default=list)
+ actions: Mapped[list] = mapped_column(JSON, default=list)
+ priority: Mapped[int] = mapped_column(Integer, default=0)
+ is_active: Mapped[bool] = mapped_column(Boolean, default=True)
+
+ user: Mapped["User"] = relationship()
diff --git a/backend/app/models/transaction.py b/backend/app/models/transaction.py
new file mode 100644
index 00000000..9f1c485e
--- /dev/null
+++ b/backend/app/models/transaction.py
@@ -0,0 +1,42 @@
+import uuid
+from datetime import date, datetime, timezone
+from decimal import Decimal
+from typing import TYPE_CHECKING, Optional
+
+from sqlalchemy import Date, DateTime, ForeignKey, JSON, Numeric, String
+from sqlalchemy.dialects.postgresql import UUID
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.account import Account
+ from app.models.category import Category
+ from app.models.import_log import ImportLog
+
+
+class Transaction(Base):
+ __tablename__ = "transactions"
+
+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
+ user_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("users.id"))
+ account_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("accounts.id"), nullable=False)
+ category_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), ForeignKey("categories.id"), nullable=True)
+ external_id: Mapped[Optional[str]] = mapped_column(String(255), nullable=True) # Provider's transaction ID
+ description: Mapped[str] = mapped_column(String(500))
+ amount: Mapped[Decimal] = mapped_column(Numeric(precision=15, scale=2))
+ currency: Mapped[str] = mapped_column(String(3), default="BRL")
+ date: Mapped[date] = mapped_column(Date)
+ type: Mapped[str] = mapped_column(String(10)) # debit, credit
+ source: Mapped[str] = mapped_column(String(20)) # sync, ofx, csv, manual
+ status: Mapped[str] = mapped_column(String(10), default="posted") # posted, pending
+ payee: Mapped[Optional[str]] = mapped_column(String(500), nullable=True)
+ notes: Mapped[Optional[str]] = mapped_column(String(1000), nullable=True)
+ raw_data: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True)
+ import_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), ForeignKey("import_logs.id"), nullable=True)
+ transfer_pair_id: Mapped[Optional[uuid.UUID]] = mapped_column(UUID(as_uuid=True), nullable=True)
+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
+
+ account: Mapped["Account"] = relationship(back_populates="transactions")
+ category: Mapped[Optional["Category"]] = relationship()
+ import_log: Mapped[Optional["ImportLog"]] = relationship(back_populates="transactions")
diff --git a/backend/app/models/user.py b/backend/app/models/user.py
new file mode 100644
index 00000000..db83b0ff
--- /dev/null
+++ b/backend/app/models/user.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Optional
+
+from fastapi_users.db import SQLAlchemyBaseUserTableUUID
+from sqlalchemy import JSON
+from sqlalchemy.orm import Mapped, mapped_column, relationship
+
+from app.core.database import Base
+
+if TYPE_CHECKING:
+ from app.models.category import Category
+ from app.models.category_group import CategoryGroup
+ from app.models.bank_connection import BankConnection
+
+
+class User(SQLAlchemyBaseUserTableUUID, Base):
+ __tablename__ = "users"
+
+ preferences: Mapped[Optional[dict]] = mapped_column(
+ JSON,
+ default=lambda: {
+ "language": "pt-BR",
+ "date_format": "DD/MM/YYYY",
+ "timezone": "America/Sao_Paulo",
+ "currency_display": "BRL",
+ },
+ )
+
+ categories: Mapped[list["Category"]] = relationship(back_populates="user", cascade="all, delete-orphan")
+ category_groups: Mapped[list["CategoryGroup"]] = relationship(back_populates="user", cascade="all, delete-orphan")
+ bank_connections: Mapped[list["BankConnection"]] = relationship(back_populates="user", cascade="all, delete-orphan")
diff --git a/backend/app/providers/__init__.py b/backend/app/providers/__init__.py
new file mode 100644
index 00000000..245bbf03
--- /dev/null
+++ b/backend/app/providers/__init__.py
@@ -0,0 +1,70 @@
+from app.providers.base import BankProvider, AccountData, TransactionData, ConnectionData, ConnectTokenData
+
+# Registry of available providers.
+_PROVIDERS: dict[str, type[BankProvider]] = {}
+
+# All known providers the system supports (extensible for future connectors).
+KNOWN_PROVIDERS = [
+ {
+ "name": "pluggy",
+ "display_name": "Pluggy",
+ "description": "Open finance provider for Brazilian banks",
+ "flow_type": "widget",
+ },
+]
+
+
+def register_provider(name: str, cls: type[BankProvider]) -> None:
+ """Register a bank provider implementation."""
+ _PROVIDERS[name] = cls
+
+
+def get_provider(name: str) -> BankProvider:
+ """Get an instance of a registered bank provider by name."""
+ provider_class = _PROVIDERS.get(name)
+ if not provider_class:
+ available = ", ".join(_PROVIDERS.keys()) or "(none)"
+ raise ValueError(f"Unknown provider: {name}. Available: {available}")
+ return provider_class()
+
+
+def list_providers() -> list[dict[str, str]]:
+ """Return info about all registered providers."""
+ return [
+ {"name": name, "flow_type": cls().flow_type}
+ for name, cls in _PROVIDERS.items()
+ ]
+
+
+def all_known_providers() -> list[dict]:
+ """Return all known providers with a configured flag."""
+ return [
+ {**p, "configured": p["name"] in _PROVIDERS}
+ for p in KNOWN_PROVIDERS
+ ]
+
+
+def _auto_register_providers() -> None:
+ """Auto-register providers when credentials are configured."""
+ from app.core.config import get_settings
+ settings = get_settings()
+
+ if settings.pluggy_client_id and settings.pluggy_client_secret:
+ from app.providers.pluggy import PluggyProvider
+ register_provider("pluggy", PluggyProvider)
+
+
+_auto_register_providers()
+
+
+__all__ = [
+ "BankProvider",
+ "AccountData",
+ "TransactionData",
+ "ConnectionData",
+ "ConnectTokenData",
+ "register_provider",
+ "get_provider",
+ "list_providers",
+ "all_known_providers",
+]
diff --git a/backend/app/providers/base.py b/backend/app/providers/base.py
new file mode 100644
index 00000000..3a390c3a
--- /dev/null
+++ b/backend/app/providers/base.py
@@ -0,0 +1,93 @@
+from abc import ABC, abstractmethod
+from dataclasses import dataclass
+from datetime import date
+from decimal import Decimal
+from typing import Optional
+
+
+@dataclass
+class AccountData:
+ external_id: str
+ name: str
+ type: str # checking, savings, credit_card
+ balance: Decimal
+ currency: str
+
+
+@dataclass
+class TransactionData:
+ external_id: str
+ description: str
+ amount: Decimal
+ date: date
+ type: str # debit, credit
+ pluggy_category: Optional[str] = None
+ status: str = "posted" # posted, pending
+ payee: Optional[str] = None
+ raw_data: Optional[dict] = None
+
+
+@dataclass
+class ConnectionData:
+ external_id: str
+ institution_name: str
+ credentials: dict
+ accounts: list[AccountData]
+
+
+@dataclass
+class ConnectTokenData:
+ access_token: str
+
+
+class BankProvider(ABC):
+ """Abstract interface for open finance integrations.
+
+ Implement this for each provider (Pluggy, Belvo, etc.)
+ to enable bank account syncing via OAuth or widget flow.
+ """
+
+ @property
+ @abstractmethod
+ def name(self) -> str:
+ """Unique provider identifier (e.g. 'pluggy', 'belvo')."""
+ ...
+
+ @property
+ def flow_type(self) -> str:
+ """Connection flow type: 'oauth' for redirect-based, 'widget' for embedded widget."""
+ return "oauth"
+
+ async def create_connect_token(
+ self, client_user_id: str, item_id: str | None = None
+ ) -> ConnectTokenData:
+ """Create a connect token for widget-based flows. Override in widget providers."""
+ raise NotImplementedError(f"{self.name} does not support widget connect tokens")
+
+ @abstractmethod
+ def get_oauth_url(self, redirect_uri: str, state: str) -> str:
+ """Generate OAuth URL for user to authorize."""
+ ...
+
+ @abstractmethod
+ async def handle_oauth_callback(self, code: str) -> ConnectionData:
+ """Exchange OAuth code for access token and fetch initial data."""
+ ...
+
+ @abstractmethod
+ async def get_accounts(self, credentials: dict) -> list[AccountData]:
+ """Fetch accounts for a connection."""
+ ...
+
+ @abstractmethod
+ async def get_transactions(
+ self, credentials: dict, account_external_id: str,
+ since: Optional[date] = None, payee_source: str = "auto",
+ ) -> list[TransactionData]:
+ """Fetch transactions for an account."""
+ ...
+
+ @abstractmethod
+ async def refresh_credentials(self, credentials: dict) -> dict:
+ """Refresh access token if needed."""
+ ...
diff --git a/backend/app/providers/pluggy.py b/backend/app/providers/pluggy.py
new file mode 100644
index 00000000..4de60dbe
--- /dev/null
+++ b/backend/app/providers/pluggy.py
@@ -0,0 +1,303 @@
+import time
+from datetime import date
+from decimal import Decimal
+from typing import Optional
+
+import httpx
+
+from app.core.config import get_settings
+from app.providers.base import (
+ AccountData,
+ BankProvider,
+ ConnectionData,
+ ConnectTokenData,
+ TransactionData,
+)
+
+PLUGGY_API_BASE = "https://api.pluggy.ai"
+
+
+class PluggyProvider(BankProvider):
+ """Pluggy (MeuPluggy) open finance provider.
+
+ Uses the Pluggy Connect Widget flow:
+ 1. Backend creates a connect token for the frontend widget
+ 2. Widget handles bank selection, login, and MFA
+ 3. Widget returns an Item ID which is used as the connection identifier
+ """
+
+ _api_key: Optional[str] = None
+ _api_key_expires_at: float = 0
+
+ @property
+ def name(self) -> str:
+ return "pluggy"
+
+ @property
+ def flow_type(self) -> str:
+ return "widget"
+
+ async def _ensure_api_key(self) -> str:
+ """Get a valid API key, refreshing if expired or about to expire (<5min remaining)."""
+ now = time.time()
+ if self._api_key and (self._api_key_expires_at - now) > 300:
+ return self._api_key
+
+ settings = get_settings()
+ async with httpx.AsyncClient(timeout=30.0) as client:
+ resp = await client.post(
+ f"{PLUGGY_API_BASE}/auth",
+ json={
+ "clientId": settings.pluggy_client_id,
+ "clientSecret": settings.pluggy_client_secret,
+ },
+ )
+ resp.raise_for_status()
+ data = resp.json()
+
+ PluggyProvider._api_key = data["apiKey"]
+ # Pluggy API keys last 2 hours
+ PluggyProvider._api_key_expires_at = now + 7200
+ return PluggyProvider._api_key
+
+ async def _headers(self) -> dict:
+ api_key = await self._ensure_api_key()
+ return {
+ "X-API-KEY": api_key,
+ "Content-Type": "application/json",
+ }
+
+ async def create_connect_token(
+ self, client_user_id: str, item_id: str | None = None
+ ) -> ConnectTokenData:
+ """Create a connect token for the Pluggy Connect Widget.
+
+ When item_id is provided, the widget opens in update mode for re-authentication.
+ """
+ headers = await self._headers()
+ body: dict = {"clientUserId": client_user_id}
+ if item_id:
+ body["itemId"] = item_id
+ async with httpx.AsyncClient(timeout=30.0) as client:
+ resp = await client.post(
+ f"{PLUGGY_API_BASE}/connect_token",
+ headers=headers,
+ json=body,
+ )
+ resp.raise_for_status()
+ data = resp.json()
+ return ConnectTokenData(access_token=data["accessToken"])
+
+ def get_oauth_url(self, redirect_uri: str, state: str) -> str:
+ raise NotImplementedError("Pluggy uses widget flow, not OAuth redirect")
+
+ async def handle_oauth_callback(self, code: str) -> ConnectionData:
+ """Handle widget callback. The 'code' parameter is the Pluggy Item ID."""
+ item_id = code
+ headers = await self._headers()
+
+ async with httpx.AsyncClient(timeout=30.0) as client:
+ # Fetch item details
+ item_resp = await client.get(
+ f"{PLUGGY_API_BASE}/items/{item_id}",
+ headers=headers,
+ )
+ item_resp.raise_for_status()
+ item_data = item_resp.json()
+
+ # Fetch accounts for this item
+ accounts_resp = await client.get(
+ f"{PLUGGY_API_BASE}/accounts",
+ headers=headers,
+ params={"itemId": item_id},
+ )
+ accounts_resp.raise_for_status()
+ accounts_data = accounts_resp.json()
+
+ institution_name = item_data.get("connector", {}).get("name", "Unknown Bank")
+
+ account_list = []
+ for acc in accounts_data.get("results", []):
+ account_list.append(
+ AccountData(
+ external_id=acc["id"],
+ name=acc["name"],
+ type=self._map_account_type(acc.get("type", "")),
+ balance=Decimal(str(acc.get("balance", 0))),
+ currency=acc.get("currencyCode", "BRL"),
+ )
+ )
+
+ return ConnectionData(
+ external_id=item_id,
+ institution_name=institution_name,
+ credentials={"item_id": item_id},
+ accounts=account_list,
+ )
+
+ async def get_accounts(self, credentials: dict) -> list[AccountData]:
+ item_id = credentials["item_id"]
+ headers = await self._headers()
+
+ async with httpx.AsyncClient(timeout=30.0) as client:
+ resp = await client.get(
+ f"{PLUGGY_API_BASE}/accounts",
+ headers=headers,
+ params={"itemId": item_id},
+ )
+ resp.raise_for_status()
+ data = resp.json()
+
+ accounts = []
+ for acc in data.get("results", []):
+ accounts.append(
+ AccountData(
+ external_id=acc["id"],
+ name=acc["name"],
+ type=self._map_account_type(acc.get("type", "")),
+ balance=Decimal(str(acc.get("balance", 0))),
+ currency=acc.get("currencyCode", "BRL"),
+ )
+ )
+ return accounts
+
+ async def get_transactions(
+ self, credentials: dict, account_external_id: str,
+ since: Optional[date] = None, payee_source: str = "auto",
+ ) -> list[TransactionData]:
+ headers = await self._headers()
+ all_transactions: list[TransactionData] = []
+ page = 1
+
+ async with httpx.AsyncClient(timeout=30.0) as client:
+ while True:
+ params: dict = {
+ "accountId": account_external_id,
+ "pageSize": 500,
+ "page": page,
+ }
+ if since:
+ params["from"] = since.isoformat()
+
+ resp = await client.get(
+ f"{PLUGGY_API_BASE}/transactions",
+ headers=headers,
+ params=params,
+ )
+ resp.raise_for_status()
+ data = resp.json()
+
+ results = data.get("results", [])
+ if not results:
+ break
+
+ for txn in results:
+ amount_raw = txn.get("amount", 0)
+ amount = Decimal(str(abs(amount_raw)))
+
+ # Use Pluggy's explicit type field when available
+ pluggy_type = txn.get("type", "").upper()
+ if pluggy_type == "DEBIT":
+ txn_type = "debit"
+ elif pluggy_type == "CREDIT":
+ txn_type = "credit"
+ else:
+ txn_type = "credit" if amount_raw >= 0 else "debit"
+
+ txn_date = date.fromisoformat(txn["date"][:10])
+
+ # Pending vs booked status
+ status = "pending" if txn.get("status") == "PENDING" else "posted"
+
+ # Smart payee extraction (merchant → payment data → None)
+ payee = self._extract_payee(txn, txn_type, payee_source)
+
+ all_transactions.append(
+ TransactionData(
+ external_id=txn["id"],
+ description=txn.get("description", ""),
+ amount=amount,
+ date=txn_date,
+ type=txn_type,
+ pluggy_category=txn.get("category"),
+ status=status,
+ payee=payee,
+ raw_data=txn,
+ )
+ )
+
+ total_pages = data.get("totalPages", 1)
+ if page >= total_pages:
+ break
+ page += 1
+
+ return all_transactions
+
+ async def refresh_credentials(self, credentials: dict) -> dict:
+ # Pluggy manages API keys at the provider level, not per-connection
+ return credentials
+
+ @staticmethod
+ def _extract_payee(txn: dict, txn_type: str, payee_source: str = "auto") -> Optional[str]:
+ """Extract payee name based on configured source."""
+ if payee_source == "none":
+ return None
+ if payee_source == "description":
+ return txn.get("description")
+ if payee_source == "merchant":
+ merchant = txn.get("merchant")
+ if merchant:
+ return merchant.get("name") or merchant.get("businessName")
+ return None
+ if payee_source == "payment_data":
+ payment_data = txn.get("paymentData")
+ if not payment_data:
+ return None
+ if txn_type == "debit":
+ receiver = payment_data.get("receiver")
+ if receiver:
+ return receiver.get("name") or (receiver.get("documentNumber") or {}).get("value")
+ else:
+ payer = payment_data.get("payer")
+ if payer:
+ return payer.get("name") or (payer.get("documentNumber") or {}).get("value")
+ return None
+
+ # "auto" — original priority chain: merchant > payment_data > None
+ merchant = txn.get("merchant")
+ if merchant:
+ name = merchant.get("name") or merchant.get("businessName")
+ if name:
+ return name
+
+ payment_data = txn.get("paymentData")
+ if payment_data:
+ if txn_type == "debit":
+ receiver = payment_data.get("receiver")
+ if receiver:
+ name = receiver.get("name")
+ if name:
+ return name
+ doc = receiver.get("documentNumber")
+ if doc and doc.get("value"):
+ return doc["value"]
+ else:
+ payer = payment_data.get("payer")
+ if payer:
+ name = payer.get("name")
+ if name:
+ return name
+ doc = payer.get("documentNumber")
+ if doc and doc.get("value"):
+ return doc["value"]
+
+ return None
+
+ @staticmethod
+ def _map_account_type(pluggy_type: str) -> str:
+ mapping = {
+ "BANK": "checking",
+ "CREDIT": "credit_card",
+ "SAVINGS": "savings",
+ }
+ return mapping.get(pluggy_type.upper(), "checking")
diff --git a/backend/app/schemas/__init__.py b/backend/app/schemas/__init__.py
new file mode 100644
index 00000000..0c6ddd70
--- /dev/null
+++ b/backend/app/schemas/__init__.py
@@ -0,0 +1,40 @@
+from app.schemas.user import UserCreate, UserRead, UserUpdate, UserPreferences
+from app.schemas.category import CategoryCreate, CategoryRead, CategoryUpdate
+from app.schemas.bank_connection import (
+ BankConnectionRead,
+ OAuthUrlRequest,
+ OAuthUrlResponse,
+ OAuthCallbackRequest,
+)
+from app.schemas.account import AccountRead
+from app.schemas.transaction import (
+ TransactionCreate,
+ TransactionRead,
+ TransactionUpdate,
+ TransactionImportPreview,
+ TransactionImportRequest,
+)
+from app.schemas.dashboard import DashboardSummary, SpendingByCategory, MonthlyTrend
+
+__all__ = [
+ "UserCreate",
+ "UserRead",
+ "UserUpdate",
+ "UserPreferences",
+ "CategoryCreate",
+ "CategoryRead",
+ "CategoryUpdate",
+ "BankConnectionRead",
+ "OAuthUrlRequest",
+ "OAuthUrlResponse",
+ "OAuthCallbackRequest",
+ "AccountRead",
+ "TransactionCreate",
+ "TransactionRead",
+ "TransactionUpdate",
+ "TransactionImportPreview",
+ "TransactionImportRequest",
+ "DashboardSummary",
+ "SpendingByCategory",
+ "MonthlyTrend",
+]
diff --git a/backend/app/schemas/account.py b/backend/app/schemas/account.py
new file mode 100644
index 00000000..8783bb12
--- /dev/null
+++ b/backend/app/schemas/account.py
@@ -0,0 +1,46 @@
+import uuid
+from datetime import datetime
+from decimal import Decimal
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class AccountBase(BaseModel):
+ name: str
+ type: str
+ balance: Decimal
+ currency: str = "BRL"
+
+
+class AccountCreate(BaseModel):
+ name: str
+ type: str
+ balance: Decimal = Decimal("0.00")
+ currency: str = "BRL"
+
+
+class AccountUpdate(BaseModel):
+ name: Optional[str] = None
+ type: Optional[str] = None
+ balance: Optional[Decimal] = None
+
+
+class AccountRead(AccountBase):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ connection_id: Optional[uuid.UUID] = None
+ external_id: Optional[str] = None
+ current_balance: float = 0.0
+ previous_balance: Optional[float] = None
+ is_closed: bool = False
+ closed_at: Optional[datetime] = None
+
+ model_config = ConfigDict(from_attributes=True)
+
+
+class AccountSummary(BaseModel):
+ account_id: uuid.UUID
+ current_balance: float
+ monthly_income: float
+ monthly_expenses: float
diff --git a/backend/app/schemas/bank_connection.py b/backend/app/schemas/bank_connection.py
new file mode 100644
index 00000000..3d9c3bc5
--- /dev/null
+++ b/backend/app/schemas/bank_connection.py
@@ -0,0 +1,52 @@
+import uuid
+from datetime import datetime
+from typing import Literal, Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class BankConnectionBase(BaseModel):
+ provider: str
+ institution_name: str
+
+
+class BankConnectionRead(BankConnectionBase):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ external_id: str
+ settings: Optional[dict] = None
+ status: str
+ last_sync_at: Optional[datetime] = None
+ created_at: datetime
+
+ model_config = ConfigDict(from_attributes=True)
+
+
+class OAuthUrlRequest(BaseModel):
+ provider: str = "pluggy"
+
+
+class OAuthUrlResponse(BaseModel):
+ url: str
+
+
+class OAuthCallbackRequest(BaseModel):
+ code: str
+ provider: str = "pluggy"
+
+
+class ConnectTokenRequest(BaseModel):
+ provider: str = "pluggy"
+
+
+class ConnectTokenResponse(BaseModel):
+ access_token: str
+
+
+class ReconnectTokenResponse(BaseModel):
+ access_token: str
+
+
+class ConnectionSettingsUpdate(BaseModel):
+ payee_source: Optional[Literal["auto", "merchant", "payment_data", "description", "none"]] = None
+ import_pending: Optional[bool] = None
diff --git a/backend/app/schemas/budget.py b/backend/app/schemas/budget.py
new file mode 100644
index 00000000..bad187df
--- /dev/null
+++ b/backend/app/schemas/budget.py
@@ -0,0 +1,43 @@
+import uuid
+from datetime import date as _Date
+from decimal import Decimal
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class BudgetCreate(BaseModel):
+ category_id: uuid.UUID
+ amount: Decimal
+ month: _Date # First day of month
+ is_recurring: bool = False
+
+
+class BudgetUpdate(BaseModel):
+ amount: Optional[Decimal] = None
+ effective_month: Optional[_Date] = None
+
+
+class BudgetRead(BaseModel):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ category_id: uuid.UUID
+ amount: Decimal
+ month: _Date
+ is_recurring: bool
+
+ model_config = ConfigDict(from_attributes=True)
+
+
+class BudgetVsActual(BaseModel):
+ category_id: uuid.UUID
+ category_name: str
+ category_icon: str
+ category_color: str
+ group_id: Optional[uuid.UUID] = None
+ group_name: Optional[str] = None
+ budget_amount: Optional[Decimal] = None
+ actual_amount: Decimal
+ prev_month_amount: Decimal = Decimal("0")
+ percentage_used: Optional[float] = None
+ is_recurring: bool = False
diff --git a/backend/app/schemas/category.py b/backend/app/schemas/category.py
new file mode 100644
index 00000000..ff204e78
--- /dev/null
+++ b/backend/app/schemas/category.py
@@ -0,0 +1,30 @@
+import uuid
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class CategoryBase(BaseModel):
+ name: str
+ icon: str = "circle-help"
+ color: str = "#6B7280"
+
+
+class CategoryCreate(CategoryBase):
+ group_id: Optional[uuid.UUID] = None
+
+
+class CategoryUpdate(BaseModel):
+ name: Optional[str] = None
+ icon: Optional[str] = None
+ color: Optional[str] = None
+ group_id: Optional[uuid.UUID] = None
+
+
+class CategoryRead(CategoryBase):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ group_id: Optional[uuid.UUID] = None
+ is_system: bool
+
+ model_config = ConfigDict(from_attributes=True)
diff --git a/backend/app/schemas/category_group.py b/backend/app/schemas/category_group.py
new file mode 100644
index 00000000..4da1f54d
--- /dev/null
+++ b/backend/app/schemas/category_group.py
@@ -0,0 +1,33 @@
+import uuid
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+from app.schemas.category import CategoryRead
+
+
+class CategoryGroupBase(BaseModel):
+ name: str
+ icon: str = "folder"
+ color: str = "#6B7280"
+ position: int = 0
+
+
+class CategoryGroupCreate(CategoryGroupBase):
+ pass
+
+
+class CategoryGroupUpdate(BaseModel):
+ name: Optional[str] = None
+ icon: Optional[str] = None
+ color: Optional[str] = None
+ position: Optional[int] = None
+
+
+class CategoryGroupRead(CategoryGroupBase):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ is_system: bool
+ categories: list[CategoryRead] = []
+
+ model_config = ConfigDict(from_attributes=True)
diff --git a/backend/app/schemas/dashboard.py b/backend/app/schemas/dashboard.py
new file mode 100644
index 00000000..972b665c
--- /dev/null
+++ b/backend/app/schemas/dashboard.py
@@ -0,0 +1,51 @@
+from typing import Optional
+
+from pydantic import BaseModel
+
+
+class DashboardSummary(BaseModel):
+ total_balance: dict[str, float] # currency -> amount
+ balance_date: str # ISO date string, e.g. "2026-03-02"
+ monthly_income: float
+ monthly_expenses: float
+ accounts_count: int
+ pending_categorization: int
+ pending_categorization_amount: float
+
+
+class SpendingByCategory(BaseModel):
+ category_id: Optional[str]
+ category_name: str
+ category_icon: str
+ category_color: str
+ total: float
+ percentage: float
+
+
+class MonthlyTrend(BaseModel):
+ month: str # "2026-01"
+ income: float
+ expenses: float
+
+
+class DailyBalance(BaseModel):
+ day: int
+ balance: Optional[float] # None for future days beyond cutoff
+
+
+class BalanceHistory(BaseModel):
+ current: list[DailyBalance]
+ previous: list[DailyBalance]
+
+
+class ProjectedTransaction(BaseModel):
+ recurring_id: str
+ description: str
+ amount: float
+ currency: str
+ type: str # debit, credit
+ date: str # YYYY-MM-DD
+ category_id: Optional[str]
+ category_name: Optional[str]
+ category_icon: Optional[str]
+ category_color: Optional[str] = None
diff --git a/backend/app/schemas/import_log.py b/backend/app/schemas/import_log.py
new file mode 100644
index 00000000..0dceb1bc
--- /dev/null
+++ b/backend/app/schemas/import_log.py
@@ -0,0 +1,21 @@
+import uuid
+from datetime import datetime
+from decimal import Decimal
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class ImportLogRead(BaseModel):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ account_id: uuid.UUID
+ account_name: Optional[str] = None
+ filename: str
+ format: str
+ transaction_count: int
+ total_credit: Decimal
+ total_debit: Decimal
+ created_at: datetime
+
+ model_config = ConfigDict(from_attributes=True)
diff --git a/backend/app/schemas/recurring_transaction.py b/backend/app/schemas/recurring_transaction.py
new file mode 100644
index 00000000..95f5b8e7
--- /dev/null
+++ b/backend/app/schemas/recurring_transaction.py
@@ -0,0 +1,53 @@
+import uuid
+from datetime import date as _Date
+from decimal import Decimal
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class RecurringTransactionCreate(BaseModel):
+ description: str
+ amount: Decimal
+ currency: str = "BRL"
+ type: str # debit, credit
+ frequency: str # monthly, weekly, yearly
+ day_of_month: Optional[int] = None
+ start_date: _Date
+ end_date: Optional[_Date] = None
+ account_id: Optional[uuid.UUID] = None
+ category_id: Optional[uuid.UUID] = None
+ skip_first: bool = False # Set true when first occurrence already created as a transaction
+
+
+class RecurringTransactionUpdate(BaseModel):
+ description: Optional[str] = None
+ amount: Optional[Decimal] = None
+ currency: Optional[str] = None
+ type: Optional[str] = None
+ frequency: Optional[str] = None
+ day_of_month: Optional[int] = None
+ start_date: Optional[_Date] = None
+ end_date: Optional[_Date] = None
+ account_id: Optional[uuid.UUID] = None
+ category_id: Optional[uuid.UUID] = None
+ is_active: Optional[bool] = None
+
+
+class RecurringTransactionRead(BaseModel):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ account_id: Optional[uuid.UUID] = None
+ category_id: Optional[uuid.UUID] = None
+ description: str
+ amount: Decimal
+ currency: str
+ type: str
+ frequency: str
+ day_of_month: Optional[int] = None
+ start_date: _Date
+ end_date: Optional[_Date] = None
+ is_active: bool
+ next_occurrence: _Date
+
+ model_config = ConfigDict(from_attributes=True)
diff --git a/backend/app/schemas/rule.py b/backend/app/schemas/rule.py
new file mode 100644
index 00000000..1066cd96
--- /dev/null
+++ b/backend/app/schemas/rule.py
@@ -0,0 +1,47 @@
+# backend/app/schemas/rule.py
+import uuid
+from typing import Any, Optional
+
+from pydantic import BaseModel, ConfigDict
+
+
+class RuleCondition(BaseModel):
+ field: str # description, notes, amount, type, account_id, date
+ op: str # contains, not_contains, equals, not_equals, starts_with, ends_with, regex, gt, gte, lt, lte
+ value: Any # str or number depending on field
+
+
+class RuleAction(BaseModel):
+ op: str # set_category, append_notes
+ value: Any # category UUID str or notes string
+
+
+class RuleCreate(BaseModel):
+ name: str
+ conditions_op: str = "and"
+ conditions: list[RuleCondition]
+ actions: list[RuleAction]
+ priority: int = 0
+ is_active: bool = True
+
+
+class RuleUpdate(BaseModel):
+ name: Optional[str] = None
+ conditions_op: Optional[str] = None
+ conditions: Optional[list[RuleCondition]] = None
+ actions: Optional[list[RuleAction]] = None
+ priority: Optional[int] = None
+ is_active: Optional[bool] = None
+
+
+class RuleRead(BaseModel):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ name: str
+ conditions_op: str
+ conditions: list[dict]
+ actions: list[dict]
+ priority: int
+ is_active: bool
+
+ model_config = ConfigDict(from_attributes=True)
diff --git a/backend/app/schemas/transaction.py b/backend/app/schemas/transaction.py
new file mode 100644
index 00000000..21572aaa
--- /dev/null
+++ b/backend/app/schemas/transaction.py
@@ -0,0 +1,66 @@
+import uuid
+from datetime import date as _Date
+from decimal import Decimal
+from typing import Optional
+
+from pydantic import BaseModel, ConfigDict
+
+from app.schemas.category import CategoryRead
+
+
+class TransactionBase(BaseModel):
+ description: str
+ amount: Decimal
+ date: _Date
+ type: str # debit, credit
+
+
+class TransactionCreate(TransactionBase):
+ account_id: uuid.UUID
+ category_id: Optional[uuid.UUID] = None
+ currency: str = "BRL"
+ notes: Optional[str] = None
+
+
+class TransactionUpdate(BaseModel):
+ description: Optional[str] = None
+ amount: Optional[Decimal] = None
+ date: Optional[_Date] = None
+ type: Optional[str] = None
+ currency: Optional[str] = None
+ category_id: Optional[uuid.UUID] = None
+ notes: Optional[str] = None
+
+
+class TransactionRead(TransactionBase):
+ id: uuid.UUID
+ user_id: uuid.UUID
+ account_id: Optional[uuid.UUID] = None
+ category_id: Optional[uuid.UUID] = None
+ category: Optional[CategoryRead] = None
+ external_id: Optional[str] = None
+ currency: str = "BRL"
+ source: str
+ status: str = "posted"
+ payee: Optional[str] = None
+ notes: Optional[str] = None
+ transfer_pair_id: Optional[uuid.UUID] = None
+
+ model_config = ConfigDict(from_attributes=True)
+
+
+class BulkCategorizeRequest(BaseModel):
+ transaction_ids: list[uuid.UUID]
+ category_id: Optional[uuid.UUID] = None
+
+
+class TransactionImportPreview(BaseModel):
+ transactions: list[TransactionBase]
+ detected_format: str
+
+
+class TransactionImportRequest(BaseModel):
+ account_id: uuid.UUID
+ transactions: list[TransactionBase]
+ filename: str = ""
+ detected_format: str = ""
diff --git a/backend/app/schemas/user.py b/backend/app/schemas/user.py
new file mode 100644
index 00000000..4f7c5344
--- /dev/null
+++ b/backend/app/schemas/user.py
@@ -0,0 +1,25 @@
+import uuid
+from typing import Optional
+
+from fastapi_users import schemas
+from pydantic import BaseModel
+
+
+class UserPreferences(BaseModel):
+ language: str = "pt-BR"
+ date_format: str = "DD/MM/YYYY"
+ timezone: str = "America/Sao_Paulo"
+ currency_display: str = "BRL"
+ onboarding_completed: bool = False
+
+
+class UserRead(schemas.BaseUser[uuid.UUID]):
+ preferences: Optional[dict] = None
+
+
+class UserCreate(schemas.BaseUserCreate):
+ pass
+
+
+class UserUpdate(schemas.BaseUserUpdate):
+ preferences: Optional[dict] = None
diff --git a/backend/app/services/__init__.py b/backend/app/services/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/app/services/account_service.py b/backend/app/services/account_service.py
new file mode 100644
index 00000000..f05235e1
--- /dev/null
+++ b/backend/app/services/account_service.py
@@ -0,0 +1,358 @@
+import uuid
+from datetime import date as _Date, datetime, timedelta, timezone
+from decimal import Decimal
+from typing import Optional
+
+from sqlalchemy import case, func, select, or_
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.account import Account
+from app.models.bank_connection import BankConnection
+from app.models.transaction import Transaction
+from app.schemas.account import AccountCreate, AccountUpdate
+
+
+async def get_accounts(session: AsyncSession, user_id: uuid.UUID, include_closed: bool = False) -> list[dict]:
+ # Subquery: compute current_balance per account from transactions in one pass
+ signed_amount = case(
+ (Transaction.type == "credit", Transaction.amount),
+ else_=-Transaction.amount,
+ )
+
+ balance_sq = (
+ select(
+ Transaction.account_id,
+ func.coalesce(func.sum(signed_amount), 0).label("current_balance"),
+ )
+ .group_by(Transaction.account_id)
+ .subquery()
+ )
+
+ # Subquery: compute previous_balance (balance at end of previous month)
+ today = _Date.today()
+ first_of_month = today.replace(day=1)
+ prev_month_end = first_of_month - timedelta(days=1)
+
+ prev_balance_sq = (
+ select(
+ Transaction.account_id,
+ func.coalesce(func.sum(signed_amount), 0).label("previous_balance"),
+ )
+ .where(Transaction.date <= prev_month_end)
+ .group_by(Transaction.account_id)
+ .subquery()
+ )
+
+ # Build the query
+ query = (
+ select(
+ Account,
+ func.coalesce(balance_sq.c.current_balance, 0).label("current_balance"),
+ func.coalesce(prev_balance_sq.c.previous_balance, 0).label("previous_balance"),
+ )
+ .outerjoin(BankConnection)
+ .outerjoin(balance_sq, Account.id == balance_sq.c.account_id)
+ .outerjoin(prev_balance_sq, Account.id == prev_balance_sq.c.account_id)
+ .where(
+ or_(
+ Account.user_id == user_id,
+ BankConnection.user_id == user_id,
+ )
+ )
+ )
+ if not include_closed:
+ query = query.where(Account.is_closed == False)
+ query = query.order_by(Account.name)
+ result = await session.execute(query)
+
+ return [
+ {
+ "id": acc.id,
+ "user_id": acc.user_id,
+ "connection_id": acc.connection_id,
+ "external_id": acc.external_id,
+ "name": acc.name,
+ "type": acc.type,
+ "balance": acc.balance,
+ "currency": acc.currency,
+ # Connected CC: provider stores positive for debt → negate.
+ # Manual accounts: transaction math already gives correct sign.
+ "current_balance": float(acc.balance) * (-1 if acc.type == "credit_card" else 1) if acc.connection_id else float(current_balance or 0),
+ "previous_balance": float(previous_balance or 0),
+ "is_closed": acc.is_closed,
+ "closed_at": acc.closed_at,
+ }
+ for acc, current_balance, previous_balance in result.all()
+ ]
+
+
+async def get_account(session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID) -> Optional[Account]:
+ result = await session.execute(
+ select(Account)
+ .outerjoin(BankConnection)
+ .where(
+ Account.id == account_id,
+ or_(
+ Account.user_id == user_id,
+ BankConnection.user_id == user_id,
+ ),
+ )
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_account(session: AsyncSession, user_id: uuid.UUID, data: AccountCreate) -> Account:
+ account = Account(
+ user_id=user_id,
+ name=data.name,
+ type=data.type,
+ balance=data.balance,
+ currency=data.currency,
+ )
+ session.add(account)
+ await session.flush() # get account.id without committing
+
+ if data.balance > Decimal("0.00"):
+ # Credit cards: opening balance represents debt → record as debit.
+ # Other accounts: opening balance represents assets → record as credit.
+ opening_type = "debit" if data.type == "credit_card" else "credit"
+ opening_tx = Transaction(
+ user_id=user_id,
+ account_id=account.id,
+ description="Saldo inicial",
+ amount=data.balance,
+ currency=data.currency,
+ date=_Date.today(),
+ type=opening_type,
+ source="opening_balance",
+ )
+ session.add(opening_tx)
+
+ await session.commit()
+ await session.refresh(account)
+ return account
+
+
+async def update_account(
+ session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID, data: AccountUpdate
+) -> Optional[Account]:
+ account = await get_account(session, account_id, user_id)
+ if not account:
+ return None
+
+ # Only allow editing manual accounts
+ if account.connection_id is not None:
+ raise ValueError("Cannot edit bank-connected accounts")
+
+ for key, value in data.model_dump(exclude_unset=True).items():
+ setattr(account, key, value)
+
+ await session.commit()
+ await session.refresh(account)
+ return account
+
+
+async def delete_account(session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID) -> bool:
+ account = await get_account(session, account_id, user_id)
+ if not account:
+ return False
+
+ # Only allow deleting manual accounts
+ if account.connection_id is not None:
+ raise ValueError("Cannot delete bank-connected accounts")
+
+ await session.delete(account)
+ await session.commit()
+ return True
+
+
+async def close_account(
+ session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID
+) -> Optional[Account]:
+ account = await get_account(session, account_id, user_id)
+ if not account:
+ return None
+ if account.is_closed:
+ raise ValueError("Account is already closed")
+
+ account.is_closed = True
+ account.closed_at = datetime.now(timezone.utc)
+
+ # Unlink from bank connection so sync skips it
+ if account.connection_id is not None:
+ account.connection_id = None
+
+ await session.commit()
+ await session.refresh(account)
+ return account
+
+
+async def reopen_account(
+ session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID
+) -> Optional[Account]:
+ account = await get_account(session, account_id, user_id)
+ if not account:
+ return None
+ if not account.is_closed:
+ raise ValueError("Account is not closed")
+
+ account.is_closed = False
+ account.closed_at = None
+
+ await session.commit()
+ await session.refresh(account)
+ return account
+
+
+async def get_account_summary(
+ session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID,
+ date_from: Optional[_Date] = None, date_to: Optional[_Date] = None,
+) -> Optional[dict]:
+ account = await get_account(session, account_id, user_id)
+ if not account:
+ return None
+
+ today = _Date.today()
+ if not date_from:
+ date_from = today.replace(day=1)
+ if not date_to:
+ date_to = today
+
+ # For bank-connected accounts, use the stored balance from the provider
+ if account.connection_id:
+ current_balance = float(account.balance)
+ else:
+ # Current balance = SUM(credit amounts) - SUM(debit amounts)
+ balance_result = await session.execute(
+ select(
+ func.coalesce(
+ func.sum(
+ case(
+ (Transaction.type == "credit", Transaction.amount),
+ else_=-Transaction.amount,
+ )
+ ),
+ 0,
+ )
+ ).where(Transaction.account_id == account_id)
+ )
+ current_balance = float(balance_result.scalar())
+
+ # Connected CC: provider balance is positive for debt → negate.
+ # Manual CC: transaction math already gives negative for debt.
+ if account.type == "credit_card" and account.connection_id:
+ current_balance = -current_balance
+
+ # Income = SUM of credit transactions in [date_from, date_to] (excluding opening_balance and transfers)
+ income_result = await session.execute(
+ select(func.coalesce(func.sum(Transaction.amount), 0)).where(
+ Transaction.account_id == account_id,
+ Transaction.type == "credit",
+ Transaction.source != "opening_balance",
+ Transaction.transfer_pair_id.is_(None),
+ Transaction.date >= date_from,
+ Transaction.date <= date_to,
+ )
+ )
+ monthly_income = float(income_result.scalar())
+
+ # Expenses = SUM of debit transactions in [date_from, date_to] (as positive value, excluding transfers)
+ expenses_result = await session.execute(
+ select(func.coalesce(func.sum(func.abs(Transaction.amount)), 0)).where(
+ Transaction.account_id == account_id,
+ Transaction.type == "debit",
+ Transaction.transfer_pair_id.is_(None),
+ Transaction.date >= date_from,
+ Transaction.date <= date_to,
+ )
+ )
+ monthly_expenses = float(expenses_result.scalar())
+
+ return {
+ "account_id": account_id,
+ "current_balance": current_balance,
+ "monthly_income": monthly_income,
+ "monthly_expenses": monthly_expenses,
+ }
+
+
+def _signed_amount_expr():
+ """credit → +amount, debit → −amount."""
+ return case(
+ (Transaction.type == "credit", Transaction.amount),
+ else_=-Transaction.amount,
+ )
+
+
+async def _account_balance_at(
+ session: AsyncSession, account_id: uuid.UUID, cutoff: _Date
+) -> float:
+ """Get balance for a single account at a specific date."""
+ result = await session.execute(
+ select(func.coalesce(func.sum(_signed_amount_expr()), 0))
+ .where(
+ Transaction.account_id == account_id,
+ Transaction.date <= cutoff,
+ )
+ )
+ return float(result.scalar() or 0)
+
+
+async def _account_daily_balance_series(
+ session: AsyncSession, account_id: uuid.UUID,
+ date_from: _Date, date_to: _Date,
+) -> list[dict]:
+ """Build daily balance series for [date_from, date_to] inclusive."""
+ # Get balance at end of day before range start
+ start_balance = await _account_balance_at(session, account_id, date_from - timedelta(days=1))
+
+ # Get daily deltas within range: group by actual date
+ result = await session.execute(
+ select(
+ Transaction.date,
+ func.sum(_signed_amount_expr()),
+ )
+ .where(
+ Transaction.account_id == account_id,
+ Transaction.date >= date_from,
+ Transaction.date <= date_to,
+ )
+ .group_by(Transaction.date)
+ )
+ deltas = {row[0]: float(row[1] or 0) for row in result.all()}
+
+ # Build daily series
+ series = []
+ balance = start_balance
+ current = date_from
+ while current <= date_to:
+ balance += deltas.get(current, 0)
+ series.append({"date": current.isoformat(), "balance": round(balance, 2)})
+ current += timedelta(days=1)
+
+ return series
+
+
+async def get_account_balance_history(
+ session: AsyncSession, account_id: uuid.UUID, user_id: uuid.UUID,
+ date_from: Optional[_Date] = None, date_to: Optional[_Date] = None,
+) -> Optional[list[dict]]:
+ account = await get_account(session, account_id, user_id)
+ if not account:
+ return None
+
+ today = _Date.today()
+ if not date_from:
+ date_from = today.replace(day=1)
+ if not date_to:
+ date_to = today
+
+ sign = -1.0 if (account.type == "credit_card" and account.connection_id) else 1.0
+
+ series = await _account_daily_balance_series(session, account_id, date_from, date_to)
+
+ if sign != 1.0:
+ for point in series:
+ point["balance"] = round(point["balance"] * sign, 2)
+
+ return series
diff --git a/backend/app/services/budget_service.py b/backend/app/services/budget_service.py
new file mode 100644
index 00000000..470df4e8
--- /dev/null
+++ b/backend/app/services/budget_service.py
@@ -0,0 +1,322 @@
+import uuid
+from datetime import date
+from decimal import Decimal
+from typing import Optional
+
+from sqlalchemy import select, func, and_
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.budget import Budget
+from app.models.category import Category
+from app.models.category_group import CategoryGroup
+from app.models.transaction import Transaction
+from app.schemas.budget import BudgetCreate, BudgetUpdate, BudgetVsActual
+from app.services.dashboard_service import _get_recurring_projections
+
+
+async def _build_budget_map(
+ session: AsyncSession, user_id: uuid.UUID, month_start: date
+) -> dict[str, tuple[Decimal, bool]]:
+ """Build a map of category_id -> (amount, is_recurring) for the given month.
+
+ Resolution order:
+ 1. Month-specific override (is_recurring=false, month=M) takes priority
+ 2. Most recent recurring default (is_recurring=true, month<=M) as fallback
+ """
+ budget_map: dict[str, tuple[Decimal, bool]] = {}
+
+ # Query 1: Get effective recurring defaults (most recent per category where month <= M)
+ # Use a subquery to get the max month per category for recurring budgets
+ max_month_subq = (
+ select(
+ Budget.category_id,
+ func.max(Budget.month).label("max_month"),
+ )
+ .where(
+ Budget.user_id == user_id,
+ Budget.is_recurring == True, # noqa: E712
+ Budget.month <= month_start,
+ )
+ .group_by(Budget.category_id)
+ .subquery()
+ )
+
+ recurring_result = await session.execute(
+ select(Budget)
+ .join(
+ max_month_subq,
+ and_(
+ Budget.category_id == max_month_subq.c.category_id,
+ Budget.month == max_month_subq.c.max_month,
+ ),
+ )
+ .where(
+ Budget.user_id == user_id,
+ Budget.is_recurring == True, # noqa: E712
+ )
+ )
+ for b in recurring_result.scalars().all():
+ budget_map[str(b.category_id)] = (b.amount, True)
+
+ # Query 2: Month-specific overrides (take priority over recurring)
+ overrides_result = await session.execute(
+ select(Budget).where(
+ Budget.user_id == user_id,
+ Budget.is_recurring == False, # noqa: E712
+ Budget.month == month_start,
+ )
+ )
+ for b in overrides_result.scalars().all():
+ budget_map[str(b.category_id)] = (b.amount, False)
+
+ return budget_map
+
+
+async def get_budgets(
+ session: AsyncSession, user_id: uuid.UUID, month: Optional[date] = None
+) -> list[Budget]:
+ if not month:
+ query = select(Budget).where(Budget.user_id == user_id)
+ result = await session.execute(query.order_by(Budget.month.desc()))
+ return list(result.scalars().all())
+
+ month_start = month.replace(day=1)
+
+ # Get month-specific overrides
+ overrides_result = await session.execute(
+ select(Budget).where(
+ Budget.user_id == user_id,
+ Budget.is_recurring == False, # noqa: E712
+ Budget.month == month_start,
+ )
+ )
+ overrides = list(overrides_result.scalars().all())
+ override_category_ids = {str(b.category_id) for b in overrides}
+
+ # Get effective recurring defaults for this month
+ max_month_subq = (
+ select(
+ Budget.category_id,
+ func.max(Budget.month).label("max_month"),
+ )
+ .where(
+ Budget.user_id == user_id,
+ Budget.is_recurring == True, # noqa: E712
+ Budget.month <= month_start,
+ )
+ .group_by(Budget.category_id)
+ .subquery()
+ )
+
+ recurring_result = await session.execute(
+ select(Budget)
+ .join(
+ max_month_subq,
+ and_(
+ Budget.category_id == max_month_subq.c.category_id,
+ Budget.month == max_month_subq.c.max_month,
+ ),
+ )
+ .where(
+ Budget.user_id == user_id,
+ Budget.is_recurring == True, # noqa: E712
+ )
+ )
+ recurring = [
+ b for b in recurring_result.scalars().all()
+ if str(b.category_id) not in override_category_ids
+ ]
+
+ return sorted(overrides + recurring, key=lambda b: b.month, reverse=True)
+
+
+async def get_budget(
+ session: AsyncSession, budget_id: uuid.UUID, user_id: uuid.UUID
+) -> Optional[Budget]:
+ result = await session.execute(
+ select(Budget).where(Budget.id == budget_id, Budget.user_id == user_id)
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_budget(
+ session: AsyncSession, user_id: uuid.UUID, data: BudgetCreate
+) -> Budget:
+ budget = Budget(
+ user_id=user_id,
+ category_id=data.category_id,
+ amount=data.amount,
+ month=data.month.replace(day=1),
+ is_recurring=data.is_recurring,
+ )
+ session.add(budget)
+ await session.commit()
+ await session.refresh(budget)
+ return budget
+
+
+async def update_budget(
+ session: AsyncSession, budget_id: uuid.UUID, user_id: uuid.UUID, data: BudgetUpdate
+) -> Optional[Budget]:
+ budget = await get_budget(session, budget_id, user_id)
+ if not budget:
+ return None
+
+ if budget.is_recurring and data.effective_month:
+ effective = data.effective_month.replace(day=1)
+ if effective != budget.month:
+ # Create a new recurring record with new effective-from month
+ new_budget = Budget(
+ user_id=budget.user_id,
+ category_id=budget.category_id,
+ amount=data.amount if data.amount is not None else budget.amount,
+ month=effective,
+ is_recurring=True,
+ )
+ session.add(new_budget)
+ await session.commit()
+ await session.refresh(new_budget)
+ return new_budget
+
+ # Update in place (non-recurring, or same effective-from month)
+ for key, value in data.model_dump(exclude_unset=True, exclude={"effective_month"}).items():
+ setattr(budget, key, value)
+
+ await session.commit()
+ await session.refresh(budget)
+ return budget
+
+
+async def delete_budget(
+ session: AsyncSession, budget_id: uuid.UUID, user_id: uuid.UUID
+) -> bool:
+ budget = await get_budget(session, budget_id, user_id)
+ if not budget:
+ return False
+
+ await session.delete(budget)
+ await session.commit()
+ return True
+
+
+async def get_budget_vs_actual(
+ session: AsyncSession, user_id: uuid.UUID, month: Optional[date] = None
+) -> list[BudgetVsActual]:
+ if not month:
+ month = date.today().replace(day=1)
+
+ month_start = month.replace(day=1)
+ if month.month == 12:
+ month_end = month.replace(year=month.year + 1, month=1, day=1)
+ else:
+ month_end = month.replace(month=month.month + 1, day=1)
+
+ # Previous month range
+ if month_start.month == 1:
+ prev_month_start = month_start.replace(year=month_start.year - 1, month=12)
+ else:
+ prev_month_start = month_start.replace(month=month_start.month - 1)
+ prev_month_end = month_start
+
+ # Get all categories for this user with their groups
+ cats_result = await session.execute(
+ select(Category, CategoryGroup)
+ .outerjoin(CategoryGroup, Category.group_id == CategoryGroup.id)
+ .where(Category.user_id == user_id)
+ )
+ all_categories = cats_result.all()
+
+ if not all_categories:
+ return []
+
+ # Get budgets for this month (with recurring resolution)
+ budget_map = await _build_budget_map(session, user_id, month_start)
+
+ # Get actual spending by category for this month (exclude transfer pairs)
+ spending_result = await session.execute(
+ select(
+ Transaction.category_id,
+ func.sum(Transaction.amount),
+ )
+ .where(
+ Transaction.user_id == user_id,
+ Transaction.type == "debit",
+ Transaction.date >= month_start,
+ Transaction.date < month_end,
+ Transaction.category_id.isnot(None),
+ Transaction.transfer_pair_id.is_(None),
+ )
+ .group_by(Transaction.category_id)
+ )
+ spending_map: dict[str, Decimal] = {}
+ for row in spending_result.all():
+ spending_map[str(row[0])] = abs(row[1] or Decimal("0"))
+
+ # Add projected recurring transactions for this month
+ projections = await _get_recurring_projections(session, user_id, month_start, month_end)
+ for proj in projections:
+ if proj["type"] != "debit" or not proj["category_id"]:
+ continue
+ cat_id = str(proj["category_id"])
+ spending_map[cat_id] = spending_map.get(cat_id, Decimal("0")) + Decimal(str(proj["amount"]))
+
+ # Get previous month spending by category (exclude transfer pairs)
+ prev_spending_result = await session.execute(
+ select(
+ Transaction.category_id,
+ func.sum(Transaction.amount),
+ )
+ .where(
+ Transaction.user_id == user_id,
+ Transaction.type == "debit",
+ Transaction.date >= prev_month_start,
+ Transaction.date < prev_month_end,
+ Transaction.category_id.isnot(None),
+ Transaction.transfer_pair_id.is_(None),
+ )
+ .group_by(Transaction.category_id)
+ )
+ prev_spending_map: dict[str, Decimal] = {}
+ for row in prev_spending_result.all():
+ prev_spending_map[str(row[0])] = abs(row[1] or Decimal("0"))
+
+ # Add projected recurring transactions for previous month
+ prev_projections = await _get_recurring_projections(session, user_id, prev_month_start, prev_month_end)
+ for proj in prev_projections:
+ if proj["type"] != "debit" or not proj["category_id"]:
+ continue
+ cat_id = str(proj["category_id"])
+ prev_spending_map[cat_id] = prev_spending_map.get(cat_id, Decimal("0")) + Decimal(str(proj["amount"]))
+
+ comparisons = []
+ for category, group in all_categories:
+ cat_id = str(category.id)
+ actual = spending_map.get(cat_id, Decimal("0"))
+ prev_actual = prev_spending_map.get(cat_id, Decimal("0"))
+ budget_entry = budget_map.get(cat_id)
+ budget_amount = budget_entry[0] if budget_entry else None
+ is_recurring = budget_entry[1] if budget_entry else False
+
+ # Skip categories with no spending in either month and no budget
+ if actual == 0 and prev_actual == 0 and budget_amount is None:
+ continue
+
+ percentage = None
+ if budget_amount and budget_amount > 0:
+ percentage = round(float(actual / budget_amount * 100), 1)
+
+ comparisons.append(BudgetVsActual(
+ category_id=category.id,
+ category_name=category.name,
+ category_icon=category.icon,
+ category_color=category.color,
+ group_id=group.id if group else None,
+ group_name=group.name if group else None,
+ budget_amount=budget_amount,
+ actual_amount=actual,
+ prev_month_amount=prev_actual,
+ percentage_used=percentage,
+ is_recurring=is_recurring,
+ ))
+
+ return sorted(comparisons, key=lambda x: float(x.actual_amount), reverse=True)
diff --git a/backend/app/services/category_group_service.py b/backend/app/services/category_group_service.py
new file mode 100644
index 00000000..8a8a67d3
--- /dev/null
+++ b/backend/app/services/category_group_service.py
@@ -0,0 +1,120 @@
+import uuid
+from typing import Optional
+
+from sqlalchemy import select, update
+from sqlalchemy.ext.asyncio import AsyncSession
+from sqlalchemy.orm import selectinload
+
+from app.models.category import Category
+from app.models.category_group import CategoryGroup
+from app.schemas.category_group import CategoryGroupCreate, CategoryGroupUpdate
+
+
+# Language-keyed translations for default groups
+# Keys are internal identifiers, values are {lang: display_name}
+DEFAULT_GROUPS_I18N = {
+ "housing": {"en": "Housing", "pt-BR": "Moradia", "icon": "house", "color": "#8B5CF6", "position": 0},
+ "food": {"en": "Food & Dining", "pt-BR": "Alimentação", "icon": "utensils-crossed", "color": "#F59E0B", "position": 1},
+ "transport": {"en": "Transport", "pt-BR": "Transporte", "icon": "car", "color": "#3B82F6", "position": 2},
+ "lifestyle": {"en": "Lifestyle", "pt-BR": "Estilo de Vida", "icon": "sparkles", "color": "#EC4899", "position": 3},
+ "income": {"en": "Income", "pt-BR": "Renda", "icon": "trending-up", "color": "#16A34A", "position": 5},
+ "other": {"en": "Other", "pt-BR": "Outros", "icon": "circle-help", "color": "#64748B", "position": 4},
+}
+
+# Maps category internal key -> group internal key
+CATEGORY_TO_GROUP = {
+ "housing": "housing",
+ "food": "food",
+ "groceries": "food",
+ "transport": "transport",
+ "health": "lifestyle",
+ "leisure": "lifestyle",
+ "education": "lifestyle",
+ "subscriptions": "other",
+ "salary": "income",
+ "shopping": "other",
+ "donations": "other",
+ "personal_care": "lifestyle",
+ "taxes": "other",
+ "transfers": "other",
+ "other": "other",
+}
+
+
+def _resolve_group_name(key: str, lang: str) -> str:
+ entry = DEFAULT_GROUPS_I18N.get(key, {})
+ return entry.get(lang, entry.get("en", key))
+
+
+async def create_default_groups(session: AsyncSession, user_id: uuid.UUID, lang: str = "pt-BR") -> dict[str, CategoryGroup]:
+ """Create default category groups for a user. Returns dict of internal_key -> group. Uses flush (not commit)."""
+ groups = {}
+ for key, data in DEFAULT_GROUPS_I18N.items():
+ name = data.get(lang, data.get("en", key))
+ group = CategoryGroup(
+ user_id=user_id,
+ name=name,
+ icon=data["icon"],
+ color=data["color"],
+ position=data["position"],
+ is_system=True,
+ )
+ session.add(group)
+ groups[key] = group
+ await session.flush()
+ return groups
+
+
+async def get_groups(session: AsyncSession, user_id: uuid.UUID) -> list[CategoryGroup]:
+ result = await session.execute(
+ select(CategoryGroup)
+ .where(CategoryGroup.user_id == user_id)
+ .options(selectinload(CategoryGroup.categories))
+ .order_by(CategoryGroup.position)
+ )
+ return list(result.scalars().all())
+
+
+async def get_group(session: AsyncSession, group_id: uuid.UUID, user_id: uuid.UUID) -> Optional[CategoryGroup]:
+ result = await session.execute(
+ select(CategoryGroup).where(CategoryGroup.id == group_id, CategoryGroup.user_id == user_id)
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_group(session: AsyncSession, user_id: uuid.UUID, data: CategoryGroupCreate) -> CategoryGroup:
+ group = CategoryGroup(user_id=user_id, **data.model_dump())
+ session.add(group)
+ await session.commit()
+ await session.refresh(group)
+ return group
+
+
+async def update_group(
+ session: AsyncSession, group_id: uuid.UUID, user_id: uuid.UUID, data: CategoryGroupUpdate
+) -> Optional[CategoryGroup]:
+ group = await get_group(session, group_id, user_id)
+ if not group:
+ return None
+
+ for key, value in data.model_dump(exclude_unset=True).items():
+ setattr(group, key, value)
+
+ await session.commit()
+ await session.refresh(group)
+ return group
+
+
+async def delete_group(session: AsyncSession, group_id: uuid.UUID, user_id: uuid.UUID) -> bool:
+ group = await get_group(session, group_id, user_id)
+ if not group or group.is_system:
+ return False
+
+ # Unlink children before deleting
+ await session.execute(
+ update(Category).where(Category.group_id == group_id).values(group_id=None)
+ )
+
+ await session.delete(group)
+ await session.commit()
+ return True
diff --git a/backend/app/services/category_service.py b/backend/app/services/category_service.py
new file mode 100644
index 00000000..372dad4c
--- /dev/null
+++ b/backend/app/services/category_service.py
@@ -0,0 +1,107 @@
+import uuid
+from typing import Optional
+
+from sqlalchemy import select
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.category import Category
+from app.schemas.category import CategoryCreate, CategoryUpdate
+from app.services.category_group_service import CATEGORY_TO_GROUP, create_default_groups
+
+
+# Language-keyed translations for default categories
+# Keys are internal identifiers used to map to groups and rules
+DEFAULT_CATEGORIES_I18N = {
+ "housing": {"en": "Housing", "pt-BR": "Moradia", "icon": "house", "color": "#8B5CF6"},
+ "food": {"en": "Food & Dining", "pt-BR": "Alimentação", "icon": "utensils-crossed", "color": "#F59E0B"},
+ "transport": {"en": "Transport", "pt-BR": "Transporte", "icon": "car", "color": "#3B82F6"},
+ "groceries": {"en": "Groceries", "pt-BR": "Mercado", "icon": "shopping-cart", "color": "#10B981"},
+ "health": {"en": "Health", "pt-BR": "Saúde", "icon": "pill", "color": "#EF4444"},
+ "leisure": {"en": "Leisure", "pt-BR": "Lazer", "icon": "gamepad-2", "color": "#EC4899"},
+ "subscriptions": {"en": "Subscriptions", "pt-BR": "Assinaturas", "icon": "smartphone", "color": "#6366F1"},
+ "education": {"en": "Education", "pt-BR": "Educação", "icon": "book-open", "color": "#22C55E"},
+ "transfers": {"en": "Transfers", "pt-BR": "Transferências", "icon": "arrow-left-right", "color": "#64748B"},
+ "salary": {"en": "Salary & Income", "pt-BR": "Salário & Renda", "icon": "banknote", "color": "#16A34A"},
+ "shopping": {"en": "Shopping", "pt-BR": "Compras", "icon": "shopping-bag", "color": "#F97316"},
+ "donations": {"en": "Donations", "pt-BR": "Doações", "icon": "heart-handshake", "color": "#D946EF"},
+ "personal_care": {"en": "Personal Care", "pt-BR": "Cuidados Pessoais", "icon": "scissors", "color": "#F472B6"},
+ "taxes": {"en": "Taxes & Fees", "pt-BR": "Impostos & Taxas", "icon": "landmark", "color": "#78716C"},
+ "other": {"en": "Other", "pt-BR": "Outros", "icon": "circle-help", "color": "#6B7280"},
+}
+
+
+async def create_default_categories(session: AsyncSession, user_id: uuid.UUID, lang: str = "pt-BR") -> list[Category]:
+ # Guard against double-creation (race between categories and groups endpoints)
+ existing = await session.execute(
+ select(Category).where(Category.user_id == user_id).limit(1)
+ )
+ if existing.scalar_one_or_none():
+ return await get_categories(session, user_id)
+
+ # Create default groups first
+ groups = await create_default_groups(session, user_id, lang)
+
+ categories = []
+ for key, data in DEFAULT_CATEGORIES_I18N.items():
+ name = data.get(lang, data.get("en", key))
+ group_key = CATEGORY_TO_GROUP.get(key)
+ group = groups.get(group_key) if group_key else None
+ category = Category(
+ user_id=user_id,
+ name=name,
+ icon=data["icon"],
+ color=data["color"],
+ is_system=True,
+ group_id=group.id if group else None,
+ )
+ session.add(category)
+ categories.append(category)
+ await session.commit()
+ return categories
+
+
+async def get_categories(session: AsyncSession, user_id: uuid.UUID) -> list[Category]:
+ result = await session.execute(
+ select(Category).where(Category.user_id == user_id).order_by(Category.is_system.desc(), Category.name)
+ )
+ return list(result.scalars().all())
+
+
+async def get_category(session: AsyncSession, category_id: uuid.UUID, user_id: uuid.UUID) -> Optional[Category]:
+ result = await session.execute(
+ select(Category).where(Category.id == category_id, Category.user_id == user_id)
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_category(session: AsyncSession, user_id: uuid.UUID, data: CategoryCreate) -> Category:
+ category = Category(user_id=user_id, **data.model_dump())
+ session.add(category)
+ await session.commit()
+ await session.refresh(category)
+ return category
+
+
+async def update_category(
+ session: AsyncSession, category_id: uuid.UUID, user_id: uuid.UUID, data: CategoryUpdate
+) -> Optional[Category]:
+ category = await get_category(session, category_id, user_id)
+ if not category:
+ return None
+
+ for key, value in data.model_dump(exclude_unset=True).items():
+ setattr(category, key, value)
+
+ await session.commit()
+ await session.refresh(category)
+ return category
+
+
+async def delete_category(session: AsyncSession, category_id: uuid.UUID, user_id: uuid.UUID) -> bool:
+ category = await get_category(session, category_id, user_id)
+ if not category or category.is_system:
+ return False
+
+ await session.delete(category)
+ await session.commit()
+ return True
diff --git a/backend/app/services/connection_service.py b/backend/app/services/connection_service.py
new file mode 100644
index 00000000..3f782f6c
--- /dev/null
+++ b/backend/app/services/connection_service.py
@@ -0,0 +1,372 @@
+import uuid
+from datetime import datetime, timedelta, timezone
+from typing import Optional
+
+from sqlalchemy import select
+from sqlalchemy.ext.asyncio import AsyncSession
+from sqlalchemy.orm import selectinload
+
+from app.core.config import get_settings
+from app.models.bank_connection import BankConnection
+from app.models.account import Account
+from app.models.category import Category
+from app.models.transaction import Transaction
+from app.providers import get_provider
+from app.services.rule_service import apply_rules_to_transaction
+from app.services.transfer_detection_service import detect_transfer_pairs
+
+settings = get_settings()
+
+PLUGGY_CATEGORY_MAP = {
+ "Eating out": "Alimentação",
+ "Restaurants": "Alimentação",
+ "Food": "Alimentação",
+ "Groceries": "Mercado",
+ "Supermarkets": "Mercado",
+ "Pharmacy": "Saúde",
+ "Health": "Saúde",
+ "Taxi and ride-hailing": "Transporte",
+ "Transport": "Transporte",
+ "Gas": "Transporte",
+ "Travel": "Transporte",
+ "Housing": "Moradia",
+ "Rent": "Moradia",
+ "Utilities": "Moradia",
+ "Entertainment": "Lazer",
+ "Leisure": "Lazer",
+ "Education": "Educação",
+ "Subscriptions": "Assinaturas",
+ "Online services": "Assinaturas",
+ "Transfer": "Transferências",
+ "Transfers": "Transferências",
+ "Wire transfers": "Transferências",
+}
+
+
+async def _match_pluggy_category(
+ session: AsyncSession, user_id: uuid.UUID, pluggy_category: Optional[str]
+) -> Optional[uuid.UUID]:
+ if not pluggy_category:
+ return None
+ # Try exact match first, then prefix before " - " (e.g. "Transfer - PIX" → "Transfer")
+ app_name = PLUGGY_CATEGORY_MAP.get(pluggy_category)
+ if not app_name and " - " in pluggy_category:
+ app_name = PLUGGY_CATEGORY_MAP.get(pluggy_category.split(" - ")[0])
+ if not app_name:
+ return None
+ result = await session.execute(
+ select(Category.id).where(Category.user_id == user_id, Category.name == app_name)
+ )
+ return result.scalar_one_or_none()
+
+
+async def get_connections(session: AsyncSession, user_id: uuid.UUID) -> list[BankConnection]:
+ result = await session.execute(
+ select(BankConnection)
+ .where(BankConnection.user_id == user_id)
+ .options(selectinload(BankConnection.accounts))
+ .order_by(BankConnection.created_at.desc())
+ )
+ return list(result.scalars().all())
+
+
+async def get_connection(
+ session: AsyncSession, connection_id: uuid.UUID, user_id: uuid.UUID
+) -> Optional[BankConnection]:
+ result = await session.execute(
+ select(BankConnection)
+ .where(BankConnection.id == connection_id, BankConnection.user_id == user_id)
+ .options(selectinload(BankConnection.accounts))
+ )
+ return result.scalar_one_or_none()
+
+
+def get_oauth_url(provider_name: str, user_id: uuid.UUID) -> str:
+ provider = get_provider(provider_name)
+ state = str(user_id)
+ return provider.get_oauth_url(settings.pluggy_oauth_redirect_uri, state)
+
+
+async def create_connect_token(
+ provider_name: str, user_id: uuid.UUID, item_id: str | None = None
+) -> dict:
+ provider = get_provider(provider_name)
+ token_data = await provider.create_connect_token(str(user_id), item_id=item_id)
+ return {"access_token": token_data.access_token}
+
+
+async def update_connection_settings(
+ session: AsyncSession,
+ connection_id: uuid.UUID,
+ user_id: uuid.UUID,
+ settings_update: dict,
+) -> Optional[BankConnection]:
+ connection = await get_connection(session, connection_id, user_id)
+ if not connection:
+ return None
+
+ current = dict(connection.settings or {})
+ for key, value in settings_update.items():
+ if value is not None:
+ current[key] = value
+ connection.settings = current
+
+ await session.commit()
+ await session.refresh(connection)
+ return connection
+
+
+async def handle_oauth_callback(
+ session: AsyncSession, user_id: uuid.UUID, code: str, provider_name: str
+) -> BankConnection:
+ provider = get_provider(provider_name)
+ connection_data = await provider.handle_oauth_callback(code)
+
+ connection = BankConnection(
+ user_id=user_id,
+ provider=provider_name,
+ external_id=connection_data.external_id,
+ institution_name=connection_data.institution_name,
+ credentials=connection_data.credentials,
+ status="active",
+ )
+ session.add(connection)
+ await session.flush()
+
+ new_tx_ids: list[uuid.UUID] = []
+
+ for acc_data in connection_data.accounts:
+ account = Account(
+ user_id=user_id,
+ connection_id=connection.id,
+ external_id=acc_data.external_id,
+ name=acc_data.name,
+ type=acc_data.type,
+ balance=acc_data.balance,
+ currency=acc_data.currency,
+ )
+ session.add(account)
+ await session.flush()
+
+ # Fetch initial transactions (since=None fetches all available history)
+ transactions_data = await provider.get_transactions(
+ connection_data.credentials, acc_data.external_id, None
+ )
+ for txn_data in transactions_data:
+ category_id = await _match_pluggy_category(
+ session, user_id, txn_data.pluggy_category
+ )
+ transaction = Transaction(
+ user_id=user_id,
+ account_id=account.id,
+ external_id=txn_data.external_id,
+ description=txn_data.description,
+ amount=txn_data.amount,
+ date=txn_data.date,
+ type=txn_data.type,
+ source="sync",
+ status=txn_data.status,
+ payee=txn_data.payee,
+ raw_data=txn_data.raw_data,
+ category_id=category_id,
+ )
+ session.add(transaction)
+ await session.flush()
+ new_tx_ids.append(transaction.id)
+ if not category_id:
+ await apply_rules_to_transaction(session, user_id, transaction)
+
+ # Detect transfer pairs among newly synced transactions
+ await detect_transfer_pairs(session, user_id, candidate_ids=new_tx_ids)
+
+ connection.last_sync_at = datetime.now(timezone.utc)
+ await session.commit()
+ await session.refresh(connection)
+ return connection
+
+
+def _description_similarity(a: str | None, b: str | None) -> float:
+ """Token overlap ratio between two descriptions."""
+ if not a or not b:
+ return 0.0
+ tokens_a = set(a.lower().split())
+ tokens_b = set(b.lower().split())
+ if not tokens_a or not tokens_b:
+ return 0.0
+ intersection = tokens_a & tokens_b
+ return len(intersection) / max(len(tokens_a), len(tokens_b))
+
+
+async def _fuzzy_match_manual(
+ session: AsyncSession,
+ account_id: uuid.UUID,
+ txn_data,
+) -> Optional[Transaction]:
+ """Try to find a manual transaction that matches the incoming synced one."""
+ date_lo = txn_data.date - timedelta(days=3)
+ date_hi = txn_data.date + timedelta(days=3)
+
+ result = await session.execute(
+ select(Transaction).where(
+ Transaction.account_id == account_id,
+ Transaction.external_id.is_(None),
+ Transaction.source == "manual",
+ Transaction.amount == txn_data.amount,
+ Transaction.type == txn_data.type,
+ Transaction.date >= date_lo,
+ Transaction.date <= date_hi,
+ )
+ )
+ candidates = result.scalars().all()
+ if not candidates:
+ return None
+
+ best_match = None
+ best_score = 0.0
+ for candidate in candidates:
+ score = _description_similarity(candidate.description, txn_data.description)
+ if score > best_score:
+ best_score = score
+ best_match = candidate
+
+ if best_match and best_score >= 0.6:
+ return best_match
+ return None
+
+
+async def sync_connection(
+ session: AsyncSession, connection_id: uuid.UUID, user_id: uuid.UUID
+) -> tuple[BankConnection, int]:
+ connection = await get_connection(session, connection_id, user_id)
+ if not connection:
+ raise ValueError("Connection not found")
+
+ conn_settings = connection.settings or {}
+ payee_source = conn_settings.get("payee_source", "auto")
+ import_pending = conn_settings.get("import_pending", True)
+
+ try:
+ provider = get_provider(connection.provider)
+
+ # Refresh credentials if needed
+ credentials = await provider.refresh_credentials(connection.credentials)
+ connection.credentials = credentials
+
+ # Update accounts
+ new_tx_ids: list[uuid.UUID] = []
+ merged_count = 0
+ accounts_data = await provider.get_accounts(credentials)
+ for acc_data in accounts_data:
+ result = await session.execute(
+ select(Account).where(
+ Account.connection_id == connection.id,
+ Account.external_id == acc_data.external_id,
+ )
+ )
+ account = result.scalar_one_or_none()
+
+ if account:
+ account.balance = acc_data.balance
+ account.name = acc_data.name
+ else:
+ account = Account(
+ user_id=user_id,
+ connection_id=connection.id,
+ external_id=acc_data.external_id,
+ name=acc_data.name,
+ type=acc_data.type,
+ balance=acc_data.balance,
+ currency=acc_data.currency,
+ )
+ session.add(account)
+ await session.flush()
+
+ if account and account.is_closed:
+ continue
+
+ # Fetch and sync transactions
+ since = connection.last_sync_at.date() if connection.last_sync_at else None
+ transactions_data = await provider.get_transactions(
+ credentials, acc_data.external_id, since, payee_source=payee_source
+ )
+
+ if not import_pending:
+ transactions_data = [t for t in transactions_data if t.status != "pending"]
+
+ for txn_data in transactions_data:
+ existing = await session.execute(
+ select(Transaction).where(
+ Transaction.account_id == account.id,
+ Transaction.external_id == txn_data.external_id,
+ )
+ )
+ existing_tx = existing.scalar_one_or_none()
+ if existing_tx:
+ if existing_tx.status == "pending" and txn_data.status == "posted":
+ existing_tx.status = "posted"
+ continue
+
+ # Pass 2: Fuzzy match against manual transactions
+ fuzzy_match = await _fuzzy_match_manual(session, account.id, txn_data)
+ if fuzzy_match:
+ fuzzy_match.external_id = txn_data.external_id
+ fuzzy_match.source = "sync"
+ fuzzy_match.raw_data = txn_data.raw_data
+ if not fuzzy_match.payee and txn_data.payee:
+ fuzzy_match.payee = txn_data.payee
+ merged_count += 1
+ continue
+
+ category_id = await _match_pluggy_category(
+ session, user_id, txn_data.pluggy_category
+ )
+ transaction = Transaction(
+ user_id=user_id,
+ account_id=account.id,
+ external_id=txn_data.external_id,
+ description=txn_data.description,
+ amount=txn_data.amount,
+ date=txn_data.date,
+ type=txn_data.type,
+ source="sync",
+ status=txn_data.status,
+ payee=txn_data.payee,
+ raw_data=txn_data.raw_data,
+ category_id=category_id,
+ )
+ session.add(transaction)
+ await session.flush()
+ new_tx_ids.append(transaction.id)
+ if not category_id:
+ await apply_rules_to_transaction(session, user_id, transaction)
+
+ # Detect transfer pairs among newly synced transactions
+ if new_tx_ids:
+ await detect_transfer_pairs(session, user_id, candidate_ids=new_tx_ids)
+
+ connection.last_sync_at = datetime.now(timezone.utc)
+ connection.status = "active"
+ await session.commit()
+ await session.refresh(connection)
+ return connection, merged_count
+
+ except Exception:
+ # Mark connection as errored so UI shows reconnect banner
+ await session.rollback()
+ async with session.begin():
+ conn = await session.get(BankConnection, connection_id)
+ if conn:
+ conn.status = "error"
+ raise
+
+
+async def delete_connection(
+ session: AsyncSession, connection_id: uuid.UUID, user_id: uuid.UUID
+) -> bool:
+ connection = await get_connection(session, connection_id, user_id)
+ if not connection:
+ return False
+
+ await session.delete(connection)
+ await session.commit()
+ return True
diff --git a/backend/app/services/dashboard_service.py b/backend/app/services/dashboard_service.py
new file mode 100644
index 00000000..c364361d
--- /dev/null
+++ b/backend/app/services/dashboard_service.py
@@ -0,0 +1,493 @@
+import uuid
+from datetime import date, timedelta
+from typing import Optional
+
+from sqlalchemy import select, func, case, or_
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.account import Account
+from app.models.bank_connection import BankConnection
+from app.models.transaction import Transaction
+from app.models.category import Category
+from app.models.recurring_transaction import RecurringTransaction
+from app.schemas.dashboard import DashboardSummary, SpendingByCategory, MonthlyTrend, ProjectedTransaction, DailyBalance, BalanceHistory
+from app.services.recurring_transaction_service import get_occurrences_in_range
+
+
+def _month_range(month: date) -> tuple[date, date]:
+ """Return (month_start, month_end) for a given date."""
+ month_start = month.replace(day=1)
+ if month.month == 12:
+ month_end = month.replace(year=month.year + 1, month=1, day=1)
+ else:
+ month_end = month.replace(month=month.month + 1, day=1)
+ return month_start, month_end
+
+
+async def _get_recurring_projections(
+ session: AsyncSession, user_id: uuid.UUID, month_start: date, month_end: date
+) -> list[dict]:
+ """Compute virtual recurring transaction projections for a month.
+ Pure read — no DB writes. Returns list of dicts with category_id, amount, type, currency."""
+ result = await session.execute(
+ select(RecurringTransaction)
+ .where(
+ RecurringTransaction.user_id == user_id,
+ RecurringTransaction.is_active == True,
+ RecurringTransaction.start_date < month_end,
+ )
+ )
+ recurring_list = list(result.scalars().all())
+
+ projections = []
+ for rec in recurring_list:
+ # Compute occurrences starting from next_occurrence (skips already-created transactions)
+ occurrences = get_occurrences_in_range(
+ start=rec.next_occurrence,
+ frequency=rec.frequency,
+ end_date=rec.end_date,
+ range_start=month_start,
+ range_end=month_end,
+ )
+ for occ_date in occurrences:
+ projections.append({
+ "category_id": rec.category_id,
+ "amount": float(rec.amount),
+ "type": rec.type,
+ "currency": rec.currency,
+ "date": occ_date,
+ })
+ return projections
+
+
+async def get_summary(
+ session: AsyncSession, user_id: uuid.UUID, month: Optional[date] = None,
+ balance_date: Optional[date] = None,
+) -> DashboardSummary:
+ if not month:
+ month = date.today().replace(day=1)
+
+ month_start, month_end = _month_range(month)
+ today = date.today()
+
+ # Compute the effective cutoff date for balance calculation
+ if balance_date:
+ cutoff = balance_date
+ elif month_end <= today:
+ # Past month: last day of that month
+ cutoff = month_end - timedelta(days=1)
+ else:
+ # Current or future month: today
+ cutoff = today
+
+ total_balance = await _total_balance_by_currency(session, user_id, cutoff)
+
+ # For current/future months, project the total balance by adding recurring
+ # projections from cutoff+1 through month_end.
+ if month_end > cutoff:
+ projection_start = cutoff + timedelta(days=1)
+ balance_projections = await _get_recurring_projections(
+ session, user_id, projection_start, month_end
+ )
+ for proj in balance_projections:
+ signed = proj["amount"] if proj["type"] == "credit" else -proj["amount"]
+ total_balance[proj["currency"]] = total_balance.get(proj["currency"], 0.0) + signed
+
+ # Monthly income and expenses — exclude opening_balance so initial deposits
+ # don't inflate the month's income figure. Also exclude transfer pairs.
+ monthly_result = await session.execute(
+ select(
+ func.sum(case((Transaction.type == "credit", Transaction.amount), else_=0)),
+ func.sum(case((Transaction.type == "debit", Transaction.amount), else_=0)),
+ )
+ .join(Account, Transaction.account_id == Account.id)
+ .where(
+ Transaction.user_id == user_id,
+ Account.is_closed == False,
+ Transaction.date >= month_start,
+ Transaction.date < month_end,
+ Transaction.source != "opening_balance",
+ Transaction.transfer_pair_id.is_(None),
+ )
+ )
+ monthly_row = monthly_result.one()
+ monthly_income = float(monthly_row[0] or 0)
+ monthly_expenses = float(monthly_row[1] or 0)
+
+ # Add virtual recurring projections
+ projections = await _get_recurring_projections(session, user_id, month_start, month_end)
+ for proj in projections:
+ if proj["type"] == "credit":
+ monthly_income += proj["amount"]
+ else:
+ monthly_expenses += proj["amount"]
+
+ # Account count — all accounts belonging to the user (manual + bank-connected)
+ accounts_count = await session.scalar(
+ select(func.count())
+ .select_from(Account)
+ .where(Account.user_id == user_id)
+ ) or 0
+
+ # Pending categorization — exclude opening_balance and transfer pairs
+ pending_cat_filters = [
+ Transaction.user_id == user_id,
+ Transaction.category_id.is_(None),
+ Transaction.source != "opening_balance",
+ Transaction.transfer_pair_id.is_(None),
+ ]
+ pending_categorization = await session.scalar(
+ select(func.count())
+ .select_from(Transaction)
+ .where(*pending_cat_filters)
+ ) or 0
+
+ pending_categorization_amount = abs(float(await session.scalar(
+ select(func.coalesce(func.sum(func.abs(Transaction.amount)), 0))
+ .select_from(Transaction)
+ .where(*pending_cat_filters)
+ ) or 0))
+
+ return DashboardSummary(
+ total_balance=total_balance,
+ balance_date=cutoff.isoformat(),
+ monthly_income=monthly_income,
+ monthly_expenses=abs(monthly_expenses),
+ accounts_count=accounts_count,
+ pending_categorization=pending_categorization,
+ pending_categorization_amount=pending_categorization_amount,
+ )
+
+
+async def get_spending_by_category(
+ session: AsyncSession, user_id: uuid.UUID, month: Optional[date] = None
+) -> list[SpendingByCategory]:
+ if not month:
+ month = date.today().replace(day=1)
+
+ month_start, month_end = _month_range(month)
+
+ # Real transactions grouped by category (exclude transfer pairs and closed accounts)
+ result = await session.execute(
+ select(
+ Category.id,
+ Category.name,
+ Category.icon,
+ Category.color,
+ func.sum(Transaction.amount),
+ )
+ .select_from(Transaction)
+ .join(Account, Transaction.account_id == Account.id)
+ .outerjoin(Category, Transaction.category_id == Category.id)
+ .where(
+ Transaction.user_id == user_id,
+ Account.is_closed == False,
+ Transaction.type == "debit",
+ Transaction.date >= month_start,
+ Transaction.date < month_end,
+ Transaction.transfer_pair_id.is_(None),
+ )
+ .group_by(Category.id, Category.name, Category.icon, Category.color)
+ .order_by(func.sum(Transaction.amount).desc())
+ )
+
+ # Build a dict of category_id -> {name, icon, color, total}
+ spending_map: dict[str | None, dict] = {}
+ for row in result.all():
+ cat_id = str(row[0]) if row[0] else None
+ spending_map[cat_id] = {
+ "name": row[1] or "Sem categoria",
+ "icon": row[2] or "circle-help",
+ "color": row[3] or "#6B7280",
+ "total": abs(float(row[4] or 0)),
+ }
+
+ # Add virtual recurring projections (debit only)
+ projections = await _get_recurring_projections(session, user_id, month_start, month_end)
+ # We need category info for recurring projections — fetch categories
+ cat_cache: dict[str, dict] = {}
+ for proj in projections:
+ if proj["type"] != "debit":
+ continue
+ cat_id = str(proj["category_id"]) if proj["category_id"] else None
+ if cat_id and cat_id not in cat_cache:
+ # Fetch category info
+ cat_result = await session.execute(
+ select(Category.name, Category.icon, Category.color)
+ .where(Category.id == proj["category_id"])
+ )
+ cat_row = cat_result.one_or_none()
+ if cat_row:
+ cat_cache[cat_id] = {"name": cat_row[0], "icon": cat_row[1], "color": cat_row[2]}
+ else:
+ cat_cache[cat_id] = {"name": "Sem categoria", "icon": "circle-help", "color": "#6B7280"}
+
+ if cat_id in spending_map:
+ spending_map[cat_id]["total"] += proj["amount"]
+ else:
+ info = cat_cache.get(cat_id, {"name": "Sem categoria", "icon": "circle-help", "color": "#6B7280"})
+ spending_map[cat_id] = {
+ "name": info["name"],
+ "icon": info["icon"],
+ "color": info["color"],
+ "total": proj["amount"],
+ }
+
+ # Convert to list and compute percentages
+ grand_total = sum(entry["total"] for entry in spending_map.values())
+ spending = []
+ for cat_id, entry in sorted(spending_map.items(), key=lambda x: x[1]["total"], reverse=True):
+ spending.append(SpendingByCategory(
+ category_id=cat_id,
+ category_name=entry["name"],
+ category_icon=entry["icon"],
+ category_color=entry["color"],
+ total=entry["total"],
+ percentage=(entry["total"] / grand_total * 100) if grand_total else 0,
+ ))
+
+ return spending
+
+
+async def get_monthly_trend(
+ session: AsyncSession, user_id: uuid.UUID, months: int = 6
+) -> list[MonthlyTrend]:
+ month_label = func.to_char(Transaction.date, 'YYYY-MM').label('month')
+ result = await session.execute(
+ select(
+ month_label,
+ func.sum(case((Transaction.type == "credit", Transaction.amount), else_=0)),
+ func.sum(case((Transaction.type == "debit", Transaction.amount), else_=0)),
+ )
+ .join(Account, Transaction.account_id == Account.id)
+ .where(
+ Transaction.user_id == user_id,
+ Account.is_closed == False,
+ Transaction.source != "opening_balance",
+ Transaction.transfer_pair_id.is_(None),
+ )
+ .group_by(month_label)
+ .order_by(month_label.desc())
+ .limit(months)
+ )
+
+ trends = []
+ for row in result.all():
+ trends.append(MonthlyTrend(
+ month=row[0],
+ income=float(row[1] or 0),
+ expenses=abs(float(row[2] or 0)),
+ ))
+
+ return list(reversed(trends))
+
+
+async def get_projected_transactions(
+ session: AsyncSession, user_id: uuid.UUID, month: Optional[date] = None
+) -> list[ProjectedTransaction]:
+ """Return virtual recurring transaction projections for a month,
+ enriched with description and category info for display."""
+ if not month:
+ month = date.today().replace(day=1)
+
+ month_start, month_end = _month_range(month)
+
+ result = await session.execute(
+ select(RecurringTransaction)
+ .where(
+ RecurringTransaction.user_id == user_id,
+ RecurringTransaction.is_active == True,
+ RecurringTransaction.start_date < month_end,
+ )
+ )
+ recurring_list = list(result.scalars().all())
+
+ # Pre-fetch categories for all recurring templates that have one
+ cat_ids = {r.category_id for r in recurring_list if r.category_id}
+ cat_map: dict[uuid.UUID, tuple[str, str, str]] = {}
+ if cat_ids:
+ cat_result = await session.execute(
+ select(Category.id, Category.name, Category.icon, Category.color)
+ .where(Category.id.in_(cat_ids))
+ )
+ for row in cat_result.all():
+ cat_map[row[0]] = (row[1], row[2], row[3])
+
+ projections: list[ProjectedTransaction] = []
+ for rec in recurring_list:
+ occurrences = get_occurrences_in_range(
+ start=rec.next_occurrence,
+ frequency=rec.frequency,
+ end_date=rec.end_date,
+ range_start=month_start,
+ range_end=month_end,
+ )
+ cat_name, cat_icon, cat_color = cat_map.get(rec.category_id, (None, None, None)) if rec.category_id else (None, None, None)
+ for occ_date in occurrences:
+ projections.append(ProjectedTransaction(
+ recurring_id=str(rec.id),
+ description=rec.description,
+ amount=float(rec.amount),
+ currency=rec.currency,
+ type=rec.type,
+ date=occ_date.isoformat(),
+ category_id=str(rec.category_id) if rec.category_id else None,
+ category_name=cat_name,
+ category_icon=cat_icon,
+ category_color=cat_color,
+ ))
+
+ return projections
+
+
+def _signed_balance_expr():
+ """Reusable SQL expression: credit → +amount, debit → −amount."""
+ return case(
+ (Transaction.type == "credit", Transaction.amount),
+ else_=-Transaction.amount,
+ )
+
+
+async def _get_open_accounts(
+ session: AsyncSession, user_id: uuid.UUID
+) -> list[Account]:
+ """Get all non-closed accounts for a user."""
+ result = await session.execute(
+ select(Account)
+ .outerjoin(BankConnection)
+ .where(
+ or_(Account.user_id == user_id, BankConnection.user_id == user_id),
+ Account.is_closed == False,
+ )
+ )
+ return [row[0] for row in result.all()]
+
+
+async def _account_balance_at(
+ session: AsyncSession, account: Account, cutoff: date
+) -> float:
+ """Get balance for a single account at a specific date.
+
+ For bank-connected accounts, backtrack from the provider's current balance
+ by subtracting transaction deltas that occurred after the cutoff.
+ For manual accounts, sum transactions up to the cutoff date.
+ """
+ if account.connection_id:
+ # Start from the provider's authoritative current balance
+ current_bal = float(account.balance)
+ if account.type == "credit_card":
+ current_bal = -current_bal
+ # Subtract activity after cutoff to get the balance AT cutoff
+ delta_after = await session.scalar(
+ select(func.coalesce(func.sum(_signed_balance_expr()), 0))
+ .where(
+ Transaction.account_id == account.id,
+ Transaction.date > cutoff,
+ )
+ )
+ return current_bal - float(delta_after or 0)
+ else:
+ result = await session.scalar(
+ select(func.coalesce(func.sum(_signed_balance_expr()), 0))
+ .where(
+ Transaction.account_id == account.id,
+ Transaction.date <= cutoff,
+ )
+ )
+ return float(result or 0)
+
+
+async def _total_balance_by_currency(
+ session: AsyncSession, user_id: uuid.UUID, cutoff: date
+) -> dict[str, float]:
+ """Get total balance across all open accounts at a date, grouped by currency."""
+ accounts = await _get_open_accounts(session, user_id)
+ totals: dict[str, float] = {}
+ for account in accounts:
+ bal = await _account_balance_at(session, account, cutoff)
+ totals[account.currency] = totals.get(account.currency, 0) + bal
+ return totals
+
+
+async def _balance_at(
+ session: AsyncSession, user_id: uuid.UUID, cutoff: date
+) -> float:
+ """Get total balance across all open accounts at a specific date (single currency sum)."""
+ totals = await _total_balance_by_currency(session, user_id, cutoff)
+ return sum(totals.values())
+
+
+async def _daily_deltas(
+ session: AsyncSession, user_id: uuid.UUID, start: date, end: date
+) -> dict[int, float]:
+ """Get daily balance deltas for a date range [start, end)."""
+ result = await session.execute(
+ select(
+ func.extract("day", Transaction.date).label("day"),
+ func.sum(_signed_balance_expr()),
+ )
+ .join(Account, Transaction.account_id == Account.id)
+ .where(
+ Transaction.user_id == user_id,
+ Account.is_closed == False,
+ Transaction.date >= start,
+ Transaction.date < end,
+ )
+ .group_by("day")
+ )
+ return {int(row[0]): float(row[1] or 0) for row in result.all()}
+
+
+async def get_balance_history(
+ session: AsyncSession, user_id: uuid.UUID, month: Optional[date] = None
+) -> BalanceHistory:
+ if not month:
+ month = date.today().replace(day=1)
+
+ month_start, month_end = _month_range(month)
+ prev_month_start = (month_start - timedelta(days=1)).replace(day=1)
+ prev_month_end = month_start
+
+ today = date.today()
+ is_current = month_start.year == today.year and month_start.month == today.month
+ days_in_month = (month_end - month_start).days
+ cutoff_day = today.day if is_current else days_in_month
+
+ prev_days_in_month = (prev_month_end - prev_month_start).days
+
+ # Starting balances
+ current_start = await _balance_at(session, user_id, month_start - timedelta(days=1))
+ prev_start = await _balance_at(session, user_id, prev_month_start - timedelta(days=1))
+
+ # Daily deltas from real transactions
+ current_deltas = await _daily_deltas(session, user_id, month_start, month_end)
+ prev_deltas = await _daily_deltas(session, user_id, prev_month_start, prev_month_end)
+
+ # Recurring projections for future days of current month
+ proj_deltas: dict[int, float] = {}
+ if month_end > today:
+ proj_start = max(month_start, today + timedelta(days=1))
+ projections = await _get_recurring_projections(session, user_id, proj_start, month_end)
+ for proj in projections:
+ day = proj["date"].day
+ signed = proj["amount"] if proj["type"] == "credit" else -proj["amount"]
+ proj_deltas[day] = proj_deltas.get(day, 0) + signed
+
+ # Build current month daily balances
+ current_daily = []
+ balance = current_start
+ for day in range(1, days_in_month + 1):
+ balance += current_deltas.get(day, 0) + proj_deltas.get(day, 0)
+ current_daily.append(DailyBalance(
+ day=day,
+ balance=round(balance, 2) if day <= cutoff_day else None,
+ ))
+
+ # Build previous month daily balances
+ prev_daily = []
+ balance = prev_start
+ for day in range(1, prev_days_in_month + 1):
+ balance += prev_deltas.get(day, 0)
+ prev_daily.append(DailyBalance(day=day, balance=round(balance, 2)))
+
+ return BalanceHistory(current=current_daily, previous=prev_daily)
diff --git a/backend/app/services/import_service.py b/backend/app/services/import_service.py
new file mode 100644
index 00000000..b8788fd6
--- /dev/null
+++ b/backend/app/services/import_service.py
@@ -0,0 +1,358 @@
+import csv
+import io
+import re
+import uuid
+import xml.etree.ElementTree as ET
+from datetime import datetime
+from decimal import Decimal
+
+from ofxparse import OfxParser
+from sqlalchemy import select
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.transaction import Transaction
+from app.schemas.transaction import TransactionBase
+from app.services.rule_service import apply_rules_to_transaction
+
+
+def parse_ofx(content: bytes) -> list[TransactionBase]:
+ """Parse OFX file content and return transactions."""
+ ofx = OfxParser.parse(io.BytesIO(content))
+ transactions = []
+
+ for account in ofx.accounts:
+ for txn in account.statement.transactions:
+ transactions.append(TransactionBase(
+ description=txn.memo or txn.payee or "Unknown",
+ amount=abs(Decimal(str(txn.amount))),
+ date=txn.date.date() if hasattr(txn.date, 'date') else txn.date,
+ type="credit" if txn.amount > 0 else "debit",
+ ))
+
+ return transactions
+
+
+def parse_qif(content: bytes) -> list[TransactionBase]:
+ """Parse QIF file content and return transactions."""
+ text = content.decode('utf-8-sig')
+ transactions = []
+
+ # Split into transaction blocks by "^"
+ blocks = text.split('^')
+ for block in blocks:
+ lines = block.strip().splitlines()
+ if not lines:
+ continue
+
+ txn_date = None
+ amount = None
+ payee = None
+ memo = None
+
+ for line in lines:
+ line = line.strip()
+ if not line:
+ continue
+ tag, value = line[0], line[1:]
+ if tag == 'D':
+ # Try common date formats
+ for fmt in ['%m/%d/%Y', '%d/%m/%Y', '%Y-%m-%d', "%m/%d'%Y"]:
+ try:
+ txn_date = datetime.strptime(value.strip(), fmt).date()
+ break
+ except ValueError:
+ continue
+ elif tag == 'T' or tag == 'U':
+ try:
+ amount = Decimal(value.strip().replace(',', ''))
+ except Exception:
+ pass
+ elif tag == 'P':
+ payee = value.strip()
+ elif tag == 'M':
+ memo = value.strip()
+
+ if txn_date is None or amount is None:
+ continue
+
+ description = payee or memo or "Unknown"
+ transactions.append(TransactionBase(
+ description=description,
+ amount=abs(amount),
+ date=txn_date,
+ type="credit" if amount > 0 else "debit",
+ ))
+
+ return transactions
+
+
+def parse_camt(content: bytes) -> list[TransactionBase]:
+ """Parse CAMT.053 (ISO 20022) XML file content and return transactions."""
+ root = ET.fromstring(content)
+
+ # Detect namespace dynamically
+ ns_match = re.match(r'\{(.+?)\}', root.tag)
+ ns = ns_match.group(1) if ns_match else ''
+ nsmap = {'ns': ns} if ns else {}
+
+ def find(element, path):
+ """Find element with or without namespace."""
+ if nsmap:
+ parts = path.split('/')
+ ns_path = '/'.join(f'ns:{p}' for p in parts)
+ return element.find(ns_path, nsmap)
+ return element.find(path)
+
+ def findall(element, path):
+ if nsmap:
+ parts = path.split('/')
+ ns_path = '/'.join(f'ns:{p}' for p in parts)
+ return element.findall(ns_path, nsmap)
+ return element.findall(path)
+
+ def find_text(element, path):
+ el = find(element, path)
+ return el.text if el is not None else None
+
+ transactions = []
+
+ # Navigate: Document > BkToCstmrStmt > Stmt > Ntry
+ for stmt in findall(root, 'BkToCstmrStmt/Stmt'):
+ for ntry in findall(stmt, 'Ntry'):
+ # Amount
+ amt_el = find(ntry, 'Amt')
+ if amt_el is None:
+ continue
+ try:
+ amount = Decimal(amt_el.text)
+ except Exception:
+ continue
+
+ # Credit/Debit indicator
+ cdt_dbt = find_text(ntry, 'CdtDbtInd')
+ txn_type = "credit" if cdt_dbt == "CRDT" else "debit"
+
+ # Date: try BookgDt/Dt then ValDt/Dt
+ date_str = find_text(ntry, 'BookgDt/Dt') or find_text(ntry, 'ValDt/Dt')
+ if not date_str:
+ continue
+ try:
+ txn_date = datetime.strptime(date_str.strip(), '%Y-%m-%d').date()
+ except ValueError:
+ continue
+
+ # Description from various paths
+ description = (
+ find_text(ntry, 'NtryDtls/TxDtls/RmtInf/Ustrd')
+ or find_text(ntry, 'NtryDtls/TxDtls/RltdPties/Cdtr/Nm')
+ or find_text(ntry, 'NtryDtls/TxDtls/RltdPties/Dbtr/Nm')
+ or find_text(ntry, 'AddtlNtryInf')
+ or "Unknown"
+ )
+
+ transactions.append(TransactionBase(
+ description=description,
+ amount=abs(amount),
+ date=txn_date,
+ type=txn_type,
+ ))
+
+ return transactions
+
+
+DATE_FORMAT_MAP = {
+ 'DD/MM/YYYY': '%d/%m/%Y',
+ 'MM/DD/YYYY': '%m/%d/%Y',
+ 'YYYY-MM-DD': '%Y-%m-%d',
+}
+
+
+def parse_csv(
+ content: bytes,
+ date_format: str | None = None,
+ flip_amount: bool = False,
+ inflow_column: str | None = None,
+ outflow_column: str | None = None,
+) -> list[TransactionBase]:
+ """Parse CSV file content and return transactions.
+
+ Attempts to detect common column formats:
+ - date, description, amount
+ - data, descricao, valor (Portuguese)
+
+ Options:
+ - date_format: explicit date format (DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD)
+ - flip_amount: negate all parsed amounts
+ - inflow_column/outflow_column: use split columns instead of single amount
+ """
+ text = content.decode('utf-8-sig') # Handle BOM
+ reader = csv.DictReader(io.StringIO(text))
+
+ # Normalize field names
+ fieldnames = [f.lower().strip() for f in (reader.fieldnames or [])]
+
+ # Map common column names
+ date_cols = ['date', 'data', 'dt', 'transaction_date', 'data_transacao']
+ desc_cols = ['description', 'descricao', 'desc', 'memo', 'historico', 'lancamento']
+ amount_cols = ['amount', 'valor', 'value', 'quantia']
+
+ def find_col(candidates):
+ for c in candidates:
+ if c in fieldnames:
+ return c
+ return None
+
+ date_col = find_col(date_cols)
+ desc_col = find_col(desc_cols)
+
+ # In split mode, we don't require a single amount column
+ use_split = inflow_column and outflow_column
+ inflow_col = inflow_column.lower().strip() if inflow_column else None
+ outflow_col = outflow_column.lower().strip() if outflow_column else None
+
+ if use_split:
+ if inflow_col not in fieldnames or outflow_col not in fieldnames:
+ raise ValueError(f"Inflow/outflow columns not found in CSV. Available: {fieldnames}")
+ amount_col = None
+ else:
+ amount_col = find_col(amount_cols)
+
+ if not date_col or not desc_col:
+ raise ValueError("Could not detect CSV columns. Expected: date, description, amount")
+ if not use_split and not amount_col:
+ raise ValueError("Could not detect CSV columns. Expected: date, description, amount")
+
+ # Determine date formats to try
+ if date_format and date_format in DATE_FORMAT_MAP:
+ date_formats = [DATE_FORMAT_MAP[date_format]]
+ else:
+ date_formats = ['%Y-%m-%d', '%d/%m/%Y', '%d-%m-%Y', '%m/%d/%Y']
+
+ transactions = []
+ for row in reader:
+ # Normalize row keys
+ row = {k.lower().strip(): v for k, v in row.items()}
+
+ # Parse date
+ date_str = row[date_col].strip()
+ txn_date = None
+ for fmt in date_formats:
+ try:
+ txn_date = datetime.strptime(date_str, fmt).date()
+ break
+ except ValueError:
+ continue
+
+ if not txn_date:
+ continue # Skip invalid dates
+
+ # Parse amount
+ if use_split:
+ inflow_str = row.get(inflow_col, '').strip().replace(',', '.').replace('R$', '').strip()
+ outflow_str = row.get(outflow_col, '').strip().replace(',', '.').replace('R$', '').strip()
+ try:
+ inflow = Decimal(inflow_str) if inflow_str else Decimal('0')
+ except Exception:
+ inflow = Decimal('0')
+ try:
+ outflow = Decimal(outflow_str) if outflow_str else Decimal('0')
+ except Exception:
+ outflow = Decimal('0')
+
+ if inflow > 0:
+ amount = inflow
+ txn_type = "credit"
+ elif outflow > 0:
+ amount = outflow
+ txn_type = "debit"
+ else:
+ continue # Skip rows with no amount
+ else:
+ amount_str = row[amount_col].strip().replace(',', '.').replace('R$', '').strip()
+ try:
+ amount = Decimal(amount_str)
+ except Exception:
+ continue # Skip invalid amounts
+
+ if flip_amount:
+ amount = -amount
+
+ txn_type = "credit" if amount > 0 else "debit"
+ amount = abs(amount)
+
+ transactions.append(TransactionBase(
+ description=row[desc_col].strip(),
+ amount=abs(amount),
+ date=txn_date,
+ type=txn_type,
+ ))
+
+ return transactions
+
+
+async def import_transactions(
+ session: AsyncSession,
+ user_id: uuid.UUID,
+ account_id: uuid.UUID,
+ transactions: list[TransactionBase],
+ source: str,
+ filename: str = "",
+ detected_format: str = "",
+) -> tuple[int, int, uuid.UUID]:
+ """Import transactions into an account. Returns (imported, skipped, import_log_id)."""
+ from app.models.import_log import ImportLog
+
+ # Calculate summaries
+ total_credit = sum(t.amount for t in transactions if t.type == "credit")
+ total_debit = sum(t.amount for t in transactions if t.type == "debit")
+
+ # Create import log first to get its ID
+ import_log = ImportLog(
+ user_id=user_id,
+ account_id=account_id,
+ filename=filename,
+ format=detected_format,
+ transaction_count=len(transactions),
+ total_credit=total_credit,
+ total_debit=total_debit,
+ )
+ session.add(import_log)
+ await session.flush() # Get the import_log.id
+
+ imported = 0
+ skipped = 0
+ for txn_data in transactions:
+ # Duplicate detection: check for existing transaction with same key fields
+ existing = await session.execute(
+ select(Transaction).where(
+ Transaction.account_id == account_id,
+ Transaction.date == txn_data.date,
+ Transaction.amount == txn_data.amount,
+ Transaction.type == txn_data.type,
+ Transaction.description == txn_data.description,
+ )
+ )
+ if existing.scalar_one_or_none():
+ skipped += 1
+ continue
+
+ transaction = Transaction(
+ user_id=user_id,
+ account_id=account_id,
+ description=txn_data.description,
+ amount=txn_data.amount,
+ date=txn_data.date,
+ type=txn_data.type,
+ source=source,
+ import_id=import_log.id,
+ )
+ session.add(transaction)
+ await session.flush()
+ await apply_rules_to_transaction(session, user_id, transaction)
+ imported += 1
+
+ # Update import log with actual imported count
+ import_log.transaction_count = imported
+
+ await session.commit()
+ return imported, skipped, import_log.id
diff --git a/backend/app/services/recurring_transaction_service.py b/backend/app/services/recurring_transaction_service.py
new file mode 100644
index 00000000..7e5ecf4e
--- /dev/null
+++ b/backend/app/services/recurring_transaction_service.py
@@ -0,0 +1,188 @@
+import calendar
+import uuid
+from datetime import date, timedelta
+from typing import Optional
+
+from sqlalchemy import select
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.recurring_transaction import RecurringTransaction
+from app.models.transaction import Transaction
+from app.schemas.recurring_transaction import RecurringTransactionCreate, RecurringTransactionUpdate
+
+
+async def get_recurring_transactions(
+ session: AsyncSession, user_id: uuid.UUID
+) -> list[RecurringTransaction]:
+ result = await session.execute(
+ select(RecurringTransaction)
+ .where(RecurringTransaction.user_id == user_id)
+ .order_by(RecurringTransaction.next_occurrence)
+ )
+ return list(result.scalars().all())
+
+
+async def get_recurring_transaction(
+ session: AsyncSession, recurring_id: uuid.UUID, user_id: uuid.UUID
+) -> Optional[RecurringTransaction]:
+ result = await session.execute(
+ select(RecurringTransaction)
+ .where(RecurringTransaction.id == recurring_id, RecurringTransaction.user_id == user_id)
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_recurring_transaction(
+ session: AsyncSession, user_id: uuid.UUID, data: RecurringTransactionCreate
+) -> RecurringTransaction:
+ next_occ = data.start_date
+ if data.skip_first:
+ next_occ = _advance_date(data.start_date, data.frequency)
+ recurring = RecurringTransaction(
+ user_id=user_id,
+ account_id=data.account_id,
+ category_id=data.category_id,
+ description=data.description,
+ amount=data.amount,
+ currency=data.currency,
+ type=data.type,
+ frequency=data.frequency,
+ day_of_month=data.day_of_month,
+ start_date=data.start_date,
+ end_date=data.end_date,
+ next_occurrence=next_occ,
+ )
+ session.add(recurring)
+ await session.commit()
+ await session.refresh(recurring)
+ return recurring
+
+
+async def update_recurring_transaction(
+ session: AsyncSession, recurring_id: uuid.UUID, user_id: uuid.UUID, data: RecurringTransactionUpdate
+) -> Optional[RecurringTransaction]:
+ recurring = await get_recurring_transaction(session, recurring_id, user_id)
+ if not recurring:
+ return None
+
+ for key, value in data.model_dump(exclude_unset=True).items():
+ setattr(recurring, key, value)
+
+ await session.commit()
+ await session.refresh(recurring)
+ return recurring
+
+
+async def delete_recurring_transaction(
+ session: AsyncSession, recurring_id: uuid.UUID, user_id: uuid.UUID
+) -> bool:
+ recurring = await get_recurring_transaction(session, recurring_id, user_id)
+ if not recurring:
+ return False
+
+ await session.delete(recurring)
+ await session.commit()
+ return True
+
+
+def _advance_date(current: date, frequency: str) -> date:
+ """Advance a date by the given frequency."""
+ if frequency == "weekly":
+ return current + timedelta(weeks=1)
+ elif frequency == "monthly":
+ month = current.month + 1
+ year = current.year
+ if month > 12:
+ month = 1
+ year += 1
+ day = min(current.day, calendar.monthrange(year, month)[1])
+ return date(year, month, day)
+ elif frequency == "yearly":
+ year = current.year + 1
+ day = min(current.day, calendar.monthrange(year, current.month)[1])
+ return date(year, current.month, day)
+ # Default: monthly
+ month = current.month + 1
+ year = current.year
+ if month > 12:
+ month = 1
+ year += 1
+ day = min(current.day, calendar.monthrange(year, month)[1])
+ return date(year, month, day)
+
+
+def get_occurrences_in_range(
+ start: date, frequency: str, end_date: Optional[date],
+ range_start: date, range_end: date,
+) -> list[date]:
+ """Compute all occurrence dates for a recurring pattern within [range_start, range_end).
+ Pure date math — no DB writes. Used by dashboard for virtual projections."""
+ occurrences: list[date] = []
+ current = start
+ # Advance to range_start without collecting
+ while current < range_start:
+ if end_date and current > end_date:
+ return occurrences
+ current = _advance_date(current, frequency)
+ # Collect occurrences within range
+ while current < range_end:
+ if end_date and current > end_date:
+ break
+ occurrences.append(current)
+ current = _advance_date(current, frequency)
+ if len(occurrences) > 200: # safety limit
+ break
+ return occurrences
+
+
+async def generate_pending(
+ session: AsyncSession, user_id: uuid.UUID, up_to: Optional[date] = None
+) -> int:
+ """Generate transactions for all pending recurring transactions up to a given date.
+ If up_to is None, defaults to today. This allows the dashboard to pre-generate
+ transactions for future months when the user navigates ahead.
+ Returns the count of transactions generated."""
+ cutoff = up_to or date.today()
+
+ result = await session.execute(
+ select(RecurringTransaction)
+ .where(
+ RecurringTransaction.user_id == user_id,
+ RecurringTransaction.is_active == True,
+ RecurringTransaction.next_occurrence <= cutoff,
+ )
+ )
+ recurring_list = list(result.scalars().all())
+
+ count = 0
+ for recurring in recurring_list:
+ # Generate transactions until next_occurrence is past the cutoff
+ while recurring.next_occurrence <= cutoff:
+ # Check if past end_date
+ if recurring.end_date and recurring.next_occurrence > recurring.end_date:
+ recurring.is_active = False
+ break
+
+ transaction = Transaction(
+ user_id=user_id,
+ account_id=recurring.account_id,
+ category_id=recurring.category_id,
+ description=recurring.description,
+ amount=recurring.amount,
+ currency=recurring.currency,
+ date=recurring.next_occurrence,
+ type=recurring.type,
+ source="recurring",
+ )
+ session.add(transaction)
+ count += 1
+
+ # Advance to next occurrence
+ recurring.next_occurrence = _advance_date(recurring.next_occurrence, recurring.frequency)
+
+ # Check again if past end_date after advancing
+ if recurring.end_date and recurring.next_occurrence > recurring.end_date:
+ recurring.is_active = False
+
+ await session.commit()
+ return count
diff --git a/backend/app/services/rule_engine.py b/backend/app/services/rule_engine.py
new file mode 100644
index 00000000..fc0e089f
--- /dev/null
+++ b/backend/app/services/rule_engine.py
@@ -0,0 +1,99 @@
+"""Pure rule evaluation engine — no DB access."""
+import re
+import uuid
+from decimal import Decimal, InvalidOperation
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from app.models.transaction import Transaction
+
+
+def _to_decimal(val) -> Decimal:
+ try:
+ return Decimal(str(val))
+ except InvalidOperation:
+ return Decimal("0")
+
+
+def _match_condition(condition: dict, tx: "Transaction") -> bool:
+ field = condition.get("field", "")
+ op = condition.get("op", "")
+ value = condition.get("value")
+
+ tx_val = getattr(tx, field, None)
+
+ # String operators
+ if op in ("contains", "not_contains", "starts_with", "ends_with", "equals", "not_equals", "regex"):
+ tx_str = str(tx_val or "").upper()
+ val_str = str(value or "").upper()
+
+ if op == "contains":
+ return val_str in tx_str
+ if op == "not_contains":
+ return val_str not in tx_str
+ if op == "starts_with":
+ return tx_str.startswith(val_str)
+ if op == "ends_with":
+ return tx_str.endswith(val_str)
+ if op == "equals":
+ return tx_str == val_str
+ if op == "not_equals":
+ return tx_str != val_str
+ if op == "regex":
+ try:
+ return bool(re.search(str(value), str(tx_val or ""), re.IGNORECASE))
+ except re.error:
+ return False
+
+ # Numeric operators
+ if op in ("gt", "gte", "lt", "lte"):
+ tx_num = _to_decimal(tx_val)
+ val_num = _to_decimal(value)
+ if op == "gt":
+ return tx_num > val_num
+ if op == "gte":
+ return tx_num >= val_num
+ if op == "lt":
+ return tx_num < val_num
+ if op == "lte":
+ return tx_num <= val_num
+
+ return False
+
+
+def evaluate_conditions(conditions_op: str, conditions: list[dict], tx: "Transaction") -> bool:
+ """Return True if the transaction matches the rule's conditions."""
+ if not conditions:
+ return False
+ results = [_match_condition(c, tx) for c in conditions]
+ if conditions_op == "or":
+ return any(results)
+ return all(results) # "and" is default
+
+
+def apply_rule_actions(
+ actions: list[dict],
+ tx: "Transaction",
+ category_already_set: bool,
+) -> bool:
+ """Apply actions to transaction in-place. Returns updated category_already_set flag."""
+ for action in actions:
+ op = action.get("op")
+ value = action.get("value")
+
+ if op == "set_category" and not category_already_set:
+ try:
+ tx.category_id = uuid.UUID(str(value))
+ category_already_set = True
+ except (ValueError, AttributeError):
+ pass
+
+ elif op == "append_notes":
+ new_tags = str(value or "").strip()
+ if not new_tags:
+ continue
+ existing = tx.notes or ""
+ if new_tags not in existing:
+ tx.notes = (existing + " " + new_tags).strip() if existing else new_tags
+
+ return category_already_set
diff --git a/backend/app/services/rule_service.py b/backend/app/services/rule_service.py
new file mode 100644
index 00000000..673c2075
--- /dev/null
+++ b/backend/app/services/rule_service.py
@@ -0,0 +1,682 @@
+# backend/app/services/rule_service.py
+import uuid
+from typing import Optional
+
+from sqlalchemy import select
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.rule import Rule
+from app.models.category import Category
+from app.models.transaction import Transaction
+from app.schemas.rule import RuleCreate, RuleUpdate
+from app.services.rule_engine import evaluate_conditions, apply_rule_actions
+from app.services.category_service import DEFAULT_CATEGORIES_I18N
+
+
+class DuplicateRuleError(Exception):
+ """Raised when a rule with the same name already exists for a user."""
+ pass
+
+
+# ─── Universal rules (work for any language/country) ───
+# Category values here use internal keys (e.g. "transport") that get resolved to the
+# user's actual category name at creation time.
+UNIVERSAL_RULES = [
+ {"name": "Streaming (Netflix, Spotify, Disney+)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "NETFLIX"},
+ {"field": "description", "op": "starts_with", "value": "SPOTIFY"},
+ {"field": "description", "op": "starts_with", "value": "DISNEY"},
+ ], "actions": [{"op": "set_category", "value": "subscriptions"}], "priority": 10},
+
+ {"name": "Uber", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "UBER"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Amazon", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "AMAZON"},
+ ], "actions": [{"op": "set_category", "value": "shopping"}], "priority": 10},
+
+ {"name": "Apple / Google Subscriptions", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "APPLE.COM/BILL"},
+ {"field": "description", "op": "starts_with", "value": "GOOGLE *"},
+ ], "actions": [{"op": "set_category", "value": "subscriptions"}], "priority": 10},
+
+ {"name": "Salary / Payroll", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "SALARY|PAYROLL|DIRECT DEPOSIT"},
+ ], "actions": [{"op": "set_category", "value": "salary"}], "priority": 10},
+]
+
+# ─── Country-specific rule packs (optional, not auto-applied) ───
+RULE_PACKS = {
+ "BR": {
+ "name": "Brazil",
+ "flag": "\U0001F1E7\U0001F1F7",
+ "rules": [
+ {"name": "99 (Ride-hailing)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "99"},
+ {"field": "description", "op": "starts_with", "value": "99POP"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "iFood / Rappi", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "IFOOD"},
+ {"field": "description", "op": "starts_with", "value": "RAPPI"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Mercado Livre", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "MERCADOLIVRE"},
+ {"field": "description", "op": "starts_with", "value": "MERCADO LIVRE"},
+ ], "actions": [{"op": "set_category", "value": "shopping"}], "priority": 10},
+
+ {"name": "Pix Recebido", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "PIX.*RECEBIDO"},
+ ], "actions": [{"op": "set_category", "value": "transfers"}], "priority": 50},
+
+ {"name": "Transferência", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "contains", "value": "TRANSFERENCIA"},
+ ], "actions": [{"op": "set_category", "value": "transfers"}], "priority": 90},
+
+ {"name": "Shopee / Magazine Luiza", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "SHOPEE"},
+ {"field": "description", "op": "starts_with", "value": "MAGALU"},
+ {"field": "description", "op": "starts_with", "value": "MAGAZINE LUIZA"},
+ ], "actions": [{"op": "set_category", "value": "shopping"}], "priority": 10},
+
+ {"name": "Drogaria / Farmácia", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "DROGARIA"},
+ {"field": "description", "op": "contains", "value": "FARMACIA"},
+ {"field": "description", "op": "contains", "value": "DROGA RAIA"},
+ {"field": "description", "op": "contains", "value": "DROGASIL"},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "Uber Eats", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "UBER EATS"},
+ {"field": "description", "op": "starts_with", "value": "UBEREATS"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 5},
+
+ {"name": "Claro / Vivo / Tim", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "CLARO"},
+ {"field": "description", "op": "starts_with", "value": "VIVO"},
+ {"field": "description", "op": "starts_with", "value": "TIM"},
+ ], "actions": [{"op": "set_category", "value": "subscriptions"}], "priority": 10},
+
+ {"name": "Posto / Shell (Combustível)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "POSTO"},
+ {"field": "description", "op": "starts_with", "value": "SHELL"},
+ {"field": "description", "op": "contains", "value": "COMBUSTIVEL"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Supermercado / Carrefour / Assaí", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "SUPERMERCADO"},
+ {"field": "description", "op": "starts_with", "value": "CARREFOUR"},
+ {"field": "description", "op": "starts_with", "value": "ASSAI"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "Smart Fit / Academia", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "SMART FIT"},
+ {"field": "description", "op": "contains", "value": "ACADEMIA"},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "Aluguel", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "ALUGUEL"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+
+ {"name": "Salário / Folha", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "SALARIO|FOLHA|PGTO.*SALARIO"},
+ ], "actions": [{"op": "set_category", "value": "salary"}], "priority": 10},
+
+ {"name": "Dízimo / Doação", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "DIZIMO"},
+ {"field": "description", "op": "contains", "value": "DOACAO"},
+ {"field": "description", "op": "contains", "value": "CARIDADE"},
+ ], "actions": [{"op": "set_category", "value": "donations"}], "priority": 10},
+
+ {"name": "Pix Enviado", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "PIX.*ENVIADO|PIX.*TRANSF"},
+ ], "actions": [{"op": "set_category", "value": "transfers"}], "priority": 50},
+
+ {"name": "Estacionamento / Pedágio", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "ESTACIONAMENTO"},
+ {"field": "description", "op": "contains", "value": "PEDAGIO"},
+ {"field": "description", "op": "contains", "value": "SEM PARAR"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Barbearia / Salão", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "BARBEARIA"},
+ {"field": "description", "op": "contains", "value": "SALAO"},
+ {"field": "description", "op": "contains", "value": "CABELEREIRO"},
+ ], "actions": [{"op": "set_category", "value": "personal_care"}], "priority": 10},
+
+ {"name": "IPTU / IPVA / Imposto", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "IPTU"},
+ {"field": "description", "op": "contains", "value": "IPVA"},
+ {"field": "description", "op": "contains", "value": "IMPOSTO"},
+ {"field": "description", "op": "contains", "value": "DARF"},
+ ], "actions": [{"op": "set_category", "value": "taxes"}], "priority": 10},
+
+ {"name": "Condomínio", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "CONDOMINIO"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+
+ {"name": "Curso / Escola / Faculdade", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "ESCOLA"},
+ {"field": "description", "op": "contains", "value": "FACULDADE"},
+ {"field": "description", "op": "contains", "value": "UNIVERSIDADE"},
+ {"field": "description", "op": "contains", "value": "UDEMY"},
+ {"field": "description", "op": "contains", "value": "ALURA"},
+ ], "actions": [{"op": "set_category", "value": "education"}], "priority": 10},
+ ],
+ },
+ "US": {
+ "name": "United States",
+ "flag": "\U0001F1FA\U0001F1F8",
+ "rules": [
+ {"name": "Lyft", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "LYFT"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "DoorDash / Grubhub", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "DOORDASH"},
+ {"field": "description", "op": "starts_with", "value": "GRUBHUB"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Walmart / Target / Costco", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "WALMART"},
+ {"field": "description", "op": "starts_with", "value": "TARGET"},
+ {"field": "description", "op": "starts_with", "value": "COSTCO"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "Venmo / Zelle / CashApp", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "VENMO"},
+ {"field": "description", "op": "contains", "value": "ZELLE"},
+ {"field": "description", "op": "contains", "value": "CASH APP"},
+ ], "actions": [{"op": "set_category", "value": "transfers"}], "priority": 50},
+
+ {"name": "Starbucks / Dunkin", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "STARBUCKS"},
+ {"field": "description", "op": "starts_with", "value": "DUNKIN"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Chevron / Shell / Exxon (Fuel)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "CHEVRON"},
+ {"field": "description", "op": "starts_with", "value": "SHELL"},
+ {"field": "description", "op": "starts_with", "value": "EXXON"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Whole Foods / Trader Joe's / Kroger", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "WHOLE FOODS"},
+ {"field": "description", "op": "starts_with", "value": "TRADER JOE"},
+ {"field": "description", "op": "starts_with", "value": "KROGER"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "CVS / Walgreens", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "CVS"},
+ {"field": "description", "op": "starts_with", "value": "WALGREENS"},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "T-Mobile / AT&T / Verizon", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "T-MOBILE"},
+ {"field": "description", "op": "starts_with", "value": "ATT"},
+ {"field": "description", "op": "starts_with", "value": "AT&T"},
+ {"field": "description", "op": "starts_with", "value": "VERIZON"},
+ ], "actions": [{"op": "set_category", "value": "subscriptions"}], "priority": 10},
+
+ {"name": "Comcast / Xfinity", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "COMCAST"},
+ {"field": "description", "op": "starts_with", "value": "XFINITY"},
+ ], "actions": [{"op": "set_category", "value": "subscriptions"}], "priority": 10},
+
+ {"name": "Home Depot / Lowe's", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "HOME DEPOT"},
+ {"field": "description", "op": "starts_with", "value": "LOWES"},
+ {"field": "description", "op": "starts_with", "value": "LOWE'S"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+
+ {"name": "Planet Fitness / YMCA", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "PLANET FITNESS"},
+ {"field": "description", "op": "starts_with", "value": "YMCA"},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "Chipotle / McDonald's / Subway", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "CHIPOTLE"},
+ {"field": "description", "op": "starts_with", "value": "MCDONALD"},
+ {"field": "description", "op": "starts_with", "value": "SUBWAY"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Paycheck / Direct Deposit", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "PAYROLL|DIRECT DEP|ADP|GUSTO"},
+ ], "actions": [{"op": "set_category", "value": "salary"}], "priority": 10},
+
+ {"name": "Donations / Charity", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "DONATION"},
+ {"field": "description", "op": "contains", "value": "CHARITY"},
+ {"field": "description", "op": "contains", "value": "TITHE"},
+ {"field": "description", "op": "contains", "value": "RED CROSS"},
+ ], "actions": [{"op": "set_category", "value": "donations"}], "priority": 10},
+
+ {"name": "Taxes / IRS", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "IRS"},
+ {"field": "description", "op": "contains", "value": "TAX PAYMENT"},
+ {"field": "description", "op": "contains", "value": "PROPERTY TAX"},
+ ], "actions": [{"op": "set_category", "value": "taxes"}], "priority": 10},
+
+ {"name": "Rent / Mortgage", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "RENT PAYMENT"},
+ {"field": "description", "op": "contains", "value": "MORTGAGE"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+ ],
+ },
+ "EU": {
+ "name": "Europe",
+ "flag": "\U0001F1EA\U0001F1FA",
+ "rules": [
+ {"name": "Bolt / FreeNow", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "BOLT"},
+ {"field": "description", "op": "starts_with", "value": "FREENOW"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Deliveroo / Just Eat / Glovo", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "DELIVEROO"},
+ {"field": "description", "op": "starts_with", "value": "JUST EAT"},
+ {"field": "description", "op": "starts_with", "value": "GLOVO"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Lidl / Aldi / Carrefour", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "LIDL"},
+ {"field": "description", "op": "starts_with", "value": "ALDI"},
+ {"field": "description", "op": "starts_with", "value": "CARREFOUR"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "SEPA Transfer", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "SEPA"},
+ {"field": "description", "op": "contains", "value": "WIRE TRANSFER"},
+ ], "actions": [{"op": "set_category", "value": "transfers"}], "priority": 50},
+
+ {"name": "Wolt", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "WOLT"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Flixbus / BlaBlaCar", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "FLIXBUS"},
+ {"field": "description", "op": "starts_with", "value": "BLABLACAR"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Rossmann / DM", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "ROSSMANN"},
+ {"field": "description", "op": "starts_with", "value": "DM "},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "IKEA", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "IKEA"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+
+ {"name": "Deutsche Bahn / SNCF / Renfe", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "DEUTSCHE BAHN"},
+ {"field": "description", "op": "starts_with", "value": "DB "},
+ {"field": "description", "op": "starts_with", "value": "SNCF"},
+ {"field": "description", "op": "starts_with", "value": "RENFE"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Albert Heijn / Rewe / Mercadona / Edeka", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "ALBERT HEIJN"},
+ {"field": "description", "op": "starts_with", "value": "REWE"},
+ {"field": "description", "op": "starts_with", "value": "MERCADONA"},
+ {"field": "description", "op": "starts_with", "value": "EDEKA"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "Miete / Loyer (Rent)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "MIETE"},
+ {"field": "description", "op": "contains", "value": "LOYER"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+
+ {"name": "Gehalt / Salaire (Salary)", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "GEHALT|SALAIRE|LOHN|SALARY|STIPENDIO"},
+ ], "actions": [{"op": "set_category", "value": "salary"}], "priority": 10},
+
+ {"name": "Spende / Don (Donation)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "SPENDE"},
+ {"field": "description", "op": "contains", "value": "DONATION"},
+ {"field": "description", "op": "contains", "value": "DON "},
+ ], "actions": [{"op": "set_category", "value": "donations"}], "priority": 10},
+
+ {"name": "Steuer / Impôt (Tax)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "STEUER"},
+ {"field": "description", "op": "contains", "value": "IMPOT"},
+ {"field": "description", "op": "contains", "value": "FINANZAMT"},
+ ], "actions": [{"op": "set_category", "value": "taxes"}], "priority": 10},
+ ],
+ },
+ "GB": {
+ "name": "United Kingdom",
+ "flag": "\U0001F1EC\U0001F1E7",
+ "rules": [
+ {"name": "Tesco / Sainsbury's / Asda", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "TESCO"},
+ {"field": "description", "op": "starts_with", "value": "SAINSBURY"},
+ {"field": "description", "op": "starts_with", "value": "ASDA"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "Deliveroo / Just Eat", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "DELIVEROO"},
+ {"field": "description", "op": "starts_with", "value": "JUST EAT"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "TfL / Trainline", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "TFL"},
+ {"field": "description", "op": "starts_with", "value": "TRAINLINE"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Greggs / Costa / Pret", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "GREGGS"},
+ {"field": "description", "op": "starts_with", "value": "COSTA"},
+ {"field": "description", "op": "starts_with", "value": "PRET"},
+ ], "actions": [{"op": "set_category", "value": "food"}], "priority": 10},
+
+ {"name": "Shell / BP / Esso (Fuel)", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "SHELL"},
+ {"field": "description", "op": "starts_with", "value": "BP "},
+ {"field": "description", "op": "starts_with", "value": "ESSO"},
+ ], "actions": [{"op": "set_category", "value": "transport"}], "priority": 10},
+
+ {"name": "Boots / Superdrug", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "BOOTS"},
+ {"field": "description", "op": "starts_with", "value": "SUPERDRUG"},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "Sky / BT / Virgin Media", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "SKY"},
+ {"field": "description", "op": "starts_with", "value": "BT "},
+ {"field": "description", "op": "starts_with", "value": "VIRGIN MEDIA"},
+ ], "actions": [{"op": "set_category", "value": "subscriptions"}], "priority": 10},
+
+ {"name": "Argos", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "ARGOS"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "M&S", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "M&S"},
+ {"field": "description", "op": "starts_with", "value": "MARKS"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "Aldi / Lidl / Morrisons / Waitrose", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "ALDI"},
+ {"field": "description", "op": "starts_with", "value": "LIDL"},
+ {"field": "description", "op": "starts_with", "value": "MORRISONS"},
+ {"field": "description", "op": "starts_with", "value": "WAITROSE"},
+ ], "actions": [{"op": "set_category", "value": "groceries"}], "priority": 10},
+
+ {"name": "HMRC / Council Tax", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "COUNCIL TAX"},
+ {"field": "description", "op": "contains", "value": "HMRC"},
+ ], "actions": [{"op": "set_category", "value": "taxes"}], "priority": 10},
+
+ {"name": "NHS / Bupa", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "starts_with", "value": "NHS"},
+ {"field": "description", "op": "starts_with", "value": "BUPA"},
+ ], "actions": [{"op": "set_category", "value": "health"}], "priority": 10},
+
+ {"name": "Salary / Wages", "conditions_op": "and", "conditions": [
+ {"field": "description", "op": "regex", "value": "SALARY|WAGES|PAYROLL"},
+ ], "actions": [{"op": "set_category", "value": "salary"}], "priority": 10},
+
+ {"name": "Charity / Donation", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "CHARITY"},
+ {"field": "description", "op": "contains", "value": "DONATION"},
+ {"field": "description", "op": "contains", "value": "JUST GIVING"},
+ ], "actions": [{"op": "set_category", "value": "donations"}], "priority": 10},
+
+ {"name": "Rent / Mortgage", "conditions_op": "or", "conditions": [
+ {"field": "description", "op": "contains", "value": "RENT"},
+ {"field": "description", "op": "contains", "value": "MORTGAGE"},
+ {"field": "description", "op": "contains", "value": "OPENRENT"},
+ ], "actions": [{"op": "set_category", "value": "housing"}], "priority": 10},
+ ],
+ },
+}
+
+# Map currency code -> default rule pack country
+CURRENCY_TO_PACK = {
+ "BRL": "BR",
+ "USD": "US",
+ "EUR": "EU",
+ "GBP": "GB",
+}
+
+
+def _resolve_category_name(internal_key: str, lang: str) -> str:
+ """Resolve internal category key to the localized name."""
+ data = DEFAULT_CATEGORIES_I18N.get(internal_key, {})
+ return data.get(lang, data.get("en", internal_key))
+
+
+def _build_rules_from_templates(templates: list[dict], categories: dict[str, str], lang: str) -> list[dict]:
+ """Convert rule templates (with internal keys) to rules with resolved category UUIDs."""
+ resolved = []
+ for rule_data in templates:
+ actions = []
+ for action in rule_data["actions"]:
+ if action["op"] == "set_category":
+ cat_name = _resolve_category_name(action["value"], lang)
+ cat_id = categories.get(cat_name)
+ if not cat_id:
+ continue
+ actions.append({"op": "set_category", "value": cat_id})
+ else:
+ actions.append(action)
+ if not actions:
+ continue
+ resolved.append({**rule_data, "actions": actions})
+ return resolved
+
+
+async def _get_existing_rule_names(session: AsyncSession, user_id: uuid.UUID) -> set[str]:
+ """Get the set of existing rule names for a user."""
+ result = await session.execute(
+ select(Rule.name).where(Rule.user_id == user_id)
+ )
+ return {row[0] for row in result.all()}
+
+
+async def create_default_rules(session: AsyncSession, user_id: uuid.UUID, lang: str = "pt-BR") -> list[Rule]:
+ """Create universal default categorization rules for a new user."""
+ result = await session.execute(select(Category).where(Category.user_id == user_id))
+ categories = {cat.name: str(cat.id) for cat in result.scalars().all()}
+
+ resolved = _build_rules_from_templates(UNIVERSAL_RULES, categories, lang)
+
+ rules = []
+ for rule_data in resolved:
+ rule = Rule(
+ user_id=user_id,
+ name=rule_data["name"],
+ conditions_op=rule_data["conditions_op"],
+ conditions=rule_data["conditions"],
+ actions=rule_data["actions"],
+ priority=rule_data["priority"],
+ is_active=True,
+ )
+ session.add(rule)
+ rules.append(rule)
+
+ await session.commit()
+ return rules
+
+
+async def install_rule_pack(session: AsyncSession, user_id: uuid.UUID, pack_code: str, lang: str = "pt-BR") -> list[Rule]:
+ """Install a country-specific rule pack for a user. Skips rules whose name already exists."""
+ pack = RULE_PACKS.get(pack_code)
+ if not pack:
+ return []
+
+ result = await session.execute(select(Category).where(Category.user_id == user_id))
+ categories = {cat.name: str(cat.id) for cat in result.scalars().all()}
+
+ resolved = _build_rules_from_templates(pack["rules"], categories, lang)
+
+ existing_names = await _get_existing_rule_names(session, user_id)
+
+ rules = []
+ for rule_data in resolved:
+ if rule_data["name"] in existing_names:
+ continue
+ rule = Rule(
+ user_id=user_id,
+ name=rule_data["name"],
+ conditions_op=rule_data["conditions_op"],
+ conditions=rule_data["conditions"],
+ actions=rule_data["actions"],
+ priority=rule_data["priority"],
+ is_active=True,
+ )
+ session.add(rule)
+ rules.append(rule)
+
+ await session.commit()
+ return rules
+
+
+async def get_installed_packs(session: AsyncSession, user_id: uuid.UUID) -> dict[str, bool]:
+ """Check which rule packs are fully installed for a user."""
+ existing_names = await _get_existing_rule_names(session, user_id)
+ result = {}
+ for code, pack in RULE_PACKS.items():
+ pack_names = {r["name"] for r in pack["rules"]}
+ result[code] = pack_names.issubset(existing_names)
+ return result
+
+
+async def get_rules(session: AsyncSession, user_id: uuid.UUID) -> list[Rule]:
+ result = await session.execute(
+ select(Rule)
+ .where(Rule.user_id == user_id)
+ .order_by(Rule.priority, Rule.id)
+ )
+ return list(result.scalars().all())
+
+
+async def get_rule(session: AsyncSession, rule_id: uuid.UUID, user_id: uuid.UUID) -> Optional[Rule]:
+ result = await session.execute(
+ select(Rule).where(Rule.id == rule_id, Rule.user_id == user_id)
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_rule(session: AsyncSession, user_id: uuid.UUID, data: RuleCreate) -> Rule:
+ existing_names = await _get_existing_rule_names(session, user_id)
+ if data.name in existing_names:
+ raise DuplicateRuleError(f"A rule named '{data.name}' already exists")
+
+ rule = Rule(
+ user_id=user_id,
+ name=data.name,
+ conditions_op=data.conditions_op,
+ conditions=[c.model_dump() for c in data.conditions],
+ actions=[a.model_dump() for a in data.actions],
+ priority=data.priority,
+ is_active=data.is_active,
+ )
+ session.add(rule)
+ await session.commit()
+ await session.refresh(rule)
+ return rule
+
+
+async def update_rule(
+ session: AsyncSession, rule_id: uuid.UUID, user_id: uuid.UUID, data: RuleUpdate
+) -> Optional[Rule]:
+ rule = await get_rule(session, rule_id, user_id)
+ if not rule:
+ return None
+
+ update_data = data.model_dump(exclude_unset=True)
+
+ if "name" in update_data and update_data["name"] != rule.name:
+ existing_names = await _get_existing_rule_names(session, user_id)
+ if update_data["name"] in existing_names:
+ raise DuplicateRuleError(f"A rule named '{update_data['name']}' already exists")
+
+ if "conditions" in update_data and update_data["conditions"] is not None:
+ update_data["conditions"] = [c.model_dump() for c in data.conditions]
+ if "actions" in update_data and update_data["actions"] is not None:
+ update_data["actions"] = [a.model_dump() for a in data.actions]
+
+ for key, value in update_data.items():
+ setattr(rule, key, value)
+
+ await session.commit()
+ await session.refresh(rule)
+ return rule
+
+
+async def delete_rule(session: AsyncSession, rule_id: uuid.UUID, user_id: uuid.UUID) -> bool:
+ rule = await get_rule(session, rule_id, user_id)
+ if not rule:
+ return False
+ await session.delete(rule)
+ await session.commit()
+ return True
+
+
+async def apply_rules_to_transaction(
+ session: AsyncSession, user_id: uuid.UUID, transaction: Transaction
+) -> None:
+ """Apply all active rules to a transaction, modifying it in-place. Commits nothing."""
+ result = await session.execute(
+ select(Rule)
+ .where(Rule.user_id == user_id, Rule.is_active == True)
+ .order_by(Rule.priority, Rule.id)
+ )
+ rules = result.scalars().all()
+
+ category_set = transaction.category_id is not None
+
+ for rule in rules:
+ conditions = rule.conditions or []
+ actions = rule.actions or []
+ if evaluate_conditions(rule.conditions_op, conditions, transaction):
+ category_set = apply_rule_actions(actions, transaction, category_set)
+
+
+async def apply_all_rules(session: AsyncSession, user_id: uuid.UUID) -> int:
+ """Re-apply all active rules to all user transactions. Returns count of affected transactions."""
+ from sqlalchemy import or_
+ from app.models.account import Account
+ from app.models.bank_connection import BankConnection
+
+ result = await session.execute(
+ select(Transaction)
+ .outerjoin(Account)
+ .outerjoin(BankConnection)
+ .where(
+ or_(
+ Transaction.user_id == user_id,
+ BankConnection.user_id == user_id,
+ ),
+ Transaction.source != "opening_balance",
+ )
+ )
+ transactions = result.scalars().all()
+
+ rules_result = await session.execute(
+ select(Rule)
+ .where(Rule.user_id == user_id, Rule.is_active == True)
+ .order_by(Rule.priority, Rule.id)
+ )
+ rules = rules_result.scalars().all()
+
+ count = 0
+ for tx in transactions:
+ # Reset to re-evaluate from scratch
+ tx.category_id = None
+ tx.notes = None
+ category_set = False
+
+ for rule in rules:
+ conditions = rule.conditions or []
+ actions = rule.actions or []
+ if evaluate_conditions(rule.conditions_op, conditions, tx):
+ category_set = apply_rule_actions(actions, tx, category_set)
+
+ count += 1
+
+ await session.commit()
+ return count
diff --git a/backend/app/services/transaction_service.py b/backend/app/services/transaction_service.py
new file mode 100644
index 00000000..9389c12d
--- /dev/null
+++ b/backend/app/services/transaction_service.py
@@ -0,0 +1,194 @@
+import uuid
+from datetime import date
+from typing import Optional
+
+from sqlalchemy import select, func, or_, update
+from sqlalchemy.ext.asyncio import AsyncSession
+from sqlalchemy.orm import selectinload
+
+from app.models.transaction import Transaction
+from app.models.account import Account
+from app.models.bank_connection import BankConnection
+from app.schemas.transaction import TransactionCreate, TransactionUpdate
+from app.services.rule_service import apply_rules_to_transaction
+
+
+async def get_transactions(
+ session: AsyncSession,
+ user_id: uuid.UUID,
+ account_id: Optional[uuid.UUID] = None,
+ category_id: Optional[uuid.UUID] = None,
+ from_date: Optional[date] = None,
+ to_date: Optional[date] = None,
+ page: int = 1,
+ limit: int = 50,
+ include_opening_balance: bool = False,
+ search: Optional[str] = None,
+ uncategorized: bool = False,
+ txn_type: Optional[str] = None,
+ skip_pagination: bool = False,
+) -> tuple[list[Transaction], int]:
+ # Base query: user's own transactions (manual or via account)
+ base_query = (
+ select(Transaction)
+ .outerjoin(Account)
+ .outerjoin(BankConnection)
+ .where(
+ or_(
+ Transaction.user_id == user_id,
+ BankConnection.user_id == user_id,
+ )
+ )
+ .options(selectinload(Transaction.category), selectinload(Transaction.account))
+ )
+
+ # Exclude opening_balance transactions from the normal list unless explicitly requested
+ if not include_opening_balance:
+ base_query = base_query.where(Transaction.source != "opening_balance")
+
+ # Apply filters
+ if account_id:
+ base_query = base_query.where(Transaction.account_id == account_id)
+ if category_id:
+ base_query = base_query.where(Transaction.category_id == category_id)
+ if uncategorized:
+ base_query = base_query.where(
+ Transaction.category_id == None,
+ Transaction.transfer_pair_id.is_(None),
+ )
+ if txn_type:
+ base_query = base_query.where(Transaction.type == txn_type)
+ if from_date:
+ base_query = base_query.where(Transaction.date >= from_date)
+ if to_date:
+ base_query = base_query.where(Transaction.date <= to_date)
+ if search:
+ term = f"%{search}%"
+ base_query = base_query.where(
+ or_(
+ Transaction.description.ilike(term),
+ Transaction.payee.ilike(term),
+ Transaction.notes.ilike(term),
+ )
+ )
+
+ # Get total count
+ count_query = select(func.count()).select_from(base_query.subquery())
+ total = await session.scalar(count_query)
+
+ # Apply ordering (and pagination unless skipped)
+ query = base_query.order_by(Transaction.date.desc(), Transaction.created_at.desc())
+ if not skip_pagination:
+ query = query.offset((page - 1) * limit).limit(limit)
+
+ result = await session.execute(query)
+ transactions = list(result.scalars().all())
+
+ return transactions, total or 0
+
+
+async def get_transaction(
+ session: AsyncSession, transaction_id: uuid.UUID, user_id: uuid.UUID
+) -> Optional[Transaction]:
+ result = await session.execute(
+ select(Transaction)
+ .outerjoin(Account)
+ .outerjoin(BankConnection)
+ .where(
+ Transaction.id == transaction_id,
+ or_(
+ Transaction.user_id == user_id,
+ BankConnection.user_id == user_id,
+ ),
+ )
+ .options(selectinload(Transaction.category))
+ )
+ return result.scalar_one_or_none()
+
+
+async def create_transaction(
+ session: AsyncSession, user_id: uuid.UUID, data: TransactionCreate
+) -> Transaction:
+ # Verify account belongs to user
+ account_result = await session.execute(
+ select(Account)
+ .outerjoin(BankConnection)
+ .where(
+ Account.id == data.account_id,
+ or_(
+ Account.user_id == user_id,
+ BankConnection.user_id == user_id,
+ ),
+ )
+ )
+ account = account_result.scalar_one_or_none()
+ if not account:
+ raise ValueError("Account not found")
+
+ transaction = Transaction(
+ user_id=user_id,
+ account_id=data.account_id,
+ category_id=data.category_id, # use provided category if given
+ description=data.description,
+ amount=data.amount,
+ currency=data.currency,
+ date=data.date,
+ type=data.type,
+ source="manual",
+ notes=data.notes,
+ )
+ session.add(transaction)
+ await session.flush() # get ID without committing
+
+ # Apply rules only if no explicit category provided
+ if not data.category_id:
+ await apply_rules_to_transaction(session, user_id, transaction)
+
+ await session.commit()
+ await session.refresh(transaction, ["category"])
+ return transaction
+
+
+async def update_transaction(
+ session: AsyncSession, transaction_id: uuid.UUID, user_id: uuid.UUID, data: TransactionUpdate
+) -> Optional[Transaction]:
+ transaction = await get_transaction(session, transaction_id, user_id)
+ if not transaction:
+ return None
+
+ for key, value in data.model_dump(exclude_unset=True).items():
+ setattr(transaction, key, value)
+
+ await session.commit()
+ await session.refresh(transaction)
+ return transaction
+
+
+async def bulk_update_category(
+ session: AsyncSession,
+ user_id: uuid.UUID,
+ transaction_ids: list[uuid.UUID],
+ category_id: Optional[uuid.UUID] = None,
+) -> int:
+ result = await session.execute(
+ update(Transaction)
+ .where(
+ Transaction.id.in_(transaction_ids),
+ Transaction.user_id == user_id,
+ )
+ .values(category_id=category_id)
+ )
+ await session.commit()
+ return result.rowcount
+
+
+async def delete_transaction(
+ session: AsyncSession, transaction_id: uuid.UUID, user_id: uuid.UUID
+) -> bool:
+ transaction = await get_transaction(session, transaction_id, user_id)
+ if not transaction:
+ return False
+
+ await session.delete(transaction)
+ await session.commit()
+ return True
diff --git a/backend/app/services/transfer_detection_service.py b/backend/app/services/transfer_detection_service.py
new file mode 100644
index 00000000..eccb2e26
--- /dev/null
+++ b/backend/app/services/transfer_detection_service.py
@@ -0,0 +1,113 @@
+import uuid
+from collections import defaultdict
+from typing import Optional
+
+from sqlalchemy import select
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.transaction import Transaction
+
+
+async def detect_transfer_pairs(
+ session: AsyncSession,
+ user_id: uuid.UUID,
+ candidate_ids: Optional[list[uuid.UUID]] = None,
+ date_tolerance_days: int = 2,
+) -> int:
+ """Detect inter-account transfer pairs and link them with a shared UUID.
+
+ Algorithm:
+ 1. Load unpaired debit transactions (optionally filtered to candidate_ids)
+ 2. For each debit, find an unpaired credit with: same user, different account,
+ same absolute amount, date within ±tolerance days
+ 3. Greedy closest-date-first matching; each tx can only pair once
+
+ Returns the number of pairs created.
+ """
+ # Load candidate debits
+ debit_query = select(Transaction).where(
+ Transaction.user_id == user_id,
+ Transaction.type == "debit",
+ Transaction.transfer_pair_id.is_(None),
+ Transaction.source != "opening_balance",
+ )
+ if candidate_ids:
+ debit_query = debit_query.where(Transaction.id.in_(candidate_ids))
+
+ debit_result = await session.execute(debit_query)
+ debits = list(debit_result.scalars().all())
+
+ if not debits:
+ return 0
+
+ # Load all unpaired credits for the user (potential partners)
+ credit_query = select(Transaction).where(
+ Transaction.user_id == user_id,
+ Transaction.type == "credit",
+ Transaction.transfer_pair_id.is_(None),
+ Transaction.source != "opening_balance",
+ )
+ credit_result = await session.execute(credit_query)
+ credits = list(credit_result.scalars().all())
+
+ if not credits:
+ return 0
+
+ # Build a lookup: amount -> list of credits
+ credit_by_amount: dict[float, list[Transaction]] = defaultdict(list)
+ for c in credits:
+ credit_by_amount[abs(float(c.amount))].append(c)
+
+ paired_credit_ids: set[uuid.UUID] = set()
+ pairs_created = 0
+
+ for debit in debits:
+ debit_amount = abs(float(debit.amount))
+ candidates = credit_by_amount.get(debit_amount, [])
+
+ # Find closest-date match in a different account
+ best_match: Optional[Transaction] = None
+ best_delta: Optional[int] = None
+
+ for credit in candidates:
+ if credit.id in paired_credit_ids:
+ continue
+ if credit.account_id == debit.account_id:
+ continue
+
+ delta = abs((credit.date - debit.date).days)
+ if delta > date_tolerance_days:
+ continue
+
+ if best_delta is None or delta < best_delta:
+ best_match = credit
+ best_delta = delta
+
+ if best_match:
+ pair_id = uuid.uuid4()
+ debit.transfer_pair_id = pair_id
+ best_match.transfer_pair_id = pair_id
+ paired_credit_ids.add(best_match.id)
+ pairs_created += 1
+
+ return pairs_created
+
+
+async def unlink_transfer_pair(
+ session: AsyncSession,
+ user_id: uuid.UUID,
+ pair_id: uuid.UUID,
+) -> int:
+ """Remove a transfer pair link. Returns number of transactions unlinked."""
+ result = await session.execute(
+ select(Transaction).where(
+ Transaction.user_id == user_id,
+ Transaction.transfer_pair_id == pair_id,
+ )
+ )
+ transactions = list(result.scalars().all())
+
+ for tx in transactions:
+ tx.transfer_pair_id = None
+
+ return len(transactions)
diff --git a/backend/app/tasks/__init__.py b/backend/app/tasks/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/app/tasks/sync_tasks.py b/backend/app/tasks/sync_tasks.py
new file mode 100644
index 00000000..05feb7e5
--- /dev/null
+++ b/backend/app/tasks/sync_tasks.py
@@ -0,0 +1,71 @@
+import asyncio
+import logging
+import uuid
+from datetime import datetime, timezone, timedelta
+
+from sqlalchemy import select
+
+from app.worker import celery_app
+from app.core.database import async_session_maker
+from app.models.bank_connection import BankConnection
+from app.services import connection_service
+
+logger = logging.getLogger(__name__)
+
+STALE_THRESHOLD = timedelta(hours=4)
+
+
+async def _sync_all() -> int:
+ """Find stale connections and sync each one."""
+ cutoff = datetime.now(timezone.utc) - STALE_THRESHOLD
+ synced = 0
+
+ async with async_session_maker() as session:
+ result = await session.execute(
+ select(BankConnection.id, BankConnection.user_id, BankConnection.last_sync_at).where(
+ BankConnection.status.in_(["active", "error"]),
+ (BankConnection.last_sync_at < cutoff) | (BankConnection.last_sync_at.is_(None)),
+ )
+ )
+ connections = result.all()
+
+ logger.info(
+ "Sync check: found %d stale connections (cutoff=%s)",
+ len(connections),
+ cutoff.isoformat(),
+ )
+
+ for conn_id, user_id, last_sync in connections:
+ try:
+ logger.info("Syncing connection %s (last_sync=%s)", conn_id, last_sync)
+ await _sync_one(conn_id, user_id)
+ synced += 1
+ except Exception:
+ logger.exception("Background sync failed for connection %s", conn_id)
+
+ return synced
+
+
+async def _sync_one(connection_id: uuid.UUID, user_id: uuid.UUID) -> None:
+ """Sync a single connection. Error status is set by sync_connection itself."""
+ async with async_session_maker() as session:
+ await connection_service.sync_connection(session, connection_id, user_id)
+
+
+@celery_app.task(name="app.tasks.sync_tasks.sync_all_connections")
+def sync_all_connections() -> dict:
+ """Celery task: sync all stale bank connections."""
+ synced = asyncio.run(_sync_all())
+ logger.info("Background sync complete: %d connections synced", synced)
+ return {"synced": synced}
+
+
+@celery_app.task(name="app.tasks.sync_tasks.sync_single_connection")
+def sync_single_connection(connection_id: str, user_id: str) -> dict:
+ """Celery task: sync a single connection (used for on-demand dispatch)."""
+ try:
+ asyncio.run(_sync_one(uuid.UUID(connection_id), uuid.UUID(user_id)))
+ return {"status": "ok", "connection_id": connection_id}
+ except Exception as e:
+ logger.exception("Sync task failed for connection %s", connection_id)
+ return {"status": "error", "connection_id": connection_id, "error": str(e)}
diff --git a/backend/app/worker.py b/backend/app/worker.py
new file mode 100644
index 00000000..4a577006
--- /dev/null
+++ b/backend/app/worker.py
@@ -0,0 +1,28 @@
+from celery import Celery
+
+from app.core.config import get_settings
+
+settings = get_settings()
+
+celery_app = Celery(
+ "securo",
+ broker=settings.redis_url,
+ backend=settings.redis_url,
+)
+
+celery_app.conf.update(
+ task_serializer="json",
+ accept_content=["json"],
+ result_serializer="json",
+ timezone="UTC",
+ enable_utc=True,
+)
+
+celery_app.conf.beat_schedule = {
+ "sync-all-connections-hourly": {
+ "task": "app.tasks.sync_tasks.sync_all_connections",
+ "schedule": 60 * 60, # every hour; task itself skips connections synced < 4h ago
+ },
+}
+
+celery_app.conf.include = ["app.tasks.sync_tasks"]
diff --git a/backend/pyproject.toml b/backend/pyproject.toml
new file mode 100644
index 00000000..7475ff3e
--- /dev/null
+++ b/backend/pyproject.toml
@@ -0,0 +1,53 @@
+[project]
+name = "finanseu-backend"
+version = "0.1.0"
+description = "Securo API - Personal Finance Manager"
+requires-python = ">=3.11"
+dependencies = [
+ "fastapi>=0.109.0",
+ "uvicorn[standard]>=0.27.0",
+ "sqlalchemy>=2.0.0",
+ "alembic>=1.13.0",
+ "asyncpg>=0.29.0",
+ "pydantic>=2.5.0",
+ "pydantic-settings>=2.1.0",
+ "python-jose[cryptography]>=3.3.0",
+ "passlib[bcrypt]>=1.7.4",
+ "fastapi-users[sqlalchemy]>=13.0.0",
+ "httpx>=0.26.0",
+ "python-multipart>=0.0.6",
+ "ofxparse>=0.21",
+ "celery[redis]>=5.3.0",
+]
+
+[project.optional-dependencies]
+dev = [
+ "pytest>=7.4.0",
+ "pytest-asyncio>=0.23.0",
+ "pytest-cov>=4.1.0",
+ "httpx>=0.26.0",
+ "aiosqlite>=0.19.0",
+ "ruff>=0.1.0",
+]
+
+[tool.setuptools.packages.find]
+include = ["app*"]
+
+[tool.pytest.ini_options]
+asyncio_mode = "auto"
+testpaths = ["tests"]
+
+[tool.coverage.run]
+omit = [
+ "app/cli.py",
+ "app/worker.py",
+ "app/tasks/*",
+ "app/providers/pluggy.py",
+]
+
+[tool.ruff]
+line-length = 100
+target-version = "py311"
+
+[tool.ruff.lint]
+ignore = ["E711", "E712"]
diff --git a/backend/tests/__init__.py b/backend/tests/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py
new file mode 100644
index 00000000..ee65eac6
--- /dev/null
+++ b/backend/tests/conftest.py
@@ -0,0 +1,278 @@
+import asyncio
+import uuid
+from datetime import date, datetime, timezone
+from decimal import Decimal
+from typing import AsyncGenerator
+
+import pytest_asyncio
+from httpx import ASGITransport, AsyncClient
+from sqlalchemy.ext.asyncio import AsyncSession, create_async_engine, async_sessionmaker
+
+from app.core.database import Base, get_async_session
+from app.main import app
+from app.models.user import User
+from app.models.category import Category
+from app.models.bank_connection import BankConnection
+from app.models.account import Account
+from app.models.transaction import Transaction
+from app.models.rule import Rule
+
+# Use SQLite for tests — fast, no external dependency
+TEST_DATABASE_URL = "sqlite+aiosqlite:///./test.db"
+
+engine = create_async_engine(TEST_DATABASE_URL, echo=False)
+TestSessionLocal = async_sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
+
+
+# SQLite doesn't support PostgreSQL UUID type natively — SQLAlchemy handles the
+# mapping automatically when we create tables via Base.metadata (it converts
+# PostgreSQL UUID to CHAR(32)). We just need to make sure we use string-based
+# UUID comparisons.
+
+
+@pytest_asyncio.fixture(scope="session")
+def event_loop():
+ loop = asyncio.new_event_loop()
+ yield loop
+ loop.close()
+
+
+@pytest_asyncio.fixture(scope="session", autouse=True)
+async def setup_database():
+ """Create all tables once for the test session."""
+ async with engine.begin() as conn:
+ await conn.run_sync(Base.metadata.create_all)
+ yield
+ async with engine.begin() as conn:
+ await conn.run_sync(Base.metadata.drop_all)
+ # Clean up test db file
+ import os
+ try:
+ os.remove("./test.db")
+ except FileNotFoundError:
+ pass
+
+
+@pytest_asyncio.fixture
+async def session() -> AsyncGenerator[AsyncSession, None]:
+ """Provide a transactional test session that rolls back after each test."""
+ async with TestSessionLocal() as session:
+ yield session
+ # Roll back any uncommitted changes
+ await session.rollback()
+
+
+@pytest_asyncio.fixture
+async def clean_db(session: AsyncSession):
+ """Clean all data between tests."""
+ for table in reversed(Base.metadata.sorted_tables):
+ await session.execute(table.delete())
+ await session.commit()
+
+
+async def override_get_async_session() -> AsyncGenerator[AsyncSession, None]:
+ async with TestSessionLocal() as session:
+ yield session
+
+
+# Override the dependency
+app.dependency_overrides[get_async_session] = override_get_async_session
+
+
+@pytest_asyncio.fixture
+async def client() -> AsyncGenerator[AsyncClient, None]:
+ """Provide an async test client."""
+ transport = ASGITransport(app=app)
+ async with AsyncClient(transport=transport, base_url="http://test") as ac:
+ yield ac
+
+
+@pytest_asyncio.fixture
+async def test_user(session: AsyncSession, clean_db) -> User:
+ """Create a test user."""
+ import bcrypt as _bcrypt
+
+ hashed = _bcrypt.hashpw(b"testpass123", _bcrypt.gensalt()).decode()
+ user = User(
+ id=uuid.uuid4(),
+ hashed_password=hashed,
+ is_active=True,
+ is_superuser=False,
+ is_verified=True,
+ preferences={
+ "language": "pt-BR",
+ "date_format": "DD/MM/YYYY",
+ "timezone": "America/Sao_Paulo",
+ "currency_display": "BRL",
+ },
+ )
+ session.add(user)
+ await session.commit()
+ await session.refresh(user)
+ return user
+
+
+@pytest_asyncio.fixture
+async def auth_token(client: AsyncClient, test_user: User) -> str:
+ """Get an auth token for the test user."""
+ response = await client.post(
+ "/api/auth/login",
+ data={"username": "[email protected]", "password": "testpass123"},
+ headers={"Content-Type": "application/x-www-form-urlencoded"},
+ )
+ assert response.status_code == 200, f"Login failed: {response.text}"
+ return response.json()["access_token"]
+
+
+@pytest_asyncio.fixture
+def auth_headers(auth_token: str) -> dict:
+ """Auth headers for authenticated requests."""
+ return {"Authorization": f"Bearer {auth_token}"}
+
+
+@pytest_asyncio.fixture
+async def test_categories(session: AsyncSession, test_user: User) -> list[Category]:
+ """Create test categories."""
+ categories = []
+ for name, icon, color in [
+ ("Alimentação", "🍔", "#F59E0B"),
+ ("Transporte", "🚗", "#3B82F6"),
+ ("Receita", "💼", "#22C55E"),
+ ]:
+ cat = Category(
+ id=uuid.uuid4(),
+ user_id=test_user.id,
+ name=name,
+ icon=icon,
+ color=color,
+ is_system=True,
+ )
+ session.add(cat)
+ categories.append(cat)
+ await session.commit()
+ for cat in categories:
+ await session.refresh(cat)
+ return categories
+
+
+@pytest_asyncio.fixture
+async def test_connection(session: AsyncSession, test_user: User) -> BankConnection:
+ """Create a test bank connection."""
+ conn = BankConnection(
+ id=uuid.uuid4(),
+ user_id=test_user.id,
+ provider="test",
+ external_id="ext-123",
+ institution_name="Banco Teste",
+ credentials={"token": "fake"},
+ status="active",
+ last_sync_at=datetime.now(timezone.utc),
+ created_at=datetime.now(timezone.utc),
+ )
+ session.add(conn)
+ await session.commit()
+ await session.refresh(conn)
+ return conn
+
+
+@pytest_asyncio.fixture
+async def test_account(session: AsyncSession, test_user: User, test_connection: BankConnection) -> Account:
+ """Create a test account."""
+ account = Account(
+ id=uuid.uuid4(),
+ user_id=test_user.id,
+ connection_id=test_connection.id,
+ external_id="acc-ext-123",
+ name="Conta Corrente",
+ type="checking",
+ balance=Decimal("1500.00"),
+ currency="BRL",
+ )
+ session.add(account)
+ await session.commit()
+ await session.refresh(account)
+ return account
+
+
+@pytest_asyncio.fixture
+async def test_transactions(
+ session: AsyncSession, test_user: User, test_account: Account, test_categories: list[Category]
+) -> list[Transaction]:
+ """Create test transactions in the current month so tests don't break as time passes."""
+ today = date.today()
+ transactions = []
+ data = [
+ ("UBER TRIP", Decimal("25.50"), today.replace(day=min(3, today.day)), "debit", test_categories[1].id),
+ ("IFOOD RESTAURANTE", Decimal("45.00"), today.replace(day=min(4, today.day)), "debit", test_categories[0].id),
+ ("SALARIO FEV", Decimal("8000.00"), today.replace(day=min(2, today.day)), "credit", test_categories[2].id),
+ ("PIX RECEBIDO", Decimal("150.00"), today.replace(day=min(5, today.day)), "credit", None),
+ ("NETFLIX", Decimal("39.90"), today.replace(day=1), "debit", None),
+ ]
+ for desc, amount, dt, typ, cat_id in data:
+ txn = Transaction(
+ id=uuid.uuid4(),
+ user_id=test_user.id,
+ account_id=test_account.id,
+ category_id=cat_id,
+ description=desc,
+ amount=amount,
+ date=dt,
+ type=typ,
+ source="manual",
+ created_at=datetime.now(timezone.utc),
+ )
+ session.add(txn)
+ transactions.append(txn)
+ await session.commit()
+ for txn in transactions:
+ await session.refresh(txn)
+ return transactions
+
+
+@pytest_asyncio.fixture
+async def test_rules(
+ session: AsyncSession, test_user: User, test_categories: list[Category]
+) -> list[Rule]:
+ """Create test categorization rules using the new Rule model."""
+ rules = []
+ rule_data = [
+ (
+ "UBER rule",
+ "or",
+ [{"field": "description", "op": "starts_with", "value": "UBER"}],
+ [{"op": "set_category", "value": str(test_categories[1].id)}],
+ 10,
+ ),
+ (
+ "IFOOD rule",
+ "or",
+ [{"field": "description", "op": "starts_with", "value": "IFOOD"}],
+ [{"op": "set_category", "value": str(test_categories[0].id)}],
+ 10,
+ ),
+ (
+ "SALARIO rule",
+ "and",
+ [{"field": "description", "op": "contains", "value": "SALARIO"}],
+ [{"op": "set_category", "value": str(test_categories[2].id)}],
+ 10,
+ ),
+ ]
+ for name, conditions_op, conditions, actions, priority in rule_data:
+ rule = Rule(
+ id=uuid.uuid4(),
+ user_id=test_user.id,
+ name=name,
+ conditions_op=conditions_op,
+ conditions=conditions,
+ actions=actions,
+ priority=priority,
+ is_active=True,
+ )
+ session.add(rule)
+ rules.append(rule)
+ await session.commit()
+ for rule in rules:
+ await session.refresh(rule)
+ return rules
diff --git a/backend/tests/test_account_closure_api.py b/backend/tests/test_account_closure_api.py
new file mode 100644
index 00000000..d1ebaeba
--- /dev/null
+++ b/backend/tests/test_account_closure_api.py
@@ -0,0 +1,166 @@
+"""Tests for account closure and reopen endpoints (Phase 2)."""
+import pytest
+from httpx import AsyncClient
+
+from app.models.account import Account
+
+
+async def test_close_manual_account(client: AsyncClient, auth_headers):
+ """Closing a manual account sets is_closed=True and closed_at."""
+ # Create a manual account
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Savings", "type": "savings", "balance": "1000.00", "currency": "BRL"},
+ )
+ assert resp.status_code == 201
+ account_id = resp.json()["id"]
+
+ # Close it
+ close_resp = await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+ assert close_resp.status_code == 200
+ data = close_resp.json()
+ assert data["is_closed"] is True
+ assert data["closed_at"] is not None
+
+
+async def test_close_bank_connected_account_unlinks(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ """Closing a bank-connected account unlinks it from the connection."""
+ assert test_account.connection_id is not None
+
+ close_resp = await client.post(
+ f"/api/accounts/{test_account.id}/close", headers=auth_headers
+ )
+ assert close_resp.status_code == 200
+ data = close_resp.json()
+ assert data["is_closed"] is True
+ assert data["connection_id"] is None
+
+
+async def test_close_already_closed_account_fails(client: AsyncClient, auth_headers):
+ """Closing an already-closed account returns 400."""
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Temp", "type": "checking", "currency": "BRL"},
+ )
+ account_id = resp.json()["id"]
+
+ # Close it
+ await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+
+ # Try closing again
+ close_resp = await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+ assert close_resp.status_code == 400
+
+
+async def test_reopen_closed_account(client: AsyncClient, auth_headers):
+ """Reopening a closed account sets is_closed=False and closed_at=None."""
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Reopen Test", "type": "checking", "currency": "BRL"},
+ )
+ account_id = resp.json()["id"]
+
+ # Close then reopen
+ await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+ reopen_resp = await client.post(f"/api/accounts/{account_id}/reopen", headers=auth_headers)
+ assert reopen_resp.status_code == 200
+ data = reopen_resp.json()
+ assert data["is_closed"] is False
+ assert data["closed_at"] is None
+
+
+async def test_reopen_non_closed_account_fails(client: AsyncClient, auth_headers):
+ """Reopening an account that is not closed returns 400."""
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Not Closed", "type": "checking", "currency": "BRL"},
+ )
+ account_id = resp.json()["id"]
+
+ reopen_resp = await client.post(f"/api/accounts/{account_id}/reopen", headers=auth_headers)
+ assert reopen_resp.status_code == 400
+
+
+async def test_closed_accounts_excluded_from_list(client: AsyncClient, auth_headers):
+ """Closed accounts are excluded from the default account listing."""
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Will Close", "type": "checking", "currency": "BRL"},
+ )
+ account_id = resp.json()["id"]
+
+ # Close it
+ await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+
+ # Default list should not include it
+ list_resp = await client.get("/api/accounts", headers=auth_headers)
+ ids = [a["id"] for a in list_resp.json()]
+ assert account_id not in ids
+
+
+async def test_closed_accounts_included_when_requested(client: AsyncClient, auth_headers):
+ """Closed accounts appear when include_closed=true."""
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Closed Visible", "type": "checking", "currency": "BRL"},
+ )
+ account_id = resp.json()["id"]
+
+ await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+
+ # With include_closed=true
+ list_resp = await client.get(
+ "/api/accounts", params={"include_closed": "true"}, headers=auth_headers
+ )
+ ids = [a["id"] for a in list_resp.json()]
+ assert account_id in ids
+
+
+async def test_close_account_not_found(client: AsyncClient, auth_headers, clean_db):
+ """Closing a nonexistent account returns 404."""
+ resp = await client.post(
+ "/api/accounts/00000000-0000-0000-0000-000000000000/close",
+ headers=auth_headers,
+ )
+ assert resp.status_code == 404
+
+
+async def test_closed_account_excluded_from_dashboard_balance(client: AsyncClient, auth_headers):
+ """Dashboard total balance should exclude closed accounts."""
+ # Create account with balance
+ resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Dashboard Test", "type": "checking", "balance": "5000.00", "currency": "BRL"},
+ )
+ account_id = resp.json()["id"]
+
+ # Check balance is included
+ summary_resp = await client.get("/api/dashboard/summary", headers=auth_headers)
+ total_before = sum(float(v) for v in summary_resp.json()["total_balance"].values())
+ assert total_before == 5000.0
+
+ # Close account
+ await client.post(f"/api/accounts/{account_id}/close", headers=auth_headers)
+
+ # Balance should now be excluded
+ summary_resp = await client.get("/api/dashboard/summary", headers=auth_headers)
+ total_after = sum(float(v) for v in summary_resp.json()["total_balance"].values())
+ assert total_after == 0.0
diff --git a/backend/tests/test_accounts_api.py b/backend/tests/test_accounts_api.py
new file mode 100644
index 00000000..dba2ff63
--- /dev/null
+++ b/backend/tests/test_accounts_api.py
@@ -0,0 +1,391 @@
+import pytest
+from httpx import AsyncClient
+
+from app.models.account import Account
+
+
+async def test_list_accounts(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ response = await client.get("/api/accounts", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) == 1
+ assert data[0]["name"] == "Conta Corrente"
+ assert data[0]["type"] == "checking"
+ assert data[0]["currency"] == "BRL"
+
+
+async def test_list_accounts_empty(client: AsyncClient, auth_headers):
+ response = await client.get("/api/accounts", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) == 0
+
+
+async def test_get_account(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ response = await client.get(
+ f"/api/accounts/{test_account.id}", headers=auth_headers
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["name"] == "Conta Corrente"
+ assert data["balance"] == "1500.00"
+
+
+async def test_get_account_not_found(client: AsyncClient, auth_headers, test_account):
+ response = await client.get(
+ "/api/accounts/00000000-0000-0000-0000-000000000000",
+ headers=auth_headers,
+ )
+ assert response.status_code == 404
+
+
+async def test_create_manual_account(client: AsyncClient, auth_headers):
+ response = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={
+ "name": "Carteira",
+ "type": "checking",
+ "balance": "500.00",
+ "currency": "BRL",
+ },
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["name"] == "Carteira"
+ assert data["balance"] == "500.00"
+ assert data["connection_id"] is None
+ assert data["external_id"] is None
+
+
+async def test_update_manual_account(client: AsyncClient, auth_headers):
+ # Create a manual account first
+ create_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Poupança", "type": "savings", "balance": "1000.00"},
+ )
+ account_id = create_resp.json()["id"]
+
+ # Update it
+ response = await client.patch(
+ f"/api/accounts/{account_id}",
+ headers=auth_headers,
+ json={"name": "Poupança Atualizada", "balance": "2000.00"},
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["name"] == "Poupança Atualizada"
+ assert data["balance"] == "2000.00"
+
+
+async def test_update_bank_connected_account_rejected(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ response = await client.patch(
+ f"/api/accounts/{test_account.id}",
+ headers=auth_headers,
+ json={"name": "Hacked"},
+ )
+ assert response.status_code == 400
+ assert "bank-connected" in response.json()["detail"].lower()
+
+
+async def test_delete_manual_account(client: AsyncClient, auth_headers):
+ # Create a manual account
+ create_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Temp", "type": "checking"},
+ )
+ account_id = create_resp.json()["id"]
+
+ # Delete it
+ response = await client.delete(f"/api/accounts/{account_id}", headers=auth_headers)
+ assert response.status_code == 204
+
+ # Verify it's gone
+ response = await client.get(f"/api/accounts/{account_id}", headers=auth_headers)
+ assert response.status_code == 404
+
+
+async def test_delete_bank_connected_account_rejected(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ response = await client.delete(
+ f"/api/accounts/{test_account.id}", headers=auth_headers
+ )
+ assert response.status_code == 400
+ assert "bank-connected" in response.json()["detail"].lower()
+
+
+async def test_accounts_unauthenticated(client: AsyncClient, clean_db):
+ response = await client.get("/api/accounts")
+ assert response.status_code == 401
+
+
+async def test_create_account_with_balance_creates_opening_transaction(
+ client: AsyncClient, auth_headers, session
+):
+ """Creating an account with balance > 0 must create an opening_balance transaction in the DB."""
+ from sqlalchemy import select
+ from app.models.transaction import Transaction as TxModel
+ import uuid as _uuid
+ from decimal import Decimal
+
+ response = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Carteira", "type": "wallet", "balance": "500.00", "currency": "BRL"},
+ )
+ assert response.status_code == 201
+ account_id = response.json()["id"]
+
+ # Verify the opening_balance transaction was actually written to the DB
+ result = await session.execute(
+ select(TxModel).where(
+ TxModel.account_id == _uuid.UUID(account_id),
+ TxModel.source == "opening_balance",
+ )
+ )
+ opening_tx = result.scalar_one_or_none()
+ assert opening_tx is not None, "opening_balance transaction should exist in DB"
+ assert opening_tx.amount == Decimal("500.00")
+ assert opening_tx.type == "credit"
+ assert opening_tx.description == "Saldo inicial"
+
+ # Also verify it does NOT appear in the public transaction list
+ txn_response = await client.get(
+ f"/api/transactions?account_id={account_id}", headers=auth_headers
+ )
+ assert txn_response.status_code == 200
+ items = txn_response.json()["items"]
+ assert all(t["source"] != "opening_balance" for t in items)
+
+
+async def test_create_account_zero_balance_no_opening_transaction(
+ client: AsyncClient, auth_headers
+):
+ """Creating an account with balance = 0 must NOT create any transaction."""
+ response = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Vazia", "type": "checking", "balance": "0", "currency": "BRL"},
+ )
+ assert response.status_code == 201
+ account_id = response.json()["id"]
+
+ txn_response = await client.get(
+ f"/api/transactions?account_id={account_id}", headers=auth_headers
+ )
+ assert txn_response.json()["total"] == 0
+
+
+async def test_account_summary(
+ client: AsyncClient, auth_headers, test_account, test_transactions
+):
+ """Summary endpoint returns computed balance from transactions (current month).
+
+ Fixture transactions (current month, no opening_balance):
+ credit: SALARIO FEV 8000.00, PIX RECEBIDO 150.00 → income = 8150.00
+ debit: UBER TRIP 25.50, IFOOD 45.00, NETFLIX 39.90 → expenses = 110.40
+
+ Note: test_account is bank-connected so current_balance uses the stored
+ Account.balance (1500.00), not the computed sum from transactions.
+ """
+ expected_income = 8000.00 + 150.00 # 8150.00
+ expected_expenses = 25.50 + 45.00 + 39.90 # 110.40
+
+ account_id = str(test_account.id)
+ response = await client.get(f"/api/accounts/{account_id}/summary", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert data["monthly_income"] == pytest.approx(expected_income)
+ assert data["monthly_expenses"] == pytest.approx(expected_expenses)
+ # Bank-connected accounts use stored balance from provider, not computed
+ assert data["current_balance"] == pytest.approx(1500.00)
+ assert isinstance(data["account_id"], str)
+
+
+async def test_account_summary_not_found(client: AsyncClient, auth_headers):
+ response = await client.get(
+ "/api/accounts/00000000-0000-0000-0000-000000000000/summary",
+ headers=auth_headers,
+ )
+ assert response.status_code == 404
+
+
+async def test_list_accounts_includes_manual_and_bank_connected(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ """Accounts list returns both manual and bank-connected accounts for the sidebar."""
+ # test_account is bank-connected (has connection_id). Create a manual account too.
+ create_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Carteira Manual", "type": "savings", "balance": "200.00", "currency": "BRL"},
+ )
+ assert create_resp.status_code == 201
+
+ response = await client.get("/api/accounts", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+
+ assert len(data) == 2, f"Expected 2 accounts (1 bank + 1 manual), got {len(data)}"
+
+ names = {a["name"] for a in data}
+ assert "Conta Corrente" in names, "Bank-connected account should appear"
+ assert "Carteira Manual" in names, "Manual account should appear"
+
+ # Verify we can distinguish them by connection_id
+ bank_acct = next(a for a in data if a["name"] == "Conta Corrente")
+ manual_acct = next(a for a in data if a["name"] == "Carteira Manual")
+ assert bank_acct["connection_id"] is not None, "Bank account should have connection_id"
+ assert manual_acct["connection_id"] is None, "Manual account should have no connection_id"
+
+
+async def test_credit_card_account_returns_negative_current_balance(
+ client: AsyncClient, auth_headers
+):
+ """Credit card accounts represent debt (liabilities).
+
+ The stored balance remains positive (raw from bank), but the API returns
+ current_balance negated so consumers see it as a liability.
+ """
+ create_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={
+ "name": "Nubank Roxinho",
+ "type": "credit_card",
+ "balance": "3500.00",
+ "currency": "BRL",
+ },
+ )
+ assert create_resp.status_code == 201
+ account_id = create_resp.json()["id"]
+
+ # Fetch the individual account — raw balance unchanged
+ response = await client.get(f"/api/accounts/{account_id}", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+
+ assert data["type"] == "credit_card"
+ assert data["balance"] == "3500.00", "Raw stored balance should remain positive"
+ assert data["connection_id"] is None
+
+ # Verify current_balance is negated in the list endpoint
+ list_resp = await client.get("/api/accounts", headers=auth_headers)
+ cc_accounts = [a for a in list_resp.json() if a["type"] == "credit_card"]
+ assert len(cc_accounts) >= 1
+ assert cc_accounts[0]["balance"] == "3500.00", "Raw balance stays positive"
+ assert cc_accounts[0]["current_balance"] == pytest.approx(-3500.00), (
+ "current_balance should be negated for credit cards"
+ )
+
+
+async def test_dashboard_total_balance_subtracts_credit_card_debt(
+ client: AsyncClient, auth_headers
+):
+ """Dashboard total_balance subtracts credit card debt as a liability.
+
+ Credit card balances are negated in the backend: a credit card with a 2000
+ opening balance contributes -2000 to total_balance. A checking account with
+ 5000 contributes +5000. Net total = 5000 - 2000 = 3000.
+ """
+ # Create a checking account with 5000 balance
+ checking_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Checking", "type": "checking", "balance": "5000.00", "currency": "BRL"},
+ )
+ assert checking_resp.status_code == 201
+
+ # Create a credit card account with 2000 balance (represents debt)
+ cc_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={"name": "Credit Card", "type": "credit_card", "balance": "2000.00", "currency": "BRL"},
+ )
+ assert cc_resp.status_code == 201
+
+ resp = await client.get("/api/dashboard/summary", headers=auth_headers)
+ assert resp.status_code == 200
+ data = resp.json()
+
+ total = sum(float(v) for v in data["total_balance"].values())
+ assert total == 3000.0, (
+ f"Expected total_balance=3000.0 (5000 checking - 2000 CC debt); got {total}"
+ )
+
+
+async def test_credit_card_summary_returns_negative_balance(
+ client: AsyncClient, auth_headers
+):
+ """Account summary for a credit card should return negative current_balance."""
+ create_resp = await client.post(
+ "/api/accounts",
+ headers=auth_headers,
+ json={
+ "name": "CC Summary Test",
+ "type": "credit_card",
+ "balance": "1200.00",
+ "currency": "BRL",
+ },
+ )
+ assert create_resp.status_code == 201
+ account_id = create_resp.json()["id"]
+
+ response = await client.get(
+ f"/api/accounts/{account_id}/summary", headers=auth_headers
+ )
+ assert response.status_code == 200
+ data = response.json()
+
+ assert data["current_balance"] == pytest.approx(-1200.00), (
+ f"Credit card summary current_balance should be -1200; got {data['current_balance']}"
+ )
+
+
+async def test_list_accounts_includes_previous_balance(client: AsyncClient, auth_headers):
+ """Account list should include previous_balance field."""
+ # Create account
+ response = await client.post(
+ "/api/accounts",
+ json={"name": "Test PB", "type": "checking", "balance": 1000},
+ headers=auth_headers,
+ )
+ assert response.status_code == 201
+
+ # List accounts
+ response = await client.get("/api/accounts", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) > 0
+ # Find our account
+ test_acc = [a for a in data if a["name"] == "Test PB"][0]
+ assert "previous_balance" in test_acc
+ assert isinstance(test_acc["previous_balance"], (int, float))
diff --git a/backend/tests/test_auth_api.py b/backend/tests/test_auth_api.py
new file mode 100644
index 00000000..7cba25d7
--- /dev/null
+++ b/backend/tests/test_auth_api.py
@@ -0,0 +1,62 @@
+import pytest
+from httpx import AsyncClient
+
+
+async def test_register(client: AsyncClient, clean_db):
+ response = await client.post(
+ "/api/auth/register",
+ json={"email": "[email protected]", "password": "newpass123"},
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["email"] == "[email protected]"
+ assert "id" in data
+ assert data["is_active"] is True
+
+
+async def test_register_duplicate_email(client: AsyncClient, test_user):
+ response = await client.post(
+ "/api/auth/register",
+ json={"email": "[email protected]", "password": "otherpass123"},
+ )
+ assert response.status_code == 400
+
+
+async def test_login(client: AsyncClient, test_user):
+ response = await client.post(
+ "/api/auth/login",
+ data={"username": "[email protected]", "password": "testpass123"},
+ headers={"Content-Type": "application/x-www-form-urlencoded"},
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert "access_token" in data
+ assert data["token_type"] == "bearer"
+
+
+async def test_login_wrong_password(client: AsyncClient, test_user):
+ response = await client.post(
+ "/api/auth/login",
+ data={"username": "[email protected]", "password": "wrongpass"},
+ headers={"Content-Type": "application/x-www-form-urlencoded"},
+ )
+ assert response.status_code == 400
+
+
+async def test_get_me(client: AsyncClient, auth_headers):
+ response = await client.get("/api/users/me", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert data["email"] == "[email protected]"
+ assert data["preferences"]["language"] == "pt-BR"
+
+
+async def test_get_me_unauthenticated(client: AsyncClient, clean_db):
+ response = await client.get("/api/users/me")
+ assert response.status_code == 401
diff --git a/backend/tests/test_budgets_api.py b/backend/tests/test_budgets_api.py
new file mode 100644
index 00000000..d3c80081
--- /dev/null
+++ b/backend/tests/test_budgets_api.py
@@ -0,0 +1,313 @@
+"""Tests for recurring budgets API."""
+from datetime import date, timedelta
+
+import pytest
+
+
+def _current_month_str() -> str:
+ return date.today().replace(day=1).isoformat()
+
+
+def _prev_month_str() -> str:
+ first = date.today().replace(day=1)
+ prev = (first - timedelta(days=1)).replace(day=1)
+ return prev.isoformat()
+
+
+def _next_month_str() -> str:
+ first = date.today().replace(day=1)
+ if first.month == 12:
+ return first.replace(year=first.year + 1, month=1).isoformat()
+ return first.replace(month=first.month + 1).isoformat()
+
+
+def _month_str(months_offset: int) -> str:
+ """Return 1st of month N months from now (negative = past)."""
+ d = date.today().replace(day=1)
+ for _ in range(abs(months_offset)):
+ if months_offset > 0:
+ if d.month == 12:
+ d = d.replace(year=d.year + 1, month=1)
+ else:
+ d = d.replace(month=d.month + 1)
+ else:
+ if d.month == 1:
+ d = d.replace(year=d.year - 1, month=12)
+ else:
+ d = d.replace(month=d.month - 1)
+ return d.isoformat()
+
+
+async def test_create_budget_defaults_non_recurring(client, auth_headers, test_categories):
+ """Creating a budget without is_recurring defaults to false (backward compat)."""
+ cat = test_categories[0]
+ response = await client.post(
+ "/api/budgets",
+ json={"category_id": str(cat.id), "amount": 500, "month": _current_month_str()},
+ headers=auth_headers,
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["is_recurring"] is False
+ assert float(data["amount"]) == 500.0
+
+
+async def test_create_recurring_budget(client, auth_headers, test_categories):
+ """Creating a recurring budget sets is_recurring=true."""
+ cat = test_categories[1]
+ response = await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 300,
+ "month": _current_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["is_recurring"] is True
+
+
+async def test_recurring_budget_appears_in_future_months(client, auth_headers, test_categories):
+ """A recurring budget effective from current month should appear in future month listings."""
+ cat = test_categories[0]
+ # Create recurring budget for current month
+ create_resp = await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 1000,
+ "month": _current_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+ assert create_resp.status_code == 201
+
+ # Check it appears for next month
+ list_resp = await client.get(
+ "/api/budgets",
+ params={"month": _next_month_str()},
+ headers=auth_headers,
+ )
+ assert list_resp.status_code == 200
+ budgets = list_resp.json()
+ cat_budgets = [b for b in budgets if b["category_id"] == str(cat.id)]
+ assert len(cat_budgets) == 1
+ assert float(cat_budgets[0]["amount"]) == 1000.0
+ assert cat_budgets[0]["is_recurring"] is True
+
+
+async def test_override_wins_over_recurring(client, auth_headers, test_categories):
+ """A month-specific override should take priority over a recurring budget."""
+ cat = test_categories[1]
+ # Create recurring
+ await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 500,
+ "month": _current_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+
+ next_month = _next_month_str()
+
+ # Create override for next month
+ await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 750,
+ "month": next_month,
+ "is_recurring": False,
+ },
+ headers=auth_headers,
+ )
+
+ # List for next month — override should win
+ list_resp = await client.get(
+ "/api/budgets",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ budgets = list_resp.json()
+ cat_budgets = [b for b in budgets if b["category_id"] == str(cat.id)]
+ assert len(cat_budgets) == 1
+ assert float(cat_budgets[0]["amount"]) == 750.0
+ assert cat_budgets[0]["is_recurring"] is False
+
+
+async def test_recurring_not_visible_before_effective_month(client, auth_headers, test_categories):
+ """A recurring budget should NOT appear for months before its effective-from month."""
+ cat = test_categories[0]
+ # Create recurring budget effective from next month
+ await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 800,
+ "month": _next_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+
+ # Should not appear for current month
+ list_resp = await client.get(
+ "/api/budgets",
+ params={"month": _current_month_str()},
+ headers=auth_headers,
+ )
+ budgets = list_resp.json()
+ cat_budgets = [b for b in budgets if b["category_id"] == str(cat.id)]
+ assert len(cat_budgets) == 0
+
+
+async def test_budget_comparison_resolves_recurring(client, auth_headers, test_categories, test_transactions):
+ """Budget comparison endpoint should resolve recurring budgets correctly."""
+ cat = test_categories[0] # Alimentação — has spending in test_transactions
+
+ # Create recurring budget
+ await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 200,
+ "month": _current_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+
+ # Check comparison
+ comp_resp = await client.get(
+ "/api/budgets/comparison",
+ params={"month": _current_month_str()},
+ headers=auth_headers,
+ )
+ assert comp_resp.status_code == 200
+ comparisons = comp_resp.json()
+ cat_comp = [c for c in comparisons if c["category_id"] == str(cat.id)]
+ assert len(cat_comp) == 1
+ assert float(cat_comp[0]["budget_amount"]) == 200.0
+ assert cat_comp[0]["is_recurring"] is True
+
+
+async def test_update_recurring_creates_new_record(client, auth_headers, test_categories):
+ """Editing a recurring budget from a later month creates a new record; old one stays."""
+ cat = test_categories[0]
+
+ # Create recurring budget for current month
+ create_resp = await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 400,
+ "month": _current_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+ original_id = create_resp.json()["id"]
+
+ next_month = _next_month_str()
+
+ # Update with a new effective month
+ update_resp = await client.patch(
+ f"/api/budgets/{original_id}",
+ json={"amount": 600, "effective_month": next_month},
+ headers=auth_headers,
+ )
+ assert update_resp.status_code == 200
+ new_data = update_resp.json()
+ assert new_data["id"] != original_id # New record created
+ assert float(new_data["amount"]) == 600.0
+ assert new_data["is_recurring"] is True
+
+ # Current month should still show original amount
+ list_resp = await client.get(
+ "/api/budgets",
+ params={"month": _current_month_str()},
+ headers=auth_headers,
+ )
+ cat_budgets = [b for b in list_resp.json() if b["category_id"] == str(cat.id)]
+ assert len(cat_budgets) == 1
+ assert float(cat_budgets[0]["amount"]) == 400.0
+
+ # Next month should show new amount
+ list_resp2 = await client.get(
+ "/api/budgets",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ cat_budgets2 = [b for b in list_resp2.json() if b["category_id"] == str(cat.id)]
+ assert len(cat_budgets2) == 1
+ assert float(cat_budgets2[0]["amount"]) == 600.0
+
+
+async def test_delete_recurring_previous_takes_effect(client, auth_headers, test_categories):
+ """Deleting a newer recurring budget makes an older one take effect again."""
+ cat = test_categories[1]
+
+ # Create recurring budget for current month
+ await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 100,
+ "month": _current_month_str(),
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+
+ next_month = _next_month_str()
+
+ # Create newer recurring for next month
+ create_resp = await client.post(
+ "/api/budgets",
+ json={
+ "category_id": str(cat.id),
+ "amount": 200,
+ "month": next_month,
+ "is_recurring": True,
+ },
+ headers=auth_headers,
+ )
+ newer_id = create_resp.json()["id"]
+
+ # Next month should show 200
+ list_resp = await client.get(
+ "/api/budgets",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ cat_budgets = [b for b in list_resp.json() if b["category_id"] == str(cat.id)]
+ assert float(cat_budgets[0]["amount"]) == 200.0
+
+ # Delete the newer one
+ del_resp = await client.delete(f"/api/budgets/{newer_id}", headers=auth_headers)
+ assert del_resp.status_code == 204
+
+ # Next month should now fall back to 100
+ list_resp2 = await client.get(
+ "/api/budgets",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ cat_budgets2 = [b for b in list_resp2.json() if b["category_id"] == str(cat.id)]
+ assert len(cat_budgets2) == 1
+ assert float(cat_budgets2[0]["amount"]) == 100.0
diff --git a/backend/tests/test_categories_api.py b/backend/tests/test_categories_api.py
new file mode 100644
index 00000000..b6d6f53c
--- /dev/null
+++ b/backend/tests/test_categories_api.py
@@ -0,0 +1,97 @@
+import pytest
+from httpx import AsyncClient
+
+from app.models.category import Category
+
+
+async def test_list_categories_creates_defaults(client: AsyncClient, auth_headers):
+ """First call should auto-create default categories."""
+ response = await client.get("/api/categories", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) == 15
+ names = {c["name"] for c in data}
+ assert "Alimentação" in names
+ assert "Transporte" in names
+ assert "Outros" in names
+
+
+async def test_list_categories_with_existing(
+ client: AsyncClient, auth_headers, test_categories: list[Category]
+):
+ response = await client.get("/api/categories", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) == 3
+
+
+async def test_create_category(client: AsyncClient, auth_headers, test_categories):
+ response = await client.post(
+ "/api/categories",
+ headers=auth_headers,
+ json={"name": "Educação", "icon": "📚", "color": "#9333EA"},
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["name"] == "Educação"
+ assert data["icon"] == "📚"
+ assert data["is_system"] is False
+
+
+async def test_update_category(
+ client: AsyncClient, auth_headers, test_categories: list[Category]
+):
+ cat_id = str(test_categories[0].id)
+ response = await client.patch(
+ f"/api/categories/{cat_id}",
+ headers=auth_headers,
+ json={"name": "Comida", "color": "#FF0000"},
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["name"] == "Comida"
+ assert data["color"] == "#FF0000"
+ assert data["icon"] == "🍔" # unchanged
+
+
+async def test_update_category_not_found(client: AsyncClient, auth_headers, test_categories):
+ response = await client.patch(
+ "/api/categories/00000000-0000-0000-0000-000000000000",
+ headers=auth_headers,
+ json={"name": "Nope"},
+ )
+ assert response.status_code == 404
+
+
+async def test_delete_category(client: AsyncClient, auth_headers, test_categories):
+ # Create a non-system category first
+ create_resp = await client.post(
+ "/api/categories",
+ headers=auth_headers,
+ json={"name": "Temp"},
+ )
+ cat_id = create_resp.json()["id"]
+
+ response = await client.delete(f"/api/categories/{cat_id}", headers=auth_headers)
+ assert response.status_code == 204
+
+
+async def test_delete_system_category_fails(
+ client: AsyncClient, auth_headers, test_categories: list[Category]
+):
+ cat_id = str(test_categories[0].id) # system category
+ response = await client.delete(f"/api/categories/{cat_id}", headers=auth_headers)
+ assert response.status_code == 400
+
+
+async def test_categories_unauthenticated(client: AsyncClient, clean_db):
+ response = await client.get("/api/categories")
+ assert response.status_code == 401
diff --git a/backend/tests/test_category_service.py b/backend/tests/test_category_service.py
new file mode 100644
index 00000000..6d7469cd
--- /dev/null
+++ b/backend/tests/test_category_service.py
@@ -0,0 +1,134 @@
+import uuid
+
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.category import Category
+from app.models.user import User
+from app.schemas.category import CategoryCreate, CategoryUpdate
+from app.services.category_service import (
+ DEFAULT_CATEGORIES_I18N,
+ create_category,
+ create_default_categories,
+ delete_category,
+ get_categories,
+ update_category,
+)
+
+
+async def test_create_default_categories(session: AsyncSession, test_user: User):
+ """create_default_categories should create all default system categories."""
+ categories = await create_default_categories(session, test_user.id)
+ assert len(categories) == len(DEFAULT_CATEGORIES_I18N)
+ # All should be system categories
+ for cat in categories:
+ assert cat.is_system is True
+ assert cat.user_id == test_user.id
+ # Verify names match the DEFAULT_CATEGORIES_I18N (pt-BR by default)
+ expected_names = {data["pt-BR"] for data in DEFAULT_CATEGORIES_I18N.values()}
+ actual_names = {c.name for c in categories}
+ assert actual_names == expected_names
+
+
+async def test_get_categories(
+ session: AsyncSession, test_user: User, test_categories: list[Category]
+):
+ """get_categories should return all categories for the given user."""
+ categories = await get_categories(session, test_user.id)
+ assert len(categories) == len(test_categories)
+ returned_ids = {c.id for c in categories}
+ expected_ids = {c.id for c in test_categories}
+ assert returned_ids == expected_ids
+
+
+async def test_get_categories_excludes_other_users(
+ session: AsyncSession, test_user: User, test_categories: list[Category]
+):
+ """get_categories should not return categories belonging to other users."""
+ other_user_id = uuid.uuid4()
+ categories = await get_categories(session, other_user_id)
+ assert len(categories) == 0
+
+
+async def test_create_category(session: AsyncSession, test_user: User):
+ """create_category should create a custom (non-system) category."""
+ data = CategoryCreate(name="Educacao", icon="📚", color="#9333EA")
+ category = await create_category(session, test_user.id, data)
+
+ assert category.id is not None
+ assert category.name == "Educacao"
+ assert category.icon == "📚"
+ assert category.color == "#9333EA"
+ assert category.user_id == test_user.id
+ assert category.is_system is False
+
+
+async def test_update_category(
+ session: AsyncSession, test_user: User, test_categories: list[Category]
+):
+ """update_category should update name, icon, and color."""
+ cat = test_categories[0] # Alimentacao
+ data = CategoryUpdate(name="Comida", icon="🍕", color="#FF6347")
+ updated = await update_category(session, cat.id, test_user.id, data)
+
+ assert updated is not None
+ assert updated.name == "Comida"
+ assert updated.icon == "🍕"
+ assert updated.color == "#FF6347"
+
+
+async def test_update_category_partial(
+ session: AsyncSession, test_user: User, test_categories: list[Category]
+):
+ """update_category with partial data should only update provided fields."""
+ cat = test_categories[1] # Transporte
+ original_icon = cat.icon
+ original_color = cat.color
+ data = CategoryUpdate(name="Mobilidade")
+ updated = await update_category(session, cat.id, test_user.id, data)
+
+ assert updated is not None
+ assert updated.name == "Mobilidade"
+ assert updated.icon == original_icon
+ assert updated.color == original_color
+
+
+async def test_update_category_not_found(session: AsyncSession, test_user: User):
+ """update_category should return None for non-existent category."""
+ data = CategoryUpdate(name="Ghost")
+ result = await update_category(session, uuid.uuid4(), test_user.id, data)
+ assert result is None
+
+
+async def test_delete_category(session: AsyncSession, test_user: User):
+ """delete_category should successfully delete a non-system category."""
+ # Create a non-system category first
+ data = CategoryCreate(name="Temporaria", icon="🗑️", color="#000000")
+ cat = await create_category(session, test_user.id, data)
+ assert cat.is_system is False
+
+ result = await delete_category(session, cat.id, test_user.id)
+ assert result is True
+
+ # Verify it's gone
+ from app.services.category_service import get_category
+
+ deleted = await get_category(session, cat.id, test_user.id)
+ assert deleted is None
+
+
+async def test_delete_system_category_fails(
+ session: AsyncSession, test_user: User, test_categories: list[Category]
+):
+ """delete_category should refuse to delete system categories (returns False)."""
+ system_cat = test_categories[0] # is_system=True from fixture
+ assert system_cat.is_system is True
+
+ result = await delete_category(session, system_cat.id, test_user.id)
+ assert result is False
+
+ # Verify it still exists
+ from app.services.category_service import get_category
+
+ still_exists = await get_category(session, system_cat.id, test_user.id)
+ assert still_exists is not None
+ assert still_exists.id == system_cat.id
diff --git a/backend/tests/test_connection_settings_api.py b/backend/tests/test_connection_settings_api.py
new file mode 100644
index 00000000..e9ba408e
--- /dev/null
+++ b/backend/tests/test_connection_settings_api.py
@@ -0,0 +1,118 @@
+"""Tests for connection settings PATCH endpoint (Phase 2)."""
+import pytest
+from httpx import AsyncClient
+
+from app.models.bank_connection import BankConnection
+
+
+async def test_update_payee_source(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ """PATCH connection settings updates payee_source."""
+ resp = await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"payee_source": "merchant"},
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["settings"]["payee_source"] == "merchant"
+
+
+async def test_update_import_pending(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ """PATCH connection settings updates import_pending."""
+ resp = await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"import_pending": False},
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["settings"]["import_pending"] is False
+
+
+async def test_update_both_settings(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ """PATCH can update both settings at once."""
+ resp = await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"payee_source": "description", "import_pending": False},
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["settings"]["payee_source"] == "description"
+ assert data["settings"]["import_pending"] is False
+
+
+async def test_partial_update_preserves_other_settings(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ """Updating one setting preserves the other."""
+ # Set both first
+ await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"payee_source": "merchant", "import_pending": False},
+ )
+
+ # Update only payee_source
+ resp = await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"payee_source": "none"},
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["settings"]["payee_source"] == "none"
+ assert data["settings"]["import_pending"] is False
+
+
+async def test_invalid_payee_source_rejected(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ """Invalid payee_source value should be rejected by validation."""
+ resp = await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"payee_source": "invalid_value"},
+ )
+ assert resp.status_code == 422
+
+
+async def test_settings_connection_not_found(client: AsyncClient, auth_headers, test_connection):
+ """PATCH on nonexistent connection returns 404."""
+ resp = await client.patch(
+ "/api/connections/00000000-0000-0000-0000-000000000000/settings",
+ headers=auth_headers,
+ json={"payee_source": "auto"},
+ )
+ assert resp.status_code == 404
+
+
+async def test_settings_visible_in_connection_list(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ """Connection settings appear in the connection list response."""
+ # Set a setting
+ await client.patch(
+ f"/api/connections/{test_connection.id}/settings",
+ headers=auth_headers,
+ json={"payee_source": "payment_data"},
+ )
+
+ # List connections
+ resp = await client.get("/api/connections", headers=auth_headers)
+ assert resp.status_code == 200
+ conn = resp.json()[0]
+ assert conn["settings"]["payee_source"] == "payment_data"
diff --git a/backend/tests/test_connections_api.py b/backend/tests/test_connections_api.py
new file mode 100644
index 00000000..a3496900
--- /dev/null
+++ b/backend/tests/test_connections_api.py
@@ -0,0 +1,76 @@
+import pytest
+from httpx import AsyncClient
+
+from app.models.bank_connection import BankConnection
+
+
+async def test_list_providers(client: AsyncClient, auth_headers):
+ """Should return all known providers with their configuration status."""
+ response = await client.get("/api/connections/providers", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data["providers"]) == 1
+ assert data["providers"][0]["name"] == "pluggy"
+ assert data["providers"][0]["configured"] is False
+
+
+async def test_list_connections(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ response = await client.get("/api/connections", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) == 1
+ assert data[0]["institution_name"] == "Banco Teste"
+ assert data[0]["provider"] == "test"
+ assert data[0]["status"] == "active"
+
+
+async def test_list_connections_empty(client: AsyncClient, auth_headers):
+ response = await client.get("/api/connections", headers=auth_headers)
+ assert response.status_code == 200
+ assert response.json() == []
+
+
+async def test_oauth_url_unknown_provider(client: AsyncClient, auth_headers):
+ """Should fail for unregistered provider."""
+ response = await client.post(
+ "/api/connections/oauth/url",
+ headers=auth_headers,
+ json={"provider": "nonexistent"},
+ )
+ assert response.status_code == 400
+ assert "Unknown provider" in response.json()["detail"]
+
+
+async def test_delete_connection(
+ client: AsyncClient, auth_headers, test_connection: BankConnection
+):
+ response = await client.delete(
+ f"/api/connections/{test_connection.id}", headers=auth_headers
+ )
+ assert response.status_code == 204
+
+ # Verify it's gone
+ response = await client.get("/api/connections", headers=auth_headers)
+ assert response.json() == []
+
+
+async def test_delete_connection_not_found(client: AsyncClient, auth_headers, test_connection):
+ response = await client.delete(
+ "/api/connections/00000000-0000-0000-0000-000000000000",
+ headers=auth_headers,
+ )
+ assert response.status_code == 404
+
+
+async def test_connections_unauthenticated(client: AsyncClient, clean_db):
+ response = await client.get("/api/connections")
+ assert response.status_code == 401
diff --git a/backend/tests/test_dashboard_api.py b/backend/tests/test_dashboard_api.py
new file mode 100644
index 00000000..afbb481f
--- /dev/null
+++ b/backend/tests/test_dashboard_api.py
@@ -0,0 +1,551 @@
+"""Tests for dashboard API endpoints."""
+import calendar
+from datetime import date, timedelta
+
+import pytest
+
+
+def _current_month_str() -> str:
+ """Return the 1st of the current month as 'YYYY-MM-DD'."""
+ return date.today().replace(day=1).isoformat()
+
+
+def _prev_month_str() -> str:
+ """Return the 1st of the previous month as 'YYYY-MM-DD'."""
+ first = date.today().replace(day=1)
+ prev = (first - timedelta(days=1)).replace(day=1)
+ return prev.isoformat()
+
+
+def _next_month_str() -> str:
+ """Return the 1st of next month as 'YYYY-MM-DD'."""
+ first = date.today().replace(day=1)
+ if first.month == 12:
+ return first.replace(year=first.year + 1, month=1).isoformat()
+ return first.replace(month=first.month + 1).isoformat()
+
+
+def _future_month_str(months_ahead: int) -> str:
+ """Return the 1st of N months ahead as 'YYYY-MM-DD'."""
+ d = date.today().replace(day=1)
+ for _ in range(months_ahead):
+ if d.month == 12:
+ d = d.replace(year=d.year + 1, month=1)
+ else:
+ d = d.replace(month=d.month + 1)
+ return d.isoformat()
+
+
+async def test_spending_by_category(client, auth_headers, test_transactions):
+ """Spending by category returns numeric totals (not strings) for chart rendering."""
+ response = await client.get("/api/dashboard/spending-by-category", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) > 0
+
+ for item in data:
+ assert "category_name" in item
+ assert "total" in item
+ assert "percentage" in item
+ # total MUST be a number (float/int), not a string — Recharts requires this
+ assert isinstance(item["total"], (int, float)), (
+ f"total should be numeric, got {type(item['total']).__name__}: {item['total']}"
+ )
+ assert isinstance(item["percentage"], (int, float))
+ assert item["total"] > 0
+
+
+async def test_spending_by_category_with_month(client, auth_headers, test_transactions):
+ """Spending by category filters by month correctly."""
+ # Current month — when test transactions exist
+ response = await client.get(
+ "/api/dashboard/spending-by-category",
+ params={"month": _current_month_str()},
+ headers=auth_headers,
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) > 0
+
+ # Previous month — no test transactions
+ response = await client.get(
+ "/api/dashboard/spending-by-category",
+ params={"month": _prev_month_str()},
+ headers=auth_headers,
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) == 0
+
+
+async def test_summary_numeric_fields(client, auth_headers, test_transactions):
+ """Summary endpoint returns numeric values, not strings."""
+ response = await client.get("/api/dashboard/summary", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+
+ assert isinstance(data["monthly_income"], (int, float))
+ assert isinstance(data["monthly_expenses"], (int, float))
+ for currency, balance in data["total_balance"].items():
+ assert isinstance(balance, (int, float)), (
+ f"total_balance[{currency}] should be numeric, got {type(balance).__name__}"
+ )
+
+
+async def test_dashboard_virtual_recurring_projection(
+ client, auth_headers, test_categories
+):
+ """Dashboard includes recurring projections via virtual computation — no DB writes."""
+ # Use a future month so projections always apply regardless of today's date.
+ next_month = _next_month_str()
+ next_month_date = date.fromisoformat(next_month)
+
+ # Create a weekly recurring starting on the 1st of next month
+ rec_resp = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Weekly groceries",
+ "amount": 50.00,
+ "currency": "BRL",
+ "type": "debit",
+ "frequency": "weekly",
+ "start_date": next_month,
+ "category_id": str(test_categories[0].id),
+ },
+ headers=auth_headers,
+ )
+ assert rec_resp.status_code == 201
+
+ # Query dashboard spending for that future month
+ spending_resp = await client.get(
+ "/api/dashboard/spending-by-category",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ assert spending_resp.status_code == 200
+ spending = spending_resp.json()
+ assert len(spending) > 0
+
+ cat_spending = next(
+ (s for s in spending if s["category_id"] == str(test_categories[0].id)), None
+ )
+ assert cat_spending is not None
+ # At least 4 weekly occurrences in a month = at least 200
+ assert cat_spending["total"] >= 200.0
+
+ # CRITICAL: No transactions should have been created in the DB (virtual projection)
+ # Compute the last day of next month for the query range
+ if next_month_date.month == 12:
+ month_end = next_month_date.replace(year=next_month_date.year + 1, month=1)
+ else:
+ month_end = next_month_date.replace(month=next_month_date.month + 1)
+ tx_resp = await client.get(
+ "/api/transactions",
+ params={"from": next_month, "to": (month_end - timedelta(days=1)).isoformat()},
+ headers=auth_headers,
+ )
+ assert tx_resp.status_code == 200
+ groceries = [t for t in tx_resp.json()["items"] if t["description"] == "Weekly groceries"]
+ assert len(groceries) == 0, "Virtual projections must NOT create DB records"
+
+ # Summary should also include the projected expenses
+ summary_resp = await client.get(
+ "/api/dashboard/summary",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ assert summary_resp.status_code == 200
+ assert summary_resp.json()["monthly_expenses"] >= 200.0
+
+
+async def test_dashboard_no_duplicates_on_concurrent_calls(
+ client, auth_headers, test_categories
+):
+ """Calling summary and spending concurrently does NOT create duplicates."""
+ import asyncio
+
+ next_month = _next_month_str()
+ next_month_date = date.fromisoformat(next_month)
+
+ # Create a monthly recurring starting next month
+ await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Rent",
+ "amount": 1500.00,
+ "type": "debit",
+ "frequency": "monthly",
+ "start_date": next_month,
+ "category_id": str(test_categories[1].id),
+ },
+ headers=auth_headers,
+ )
+
+ # Call both dashboard endpoints in parallel (simulating frontend)
+ summary_coro = client.get(
+ "/api/dashboard/summary", params={"month": next_month}, headers=auth_headers
+ )
+ spending_coro = client.get(
+ "/api/dashboard/spending-by-category", params={"month": next_month}, headers=auth_headers
+ )
+ summary_resp, spending_resp = await asyncio.gather(summary_coro, spending_coro)
+
+ assert summary_resp.status_code == 200
+ assert spending_resp.status_code == 200
+
+ # Call them again — results should be identical (no duplicate accumulation)
+ summary2 = await client.get(
+ "/api/dashboard/summary", params={"month": next_month}, headers=auth_headers
+ )
+ spending2 = await client.get(
+ "/api/dashboard/spending-by-category", params={"month": next_month}, headers=auth_headers
+ )
+
+ assert summary_resp.json()["monthly_expenses"] == summary2.json()["monthly_expenses"]
+ assert spending_resp.json() == spending2.json()
+
+ # No transaction records should exist — projections are virtual
+ if next_month_date.month == 12:
+ month_end = next_month_date.replace(year=next_month_date.year + 1, month=1)
+ else:
+ month_end = next_month_date.replace(month=next_month_date.month + 1)
+ tx_resp = await client.get(
+ "/api/transactions",
+ params={"from": next_month, "to": (month_end - timedelta(days=1)).isoformat()},
+ headers=auth_headers,
+ )
+ rent_txs = [t for t in tx_resp.json()["items"] if t["description"] == "Rent"]
+ assert len(rent_txs) == 0, "Virtual projections must NOT create DB records"
+
+
+async def test_recurring_projection_respects_end_date(
+ client, auth_headers, test_categories
+):
+ """Recurring with end_date stops projecting after that date."""
+ next_month = _next_month_str()
+ next_month_date = date.fromisoformat(next_month)
+ end_date = next_month_date.replace(day=15).isoformat()
+
+ await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Temp sub",
+ "amount": 20.00,
+ "type": "debit",
+ "frequency": "weekly",
+ "start_date": next_month,
+ "end_date": end_date,
+ "category_id": str(test_categories[0].id),
+ },
+ headers=auth_headers,
+ )
+
+ # Next month spending should include only 3 occurrences: 1st, 8th, 15th = 60
+ spending_resp = await client.get(
+ "/api/dashboard/spending-by-category",
+ params={"month": next_month},
+ headers=auth_headers,
+ )
+ cat_spending = next(
+ (s for s in spending_resp.json() if s["category_id"] == str(test_categories[0].id)), None
+ )
+ assert cat_spending is not None
+ assert cat_spending["total"] == 60.0
+
+
[email protected](reason="to_char() is PostgreSQL-specific; tests use SQLite")
+async def test_monthly_trend_numeric_fields(client, auth_headers, test_transactions):
+ """Monthly trend returns numeric values, not strings."""
+ response = await client.get("/api/dashboard/monthly-trend", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) > 0
+
+ for item in data:
+ assert isinstance(item["income"], (int, float))
+ assert isinstance(item["expenses"], (int, float))
+
+
+async def test_opening_balance_not_counted_as_monthly_income(client, auth_headers):
+ """Opening balance transactions must NOT inflate monthly_income on dashboard."""
+ # Create a manual account with a 5000 opening balance (this month)
+ acc_resp = await client.post(
+ "/api/accounts",
+ json={"name": "Savings", "type": "savings", "balance": 5000.00, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert acc_resp.status_code == 201
+
+ # Dashboard for current month must NOT count the 5000 as income
+ resp = await client.get("/api/dashboard/summary", headers=auth_headers)
+ assert resp.status_code == 200
+ data = resp.json()
+
+ assert data["monthly_income"] == 0.0, (
+ f"Opening balance must not appear as income; got {data['monthly_income']}"
+ )
+ # But total_balance should reflect it
+ total = sum(float(v) for v in data["total_balance"].values())
+ assert total == 5000.0, f"Total balance should include opening balance; got {total}"
+
+
+async def test_accounts_count_includes_manual_accounts(client, auth_headers):
+ """accounts_count must include manual (non-bank-connected) accounts."""
+ # Create two manual accounts
+ for name in ("Wallet", "Piggy Bank"):
+ resp = await client.post(
+ "/api/accounts",
+ json={"name": name, "type": "checking", "balance": 0, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert resp.status_code == 201
+
+ resp = await client.get("/api/dashboard/summary", headers=auth_headers)
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["accounts_count"] >= 2, (
+ f"Expected ≥2 accounts, got {data['accounts_count']}"
+ )
+
+
+async def test_total_balance_computed_from_transactions(client, auth_headers):
+ """Total balance is the signed sum of all transactions, not the stale Account.balance field."""
+ # Create a manual account with 1000 opening balance
+ acc_resp = await client.post(
+ "/api/accounts",
+ json={"name": "Current Account", "type": "checking", "balance": 1000.00, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert acc_resp.status_code == 201
+ acc_id = acc_resp.json()["id"]
+
+ # Add a 200 debit — balance should drop to 800
+ await client.post(
+ "/api/transactions",
+ json={
+ "description": "Groceries",
+ "amount": 200.00,
+ "currency": "BRL",
+ "type": "debit",
+ "date": "2026-02-20",
+ "account_id": acc_id,
+ },
+ headers=auth_headers,
+ )
+
+ resp = await client.get("/api/dashboard/summary", headers=auth_headers)
+ data = resp.json()
+ total = sum(float(v) for v in data["total_balance"].values())
+ assert total == 800.0, f"Expected 800.0 (1000 - 200), got {total}"
+
+
+async def test_future_month_balance_includes_recurring_projections(
+ client, auth_headers, test_categories
+):
+ """When viewing a future month, total_balance must reflect projected recurring cash flows."""
+ next_month = _next_month_str()
+ month_after = _future_month_str(2)
+
+
+ # Create an account with 2000 starting balance
+ acc_resp = await client.post(
+ "/api/accounts",
+ json={"name": "Main Account", "type": "checking", "balance": 2000.00, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert acc_resp.status_code == 201
+
+ # Create a monthly recurring expense of 500 starting next month
+ rec_resp = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Rent",
+ "amount": 500.00,
+ "currency": "BRL",
+ "type": "debit",
+ "frequency": "monthly",
+ "start_date": next_month,
+ "category_id": str(test_categories[1].id),
+ },
+ headers=auth_headers,
+ )
+ assert rec_resp.status_code == 201
+
+ # Current month balance: should still be 2000 (recurring starts next month)
+ current_resp = await client.get(
+ "/api/dashboard/summary", params={"month": _current_month_str()}, headers=auth_headers
+ )
+ assert current_resp.status_code == 200
+ base_total = sum(float(v) for v in current_resp.json()["total_balance"].values())
+
+ # Next month: 2000 - 500 (projected rent) = 1500
+ next_resp = await client.get(
+ "/api/dashboard/summary", params={"month": next_month}, headers=auth_headers
+ )
+ assert next_resp.status_code == 200
+ next_total = sum(float(v) for v in next_resp.json()["total_balance"].values())
+ assert next_total == base_total - 500.0, (
+ f"Next month balance should be 500 less; got {next_total} vs {base_total}"
+ )
+
+ # Month after: 2000 - 500 - 500 = 1000
+ after_resp = await client.get(
+ "/api/dashboard/summary", params={"month": month_after}, headers=auth_headers
+ )
+ assert after_resp.status_code == 200
+ after_total = sum(float(v) for v in after_resp.json()["total_balance"].values())
+ assert after_total == base_total - 1000.0, (
+ f"Month+2 balance should be 1000 less; got {after_total} vs {base_total}"
+ )
+
+
+async def test_past_month_balance_filtered_by_end_of_month(client, auth_headers):
+ """Past month balance only includes transactions up to the end of that month."""
+ today = date.today()
+ # Pick a month that's definitely in the past
+ past_first = (today.replace(day=1) - timedelta(days=1)).replace(day=1)
+ past_last_day = calendar.monthrange(past_first.year, past_first.month)[1]
+ past_last = past_first.replace(day=past_last_day)
+ past_month_param = past_first.isoformat()
+
+ # Create an account with 1000 opening balance (today — after the past month)
+ acc_resp = await client.post(
+ "/api/accounts",
+ json={"name": "TimeTest", "type": "checking", "balance": 1000.00, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert acc_resp.status_code == 201
+ acc_id = acc_resp.json()["id"]
+
+ # Add a transaction in the past month
+ await client.post(
+ "/api/transactions",
+ json={
+ "description": "Past expense",
+ "amount": 200.00,
+ "currency": "BRL",
+ "type": "debit",
+ "date": past_first.replace(day=15).isoformat(),
+ "account_id": acc_id,
+ },
+ headers=auth_headers,
+ )
+
+ # Query summary for past month — balance should NOT include the opening_balance
+ # transaction (dated today) but SHOULD include the past month transaction.
+ resp = await client.get(
+ "/api/dashboard/summary",
+ params={"month": past_month_param},
+ headers=auth_headers,
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ total = sum(float(v) for v in data["total_balance"].values())
+ # Only the past debit should be counted (opening balance is dated today)
+ assert total == -200.0, f"Expected -200.0 for past month, got {total}"
+ assert data["balance_date"] == past_last.isoformat()
+
+
+async def test_current_month_balance_uses_today_as_cutoff(client, auth_headers):
+ """Current month balance uses today as the cutoff date."""
+ today = date.today()
+
+ acc_resp = await client.post(
+ "/api/accounts",
+ json={"name": "TodayTest", "type": "checking", "balance": 500.00, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert acc_resp.status_code == 201
+
+ resp = await client.get(
+ "/api/dashboard/summary",
+ params={"month": today.replace(day=1).isoformat()},
+ headers=auth_headers,
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ assert data["balance_date"] == today.isoformat()
+
+
+async def test_balance_date_parameter_overrides_default_cutoff(client, auth_headers):
+ """Providing balance_date overrides the default cutoff calculation."""
+ today = date.today()
+
+ # Create account with zero balance (no opening_balance transaction)
+ acc_resp = await client.post(
+ "/api/accounts",
+ json={"name": "OverrideTest", "type": "checking", "balance": 0, "currency": "BRL"},
+ headers=auth_headers,
+ )
+ assert acc_resp.status_code == 201
+ acc_id = acc_resp.json()["id"]
+
+ # Add a credit dated 15 days ago
+ fifteen_days_ago = (today - timedelta(days=15)).isoformat()
+ await client.post(
+ "/api/transactions",
+ json={
+ "description": "Salary",
+ "amount": 1000.00,
+ "currency": "BRL",
+ "type": "credit",
+ "date": fifteen_days_ago,
+ "account_id": acc_id,
+ },
+ headers=auth_headers,
+ )
+
+ # Add a debit dated 5 days ago
+ five_days_ago = (today - timedelta(days=5)).isoformat()
+ await client.post(
+ "/api/transactions",
+ json={
+ "description": "Recent purchase",
+ "amount": 300.00,
+ "currency": "BRL",
+ "type": "debit",
+ "date": five_days_ago,
+ "account_id": acc_id,
+ },
+ headers=auth_headers,
+ )
+
+ # Query with balance_date = 10 days ago (after credit, before debit)
+ ten_days_ago = (today - timedelta(days=10)).isoformat()
+ resp = await client.get(
+ "/api/dashboard/summary",
+ params={
+ "month": today.replace(day=1).isoformat(),
+ "balance_date": ten_days_ago,
+ },
+ headers=auth_headers,
+ )
+ assert resp.status_code == 200
+ data = resp.json()
+ total = sum(float(v) for v in data["total_balance"].values())
+ # Should only include the credit (1000), not the debit from 5 days ago
+ assert total == 1000.0, f"Expected 1000.0 with cutoff 10 days ago, got {total}"
+ assert data["balance_date"] == ten_days_ago
+
+ # Now query without balance_date (default cutoff = today) — should include both
+ resp2 = await client.get(
+ "/api/dashboard/summary",
+ params={"month": today.replace(day=1).isoformat()},
+ headers=auth_headers,
+ )
+ total2 = sum(float(v) for v in resp2.json()["total_balance"].values())
+ assert total2 == 700.0, f"Expected 700.0 with default cutoff, got {total2}"
diff --git a/backend/tests/test_fuzzy_matching.py b/backend/tests/test_fuzzy_matching.py
new file mode 100644
index 00000000..90b19da9
--- /dev/null
+++ b/backend/tests/test_fuzzy_matching.py
@@ -0,0 +1,54 @@
+"""Tests for fuzzy transaction matching logic (Phase 2)."""
+import pytest
+
+from app.services.connection_service import _description_similarity
+
+
+class TestDescriptionSimilarity:
+ """Unit tests for the _description_similarity helper."""
+
+ def test_identical_descriptions(self):
+ assert _description_similarity("UBER TRIP", "UBER TRIP") == 1.0
+
+ def test_partial_overlap(self):
+ # "UBER" overlaps, "TRIP" vs "RIDE" don't → 1/2 = 0.5
+ score = _description_similarity("UBER TRIP", "UBER RIDE")
+ assert score == pytest.approx(0.5)
+
+ def test_no_overlap(self):
+ score = _description_similarity("NETFLIX", "SPOTIFY")
+ assert score == 0.0
+
+ def test_case_insensitive(self):
+ score = _description_similarity("Uber Trip", "UBER TRIP")
+ assert score == 1.0
+
+ def test_null_first_arg(self):
+ assert _description_similarity(None, "UBER") == 0.0
+
+ def test_null_second_arg(self):
+ assert _description_similarity("UBER", None) == 0.0
+
+ def test_both_null(self):
+ assert _description_similarity(None, None) == 0.0
+
+ def test_empty_first_arg(self):
+ assert _description_similarity("", "UBER") == 0.0
+
+ def test_empty_second_arg(self):
+ assert _description_similarity("UBER", "") == 0.0
+
+ def test_single_token_match(self):
+ # "IFOOD" matches in both → 1/2 = 0.5
+ score = _description_similarity("IFOOD RESTAURANTE", "IFOOD")
+ assert score == pytest.approx(0.5)
+
+ def test_high_overlap_above_threshold(self):
+ # 3 out of 4 tokens match → 0.75
+ score = _description_similarity("PIX RECEBIDO JOAO", "PIX RECEBIDO JOAO SILVA")
+ assert score >= 0.6
+
+ def test_low_overlap_below_threshold(self):
+ # Only 1 out of 3 tokens match → 0.33
+ score = _description_similarity("PAGAMENTO PIX", "UBER TRIP PIX")
+ assert score < 0.6
diff --git a/backend/tests/test_health.py b/backend/tests/test_health.py
new file mode 100644
index 00000000..a1e0e850
--- /dev/null
+++ b/backend/tests/test_health.py
@@ -0,0 +1,9 @@
+import pytest
+from httpx import AsyncClient
+
+
+async def test_health_check(client: AsyncClient):
+ response = await client.get("/api/health")
+ assert response.status_code == 200
+ assert response.json() == {"status": "healthy"}
diff --git a/backend/tests/test_import_api.py b/backend/tests/test_import_api.py
new file mode 100644
index 00000000..8686bc0e
--- /dev/null
+++ b/backend/tests/test_import_api.py
@@ -0,0 +1,164 @@
+import pytest
+from httpx import AsyncClient
+
+from app.models.account import Account
+
+
+async def test_preview_csv_import(client: AsyncClient, auth_headers, test_account):
+ csv_content = b"data,descricao,valor\n10/02/2026,UBER TRIP,-25.50\n12/02/2026,PIX RECEBIDO,150.00\n"
+ response = await client.post(
+ "/api/transactions/import/preview",
+ headers=auth_headers,
+ files={"file": ("extrato.csv", csv_content, "text/csv")},
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["detected_format"] == "csv"
+ assert len(data["transactions"]) == 2
+ assert data["transactions"][0]["description"] == "UBER TRIP"
+ assert data["transactions"][0]["type"] == "debit"
+ assert data["transactions"][1]["type"] == "credit"
+
+
+async def test_preview_invalid_file(client: AsyncClient, auth_headers, test_account):
+ response = await client.post(
+ "/api/transactions/import/preview",
+ headers=auth_headers,
+ files={"file": ("bad.csv", b"col1,col2,col3\na,b,c\n", "text/csv")},
+ )
+ assert response.status_code == 400
+
+
+async def test_import_transactions(
+ client: AsyncClient, auth_headers, test_account: Account
+):
+ response = await client.post(
+ "/api/transactions/import",
+ headers=auth_headers,
+ json={
+ "account_id": str(test_account.id),
+ "transactions": [
+ {
+ "description": "UBER TRIP",
+ "amount": "25.50",
+ "date": "2026-02-10",
+ "type": "debit",
+ },
+ {
+ "description": "PIX RECEBIDO",
+ "amount": "150.00",
+ "date": "2026-02-15",
+ "type": "credit",
+ },
+ ],
+ },
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["imported"] == 2
+
+
+async def test_import_to_invalid_account(client: AsyncClient, auth_headers, test_account):
+ response = await client.post(
+ "/api/transactions/import",
+ headers=auth_headers,
+ json={
+ "account_id": "00000000-0000-0000-0000-000000000000",
+ "transactions": [
+ {
+ "description": "Test",
+ "amount": "10.00",
+ "date": "2026-02-20",
+ "type": "debit",
+ },
+ ],
+ },
+ )
+ assert response.status_code == 404
+
+
+async def test_import_unauthenticated(client: AsyncClient, clean_db):
+ response = await client.post(
+ "/api/transactions/import/preview",
+ files={"file": ("test.csv", b"a,b,c", "text/csv")},
+ )
+ assert response.status_code == 401
+
+
+async def test_import_creates_log(client: AsyncClient, auth_headers, test_account: Account):
+ response = await client.post(
+ "/api/transactions/import",
+ headers=auth_headers,
+ json={
+ "account_id": str(test_account.id),
+ "transactions": [
+ {"description": "UBER TRIP", "amount": "25.50", "date": "2026-02-10", "type": "debit"},
+ {"description": "PIX RECEBIDO", "amount": "150.00", "date": "2026-02-15", "type": "credit"},
+ ],
+ "filename": "extrato.csv",
+ "detected_format": "csv",
+ },
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["imported"] == 2
+ assert "import_log_id" in data
+
+
+async def test_list_import_logs(client: AsyncClient, auth_headers, test_account: Account):
+ # Create an import first
+ await client.post(
+ "/api/transactions/import",
+ headers=auth_headers,
+ json={
+ "account_id": str(test_account.id),
+ "transactions": [
+ {"description": "TEST TXN", "amount": "10.00", "date": "2026-02-20", "type": "debit"},
+ ],
+ "filename": "test.csv",
+ "detected_format": "csv",
+ },
+ )
+
+ response = await client.get("/api/import-logs", headers=auth_headers)
+ assert response.status_code == 200
+ logs = response.json()
+ assert len(logs) >= 1
+ log = logs[0]
+ assert log["filename"] == "test.csv"
+ assert log["format"] == "csv"
+ assert log["transaction_count"] == 1
+
+
+async def test_delete_import_log(client: AsyncClient, auth_headers, test_account: Account):
+ # Create an import
+ resp = await client.post(
+ "/api/transactions/import",
+ headers=auth_headers,
+ json={
+ "account_id": str(test_account.id),
+ "transactions": [
+ {"description": "TO DELETE", "amount": "50.00", "date": "2026-02-20", "type": "debit"},
+ ],
+ "filename": "delete_me.csv",
+ "detected_format": "csv",
+ },
+ )
+ import_log_id = resp.json()["import_log_id"]
+
+ # Delete it
+ delete_resp = await client.delete(f"/api/import-logs/{import_log_id}", headers=auth_headers)
+ assert delete_resp.status_code == 204
+
+ # Verify it's gone
+ logs_resp = await client.get("/api/import-logs", headers=auth_headers)
+ log_ids = [entry["id"] for entry in logs_resp.json()]
+ assert import_log_id not in log_ids
diff --git a/backend/tests/test_import_service.py b/backend/tests/test_import_service.py
new file mode 100644
index 00000000..8441e502
--- /dev/null
+++ b/backend/tests/test_import_service.py
@@ -0,0 +1,414 @@
+from datetime import date
+from decimal import Decimal
+
+import pytest
+
+from app.services.import_service import parse_csv, parse_qif, parse_camt
+
+
+class TestParseCsv:
+ """Tests for the parse_csv function."""
+
+ def test_parse_csv(self):
+ """Parse a valid CSV with localized columns (data, descricao, valor)."""
+ csv_content = (
+ "data,descricao,valor\n"
+ "10/02/2026,UBER TRIP,-25.50\n"
+ "12/02/2026,IFOOD RESTAURANTE,-45.00\n"
+ "05/02/2026,SALARIO FEV,8000.00\n"
+ )
+ transactions = parse_csv(csv_content.encode("utf-8"))
+
+ assert len(transactions) == 3
+
+ # First transaction: UBER TRIP (debit because negative)
+ assert transactions[0].description == "UBER TRIP"
+ assert transactions[0].amount == Decimal("25.50")
+ assert transactions[0].date == date(2026, 2, 10)
+ assert transactions[0].type == "debit"
+
+ # Second transaction: IFOOD (debit)
+ assert transactions[1].description == "IFOOD RESTAURANTE"
+ assert transactions[1].amount == Decimal("45.00")
+ assert transactions[1].date == date(2026, 2, 12)
+ assert transactions[1].type == "debit"
+
+ # Third transaction: SALARIO (credit because positive)
+ assert transactions[2].description == "SALARIO FEV"
+ assert transactions[2].amount == Decimal("8000.00")
+ assert transactions[2].date == date(2026, 2, 5)
+ assert transactions[2].type == "credit"
+
+ def test_parse_csv_english(self):
+ """Parse a CSV with English column headers (date, description, amount)."""
+ csv_content = (
+ "date,description,amount\n"
+ "2026-02-10,GROCERY STORE,-120.50\n"
+ "2026-02-15,SALARY PAYMENT,5000.00\n"
+ )
+ transactions = parse_csv(csv_content.encode("utf-8"))
+
+ assert len(transactions) == 2
+
+ assert transactions[0].description == "GROCERY STORE"
+ assert transactions[0].amount == Decimal("120.50")
+ assert transactions[0].date == date(2026, 2, 10)
+ assert transactions[0].type == "debit"
+
+ assert transactions[1].description == "SALARY PAYMENT"
+ assert transactions[1].amount == Decimal("5000.00")
+ assert transactions[1].date == date(2026, 2, 15)
+ assert transactions[1].type == "credit"
+
+ def test_parse_csv_invalid_columns(self):
+ """CSV with unrecognized column names should raise ValueError."""
+ csv_content = (
+ "col_a,col_b,col_c\n"
+ "foo,bar,baz\n"
+ )
+ with pytest.raises(ValueError, match="Could not detect CSV columns"):
+ parse_csv(csv_content.encode("utf-8"))
+
+ def test_parse_csv_brl_amounts(self):
+ """CSV with R$ prefix and comma-as-decimal amounts should be parsed correctly.
+
+ When amounts use comma as decimal separator, CSV values must be quoted
+ to avoid conflict with the comma column delimiter.
+ """
+ csv_content = (
+ 'data,descricao,valor\n'
+ '10/02/2026,MERCADO LIVRE,"R$ -150,99"\n'
+ '11/02/2026,PIX RECEBIDO,"R$ 200,00"\n'
+ )
+ transactions = parse_csv(csv_content.encode("utf-8"))
+
+ assert len(transactions) == 2
+
+ # R$ -150,99 -> strip R$ -> -150,99 -> comma becomes dot -> -150.99 -> abs = 150.99
+ assert transactions[0].description == "MERCADO LIVRE"
+ assert transactions[0].amount == Decimal("150.99")
+ assert transactions[0].type == "debit"
+
+ # R$ 200,00 -> 200.00
+ assert transactions[1].description == "PIX RECEBIDO"
+ assert transactions[1].amount == Decimal("200.00")
+ assert transactions[1].type == "credit"
+
+ def test_parse_csv_with_bom(self):
+ """CSV encoded with UTF-8 BOM should be parsed correctly."""
+ # Encode with utf-8-sig which prepends BOM bytes; parse_csv decodes with utf-8-sig
+ csv_content = "date,description,amount\n2026-01-15,TEST TRANSACTION,-50.00\n"
+ transactions = parse_csv(csv_content.encode("utf-8-sig"))
+
+ assert len(transactions) == 1
+ assert transactions[0].description == "TEST TRANSACTION"
+ assert transactions[0].amount == Decimal("50.00")
+
+ def test_parse_csv_skips_invalid_dates(self):
+ """Rows with unparseable dates should be silently skipped."""
+ csv_content = (
+ "date,description,amount\n"
+ "not-a-date,BAD ROW,-10.00\n"
+ "2026-02-20,GOOD ROW,-30.00\n"
+ )
+ transactions = parse_csv(csv_content.encode("utf-8"))
+
+ assert len(transactions) == 1
+ assert transactions[0].description == "GOOD ROW"
+
+ def test_parse_csv_skips_invalid_amounts(self):
+ """Rows with unparseable amounts should be silently skipped."""
+ csv_content = (
+ "date,description,amount\n"
+ "2026-02-20,BAD AMOUNT,abc\n"
+ "2026-02-21,GOOD AMOUNT,-75.00\n"
+ )
+ transactions = parse_csv(csv_content.encode("utf-8"))
+
+ assert len(transactions) == 1
+ assert transactions[0].description == "GOOD AMOUNT"
+
+ def test_parse_csv_dd_mm_yyyy_format(self):
+ """DD/MM/YYYY date format should be correctly parsed."""
+ csv_content = "data,descricao,valor\n25/12/2025,NATAL,-500.00\n"
+ transactions = parse_csv(csv_content.encode("utf-8"))
+
+ assert len(transactions) == 1
+ assert transactions[0].date == date(2025, 12, 25)
+
+ def test_parse_csv_empty_file(self):
+ """A CSV with only headers and no data rows should return empty list."""
+ csv_content = "date,description,amount\n"
+ transactions = parse_csv(csv_content.encode("utf-8"))
+ assert len(transactions) == 0
+
+ def test_parse_csv_explicit_date_format(self):
+ """CSV with explicit date format should use only that format."""
+ csv_content = (
+ "date,description,amount\n"
+ "03/04/2026,PAYMENT,-100.00\n"
+ )
+ # With MM/DD/YYYY format, 03/04 = March 4
+ transactions = parse_csv(csv_content.encode("utf-8"), date_format="MM/DD/YYYY")
+ assert len(transactions) == 1
+ assert transactions[0].date == date(2026, 3, 4)
+
+ # With DD/MM/YYYY format, 03/04 = April 3
+ transactions = parse_csv(csv_content.encode("utf-8"), date_format="DD/MM/YYYY")
+ assert len(transactions) == 1
+ assert transactions[0].date == date(2026, 4, 3)
+
+ def test_parse_csv_flip_amount(self):
+ """Flip amount should negate amounts, swapping credit/debit."""
+ csv_content = (
+ "date,description,amount\n"
+ "2026-01-10,EXPENSE,100.00\n"
+ "2026-01-11,INCOME,-500.00\n"
+ )
+ transactions = parse_csv(csv_content.encode("utf-8"), flip_amount=True)
+ assert len(transactions) == 2
+ # 100.00 flipped to -100.00 => debit
+ assert transactions[0].type == "debit"
+ assert transactions[0].amount == Decimal("100.00")
+ # -500.00 flipped to 500.00 => credit
+ assert transactions[1].type == "credit"
+ assert transactions[1].amount == Decimal("500.00")
+
+ def test_parse_csv_split_columns(self):
+ """CSV with inflow/outflow split columns."""
+ csv_content = (
+ "date,description,inflow,outflow\n"
+ "2026-01-10,SALARY,5000.00,\n"
+ "2026-01-11,RENT,,1200.00\n"
+ )
+ transactions = parse_csv(
+ csv_content.encode("utf-8"),
+ inflow_column="inflow",
+ outflow_column="outflow",
+ )
+ assert len(transactions) == 2
+ assert transactions[0].type == "credit"
+ assert transactions[0].amount == Decimal("5000.00")
+ assert transactions[1].type == "debit"
+ assert transactions[1].amount == Decimal("1200.00")
+
+
+class TestParseQif:
+ """Tests for the parse_qif function."""
+
+ def test_parse_qif_basic(self):
+ """Parse a basic QIF file with multiple transactions."""
+ qif_content = (
+ "!Type:Bank\n"
+ "D01/15/2026\n"
+ "T-250.00\n"
+ "PElectric Company\n"
+ "MMonthly bill\n"
+ "^\n"
+ "D01/20/2026\n"
+ "T1500.00\n"
+ "PEmployer Inc\n"
+ "MSalary\n"
+ "^\n"
+ )
+ transactions = parse_qif(qif_content.encode("utf-8"))
+
+ assert len(transactions) == 2
+
+ assert transactions[0].description == "Electric Company"
+ assert transactions[0].amount == Decimal("250.00")
+ assert transactions[0].date == date(2026, 1, 15)
+ assert transactions[0].type == "debit"
+
+ assert transactions[1].description == "Employer Inc"
+ assert transactions[1].amount == Decimal("1500.00")
+ assert transactions[1].date == date(2026, 1, 20)
+ assert transactions[1].type == "credit"
+
+ def test_parse_qif_memo_as_description(self):
+ """When no payee, memo should be used as description."""
+ qif_content = (
+ "D02/10/2026\n"
+ "T-50.00\n"
+ "MGrocery purchase\n"
+ "^\n"
+ )
+ transactions = parse_qif(qif_content.encode("utf-8"))
+ assert len(transactions) == 1
+ assert transactions[0].description == "Grocery purchase"
+
+ def test_parse_qif_unknown_description(self):
+ """When no payee or memo, description should be 'Unknown'."""
+ qif_content = (
+ "D03/01/2026\n"
+ "T-10.00\n"
+ "^\n"
+ )
+ transactions = parse_qif(qif_content.encode("utf-8"))
+ assert len(transactions) == 1
+ assert transactions[0].description == "Unknown"
+
+ def test_parse_qif_iso_date(self):
+ """QIF with YYYY-MM-DD date format."""
+ qif_content = (
+ "D2026-03-15\n"
+ "T-100.00\n"
+ "PTest\n"
+ "^\n"
+ )
+ transactions = parse_qif(qif_content.encode("utf-8"))
+ assert len(transactions) == 1
+ assert transactions[0].date == date(2026, 3, 15)
+
+ def test_parse_qif_skips_invalid_blocks(self):
+ """Blocks without date or amount should be skipped."""
+ qif_content = (
+ "!Type:Bank\n"
+ "^\n"
+ "POrphan payee\n"
+ "^\n"
+ "D01/01/2026\n"
+ "T-50.00\n"
+ "PValid\n"
+ "^\n"
+ )
+ transactions = parse_qif(qif_content.encode("utf-8"))
+ assert len(transactions) == 1
+ assert transactions[0].description == "Valid"
+
+ def test_parse_qif_comma_in_amount(self):
+ """QIF amounts with comma thousands separator."""
+ qif_content = (
+ "D01/01/2026\n"
+ "T-1,250.00\n"
+ "PBig Purchase\n"
+ "^\n"
+ )
+ transactions = parse_qif(qif_content.encode("utf-8"))
+ assert len(transactions) == 1
+ assert transactions[0].amount == Decimal("1250.00")
+
+
+class TestParseCamt:
+ """Tests for the parse_camt function (ISO 20022 XML)."""
+
+ def _make_camt_xml(self, entries_xml: str) -> bytes:
+ """Helper to wrap entries in a valid CAMT.053 XML structure."""
+ return (
+ '<?xml version="1.0" encoding="UTF-8"?>'
+ '<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.053.001.02">'
+ '<BkToCstmrStmt><Stmt>'
+ f'{entries_xml}'
+ '</Stmt></BkToCstmrStmt>'
+ '</Document>'
+ ).encode('utf-8')
+
+ def test_parse_camt_basic(self):
+ """Parse a basic CAMT file with credit and debit entries."""
+ entries = (
+ '<Ntry>'
+ '<Amt Ccy="BRL">1500.00</Amt>'
+ '<CdtDbtInd>CRDT</CdtDbtInd>'
+ '<BookgDt><Dt>2026-01-15</Dt></BookgDt>'
+ '<NtryDtls><TxDtls><RmtInf><Ustrd>Salary Payment</Ustrd></RmtInf></TxDtls></NtryDtls>'
+ '</Ntry>'
+ '<Ntry>'
+ '<Amt Ccy="BRL">250.00</Amt>'
+ '<CdtDbtInd>DBIT</CdtDbtInd>'
+ '<BookgDt><Dt>2026-01-16</Dt></BookgDt>'
+ '<NtryDtls><TxDtls><RmtInf><Ustrd>Electric Bill</Ustrd></RmtInf></TxDtls></NtryDtls>'
+ '</Ntry>'
+ )
+ transactions = parse_camt(self._make_camt_xml(entries))
+
+ assert len(transactions) == 2
+
+ assert transactions[0].description == "Salary Payment"
+ assert transactions[0].amount == Decimal("1500.00")
+ assert transactions[0].type == "credit"
+ assert transactions[0].date == date(2026, 1, 15)
+
+ assert transactions[1].description == "Electric Bill"
+ assert transactions[1].amount == Decimal("250.00")
+ assert transactions[1].type == "debit"
+ assert transactions[1].date == date(2026, 1, 16)
+
+ def test_parse_camt_valdt_fallback(self):
+ """When BookgDt is missing, ValDt should be used."""
+ entries = (
+ '<Ntry>'
+ '<Amt Ccy="BRL">100.00</Amt>'
+ '<CdtDbtInd>DBIT</CdtDbtInd>'
+ '<ValDt><Dt>2026-02-20</Dt></ValDt>'
+ '<NtryDtls><TxDtls><RmtInf><Ustrd>Test</Ustrd></RmtInf></TxDtls></NtryDtls>'
+ '</Ntry>'
+ )
+ transactions = parse_camt(self._make_camt_xml(entries))
+ assert len(transactions) == 1
+ assert transactions[0].date == date(2026, 2, 20)
+
+ def test_parse_camt_description_fallbacks(self):
+ """Description should fall back through various paths."""
+ # Creditor name fallback
+ entries = (
+ '<Ntry>'
+ '<Amt Ccy="BRL">50.00</Amt>'
+ '<CdtDbtInd>DBIT</CdtDbtInd>'
+ '<BookgDt><Dt>2026-01-01</Dt></BookgDt>'
+ '<NtryDtls><TxDtls><RltdPties><Cdtr><Nm>Store ABC</Nm></Cdtr></RltdPties></TxDtls></NtryDtls>'
+ '</Ntry>'
+ )
+ transactions = parse_camt(self._make_camt_xml(entries))
+ assert len(transactions) == 1
+ assert transactions[0].description == "Store ABC"
+
+ def test_parse_camt_unknown_description(self):
+ """When no description paths exist, should default to 'Unknown'."""
+ entries = (
+ '<Ntry>'
+ '<Amt Ccy="BRL">75.00</Amt>'
+ '<CdtDbtInd>CRDT</CdtDbtInd>'
+ '<BookgDt><Dt>2026-01-01</Dt></BookgDt>'
+ '</Ntry>'
+ )
+ transactions = parse_camt(self._make_camt_xml(entries))
+ assert len(transactions) == 1
+ assert transactions[0].description == "Unknown"
+
+ def test_parse_camt_skips_entries_without_date(self):
+ """Entries without any date should be skipped."""
+ entries = (
+ '<Ntry>'
+ '<Amt Ccy="BRL">100.00</Amt>'
+ '<CdtDbtInd>CRDT</CdtDbtInd>'
+ '</Ntry>'
+ '<Ntry>'
+ '<Amt Ccy="BRL">200.00</Amt>'
+ '<CdtDbtInd>DBIT</CdtDbtInd>'
+ '<BookgDt><Dt>2026-03-01</Dt></BookgDt>'
+ '<NtryDtls><TxDtls><RmtInf><Ustrd>Valid</Ustrd></RmtInf></TxDtls></NtryDtls>'
+ '</Ntry>'
+ )
+ transactions = parse_camt(self._make_camt_xml(entries))
+ assert len(transactions) == 1
+ assert transactions[0].description == "Valid"
+
+ def test_parse_camt_no_namespace(self):
+ """CAMT XML without namespace should still be parsed."""
+ xml = (
+ '<?xml version="1.0" encoding="UTF-8"?>'
+ '<Document>'
+ '<BkToCstmrStmt><Stmt>'
+ '<Ntry>'
+ '<Amt Ccy="BRL">300.00</Amt>'
+ '<CdtDbtInd>CRDT</CdtDbtInd>'
+ '<BookgDt><Dt>2026-01-10</Dt></BookgDt>'
+ '<NtryDtls><TxDtls><RmtInf><Ustrd>No NS</Ustrd></RmtInf></TxDtls></NtryDtls>'
+ '</Ntry>'
+ '</Stmt></BkToCstmrStmt>'
+ '</Document>'
+ ).encode('utf-8')
+ transactions = parse_camt(xml)
+ assert len(transactions) == 1
+ assert transactions[0].description == "No NS"
+ assert transactions[0].amount == Decimal("300.00")
diff --git a/backend/tests/test_new_rules_api.py b/backend/tests/test_new_rules_api.py
new file mode 100644
index 00000000..93b56169
--- /dev/null
+++ b/backend/tests/test_new_rules_api.py
@@ -0,0 +1,306 @@
+# backend/tests/test_new_rules_api.py
+import uuid
+
+import pytest
+from httpx import AsyncClient
+from sqlalchemy.ext.asyncio import AsyncSession
+
+from app.models.user import User
+
+
+
+async def test_list_rules_creates_defaults(client: AsyncClient, auth_headers, test_categories):
+ response = await client.get("/api/rules", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert len(data) > 0
+ # Each rule has the expected structure
+ rule = data[0]
+ assert "conditions" in rule
+ assert "actions" in rule
+ assert "conditions_op" in rule
+
+
+async def test_create_rule(client: AsyncClient, auth_headers, test_categories):
+ cat_id = str(test_categories[0].id)
+ payload = {
+ "name": "Test Rule",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "IFOOD"}],
+ "actions": [{"op": "set_category", "value": cat_id}],
+ "priority": 5,
+ "is_active": True,
+ }
+ response = await client.post("/api/rules", json=payload, headers=auth_headers)
+ assert response.status_code == 201
+ data = response.json()
+ assert data["name"] == "Test Rule"
+ assert data["conditions"][0]["value"] == "IFOOD"
+
+
+async def test_update_rule(client: AsyncClient, auth_headers, test_rules):
+ rule_id = str(test_rules[0].id)
+ response = await client.patch(
+ f"/api/rules/{rule_id}",
+ json={"name": "Updated Name"},
+ headers=auth_headers,
+ )
+ assert response.status_code == 200
+ assert response.json()["name"] == "Updated Name"
+
+
+async def test_delete_rule(client: AsyncClient, auth_headers, test_rules):
+ rule_id = str(test_rules[0].id)
+ response = await client.delete(f"/api/rules/{rule_id}", headers=auth_headers)
+ assert response.status_code == 204
+
+
+async def test_apply_all_rules(client: AsyncClient, auth_headers, test_rules, test_transactions):
+ response = await client.post("/api/rules/apply-all", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert "applied" in data
+ assert data["applied"] >= 5 # We have 5 test transactions
+
+
+# --- Integration tests: category assignment, tags, priority, isolation ---
+
+
+async def test_apply_all_verifies_category_assignment(
+ client: AsyncClient, auth_headers, test_rules, test_transactions, test_categories,
+):
+ """After apply-all, GET transactions and confirm correct category_id."""
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ response = await client.get("/api/transactions", headers=auth_headers)
+ assert response.status_code == 200
+ items = response.json()["items"]
+
+ # Build a lookup by description
+ by_desc = {t["description"]: t for t in items}
+
+ # UBER TRIP should be categorised as Transporte (test_categories[1])
+ uber = by_desc.get("UBER TRIP")
+ assert uber is not None
+ assert uber["category_id"] == str(test_categories[1].id)
+
+ # IFOOD RESTAURANTE -> Alimentação (test_categories[0])
+ ifood = by_desc.get("IFOOD RESTAURANTE")
+ assert ifood is not None
+ assert ifood["category_id"] == str(test_categories[0].id)
+
+ # SALARIO FEV -> Receita (test_categories[2])
+ salario = by_desc.get("SALARIO FEV")
+ assert salario is not None
+ assert salario["category_id"] == str(test_categories[2].id)
+
+
+async def test_apply_all_resets_before_reapply(
+ client: AsyncClient, auth_headers, test_rules, test_transactions, test_categories,
+):
+ """Category/notes are reset before re-applying, so results are idempotent."""
+ # Apply once
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ # Apply again — should produce same results
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ response = await client.get("/api/transactions", headers=auth_headers)
+ items = response.json()["items"]
+ by_desc = {t["description"]: t for t in items}
+
+ uber = by_desc.get("UBER TRIP")
+ assert uber["category_id"] == str(test_categories[1].id)
+
+
+async def test_conflicting_rules_priority(
+ client: AsyncClient, auth_headers, test_transactions, test_categories,
+):
+ """Two rules match same transaction; lower priority number wins category."""
+ cat_food = str(test_categories[0].id) # Alimentação
+ cat_transport = str(test_categories[1].id) # Transporte
+
+ # Create a low-priority rule (runs first) matching UBER -> Alimentação
+ low_rule = {
+ "name": "Low priority UBER",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "UBER"}],
+ "actions": [{"op": "set_category", "value": cat_food}],
+ "priority": 1,
+ "is_active": True,
+ }
+ # Create a high-priority rule (runs later) matching UBER -> Transporte
+ high_rule = {
+ "name": "High priority UBER",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "UBER"}],
+ "actions": [{"op": "set_category", "value": cat_transport}],
+ "priority": 99,
+ "is_active": True,
+ }
+ resp1 = await client.post("/api/rules", json=low_rule, headers=auth_headers)
+ resp2 = await client.post("/api/rules", json=high_rule, headers=auth_headers)
+ assert resp1.status_code == 201
+ assert resp2.status_code == 201
+
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ response = await client.get("/api/transactions", headers=auth_headers)
+ items = response.json()["items"]
+ by_desc = {t["description"]: t for t in items}
+
+ uber = by_desc.get("UBER TRIP")
+ assert uber is not None
+ # Lower priority (1) wins, so category should be Alimentação
+ assert uber["category_id"] == cat_food
+
+
+async def test_tag_attribution_via_rules(
+ client: AsyncClient, auth_headers, test_transactions, test_categories,
+):
+ """Rule with append_notes applies tags, verify on transaction."""
+ cat_transport = str(test_categories[1].id)
+ rule_payload = {
+ "name": "Tag UBER trips",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "UBER"}],
+ "actions": [
+ {"op": "set_category", "value": cat_transport},
+ {"op": "append_notes", "value": "#transport #rideshare"},
+ ],
+ "priority": 1,
+ "is_active": True,
+ }
+ resp = await client.post("/api/rules", json=rule_payload, headers=auth_headers)
+ assert resp.status_code == 201
+
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ response = await client.get("/api/transactions", headers=auth_headers)
+ items = response.json()["items"]
+ by_desc = {t["description"]: t for t in items}
+
+ uber = by_desc.get("UBER TRIP")
+ assert uber is not None
+ assert "#transport" in (uber.get("notes") or "")
+ assert "#rideshare" in (uber.get("notes") or "")
+
+
+async def test_multiple_tags_from_multiple_rules(
+ client: AsyncClient, auth_headers, test_transactions, test_categories,
+):
+ """Two rules append different tags to the same transaction."""
+ rule1 = {
+ "name": "Tag debit",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "UBER"}],
+ "actions": [{"op": "append_notes", "value": "#expense"}],
+ "priority": 1,
+ "is_active": True,
+ }
+ rule2 = {
+ "name": "Tag rideshare",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "UBER"}],
+ "actions": [{"op": "append_notes", "value": "#rideshare"}],
+ "priority": 2,
+ "is_active": True,
+ }
+ resp1 = await client.post("/api/rules", json=rule1, headers=auth_headers)
+ resp2 = await client.post("/api/rules", json=rule2, headers=auth_headers)
+ assert resp1.status_code == 201
+ assert resp2.status_code == 201
+
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ response = await client.get("/api/transactions", headers=auth_headers)
+ items = response.json()["items"]
+ by_desc = {t["description"]: t for t in items}
+
+ uber = by_desc.get("UBER TRIP")
+ assert uber is not None
+ notes = uber.get("notes") or ""
+ assert "#expense" in notes
+ assert "#rideshare" in notes
+
+
+async def test_inactive_rule_is_skipped(
+ client: AsyncClient, auth_headers, test_transactions, test_categories,
+):
+ """Disabled rule should not apply."""
+ cat_food = str(test_categories[0].id)
+ rule_payload = {
+ "name": "Inactive NETFLIX rule",
+ "conditions_op": "and",
+ "conditions": [{"field": "description", "op": "contains", "value": "NETFLIX"}],
+ "actions": [{"op": "set_category", "value": cat_food}],
+ "priority": 1,
+ "is_active": False,
+ }
+ resp = await client.post("/api/rules", json=rule_payload, headers=auth_headers)
+ assert resp.status_code == 201
+
+ await client.post("/api/rules/apply-all", headers=auth_headers)
+
+ response = await client.get("/api/transactions", headers=auth_headers)
+ items = response.json()["items"]
+ by_desc = {t["description"]: t for t in items}
+
+ netflix = by_desc.get("NETFLIX")
+ assert netflix is not None
+ # No active rule matches NETFLIX, so category should be None
+ assert netflix["category_id"] is None
+
+
+async def test_rule_user_isolation(
+ client: AsyncClient, auth_headers, test_rules, test_transactions, session: AsyncSession,
+):
+ """One user's rules don't affect another user's transactions."""
+ import bcrypt as _bcrypt
+
+ # Create second user
+ hashed = _bcrypt.hashpw(b"otherpass123", _bcrypt.gensalt()).decode()
+ user2 = User(
+ id=uuid.uuid4(),
+ hashed_password=hashed,
+ is_active=True,
+ is_superuser=False,
+ is_verified=True,
+ preferences={"language": "pt-BR", "date_format": "DD/MM/YYYY",
+ "timezone": "America/Sao_Paulo", "currency_display": "BRL"},
+ )
+ session.add(user2)
+ await session.commit()
+
+ # Login as user2
+ login_resp = await client.post(
+ "/api/auth/login",
+ data={"username": "[email protected]", "password": "otherpass123"},
+ headers={"Content-Type": "application/x-www-form-urlencoded"},
+ )
+ assert login_resp.status_code == 200
+ user2_headers = {"Authorization": f"Bearer {login_resp.json()['access_token']}"}
+
+ # User2 apply-all should not process user1's transactions
+ response = await client.post("/api/rules/apply-all", headers=user2_headers)
+ assert response.status_code == 200
+ assert response.json()["applied"] == 0
+
+ # User1's transactions should remain unchanged by user2's apply-all
+ response = await client.get("/api/transactions", headers=auth_headers)
+ items = response.json()["items"]
+ # Verify user1 still has transactions
+ assert len(items) >= 5
diff --git a/backend/tests/test_recurring_api.py b/backend/tests/test_recurring_api.py
new file mode 100644
index 00000000..e4814a51
--- /dev/null
+++ b/backend/tests/test_recurring_api.py
@@ -0,0 +1,224 @@
+"""Tests for recurring transactions API."""
+import pytest
+
+
+async def test_create_recurring_transaction(client, auth_headers, test_categories):
+ """Creating a recurring transaction sets next_occurrence to start_date."""
+ response = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Netflix",
+ "amount": 39.90,
+ "currency": "BRL",
+ "type": "debit",
+ "frequency": "monthly",
+ "start_date": "2026-03-01",
+ "category_id": str(test_categories[0].id),
+ },
+ headers=auth_headers,
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["description"] == "Netflix"
+ assert data["frequency"] == "monthly"
+ assert data["is_active"] is True
+ # next_occurrence should be start_date since skip_first not set
+ assert data["next_occurrence"] == "2026-03-01"
+
+
+async def test_create_recurring_with_skip_first(client, auth_headers, test_categories):
+ """skip_first=true advances next_occurrence by one frequency period."""
+ response = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Mercadinho",
+ "amount": 50.00,
+ "currency": "EUR",
+ "type": "debit",
+ "frequency": "weekly",
+ "start_date": "2026-02-25",
+ "skip_first": True,
+ "category_id": str(test_categories[0].id),
+ },
+ headers=auth_headers,
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["description"] == "Mercadinho"
+ assert data["frequency"] == "weekly"
+ # next_occurrence should be one week ahead (not start_date)
+ assert data["next_occurrence"] == "2026-03-04"
+
+
+async def test_create_recurring_skip_first_monthly(client, auth_headers):
+ """skip_first with monthly frequency advances by one month."""
+ response = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Rent",
+ "amount": 1500.00,
+ "currency": "BRL",
+ "type": "debit",
+ "frequency": "monthly",
+ "start_date": "2026-01-15",
+ "skip_first": True,
+ },
+ headers=auth_headers,
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["next_occurrence"] == "2026-02-15"
+
+
+async def test_generate_pending_creates_transactions(client, auth_headers, test_account):
+ """Generate pending creates transactions and advances next_occurrence."""
+ # Create a recurring that's already past due
+ create_resp = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Weekly gym",
+ "amount": 30.00,
+ "currency": "BRL",
+ "type": "debit",
+ "frequency": "weekly",
+ "start_date": "2026-02-01",
+ "account_id": str(test_account.id),
+ },
+ headers=auth_headers,
+ )
+ assert create_resp.status_code == 201
+ rec_id = create_resp.json()["id"]
+
+ # Generate pending — should create multiple transactions up to today
+ gen_resp = await client.post(
+ "/api/recurring-transactions/generate",
+ headers=auth_headers,
+ )
+ assert gen_resp.status_code == 200
+ generated = gen_resp.json()["generated"]
+ assert generated >= 1
+
+ # Verify the recurring's next_occurrence is now in the future
+ await client.get(
+ f"/api/recurring-transactions/{rec_id}",
+ headers=auth_headers,
+ )
+ # It may be 404 if list-only, check the list
+ list_resp = await client.get(
+ "/api/recurring-transactions",
+ headers=auth_headers,
+ )
+ assert list_resp.status_code == 200
+ rec = next(r for r in list_resp.json() if r["id"] == rec_id)
+ # next_occurrence should be after today (2026-02-25)
+ assert rec["next_occurrence"] > "2026-02-25"
+
+
+async def test_generate_no_duplicate_with_skip_first(client, auth_headers, test_categories, test_account):
+ """When created with skip_first, generate doesn't create duplicate for start_date."""
+ # Simulate creating a transaction + recurring with skip_first (as the UI does)
+ # First, create the transaction
+ tx_resp = await client.post(
+ "/api/transactions",
+ json={
+ "description": "Internet bill",
+ "amount": 99.90,
+ "currency": "BRL",
+ "type": "debit",
+ "date": "2026-02-25",
+ "category_id": str(test_categories[1].id),
+ "account_id": str(test_account.id),
+ },
+ headers=auth_headers,
+ )
+ assert tx_resp.status_code == 201
+
+ # Then create the recurring with skip_first=true
+ rec_resp = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "Internet bill",
+ "amount": 99.90,
+ "currency": "BRL",
+ "type": "debit",
+ "frequency": "monthly",
+ "start_date": "2026-02-25",
+ "skip_first": True,
+ "category_id": str(test_categories[1].id),
+ "account_id": str(test_account.id),
+ },
+ headers=auth_headers,
+ )
+ assert rec_resp.status_code == 201
+ # next_occurrence should be March, not February
+ assert rec_resp.json()["next_occurrence"] == "2026-03-25"
+
+ # Generate pending — should NOT create anything (next_occurrence is in the future)
+ gen_resp = await client.post(
+ "/api/recurring-transactions/generate",
+ headers=auth_headers,
+ )
+ assert gen_resp.status_code == 200
+ assert gen_resp.json()["generated"] == 0
+
+ # Verify only one "Internet bill" transaction exists for Feb 25
+ tx_list = await client.get(
+ "/api/transactions",
+ params={"from": "2026-02-25", "to": "2026-02-26"},
+ headers=auth_headers,
+ )
+ assert tx_list.status_code == 200
+ internet_txs = [t for t in tx_list.json()["items"] if t["description"] == "Internet bill"]
+ assert len(internet_txs) == 1
+
+
+async def test_list_recurring_transactions(client, auth_headers):
+ """List returns all recurring transactions for the user."""
+ # Create two
+ for desc in ["Sub A", "Sub B"]:
+ await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": desc,
+ "amount": 10.00,
+ "type": "debit",
+ "frequency": "monthly",
+ "start_date": "2026-03-01",
+ },
+ headers=auth_headers,
+ )
+
+ response = await client.get("/api/recurring-transactions", headers=auth_headers)
+ assert response.status_code == 200
+ descriptions = [r["description"] for r in response.json()]
+ assert "Sub A" in descriptions
+ assert "Sub B" in descriptions
+
+
+async def test_delete_recurring_transaction(client, auth_headers):
+ """Delete removes a recurring transaction."""
+ create_resp = await client.post(
+ "/api/recurring-transactions",
+ json={
+ "description": "To delete",
+ "amount": 5.00,
+ "type": "debit",
+ "frequency": "weekly",
+ "start_date": "2026-03-01",
+ },
+ headers=auth_headers,
+ )
+ rec_id = create_resp.json()["id"]
+
+ del_resp = await client.delete(
+ f"/api/recurring-transactions/{rec_id}",
+ headers=auth_headers,
+ )
+ assert del_resp.status_code == 204
diff --git a/backend/tests/test_rule_engine.py b/backend/tests/test_rule_engine.py
new file mode 100644
index 00000000..125a0492
--- /dev/null
+++ b/backend/tests/test_rule_engine.py
@@ -0,0 +1,306 @@
+# backend/tests/test_rule_engine.py
+import types
+import uuid
+from decimal import Decimal
+from datetime import date
+
+
+from app.services.rule_engine import evaluate_conditions, apply_rule_actions
+
+
+def make_tx(**kwargs) -> types.SimpleNamespace:
+ defaults = dict(
+ id=uuid.uuid4(),
+ user_id=uuid.uuid4(),
+ account_id=uuid.uuid4(),
+ category_id=None,
+ description="UBER TRIP",
+ amount=Decimal("25.50"),
+ currency="BRL",
+ date=date(2026, 2, 10),
+ type="debit",
+ source="manual",
+ notes=None,
+ )
+ defaults.update(kwargs)
+ return types.SimpleNamespace(**defaults)
+
+
+# --- evaluate_conditions tests ---
+
+def test_contains_match():
+ conditions = [{"field": "description", "op": "contains", "value": "UBER"}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_contains_case_insensitive():
+ conditions = [{"field": "description", "op": "contains", "value": "uber"}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_not_contains():
+ conditions = [{"field": "description", "op": "not_contains", "value": "IFOOD"}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_starts_with():
+ conditions = [{"field": "description", "op": "starts_with", "value": "UBER"}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_ends_with():
+ conditions = [{"field": "description", "op": "ends_with", "value": "TRIP"}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_equals():
+ conditions = [{"field": "type", "op": "equals", "value": "debit"}]
+ tx = make_tx(type="debit")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_equals_no_match():
+ conditions = [{"field": "type", "op": "equals", "value": "credit"}]
+ tx = make_tx(type="debit")
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_regex():
+ conditions = [{"field": "description", "op": "regex", "value": "PIX.*RECEBIDO"}]
+ tx = make_tx(description="PIX RECEBIDO JOAO")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_amount_lt():
+ conditions = [{"field": "amount", "op": "lt", "value": 50}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_amount_gt_no_match():
+ conditions = [{"field": "amount", "op": "gt", "value": 100}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_and_all_match():
+ conditions = [
+ {"field": "description", "op": "contains", "value": "UBER"},
+ {"field": "amount", "op": "lt", "value": 50},
+ ]
+ tx = make_tx(description="UBER TRIP", amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_and_partial_match():
+ conditions = [
+ {"field": "description", "op": "contains", "value": "UBER"},
+ {"field": "amount", "op": "gt", "value": 100}, # fails
+ ]
+ tx = make_tx(description="UBER TRIP", amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_or_one_match():
+ conditions = [
+ {"field": "description", "op": "contains", "value": "IFOOD"}, # fails
+ {"field": "description", "op": "contains", "value": "UBER"}, # passes
+ ]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("or", conditions, tx) is True
+
+
+# --- apply_rule_actions tests ---
+
+def test_set_category():
+ cat_id = uuid.uuid4()
+ actions = [{"op": "set_category", "value": str(cat_id)}]
+ tx = make_tx()
+ category_set = apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.category_id == cat_id
+ assert category_set is True
+
+
+def test_set_category_skips_if_already_set():
+ cat_id1 = uuid.uuid4()
+ cat_id2 = uuid.uuid4()
+ # First rule sets category
+ actions1 = [{"op": "set_category", "value": str(cat_id1)}]
+ tx = make_tx()
+ apply_rule_actions(actions1, tx, category_already_set=False)
+ # Second rule should NOT override
+ actions2 = [{"op": "set_category", "value": str(cat_id2)}]
+ apply_rule_actions(actions2, tx, category_already_set=True)
+ assert tx.category_id == cat_id1 # unchanged
+
+
+def test_append_notes():
+ actions = [{"op": "append_notes", "value": "#work #reimbursable"}]
+ tx = make_tx(notes=None)
+ apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.notes == "#work #reimbursable"
+
+
+def test_append_notes_accumulates():
+ actions1 = [{"op": "append_notes", "value": "#work"}]
+ actions2 = [{"op": "append_notes", "value": "#small"}]
+ tx = make_tx(notes=None)
+ apply_rule_actions(actions1, tx, category_already_set=False)
+ apply_rule_actions(actions2, tx, category_already_set=False)
+ assert "#work" in tx.notes
+ assert "#small" in tx.notes
+
+
+def test_append_notes_no_duplicate():
+ actions = [{"op": "append_notes", "value": "#work"}]
+ tx = make_tx(notes="#work")
+ apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.notes.count("#work") == 1
+
+
+# --- Edge-case: evaluate_conditions ---
+
+def test_not_equals():
+ conditions = [{"field": "type", "op": "not_equals", "value": "credit"}]
+ tx = make_tx(type="debit")
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_not_equals_same_value():
+ conditions = [{"field": "type", "op": "not_equals", "value": "debit"}]
+ tx = make_tx(type="debit")
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_gte_equal():
+ conditions = [{"field": "amount", "op": "gte", "value": 25.50}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_gte_greater():
+ conditions = [{"field": "amount", "op": "gte", "value": 20}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_gte_less():
+ conditions = [{"field": "amount", "op": "gte", "value": 30}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_lte_equal():
+ conditions = [{"field": "amount", "op": "lte", "value": 25.50}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_lte_less():
+ conditions = [{"field": "amount", "op": "lte", "value": 30}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_lte_greater():
+ conditions = [{"field": "amount", "op": "lte", "value": 20}]
+ tx = make_tx(amount=Decimal("25.50"))
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_empty_conditions_returns_false():
+ tx = make_tx()
+ assert evaluate_conditions("and", [], tx) is False
+ assert evaluate_conditions("or", [], tx) is False
+
+
+def test_unknown_operator_returns_false():
+ conditions = [{"field": "description", "op": "fuzzy_match", "value": "UBER"}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_none_field_value_string_op():
+ conditions = [{"field": "notes", "op": "contains", "value": "tag"}]
+ tx = make_tx(notes=None)
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+def test_none_field_value_not_contains():
+ conditions = [{"field": "notes", "op": "not_contains", "value": "tag"}]
+ tx = make_tx(notes=None)
+ assert evaluate_conditions("and", conditions, tx) is True
+
+
+def test_invalid_regex_returns_false():
+ conditions = [{"field": "description", "op": "regex", "value": "[invalid("}]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("and", conditions, tx) is False
+
+
+# --- Edge-case: apply_rule_actions ---
+
+def test_invalid_uuid_set_category_skips():
+ actions = [{"op": "set_category", "value": "not-a-uuid"}]
+ tx = make_tx()
+ result = apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.category_id is None
+ assert result is False
+
+
+def test_empty_append_notes_no_change():
+ actions = [{"op": "append_notes", "value": ""}]
+ tx = make_tx(notes="existing")
+ apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.notes == "existing"
+
+
+def test_whitespace_only_append_notes_no_change():
+ actions = [{"op": "append_notes", "value": " "}]
+ tx = make_tx(notes="existing")
+ apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.notes == "existing"
+
+
+def test_multiple_actions_set_category_and_append_notes():
+ cat_id = uuid.uuid4()
+ actions = [
+ {"op": "set_category", "value": str(cat_id)},
+ {"op": "append_notes", "value": "#transport"},
+ ]
+ tx = make_tx()
+ result = apply_rule_actions(actions, tx, category_already_set=False)
+ assert tx.category_id == cat_id
+ assert tx.notes == "#transport"
+ assert result is True
+
+
+def test_or_no_matches_returns_false():
+ conditions = [
+ {"field": "description", "op": "contains", "value": "IFOOD"},
+ {"field": "description", "op": "contains", "value": "RAPPI"},
+ ]
+ tx = make_tx(description="UBER TRIP")
+ assert evaluate_conditions("or", conditions, tx) is False
+
+
+def test_rule_priority_ordering():
+ """Lower priority rules apply first; first category wins."""
+ cat_low = uuid.uuid4()
+ cat_high = uuid.uuid4()
+ tx = make_tx(description="UBER TRIP")
+
+ # Simulate priority ordering: low-priority rule runs first
+ actions_low = [{"op": "set_category", "value": str(cat_low)}]
+ actions_high = [{"op": "set_category", "value": str(cat_high)}]
+
+ category_set = False
+ category_set = apply_rule_actions(actions_low, tx, category_already_set=category_set)
+ category_set = apply_rule_actions(actions_high, tx, category_already_set=category_set)
+
+ assert tx.category_id == cat_low
diff --git a/backend/tests/test_transaction_schemas.py b/backend/tests/test_transaction_schemas.py
new file mode 100644
index 00000000..2c82b348
--- /dev/null
+++ b/backend/tests/test_transaction_schemas.py
@@ -0,0 +1,84 @@
+"""Regression tests for TransactionUpdate schema.
+
+Ensures the Pydantic field-name/type-name collision for `date: Optional[date]`
+does not resurface. See: Pydantic V2 metaclass resolves the `date` type annotation
+to NoneType when the field name is also `date` and the type is Optional.
+"""
+
+from datetime import date
+from decimal import Decimal
+
+import pytest
+from pydantic import ValidationError
+
+from app.schemas.transaction import TransactionCreate, TransactionUpdate
+
+
+class TestTransactionUpdateDateField:
+ """Verify the `date` field on TransactionUpdate accepts valid date strings."""
+
+ def test_accepts_iso_date_string(self):
+ data = TransactionUpdate.model_validate({"date": "2026-02-25"})
+ assert data.date == date(2026, 2, 25)
+
+ def test_accepts_none(self):
+ data = TransactionUpdate.model_validate({"date": None})
+ assert data.date is None
+
+ def test_unset_date_excluded(self):
+ data = TransactionUpdate.model_validate({"description": "test"})
+ dumped = data.model_dump(exclude_unset=True)
+ assert "date" not in dumped
+
+ def test_set_date_included(self):
+ data = TransactionUpdate.model_validate({"date": "2026-03-15"})
+ dumped = data.model_dump(exclude_unset=True)
+ assert dumped["date"] == date(2026, 3, 15)
+
+ def test_rejects_invalid_date_string(self):
+ with pytest.raises(ValidationError):
+ TransactionUpdate.model_validate({"date": "not-a-date"})
+
+
+class TestTransactionUpdateAllFields:
+ """Verify TransactionUpdate accepts all editable fields together."""
+
+ def test_all_fields_accepted(self):
+ data = TransactionUpdate.model_validate({
+ "description": "Updated description",
+ "amount": "250.00",
+ "date": "2026-06-01",
+ "type": "credit",
+ "currency": "USD",
+ "category_id": "11111111-1111-1111-1111-111111111111",
+ })
+ assert data.description == "Updated description"
+ assert data.amount == Decimal("250.00")
+ assert data.date == date(2026, 6, 1)
+ assert data.type == "credit"
+ assert data.currency == "USD"
+ assert str(data.category_id) == "11111111-1111-1111-1111-111111111111"
+
+ def test_partial_update_only_type(self):
+ data = TransactionUpdate.model_validate({"type": "credit"})
+ dumped = data.model_dump(exclude_unset=True)
+ assert dumped == {"type": "credit"}
+
+ def test_partial_update_amount_and_currency(self):
+ data = TransactionUpdate.model_validate({"amount": "99.99", "currency": "EUR"})
+ dumped = data.model_dump(exclude_unset=True)
+ assert dumped == {"amount": Decimal("99.99"), "currency": "EUR"}
+
+
+class TestTransactionCreateDateField:
+ """Ensure TransactionCreate also handles the date field correctly."""
+
+ def test_accepts_iso_date_string(self):
+ data = TransactionCreate.model_validate({
+ "description": "Test",
+ "amount": "10.00",
+ "date": "2026-02-25",
+ "type": "debit",
+ "account_id": "11111111-1111-1111-1111-111111111111",
+ })
+ assert data.date == date(2026, 2, 25)
diff --git a/backend/tests/test_transactions_api.py b/backend/tests/test_transactions_api.py
new file mode 100644
index 00000000..286e7373
--- /dev/null
+++ b/backend/tests/test_transactions_api.py
@@ -0,0 +1,268 @@
+import pytest
+from httpx import AsyncClient
+
+from app.models.account import Account
+from app.models.transaction import Transaction
+from app.models.category import Category
+
+
+async def test_list_transactions(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction]
+):
+ response = await client.get("/api/transactions", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] == 5
+ assert len(data["items"]) == 5
+ assert data["page"] == 1
+ assert data["limit"] == 50
+
+
+async def test_list_transactions_pagination(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction]
+):
+ response = await client.get(
+ "/api/transactions?page=1&limit=2", headers=auth_headers
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] == 5
+ assert len(data["items"]) == 2
+ assert data["page"] == 1
+ assert data["limit"] == 2
+
+
+async def test_list_transactions_filter_by_account(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction], test_account: Account
+):
+ response = await client.get(
+ f"/api/transactions?account_id={test_account.id}", headers=auth_headers
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] == 5 # all belong to same account
+
+
+async def test_list_transactions_filter_by_category(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction],
+ test_categories: list[Category],
+):
+ cat_id = test_categories[0].id # Alimentação
+ response = await client.get(
+ f"/api/transactions?category_id={cat_id}", headers=auth_headers
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] == 1 # only IFOOD
+
+
+async def test_list_transactions_filter_by_date(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction]
+):
+ # Use actual fixture transaction dates (UBER and IFOOD)
+ uber_date = test_transactions[0].date.isoformat()
+ ifood_date = test_transactions[1].date.isoformat()
+ date_from = min(uber_date, ifood_date)
+ date_to = max(uber_date, ifood_date)
+ response = await client.get(
+ f"/api/transactions?from={date_from}&to={date_to}", headers=auth_headers
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["total"] >= 2 # at least UBER and IFOOD
+
+
+async def test_get_transaction(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction]
+):
+ txn_id = str(test_transactions[0].id)
+ response = await client.get(f"/api/transactions/{txn_id}", headers=auth_headers)
+ assert response.status_code == 200
+ data = response.json()
+ assert data["description"] == "UBER TRIP"
+ assert data["source"] == "manual"
+
+
+async def test_get_transaction_not_found(client: AsyncClient, auth_headers, test_transactions):
+ response = await client.get(
+ "/api/transactions/00000000-0000-0000-0000-000000000000",
+ headers=auth_headers,
+ )
+ assert response.status_code == 404
+
+
+async def test_create_transaction(
+ client: AsyncClient, auth_headers, test_account: Account, test_categories: list[Category]
+):
+ response = await client.post(
+ "/api/transactions",
+ headers=auth_headers,
+ json={
+ "account_id": str(test_account.id),
+ "category_id": str(test_categories[0].id),
+ "description": "Almoço restaurante",
+ "amount": "32.50",
+ "date": "2026-02-20",
+ "type": "debit",
+ },
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["description"] == "Almoço restaurante"
+ assert data["source"] == "manual"
+ assert data["category_id"] == str(test_categories[0].id)
+
+
+async def test_create_transaction_auto_categorize(
+ client: AsyncClient, auth_headers, test_account: Account,
+ test_rules, test_categories: list[Category],
+):
+ """Transaction with UBER in description should auto-categorize to Transporte."""
+ response = await client.post(
+ "/api/transactions",
+ headers=auth_headers,
+ json={
+ "account_id": str(test_account.id),
+ "description": "UBER TRIP CENTRO",
+ "amount": "18.00",
+ "date": "2026-02-21",
+ "type": "debit",
+ },
+ )
+ assert response.status_code == 201
+ data = response.json()
+ assert data["category_id"] == str(test_categories[1].id) # Transporte
+
+
+async def test_create_transaction_invalid_account(
+ client: AsyncClient, auth_headers, test_account
+):
+ response = await client.post(
+ "/api/transactions",
+ headers=auth_headers,
+ json={
+ "account_id": "00000000-0000-0000-0000-000000000000",
+ "description": "Test",
+ "amount": "10.00",
+ "date": "2026-02-20",
+ "type": "debit",
+ },
+ )
+ assert response.status_code == 400
+
+
+async def test_update_transaction(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction],
+ test_categories: list[Category],
+):
+ txn_id = str(test_transactions[4].id) # NETFLIX, no category
+ response = await client.patch(
+ f"/api/transactions/{txn_id}",
+ headers=auth_headers,
+ json={"category_id": str(test_categories[0].id)},
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["category_id"] == str(test_categories[0].id)
+
+
+async def test_update_transaction_date(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction],
+):
+ """Regression: updating the date field must not fail with 'input should be none'."""
+ txn_id = str(test_transactions[0].id)
+ response = await client.patch(
+ f"/api/transactions/{txn_id}",
+ headers=auth_headers,
+ json={"date": "2026-06-15"},
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["date"] == "2026-06-15"
+
+
+async def test_update_transaction_all_fields(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction],
+ test_categories: list[Category],
+):
+ """Regression: updating multiple fields including date must succeed."""
+ txn_id = str(test_transactions[0].id)
+ response = await client.patch(
+ f"/api/transactions/{txn_id}",
+ headers=auth_headers,
+ json={
+ "description": "Updated description",
+ "amount": "999.99",
+ "date": "2026-12-25",
+ "type": "credit",
+ "currency": "USD",
+ "category_id": str(test_categories[0].id),
+ },
+ )
+ assert response.status_code == 200
+ data = response.json()
+ assert data["description"] == "Updated description"
+ assert float(data["amount"]) == 999.99
+ assert data["date"] == "2026-12-25"
+ assert data["type"] == "credit"
+ assert data["currency"] == "USD"
+ assert data["category_id"] == str(test_categories[0].id)
+
+
+async def test_delete_transaction(
+ client: AsyncClient, auth_headers, test_transactions: list[Transaction]
+):
+ txn_id = str(test_transactions[4].id) # NETFLIX
+ response = await client.delete(f"/api/transactions/{txn_id}", headers=auth_headers)
+ assert response.status_code == 204
+
+ # Verify it's gone
+ response = await client.get(f"/api/transactions/{txn_id}", headers=auth_headers)
+ assert response.status_code == 404
+
+
+async def test_delete_transaction_not_found(client: AsyncClient, auth_headers, test_transactions):
+ response = await client.delete(
+ "/api/transactions/00000000-0000-0000-0000-000000000000",
+ headers=auth_headers,
+ )
+ assert response.status_code == 404
+
+
+async def test_transactions_unauthenticated(client: AsyncClient, clean_db):
+ response = await client.get("/api/transactions")
+ assert response.status_code == 401
+
+
+async def test_create_transaction_without_account_fails(
+ client: AsyncClient, auth_headers, test_account
+):
+ """account_id is required — omitting it must return 422."""
+ response = await client.post(
+ "/api/transactions",
+ headers=auth_headers,
+ json={
+ "description": "No account",
+ "amount": "10.00",
+ "date": "2026-02-20",
+ "type": "debit",
+ },
+ )
+ assert response.status_code == 422
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 00000000..d50d8b2e
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,74 @@
+x-backend-env: &backend-env
+ DATABASE_URL: postgresql+asyncpg://postgres:postgres@db:5432/securo
+ SECRET_KEY: ${SECRET_KEY:-dev-secret-change-in-production}
+ DEBUG: ${DEBUG:-true}
+ FRONTEND_URL: http://localhost:3000
+ PLUGGY_CLIENT_ID: ${PLUGGY_CLIENT_ID:-}
+ PLUGGY_CLIENT_SECRET: ${PLUGGY_CLIENT_SECRET:-}
+ PLUGGY_OAUTH_REDIRECT_URI: http://localhost:3000/oauth/callback
+ REDIS_URL: redis://redis:6379/0
+
+x-backend-base: &backend-base
+ build: ./backend
+ environment: *backend-env
+ depends_on:
+ db: { condition: service_healthy }
+ redis: { condition: service_healthy }
+ volumes:
+ - ./backend:/app
+ restart: unless-stopped
+
+services:
+ redis:
+ image: redis:7-alpine
+ healthcheck:
+ test: ["CMD", "redis-cli", "ping"]
+ interval: 5s
+ timeout: 3s
+ retries: 5
+
+ db:
+ image: postgres:16-alpine
+ environment:
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: postgres
+ POSTGRES_DB: securo
+ volumes:
+ - pgdata:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
+ interval: 5s
+ timeout: 3s
+ retries: 5
+
+ backend:
+ <<: *backend-base
+ command: sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
+ ports:
+ - "8000:8000"
+
+ frontend:
+ build:
+ context: ./frontend
+ dockerfile: Dockerfile.dev
+ ports:
+ - "3000:5173"
+ environment:
+ BACKEND_URL: http://backend:8000
+ depends_on:
+ - backend
+ volumes:
+ - ./frontend:/app
+ - /app/node_modules
+ restart: unless-stopped
+
+ celery-worker:
+ <<: *backend-base
+ command: celery -A app.worker worker --loglevel=info
+
+ celery-beat:
+ <<: *backend-base
+ command: celery -A app.worker beat --loglevel=info
+
+volumes:
+ pgdata:
diff --git a/favicons/android-icon-192x192.png b/favicons/android-icon-192x192.png
new file mode 100644
index 00000000..dca4247b
Binary files /dev/null and b/favicons/android-icon-192x192.png differ
diff --git a/favicons/apple-icon-114x114.png b/favicons/apple-icon-114x114.png
new file mode 100644
index 00000000..ed4c5531
Binary files /dev/null and b/favicons/apple-icon-114x114.png differ
diff --git a/favicons/apple-icon-120x120.png b/favicons/apple-icon-120x120.png
new file mode 100644
index 00000000..a1002777
Binary files /dev/null and b/favicons/apple-icon-120x120.png differ
diff --git a/favicons/apple-icon-144x144.png b/favicons/apple-icon-144x144.png
new file mode 100644
index 00000000..361a96cf
Binary files /dev/null and b/favicons/apple-icon-144x144.png differ
diff --git a/favicons/apple-icon-152x152.png b/favicons/apple-icon-152x152.png
new file mode 100644
index 00000000..3362a765
Binary files /dev/null and b/favicons/apple-icon-152x152.png differ
diff --git a/favicons/apple-icon-180x180.png b/favicons/apple-icon-180x180.png
new file mode 100644
index 00000000..cc0cf287
Binary files /dev/null and b/favicons/apple-icon-180x180.png differ
diff --git a/favicons/apple-icon-57x57.png b/favicons/apple-icon-57x57.png
new file mode 100644
index 00000000..1f0be776
Binary files /dev/null and b/favicons/apple-icon-57x57.png differ
diff --git a/favicons/apple-icon-60x60.png b/favicons/apple-icon-60x60.png
new file mode 100644
index 00000000..8c7aea8f
Binary files /dev/null and b/favicons/apple-icon-60x60.png differ
diff --git a/favicons/apple-icon-72x72.png b/favicons/apple-icon-72x72.png
new file mode 100644
index 00000000..52ed7c06
Binary files /dev/null and b/favicons/apple-icon-72x72.png differ
diff --git a/favicons/apple-icon-76x76.png b/favicons/apple-icon-76x76.png
new file mode 100644
index 00000000..feaaab4a
Binary files /dev/null and b/favicons/apple-icon-76x76.png differ
diff --git a/favicons/apple-touch-icon.png b/favicons/apple-touch-icon.png
new file mode 100644
index 00000000..8b5773e9
Binary files /dev/null and b/favicons/apple-touch-icon.png differ
diff --git a/favicons/favicon-16x16-dark.png b/favicons/favicon-16x16-dark.png
new file mode 100644
index 00000000..a19304fb
Binary files /dev/null and b/favicons/favicon-16x16-dark.png differ
diff --git a/favicons/favicon-16x16-light.png b/favicons/favicon-16x16-light.png
new file mode 100644
index 00000000..2e1dabc0
Binary files /dev/null and b/favicons/favicon-16x16-light.png differ
diff --git a/favicons/favicon-16x16.png b/favicons/favicon-16x16.png
new file mode 100644
index 00000000..2e1dabc0
Binary files /dev/null and b/favicons/favicon-16x16.png differ
diff --git a/favicons/favicon-32x32.png b/favicons/favicon-32x32.png
new file mode 100644
index 00000000..36cb02cd
Binary files /dev/null and b/favicons/favicon-32x32.png differ
diff --git a/favicons/favicon-96x96.png b/favicons/favicon-96x96.png
new file mode 100644
index 00000000..1eab1ea8
Binary files /dev/null and b/favicons/favicon-96x96.png differ
diff --git a/favicons/favicon.ico b/favicons/favicon.ico
new file mode 100644
index 00000000..382d3e7b
Binary files /dev/null and b/favicons/favicon.ico differ
diff --git a/favicons/favicon.png b/favicons/favicon.png
new file mode 100644
index 00000000..36cb02cd
Binary files /dev/null and b/favicons/favicon.png differ
diff --git a/favicons/manifest.json b/favicons/manifest.json
new file mode 100644
index 00000000..42d55314
--- /dev/null
+++ b/favicons/manifest.json
@@ -0,0 +1,30 @@
+{
+ "name": "Favicon Package",
+ "short_name": "Favicons",
+ "start_url": "/",
+ "icons": [
+ {
+ "src": "/android-icon-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/favicon-96x96.png",
+ "sizes": "96x96",
+ "type": "image/png"
+ },
+ {
+ "src": "/favicon-32x32.png",
+ "sizes": "32x32",
+ "type": "image/png"
+ },
+ {
+ "src": "/favicon-16x16.png",
+ "sizes": "16x16",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
\ No newline at end of file
diff --git a/favicons/ms-icon-144x144.png b/favicons/ms-icon-144x144.png
new file mode 100644
index 00000000..361a96cf
Binary files /dev/null and b/favicons/ms-icon-144x144.png differ
diff --git a/frontend/.dockerignore b/frontend/.dockerignore
new file mode 100644
index 00000000..deed335b
--- /dev/null
+++ b/frontend/.dockerignore
@@ -0,0 +1,3 @@
+node_modules/
+dist/
+.env
diff --git a/frontend/.gitignore b/frontend/.gitignore
new file mode 100644
index 00000000..a547bf36
--- /dev/null
+++ b/frontend/.gitignore
@@ -0,0 +1,24 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
diff --git a/frontend/Dockerfile b/frontend/Dockerfile
new file mode 100644
index 00000000..7ca40c3d
--- /dev/null
+++ b/frontend/Dockerfile
@@ -0,0 +1,17 @@
+FROM node:22-slim AS build
+
+WORKDIR /app
+
+COPY package.json package-lock.json ./
+RUN npm ci
+
+COPY . .
+RUN npm run build
+
+# Serve with nginx
+FROM nginx:alpine
+
+COPY --from=build /app/dist /usr/share/nginx/html
+COPY nginx.conf /etc/nginx/conf.d/default.conf
+
+EXPOSE 80
diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev
new file mode 100644
index 00000000..12d8bd42
--- /dev/null
+++ b/frontend/Dockerfile.dev
@@ -0,0 +1,12 @@
+FROM node:22-slim
+
+WORKDIR /app
+
+COPY package.json package-lock.json ./
+RUN npm ci
+
+COPY . .
+
+EXPOSE 5173
+
+CMD ["npm", "run", "dev"]
diff --git a/frontend/README.md b/frontend/README.md
new file mode 100644
index 00000000..d2e77611
--- /dev/null
+++ b/frontend/README.md
@@ -0,0 +1,73 @@
+# React + TypeScript + Vite
+
+This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
+
+Currently, two official plugins are available:
+
+- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
+- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
+
+## React Compiler
+
+The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
+
+## Expanding the ESLint configuration
+
+If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
+
+```js
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{ts,tsx}'],
+ extends: [
+ // Other configs...
+
+ // Remove tseslint.configs.recommended and replace with this
+ tseslint.configs.recommendedTypeChecked,
+ // Alternatively, use this for stricter rules
+ tseslint.configs.strictTypeChecked,
+ // Optionally, add this for stylistic rules
+ tseslint.configs.stylisticTypeChecked,
+
+ // Other configs...
+ ],
+ languageOptions: {
+ parserOptions: {
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
+ tsconfigRootDir: import.meta.dirname,
+ },
+ // other options...
+ },
+ },
+])
+```
+
+You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
+
+```js
+// eslint.config.js
+import reactX from 'eslint-plugin-react-x'
+import reactDom from 'eslint-plugin-react-dom'
+
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{ts,tsx}'],
+ extends: [
+ // Other configs...
+ // Enable lint rules for React
+ reactX.configs['recommended-typescript'],
+ // Enable lint rules for React DOM
+ reactDom.configs.recommended,
+ ],
+ languageOptions: {
+ parserOptions: {
+ project: ['./tsconfig.node.json', './tsconfig.app.json'],
+ tsconfigRootDir: import.meta.dirname,
+ },
+ // other options...
+ },
+ },
+])
+```
diff --git a/frontend/components.json b/frontend/components.json
new file mode 100644
index 00000000..c3085d6c
--- /dev/null
+++ b/frontend/components.json
@@ -0,0 +1,23 @@
+{
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "new-york",
+ "rsc": false,
+ "tsx": true,
+ "tailwind": {
+ "config": "",
+ "css": "src/index.css",
+ "baseColor": "neutral",
+ "cssVariables": true,
+ "prefix": ""
+ },
+ "iconLibrary": "lucide",
+ "rtl": false,
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils",
+ "ui": "@/components/ui",
+ "lib": "@/lib",
+ "hooks": "@/hooks"
+ },
+ "registries": {}
+}
diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js
new file mode 100644
index 00000000..e39a246a
--- /dev/null
+++ b/frontend/eslint.config.js
@@ -0,0 +1,28 @@
+import js from '@eslint/js'
+import globals from 'globals'
+import reactHooks from 'eslint-plugin-react-hooks'
+import reactRefresh from 'eslint-plugin-react-refresh'
+import tseslint from 'typescript-eslint'
+import { defineConfig, globalIgnores } from 'eslint/config'
+
+export default defineConfig([
+ globalIgnores(['dist']),
+ {
+ files: ['**/*.{ts,tsx}'],
+ extends: [
+ js.configs.recommended,
+ tseslint.configs.recommended,
+ reactHooks.configs.flat.recommended,
+ reactRefresh.configs.vite,
+ ],
+ languageOptions: {
+ ecmaVersion: 2020,
+ globals: globals.browser,
+ },
+ rules: {
+ 'react-refresh/only-export-components': 'warn',
+ 'react-hooks/set-state-in-effect': 'warn',
+ 'react-hooks/preserve-manual-memoization': 'warn',
+ },
+ },
+])
diff --git a/frontend/index.html b/frontend/index.html
new file mode 100644
index 00000000..f81d6429
--- /dev/null
+++ b/frontend/index.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <link rel="icon" type="image/x-icon" href="/favicon.ico" />
+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
+ <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+ <link href="https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap" rel="stylesheet" />
+ <title>Securo</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="/src/main.tsx"></script>
+ </body>
+</html>
diff --git a/frontend/nginx.conf b/frontend/nginx.conf
new file mode 100644
index 00000000..bc5158ee
--- /dev/null
+++ b/frontend/nginx.conf
@@ -0,0 +1,25 @@
+server {
+ listen 80;
+ root /usr/share/nginx/html;
+ index index.html;
+
+ # API proxy to backend
+ location /api/ {
+ proxy_pass http://backend:8000;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ }
+
+ # Never cache index.html so new deployments are always picked up immediately
+ location = /index.html {
+ add_header Cache-Control "no-store, no-cache, must-revalidate";
+ try_files $uri =404;
+ }
+
+ # SPA fallback — serve index.html for all non-file routes
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+}
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
new file mode 100644
index 00000000..455b3246
--- /dev/null
+++ b/frontend/package-lock.json
@@ -0,0 +1,10450 @@
+{
+ "name": "frontend",
+ "version": "0.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "frontend",
+ "version": "0.0.0",
+ "dependencies": {
+ "@hookform/resolvers": "^5.2.2",
+ "@tanstack/react-query": "^5.90.21",
+ "axios": "^1.13.5",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "date-fns": "^4.1.0",
+ "i18next": "^25.8.13",
+ "i18next-browser-languagedetector": "^8.2.1",
+ "lucide-react": "^0.575.0",
+ "next-themes": "^0.4.6",
+ "radix-ui": "^1.4.3",
+ "react": "^19.2.0",
+ "react-dom": "^19.2.0",
+ "react-hook-form": "^7.71.2",
+ "react-i18next": "^16.5.4",
+ "react-pluggy-connect": "^2.10.2",
+ "react-router-dom": "^7.13.1",
+ "recharts": "^3.7.0",
+ "sonner": "^2.0.7",
+ "tailwind-merge": "^3.5.0",
+ "zod": "^4.3.6"
+ },
+ "devDependencies": {
+ "@eslint/js": "^9.39.1",
+ "@tailwindcss/vite": "^4.2.1",
+ "@types/node": "^24.10.13",
+ "@types/react": "^19.2.7",
+ "@types/react-dom": "^19.2.3",
+ "@vitejs/plugin-react": "^5.1.1",
+ "eslint": "^9.39.1",
+ "eslint-plugin-react-hooks": "^7.0.1",
+ "eslint-plugin-react-refresh": "^0.4.24",
+ "globals": "^16.5.0",
+ "shadcn": "^3.8.5",
+ "tailwindcss": "^4.2.1",
+ "tw-animate-css": "^1.4.0",
+ "typescript": "~5.9.3",
+ "typescript-eslint": "^8.48.0",
+ "vite": "^7.3.1"
+ }
+ },
+ "node_modules/@antfu/ni": {
+ "version": "25.0.0",
+ "resolved": "https://registry.npmjs.org/@antfu/ni/-/ni-25.0.0.tgz",
+ "integrity": "sha512-9q/yCljni37pkMr4sPrI3G4jqdIk074+iukc5aFJl7kmDCCsiJrbZ6zKxnES1Gwg+i9RcDZwvktl23puGslmvA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansis": "^4.0.0",
+ "fzf": "^0.5.2",
+ "package-manager-detector": "^1.3.0",
+ "tinyexec": "^1.0.1"
+ },
+ "bin": {
+ "na": "bin/na.mjs",
+ "nci": "bin/nci.mjs",
+ "ni": "bin/ni.mjs",
+ "nlx": "bin/nlx.mjs",
+ "nr": "bin/nr.mjs",
+ "nun": "bin/nun.mjs",
+ "nup": "bin/nup.mjs"
+ }
+ },
+ "node_modules/@babel/code-frame": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
+ "integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.28.5",
+ "js-tokens": "^4.0.0",
+ "picocolors": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/compat-data": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",
+ "integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/core": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
+ "integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.0",
+ "@babel/generator": "^7.29.0",
+ "@babel/helper-compilation-targets": "^7.28.6",
+ "@babel/helper-module-transforms": "^7.28.6",
+ "@babel/helpers": "^7.28.6",
+ "@babel/parser": "^7.29.0",
+ "@babel/template": "^7.28.6",
+ "@babel/traverse": "^7.29.0",
+ "@babel/types": "^7.29.0",
+ "@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.1",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz",
+ "integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/parser": "^7.29.0",
+ "@babel/types": "^7.29.0",
+ "@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-annotate-as-pure": {
+ "version": "7.27.3",
+ "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.27.3.tgz",
+ "integrity": "sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.27.3"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-compilation-targets": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",
+ "integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/compat-data": "^7.28.6",
+ "@babel/helper-validator-option": "^7.27.1",
+ "browserslist": "^4.24.0",
+ "lru-cache": "^5.1.1",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-create-class-features-plugin": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.28.6.tgz",
+ "integrity": "sha512-dTOdvsjnG3xNT9Y0AUg1wAl38y+4Rl4sf9caSQZOXdNqVn+H+HbbJ4IyyHaIqNR6SW9oJpA/RuRjsjCw2IdIow==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.27.3",
+ "@babel/helper-member-expression-to-functions": "^7.28.5",
+ "@babel/helper-optimise-call-expression": "^7.27.1",
+ "@babel/helper-replace-supers": "^7.28.6",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
+ "@babel/traverse": "^7.28.6",
+ "semver": "^6.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-globals": {
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",
+ "integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-member-expression-to-functions": {
+ "version": "7.28.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.28.5.tgz",
+ "integrity": "sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.28.5",
+ "@babel/types": "^7.28.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-imports": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",
+ "integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.28.6",
+ "@babel/types": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-module-transforms": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",
+ "integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-imports": "^7.28.6",
+ "@babel/helper-validator-identifier": "^7.28.5",
+ "@babel/traverse": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-optimise-call-expression": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.27.1.tgz",
+ "integrity": "sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-plugin-utils": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz",
+ "integrity": "sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-replace-supers": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.28.6.tgz",
+ "integrity": "sha512-mq8e+laIk94/yFec3DxSjCRD2Z0TAjhVbEJY3UQrlwVo15Lmt7C2wAUbK4bjnTs4APkwsYLTahXRraQXhb1WCg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-member-expression-to-functions": "^7.28.5",
+ "@babel/helper-optimise-call-expression": "^7.27.1",
+ "@babel/traverse": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/@babel/helper-skip-transparent-expression-wrappers": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.27.1.tgz",
+ "integrity": "sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/traverse": "^7.27.1",
+ "@babel/types": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-string-parser": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
+ "integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.28.5",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
+ "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helper-validator-option": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
+ "integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/helpers": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.28.6.tgz",
+ "integrity": "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/template": "^7.28.6",
+ "@babel/types": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/parser": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz",
+ "integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/types": "^7.29.0"
+ },
+ "bin": {
+ "parser": "bin/babel-parser.js"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-jsx": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz",
+ "integrity": "sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-syntax-typescript": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz",
+ "integrity": "sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-modules-commonjs": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.28.6.tgz",
+ "integrity": "sha512-jppVbf8IV9iWWwWTQIxJMAJCWBuuKx71475wHwYytrRGQ2CWiDvYlADQno3tcYpS/T2UUWFQp3nVtYfK/YBQrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-module-transforms": "^7.28.6",
+ "@babel/helper-plugin-utils": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-self": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.27.1.tgz",
+ "integrity": "sha512-6UzkCs+ejGdZ5mFFC/OCUrv028ab2fp1znZmCZjAOBKiBK2jXD1O+BPSfX8X2qjJ75fZBMSnQn3Rq2mrBJK2mw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-react-jsx-source": {
+ "version": "7.27.1",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.27.1.tgz",
+ "integrity": "sha512-zbwoTsBruTeKB9hSq73ha66iFeJHuaFkUbwvqElnygoNbj/jHRsSeokowZFN3CZ64IvEqcmmkVe89OPXc7ldAw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/plugin-transform-typescript": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.28.6.tgz",
+ "integrity": "sha512-0YWL2RFxOqEm9Efk5PvreamxPME8OyY0wM5wh5lHjF+VtVhdneCWGzZeSqzOfiobVqQaNCd2z0tQvnI9DaPWPw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-annotate-as-pure": "^7.27.3",
+ "@babel/helper-create-class-features-plugin": "^7.28.6",
+ "@babel/helper-plugin-utils": "^7.28.6",
+ "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1",
+ "@babel/plugin-syntax-typescript": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/preset-typescript": {
+ "version": "7.28.5",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.28.5.tgz",
+ "integrity": "sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.27.1",
+ "@babel/helper-validator-option": "^7.27.1",
+ "@babel/plugin-syntax-jsx": "^7.27.1",
+ "@babel/plugin-transform-modules-commonjs": "^7.27.1",
+ "@babel/plugin-transform-typescript": "^7.28.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/runtime": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.6.tgz",
+ "integrity": "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/template": {
+ "version": "7.28.6",
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",
+ "integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.28.6",
+ "@babel/parser": "^7.28.6",
+ "@babel/types": "^7.28.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/traverse": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",
+ "integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.29.0",
+ "@babel/generator": "^7.29.0",
+ "@babel/helper-globals": "^7.28.0",
+ "@babel/parser": "^7.29.0",
+ "@babel/template": "^7.28.6",
+ "@babel/types": "^7.29.0",
+ "debug": "^4.3.1"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@babel/types": {
+ "version": "7.29.0",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
+ "integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/helper-string-parser": "^7.27.1",
+ "@babel/helper-validator-identifier": "^7.28.5"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmjs.org/@dotenvx/dotenvx/-/dotenvx-1.52.0.tgz",
+ "integrity": "sha512-CaQcc8JvtzQhUSm9877b6V4Tb7HCotkcyud9X2YwdqtQKwgljkMRwU96fVYKnzN3V0Hj74oP7Es+vZ0mS+Aa1w==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "commander": "^11.1.0",
+ "dotenv": "^17.2.1",
+ "eciesjs": "^0.4.10",
+ "execa": "^5.1.1",
+ "fdir": "^6.2.0",
+ "ignore": "^5.3.0",
+ "object-treeify": "1.1.33",
+ "picomatch": "^4.0.2",
+ "which": "^4.0.0"
+ },
+ "bin": {
+ "dotenvx": "src/cli/dotenvx.js"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/commander": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz",
+ "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/execa": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cross-spawn": "^7.0.3",
+ "get-stream": "^6.0.0",
+ "human-signals": "^2.1.0",
+ "is-stream": "^2.0.0",
+ "merge-stream": "^2.0.0",
+ "npm-run-path": "^4.0.1",
+ "onetime": "^5.1.2",
+ "signal-exit": "^3.0.3",
+ "strip-final-newline": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/get-stream": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/human-signals": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
+ "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10.17.0"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/is-stream": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/isexe": {
+ "version": "3.1.5",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.5.tgz",
+ "integrity": "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/npm-run-path": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
+ "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/onetime": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz",
+ "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mimic-fn": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/signal-exit": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/strip-final-newline": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
+ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@dotenvx/dotenvx/node_modules/which": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz",
+ "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^3.1.1"
+ },
+ "bin": {
+ "node-which": "bin/which.js"
+ },
+ "engines": {
+ "node": "^16.13.0 || >=18.0.0"
+ }
+ },
+ "node_modules/@ecies/ciphers": {
+ "version": "0.2.5",
+ "resolved": "https://registry.npmjs.org/@ecies/ciphers/-/ciphers-0.2.5.tgz",
+ "integrity": "sha512-GalEZH4JgOMHYYcYmVqnFirFsjZHeoGMDt9IxEnM9F7GRUUyUksJ7Ou53L83WHJq3RWKD3AcBpo0iQh0oMpf8A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "bun": ">=1",
+ "deno": ">=2",
+ "node": ">=16"
+ },
+ "peerDependencies": {
+ "@noble/ciphers": "^1.0.0"
+ }
+ },
+ "node_modules/@esbuild/aix-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz",
+ "integrity": "sha512-9fJMTNFTWZMh5qwrBItuziu834eOCUcEqymSH7pY+zoMVEZg3gcPuBNxH1EvfVYe9h0x/Ptw8KBzv7qxb7l8dg==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "aix"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.3.tgz",
+ "integrity": "sha512-i5D1hPY7GIQmXlXhs2w8AWHhenb00+GxjxRncS2ZM7YNVGNfaMxgzSGuO8o8SJzRc/oZwU2bcScvVERk03QhzA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.3.tgz",
+ "integrity": "sha512-YdghPYUmj/FX2SYKJ0OZxf+iaKgMsKHVPF1MAq/P8WirnSpCStzKJFjOjzsW0QQ7oIAiccHdcqjbHmJxRb/dmg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/android-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.3.tgz",
+ "integrity": "sha512-IN/0BNTkHtk8lkOM8JWAYFg4ORxBkZQf9zXiEOfERX/CzxW3Vg1ewAhU7QSWQpVIzTW+b8Xy+lGzdYXV6UZObQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.3.tgz",
+ "integrity": "sha512-Re491k7ByTVRy0t3EKWajdLIr0gz2kKKfzafkth4Q8A5n1xTHrkqZgLLjFEHVD+AXdUGgQMq+Godfq45mGpCKg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/darwin-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.3.tgz",
+ "integrity": "sha512-vHk/hA7/1AckjGzRqi6wbo+jaShzRowYip6rt6q7VYEDX4LEy1pZfDpdxCBnGtl+A5zq8iXDcyuxwtv3hNtHFg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-ipTYM2fjt3kQAYOvo6vcxJx3nBYAzPjgTCk7QEgZG8AUO3ydUhvelmhrbOheMnGOlaSFUoHXB6un+A7q4ygY9w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/freebsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.3.tgz",
+ "integrity": "sha512-dDk0X87T7mI6U3K9VjWtHOXqwAMJBNN2r7bejDsc+j03SEjtD9HrOl8gVFByeM0aJksoUuUVU9TBaZa2rgj0oA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.3.tgz",
+ "integrity": "sha512-s6nPv2QkSupJwLYyfS+gwdirm0ukyTFNl3KTgZEAiJDd+iHZcbTPPcWCcRYH+WlNbwChgH2QkE9NSlNrMT8Gfw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.3.tgz",
+ "integrity": "sha512-sZOuFz/xWnZ4KH3YfFrKCf1WyPZHakVzTiqji3WDc0BCl2kBwiJLCXpzLzUBLgmp4veFZdvN5ChW4Eq/8Fc2Fg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.3.tgz",
+ "integrity": "sha512-yGlQYjdxtLdh0a3jHjuwOrxQjOZYD/C9PfdbgJJF3TIZWnm/tMd/RcNiLngiu4iwcBAOezdnSLAwQDPqTmtTYg==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-loong64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.3.tgz",
+ "integrity": "sha512-WO60Sn8ly3gtzhyjATDgieJNet/KqsDlX5nRC5Y3oTFcS1l0KWba+SEa9Ja1GfDqSF1z6hif/SkpQJbL63cgOA==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-mips64el": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.3.tgz",
+ "integrity": "sha512-APsymYA6sGcZ4pD6k+UxbDjOFSvPWyZhjaiPyl/f79xKxwTnrn5QUnXR5prvetuaSMsb4jgeHewIDCIWljrSxw==",
+ "cpu": [
+ "mips64el"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-ppc64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.3.tgz",
+ "integrity": "sha512-eizBnTeBefojtDb9nSh4vvVQ3V9Qf9Df01PfawPcRzJH4gFSgrObw+LveUyDoKU3kxi5+9RJTCWlj4FjYXVPEA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-riscv64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.3.tgz",
+ "integrity": "sha512-3Emwh0r5wmfm3ssTWRQSyVhbOHvqegUDRd0WhmXKX2mkHJe1SFCMJhagUleMq+Uci34wLSipf8Lagt4LlpRFWQ==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-s390x": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.3.tgz",
+ "integrity": "sha512-pBHUx9LzXWBc7MFIEEL0yD/ZVtNgLytvx60gES28GcWMqil8ElCYR4kvbV2BDqsHOvVDRrOxGySBM9Fcv744hw==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/linux-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.3.tgz",
+ "integrity": "sha512-Czi8yzXUWIQYAtL/2y6vogER8pvcsOsk5cpwL4Gk5nJqH5UZiVByIY8Eorm5R13gq+DQKYg0+JyQoytLQas4dA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-sDpk0RgmTCR/5HguIZa9n9u+HVKf40fbEUt+iTzSnCaGvY9kFP0YKBWZtJaraonFnqef5SlJ8/TiPAxzyS+UoA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/netbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-P14lFKJl/DdaE00LItAukUdZO5iqNH7+PjoBm+fLQjtxfcfFE20Xf5CrLsmZdq5LFFZzb5JMZ9grUwvtVYzjiA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "netbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.3.tgz",
+ "integrity": "sha512-AIcMP77AvirGbRl/UZFTq5hjXK+2wC7qFRGoHSDrZ5v5b8DK/GYpXW3CPRL53NkvDqb9D+alBiC/dV0Fb7eJcw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openbsd-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.3.tgz",
+ "integrity": "sha512-DnW2sRrBzA+YnE70LKqnM3P+z8vehfJWHXECbwBmH/CU51z6FiqTQTHFenPlHmo3a8UgpLyH3PT+87OViOh1AQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/openharmony-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.3.tgz",
+ "integrity": "sha512-NinAEgr/etERPTsZJ7aEZQvvg/A6IsZG/LgZy+81wON2huV7SrK3e63dU0XhyZP4RKGyTm7aOgmQk0bGp0fy2g==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/sunos-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.3.tgz",
+ "integrity": "sha512-PanZ+nEz+eWoBJ8/f8HKxTTD172SKwdXebZ0ndd953gt1HRBbhMsaNqjTyYLGLPdoWHy4zLU7bDVJztF5f3BHA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "sunos"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-arm64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.3.tgz",
+ "integrity": "sha512-B2t59lWWYrbRDw/tjiWOuzSsFh1Y/E95ofKz7rIVYSQkUYBjfSgf6oeYPNWHToFRr2zx52JKApIcAS/D5TUBnA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-ia32": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.3.tgz",
+ "integrity": "sha512-QLKSFeXNS8+tHW7tZpMtjlNb7HKau0QDpwm49u0vUp9y1WOF+PEzkU84y9GqYaAVW8aH8f3GcBck26jh54cX4Q==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@esbuild/win32-x64": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz",
+ "integrity": "sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils": {
+ "version": "4.9.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz",
+ "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "eslint-visitor-keys": "^3.4.3"
+ },
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
+ }
+ },
+ "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+ "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint-community/regexpp": {
+ "version": "4.12.2",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
+ "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
+ }
+ },
+ "node_modules/@eslint/config-array": {
+ "version": "0.21.1",
+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz",
+ "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/object-schema": "^2.1.7",
+ "debug": "^4.3.1",
+ "minimatch": "^3.1.2"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/config-helpers": {
+ "version": "0.4.2",
+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz",
+ "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/core": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz",
+ "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@types/json-schema": "^7.0.15"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/eslintrc": {
+ "version": "3.3.4",
+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.4.tgz",
+ "integrity": "sha512-4h4MVF8pmBsncB60r0wSJiIeUKTSD4m7FmTFThG8RHlsg9ajqckLm9OraguFGZE4vVdpiI1Q4+hFnisopmG6gQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^6.14.0",
+ "debug": "^4.3.2",
+ "espree": "^10.0.1",
+ "globals": "^14.0.0",
+ "ignore": "^5.2.0",
+ "import-fresh": "^3.2.1",
+ "js-yaml": "^4.1.1",
+ "minimatch": "^3.1.3",
+ "strip-json-comments": "^3.1.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@eslint/eslintrc/node_modules/globals": {
+ "version": "14.0.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
+ "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@eslint/js": {
+ "version": "9.39.3",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.3.tgz",
+ "integrity": "sha512-1B1VkCq6FuUNlQvlBYb+1jDu/gV297TIs/OeiaSR9l1H27SVW55ONE1e1Vp16NqP683+xEGzxYtv4XCiDPaQiw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ }
+ },
+ "node_modules/@eslint/object-schema": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz",
+ "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@eslint/plugin-kit": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz",
+ "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@eslint/core": "^0.17.0",
+ "levn": "^0.4.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ }
+ },
+ "node_modules/@floating-ui/core": {
+ "version": "1.7.4",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.4.tgz",
+ "integrity": "sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/utils": "^0.2.10"
+ }
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.7.5",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.5.tgz",
+ "integrity": "sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/core": "^1.7.4",
+ "@floating-ui/utils": "^0.2.10"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.7.tgz",
+ "integrity": "sha512-0tLRojf/1Go2JgEVm+3Frg9A3IW8bJgKgdO0BN5RkF//ufuz2joZM63Npau2ff3J6lUVYgDSNzNkR+aH3IVfjg==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/dom": "^1.7.5"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@floating-ui/utils": {
+ "version": "0.2.10",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz",
+ "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==",
+ "license": "MIT"
+ },
+ "node_modules/@hono/node-server": {
+ "version": "1.19.9",
+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.9.tgz",
+ "integrity": "sha512-vHL6w3ecZsky+8P5MD+eFfaGTyCeOHUIFYMGpQGbrBTSmNNoxv0if69rEZ5giu36weC5saFuznL411gRX7bJDw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.14.1"
+ },
+ "peerDependencies": {
+ "hono": "^4"
+ }
+ },
+ "node_modules/@hookform/resolvers": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.2.2.tgz",
+ "integrity": "sha512-A/IxlMLShx3KjV/HeTcTfaMxdwy690+L/ZADoeaTltLx+CVuzkeVIPuybK3jrRfw7YZnmdKsVVHAlEPIAEUNlA==",
+ "license": "MIT",
+ "dependencies": {
+ "@standard-schema/utils": "^0.3.0"
+ },
+ "peerDependencies": {
+ "react-hook-form": "^7.55.0"
+ }
+ },
+ "node_modules/@humanfs/core": {
+ "version": "0.19.1",
+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
+ "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanfs/node": {
+ "version": "0.16.7",
+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz",
+ "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@humanfs/core": "^0.19.1",
+ "@humanwhocodes/retry": "^0.4.0"
+ },
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/@humanwhocodes/module-importer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
+ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=12.22"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@humanwhocodes/retry": {
+ "version": "0.4.3",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
+ "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
+ "node_modules/@inquirer/ansi": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@inquirer/ansi/-/ansi-1.0.2.tgz",
+ "integrity": "sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/confirm": {
+ "version": "5.1.21",
+ "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-5.1.21.tgz",
+ "integrity": "sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@inquirer/core": "^10.3.2",
+ "@inquirer/type": "^3.0.10"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@types/node": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@inquirer/core": {
+ "version": "10.3.2",
+ "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-10.3.2.tgz",
+ "integrity": "sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@inquirer/ansi": "^1.0.2",
+ "@inquirer/figures": "^1.0.15",
+ "@inquirer/type": "^3.0.10",
+ "cli-width": "^4.1.0",
+ "mute-stream": "^2.0.0",
+ "signal-exit": "^4.1.0",
+ "wrap-ansi": "^6.2.0",
+ "yoctocolors-cjs": "^2.1.3"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@types/node": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@inquirer/figures": {
+ "version": "1.0.15",
+ "resolved": "https://registry.npmjs.org/@inquirer/figures/-/figures-1.0.15.tgz",
+ "integrity": "sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@inquirer/type": {
+ "version": "3.0.10",
+ "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-3.0.10.tgz",
+ "integrity": "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@types/node": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "@types/node": {
+ "optional": true
+ }
+ }
+ },
+ "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/@modelcontextprotocol/sdk": {
+ "version": "1.27.1",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.27.1.tgz",
+ "integrity": "sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@hono/node-server": "^1.19.9",
+ "ajv": "^8.17.1",
+ "ajv-formats": "^3.0.1",
+ "content-type": "^1.0.5",
+ "cors": "^2.8.5",
+ "cross-spawn": "^7.0.5",
+ "eventsource": "^3.0.2",
+ "eventsource-parser": "^3.0.0",
+ "express": "^5.2.1",
+ "express-rate-limit": "^8.2.1",
+ "hono": "^4.11.4",
+ "jose": "^6.1.3",
+ "json-schema-typed": "^8.0.2",
+ "pkce-challenge": "^5.0.0",
+ "raw-body": "^3.0.0",
+ "zod": "^3.25 || ^4.0",
+ "zod-to-json-schema": "^3.25.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@cfworker/json-schema": "^4.1.1",
+ "zod": "^3.25 || ^4.0"
+ },
+ "peerDependenciesMeta": {
+ "@cfworker/json-schema": {
+ "optional": true
+ },
+ "zod": {
+ "optional": false
+ }
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/ajv": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",
+ "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@mswjs/interceptors": {
+ "version": "0.41.3",
+ "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.41.3.tgz",
+ "integrity": "sha512-cXu86tF4VQVfwz8W1SPbhoRyHJkti6mjH/XJIxp40jhO4j2k1m4KYrEykxqWPkFF3vrK4rgQppBh//AwyGSXPA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@open-draft/deferred-promise": "^2.2.0",
+ "@open-draft/logger": "^0.3.0",
+ "@open-draft/until": "^2.0.0",
+ "is-node-process": "^1.2.0",
+ "outvariant": "^1.4.3",
+ "strict-event-emitter": "^0.5.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@noble/ciphers": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz",
+ "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "1.9.7",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz",
+ "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "1.8.0"
+ },
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^14.21.3 || >=16"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@nodelib/fs.scandir": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.stat": "2.0.5",
+ "run-parallel": "^1.1.9"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.stat": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@open-draft/deferred-promise": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/deferred-promise/-/deferred-promise-2.2.0.tgz",
+ "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@open-draft/logger": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/logger/-/logger-0.3.0.tgz",
+ "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-node-process": "^1.2.0",
+ "outvariant": "^1.4.0"
+ }
+ },
+ "node_modules/@open-draft/until": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@open-draft/until/-/until-2.1.0.tgz",
+ "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@radix-ui/number": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz",
+ "integrity": "sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g==",
+ "license": "MIT"
+ },
+ "node_modules/@radix-ui/primitive": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.3.tgz",
+ "integrity": "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg==",
+ "license": "MIT"
+ },
+ "node_modules/@radix-ui/react-accessible-icon": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.1.7.tgz",
+ "integrity": "sha512-XM+E4WXl0OqUJFovy6GjmxxFyx9opfCAIUku4dlKRd5YEPqt4kALOkQOp0Of6reHuUkJuiPBEc5k0o4z4lTC8A==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-visually-hidden": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-accordion": {
+ "version": "1.2.12",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.12.tgz",
+ "integrity": "sha512-T4nygeh9YE9dLRPhAHSeOZi7HBXo+0kYIPJXayZfvWOWA0+n3dESrZbjfDPUABkUNym6Hd+f2IR113To8D2GPA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collapsible": "1.1.12",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-alert-dialog": {
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.15.tgz",
+ "integrity": "sha512-oTVLkEw5GpdRe29BqJ0LSDFWI3qu0vR1M0mUkOQWDIUnY/QIkLpgDMWuKxP94c2NAC2LGcgVhG1ImF3jkZ5wXw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-dialog": "1.1.15",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-slot": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-arrow": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.7.tgz",
+ "integrity": "sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-aspect-ratio": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.1.7.tgz",
+ "integrity": "sha512-Yq6lvO9HQyPwev1onK1daHCHqXVLzPhSVjmsNjCa2Zcxy2f7uJD2itDtxknv6FzAKCwD1qQkeVDmX/cev13n/g==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-avatar": {
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.1.10.tgz",
+ "integrity": "sha512-V8piFfWapM5OmNCXTzVQY+E1rDa53zY+MQ4Y7356v4fFz6vqCyUtIz2rUD44ZEdwg78/jKmMJHj07+C/Z/rcog==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-is-hydrated": "0.1.0",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-checkbox": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.3.tgz",
+ "integrity": "sha512-wBbpv+NQftHDdG86Qc0pIyXk5IR3tM8Vd0nWLKDcX8nNn4nXFOFwsKuqw2okA/1D/mpaAkmuyndrPJTYDNZtFw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-previous": "1.1.1",
+ "@radix-ui/react-use-size": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-collapsible": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.12.tgz",
+ "integrity": "sha512-Uu+mSh4agx2ib1uIGPP4/CKNULyajb3p92LsVXmH2EHVMTfZWpll88XJ0j4W0z3f8NK1eYl1+Mf/szHPmcHzyA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-collection": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.7.tgz",
+ "integrity": "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-slot": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.2.tgz",
+ "integrity": "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-context": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.1.2.tgz",
+ "integrity": "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-context-menu": {
+ "version": "2.2.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context-menu/-/react-context-menu-2.2.16.tgz",
+ "integrity": "sha512-O8morBEW+HsVG28gYDZPTrT9UUovQUlJue5YO836tiTJhuIWBm/zQHc7j388sHWtdH/xUZurK9olD2+pcqx5ww==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-menu": "2.1.16",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dialog": {
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.15.tgz",
+ "integrity": "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-focus-guards": "1.1.3",
+ "@radix-ui/react-focus-scope": "1.1.7",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-slot": "1.2.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "aria-hidden": "^1.2.4",
+ "react-remove-scroll": "^2.6.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-direction": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.1.tgz",
+ "integrity": "sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dismissable-layer": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.11.tgz",
+ "integrity": "sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-escape-keydown": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dropdown-menu": {
+ "version": "2.1.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.16.tgz",
+ "integrity": "sha512-1PLGQEynI/3OX/ftV54COn+3Sud/Mn8vALg2rWnBLnRaGtJDduNW/22XjlGgPdpcIbiQxjKtb7BkcjP00nqfJw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-menu": "2.1.16",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-guards": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.3.tgz",
+ "integrity": "sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.7.tgz",
+ "integrity": "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-form": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.1.8.tgz",
+ "integrity": "sha512-QM70k4Zwjttifr5a4sZFts9fn8FzHYvQ5PiB19O2HsYibaHSVt9fH9rzB0XZo/YcM+b7t/p7lYCT/F5eOeF5yQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-label": "2.1.7",
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-hover-card": {
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.1.15.tgz",
+ "integrity": "sha512-qgTkjNT1CfKMoP0rcasmlH2r1DAiYicWsDsufxl940sT2wHNEWWv6FMWIQXWhVdmC1d/HYfbhQx60KYyAtKxjg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-popper": "1.2.8",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-id": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.1.1.tgz",
+ "integrity": "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-label": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.7.tgz",
+ "integrity": "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-menu": {
+ "version": "2.1.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.16.tgz",
+ "integrity": "sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-focus-guards": "1.1.3",
+ "@radix-ui/react-focus-scope": "1.1.7",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-popper": "1.2.8",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-slot": "1.2.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "aria-hidden": "^1.2.4",
+ "react-remove-scroll": "^2.6.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-menubar": {
+ "version": "1.1.16",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-menubar/-/react-menubar-1.1.16.tgz",
+ "integrity": "sha512-EB1FktTz5xRRi2Er974AUQZWg2yVBb1yjip38/lgwtCVRd3a+maUoGHN/xs9Yv8SY8QwbSEb+YrxGadVWbEutA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-menu": "2.1.16",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-navigation-menu": {
+ "version": "1.2.14",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.2.14.tgz",
+ "integrity": "sha512-YB9mTFQvCOAQMHU+C/jVl96WmuWeltyUEpRJJky51huhds5W2FQr1J8D/16sQlf0ozxkPK8uF3niQMdUwZPv5w==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1",
+ "@radix-ui/react-use-previous": "1.1.1",
+ "@radix-ui/react-visually-hidden": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-one-time-password-field": {
+ "version": "0.1.8",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.1.8.tgz",
+ "integrity": "sha512-ycS4rbwURavDPVjCb5iS3aG4lURFDILi6sKI/WITUMZ13gMmn/xGjpLoqBAalhJaDk8I3UbCM5GzKHrnzwHbvg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/number": "1.1.1",
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-effect-event": "0.0.2",
+ "@radix-ui/react-use-is-hydrated": "0.1.0",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-password-toggle-field": {
+ "version": "0.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.1.3.tgz",
+ "integrity": "sha512-/UuCrDBWravcaMix4TdT+qlNdVwOM1Nck9kWx/vafXsdfj1ChfhOdfi3cy9SGBpWgTXwYCuboT/oYpJy3clqfw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-effect-event": "0.0.2",
+ "@radix-ui/react-use-is-hydrated": "0.1.0"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popover": {
+ "version": "1.1.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.15.tgz",
+ "integrity": "sha512-kr0X2+6Yy/vJzLYJUPCZEc8SfQcf+1COFoAqauJm74umQhta9M7lNJHP7QQS3vkvcGLQUbWpMzwrXYwrYztHKA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-focus-guards": "1.1.3",
+ "@radix-ui/react-focus-scope": "1.1.7",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-popper": "1.2.8",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-slot": "1.2.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "aria-hidden": "^1.2.4",
+ "react-remove-scroll": "^2.6.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popper": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.8.tgz",
+ "integrity": "sha512-0NJQ4LFFUuWkE7Oxf0htBKS6zLkkjBH+hM1uk7Ng705ReR8m/uelduy1DBo0PyBXPKVnBA6YBlU94MBGXrSBCw==",
+ "license": "MIT",
+ "dependencies": {
+ "@floating-ui/react-dom": "^2.0.0",
+ "@radix-ui/react-arrow": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-layout-effect": "1.1.1",
+ "@radix-ui/react-use-rect": "1.1.1",
+ "@radix-ui/react-use-size": "1.1.1",
+ "@radix-ui/rect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-portal": {
+ "version": "1.1.9",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.9.tgz",
+ "integrity": "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-presence": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.5.tgz",
+ "integrity": "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-primitive": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.3.tgz",
+ "integrity": "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-slot": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-progress": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.7.tgz",
+ "integrity": "sha512-vPdg/tF6YC/ynuBIJlk1mm7Le0VgW6ub6J2UWnTQ7/D23KXcPI1qy+0vBkgKgd38RCMJavBXpB83HPNFMTb0Fg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-radio-group": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.3.8.tgz",
+ "integrity": "sha512-VBKYIYImA5zsxACdisNQ3BjCBfmbGH3kQlnFVqlWU4tXwjy7cGX8ta80BcrO+WJXIn5iBylEH3K6ZTlee//lgQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-previous": "1.1.1",
+ "@radix-ui/react-use-size": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-roving-focus": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.11.tgz",
+ "integrity": "sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-scroll-area": {
+ "version": "1.2.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.2.10.tgz",
+ "integrity": "sha512-tAXIa1g3sM5CGpVT0uIbUx/U3Gs5N8T52IICuCtObaos1S8fzsrPXG5WObkQN3S6NVl6wKgPhAIiBGbWnvc97A==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/number": "1.1.1",
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-select": {
+ "version": "2.2.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.2.6.tgz",
+ "integrity": "sha512-I30RydO+bnn2PQztvo25tswPH+wFBjehVGtmagkU78yMdwTwVf12wnAOF+AeP8S2N8xD+5UPbGhkUfPyvT+mwQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/number": "1.1.1",
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-focus-guards": "1.1.3",
+ "@radix-ui/react-focus-scope": "1.1.7",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-popper": "1.2.8",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-slot": "1.2.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1",
+ "@radix-ui/react-use-previous": "1.1.1",
+ "@radix-ui/react-visually-hidden": "1.2.3",
+ "aria-hidden": "^1.2.4",
+ "react-remove-scroll": "^2.6.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-separator": {
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.7.tgz",
+ "integrity": "sha512-0HEb8R9E8A+jZjvmFCy/J4xhbXy3TV+9XSnGJ3KvTtjlIUy/YQ/p6UYZvi7YbeoeXdyU9+Y3scizK6hkY37baA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-slider": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.3.6.tgz",
+ "integrity": "sha512-JPYb1GuM1bxfjMRlNLE+BcmBC8onfCi60Blk7OBqi2MLTFdS+8401U4uFjnwkOr49BLmXxLC6JHkvAsx5OJvHw==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/number": "1.1.1",
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1",
+ "@radix-ui/react-use-previous": "1.1.1",
+ "@radix-ui/react-use-size": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-slot": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.2.3.tgz",
+ "integrity": "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-compose-refs": "1.1.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-switch": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.2.6.tgz",
+ "integrity": "sha512-bByzr1+ep1zk4VubeEVViV592vu2lHE2BZY5OnzehZqOOgogN80+mNtCqPkhn2gklJqOpxWgPoYTSnhBCqpOXQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-previous": "1.1.1",
+ "@radix-ui/react-use-size": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-tabs": {
+ "version": "1.1.13",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.13.tgz",
+ "integrity": "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toast": {
+ "version": "1.2.15",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.2.15.tgz",
+ "integrity": "sha512-3OSz3TacUWy4WtOXV38DggwxoqJK4+eDkNMl5Z/MJZaoUPaP4/9lf81xXMe1I2ReTAptverZUpbPY4wWwWyL5g==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1",
+ "@radix-ui/react-visually-hidden": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toggle": {
+ "version": "1.1.10",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.10.tgz",
+ "integrity": "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toggle-group": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.1.11.tgz",
+ "integrity": "sha512-5umnS0T8JQzQT6HbPyO7Hh9dgd82NmS36DQr+X/YJ9ctFNCiiQd6IJAYYZ33LUwm8M+taCz5t2ui29fHZc4Y6Q==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-toggle": "1.1.10",
+ "@radix-ui/react-use-controllable-state": "1.2.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toolbar": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.1.11.tgz",
+ "integrity": "sha512-4ol06/1bLoFu1nwUqzdD4Y5RZ9oDdKeiHIsntug54Hcr1pgaHiPqHFEaXI1IFP/EsOfROQZ8Mig9VTIRza6Tjg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-separator": "1.1.7",
+ "@radix-ui/react-toggle-group": "1.1.11"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-tooltip": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.8.tgz",
+ "integrity": "sha512-tY7sVt1yL9ozIxvmbtN5qtmH2krXcBCfjEiCgKGLqunJHvgvZG2Pcl2oQ3kbcZARb1BGEHdkLzcYGO8ynVlieg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-id": "1.1.1",
+ "@radix-ui/react-popper": "1.2.8",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-slot": "1.2.3",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-visually-hidden": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-callback-ref": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.1.tgz",
+ "integrity": "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-controllable-state": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.2.tgz",
+ "integrity": "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-use-effect-event": "0.0.2",
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-effect-event": {
+ "version": "0.0.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-effect-event/-/react-use-effect-event-0.0.2.tgz",
+ "integrity": "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-escape-keydown": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.1.tgz",
+ "integrity": "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-use-callback-ref": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-is-hydrated": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-is-hydrated/-/react-use-is-hydrated-0.1.0.tgz",
+ "integrity": "sha512-U+UORVEq+cTnRIaostJv9AGdV3G6Y+zbVd+12e18jQ5A3c0xL03IhnHuiU4UV69wolOQp5GfR58NW/EgdQhwOA==",
+ "license": "MIT",
+ "dependencies": {
+ "use-sync-external-store": "^1.5.0"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-layout-effect": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.1.1.tgz",
+ "integrity": "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-previous": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.1.1.tgz",
+ "integrity": "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ==",
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-rect": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.1.1.tgz",
+ "integrity": "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/rect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-size": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.1.tgz",
+ "integrity": "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-use-layout-effect": "1.1.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-visually-hidden": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.3.tgz",
+ "integrity": "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/react-primitive": "2.1.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/rect": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.1.1.tgz",
+ "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==",
+ "license": "MIT"
+ },
+ "node_modules/@reduxjs/toolkit": {
+ "version": "2.11.2",
+ "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.11.2.tgz",
+ "integrity": "sha512-Kd6kAHTA6/nUpp8mySPqj3en3dm0tdMIgbttnQ1xFMVpufoj+ADi8pXLBsd4xzTRHQa7t/Jv8W5UnCuW4kuWMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@standard-schema/spec": "^1.0.0",
+ "@standard-schema/utils": "^0.3.0",
+ "immer": "^11.0.0",
+ "redux": "^5.0.1",
+ "redux-thunk": "^3.1.0",
+ "reselect": "^5.1.0"
+ },
+ "peerDependencies": {
+ "react": "^16.9.0 || ^17.0.0 || ^18 || ^19",
+ "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0"
+ },
+ "peerDependenciesMeta": {
+ "react": {
+ "optional": true
+ },
+ "react-redux": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@reduxjs/toolkit/node_modules/immer": {
+ "version": "11.1.4",
+ "resolved": "https://registry.npmjs.org/immer/-/immer-11.1.4.tgz",
+ "integrity": "sha512-XREFCPo6ksxVzP4E0ekD5aMdf8WMwmdNaz6vuvxgI40UaEiu6q3p8X52aU6GdyvLY3XXX/8R7JOTXStz/nBbRw==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/immer"
+ }
+ },
+ "node_modules/@rolldown/pluginutils": {
+ "version": "1.0.0-rc.3",
+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz",
+ "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@rollup/rollup-android-arm-eabi": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.59.0.tgz",
+ "integrity": "sha512-upnNBkA6ZH2VKGcBj9Fyl9IGNPULcjXRlg0LLeaioQWueH30p6IXtJEbKAgvyv+mJaMxSm1l6xwDXYjpEMiLMg==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-android-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.59.0.tgz",
+ "integrity": "sha512-hZ+Zxj3SySm4A/DylsDKZAeVg0mvi++0PYVceVyX7hemkw7OreKdCvW2oQ3T1FMZvCaQXqOTHb8qmBShoqk69Q==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.59.0.tgz",
+ "integrity": "sha512-W2Psnbh1J8ZJw0xKAd8zdNgF9HRLkdWwwdWqubSVk0pUuQkoHnv7rx4GiF9rT4t5DIZGAsConRE3AxCdJ4m8rg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-darwin-x64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz",
+ "integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.59.0.tgz",
+ "integrity": "sha512-EsKaJ5ytAu9jI3lonzn3BgG8iRBjV4LxZexygcQbpiU0wU0ATxhNVEpXKfUa0pS05gTcSDMKpn3Sx+QB9RlTTA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-freebsd-x64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.59.0.tgz",
+ "integrity": "sha512-d3DuZi2KzTMjImrxoHIAODUZYoUUMsuUiY4SRRcJy6NJoZ6iIqWnJu9IScV9jXysyGMVuW+KNzZvBLOcpdl3Vg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.59.0.tgz",
+ "integrity": "sha512-t4ONHboXi/3E0rT6OZl1pKbl2Vgxf9vJfWgmUoCEVQVxhW6Cw/c8I6hbbu7DAvgp82RKiH7TpLwxnJeKv2pbsw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm-musleabihf": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.59.0.tgz",
+ "integrity": "sha512-CikFT7aYPA2ufMD086cVORBYGHffBo4K8MQ4uPS/ZnY54GKj36i196u8U+aDVT2LX4eSMbyHtyOh7D7Zvk2VvA==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.59.0.tgz",
+ "integrity": "sha512-jYgUGk5aLd1nUb1CtQ8E+t5JhLc9x5WdBKew9ZgAXg7DBk0ZHErLHdXM24rfX+bKrFe+Xp5YuJo54I5HFjGDAA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-arm64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.59.0.tgz",
+ "integrity": "sha512-peZRVEdnFWZ5Bh2KeumKG9ty7aCXzzEsHShOZEFiCQlDEepP1dpUl/SrUNXNg13UmZl+gzVDPsiCwnV1uI0RUA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.59.0.tgz",
+ "integrity": "sha512-gbUSW/97f7+r4gHy3Jlup8zDG190AuodsWnNiXErp9mT90iCy9NKKU0Xwx5k8VlRAIV2uU9CsMnEFg/xXaOfXg==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-loong64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.59.0.tgz",
+ "integrity": "sha512-yTRONe79E+o0FWFijasoTjtzG9EBedFXJMl888NBEDCDV9I2wGbFFfJQQe63OijbFCUZqxpHz1GzpbtSFikJ4Q==",
+ "cpu": [
+ "loong64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.59.0.tgz",
+ "integrity": "sha512-sw1o3tfyk12k3OEpRddF68a1unZ5VCN7zoTNtSn2KndUE+ea3m3ROOKRCZxEpmT9nsGnogpFP9x6mnLTCaoLkA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-ppc64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.59.0.tgz",
+ "integrity": "sha512-+2kLtQ4xT3AiIxkzFVFXfsmlZiG5FXYW7ZyIIvGA7Bdeuh9Z0aN4hVyXS/G1E9bTP/vqszNIN/pUKCk/BTHsKA==",
+ "cpu": [
+ "ppc64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.59.0.tgz",
+ "integrity": "sha512-NDYMpsXYJJaj+I7UdwIuHHNxXZ/b/N2hR15NyH3m2qAtb/hHPA4g4SuuvrdxetTdndfj9b1WOmy73kcPRoERUg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-riscv64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.59.0.tgz",
+ "integrity": "sha512-nLckB8WOqHIf1bhymk+oHxvM9D3tyPndZH8i8+35p/1YiVoVswPid2yLzgX7ZJP0KQvnkhM4H6QZ5m0LzbyIAg==",
+ "cpu": [
+ "riscv64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-s390x-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.59.0.tgz",
+ "integrity": "sha512-oF87Ie3uAIvORFBpwnCvUzdeYUqi2wY6jRFWJAy1qus/udHFYIkplYRW+wo+GRUP4sKzYdmE1Y3+rY5Gc4ZO+w==",
+ "cpu": [
+ "s390x"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.59.0.tgz",
+ "integrity": "sha512-3AHmtQq/ppNuUspKAlvA8HtLybkDflkMuLK4DPo77DfthRb71V84/c4MlWJXixZz4uruIH4uaa07IqoAkG64fg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-linux-x64-musl": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.59.0.tgz",
+ "integrity": "sha512-2UdiwS/9cTAx7qIUZB/fWtToJwvt0Vbo0zmnYt7ED35KPg13Q0ym1g442THLC7VyI6JfYTP4PiSOWyoMdV2/xg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
+ "node_modules/@rollup/rollup-openbsd-x64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.59.0.tgz",
+ "integrity": "sha512-M3bLRAVk6GOwFlPTIxVBSYKUaqfLrn8l0psKinkCFxl4lQvOSz8ZrKDz2gxcBwHFpci0B6rttydI4IpS4IS/jQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openbsd"
+ ]
+ },
+ "node_modules/@rollup/rollup-openharmony-arm64": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.59.0.tgz",
+ "integrity": "sha512-tt9KBJqaqp5i5HUZzoafHZX8b5Q2Fe7UjYERADll83O4fGqJ49O1FsL6LpdzVFQcpwvnyd0i+K/VSwu/o/nWlA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "openharmony"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-arm64-msvc": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.59.0.tgz",
+ "integrity": "sha512-V5B6mG7OrGTwnxaNUzZTDTjDS7F75PO1ae6MJYdiMu60sq0CqN5CVeVsbhPxalupvTX8gXVSU9gq+Rx1/hvu6A==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-ia32-msvc": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.59.0.tgz",
+ "integrity": "sha512-UKFMHPuM9R0iBegwzKF4y0C4J9u8C6MEJgFuXTBerMk7EJ92GFVFYBfOZaSGLu6COf7FxpQNqhNS4c4icUPqxA==",
+ "cpu": [
+ "ia32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-gnu": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.59.0.tgz",
+ "integrity": "sha512-laBkYlSS1n2L8fSo1thDNGrCTQMmxjYY5G0WFWjFFYZkKPjsMBsgJfGf4TLxXrF6RyhI60L8TMOjBMvXiTcxeA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@rollup/rollup-win32-x64-msvc": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.59.0.tgz",
+ "integrity": "sha512-2HRCml6OztYXyJXAvdDXPKcawukWY2GpR5/nxKp4iBgiO3wcoEGkAaqctIbZcNB6KlUQBIqt8VYkNSj2397EfA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ]
+ },
+ "node_modules/@sec-ant/readable-stream": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz",
+ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@sindresorhus/merge-streams": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz",
+ "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@standard-schema/spec": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
+ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==",
+ "license": "MIT"
+ },
+ "node_modules/@standard-schema/utils": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz",
+ "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==",
+ "license": "MIT"
+ },
+ "node_modules/@tailwindcss/node": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.1.tgz",
+ "integrity": "sha512-jlx6sLk4EOwO6hHe1oCGm1Q4AN/s0rSrTTPBGPM0/RQ6Uylwq17FuU8IeJJKEjtc6K6O07zsvP+gDO6MMWo7pg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/remapping": "^2.3.5",
+ "enhanced-resolve": "^5.19.0",
+ "jiti": "^2.6.1",
+ "lightningcss": "1.31.1",
+ "magic-string": "^0.30.21",
+ "source-map-js": "^1.2.1",
+ "tailwindcss": "4.2.1"
+ }
+ },
+ "node_modules/@tailwindcss/oxide": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.1.tgz",
+ "integrity": "sha512-yv9jeEFWnjKCI6/T3Oq50yQEOqmpmpfzG1hcZsAOaXFQPfzWprWrlHSdGPEF3WQTi8zu8ohC9Mh9J470nT5pUw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20"
+ },
+ "optionalDependencies": {
+ "@tailwindcss/oxide-android-arm64": "4.2.1",
+ "@tailwindcss/oxide-darwin-arm64": "4.2.1",
+ "@tailwindcss/oxide-darwin-x64": "4.2.1",
+ "@tailwindcss/oxide-freebsd-x64": "4.2.1",
+ "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.1",
+ "@tailwindcss/oxide-linux-arm64-gnu": "4.2.1",
+ "@tailwindcss/oxide-linux-arm64-musl": "4.2.1",
+ "@tailwindcss/oxide-linux-x64-gnu": "4.2.1",
+ "@tailwindcss/oxide-linux-x64-musl": "4.2.1",
+ "@tailwindcss/oxide-wasm32-wasi": "4.2.1",
+ "@tailwindcss/oxide-win32-arm64-msvc": "4.2.1",
+ "@tailwindcss/oxide-win32-x64-msvc": "4.2.1"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-android-arm64": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.1.tgz",
+ "integrity": "sha512-eZ7G1Zm5EC8OOKaesIKuw77jw++QJ2lL9N+dDpdQiAB/c/B2wDh0QPFHbkBVrXnwNugvrbJFk1gK2SsVjwWReg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-darwin-arm64": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.1.tgz",
+ "integrity": "sha512-q/LHkOstoJ7pI1J0q6djesLzRvQSIfEto148ppAd+BVQK0JYjQIFSK3JgYZJa+Yzi0DDa52ZsQx2rqytBnf8Hw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-darwin-x64": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.1.tgz",
+ "integrity": "sha512-/f/ozlaXGY6QLbpvd/kFTro2l18f7dHKpB+ieXz+Cijl4Mt9AI2rTrpq7V+t04nK+j9XBQHnSMdeQRhbGyt6fw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-freebsd-x64": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.1.tgz",
+ "integrity": "sha512-5e/AkgYJT/cpbkys/OU2Ei2jdETCLlifwm7ogMC7/hksI2fC3iiq6OcXwjibcIjPung0kRtR3TxEITkqgn0TcA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.1.tgz",
+ "integrity": "sha512-Uny1EcVTTmerCKt/1ZuKTkb0x8ZaiuYucg2/kImO5A5Y/kBz41/+j0gxUZl+hTF3xkWpDmHX+TaWhOtba2Fyuw==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm64-gnu": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.1.tgz",
+ "integrity": "sha512-CTrwomI+c7n6aSSQlsPL0roRiNMDQ/YzMD9EjcR+H4f0I1SQ8QqIuPnsVp7QgMkC1Qi8rtkekLkOFjo7OlEFRQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-arm64-musl": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.1.tgz",
+ "integrity": "sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-x64-gnu": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.1.tgz",
+ "integrity": "sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-linux-x64-musl": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.1.tgz",
+ "integrity": "sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-wasm32-wasi": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.1.tgz",
+ "integrity": "sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q==",
+ "bundleDependencies": [
+ "@napi-rs/wasm-runtime",
+ "@emnapi/core",
+ "@emnapi/runtime",
+ "@tybys/wasm-util",
+ "@emnapi/wasi-threads",
+ "tslib"
+ ],
+ "cpu": [
+ "wasm32"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "dependencies": {
+ "@emnapi/core": "^1.8.1",
+ "@emnapi/runtime": "^1.8.1",
+ "@emnapi/wasi-threads": "^1.1.0",
+ "@napi-rs/wasm-runtime": "^1.1.1",
+ "@tybys/wasm-util": "^0.10.1",
+ "tslib": "^2.8.1"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-win32-arm64-msvc": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.1.tgz",
+ "integrity": "sha512-YlUEHRHBGnCMh4Nj4GnqQyBtsshUPdiNroZj8VPkvTZSoHsilRCwXcVKnG9kyi0ZFAS/3u+qKHBdDc81SADTRA==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/oxide-win32-x64-msvc": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.1.tgz",
+ "integrity": "sha512-rbO34G5sMWWyrN/idLeVxAZgAKWrn5LiR3/I90Q9MkA67s6T1oB0xtTe+0heoBvHSpbU9Mk7i6uwJnpo4u21XQ==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 20"
+ }
+ },
+ "node_modules/@tailwindcss/vite": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.1.tgz",
+ "integrity": "sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@tailwindcss/node": "4.2.1",
+ "@tailwindcss/oxide": "4.2.1",
+ "tailwindcss": "4.2.1"
+ },
+ "peerDependencies": {
+ "vite": "^5.2.0 || ^6 || ^7"
+ }
+ },
+ "node_modules/@tanstack/query-core": {
+ "version": "5.90.20",
+ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.20.tgz",
+ "integrity": "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ }
+ },
+ "node_modules/@tanstack/react-query": {
+ "version": "5.90.21",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.21.tgz",
+ "integrity": "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg==",
+ "license": "MIT",
+ "dependencies": {
+ "@tanstack/query-core": "5.90.20"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "react": "^18 || ^19"
+ }
+ },
+ "node_modules/@ts-morph/common": {
+ "version": "0.27.0",
+ "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.27.0.tgz",
+ "integrity": "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-glob": "^3.3.3",
+ "minimatch": "^10.0.1",
+ "path-browserify": "^1.0.1"
+ }
+ },
+ "node_modules/@ts-morph/common/node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/@ts-morph/common/node_modules/brace-expansion": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",
+ "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/@ts-morph/common/node_modules/minimatch": {
+ "version": "10.2.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.3.tgz",
+ "integrity": "sha512-Rwi3pnapEqirPSbWbrZaa6N3nmqq4Xer/2XooiOKyV3q12ML06f7MOuc5DVH8ONZIFhwIYQ3yzPH4nt7iWHaTg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "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/d3-array": {
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",
+ "integrity": "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-color": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz",
+ "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-ease": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz",
+ "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-interpolate": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz",
+ "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-color": "*"
+ }
+ },
+ "node_modules/@types/d3-path": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz",
+ "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-scale": {
+ "version": "4.0.9",
+ "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz",
+ "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-time": "*"
+ }
+ },
+ "node_modules/@types/d3-shape": {
+ "version": "3.1.8",
+ "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.8.tgz",
+ "integrity": "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/d3-path": "*"
+ }
+ },
+ "node_modules/@types/d3-time": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz",
+ "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==",
+ "license": "MIT"
+ },
+ "node_modules/@types/d3-timer": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz",
+ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==",
+ "license": "MIT"
+ },
+ "node_modules/@types/estree": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
+ "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/json-schema": {
+ "version": "7.0.15",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
+ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/node": {
+ "version": "24.10.13",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.13.tgz",
+ "integrity": "sha512-oH72nZRfDv9lADUBSo104Aq7gPHpQZc4BTx38r9xf9pg5LfP6EzSyH2n7qFmmxRQXh7YlUXODcYsg6PuTDSxGg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~7.16.0"
+ }
+ },
+ "node_modules/@types/react": {
+ "version": "19.2.14",
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.14.tgz",
+ "integrity": "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==",
+ "devOptional": true,
+ "license": "MIT",
+ "dependencies": {
+ "csstype": "^3.2.2"
+ }
+ },
+ "node_modules/@types/react-dom": {
+ "version": "19.2.3",
+ "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.3.tgz",
+ "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==",
+ "devOptional": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "@types/react": "^19.2.0"
+ }
+ },
+ "node_modules/@types/statuses": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@types/statuses/-/statuses-2.0.6.tgz",
+ "integrity": "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@types/use-sync-external-store": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
+ "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
+ "license": "MIT"
+ },
+ "node_modules/@types/validate-npm-package-name": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/@types/validate-npm-package-name/-/validate-npm-package-name-4.0.2.tgz",
+ "integrity": "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@typescript-eslint/eslint-plugin": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.1.tgz",
+ "integrity": "sha512-Jz9ZztpB37dNC+HU2HI28Bs9QXpzCz+y/twHOwhyrIRdbuVDxSytJNDl6z/aAKlaRIwC7y8wJdkBv7FxYGgi0A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/regexpp": "^4.12.2",
+ "@typescript-eslint/scope-manager": "8.56.1",
+ "@typescript-eslint/type-utils": "8.56.1",
+ "@typescript-eslint/utils": "8.56.1",
+ "@typescript-eslint/visitor-keys": "8.56.1",
+ "ignore": "^7.0.5",
+ "natural-compare": "^1.4.0",
+ "ts-api-utils": "^2.4.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "@typescript-eslint/parser": "^8.56.1",
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
+ "version": "7.0.5",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
+ "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/@typescript-eslint/parser": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.56.1.tgz",
+ "integrity": "sha512-klQbnPAAiGYFyI02+znpBRLyjL4/BrBd0nyWkdC0s/6xFLkXYQ8OoRrSkqacS1ddVxf/LDyODIKbQ5TgKAf/Fg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/scope-manager": "8.56.1",
+ "@typescript-eslint/types": "8.56.1",
+ "@typescript-eslint/typescript-estree": "8.56.1",
+ "@typescript-eslint/visitor-keys": "8.56.1",
+ "debug": "^4.4.3"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/project-service": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.56.1.tgz",
+ "integrity": "sha512-TAdqQTzHNNvlVFfR+hu2PDJrURiwKsUvxFn1M0h95BB8ah5jejas08jUWG4dBA68jDMI988IvtfdAI53JzEHOQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/tsconfig-utils": "^8.56.1",
+ "@typescript-eslint/types": "^8.56.1",
+ "debug": "^4.4.3"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/scope-manager": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.56.1.tgz",
+ "integrity": "sha512-YAi4VDKcIZp0O4tz/haYKhmIDZFEUPOreKbfdAN3SzUDMcPhJ8QI99xQXqX+HoUVq8cs85eRKnD+rne2UAnj2w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.56.1",
+ "@typescript-eslint/visitor-keys": "8.56.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/tsconfig-utils": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.1.tgz",
+ "integrity": "sha512-qOtCYzKEeyr3aR9f28mPJqBty7+DBqsdd63eO0yyDwc6vgThj2UjWfJIcsFeSucYydqcuudMOprZ+x1SpF3ZuQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/type-utils": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.56.1.tgz",
+ "integrity": "sha512-yB/7dxi7MgTtGhZdaHCemf7PuwrHMenHjmzgUW1aJpO+bBU43OycnM3Wn+DdvDO/8zzA9HlhaJ0AUGuvri4oGg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.56.1",
+ "@typescript-eslint/typescript-estree": "8.56.1",
+ "@typescript-eslint/utils": "8.56.1",
+ "debug": "^4.4.3",
+ "ts-api-utils": "^2.4.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/types": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.56.1.tgz",
+ "integrity": "sha512-dbMkdIUkIkchgGDIv7KLUpa0Mda4IYjo4IAMJUZ+3xNoUXxMsk9YtKpTHSChRS85o+H9ftm51gsK1dZReY9CVw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.1.tgz",
+ "integrity": "sha512-qzUL1qgalIvKWAf9C1HpvBjif+Vm6rcT5wZd4VoMb9+Km3iS3Cv9DY6dMRMDtPnwRAFyAi7YXJpTIEXLvdfPxg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/project-service": "8.56.1",
+ "@typescript-eslint/tsconfig-utils": "8.56.1",
+ "@typescript-eslint/types": "8.56.1",
+ "@typescript-eslint/visitor-keys": "8.56.1",
+ "debug": "^4.4.3",
+ "minimatch": "^10.2.2",
+ "semver": "^7.7.3",
+ "tinyglobby": "^0.2.15",
+ "ts-api-utils": "^2.4.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {
+ "version": "4.0.4",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
+ "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.3.tgz",
+ "integrity": "sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^4.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
+ "version": "10.2.3",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.3.tgz",
+ "integrity": "sha512-Rwi3pnapEqirPSbWbrZaa6N3nmqq4Xer/2XooiOKyV3q12ML06f7MOuc5DVH8ONZIFhwIYQ3yzPH4nt7iWHaTg==",
+ "dev": true,
+ "license": "BlueOak-1.0.0",
+ "dependencies": {
+ "brace-expansion": "^5.0.2"
+ },
+ "engines": {
+ "node": "18 || 20 || >=22"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
+ "version": "7.7.4",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
+ "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
+ "dev": true,
+ "license": "ISC",
+ "bin": {
+ "semver": "bin/semver.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@typescript-eslint/utils": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.56.1.tgz",
+ "integrity": "sha512-HPAVNIME3tABJ61siYlHzSWCGtOoeP2RTIaHXFMPqjrQKCGB9OgUVdiNgH7TJS2JNIQ5qQ4RsAUDuGaGme/KOA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.9.1",
+ "@typescript-eslint/scope-manager": "8.56.1",
+ "@typescript-eslint/types": "8.56.1",
+ "@typescript-eslint/typescript-estree": "8.56.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.1.tgz",
+ "integrity": "sha512-KiROIzYdEV85YygXw6BI/Dx4fnBlFQu6Mq4QE4MOH9fFnhohw6wX/OAvDY2/C+ut0I3RSPKenvZJIVYqJNkhEw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/types": "8.56.1",
+ "eslint-visitor-keys": "^5.0.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ }
+ },
+ "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
+ "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^20.19.0 || ^22.13.0 || >=24"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/@vitejs/plugin-react": {
+ "version": "5.1.4",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz",
+ "integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.29.0",
+ "@babel/plugin-transform-react-jsx-self": "^7.27.1",
+ "@babel/plugin-transform-react-jsx-source": "^7.27.1",
+ "@rolldown/pluginutils": "1.0.0-rc.3",
+ "@types/babel__core": "^7.20.5",
+ "react-refresh": "^0.18.0"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "peerDependencies": {
+ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
+ }
+ },
+ "node_modules/accepts": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-types": "^3.0.0",
+ "negotiator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/accepts/node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/accepts/node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/acorn": {
+ "version": "8.16.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz",
+ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "acorn": "bin/acorn"
+ },
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/acorn-jsx": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ }
+ },
+ "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/ajv": {
+ "version": "6.14.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz",
+ "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-formats": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ajv-formats/node_modules/ajv": {
+ "version": "8.18.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.18.0.tgz",
+ "integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-formats/node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/ansis": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/ansis/-/ansis-4.2.0.tgz",
+ "integrity": "sha512-HqZ5rWlFjGiV0tDm3UxxgNRqsOTniqoKZu0pIAfh7TZQMGuZK+hH0drySty0si0QXj1ieop4+SkSfPZBPPkHig==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true,
+ "license": "Python-2.0"
+ },
+ "node_modules/aria-hidden": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz",
+ "integrity": "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA==",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/ast-types": {
+ "version": "0.16.1",
+ "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.1.tgz",
+ "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+ "license": "MIT"
+ },
+ "node_modules/axios": {
+ "version": "1.13.5",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.5.tgz",
+ "integrity": "sha512-cz4ur7Vb0xS4/KUN0tPWe44eqxrIu31me+fbang3ijiNscE129POzipJJA6zniq2C/Z6sJCjMimjS8Lc/GAs8Q==",
+ "license": "MIT",
+ "dependencies": {
+ "follow-redirects": "^1.15.11",
+ "form-data": "^4.0.5",
+ "proxy-from-env": "^1.1.0"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/baseline-browser-mapping": {
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz",
+ "integrity": "sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "baseline-browser-mapping": "dist/cli.cjs"
+ },
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/belter": {
+ "version": "1.0.190",
+ "resolved": "https://registry.npmjs.org/belter/-/belter-1.0.190.tgz",
+ "integrity": "sha512-jz05FHrO+bwitdI6JxV5ESyRdVhTcwMWQ7L4o+q/R4LNJFQrG58sp9EiwsSjhbihhiyYFcmmCMRRagxte6igtw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "cross-domain-safe-weakmap": "^1",
+ "cross-domain-utils": "^2",
+ "zalgo-promise": "^1"
+ }
+ },
+ "node_modules/body-parser": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz",
+ "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^1.0.5",
+ "debug": "^4.4.3",
+ "http-errors": "^2.0.0",
+ "iconv-lite": "^0.7.0",
+ "on-finished": "^2.4.1",
+ "qs": "^6.14.1",
+ "raw-body": "^3.0.1",
+ "type-is": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.12",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fill-range": "^7.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/browserslist": {
+ "version": "4.28.1",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
+ "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
+ "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.9.0",
+ "caniuse-lite": "^1.0.30001759",
+ "electron-to-chromium": "^1.5.263",
+ "node-releases": "^2.0.27",
+ "update-browserslist-db": "^1.2.0"
+ },
+ "bin": {
+ "browserslist": "cli.js"
+ },
+ "engines": {
+ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ }
+ },
+ "node_modules/bundle-name": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
+ "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "run-applescript": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.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==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/callsites": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/caniuse-lite": {
+ "version": "1.0.30001774",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001774.tgz",
+ "integrity": "sha512-DDdwPGz99nmIEv216hKSgLD+D4ikHQHjBC/seF98N9CPqRX4M5mSxT9eTV6oyisnJcuzxtZy4n17yKKQYmYQOA==",
+ "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/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/class-variance-authority": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz",
+ "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "clsx": "^2.1.1"
+ },
+ "funding": {
+ "url": "https://polar.sh/cva"
+ }
+ },
+ "node_modules/cli-cursor": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "2.9.2",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz",
+ "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-width": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz",
+ "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/cliui": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/cliui/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",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cliui/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/cliui/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cliui/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/cliui/node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/clsx": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
+ "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/code-block-writer": {
+ "version": "13.0.3",
+ "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz",
+ "integrity": "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "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==",
+ "license": "MIT",
+ "dependencies": {
+ "delayed-stream": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/content-disposition": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz",
+ "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "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/cookie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.6.0"
+ }
+ },
+ "node_modules/cors": {
+ "version": "2.8.6",
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "object-assign": "^4",
+ "vary": "^1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/cosmiconfig": {
+ "version": "9.0.0",
+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz",
+ "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "env-paths": "^2.2.1",
+ "import-fresh": "^3.3.0",
+ "js-yaml": "^4.1.0",
+ "parse-json": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/d-fischer"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.9.5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/cross-domain-safe-weakmap": {
+ "version": "1.0.29",
+ "resolved": "https://registry.npmjs.org/cross-domain-safe-weakmap/-/cross-domain-safe-weakmap-1.0.29.tgz",
+ "integrity": "sha512-VLoUgf2SXnf3+na8NfeUFV59TRZkIJqCIATaMdbhccgtnTlSnHXkyTRwokngEGYdQXx8JbHT9GDYitgR2sdjuA==",
+ "dependencies": {
+ "cross-domain-utils": "^2.0.0"
+ }
+ },
+ "node_modules/cross-domain-utils": {
+ "version": "2.0.38",
+ "resolved": "https://registry.npmjs.org/cross-domain-utils/-/cross-domain-utils-2.0.38.tgz",
+ "integrity": "sha512-zZfi3+2EIR9l4chrEiXI2xFleyacsJf8YMLR1eJ0Veb5FTMXeJ3DpxDjZkto2FhL/g717WSELqbptNSo85UJDw==",
+ "dependencies": {
+ "zalgo-promise": "^1.0.11"
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/cssesc": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
+ "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "cssesc": "bin/cssesc"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "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==",
+ "devOptional": true,
+ "license": "MIT"
+ },
+ "node_modules/d3-array": {
+ "version": "3.2.4",
+ "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
+ "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
+ "license": "ISC",
+ "dependencies": {
+ "internmap": "1 - 2"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-color": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
+ "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-ease": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
+ "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-format": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
+ "integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-interpolate": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
+ "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-color": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-path": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
+ "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-scale": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
+ "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "2.10.0 - 3",
+ "d3-format": "1 - 3",
+ "d3-interpolate": "1.2.0 - 3",
+ "d3-time": "2.1.1 - 3",
+ "d3-time-format": "2 - 4"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-shape": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
+ "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-path": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-time": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
+ "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-array": "2 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-time-format": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
+ "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
+ "license": "ISC",
+ "dependencies": {
+ "d3-time": "1 - 3"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/d3-timer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
+ "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/data-uri-to-buffer": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
+ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/date-fns": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz",
+ "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/kossnocorp"
+ }
+ },
+ "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-light": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz",
+ "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==",
+ "license": "MIT"
+ },
+ "node_modules/dedent": {
+ "version": "1.7.1",
+ "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.1.tgz",
+ "integrity": "sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "babel-plugin-macros": "^3.1.0"
+ },
+ "peerDependenciesMeta": {
+ "babel-plugin-macros": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/deep-is": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/deepmerge": {
+ "version": "4.3.1",
+ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
+ "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/default-browser": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz",
+ "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bundle-name": "^4.1.0",
+ "default-browser-id": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/default-browser-id": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz",
+ "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/define-lazy-prop": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz",
+ "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.4.0"
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/detect-libc": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/detect-node-es": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz",
+ "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==",
+ "license": "MIT"
+ },
+ "node_modules/diff": {
+ "version": "8.0.3",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.3.tgz",
+ "integrity": "sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/dotenv": {
+ "version": "17.3.1",
+ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz",
+ "integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://dotenvx.com"
+ }
+ },
+ "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==",
+ "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/eciesjs": {
+ "version": "0.4.17",
+ "resolved": "https://registry.npmjs.org/eciesjs/-/eciesjs-0.4.17.tgz",
+ "integrity": "sha512-TOOURki4G7sD1wDCjj7NfLaXZZ49dFOeEb5y39IXpb8p0hRzVvfvzZHOi5JcT+PpyAbi/Y+lxPb8eTag2WYH8w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@ecies/ciphers": "^0.2.5",
+ "@noble/ciphers": "^1.3.0",
+ "@noble/curves": "^1.9.7",
+ "@noble/hashes": "^1.8.0"
+ },
+ "engines": {
+ "bun": ">=1",
+ "deno": ">=2",
+ "node": ">=16"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/electron-to-chromium": {
+ "version": "1.5.302",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz",
+ "integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/emoji-regex": {
+ "version": "10.6.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
+ "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/enhanced-resolve": {
+ "version": "5.19.0",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.19.0.tgz",
+ "integrity": "sha512-phv3E1Xl4tQOShqSte26C7Fl84EwUdZsyOuSSk9qtAGyyQs2s3jJzComh+Abf4g187lUUAvH+H26omrqia2aGg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.4",
+ "tapable": "^2.3.0"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/env-paths": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
+ "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/error-ex": {
+ "version": "1.3.4",
+ "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz",
+ "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-arrayish": "^0.2.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==",
+ "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==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "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==",
+ "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/es-toolkit": {
+ "version": "1.44.0",
+ "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.44.0.tgz",
+ "integrity": "sha512-6penXeZalaV88MM3cGkFZZfOoLGWshWWfdy0tWw/RlVVyhvMaWSBTOvXNeiW3e5FwdS5ePW0LGEu17zT139ktg==",
+ "license": "MIT",
+ "workspaces": [
+ "docs",
+ "benchmarks"
+ ]
+ },
+ "node_modules/esbuild": {
+ "version": "0.27.3",
+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz",
+ "integrity": "sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "bin": {
+ "esbuild": "bin/esbuild"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "@esbuild/aix-ppc64": "0.27.3",
+ "@esbuild/android-arm": "0.27.3",
+ "@esbuild/android-arm64": "0.27.3",
+ "@esbuild/android-x64": "0.27.3",
+ "@esbuild/darwin-arm64": "0.27.3",
+ "@esbuild/darwin-x64": "0.27.3",
+ "@esbuild/freebsd-arm64": "0.27.3",
+ "@esbuild/freebsd-x64": "0.27.3",
+ "@esbuild/linux-arm": "0.27.3",
+ "@esbuild/linux-arm64": "0.27.3",
+ "@esbuild/linux-ia32": "0.27.3",
+ "@esbuild/linux-loong64": "0.27.3",
+ "@esbuild/linux-mips64el": "0.27.3",
+ "@esbuild/linux-ppc64": "0.27.3",
+ "@esbuild/linux-riscv64": "0.27.3",
+ "@esbuild/linux-s390x": "0.27.3",
+ "@esbuild/linux-x64": "0.27.3",
+ "@esbuild/netbsd-arm64": "0.27.3",
+ "@esbuild/netbsd-x64": "0.27.3",
+ "@esbuild/openbsd-arm64": "0.27.3",
+ "@esbuild/openbsd-x64": "0.27.3",
+ "@esbuild/openharmony-arm64": "0.27.3",
+ "@esbuild/sunos-x64": "0.27.3",
+ "@esbuild/win32-arm64": "0.27.3",
+ "@esbuild/win32-ia32": "0.27.3",
+ "@esbuild/win32-x64": "0.27.3"
+ }
+ },
+ "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/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/eslint": {
+ "version": "9.39.3",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.3.tgz",
+ "integrity": "sha512-VmQ+sifHUbI/IcSopBCF/HO3YiHQx/AVd3UVyYL6weuwW+HvON9VYn5l6Zl1WZzPWXPNZrSQpxwkkZ/VuvJZzg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@eslint-community/eslint-utils": "^4.8.0",
+ "@eslint-community/regexpp": "^4.12.1",
+ "@eslint/config-array": "^0.21.1",
+ "@eslint/config-helpers": "^0.4.2",
+ "@eslint/core": "^0.17.0",
+ "@eslint/eslintrc": "^3.3.1",
+ "@eslint/js": "9.39.3",
+ "@eslint/plugin-kit": "^0.4.1",
+ "@humanfs/node": "^0.16.6",
+ "@humanwhocodes/module-importer": "^1.0.1",
+ "@humanwhocodes/retry": "^0.4.2",
+ "@types/estree": "^1.0.6",
+ "ajv": "^6.12.4",
+ "chalk": "^4.0.0",
+ "cross-spawn": "^7.0.6",
+ "debug": "^4.3.2",
+ "escape-string-regexp": "^4.0.0",
+ "eslint-scope": "^8.4.0",
+ "eslint-visitor-keys": "^4.2.1",
+ "espree": "^10.4.0",
+ "esquery": "^1.5.0",
+ "esutils": "^2.0.2",
+ "fast-deep-equal": "^3.1.3",
+ "file-entry-cache": "^8.0.0",
+ "find-up": "^5.0.0",
+ "glob-parent": "^6.0.2",
+ "ignore": "^5.2.0",
+ "imurmurhash": "^0.1.4",
+ "is-glob": "^4.0.0",
+ "json-stable-stringify-without-jsonify": "^1.0.1",
+ "lodash.merge": "^4.6.2",
+ "minimatch": "^3.1.2",
+ "natural-compare": "^1.4.0",
+ "optionator": "^0.9.3"
+ },
+ "bin": {
+ "eslint": "bin/eslint.js"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://eslint.org/donate"
+ },
+ "peerDependencies": {
+ "jiti": "*"
+ },
+ "peerDependenciesMeta": {
+ "jiti": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/eslint-plugin-react-hooks": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz",
+ "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.24.4",
+ "@babel/parser": "^7.24.4",
+ "hermes-parser": "^0.25.1",
+ "zod": "^3.25.0 || ^4.0.0",
+ "zod-validation-error": "^3.5.0 || ^4.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"
+ }
+ },
+ "node_modules/eslint-plugin-react-refresh": {
+ "version": "0.4.26",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.4.26.tgz",
+ "integrity": "sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==",
+ "dev": true,
+ "license": "MIT",
+ "peerDependencies": {
+ "eslint": ">=8.40"
+ }
+ },
+ "node_modules/eslint-scope": {
+ "version": "8.4.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "esrecurse": "^4.3.0",
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/espree": {
+ "version": "10.4.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",
+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "acorn": "^8.15.0",
+ "acorn-jsx": "^5.3.2",
+ "eslint-visitor-keys": "^4.2.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "url": "https://opencollective.com/eslint"
+ }
+ },
+ "node_modules/esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/esquery": {
+ "version": "1.7.0",
+ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
+ "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "estraverse": "^5.1.0"
+ },
+ "engines": {
+ "node": ">=0.10"
+ }
+ },
+ "node_modules/esrecurse": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "estraverse": "^5.2.0"
+ },
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/estraverse": {
+ "version": "5.3.0",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=4.0"
+ }
+ },
+ "node_modules/esutils": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/eventemitter3": {
+ "version": "5.0.4",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz",
+ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==",
+ "license": "MIT"
+ },
+ "node_modules/eventsource": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",
+ "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "eventsource-parser": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/eventsource-parser": {
+ "version": "3.0.6",
+ "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.6.tgz",
+ "integrity": "sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/execa": {
+ "version": "9.6.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-9.6.1.tgz",
+ "integrity": "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@sindresorhus/merge-streams": "^4.0.0",
+ "cross-spawn": "^7.0.6",
+ "figures": "^6.1.0",
+ "get-stream": "^9.0.0",
+ "human-signals": "^8.0.1",
+ "is-plain-obj": "^4.1.0",
+ "is-stream": "^4.0.1",
+ "npm-run-path": "^6.0.0",
+ "pretty-ms": "^9.2.0",
+ "signal-exit": "^4.1.0",
+ "strip-final-newline": "^4.0.0",
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": "^18.19.0 || >=20.5.0"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
+ }
+ },
+ "node_modules/express": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "^2.0.0",
+ "body-parser": "^2.2.1",
+ "content-disposition": "^1.0.0",
+ "content-type": "^1.0.5",
+ "cookie": "^0.7.1",
+ "cookie-signature": "^1.2.1",
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "finalhandler": "^2.1.0",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "merge-descriptors": "^2.0.0",
+ "mime-types": "^3.0.0",
+ "on-finished": "^2.4.1",
+ "once": "^1.4.0",
+ "parseurl": "^1.3.3",
+ "proxy-addr": "^2.0.7",
+ "qs": "^6.14.0",
+ "range-parser": "^1.2.1",
+ "router": "^2.2.0",
+ "send": "^1.1.0",
+ "serve-static": "^2.2.0",
+ "statuses": "^2.0.1",
+ "type-is": "^2.0.1",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/express-rate-limit": {
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.2.1.tgz",
+ "integrity": "sha512-PCZEIEIxqwhzw4KF0n7QF4QqruVTcF73O5kFKUnGOyjbCCgizBBiFaYpd/fnBLUMPw/BWw9OsiN7GgrNYr7j6g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ip-address": "10.0.1"
+ },
+ "engines": {
+ "node": ">= 16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/express-rate-limit"
+ },
+ "peerDependencies": {
+ "express": ">= 4.11"
+ }
+ },
+ "node_modules/express/node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/express/node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/express/node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-glob": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@nodelib/fs.stat": "^2.0.2",
+ "@nodelib/fs.walk": "^1.2.3",
+ "glob-parent": "^5.1.2",
+ "merge2": "^1.3.0",
+ "micromatch": "^4.0.8"
+ },
+ "engines": {
+ "node": ">=8.6.0"
+ }
+ },
+ "node_modules/fast-glob/node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-levenshtein": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fast-uri": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
+ "integrity": "sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/fastq": {
+ "version": "1.20.1",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz",
+ "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "reusify": "^1.0.4"
+ }
+ },
+ "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/fetch-blob": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
+ "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "paypal",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "node-domexception": "^1.0.0",
+ "web-streams-polyfill": "^3.0.3"
+ },
+ "engines": {
+ "node": "^12.20 || >= 14.13"
+ }
+ },
+ "node_modules/figures": {
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz",
+ "integrity": "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-unicode-supported": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/file-entry-cache": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
+ "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flat-cache": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=16.0.0"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "on-finished": "^2.4.1",
+ "parseurl": "^1.3.3",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/find-up": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/flat-cache": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
+ "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "flatted": "^3.2.9",
+ "keyv": "^4.5.4"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/flatted": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz",
+ "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/follow-redirects": {
+ "version": "1.15.11",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
+ "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/form-data": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz",
+ "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
+ "license": "MIT",
+ "dependencies": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.8",
+ "es-set-tostringtag": "^2.1.0",
+ "hasown": "^2.0.2",
+ "mime-types": "^2.1.12"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/formdata-polyfill": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
+ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fetch-blob": "^3.1.2"
+ },
+ "engines": {
+ "node": ">=12.20.0"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/fs-extra": {
+ "version": "11.3.3",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.3.tgz",
+ "integrity": "sha512-VWSRii4t0AFm6ixFFmLLx1t7wS1gh+ckoa84aOeapGum0h+EZd1EhEumSB+ZdDLnEPuucsVB9oB7cxJHap6Afg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "graceful-fs": "^4.2.0",
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=14.14"
+ }
+ },
+ "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==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/fuzzysort": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/fuzzysort/-/fuzzysort-3.1.0.tgz",
+ "integrity": "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/fzf": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmjs.org/fzf/-/fzf-0.5.2.tgz",
+ "integrity": "sha512-Tt4kuxLXFKHy8KT40zwsUPUkg1CrsgY25FxA2U/j/0WgEDCk3ddc/zLTCCcbSHX9FcKtLuVaDGtGE/STWC+j3Q==",
+ "dev": true,
+ "license": "BSD-3-Clause"
+ },
+ "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-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/get-east-asian-width": {
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz",
+ "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "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==",
+ "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-nonce": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz",
+ "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/get-own-enumerable-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/get-own-enumerable-keys/-/get-own-enumerable-keys-1.0.0.tgz",
+ "integrity": "sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "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==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/get-stream": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-9.0.1.tgz",
+ "integrity": "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@sec-ant/readable-stream": "^0.4.1",
+ "is-stream": "^4.0.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
+ "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "is-glob": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=10.13.0"
+ }
+ },
+ "node_modules/globals": {
+ "version": "16.5.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz",
+ "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/graceful-fs": {
+ "version": "4.2.11",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/graphql": {
+ "version": "16.13.0",
+ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.13.0.tgz",
+ "integrity": "sha512-uSisMYERbaB9bkA9M4/4dnqyktaEkf1kMHNKq/7DHyxVeWqHQ2mBmVqm5u6/FVHwF3iCNalKcg82Zfl+tffWoA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "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==",
+ "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==",
+ "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.2",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/headers-polyfill": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/headers-polyfill/-/headers-polyfill-4.0.3.tgz",
+ "integrity": "sha512-IScLbePpkvO846sIwOtOTDjutRMWdXdJmXdMvk6gCBHxFO8d+QKOQedyZSxFTTFYRSmlgSTDtXqqq4pcenBXLQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/hermes-estree": {
+ "version": "0.25.1",
+ "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz",
+ "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/hermes-parser": {
+ "version": "0.25.1",
+ "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz",
+ "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "hermes-estree": "0.25.1"
+ }
+ },
+ "node_modules/hono": {
+ "version": "4.12.2",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.2.tgz",
+ "integrity": "sha512-gJnaDHXKDayjt8ue0n8Gs0A007yKXj4Xzb8+cNjZeYsSzzwKc0Lr+OZgYwVfB0pHfUs17EPoLvrOsEaJ9mj+Tg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.9.0"
+ }
+ },
+ "node_modules/html-parse-stringify": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz",
+ "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==",
+ "license": "MIT",
+ "dependencies": {
+ "void-elements": "3.1.0"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "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/human-signals": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-8.0.1.tgz",
+ "integrity": "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ==",
+ "dev": true,
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=18.18.0"
+ }
+ },
+ "node_modules/i18next": {
+ "version": "25.8.13",
+ "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.8.13.tgz",
+ "integrity": "sha512-E0vzjBY1yM+nsFrtgkjLhST2NBkirkvOVoQa0MSldhsuZ3jUge7ZNpuwG0Cfc74zwo5ZwRzg3uOgT+McBn32iA==",
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://locize.com"
+ },
+ {
+ "type": "individual",
+ "url": "https://locize.com/i18next.html"
+ },
+ {
+ "type": "individual",
+ "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.28.4"
+ },
+ "peerDependencies": {
+ "typescript": "^5"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/i18next-browser-languagedetector": {
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.2.1.tgz",
+ "integrity": "sha512-bZg8+4bdmaOiApD7N7BPT9W8MLZG+nPTOFlLiJiT8uzKXFjhxw4v2ierCXOwB5sFDMtuA5G4kgYZ0AznZxQ/cw==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.23.2"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
+ "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/ignore": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/immer": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz",
+ "integrity": "sha512-d/+XTN3zfODyjr89gM3mPq1WNX2B8pYsu7eORitdwyA2sBubnTl3laYlBk4sXY5FUa5qTZGBDPJICVbvqzjlbw==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/immer"
+ }
+ },
+ "node_modules/import-fresh": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz",
+ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parent-module": "^1.0.0",
+ "resolve-from": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/imurmurhash": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.19"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/internmap": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
+ "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/ip-address": {
+ "version": "10.0.1",
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz",
+ "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-arrayish": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-docker": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz",
+ "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "is-docker": "cli.js"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-in-ssh": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz",
+ "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-inside-container": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz",
+ "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-docker": "^3.0.0"
+ },
+ "bin": {
+ "is-inside-container": "cli.js"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-interactive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
+ "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-node-process": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/is-node-process/-/is-node-process-1.2.0.tgz",
+ "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-obj": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-3.0.0.tgz",
+ "integrity": "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-plain-obj": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz",
+ "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/is-regexp": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-3.1.0.tgz",
+ "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-stream": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz",
+ "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-wsl": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz",
+ "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-inside-container": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/jiti": {
+ "version": "2.6.1",
+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz",
+ "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "jiti": "lib/jiti-cli.mjs"
+ }
+ },
+ "node_modules/jose": {
+ "version": "6.1.3",
+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.1.3.tgz",
+ "integrity": "sha512-0TpaTfihd4QMNwrz/ob2Bp7X04yuxJkjRGi4aKmOqwhov54i6u79oCv7T+C7lo70MKH6BesI3vscD1yb/yzKXQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/panva"
+ }
+ },
+ "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==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/js-yaml": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
+ "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "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/json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-parse-even-better-errors": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
+ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/json-schema-typed": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz",
+ "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",
+ "dev": true,
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/json-stable-stringify-without-jsonify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+ "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "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/jsonfile": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz",
+ "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
+ "graceful-fs": "^4.1.6"
+ }
+ },
+ "node_modules/keyv": {
+ "version": "4.5.4",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
+ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "json-buffer": "3.0.1"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/levn": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "prelude-ls": "^1.2.1",
+ "type-check": "~0.4.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/lightningcss": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.31.1.tgz",
+ "integrity": "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ==",
+ "dev": true,
+ "license": "MPL-2.0",
+ "dependencies": {
+ "detect-libc": "^2.0.3"
+ },
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ },
+ "optionalDependencies": {
+ "lightningcss-android-arm64": "1.31.1",
+ "lightningcss-darwin-arm64": "1.31.1",
+ "lightningcss-darwin-x64": "1.31.1",
+ "lightningcss-freebsd-x64": "1.31.1",
+ "lightningcss-linux-arm-gnueabihf": "1.31.1",
+ "lightningcss-linux-arm64-gnu": "1.31.1",
+ "lightningcss-linux-arm64-musl": "1.31.1",
+ "lightningcss-linux-x64-gnu": "1.31.1",
+ "lightningcss-linux-x64-musl": "1.31.1",
+ "lightningcss-win32-arm64-msvc": "1.31.1",
+ "lightningcss-win32-x64-msvc": "1.31.1"
+ }
+ },
+ "node_modules/lightningcss-android-arm64": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.31.1.tgz",
+ "integrity": "sha512-HXJF3x8w9nQ4jbXRiNppBCqeZPIAfUo8zE/kOEGbW5NZvGc/K7nMxbhIr+YlFlHW5mpbg/YFPdbnCh1wAXCKFg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-darwin-arm64": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.31.1.tgz",
+ "integrity": "sha512-02uTEqf3vIfNMq3h/z2cJfcOXnQ0GRwQrkmPafhueLb2h7mqEidiCzkE4gBMEH65abHRiQvhdcQ+aP0D0g67sg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-darwin-x64": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.31.1.tgz",
+ "integrity": "sha512-1ObhyoCY+tGxtsz1lSx5NXCj3nirk0Y0kB/g8B8DT+sSx4G9djitg9ejFnjb3gJNWo7qXH4DIy2SUHvpoFwfTA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-freebsd-x64": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.31.1.tgz",
+ "integrity": "sha512-1RINmQKAItO6ISxYgPwszQE1BrsVU5aB45ho6O42mu96UiZBxEXsuQ7cJW4zs4CEodPUioj/QrXW1r9pLUM74A==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm-gnueabihf": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.31.1.tgz",
+ "integrity": "sha512-OOCm2//MZJ87CdDK62rZIu+aw9gBv4azMJuA8/KB74wmfS3lnC4yoPHm0uXZ/dvNNHmnZnB8XLAZzObeG0nS1g==",
+ "cpu": [
+ "arm"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm64-gnu": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.31.1.tgz",
+ "integrity": "sha512-WKyLWztD71rTnou4xAD5kQT+982wvca7E6QoLpoawZ1gP9JM0GJj4Tp5jMUh9B3AitHbRZ2/H3W5xQmdEOUlLg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-arm64-musl": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.31.1.tgz",
+ "integrity": "sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-x64-gnu": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.31.1.tgz",
+ "integrity": "sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-linux-x64-musl": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.31.1.tgz",
+ "integrity": "sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-win32-arm64-msvc": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.31.1.tgz",
+ "integrity": "sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lightningcss-win32-x64-msvc": {
+ "version": "1.31.1",
+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.31.1.tgz",
+ "integrity": "sha512-I9aiFrbd7oYHwlnQDqr1Roz+fTz61oDDJX7n9tYF9FJymH1cIN1DtKw3iYt6b8WZgEjoNwVSncwF4wx/ZedMhw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "MPL-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/parcel"
+ }
+ },
+ "node_modules/lines-and-columns": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
+ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/lodash.merge": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/log-symbols": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-6.0.0.tgz",
+ "integrity": "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "is-unicode-supported": "^1.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/log-symbols/node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/log-symbols/node_modules/is-unicode-supported": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.3.0.tgz",
+ "integrity": "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "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/lucide-react": {
+ "version": "0.575.0",
+ "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.575.0.tgz",
+ "integrity": "sha512-VuXgKZrk0uiDlWjGGXmKV6MSk9Yy4l10qgVvzGn2AWBx1Ylt0iBexKOAoA6I7JO3m+M9oeovJd3yYENfkUbOeg==",
+ "license": "ISC",
+ "peerDependencies": {
+ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
+ "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==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",
+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/merge-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/merge2": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/micromatch": {
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "braces": "^3.0.3",
+ "picomatch": "^2.3.1"
+ },
+ "engines": {
+ "node": ">=8.6"
+ }
+ },
+ "node_modules/micromatch/node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "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==",
+ "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==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mimic-fn": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
+ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "3.1.4",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.4.tgz",
+ "integrity": "sha512-twmL+S8+7yIsE9wsqgzU3E8/LumN3M3QELrBZ20OdmQ9jB2JvW5oZtBEmft84k/Gs5CG9mqtWc6Y9vW+JEzGxw==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "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/msw": {
+ "version": "2.12.10",
+ "resolved": "https://registry.npmjs.org/msw/-/msw-2.12.10.tgz",
+ "integrity": "sha512-G3VUymSE0/iegFnuipujpwyTM2GuZAKXNeerUSrG2+Eg391wW63xFs5ixWsK9MWzr1AGoSkYGmyAzNgbR3+urw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "dependencies": {
+ "@inquirer/confirm": "^5.0.0",
+ "@mswjs/interceptors": "^0.41.2",
+ "@open-draft/deferred-promise": "^2.2.0",
+ "@types/statuses": "^2.0.6",
+ "cookie": "^1.0.2",
+ "graphql": "^16.12.0",
+ "headers-polyfill": "^4.0.2",
+ "is-node-process": "^1.2.0",
+ "outvariant": "^1.4.3",
+ "path-to-regexp": "^6.3.0",
+ "picocolors": "^1.1.1",
+ "rettime": "^0.10.1",
+ "statuses": "^2.0.2",
+ "strict-event-emitter": "^0.5.1",
+ "tough-cookie": "^6.0.0",
+ "type-fest": "^5.2.0",
+ "until-async": "^3.0.2",
+ "yargs": "^17.7.2"
+ },
+ "bin": {
+ "msw": "cli/index.js"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mswjs"
+ },
+ "peerDependencies": {
+ "typescript": ">= 4.8.x"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/mute-stream": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-2.0.0.tgz",
+ "integrity": "sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": "^18.17.0 || >=20.5.0"
+ }
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.11",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
+ "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
+ "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/natural-compare": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/negotiator": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",
+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/next-themes": {
+ "version": "0.4.6",
+ "resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.6.tgz",
+ "integrity": "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc"
+ }
+ },
+ "node_modules/node-domexception": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
+ "deprecated": "Use your platform's native DOMException instead",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "github",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.5.0"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "data-uri-to-buffer": "^4.0.0",
+ "fetch-blob": "^3.1.4",
+ "formdata-polyfill": "^4.0.10"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-fetch"
+ }
+ },
+ "node_modules/node-releases": {
+ "version": "2.0.27",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
+ "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/npm-run-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-6.0.0.tgz",
+ "integrity": "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^4.0.0",
+ "unicorn-magic": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/npm-run-path/node_modules/path-key": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz",
+ "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/object-treeify": {
+ "version": "1.1.33",
+ "resolved": "https://registry.npmjs.org/object-treeify/-/object-treeify-1.1.33.tgz",
+ "integrity": "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/onetime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mimic-function": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/open": {
+ "version": "11.0.0",
+ "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz",
+ "integrity": "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "default-browser": "^5.4.0",
+ "define-lazy-prop": "^3.0.0",
+ "is-in-ssh": "^1.0.0",
+ "is-inside-container": "^1.0.0",
+ "powershell-utils": "^0.1.0",
+ "wsl-utils": "^0.3.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/optionator": {
+ "version": "0.9.4",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
+ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "deep-is": "^0.1.3",
+ "fast-levenshtein": "^2.0.6",
+ "levn": "^0.4.1",
+ "prelude-ls": "^1.2.1",
+ "type-check": "^0.4.0",
+ "word-wrap": "^1.2.5"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/ora": {
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-8.2.0.tgz",
+ "integrity": "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.3.0",
+ "cli-cursor": "^5.0.0",
+ "cli-spinners": "^2.9.2",
+ "is-interactive": "^2.0.0",
+ "is-unicode-supported": "^2.0.0",
+ "log-symbols": "^6.0.0",
+ "stdin-discarder": "^0.2.2",
+ "string-width": "^7.2.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora/node_modules/chalk": {
+ "version": "5.6.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz",
+ "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": "^12.17.0 || ^14.13 || >=16.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/outvariant": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/outvariant/-/outvariant-1.4.3.tgz",
+ "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/package-manager-detector": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.6.0.tgz",
+ "integrity": "sha512-61A5ThoTiDG/C8s8UMZwSorAGwMJ0ERVGj2OjoW5pAalsNOg15+iQiPzrLJ4jhZ1HJzmC2PIHT2oEiH3R5fzNA==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/parent-module": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "callsites": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/parse-json": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
+ "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@babel/code-frame": "^7.0.0",
+ "error-ex": "^1.3.1",
+ "json-parse-even-better-errors": "^2.3.0",
+ "lines-and-columns": "^1.1.6"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parse-ms": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-4.0.0.tgz",
+ "integrity": "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-browserify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz",
+ "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-key": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
+ "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "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.3",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz",
+ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/pkce-challenge": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
+ "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/pluggy-connect-sdk": {
+ "version": "2.13.0",
+ "resolved": "https://registry.npmjs.org/pluggy-connect-sdk/-/pluggy-connect-sdk-2.13.0.tgz",
+ "integrity": "sha512-RbEjFbZsss8mdyuBqK3bVvfmW1zi+JWVnUb0L3cBYUXBujTzP1na/3GGfE3hJjYIShoMhRjPvq+CzuRZU0DrTw==",
+ "license": "MIT",
+ "dependencies": {
+ "zoid": "9.0.63"
+ },
+ "peerDependencies": {
+ "pluggy-js": ">= 0.16.0"
+ },
+ "peerDependenciesMeta": {
+ "pluggy-js": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/post-robot": {
+ "version": "10.0.46",
+ "resolved": "https://registry.npmjs.org/post-robot/-/post-robot-10.0.46.tgz",
+ "integrity": "sha512-EgVJiuvI4iRWDZvzObWes0X/n8olWBEJWxlSw79zmhpgkigX8UsVL4VOBhVtoJKwf0Y9qP9g2zOONw1rv80QbA==",
+ "dependencies": {
+ "belter": "^1.0.41",
+ "cross-domain-safe-weakmap": "^1.0.1",
+ "cross-domain-utils": "^2.0.0",
+ "universal-serialize": "^1.0.4",
+ "zalgo-promise": "^1.0.3"
+ }
+ },
+ "node_modules/postcss": {
+ "version": "8.5.6",
+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
+ "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
+ "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.11",
+ "picocolors": "^1.1.1",
+ "source-map-js": "^1.2.1"
+ },
+ "engines": {
+ "node": "^10 || ^12 || >=14"
+ }
+ },
+ "node_modules/postcss-selector-parser": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.1.tgz",
+ "integrity": "sha512-orRsuYpJVw8LdAwqqLykBj9ecS5/cRHlI5+nvTo8LcCKmzDmqVORXtOIYEEQuL9D4BxtA1lm5isAqzQZCoQ6Eg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cssesc": "^3.0.0",
+ "util-deprecate": "^1.0.2"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/powershell-utils": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz",
+ "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/prelude-ls": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/pretty-ms": {
+ "version": "9.3.0",
+ "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.3.0.tgz",
+ "integrity": "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "parse-ms": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/prompts": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^3.0.3",
+ "sisteransi": "^1.0.5"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/prompts/node_modules/kleur": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/proxy-from-env": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
+ "license": "MIT"
+ },
+ "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/qs": {
+ "version": "6.15.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz",
+ "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "side-channel": "^1.1.0"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/queue-microtask": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/radix-ui": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/radix-ui/-/radix-ui-1.4.3.tgz",
+ "integrity": "sha512-aWizCQiyeAenIdUbqEpXgRA1ya65P13NKn/W8rWkcN0OPkRDxdBVLWnIEDsS2RpwCK2nobI7oMUSmexzTDyAmA==",
+ "license": "MIT",
+ "dependencies": {
+ "@radix-ui/primitive": "1.1.3",
+ "@radix-ui/react-accessible-icon": "1.1.7",
+ "@radix-ui/react-accordion": "1.2.12",
+ "@radix-ui/react-alert-dialog": "1.1.15",
+ "@radix-ui/react-arrow": "1.1.7",
+ "@radix-ui/react-aspect-ratio": "1.1.7",
+ "@radix-ui/react-avatar": "1.1.10",
+ "@radix-ui/react-checkbox": "1.3.3",
+ "@radix-ui/react-collapsible": "1.1.12",
+ "@radix-ui/react-collection": "1.1.7",
+ "@radix-ui/react-compose-refs": "1.1.2",
+ "@radix-ui/react-context": "1.1.2",
+ "@radix-ui/react-context-menu": "2.2.16",
+ "@radix-ui/react-dialog": "1.1.15",
+ "@radix-ui/react-direction": "1.1.1",
+ "@radix-ui/react-dismissable-layer": "1.1.11",
+ "@radix-ui/react-dropdown-menu": "2.1.16",
+ "@radix-ui/react-focus-guards": "1.1.3",
+ "@radix-ui/react-focus-scope": "1.1.7",
+ "@radix-ui/react-form": "0.1.8",
+ "@radix-ui/react-hover-card": "1.1.15",
+ "@radix-ui/react-label": "2.1.7",
+ "@radix-ui/react-menu": "2.1.16",
+ "@radix-ui/react-menubar": "1.1.16",
+ "@radix-ui/react-navigation-menu": "1.2.14",
+ "@radix-ui/react-one-time-password-field": "0.1.8",
+ "@radix-ui/react-password-toggle-field": "0.1.3",
+ "@radix-ui/react-popover": "1.1.15",
+ "@radix-ui/react-popper": "1.2.8",
+ "@radix-ui/react-portal": "1.1.9",
+ "@radix-ui/react-presence": "1.1.5",
+ "@radix-ui/react-primitive": "2.1.3",
+ "@radix-ui/react-progress": "1.1.7",
+ "@radix-ui/react-radio-group": "1.3.8",
+ "@radix-ui/react-roving-focus": "1.1.11",
+ "@radix-ui/react-scroll-area": "1.2.10",
+ "@radix-ui/react-select": "2.2.6",
+ "@radix-ui/react-separator": "1.1.7",
+ "@radix-ui/react-slider": "1.3.6",
+ "@radix-ui/react-slot": "1.2.3",
+ "@radix-ui/react-switch": "1.2.6",
+ "@radix-ui/react-tabs": "1.1.13",
+ "@radix-ui/react-toast": "1.2.15",
+ "@radix-ui/react-toggle": "1.1.10",
+ "@radix-ui/react-toggle-group": "1.1.11",
+ "@radix-ui/react-toolbar": "1.1.11",
+ "@radix-ui/react-tooltip": "1.2.8",
+ "@radix-ui/react-use-callback-ref": "1.1.1",
+ "@radix-ui/react-use-controllable-state": "1.2.2",
+ "@radix-ui/react-use-effect-event": "0.0.2",
+ "@radix-ui/react-use-escape-keydown": "1.1.1",
+ "@radix-ui/react-use-is-hydrated": "0.1.0",
+ "@radix-ui/react-use-layout-effect": "1.1.1",
+ "@radix-ui/react-use-size": "1.1.1",
+ "@radix-ui/react-visually-hidden": "1.2.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
+ "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.7.0",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/react": {
+ "version": "19.2.4",
+ "resolved": "https://registry.npmjs.org/react/-/react-19.2.4.tgz",
+ "integrity": "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-dom": {
+ "version": "19.2.4",
+ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.4.tgz",
+ "integrity": "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ==",
+ "license": "MIT",
+ "dependencies": {
+ "scheduler": "^0.27.0"
+ },
+ "peerDependencies": {
+ "react": "^19.2.4"
+ }
+ },
+ "node_modules/react-hook-form": {
+ "version": "7.71.2",
+ "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.71.2.tgz",
+ "integrity": "sha512-1CHvcDYzuRUNOflt4MOq3ZM46AronNJtQ1S7tnX6YN4y72qhgiUItpacZUAQ0TyWYci3yz1X+rXaSxiuEm86PA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/react-hook-form"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17 || ^18 || ^19"
+ }
+ },
+ "node_modules/react-i18next": {
+ "version": "16.5.4",
+ "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-16.5.4.tgz",
+ "integrity": "sha512-6yj+dcfMncEC21QPhOTsW8mOSO+pzFmT6uvU7XXdvM/Cp38zJkmTeMeKmTrmCMD5ToT79FmiE/mRWiYWcJYW4g==",
+ "license": "MIT",
+ "dependencies": {
+ "@babel/runtime": "^7.28.4",
+ "html-parse-stringify": "^3.0.1",
+ "use-sync-external-store": "^1.6.0"
+ },
+ "peerDependencies": {
+ "i18next": ">= 25.6.2",
+ "react": ">= 16.8.0",
+ "typescript": "^5"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ },
+ "react-native": {
+ "optional": true
+ },
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-is": {
+ "version": "19.2.4",
+ "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.2.4.tgz",
+ "integrity": "sha512-W+EWGn2v0ApPKgKKCy/7s7WHXkboGcsrXE+2joLyVxkbyVQfO3MUEaUQDHoSmb8TFFrSKYa9mw64WZHNHSDzYA==",
+ "license": "MIT",
+ "peer": true
+ },
+ "node_modules/react-pluggy-connect": {
+ "version": "2.12.0",
+ "resolved": "https://registry.npmjs.org/react-pluggy-connect/-/react-pluggy-connect-2.12.0.tgz",
+ "integrity": "sha512-p+Rq5Notr/KjoakpqIUDAMh/XFUaF2rTRachpBFxr90lOdWkE6S7i3qHanNq2lav/WsAa8y6MdSZC6gV1Sxp3g==",
+ "license": "MIT",
+ "dependencies": {
+ "pluggy-connect-sdk": "^2.12.0"
+ },
+ "peerDependencies": {
+ "pluggy-js": ">= 0.16.0",
+ "react": ">= 16.10.0",
+ "react-dom": ">= 16.10.0"
+ },
+ "peerDependenciesMeta": {
+ "pluggy-js": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-redux": {
+ "version": "9.2.0",
+ "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.2.0.tgz",
+ "integrity": "sha512-ROY9fvHhwOD9ySfrF0wmvu//bKCQ6AeZZq1nJNtbDC+kk5DuSuNX/n6YWYF/SYy7bSba4D4FSz8DJeKY/S/r+g==",
+ "license": "MIT",
+ "dependencies": {
+ "@types/use-sync-external-store": "^0.0.6",
+ "use-sync-external-store": "^1.4.0"
+ },
+ "peerDependencies": {
+ "@types/react": "^18.2.25 || ^19",
+ "react": "^18.0 || ^19",
+ "redux": "^5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "redux": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-refresh": {
+ "version": "0.18.0",
+ "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.18.0.tgz",
+ "integrity": "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/react-remove-scroll": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz",
+ "integrity": "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==",
+ "license": "MIT",
+ "dependencies": {
+ "react-remove-scroll-bar": "^2.3.7",
+ "react-style-singleton": "^2.2.3",
+ "tslib": "^2.1.0",
+ "use-callback-ref": "^1.3.3",
+ "use-sidecar": "^1.1.3"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-remove-scroll-bar": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz",
+ "integrity": "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==",
+ "license": "MIT",
+ "dependencies": {
+ "react-style-singleton": "^2.2.2",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router": {
+ "version": "7.13.1",
+ "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.13.1.tgz",
+ "integrity": "sha512-td+xP4X2/6BJvZoX6xw++A2DdEi++YypA69bJUV5oVvqf6/9/9nNlD70YO1e9d3MyamJEBQFEzk6mbfDYbqrSA==",
+ "license": "MIT",
+ "dependencies": {
+ "cookie": "^1.0.1",
+ "set-cookie-parser": "^2.6.0"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ },
+ "peerDependenciesMeta": {
+ "react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-router-dom": {
+ "version": "7.13.1",
+ "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.13.1.tgz",
+ "integrity": "sha512-UJnV3Rxc5TgUPJt2KJpo1Jpy0OKQr0AjgbZzBFjaPJcFOb2Y8jA5H3LT8HUJAiRLlWrEXWHbF1Z4SCZaQjWDHw==",
+ "license": "MIT",
+ "dependencies": {
+ "react-router": "7.13.1"
+ },
+ "engines": {
+ "node": ">=20.0.0"
+ },
+ "peerDependencies": {
+ "react": ">=18",
+ "react-dom": ">=18"
+ }
+ },
+ "node_modules/react-style-singleton": {
+ "version": "2.2.3",
+ "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.3.tgz",
+ "integrity": "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==",
+ "license": "MIT",
+ "dependencies": {
+ "get-nonce": "^1.0.0",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/recast": {
+ "version": "0.23.11",
+ "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.11.tgz",
+ "integrity": "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ast-types": "^0.16.1",
+ "esprima": "~4.0.0",
+ "source-map": "~0.6.1",
+ "tiny-invariant": "^1.3.3",
+ "tslib": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 4"
+ }
+ },
+ "node_modules/recharts": {
+ "version": "3.7.0",
+ "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.7.0.tgz",
+ "integrity": "sha512-l2VCsy3XXeraxIID9fx23eCb6iCBsxUQDnE8tWm6DFdszVAO7WVY/ChAD9wVit01y6B2PMupYiMmQwhgPHc9Ew==",
+ "license": "MIT",
+ "workspaces": [
+ "www"
+ ],
+ "dependencies": {
+ "@reduxjs/toolkit": "1.x.x || 2.x.x",
+ "clsx": "^2.1.1",
+ "decimal.js-light": "^2.5.1",
+ "es-toolkit": "^1.39.3",
+ "eventemitter3": "^5.0.1",
+ "immer": "^10.1.1",
+ "react-redux": "8.x.x || 9.x.x",
+ "reselect": "5.1.1",
+ "tiny-invariant": "^1.3.3",
+ "use-sync-external-store": "^1.2.2",
+ "victory-vendor": "^37.0.2"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+ "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
+ "react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
+ "node_modules/redux": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
+ "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==",
+ "license": "MIT"
+ },
+ "node_modules/redux-thunk": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz",
+ "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "redux": "^5.0.0"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/reselect": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz",
+ "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==",
+ "license": "MIT"
+ },
+ "node_modules/resolve-from": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/restore-cursor": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/rettime": {
+ "version": "0.10.1",
+ "resolved": "https://registry.npmjs.org/rettime/-/rettime-0.10.1.tgz",
+ "integrity": "sha512-uyDrIlUEH37cinabq0AX4QbgV4HbFZ/gqoiunWQ1UqBtRvTTytwhNYjE++pO/MjPTZL5KQCf2bEoJ/BJNVQ5Kw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/reusify": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "iojs": ">=1.0.0",
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/rollup": {
+ "version": "4.59.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.59.0.tgz",
+ "integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@types/estree": "1.0.8"
+ },
+ "bin": {
+ "rollup": "dist/bin/rollup"
+ },
+ "engines": {
+ "node": ">=18.0.0",
+ "npm": ">=8.0.0"
+ },
+ "optionalDependencies": {
+ "@rollup/rollup-android-arm-eabi": "4.59.0",
+ "@rollup/rollup-android-arm64": "4.59.0",
+ "@rollup/rollup-darwin-arm64": "4.59.0",
+ "@rollup/rollup-darwin-x64": "4.59.0",
+ "@rollup/rollup-freebsd-arm64": "4.59.0",
+ "@rollup/rollup-freebsd-x64": "4.59.0",
+ "@rollup/rollup-linux-arm-gnueabihf": "4.59.0",
+ "@rollup/rollup-linux-arm-musleabihf": "4.59.0",
+ "@rollup/rollup-linux-arm64-gnu": "4.59.0",
+ "@rollup/rollup-linux-arm64-musl": "4.59.0",
+ "@rollup/rollup-linux-loong64-gnu": "4.59.0",
+ "@rollup/rollup-linux-loong64-musl": "4.59.0",
+ "@rollup/rollup-linux-ppc64-gnu": "4.59.0",
+ "@rollup/rollup-linux-ppc64-musl": "4.59.0",
+ "@rollup/rollup-linux-riscv64-gnu": "4.59.0",
+ "@rollup/rollup-linux-riscv64-musl": "4.59.0",
+ "@rollup/rollup-linux-s390x-gnu": "4.59.0",
+ "@rollup/rollup-linux-x64-gnu": "4.59.0",
+ "@rollup/rollup-linux-x64-musl": "4.59.0",
+ "@rollup/rollup-openbsd-x64": "4.59.0",
+ "@rollup/rollup-openharmony-arm64": "4.59.0",
+ "@rollup/rollup-win32-arm64-msvc": "4.59.0",
+ "@rollup/rollup-win32-ia32-msvc": "4.59.0",
+ "@rollup/rollup-win32-x64-gnu": "4.59.0",
+ "@rollup/rollup-win32-x64-msvc": "4.59.0",
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/router": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "is-promise": "^4.0.0",
+ "parseurl": "^1.3.3",
+ "path-to-regexp": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/router/node_modules/path-to-regexp": {
+ "version": "8.3.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
+ "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/run-applescript": {
+ "version": "7.1.0",
+ "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz",
+ "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/run-parallel": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "queue-microtask": "^1.2.2"
+ }
+ },
+ "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/scheduler": {
+ "version": "0.27.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz",
+ "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==",
+ "license": "MIT"
+ },
+ "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/send": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.3",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.1",
+ "mime-types": "^3.0.2",
+ "ms": "^2.1.3",
+ "on-finished": "^2.4.1",
+ "range-parser": "^1.2.1",
+ "statuses": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/send/node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/send/node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/serve-static": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "parseurl": "^1.3.3",
+ "send": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/set-cookie-parser": {
+ "version": "2.7.2",
+ "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.2.tgz",
+ "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==",
+ "license": "MIT"
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/shadcn": {
+ "version": "3.8.5",
+ "resolved": "https://registry.npmjs.org/shadcn/-/shadcn-3.8.5.tgz",
+ "integrity": "sha512-jPRx44e+eyeV7xwY3BLJXcfrks00+M0h5BGB9l6DdcBW4BpAj4x3lVmVy0TXPEs2iHEisxejr62sZAAw6B1EVA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@antfu/ni": "^25.0.0",
+ "@babel/core": "^7.28.0",
+ "@babel/parser": "^7.28.0",
+ "@babel/plugin-transform-typescript": "^7.28.0",
+ "@babel/preset-typescript": "^7.27.1",
+ "@dotenvx/dotenvx": "^1.48.4",
+ "@modelcontextprotocol/sdk": "^1.26.0",
+ "@types/validate-npm-package-name": "^4.0.2",
+ "browserslist": "^4.26.2",
+ "commander": "^14.0.0",
+ "cosmiconfig": "^9.0.0",
+ "dedent": "^1.6.0",
+ "deepmerge": "^4.3.1",
+ "diff": "^8.0.2",
+ "execa": "^9.6.0",
+ "fast-glob": "^3.3.3",
+ "fs-extra": "^11.3.1",
+ "fuzzysort": "^3.1.0",
+ "https-proxy-agent": "^7.0.6",
+ "kleur": "^4.1.5",
+ "msw": "^2.10.4",
+ "node-fetch": "^3.3.2",
+ "open": "^11.0.0",
+ "ora": "^8.2.0",
+ "postcss": "^8.5.6",
+ "postcss-selector-parser": "^7.1.0",
+ "prompts": "^2.4.2",
+ "recast": "^0.23.11",
+ "stringify-object": "^5.0.0",
+ "tailwind-merge": "^3.0.1",
+ "ts-morph": "^26.0.0",
+ "tsconfig-paths": "^4.2.0",
+ "validate-npm-package-name": "^7.0.1",
+ "zod": "^3.24.1",
+ "zod-to-json-schema": "^3.24.6"
+ },
+ "bin": {
+ "shadcn": "dist/index.js"
+ }
+ },
+ "node_modules/shadcn/node_modules/zod": {
+ "version": "3.25.76",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
+ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/shebang-command": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "shebang-regex": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/shebang-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
+ "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.3",
+ "side-channel-list": "^1.0.0",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
+ "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/signal-exit": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+ "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/sisteransi": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
+ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/sonner": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
+ "integrity": "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc",
+ "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ }
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "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/statuses": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/stdin-discarder": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.2.2.tgz",
+ "integrity": "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/strict-event-emitter": {
+ "version": "0.5.1",
+ "resolved": "https://registry.npmjs.org/strict-event-emitter/-/strict-event-emitter-0.5.1.tgz",
+ "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/string-width": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+ "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^10.3.0",
+ "get-east-asian-width": "^1.0.0",
+ "strip-ansi": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/stringify-object": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-5.0.0.tgz",
+ "integrity": "sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "get-own-enumerable-keys": "^1.0.0",
+ "is-obj": "^3.0.0",
+ "is-regexp": "^3.1.0"
+ },
+ "engines": {
+ "node": ">=14.16"
+ },
+ "funding": {
+ "url": "https://github.com/yeoman/stringify-object?sponsor=1"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "7.1.2",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
+ "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/strip-bom": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+ "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/strip-final-newline": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-4.0.0.tgz",
+ "integrity": "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/tagged-tag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz",
+ "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/tailwind-merge": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.5.0.tgz",
+ "integrity": "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A==",
+ "license": "MIT",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/dcastil"
+ }
+ },
+ "node_modules/tailwindcss": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.1.tgz",
+ "integrity": "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/tapable": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz",
+ "integrity": "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/webpack"
+ }
+ },
+ "node_modules/tiny-invariant": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
+ "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==",
+ "license": "MIT"
+ },
+ "node_modules/tinyexec": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.2.tgz",
+ "integrity": "sha512-W/KYk+NFhkmsYpuHq5JykngiOCnxeVL8v8dFnqxSD8qEEdRfXk1SDM6JzNqcERbcGYj9tMrDQBYV9cjgnunFIg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/tinyglobby": {
+ "version": "0.2.15",
+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz",
+ "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/SuperchupuDev"
+ }
+ },
+ "node_modules/tldts": {
+ "version": "7.0.23",
+ "resolved": "https://registry.npmjs.org/tldts/-/tldts-7.0.23.tgz",
+ "integrity": "sha512-ASdhgQIBSay0R/eXggAkQ53G4nTJqTXqC2kbaBbdDwM7SkjyZyO0OaaN1/FH7U/yCeqOHDwFO5j8+Os/IS1dXw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "tldts-core": "^7.0.23"
+ },
+ "bin": {
+ "tldts": "bin/cli.js"
+ }
+ },
+ "node_modules/tldts-core": {
+ "version": "7.0.23",
+ "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-7.0.23.tgz",
+ "integrity": "sha512-0g9vrtDQLrNIiCj22HSe9d4mLVG3g5ph5DZ8zCKBr4OtrspmNB6ss7hVyzArAeE88ceZocIEGkyW1Ime7fxPtQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/tough-cookie": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-6.0.0.tgz",
+ "integrity": "sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w==",
+ "dev": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "tldts": "^7.0.5"
+ },
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/ts-api-utils": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.4.0.tgz",
+ "integrity": "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.12"
+ },
+ "peerDependencies": {
+ "typescript": ">=4.8.4"
+ }
+ },
+ "node_modules/ts-morph": {
+ "version": "26.0.0",
+ "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-26.0.0.tgz",
+ "integrity": "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@ts-morph/common": "~0.27.0",
+ "code-block-writer": "^13.0.3"
+ }
+ },
+ "node_modules/tsconfig-paths": {
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz",
+ "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "json5": "^2.2.2",
+ "minimist": "^1.2.6",
+ "strip-bom": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
+ "license": "0BSD"
+ },
+ "node_modules/tw-animate-css": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz",
+ "integrity": "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/Wombosvideo"
+ }
+ },
+ "node_modules/type-check": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "prelude-ls": "^1.2.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/type-fest": {
+ "version": "5.4.4",
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.4.4.tgz",
+ "integrity": "sha512-JnTrzGu+zPV3aXIUhnyWJj4z/wigMsdYajGLIYakqyOW1nPllzXEJee0QQbHj+CTIQtXGlAjuK0UY+2xTyjVAw==",
+ "dev": true,
+ "license": "(MIT OR CC0-1.0)",
+ "dependencies": {
+ "tagged-tag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",
+ "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "content-type": "^1.0.5",
+ "media-typer": "^1.1.0",
+ "mime-types": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/type-is/node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/type-is/node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "5.9.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
+ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
+ "devOptional": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=14.17"
+ }
+ },
+ "node_modules/typescript-eslint": {
+ "version": "8.56.1",
+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.56.1.tgz",
+ "integrity": "sha512-U4lM6pjmBX7J5wk4szltF7I1cGBHXZopnAXCMXb3+fZ3B/0Z3hq3wS/CCUB2NZBNAExK92mCU2tEohWuwVMsDQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/eslint-plugin": "8.56.1",
+ "@typescript-eslint/parser": "8.56.1",
+ "@typescript-eslint/typescript-estree": "8.56.1",
+ "@typescript-eslint/utils": "8.56.1"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
+ "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/unicorn-magic": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz",
+ "integrity": "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/universal-serialize": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/universal-serialize/-/universal-serialize-1.0.10.tgz",
+ "integrity": "sha512-FdouA4xSFa0fudk1+z5vLWtxZCoC0Q9lKYV3uUdFl7DttNfolmiw2ASr5ddY+/Yz6Isr68u3IqC9XMSwMP+Pow=="
+ },
+ "node_modules/universalify": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz",
+ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 10.0.0"
+ }
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/until-async": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/until-async/-/until-async-3.0.2.tgz",
+ "integrity": "sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/kettanaito"
+ }
+ },
+ "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/uri-js": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+ "dev": true,
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "node_modules/use-callback-ref": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz",
+ "integrity": "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==",
+ "license": "MIT",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/use-sidecar": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/use-sidecar/-/use-sidecar-1.1.3.tgz",
+ "integrity": "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==",
+ "license": "MIT",
+ "dependencies": {
+ "detect-node-es": "^1.1.0",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/use-sync-external-store": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz",
+ "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==",
+ "license": "MIT",
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
+ }
+ },
+ "node_modules/util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/validate-npm-package-name": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-7.0.2.tgz",
+ "integrity": "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": "^20.17.0 || >=22.9.0"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/victory-vendor": {
+ "version": "37.3.6",
+ "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz",
+ "integrity": "sha512-SbPDPdDBYp+5MJHhBCAyI7wKM3d5ivekigc2Dk2s7pgbZ9wIgIBYGVw4zGHBml/qTFbexrofXW6Gu4noGxrOwQ==",
+ "license": "MIT AND ISC",
+ "dependencies": {
+ "@types/d3-array": "^3.0.3",
+ "@types/d3-ease": "^3.0.0",
+ "@types/d3-interpolate": "^3.0.1",
+ "@types/d3-scale": "^4.0.2",
+ "@types/d3-shape": "^3.1.0",
+ "@types/d3-time": "^3.0.0",
+ "@types/d3-timer": "^3.0.0",
+ "d3-array": "^3.1.6",
+ "d3-ease": "^3.0.1",
+ "d3-interpolate": "^3.0.1",
+ "d3-scale": "^4.0.2",
+ "d3-shape": "^3.1.0",
+ "d3-time": "^3.0.0",
+ "d3-timer": "^3.0.1"
+ }
+ },
+ "node_modules/vite": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz",
+ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "esbuild": "^0.27.0",
+ "fdir": "^6.5.0",
+ "picomatch": "^4.0.3",
+ "postcss": "^8.5.6",
+ "rollup": "^4.43.0",
+ "tinyglobby": "^0.2.15"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^20.19.0 || >=22.12.0"
+ },
+ "funding": {
+ "url": "https://github.com/vitejs/vite?sponsor=1"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.3"
+ },
+ "peerDependencies": {
+ "@types/node": "^20.19.0 || >=22.12.0",
+ "jiti": ">=1.21.0",
+ "less": "^4.0.0",
+ "lightningcss": "^1.21.0",
+ "sass": "^1.70.0",
+ "sass-embedded": "^1.70.0",
+ "stylus": ">=0.54.8",
+ "sugarss": "^5.0.0",
+ "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/void-elements": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz",
+ "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/web-streams-polyfill": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
+ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "dev": true,
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/word-wrap": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
+ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/wrap-ansi": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi/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",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/wrap-ansi/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "dev": true,
+ "license": "ISC"
+ },
+ "node_modules/wsl-utils": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz",
+ "integrity": "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "is-wsl": "^3.1.0",
+ "powershell-utils": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "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"
+ },
+ "node_modules/yargs": {
+ "version": "17.7.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
+ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+ "dev": true,
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs/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",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/yargs/node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yoctocolors": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz",
+ "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yoctocolors-cjs": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz",
+ "integrity": "sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/zalgo-promise": {
+ "version": "1.0.48",
+ "resolved": "https://registry.npmjs.org/zalgo-promise/-/zalgo-promise-1.0.48.tgz",
+ "integrity": "sha512-LLHANmdm53+MucY9aOFIggzYtUdkSBFxUsy4glTTQYNyK6B3uCPWTbfiGvSrEvLojw0mSzyFJ1/RRLv+QMNdzQ=="
+ },
+ "node_modules/zod": {
+ "version": "4.3.6",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.6.tgz",
+ "integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zod-to-json-schema": {
+ "version": "3.25.1",
+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.1.tgz",
+ "integrity": "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==",
+ "dev": true,
+ "license": "ISC",
+ "peerDependencies": {
+ "zod": "^3.25 || ^4"
+ }
+ },
+ "node_modules/zod-validation-error": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz",
+ "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "peerDependencies": {
+ "zod": "^3.25.0 || ^4.0.0"
+ }
+ },
+ "node_modules/zoid": {
+ "version": "9.0.63",
+ "resolved": "https://registry.npmjs.org/zoid/-/zoid-9.0.63.tgz",
+ "integrity": "sha512-c9OccNUlOV9KuTKJJRhCU3B5SRHObTTiPAUayKkBQ0/qZugfh59MDW+zkFDR8IZN+c7NB/R90FCIpAfBp8+U/g==",
+ "dependencies": {
+ "belter": "^1.0.123",
+ "cross-domain-utils": "^2.0.33",
+ "post-robot": "^10",
+ "zalgo-promise": "^1.0.45"
+ }
+ }
+ }
+}
diff --git a/frontend/package.json b/frontend/package.json
new file mode 100644
index 00000000..892b13a6
--- /dev/null
+++ b/frontend/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "frontend",
+ "private": true,
+ "version": "0.0.0",
+ "type": "module",
+ "scripts": {
+ "dev": "vite",
+ "build": "tsc -b && vite build",
+ "lint": "eslint .",
+ "preview": "vite preview",
+ "dev:docker": "node ../scripts/dev-frontend.mjs"
+ },
+ "dependencies": {
+ "@hookform/resolvers": "^5.2.2",
+ "@tanstack/react-query": "^5.90.21",
+ "axios": "^1.13.5",
+ "class-variance-authority": "^0.7.1",
+ "clsx": "^2.1.1",
+ "date-fns": "^4.1.0",
+ "i18next": "^25.8.13",
+ "i18next-browser-languagedetector": "^8.2.1",
+ "lucide-react": "^0.575.0",
+ "next-themes": "^0.4.6",
+ "radix-ui": "^1.4.3",
+ "react": "^19.2.0",
+ "react-dom": "^19.2.0",
+ "react-hook-form": "^7.71.2",
+ "react-i18next": "^16.5.4",
+ "react-pluggy-connect": "^2.10.2",
+ "react-router-dom": "^7.13.1",
+ "recharts": "^3.7.0",
+ "sonner": "^2.0.7",
+ "tailwind-merge": "^3.5.0",
+ "zod": "^4.3.6"
+ },
+ "devDependencies": {
+ "@eslint/js": "^9.39.1",
+ "@tailwindcss/vite": "^4.2.1",
+ "@types/node": "^24.10.13",
+ "@types/react": "^19.2.7",
+ "@types/react-dom": "^19.2.3",
+ "@vitejs/plugin-react": "^5.1.1",
+ "eslint": "^9.39.1",
+ "eslint-plugin-react-hooks": "^7.0.1",
+ "eslint-plugin-react-refresh": "^0.4.24",
+ "globals": "^16.5.0",
+ "shadcn": "^3.8.5",
+ "tailwindcss": "^4.2.1",
+ "tw-animate-css": "^1.4.0",
+ "typescript": "~5.9.3",
+ "typescript-eslint": "^8.48.0",
+ "vite": "^7.3.1"
+ }
+}
diff --git a/frontend/public/android-icon-192x192.png b/frontend/public/android-icon-192x192.png
new file mode 100644
index 00000000..dca4247b
Binary files /dev/null and b/frontend/public/android-icon-192x192.png differ
diff --git a/frontend/public/apple-touch-icon.png b/frontend/public/apple-touch-icon.png
new file mode 100644
index 00000000..8b5773e9
Binary files /dev/null and b/frontend/public/apple-touch-icon.png differ
diff --git a/frontend/public/favicon-16x16.png b/frontend/public/favicon-16x16.png
new file mode 100644
index 00000000..2e1dabc0
Binary files /dev/null and b/frontend/public/favicon-16x16.png differ
diff --git a/frontend/public/favicon-32x32.png b/frontend/public/favicon-32x32.png
new file mode 100644
index 00000000..36cb02cd
Binary files /dev/null and b/frontend/public/favicon-32x32.png differ
diff --git a/frontend/public/favicon-96x96.png b/frontend/public/favicon-96x96.png
new file mode 100644
index 00000000..1eab1ea8
Binary files /dev/null and b/frontend/public/favicon-96x96.png differ
diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico
new file mode 100644
index 00000000..382d3e7b
Binary files /dev/null and b/frontend/public/favicon.ico differ
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
new file mode 100644
index 00000000..fc1470ec
--- /dev/null
+++ b/frontend/src/App.tsx
@@ -0,0 +1,78 @@
+import { lazy, Suspense } from 'react'
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
+import { BrowserRouter, Routes, Route } from 'react-router-dom'
+import { Toaster } from '@/components/ui/sonner'
+import { ThemeProvider } from '@/components/theme-provider'
+import { AuthProvider } from '@/contexts/auth-context'
+import { ProtectedRoute } from '@/components/protected-route'
+import { AppLayout } from '@/components/app-layout'
+
+const SetupPage = lazy(() => import('@/pages/setup'))
+const LoginPage = lazy(() => import('@/pages/login'))
+const RegisterPage = lazy(() => import('@/pages/register'))
+const DashboardPage = lazy(() => import('@/pages/dashboard'))
+const TransactionsPage = lazy(() => import('@/pages/transactions'))
+const AccountsPage = lazy(() => import('@/pages/accounts'))
+const AccountDetailPage = lazy(() => import('@/pages/account-detail'))
+const ImportPage = lazy(() => import('@/pages/import'))
+const RulesPage = lazy(() => import('@/pages/rules'))
+const CategoriesPage = lazy(() => import('@/pages/categories'))
+const BudgetsPage = lazy(() => import('@/pages/budgets'))
+const RecurringPage = lazy(() => import('@/pages/recurring'))
+
+const queryClient = new QueryClient({
+ defaultOptions: {
+ queries: {
+ staleTime: 1000 * 60 * 5,
+ retry: 1,
+ },
+ },
+})
+
+function LoadingFallback() {
+ return (
+ <div className="flex items-center justify-center min-h-[50vh]">
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary" />
+ </div>
+ )
+}
+
+function App() {
+ return (
+ <ThemeProvider>
+ <QueryClientProvider client={queryClient}>
+ <BrowserRouter>
+ <AuthProvider>
+ <Suspense fallback={<LoadingFallback />}>
+ <Routes>
+ <Route path="/setup" element={<SetupPage />} />
+ <Route path="/login" element={<LoginPage />} />
+ <Route path="/register" element={<RegisterPage />} />
+ <Route
+ element={
+ <ProtectedRoute>
+ <AppLayout />
+ </ProtectedRoute>
+ }
+ >
+ <Route path="/" element={<DashboardPage />} />
+ <Route path="/transactions" element={<TransactionsPage />} />
+ <Route path="/accounts" element={<AccountsPage />} />
+ <Route path="/accounts/:id" element={<AccountDetailPage />} />
+ <Route path="/import" element={<ImportPage />} />
+ <Route path="/rules" element={<RulesPage />} />
+ <Route path="/categories" element={<CategoriesPage />} />
+ <Route path="/budgets" element={<BudgetsPage />} />
+ <Route path="/recurring" element={<RecurringPage />} />
+ </Route>
+ </Routes>
+ </Suspense>
+ <Toaster />
+ </AuthProvider>
+ </BrowserRouter>
+ </QueryClientProvider>
+ </ThemeProvider>
+ )
+}
+
+export default App
diff --git a/frontend/src/components/app-layout.tsx b/frontend/src/components/app-layout.tsx
new file mode 100644
index 00000000..19f32398
--- /dev/null
+++ b/frontend/src/components/app-layout.tsx
@@ -0,0 +1,355 @@
+import { useState, useCallback } from 'react'
+import { Link, Outlet, useLocation } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { useQuery } from '@tanstack/react-query'
+import { useAuth } from '@/contexts/auth-context'
+import { auth as authApi } from '@/lib/api'
+import { OnboardingTour } from '@/components/onboarding-tour'
+import { useTheme } from 'next-themes'
+import { accounts as accountsApi } from '@/lib/api'
+import { Button } from '@/components/ui/button'
+import { Avatar, AvatarFallback } from '@/components/ui/avatar'
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from '@/components/ui/dropdown-menu'
+import { cn } from '@/lib/utils'
+import { ShellLogo } from '@/components/shell-logo'
+import {
+ LayoutDashboard,
+ ArrowLeftRight,
+ Building2,
+ SlidersHorizontal,
+ Upload,
+ LogOut,
+ Menu,
+ ChevronRight,
+ Tag,
+ PiggyBank,
+ Eye,
+ EyeOff,
+ Repeat,
+ Sun,
+ Moon,
+} from 'lucide-react'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+
+const navItems = [
+ { key: 'dashboard', path: '/', icon: LayoutDashboard },
+ { key: 'transactions', path: '/transactions', icon: ArrowLeftRight },
+ { key: 'accounts', path: '/accounts', icon: Building2 },
+ { key: 'categories', path: '/categories', icon: Tag },
+ { key: 'budgets', path: '/budgets', icon: PiggyBank },
+ { key: 'recurring', path: '/recurring', icon: Repeat },
+ { key: 'rules', path: '/rules', icon: SlidersHorizontal },
+ { key: 'import', path: '/import', icon: Upload },
+] as const
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+export function AppLayout() {
+ const { t, i18n } = useTranslation()
+ const { user, logout, updateUser } = useAuth()
+ const userCurrency = user?.preferences?.currency_display ?? 'BRL'
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const { theme, setTheme } = useTheme()
+ const location = useLocation()
+ const [sidebarOpen, setSidebarOpen] = useState(false)
+ const [accountsExpanded, setAccountsExpanded] = useState(true)
+ const { privacyMode, togglePrivacyMode, mask } = usePrivacyMode()
+
+ const showTour = user && !user.preferences?.onboarding_completed && !localStorage.getItem('onboarding_completed')
+
+ const handleTourComplete = useCallback(async () => {
+ localStorage.setItem('onboarding_completed', 'true')
+ try {
+ const prefs = { ...(user?.preferences || {}), onboarding_completed: true }
+ const updated = await authApi.updateMe({ preferences: prefs })
+ updateUser(updated)
+ } catch {
+ // localStorage fallback is already set
+ }
+ }, [user, updateUser])
+
+ const userInitial = user?.email?.charAt(0).toUpperCase() ?? '?'
+ const currentLang = i18n.language
+
+ const { data: accountsList } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accountsApi.list(),
+ })
+
+ const allAccounts = accountsList ?? []
+ const totalBalance = allAccounts.reduce((sum, a) => {
+ return sum + Number(a.current_balance)
+ }, 0)
+
+ return (
+ <div className="min-h-screen bg-background">
+ {/* Mobile header */}
+ <header className="sticky top-0 z-40 flex h-14 items-center gap-3 bg-sidebar border-b border-sidebar-border px-4 lg:hidden">
+ <button
+ onClick={() => setSidebarOpen(!sidebarOpen)}
+ className="text-sidebar-muted hover:text-sidebar-foreground transition-colors"
+ aria-label="Toggle menu"
+ >
+ <Menu size={20} />
+ </button>
+ <div className="flex items-center gap-2">
+ <ShellLogo size={22} className="text-primary shrink-0" />
+ <span className="font-bold text-sidebar-foreground">{t('app.name')}</span>
+ </div>
+ <div className="ml-auto flex items-center gap-2">
+ <button
+ onClick={togglePrivacyMode}
+ className="text-sidebar-muted hover:text-sidebar-foreground transition-colors p-1"
+ title={privacyMode ? t('privacy.show') : t('privacy.hide')}
+ >
+ {privacyMode ? <EyeOff size={18} /> : <Eye size={18} />}
+ </button>
+ <UserMenu userInitial={userInitial} logout={logout} dark />
+ </div>
+ </header>
+
+ <div className="flex">
+ {/* Sidebar overlay for mobile */}
+ {sidebarOpen && (
+ <div
+ className="fixed inset-0 z-40 bg-black/50 lg:hidden"
+ onClick={() => setSidebarOpen(false)}
+ />
+ )}
+
+ {/* Sidebar */}
+ <aside
+ className={cn(
+ 'fixed inset-y-0 left-0 z-50 w-60 bg-sidebar border-r border-sidebar-border flex flex-col transform transition-transform lg:translate-x-0 shrink-0 overflow-y-auto',
+ sidebarOpen ? 'translate-x-0' : '-translate-x-full'
+ )}
+ >
+ {/* Logo */}
+ <div className="flex h-16 items-center justify-between px-5 border-b border-sidebar-border">
+ <div className="flex items-center gap-2.5">
+ <ShellLogo size={24} className="text-primary shrink-0" />
+ <span className="font-bold text-lg text-sidebar-foreground tracking-tight">{t('app.name')}</span>
+ </div>
+ <button
+ onClick={togglePrivacyMode}
+ className="text-sidebar-muted hover:text-sidebar-foreground transition-colors p-1 rounded-md hover:bg-sidebar-accent"
+ title={privacyMode ? t('privacy.show') : t('privacy.hide')}
+ >
+ {privacyMode ? <EyeOff size={16} /> : <Eye size={16} />}
+ </button>
+ </div>
+
+ {/* Nav */}
+ <nav className="flex flex-col gap-1 p-3" data-tour="sidebar">
+ {navItems.map((item) => {
+ const isActive = item.path === '/'
+ ? location.pathname === '/'
+ : location.pathname.startsWith(item.path)
+ const Icon = item.icon
+ return (
+ <Link
+ key={item.key}
+ to={item.path}
+ data-tour={`nav-${item.key}`}
+ onClick={() => setSidebarOpen(false)}
+ className={cn(
+ 'flex items-center gap-3 text-[15px] font-medium transition-all',
+ isActive
+ ? 'bg-primary/[0.08] text-primary rounded-lg border-l-[3px] border-primary pl-[9px] pr-3 py-2'
+ : 'rounded-lg px-3 py-2 text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground'
+ )}
+ >
+ <Icon
+ size={20}
+ className={cn('shrink-0', isActive ? 'text-primary' : 'text-sidebar-muted')}
+ />
+ <span>{t(`nav.${item.key}`)}</span>
+ </Link>
+ )
+ })}
+ </nav>
+
+ {/* Account list in sidebar */}
+ {allAccounts.length > 0 && (
+ <div className="px-3 pb-2 mt-2">
+ <button
+ onClick={() => setAccountsExpanded(!accountsExpanded)}
+ className="flex items-center justify-between w-full px-3 py-2 hover:text-sidebar-foreground transition-colors"
+ >
+ <span className="text-[11px] uppercase tracking-[0.12em] font-semibold text-sidebar-muted">{t('accounts.title')}</span>
+ <div className="flex items-center gap-2">
+ <span className={`tabular-nums font-medium text-xs ${totalBalance < 0 ? 'text-rose-400' : 'text-sidebar-muted'}`}>
+ {mask(formatCurrency(totalBalance, userCurrency, locale))}
+ </span>
+ <ChevronRight
+ size={12}
+ className={cn('text-sidebar-muted transition-transform', accountsExpanded && 'rotate-90')}
+ />
+ </div>
+ </button>
+ {accountsExpanded && (
+ <div className="mt-1 space-y-0.5">
+ {allAccounts.map((acc) => {
+ const balance = Number(acc.current_balance)
+ const prevBalance = acc.previous_balance ?? 0
+ const pctChange = prevBalance !== 0
+ ? ((balance - prevBalance) / Math.abs(prevBalance)) * 100
+ : null
+ const typeKey = acc.type.replace(/_([a-z])/g, (_, c: string) => c.toUpperCase()).replace(/^./, c => c.toUpperCase())
+
+ return (
+ <Link
+ key={acc.id}
+ to={`/accounts/${acc.id}`}
+ onClick={() => setSidebarOpen(false)}
+ className="flex items-center justify-between px-3 py-2 rounded-lg text-[13px] text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground transition-all"
+ >
+ <div className="truncate min-w-0">
+ <span className="block truncate">{acc.name}</span>
+ <span className="block text-[11px] text-sidebar-muted/60">
+ {t(`accounts.type${typeKey}`)}
+ </span>
+ </div>
+ <div className="text-right shrink-0 ml-2">
+ <span className={`block tabular-nums font-medium text-[13px] ${balance < 0 ? 'text-rose-400' : 'text-sidebar-foreground'}`}>
+ {mask(formatCurrency(balance, acc.currency))}
+ </span>
+ {pctChange !== null && (
+ <span className={`block text-[11px] tabular-nums font-medium ${pctChange >= 0 ? 'text-emerald-400' : 'text-rose-400'}`}>
+ {mask(`${pctChange >= 0 ? '+' : ''}${pctChange.toFixed(1)}%`)}
+ </span>
+ )}
+ </div>
+ </Link>
+ )
+ })}
+ </div>
+ )}
+ </div>
+ )}
+
+ <div className="flex-1" />
+
+ {/* Language & Theme toggles */}
+ <div className="group/toggles px-3 pb-2 border-b border-sidebar-border">
+ <div className="flex items-center justify-between gap-2 px-1 py-2">
+ {/* Language toggle */}
+ <div className="flex items-center gap-1">
+ <button
+ onClick={() => i18n.changeLanguage('pt-BR')}
+ className={cn(
+ 'px-2 py-1 rounded text-[11px] font-semibold transition-all duration-300',
+ currentLang === 'pt-BR'
+ ? 'bg-primary/15 text-primary group-hover/toggles:bg-primary/25'
+ : 'text-sidebar-muted/40 group-hover/toggles:text-sidebar-muted group-hover/toggles:hover:text-sidebar-foreground'
+ )}
+ >
+ PT
+ </button>
+ <button
+ onClick={() => i18n.changeLanguage('en')}
+ className={cn(
+ 'px-2 py-1 rounded text-[11px] font-semibold transition-all duration-300',
+ currentLang === 'en'
+ ? 'bg-primary/15 text-primary group-hover/toggles:bg-primary/25'
+ : 'text-sidebar-muted/40 group-hover/toggles:text-sidebar-muted group-hover/toggles:hover:text-sidebar-foreground'
+ )}
+ >
+ EN
+ </button>
+ </div>
+ {/* Theme toggle */}
+ <div className="flex items-center gap-1">
+ <button
+ onClick={() => setTheme('light')}
+ className={cn(
+ 'p-1.5 rounded transition-all duration-300',
+ theme === 'light'
+ ? 'bg-primary/15 text-primary group-hover/toggles:bg-primary/25'
+ : 'text-sidebar-muted/40 group-hover/toggles:text-sidebar-muted group-hover/toggles:hover:text-sidebar-foreground'
+ )}
+ >
+ <Sun size={14} />
+ </button>
+ <button
+ onClick={() => setTheme('dark')}
+ className={cn(
+ 'p-1.5 rounded transition-all duration-300',
+ theme === 'dark'
+ ? 'bg-primary/15 text-primary group-hover/toggles:bg-primary/25'
+ : 'text-sidebar-muted/40 group-hover/toggles:text-sidebar-muted group-hover/toggles:hover:text-sidebar-foreground'
+ )}
+ >
+ <Moon size={14} />
+ </button>
+ </div>
+ </div>
+ </div>
+
+ {/* User section */}
+ <div className="p-3">
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <button className="flex items-center gap-3 w-full rounded-lg px-3 py-2.5 text-sm hover:bg-sidebar-accent transition-colors text-left">
+ <Avatar className="h-7 w-7 shrink-0">
+ <AvatarFallback className="bg-primary/20 text-primary text-xs font-semibold">
+ {userInitial}
+ </AvatarFallback>
+ </Avatar>
+ <span className="text-xs text-sidebar-muted truncate flex-1">{user?.email}</span>
+ </button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end" className="w-48" side="top">
+ <DropdownMenuItem
+ onClick={logout}
+ className="flex items-center gap-2 text-rose-600 focus:text-rose-600"
+ >
+ <LogOut size={14} />
+ {t('auth.logout')}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ </div>
+ </aside>
+
+ {/* Main content */}
+ <main className="flex-1 min-h-screen overflow-x-hidden lg:ml-60">
+ <div className="p-6 max-w-7xl mx-auto">
+ <Outlet />
+ </div>
+ </main>
+ </div>
+
+ {showTour && <OnboardingTour onComplete={handleTourComplete} />}
+ </div>
+ )
+}
+
+function UserMenu({ userInitial, logout, dark }: { userInitial: string; logout: () => void; dark?: boolean }) {
+ const { t } = useTranslation()
+ return (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="ghost" className="relative h-8 w-8 rounded-full p-0">
+ <Avatar className="h-8 w-8">
+ <AvatarFallback className={dark ? 'bg-primary/20 text-primary text-xs font-semibold' : 'bg-primary/10 text-primary text-xs font-semibold'}>
+ {userInitial}
+ </AvatarFallback>
+ </Avatar>
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent align="end">
+ <DropdownMenuItem onClick={logout} className="text-rose-600 focus:text-rose-600">
+ {t('auth.logout')}
+ </DropdownMenuItem>
+ </DropdownMenuContent>
+ </DropdownMenu>
+ )
+}
diff --git a/frontend/src/components/bank-connect-dialog.tsx b/frontend/src/components/bank-connect-dialog.tsx
new file mode 100644
index 00000000..fe4310fe
--- /dev/null
+++ b/frontend/src/components/bank-connect-dialog.tsx
@@ -0,0 +1,89 @@
+import { useState, useEffect } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQueryClient } from '@tanstack/react-query'
+import { PluggyConnect } from 'react-pluggy-connect'
+import { connections } from '@/lib/api'
+import { toast } from 'sonner'
+
+interface BankConnectDialogProps {
+ open: boolean
+ onClose: () => void
+ reconnectConnectionId?: string
+ updateItemId?: string
+ provider?: string
+}
+
+export function BankConnectDialog({
+ open,
+ onClose,
+ reconnectConnectionId,
+ updateItemId,
+ provider = 'pluggy',
+}: BankConnectDialogProps) {
+ const { t } = useTranslation()
+ const queryClient = useQueryClient()
+ const [connectToken, setConnectToken] = useState<string | null>(null)
+
+ useEffect(() => {
+ if (!open) {
+ setConnectToken(null)
+ return
+ }
+
+ let cancelled = false
+ const fetchToken = async () => {
+ try {
+ const token = reconnectConnectionId
+ ? await connections.getReconnectToken(reconnectConnectionId)
+ : await connections.getConnectToken(provider)
+ if (!cancelled) setConnectToken(token)
+ } catch {
+ if (!cancelled) {
+ toast.error(t('accounts.connectError'))
+ onClose()
+ }
+ }
+ }
+ fetchToken()
+
+ return () => { cancelled = true }
+ }, [open, reconnectConnectionId, provider])
+
+ const handleSuccess = async (data: { item: { id: string } }) => {
+ try {
+ if (reconnectConnectionId) {
+ await connections.sync(reconnectConnectionId)
+ } else {
+ await connections.handleCallback(data.item.id, provider)
+ }
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['connections'] })
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ toast.success(t('accounts.connected'))
+ } catch {
+ toast.error(t('accounts.connectError'))
+ } finally {
+ handleClose()
+ }
+ }
+
+ const handleClose = () => {
+ setConnectToken(null)
+ onClose()
+ }
+
+ if (!open || !connectToken) return null
+
+ return (
+ <PluggyConnect
+ connectToken={connectToken}
+ updateItem={updateItemId}
+ onSuccess={handleSuccess}
+ onClose={handleClose}
+ onError={() => {
+ toast.error(t('accounts.connectError'))
+ handleClose()
+ }}
+ />
+ )
+}
diff --git a/frontend/src/components/category-icon.tsx b/frontend/src/components/category-icon.tsx
new file mode 100644
index 00000000..07dd65da
--- /dev/null
+++ b/frontend/src/components/category-icon.tsx
@@ -0,0 +1,46 @@
+import { ICON_MAP, isEmoji } from '@/lib/category-icons'
+import { CircleHelp } from 'lucide-react'
+import { cn } from '@/lib/utils'
+
+const SIZES = {
+ sm: { box: 'w-6 h-6 rounded-md', icon: 14 },
+ md: { box: 'w-8 h-8 rounded-lg', icon: 16 },
+ lg: { box: 'w-10 h-10 rounded-xl', icon: 20 },
+ xl: { box: 'w-11 h-11 rounded-xl', icon: 22 },
+} as const
+
+interface CategoryIconProps {
+ icon: string | null | undefined
+ color: string | null | undefined
+ size?: keyof typeof SIZES
+ className?: string
+}
+
+export function CategoryIcon({ icon, color, size = 'md', className }: CategoryIconProps) {
+ const { box, icon: iconSize } = SIZES[size]
+ const bgColor = color || '#6B7280'
+ const iconStr = icon || 'circle-help'
+
+ // Emoji fallback for backward compatibility
+ if (isEmoji(iconStr)) {
+ return (
+ <div
+ className={cn(box, 'flex items-center justify-center shrink-0', className)}
+ style={{ backgroundColor: bgColor }}
+ >
+ <span style={{ fontSize: iconSize - 2, lineHeight: 1 }}>{iconStr}</span>
+ </div>
+ )
+ }
+
+ const LucideIcon = ICON_MAP[iconStr] ?? CircleHelp
+
+ return (
+ <div
+ className={cn(box, 'flex items-center justify-center shrink-0', className)}
+ style={{ backgroundColor: bgColor }}
+ >
+ <LucideIcon size={iconSize} className="text-white" strokeWidth={2} />
+ </div>
+ )
+}
diff --git a/frontend/src/components/connection-settings-dialog.tsx b/frontend/src/components/connection-settings-dialog.tsx
new file mode 100644
index 00000000..14c3e19a
--- /dev/null
+++ b/frontend/src/components/connection-settings-dialog.tsx
@@ -0,0 +1,100 @@
+import { useState, useEffect } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
+import { connections } from '@/lib/api'
+import { toast } from 'sonner'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import { Button } from '@/components/ui/button'
+import { Label } from '@/components/ui/label'
+import type { BankConnection, ConnectionSettings } from '@/types'
+
+type PayeeSource = NonNullable<ConnectionSettings['payee_source']>
+
+interface ConnectionSettingsDialogProps {
+ open: boolean
+ onClose: () => void
+ connection: BankConnection | null
+}
+
+export function ConnectionSettingsDialog({
+ open,
+ onClose,
+ connection,
+}: ConnectionSettingsDialogProps) {
+ const { t } = useTranslation()
+ const queryClient = useQueryClient()
+
+ const [payeeSource, setPayeeSource] = useState<PayeeSource>('auto')
+ const [importPending, setImportPending] = useState(true)
+
+ useEffect(() => {
+ if (connection) {
+ setPayeeSource(connection.settings?.payee_source ?? 'auto')
+ setImportPending(connection.settings?.import_pending ?? true)
+ }
+ }, [connection])
+
+ const mutation = useMutation({
+ mutationFn: () =>
+ connections.updateSettings(connection!.id, {
+ payee_source: payeeSource,
+ import_pending: importPending,
+ }),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['connections'] })
+ toast.success(t('accounts.updated'))
+ onClose()
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ return (
+ <Dialog open={open} onOpenChange={onClose}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{t('connections.settings')}</DialogTitle>
+ </DialogHeader>
+ <div className="space-y-4">
+ <div className="space-y-2">
+ <Label>{t('connections.payeeSource')}</Label>
+ <select
+ className="w-full border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={payeeSource}
+ onChange={(e) => setPayeeSource(e.target.value as PayeeSource)}
+ >
+ <option value="auto">{t('connections.payeeAuto')}</option>
+ <option value="merchant">{t('connections.payeeMerchant')}</option>
+ <option value="payment_data">{t('connections.payeePaymentData')}</option>
+ <option value="description">{t('connections.payeeDescription')}</option>
+ <option value="none">{t('connections.payeeNone')}</option>
+ </select>
+ </div>
+ <div className="flex items-center justify-between">
+ <Label htmlFor="import-pending">{t('connections.importPending')}</Label>
+ <input
+ id="import-pending"
+ type="checkbox"
+ checked={importPending}
+ onChange={(e) => setImportPending(e.target.checked)}
+ className="h-4 w-4 rounded border-border text-primary focus:ring-primary"
+ />
+ </div>
+ </div>
+ <DialogFooter>
+ <Button variant="outline" onClick={onClose}>
+ {t('common.cancel')}
+ </Button>
+ <Button onClick={() => mutation.mutate()} disabled={mutation.isPending}>
+ {mutation.isPending ? t('common.loading') : t('common.save')}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ )
+}
diff --git a/frontend/src/components/connector-select-dialog.tsx b/frontend/src/components/connector-select-dialog.tsx
new file mode 100644
index 00000000..f2e1aeb9
--- /dev/null
+++ b/frontend/src/components/connector-select-dialog.tsx
@@ -0,0 +1,93 @@
+import { useEffect, useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { connections } from '@/lib/api'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+} from '@/components/ui/dialog'
+import { Building2 } from 'lucide-react'
+
+interface Provider {
+ name: string
+ display_name: string
+ description: string
+ flow_type: string
+ configured: boolean
+}
+
+interface ConnectorSelectDialogProps {
+ open: boolean
+ onClose: () => void
+ onSelect: (providerName: string) => void
+}
+
+export function ConnectorSelectDialog({ open, onClose, onSelect }: ConnectorSelectDialogProps) {
+ const { t } = useTranslation()
+ const [providers, setProviders] = useState<Provider[]>([])
+ const [loading, setLoading] = useState(true)
+
+ useEffect(() => {
+ if (!open) return
+ setLoading(true)
+ connections.getProviders().then((data) => {
+ setProviders(data)
+ setLoading(false)
+ }).catch(() => {
+ setProviders([])
+ setLoading(false)
+ })
+ }, [open])
+
+ return (
+ <Dialog open={open} onOpenChange={(v) => !v && onClose()}>
+ <DialogContent className="sm:max-w-md">
+ <DialogHeader>
+ <DialogTitle>{t('accounts.selectConnector')}</DialogTitle>
+ <p className="text-sm text-muted-foreground">{t('accounts.selectConnectorDesc')}</p>
+ </DialogHeader>
+ <div className="space-y-2 pt-2">
+ {loading ? (
+ <div className="flex justify-center py-8">
+ <div className="h-5 w-5 animate-spin rounded-full border-2 border-primary border-t-transparent" />
+ </div>
+ ) : providers.length === 0 ? (
+ <p className="text-sm text-muted-foreground text-center py-8">
+ {t('accounts.noConnectorsAvailable')}
+ </p>
+ ) : (
+ providers.map((p) => (
+ <button
+ key={p.name}
+ disabled={!p.configured}
+ onClick={() => {
+ onSelect(p.name)
+ onClose()
+ }}
+ className={`w-full flex items-start gap-3 rounded-lg border p-4 text-left transition-colors ${
+ p.configured
+ ? 'border-border hover:border-primary hover:bg-muted/50 cursor-pointer'
+ : 'border-border/50 opacity-60 cursor-not-allowed'
+ }`}
+ >
+ <div className="w-9 h-9 rounded-lg bg-muted flex items-center justify-center shrink-0 mt-0.5">
+ <Building2 size={16} className="text-muted-foreground" />
+ </div>
+ <div className="min-w-0 flex-1">
+ <p className="text-sm font-medium text-foreground">{p.display_name}</p>
+ <p className="text-xs text-muted-foreground mt-0.5">{p.description}</p>
+ {!p.configured && (
+ <p className="text-xs text-amber-600 mt-1.5">
+ {t('accounts.connectorNotConfigured')}
+ </p>
+ )}
+ </div>
+ </button>
+ ))
+ )}
+ </div>
+ </DialogContent>
+ </Dialog>
+ )
+}
diff --git a/frontend/src/components/icon-picker.tsx b/frontend/src/components/icon-picker.tsx
new file mode 100644
index 00000000..25d57bb0
--- /dev/null
+++ b/frontend/src/components/icon-picker.tsx
@@ -0,0 +1,67 @@
+import { useState, useMemo } from 'react'
+import { CATEGORY_ICONS } from '@/lib/category-icons'
+import { cn } from '@/lib/utils'
+
+interface IconPickerProps {
+ value: string
+ color: string
+ onChange: (iconName: string) => void
+}
+
+export function IconPicker({ value, color, onChange }: IconPickerProps) {
+ const [search, setSearch] = useState('')
+
+ const filtered = useMemo(() => {
+ if (!search.trim()) return CATEGORY_ICONS
+ const q = search.toLowerCase()
+ return CATEGORY_ICONS.filter(
+ (entry) =>
+ entry.name.includes(q) ||
+ entry.label.toLowerCase().includes(q)
+ )
+ }, [search])
+
+ return (
+ <div className="space-y-2">
+ <input
+ type="text"
+ placeholder="Buscar ícone..."
+ className="w-full border border-border rounded-lg px-3 py-1.5 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={search}
+ onChange={(e) => setSearch(e.target.value)}
+ />
+ <div className="grid grid-cols-8 gap-1.5 max-h-48 overflow-y-auto p-1">
+ {filtered.map((entry) => {
+ const isSelected = value === entry.name
+ const Icon = entry.icon
+ return (
+ <button
+ key={entry.name}
+ type="button"
+ title={entry.label}
+ className={cn(
+ 'w-9 h-9 rounded-lg flex items-center justify-center transition-all',
+ isSelected
+ ? 'ring-2 ring-offset-1 ring-primary'
+ : 'hover:bg-muted'
+ )}
+ style={isSelected ? { backgroundColor: color || '#6B7280' } : undefined}
+ onClick={() => onChange(entry.name)}
+ >
+ <Icon
+ size={18}
+ className={isSelected ? 'text-white' : 'text-muted-foreground'}
+ strokeWidth={2}
+ />
+ </button>
+ )
+ })}
+ {filtered.length === 0 && (
+ <p className="col-span-8 text-xs text-muted-foreground text-center py-4">
+ Nenhum ícone encontrado
+ </p>
+ )}
+ </div>
+ </div>
+ )
+}
diff --git a/frontend/src/components/onboarding-tour.tsx b/frontend/src/components/onboarding-tour.tsx
new file mode 100644
index 00000000..2675abfa
--- /dev/null
+++ b/frontend/src/components/onboarding-tour.tsx
@@ -0,0 +1,161 @@
+import { useState, useEffect, useCallback, useRef } from 'react'
+import { useTranslation } from 'react-i18next'
+import { Button } from '@/components/ui/button'
+
+interface TourStep {
+ target: string
+ titleKey: string
+ descKey: string
+}
+
+const STEPS: TourStep[] = [
+ { target: '[data-tour="sidebar"]', titleKey: 'onboarding.sidebar', descKey: 'onboarding.sidebarDesc' },
+ { target: '[data-tour="nav-dashboard"]', titleKey: 'onboarding.dashboard', descKey: 'onboarding.dashboardDesc' },
+ { target: '[data-tour="nav-accounts"]', titleKey: 'onboarding.accounts', descKey: 'onboarding.accountsDesc' },
+ { target: '[data-tour="nav-transactions"]', titleKey: 'onboarding.transactions', descKey: 'onboarding.transactionsDesc' },
+ { target: '[data-tour="nav-import"]', titleKey: 'onboarding.import', descKey: 'onboarding.importDesc' },
+ { target: '[data-tour="nav-categories"]', titleKey: 'onboarding.categories', descKey: 'onboarding.categoriesDesc' },
+]
+
+interface Props {
+ onComplete: () => void
+}
+
+export function OnboardingTour({ onComplete }: Props) {
+ const { t } = useTranslation()
+ const [current, setCurrent] = useState(0)
+ const [rect, setRect] = useState<DOMRect | null>(null)
+ const tooltipRef = useRef<HTMLDivElement>(null)
+
+ const updateRect = useCallback(() => {
+ const step = STEPS[current]
+ const el = document.querySelector(step.target)
+ if (el) {
+ setRect(el.getBoundingClientRect())
+ }
+ }, [current])
+
+ useEffect(() => {
+ // Small delay to let the sidebar render
+ const timer = setTimeout(updateRect, 100)
+ window.addEventListener('resize', updateRect)
+ window.addEventListener('scroll', updateRect, true)
+ return () => {
+ clearTimeout(timer)
+ window.removeEventListener('resize', updateRect)
+ window.removeEventListener('scroll', updateRect, true)
+ }
+ }, [updateRect])
+
+ const next = () => {
+ if (current < STEPS.length - 1) {
+ setCurrent(current + 1)
+ } else {
+ onComplete()
+ }
+ }
+
+ const back = () => {
+ if (current > 0) {
+ setCurrent(current - 1)
+ }
+ }
+
+ const step = STEPS[current]
+ const pad = 6
+
+ // Tooltip position: to the right of the target element
+ const tooltipStyle: React.CSSProperties = rect
+ ? {
+ position: 'fixed',
+ top: Math.max(8, Math.min(rect.top, window.innerHeight - 220)),
+ left: rect.right + 16,
+ zIndex: 10001,
+ maxWidth: 320,
+ }
+ : { display: 'none' }
+
+ // If tooltip would go off screen right, put it below instead
+ if (rect && rect.right + 16 + 320 > window.innerWidth) {
+ tooltipStyle.left = Math.max(8, rect.left)
+ tooltipStyle.top = rect.bottom + 12
+ }
+
+ return (
+ <>
+ {/* Overlay: 4 rectangles around the spotlight */}
+ {rect && (
+ <div className="fixed inset-0 z-[10000] pointer-events-none">
+ {/* Top */}
+ <div
+ className="absolute bg-black/50 pointer-events-auto transition-all duration-300"
+ style={{ top: 0, left: 0, right: 0, height: Math.max(0, rect.top - pad) }}
+ />
+ {/* Bottom */}
+ <div
+ className="absolute bg-black/50 pointer-events-auto transition-all duration-300"
+ style={{ top: rect.bottom + pad, left: 0, right: 0, bottom: 0 }}
+ />
+ {/* Left */}
+ <div
+ className="absolute bg-black/50 pointer-events-auto transition-all duration-300"
+ style={{
+ top: Math.max(0, rect.top - pad),
+ left: 0,
+ width: Math.max(0, rect.left - pad),
+ height: rect.height + pad * 2,
+ }}
+ />
+ {/* Right */}
+ <div
+ className="absolute bg-black/50 pointer-events-auto transition-all duration-300"
+ style={{
+ top: Math.max(0, rect.top - pad),
+ left: rect.right + pad,
+ right: 0,
+ height: rect.height + pad * 2,
+ }}
+ />
+ {/* Spotlight border */}
+ <div
+ className="absolute rounded-lg ring-2 ring-primary/50 transition-all duration-300"
+ style={{
+ top: rect.top - pad,
+ left: rect.left - pad,
+ width: rect.width + pad * 2,
+ height: rect.height + pad * 2,
+ }}
+ />
+ </div>
+ )}
+
+ {/* Tooltip */}
+ <div ref={tooltipRef} style={tooltipStyle} className="pointer-events-auto">
+ <div className="bg-popover text-popover-foreground rounded-xl shadow-lg border p-5 space-y-3">
+ <div className="flex items-center justify-between">
+ <h3 className="font-semibold text-base">{t(step.titleKey)}</h3>
+ <span className="text-xs text-muted-foreground tabular-nums">
+ {current + 1}/{STEPS.length}
+ </span>
+ </div>
+ <p className="text-sm text-muted-foreground leading-relaxed">{t(step.descKey)}</p>
+ <div className="flex items-center justify-between pt-1">
+ <Button variant="ghost" size="sm" onClick={onComplete} className="text-muted-foreground">
+ {t('onboarding.skip')}
+ </Button>
+ <div className="flex gap-2">
+ {current > 0 && (
+ <Button variant="outline" size="sm" onClick={back}>
+ {t('onboarding.back')}
+ </Button>
+ )}
+ <Button size="sm" onClick={next}>
+ {current === STEPS.length - 1 ? t('onboarding.finish') : t('onboarding.next')}
+ </Button>
+ </div>
+ </div>
+ </div>
+ </div>
+ </>
+ )
+}
diff --git a/frontend/src/components/page-header.tsx b/frontend/src/components/page-header.tsx
new file mode 100644
index 00000000..8c929149
--- /dev/null
+++ b/frontend/src/components/page-header.tsx
@@ -0,0 +1,20 @@
+// frontend/src/components/page-header.tsx
+interface PageHeaderProps {
+ section: string
+ title: string
+ action?: React.ReactNode
+}
+
+export function PageHeader({ section, title, action }: PageHeaderProps) {
+ return (
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between mb-6">
+ <div>
+ <p className="text-xs font-medium text-muted-foreground mb-0.5">
+ {section}
+ </p>
+ <h1 className="text-2xl font-semibold text-foreground tracking-tight">{title}</h1>
+ </div>
+ {action}
+ </div>
+ )
+}
diff --git a/frontend/src/components/protected-route.tsx b/frontend/src/components/protected-route.tsx
new file mode 100644
index 00000000..8235220b
--- /dev/null
+++ b/frontend/src/components/protected-route.tsx
@@ -0,0 +1,20 @@
+import { Navigate } from 'react-router-dom'
+import { useAuth } from '@/contexts/auth-context'
+
+export function ProtectedRoute({ children }: { children: React.ReactNode }) {
+ const { token, isLoading } = useAuth()
+
+ if (isLoading) {
+ return (
+ <div className="flex items-center justify-center min-h-screen">
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary" />
+ </div>
+ )
+ }
+
+ if (!token) {
+ return <Navigate to="/login" replace />
+ }
+
+ return <>{children}</>
+}
diff --git a/frontend/src/components/shell-logo.tsx b/frontend/src/components/shell-logo.tsx
new file mode 100644
index 00000000..4e03ff5a
--- /dev/null
+++ b/frontend/src/components/shell-logo.tsx
@@ -0,0 +1,23 @@
+interface ShellLogoProps {
+ size?: number
+ className?: string
+}
+
+export function ShellLogo({ size = 24, className }: ShellLogoProps) {
+ return (
+ <svg
+ width={size}
+ height={size}
+ viewBox="0 0 460 460"
+ preserveAspectRatio="xMidYMid meet"
+ xmlns="http://www.w3.org/2000/svg"
+ className={className}
+ >
+ <g transform="translate(0,460) scale(0.1,-0.1)" fill="currentColor" stroke="none">
+ <path d="M2125 4149 c-222 -23 -430 -97 -652 -232 -66 -40 -103 -68 -103 -79 0 -9 19 -59 41 -110 197 -446 465 -1250 614 -1845 61 -242 56 -233 -140 252 -299 743 -439 1057 -601 1355 -132 242 -116 226 -200 210 -95 -18 -242 -94 -335 -173 -91 -78 -219 -246 -219 -287 0 -11 364 -501 695 -935 75 -99 202 -265 281 -370 79 -104 200 -264 269 -355 69 -90 125 -168 125 -172 0 -10 -239 236 -405 417 -70 77 -172 187 -225 245 -102 111 -597 675 -764 870 -54 63 -101 116 -106 118 -19 7 -147 -149 -188 -231 -69 -137 -83 -193 -89 -352 -5 -137 -5 -143 24 -227 69 -198 189 -332 419 -462 128 -74 473 -256 889 -470 94 -49 289 -150 435 -226 336 -175 381 -189 500 -154 29 8 193 89 364 178 171 90 435 227 586 306 607 316 773 409 857 481 118 101 213 247 249 379 25 94 23 270 -5 375 -33 126 -102 255 -178 336 l-66 70 -30 -28 c-38 -36 -176 -191 -477 -538 -283 -326 -309 -355 -576 -649 -251 -276 -410 -443 -418 -435 -5 5 65 102 260 354 158 206 589 774 936 1235 l176 235 -30 57 c-97 182 -323 356 -529 405 l-71 17 -19 -23 c-33 -41 -190 -338 -282 -535 -121 -259 -232 -522 -433 -1025 -93 -233 -170 -417 -172 -408 -4 18 107 434 219 827 89 308 250 766 403 1143 31 76 56 142 56 148 0 13 -149 108 -245 156 -262 131 -547 182 -840 152z"/>
+ <path d="M949 1318 c-28 -94 -31 -206 -6 -270 53 -136 217 -187 567 -174 239 8 470 29 457 42 -7 7 -985 474 -993 474 -2 0 -13 -33 -25 -72z"/>
+ <path d="M3280 1227 c-185 -89 -406 -196 -492 -237 -106 -50 -151 -77 -140 -81 85 -30 681 -46 782 -20 160 40 232 126 233 277 0 67 -29 225 -42 223 -3 0 -157 -73 -341 -162z"/>
+ </g>
+ </svg>
+ )
+}
diff --git a/frontend/src/components/theme-provider.tsx b/frontend/src/components/theme-provider.tsx
new file mode 100644
index 00000000..207fe1e7
--- /dev/null
+++ b/frontend/src/components/theme-provider.tsx
@@ -0,0 +1,10 @@
+import { ThemeProvider as NextThemesProvider } from 'next-themes'
+import type { ReactNode } from 'react'
+
+export function ThemeProvider({ children }: { children: ReactNode }) {
+ return (
+ <NextThemesProvider attribute="class" defaultTheme="dark" enableSystem={false}>
+ {children}
+ </NextThemesProvider>
+ )
+}
diff --git a/frontend/src/components/transaction-dialog.tsx b/frontend/src/components/transaction-dialog.tsx
new file mode 100644
index 00000000..ab9fabd2
--- /dev/null
+++ b/frontend/src/components/transaction-dialog.tsx
@@ -0,0 +1,331 @@
+import { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import { DatePickerInput } from '@/components/ui/date-picker-input'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import type { Transaction, RecurringTransaction } from '@/types'
+
+export function extractApiError(error: unknown): string {
+ if (
+ error &&
+ typeof error === 'object' &&
+ 'response' in error &&
+ error.response &&
+ typeof error.response === 'object' &&
+ 'data' in error.response
+ ) {
+ const data = (error.response as { data: unknown }).data
+ if (data && typeof data === 'object' && 'detail' in data) {
+ const detail = (data as { detail: unknown }).detail
+ if (typeof detail === 'string') return detail
+ if (Array.isArray(detail)) {
+ return detail.map((d: { msg?: string; loc?: string[] }) => {
+ const field = d.loc?.slice(-1)[0] ?? ''
+ return `${field}: ${d.msg ?? 'inválido'}`
+ }).join(', ')
+ }
+ }
+ }
+ return 'Ocorreu um erro inesperado'
+}
+
+export function TransactionDialog({
+ open,
+ onClose,
+ transaction,
+ categories,
+ accounts,
+ recurringMatch,
+ onSave,
+ onDelete,
+ loading,
+ error,
+ isSynced = false,
+}: {
+ open: boolean
+ onClose: () => void
+ transaction: Transaction | null
+ categories: { id: string; name: string; icon: string }[]
+ accounts: { id: string; name: string }[]
+ recurringMatch?: RecurringTransaction
+ onSave: (data: Partial<Transaction>, recurringData?: { frequency: string; end_date?: string }) => void
+ onDelete?: () => void
+ loading: boolean
+ error: string | null
+ isSynced?: boolean
+}) {
+ const { t } = useTranslation()
+
+ return (
+ <Dialog open={open} onOpenChange={onClose}>
+ <DialogContent className="max-w-2xl">
+ <DialogHeader>
+ <DialogTitle>
+ {transaction ? t('common.edit') : t('transactions.addManual')}
+ </DialogTitle>
+ </DialogHeader>
+ <TransactionForm
+ key={transaction?.id ?? 'new'}
+ transaction={transaction}
+ categories={categories}
+ accounts={accounts}
+ recurringMatch={recurringMatch}
+ onSave={onSave}
+ onDelete={onDelete}
+ onCancel={onClose}
+ loading={loading}
+ error={error}
+ isSynced={isSynced}
+ />
+ </DialogContent>
+ </Dialog>
+ )
+}
+
+function TransactionForm({
+ transaction,
+ categories,
+ accounts,
+ recurringMatch,
+ onSave,
+ onDelete,
+ onCancel,
+ loading,
+ error,
+ isSynced,
+}: {
+ transaction: Transaction | null
+ categories: { id: string; name: string; icon: string }[]
+ accounts: { id: string; name: string }[]
+ recurringMatch?: RecurringTransaction
+ onSave: (data: Partial<Transaction>, recurringData?: { frequency: string; end_date?: string }) => void
+ onDelete?: () => void
+ onCancel: () => void
+ loading: boolean
+ error: string | null
+ isSynced: boolean
+}) {
+ const { t, i18n } = useTranslation()
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const [description, setDescription] = useState(transaction?.description ?? '')
+ const [amount, setAmount] = useState(transaction?.amount?.toString() ?? '')
+ const [date, setDate] = useState(transaction?.date ?? new Date().toISOString().split('T')[0])
+ const [type, setType] = useState<'debit' | 'credit'>(transaction?.type ?? 'debit')
+ const [currency, setCurrency] = useState(transaction?.currency ?? 'BRL')
+ const [categoryId, setCategoryId] = useState(transaction?.category_id ?? '')
+ const [accountId, setAccountId] = useState(transaction?.account_id ?? accounts[0]?.id ?? '')
+ const [notes, setNotes] = useState(transaction?.notes ?? '')
+ const [isRecurring, setIsRecurring] = useState(false)
+ const [frequency, setFrequency] = useState<'monthly' | 'weekly' | 'yearly'>('monthly')
+ const [endDate, setEndDate] = useState('')
+ const isCreating = !transaction
+
+ return (
+ <form
+ onSubmit={(e) => {
+ e.preventDefault()
+ const txData = isSynced
+ ? {
+ category_id: categoryId || undefined,
+ notes: notes.trim() || undefined,
+ } as Partial<Transaction>
+ : {
+ description,
+ amount: parseFloat(amount),
+ date,
+ type,
+ currency,
+ category_id: categoryId || undefined,
+ account_id: accountId || undefined,
+ notes: notes.trim() || undefined,
+ } as Partial<Transaction>
+ const recurringData = isCreating && isRecurring
+ ? { frequency, end_date: endDate || undefined }
+ : undefined
+ onSave(txData, recurringData)
+ }}
+ className="space-y-4"
+ >
+ {error && (
+ <div className="p-3 text-sm text-destructive bg-destructive/10 rounded-md">
+ {error}
+ </div>
+ )}
+ {isSynced && (
+ <div className="flex items-center gap-2 p-3 text-sm bg-amber-50 border border-amber-200 rounded-md text-amber-700">
+ {t('transactions.syncedInfo')}
+ </div>
+ )}
+ {recurringMatch && (
+ <div className="flex items-center gap-2 p-3 text-sm bg-blue-50 dark:bg-blue-950 border border-blue-200 dark:border-blue-800 rounded-md">
+ <span>{t('transactions.recurringInfo', {
+ frequency: t(`recurring.${recurringMatch.frequency}`),
+ next: new Date(recurringMatch.next_occurrence).toLocaleDateString(locale),
+ })}</span>
+ </div>
+ )}
+ <div className="space-y-2">
+ <Label>{t('transactions.description')}</Label>
+ <Input
+ value={description}
+ onChange={(e) => setDescription(e.target.value)}
+ required
+ disabled={isSynced}
+ />
+ {isSynced && transaction?.payee && transaction.payee !== transaction.description && (
+ <p className="text-xs text-muted-foreground">{transaction.payee}</p>
+ )}
+ </div>
+ <div className="grid grid-cols-3 gap-4">
+ <div className="space-y-2">
+ <Label>{t('transactions.amount')}</Label>
+ <Input
+ type="number"
+ step="0.01"
+ value={amount}
+ onChange={(e) => setAmount(e.target.value)}
+ required
+ disabled={isSynced}
+ />
+ </div>
+ <div className="space-y-2">
+ <Label>Moeda</Label>
+ <select
+ className="w-full border border-border rounded-md px-3 py-2 text-sm bg-background h-9 disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px]"
+ value={currency}
+ onChange={(e) => setCurrency(e.target.value)}
+ disabled={isSynced}
+ >
+ <option value="BRL">BRL (R$)</option>
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('transactions.date')}</Label>
+ <DatePickerInput
+ value={date}
+ onChange={setDate}
+ disabled={isSynced}
+ className="w-full justify-start"
+ />
+ </div>
+ </div>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label>Tipo</Label>
+ <select
+ className="w-full border border-border rounded-md px-3 py-2 text-sm bg-background disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px]"
+ value={type}
+ onChange={(e) => setType(e.target.value as 'debit' | 'credit')}
+ disabled={isSynced}
+ >
+ <option value="debit">Despesa</option>
+ <option value="credit">Receita</option>
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('transactions.category')}</Label>
+ <select
+ className="w-full border border-border rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px]"
+ value={categoryId}
+ onChange={(e) => setCategoryId(e.target.value)}
+ >
+ <option value="">{t('transactions.noCategory')}</option>
+ {categories.map((cat) => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </select>
+ </div>
+ </div>
+ {!isSynced && (
+ <div className="space-y-2">
+ <Label>{t('transactions.account')}</Label>
+ <select
+ className="w-full border border-border rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px]"
+ value={accountId}
+ onChange={(e) => setAccountId(e.target.value)}
+ required
+ >
+ {accounts.map((acc) => (
+ <option key={acc.id} value={acc.id}>{acc.name}</option>
+ ))}
+ </select>
+ </div>
+ )}
+
+ <div className="space-y-2">
+ <Label>Notas <span className="text-muted-foreground font-normal text-xs">(opcional — use #tags para categorizar)</span></Label>
+ <textarea
+ className="w-full border border-input rounded-md px-3 py-2 text-sm bg-background resize-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0"
+ rows={2}
+ value={notes}
+ onChange={(e) => setNotes(e.target.value)}
+ placeholder="Ex: jantar de negócios #work #reimbursable"
+ />
+ </div>
+
+ {/* Recurring toggle — only shown when creating non-synced */}
+ {isCreating && !isSynced && (
+ <div className="space-y-3 border rounded-md p-3">
+ <label className="flex items-center gap-2 cursor-pointer">
+ <input
+ type="checkbox"
+ checked={isRecurring}
+ onChange={(e) => setIsRecurring(e.target.checked)}
+ className="rounded border-gray-300"
+ />
+ <span className="text-sm font-medium">{t('transactions.makeRecurring')}</span>
+ </label>
+ {isRecurring && (
+ <div className="grid grid-cols-2 gap-4 pt-1">
+ <div className="space-y-2">
+ <Label>{t('recurring.frequency')}</Label>
+ <select
+ className="w-full border border-border rounded-md px-3 py-2 text-sm bg-background focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px]"
+ value={frequency}
+ onChange={(e) => setFrequency(e.target.value as 'monthly' | 'weekly' | 'yearly')}
+ >
+ <option value="monthly">{t('recurring.monthly')}</option>
+ <option value="weekly">{t('recurring.weekly')}</option>
+ <option value="yearly">{t('recurring.yearly')}</option>
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('recurring.endDate')}</Label>
+ <DatePickerInput
+ value={endDate}
+ onChange={setEndDate}
+ placeholder={t('recurring.endDate')}
+ className="w-full justify-start"
+ />
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+
+ <DialogFooter className={onDelete ? 'flex justify-between sm:justify-between' : ''}>
+ {onDelete && (
+ <Button type="button" variant="destructive" onClick={onDelete} disabled={loading}>
+ {t('common.delete')}
+ </Button>
+ )}
+ <div className="flex gap-2">
+ <Button type="button" variant="outline" onClick={onCancel}>
+ {t('common.cancel')}
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? t('common.loading') : t('common.save')}
+ </Button>
+ </div>
+ </DialogFooter>
+ </form>
+ )
+}
diff --git a/frontend/src/components/transaction-drill-down.tsx b/frontend/src/components/transaction-drill-down.tsx
new file mode 100644
index 00000000..a67fb73e
--- /dev/null
+++ b/frontend/src/components/transaction-drill-down.tsx
@@ -0,0 +1,259 @@
+import { useEffect, useRef, useMemo } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery } from '@tanstack/react-query'
+import { transactions as transactionsApi, dashboard } from '@/lib/api'
+import { X } from 'lucide-react'
+import { CategoryIcon } from '@/components/category-icon'
+import { useAuth } from '@/contexts/auth-context'
+import type { Transaction } from '@/types'
+
+export type DrillDownFilter = {
+ title: string
+ category_id?: string
+ uncategorized?: boolean
+ account_id?: string
+ type?: 'credit' | 'debit'
+ from?: string
+ to?: string
+}
+
+type DisplayItem = {
+ key: string
+ description: string
+ date: string
+ type: 'debit' | 'credit'
+ amount: number
+ currency: string
+ categoryIcon: string | null
+ categoryName: string | null
+ categoryColor: string | null
+ isProjected: boolean
+ transaction: Transaction | null
+}
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+export function TransactionDrillDown({
+ filter,
+ onClose,
+ onTransactionClick,
+}: {
+ filter: DrillDownFilter | null
+ onClose: () => void
+ onTransactionClick?: (tx: Transaction) => void
+}) {
+ const { t, i18n } = useTranslation()
+ const { user } = useAuth()
+ const userCurrency = user?.preferences?.currency_display ?? 'BRL'
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const panelRef = useRef<HTMLDivElement>(null)
+
+ const { data, isLoading } = useQuery({
+ queryKey: ['drill-down', filter],
+ queryFn: () =>
+ transactionsApi.list({
+ category_id: filter?.category_id,
+ uncategorized: filter?.uncategorized,
+ account_id: filter?.account_id,
+ type: filter?.type,
+ from: filter?.from,
+ to: filter?.to,
+ limit: 200,
+ }),
+ enabled: !!filter,
+ })
+
+ // Derive month param from filter.from for projected transactions
+ const monthParam = filter?.from ? filter.from.slice(0, 7) + '-01' : undefined
+
+ const { data: projectedTxs } = useQuery({
+ queryKey: ['dashboard', 'projected-transactions', monthParam],
+ queryFn: () => dashboard.projectedTransactions(monthParam),
+ enabled: !!filter && !!monthParam,
+ })
+
+ // Merge real + projected transactions, filtering projected by drill-down criteria
+ const displayItems = useMemo((): DisplayItem[] => {
+ const items: DisplayItem[] = []
+
+ for (const tx of data?.items ?? []) {
+ items.push({
+ key: tx.id,
+ description: tx.description,
+ date: tx.date,
+ type: tx.type as 'debit' | 'credit',
+ amount: Number(tx.amount),
+ currency: tx.currency,
+ categoryIcon: tx.category?.icon ?? null,
+ categoryName: tx.category?.name ?? null,
+ categoryColor: tx.category?.color ?? null,
+ isProjected: false,
+ transaction: tx,
+ })
+ }
+
+ for (const pt of projectedTxs ?? []) {
+ // Filter projected txs by drill-down criteria
+ if (filter?.type && pt.type !== filter.type) continue
+ if (filter?.category_id && String(pt.category_id) !== filter.category_id) continue
+ if (filter?.uncategorized && pt.category_id != null) continue
+ if (filter?.from && pt.date < filter.from) continue
+ if (filter?.to && pt.date > filter.to) continue
+
+ items.push({
+ key: `proj-${pt.recurring_id}-${pt.date}`,
+ description: pt.description,
+ date: pt.date,
+ type: pt.type,
+ amount: pt.amount,
+ currency: pt.currency,
+ categoryIcon: pt.category_icon,
+ categoryName: pt.category_name,
+ categoryColor: pt.category_color ?? null,
+ isProjected: true,
+ transaction: null,
+ })
+ }
+
+ items.sort((a, b) => a.date.localeCompare(b.date))
+ return items
+ }, [data, projectedTxs, filter])
+
+ // Close on Escape
+ useEffect(() => {
+ if (!filter) return
+ const handleKey = (e: KeyboardEvent) => {
+ if (e.key === 'Escape') onClose()
+ }
+ document.addEventListener('keydown', handleKey)
+ return () => document.removeEventListener('keydown', handleKey)
+ }, [filter, onClose])
+
+ // Close on click outside
+ useEffect(() => {
+ if (!filter) return
+ const handleClick = (e: MouseEvent) => {
+ if (panelRef.current && !panelRef.current.contains(e.target as Node)) {
+ onClose()
+ }
+ }
+ // Delay to avoid closing immediately from the click that opened it
+ const timer = setTimeout(() => {
+ document.addEventListener('mousedown', handleClick)
+ }, 100)
+ return () => {
+ clearTimeout(timer)
+ document.removeEventListener('mousedown', handleClick)
+ }
+ }, [filter, onClose])
+
+ const absTotal = displayItems.reduce((sum, item) => sum + Math.abs(item.amount), 0)
+
+ return (
+ <>
+ {/* Backdrop */}
+ <div
+ className={`fixed inset-0 bg-black/20 z-40 transition-opacity duration-200 ${
+ filter ? 'opacity-100' : 'opacity-0 pointer-events-none'
+ }`}
+ />
+
+ {/* Panel */}
+ <div
+ ref={panelRef}
+ className={`fixed top-0 right-0 h-full w-full max-w-md bg-card shadow-2xl z-50 transform transition-transform duration-200 ease-out flex flex-col ${
+ filter ? 'translate-x-0' : 'translate-x-full'
+ }`}
+ >
+ {/* Header */}
+ <div className="flex items-center justify-between px-5 py-4 border-b border-border shrink-0">
+ <h2 className="text-sm font-semibold text-foreground truncate pr-4">
+ {filter?.title}
+ </h2>
+ <button
+ onClick={onClose}
+ className="w-8 h-8 flex items-center justify-center rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors shrink-0"
+ >
+ <X size={16} />
+ </button>
+ </div>
+
+ {/* Transaction list */}
+ <div className="flex-1 overflow-auto">
+ {isLoading ? (
+ <div className="p-5 space-y-3">
+ {Array.from({ length: 8 }).map((_, i) => (
+ <div key={i} className="h-12 bg-muted rounded-lg animate-pulse" />
+ ))}
+ </div>
+ ) : displayItems.length === 0 ? (
+ <p className="text-muted-foreground text-sm text-center py-12">
+ {t('dashboard.drillDownEmpty')}
+ </p>
+ ) : (
+ <div className="divide-y divide-border">
+ {displayItems.map((item) => (
+ <div
+ key={item.key}
+ className={`flex items-center gap-3 px-5 py-3 hover:bg-muted transition-colors ${!item.isProjected ? 'cursor-pointer' : ''}`}
+ onClick={() => {
+ if (!item.isProjected && item.transaction) {
+ onTransactionClick?.(item.transaction)
+ }
+ }}
+ >
+ <CategoryIcon
+ icon={item.categoryIcon}
+ color={item.categoryColor}
+ size="lg"
+ />
+ <div className="flex-1 min-w-0">
+ <div className="flex items-center gap-2">
+ <p className="text-sm font-medium text-foreground truncate">{item.description}</p>
+ {item.isProjected && (
+ <span className="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold bg-violet-100 text-violet-600 shrink-0">
+ {t('transactions.recurringBadge')}
+ </span>
+ )}
+ </div>
+ <p className="text-xs text-muted-foreground">
+ {new Date(item.date + 'T00:00:00').toLocaleDateString(locale)}
+ {item.categoryName && ` · ${item.categoryName}`}
+ </p>
+ </div>
+ <span
+ className={`text-sm font-semibold tabular-nums shrink-0 ${
+ item.type === 'credit' ? 'text-emerald-600' : 'text-rose-500'
+ }`}
+ >
+ {item.type === 'credit' ? '+' : '-'}
+ {formatCurrency(Math.abs(item.amount), item.currency ?? userCurrency, locale)}
+ </span>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+
+ {/* Footer */}
+ {displayItems.length > 0 && (
+ <div className="px-5 py-3 border-t border-border bg-muted/50 shrink-0">
+ <div className="flex items-center justify-between">
+ <span className="text-xs text-muted-foreground">
+ {t('dashboard.drillDownTotal', {
+ count: displayItems.length,
+ total: formatCurrency(absTotal, userCurrency, locale),
+ })}
+ </span>
+ <span className="text-sm font-bold tabular-nums text-foreground">
+ {formatCurrency(absTotal, userCurrency, locale)}
+ </span>
+ </div>
+ </div>
+ )}
+ </div>
+ </>
+ )
+}
diff --git a/frontend/src/components/ui/avatar.tsx b/frontend/src/components/ui/avatar.tsx
new file mode 100644
index 00000000..18f71e7e
--- /dev/null
+++ b/frontend/src/components/ui/avatar.tsx
@@ -0,0 +1,107 @@
+import * as React from "react"
+import { Avatar as AvatarPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+function Avatar({
+ className,
+ size = "default",
+ ...props
+}: React.ComponentProps<typeof AvatarPrimitive.Root> & {
+ size?: "default" | "sm" | "lg"
+}) {
+ return (
+ <AvatarPrimitive.Root
+ data-slot="avatar"
+ data-size={size}
+ className={cn(
+ "group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AvatarImage({
+ className,
+ ...props
+}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
+ return (
+ <AvatarPrimitive.Image
+ data-slot="avatar-image"
+ className={cn("aspect-square size-full", className)}
+ {...props}
+ />
+ )
+}
+
+function AvatarFallback({
+ className,
+ ...props
+}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
+ return (
+ <AvatarPrimitive.Fallback
+ data-slot="avatar-fallback"
+ className={cn(
+ "bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
+ return (
+ <span
+ data-slot="avatar-badge"
+ className={cn(
+ "bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none",
+ "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
+ "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
+ "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="avatar-group"
+ className={cn(
+ "*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function AvatarGroupCount({
+ className,
+ ...props
+}: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="avatar-group-count"
+ className={cn(
+ "bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ Avatar,
+ AvatarImage,
+ AvatarFallback,
+ AvatarBadge,
+ AvatarGroup,
+ AvatarGroupCount,
+}
diff --git a/frontend/src/components/ui/badge.tsx b/frontend/src/components/ui/badge.tsx
new file mode 100644
index 00000000..beb56ed1
--- /dev/null
+++ b/frontend/src/components/ui/badge.tsx
@@ -0,0 +1,48 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+import { Slot } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+const badgeVariants = cva(
+ "inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
+ secondary:
+ "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
+ destructive:
+ "bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
+ outline:
+ "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
+ ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
+ link: "text-primary underline-offset-4 [a&]:hover:underline",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+function Badge({
+ className,
+ variant = "default",
+ asChild = false,
+ ...props
+}: React.ComponentProps<"span"> &
+ VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
+ const Comp = asChild ? Slot.Root : "span"
+
+ return (
+ <Comp
+ data-slot="badge"
+ data-variant={variant}
+ className={cn(badgeVariants({ variant }), className)}
+ {...props}
+ />
+ )
+}
+
+export { Badge, badgeVariants }
diff --git a/frontend/src/components/ui/button.tsx b/frontend/src/components/ui/button.tsx
new file mode 100644
index 00000000..ff8bc309
--- /dev/null
+++ b/frontend/src/components/ui/button.tsx
@@ -0,0 +1,64 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+import { Slot } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+const buttonVariants = cva(
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-[2px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ {
+ variants: {
+ variant: {
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
+ destructive:
+ "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
+ outline:
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
+ secondary:
+ "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ ghost:
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
+ link: "text-primary underline-offset-4 hover:underline",
+ },
+ size: {
+ default: "h-9 px-5 py-2 has-[>svg]:px-4",
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
+ sm: "h-9 rounded-lg gap-1.5 px-4 has-[>svg]:px-3",
+ lg: "h-11 rounded-lg px-7 has-[>svg]:px-5",
+ icon: "size-10",
+ "icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
+ "icon-sm": "size-8",
+ "icon-lg": "size-10",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+function Button({
+ className,
+ variant = "default",
+ size = "default",
+ asChild = false,
+ ...props
+}: React.ComponentProps<"button"> &
+ VariantProps<typeof buttonVariants> & {
+ asChild?: boolean
+ }) {
+ const Comp = asChild ? Slot.Root : "button"
+
+ return (
+ <Comp
+ data-slot="button"
+ data-variant={variant}
+ data-size={size}
+ className={cn(buttonVariants({ variant, size, className }))}
+ {...props}
+ />
+ )
+}
+
+export { Button, buttonVariants }
diff --git a/frontend/src/components/ui/calendar.tsx b/frontend/src/components/ui/calendar.tsx
new file mode 100644
index 00000000..f7b1a427
--- /dev/null
+++ b/frontend/src/components/ui/calendar.tsx
@@ -0,0 +1,122 @@
+import { useState } from 'react'
+import {
+ startOfMonth,
+ endOfMonth,
+ startOfWeek,
+ endOfWeek,
+ addDays,
+ addMonths,
+ subMonths,
+ isSameMonth,
+ isSameDay,
+ isToday,
+ format,
+ type Locale,
+} from 'date-fns'
+import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react'
+import { cn } from '@/lib/utils'
+
+interface CalendarProps {
+ mode?: 'single'
+ selected?: Date
+ defaultMonth?: Date
+ locale?: Locale
+ onSelect?: (date: Date | undefined) => void
+ className?: string
+}
+
+function Calendar({
+ selected,
+ defaultMonth,
+ locale,
+ onSelect,
+ className,
+}: CalendarProps) {
+ const [viewMonth, setViewMonth] = useState(defaultMonth ?? selected ?? new Date())
+
+ const monthStart = startOfMonth(viewMonth)
+ const monthEnd = endOfMonth(viewMonth)
+ const calStart = startOfWeek(monthStart, { locale })
+ const calEnd = endOfWeek(monthEnd, { locale })
+
+ const weeks: Date[][] = []
+ let day = calStart
+ while (day <= calEnd) {
+ const week: Date[] = []
+ for (let i = 0; i < 7; i++) {
+ week.push(day)
+ day = addDays(day, 1)
+ }
+ weeks.push(week)
+ }
+
+ const weekdayLabels: string[] = []
+ for (let i = 0; i < 7; i++) {
+ weekdayLabels.push(format(addDays(calStart, i), 'EEEEEE', { locale }))
+ }
+
+ return (
+ <div className={cn('p-3', className)}>
+ {/* Header: nav + month label */}
+ <div className="flex items-center justify-between mb-3">
+ <button
+ type="button"
+ onClick={() => setViewMonth(subMonths(viewMonth, 1))}
+ className="size-7 inline-flex items-center justify-center rounded-lg border border-border bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"
+ >
+ <ChevronLeftIcon className="size-4" />
+ </button>
+ <span className="text-sm font-medium text-foreground capitalize">
+ {format(viewMonth, 'LLLL yyyy', { locale })}
+ </span>
+ <button
+ type="button"
+ onClick={() => setViewMonth(addMonths(viewMonth, 1))}
+ className="size-7 inline-flex items-center justify-center rounded-lg border border-border bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors"
+ >
+ <ChevronRightIcon className="size-4" />
+ </button>
+ </div>
+
+ {/* Weekday headers */}
+ <div className="grid grid-cols-7 mb-1">
+ {weekdayLabels.map((label, i) => (
+ <div key={i} className="text-center text-[11px] font-medium text-muted-foreground py-1">
+ {label}
+ </div>
+ ))}
+ </div>
+
+ {/* Day grid */}
+ <div className="grid grid-cols-7">
+ {weeks.map((week, wi) =>
+ week.map((d, di) => {
+ const inMonth = isSameMonth(d, viewMonth)
+ const isSelected = selected && isSameDay(d, selected)
+ const today = isToday(d)
+
+ return (
+ <button
+ key={`${wi}-${di}`}
+ type="button"
+ onClick={() => onSelect?.(d)}
+ className={cn(
+ 'size-8 inline-flex items-center justify-center rounded-lg text-sm transition-colors',
+ !inMonth && 'text-muted-foreground/40',
+ inMonth && !isSelected && 'text-foreground hover:bg-muted/60',
+ today && !isSelected && 'bg-accent text-accent-foreground font-medium',
+ isSelected && 'bg-primary text-primary-foreground font-semibold',
+ )}
+ >
+ {d.getDate()}
+ </button>
+ )
+ }),
+ )}
+ </div>
+ </div>
+ )
+}
+
+export { Calendar }
+export type { CalendarProps }
diff --git a/frontend/src/components/ui/card.tsx b/frontend/src/components/ui/card.tsx
new file mode 100644
index 00000000..3ab01b66
--- /dev/null
+++ b/frontend/src/components/ui/card.tsx
@@ -0,0 +1,92 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+function Card({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card"
+ className={cn(
+ "bg-card text-card-foreground flex flex-col rounded-xl border border-border/80 shadow-[0_1px_2px_0_rgba(0,0,0,0.03)]",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card-header"
+ className={cn(
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card-title"
+ className={cn("leading-none font-semibold", className)}
+ {...props}
+ />
+ )
+}
+
+function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card-description"
+ className={cn("text-muted-foreground text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+function CardAction({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card-action"
+ className={cn(
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function CardContent({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card-content"
+ className={cn("px-6", className)}
+ {...props}
+ />
+ )
+}
+
+function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="card-footer"
+ className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
+ {...props}
+ />
+ )
+}
+
+export {
+ Card,
+ CardHeader,
+ CardFooter,
+ CardTitle,
+ CardAction,
+ CardDescription,
+ CardContent,
+}
diff --git a/frontend/src/components/ui/date-picker-input.tsx b/frontend/src/components/ui/date-picker-input.tsx
new file mode 100644
index 00000000..d0e06f47
--- /dev/null
+++ b/frontend/src/components/ui/date-picker-input.tsx
@@ -0,0 +1,70 @@
+import { useState } from 'react'
+import { format } from 'date-fns'
+import { ptBR, enUS } from 'date-fns/locale'
+import { CalendarIcon } from 'lucide-react'
+import { useTranslation } from 'react-i18next'
+import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover'
+import { Calendar } from '@/components/ui/calendar'
+import { cn } from '@/lib/utils'
+
+interface DatePickerInputProps {
+ value: string
+ onChange: (value: string) => void
+ placeholder?: string
+ className?: string
+ disabled?: boolean
+ align?: 'start' | 'center' | 'end'
+}
+
+function DatePickerInput({
+ value,
+ onChange,
+ placeholder,
+ className,
+ disabled,
+ align = 'start',
+}: DatePickerInputProps) {
+ const { i18n } = useTranslation()
+ const [open, setOpen] = useState(false)
+ const dateFnsLocale = i18n.language === 'pt-BR' ? ptBR : enUS
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+
+ const selectedDate = value ? new Date(value + 'T00:00:00') : undefined
+ const displayText = selectedDate
+ ? selectedDate.toLocaleDateString(locale)
+ : placeholder || 'dd/mm/yyyy'
+
+ return (
+ <Popover open={open} onOpenChange={disabled ? undefined : setOpen}>
+ <PopoverTrigger asChild>
+ <button
+ type="button"
+ disabled={disabled}
+ className={cn(
+ 'inline-flex items-center gap-2 border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground hover:bg-muted/50 transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none min-w-[120px]',
+ !value && 'text-muted-foreground',
+ className,
+ )}
+ >
+ <CalendarIcon className="size-3.5 text-muted-foreground shrink-0" />
+ {displayText}
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align={align} className="w-auto p-0">
+ <Calendar
+ mode="single"
+ locale={dateFnsLocale}
+ selected={selectedDate}
+ defaultMonth={selectedDate ?? new Date()}
+ onSelect={(date) => {
+ if (!date) return
+ onChange(format(date, 'yyyy-MM-dd'))
+ setOpen(false)
+ }}
+ />
+ </PopoverContent>
+ </Popover>
+ )
+}
+
+export { DatePickerInput }
diff --git a/frontend/src/components/ui/dialog.tsx b/frontend/src/components/ui/dialog.tsx
new file mode 100644
index 00000000..d8a06aaa
--- /dev/null
+++ b/frontend/src/components/ui/dialog.tsx
@@ -0,0 +1,156 @@
+import * as React from "react"
+import { XIcon } from "lucide-react"
+import { Dialog as DialogPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+import { Button } from "@/components/ui/button"
+
+function Dialog({
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Root>) {
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
+}
+
+function DialogTrigger({
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
+}
+
+function DialogPortal({
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Portal>) {
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
+}
+
+function DialogClose({
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Close>) {
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
+}
+
+function DialogOverlay({
+ className,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
+ return (
+ <DialogPrimitive.Overlay
+ data-slot="dialog-overlay"
+ className={cn(
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function DialogContent({
+ className,
+ children,
+ showCloseButton = true,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Content> & {
+ showCloseButton?: boolean
+}) {
+ return (
+ <DialogPortal data-slot="dialog-portal">
+ <DialogOverlay />
+ <DialogPrimitive.Content
+ data-slot="dialog-content"
+ className={cn(
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ {showCloseButton && (
+ <DialogPrimitive.Close
+ data-slot="dialog-close"
+ className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
+ >
+ <XIcon />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ )}
+ </DialogPrimitive.Content>
+ </DialogPortal>
+ )
+}
+
+function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="dialog-header"
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
+ {...props}
+ />
+ )
+}
+
+function DialogFooter({
+ className,
+ showCloseButton = false,
+ children,
+ ...props
+}: React.ComponentProps<"div"> & {
+ showCloseButton?: boolean
+}) {
+ return (
+ <div
+ data-slot="dialog-footer"
+ className={cn(
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ {showCloseButton && (
+ <DialogPrimitive.Close asChild>
+ <Button variant="outline">Close</Button>
+ </DialogPrimitive.Close>
+ )}
+ </div>
+ )
+}
+
+function DialogTitle({
+ className,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Title>) {
+ return (
+ <DialogPrimitive.Title
+ data-slot="dialog-title"
+ className={cn("text-lg leading-none font-semibold", className)}
+ {...props}
+ />
+ )
+}
+
+function DialogDescription({
+ className,
+ ...props
+}: React.ComponentProps<typeof DialogPrimitive.Description>) {
+ return (
+ <DialogPrimitive.Description
+ data-slot="dialog-description"
+ className={cn("text-muted-foreground text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+export {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogOverlay,
+ DialogPortal,
+ DialogTitle,
+ DialogTrigger,
+}
diff --git a/frontend/src/components/ui/dropdown-menu.tsx b/frontend/src/components/ui/dropdown-menu.tsx
new file mode 100644
index 00000000..bffc3276
--- /dev/null
+++ b/frontend/src/components/ui/dropdown-menu.tsx
@@ -0,0 +1,257 @@
+"use client"
+
+import * as React from "react"
+import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
+import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+function DropdownMenu({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
+}
+
+function DropdownMenuPortal({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
+ return (
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
+ )
+}
+
+function DropdownMenuTrigger({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
+ return (
+ <DropdownMenuPrimitive.Trigger
+ data-slot="dropdown-menu-trigger"
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuContent({
+ className,
+ sideOffset = 4,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
+ return (
+ <DropdownMenuPrimitive.Portal>
+ <DropdownMenuPrimitive.Content
+ data-slot="dropdown-menu-content"
+ sideOffset={sideOffset}
+ className={cn(
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
+ className
+ )}
+ {...props}
+ />
+ </DropdownMenuPrimitive.Portal>
+ )
+}
+
+function DropdownMenuGroup({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
+ return (
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
+ )
+}
+
+function DropdownMenuItem({
+ className,
+ inset,
+ variant = "default",
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
+ inset?: boolean
+ variant?: "default" | "destructive"
+}) {
+ return (
+ <DropdownMenuPrimitive.Item
+ data-slot="dropdown-menu-item"
+ data-inset={inset}
+ data-variant={variant}
+ className={cn(
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuCheckboxItem({
+ className,
+ children,
+ checked,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
+ return (
+ <DropdownMenuPrimitive.CheckboxItem
+ data-slot="dropdown-menu-checkbox-item"
+ className={cn(
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ checked={checked}
+ {...props}
+ >
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <CheckIcon className="size-4" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.CheckboxItem>
+ )
+}
+
+function DropdownMenuRadioGroup({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
+ return (
+ <DropdownMenuPrimitive.RadioGroup
+ data-slot="dropdown-menu-radio-group"
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuRadioItem({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
+ return (
+ <DropdownMenuPrimitive.RadioItem
+ data-slot="dropdown-menu-radio-item"
+ className={cn(
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ {...props}
+ >
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
+ <DropdownMenuPrimitive.ItemIndicator>
+ <CircleIcon className="size-2 fill-current" />
+ </DropdownMenuPrimitive.ItemIndicator>
+ </span>
+ {children}
+ </DropdownMenuPrimitive.RadioItem>
+ )
+}
+
+function DropdownMenuLabel({
+ className,
+ inset,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
+ inset?: boolean
+}) {
+ return (
+ <DropdownMenuPrimitive.Label
+ data-slot="dropdown-menu-label"
+ data-inset={inset}
+ className={cn(
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuSeparator({
+ className,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
+ return (
+ <DropdownMenuPrimitive.Separator
+ data-slot="dropdown-menu-separator"
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuShortcut({
+ className,
+ ...props
+}: React.ComponentProps<"span">) {
+ return (
+ <span
+ data-slot="dropdown-menu-shortcut"
+ className={cn(
+ "text-muted-foreground ml-auto text-xs tracking-widest",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function DropdownMenuSub({
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
+}
+
+function DropdownMenuSubTrigger({
+ className,
+ inset,
+ children,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
+ inset?: boolean
+}) {
+ return (
+ <DropdownMenuPrimitive.SubTrigger
+ data-slot="dropdown-menu-sub-trigger"
+ data-inset={inset}
+ className={cn(
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <ChevronRightIcon className="ml-auto size-4" />
+ </DropdownMenuPrimitive.SubTrigger>
+ )
+}
+
+function DropdownMenuSubContent({
+ className,
+ ...props
+}: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
+ return (
+ <DropdownMenuPrimitive.SubContent
+ data-slot="dropdown-menu-sub-content"
+ className={cn(
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ DropdownMenu,
+ DropdownMenuPortal,
+ DropdownMenuTrigger,
+ DropdownMenuContent,
+ DropdownMenuGroup,
+ DropdownMenuLabel,
+ DropdownMenuItem,
+ DropdownMenuCheckboxItem,
+ DropdownMenuRadioGroup,
+ DropdownMenuRadioItem,
+ DropdownMenuSeparator,
+ DropdownMenuShortcut,
+ DropdownMenuSub,
+ DropdownMenuSubTrigger,
+ DropdownMenuSubContent,
+}
diff --git a/frontend/src/components/ui/form.tsx b/frontend/src/components/ui/form.tsx
new file mode 100644
index 00000000..b4ec1985
--- /dev/null
+++ b/frontend/src/components/ui/form.tsx
@@ -0,0 +1,165 @@
+import * as React from "react"
+import type { Label as LabelPrimitive } from "radix-ui"
+import { Slot } from "radix-ui"
+import {
+ Controller,
+ FormProvider,
+ useFormContext,
+ useFormState,
+ type ControllerProps,
+ type FieldPath,
+ type FieldValues,
+} from "react-hook-form"
+
+import { cn } from "@/lib/utils"
+import { Label } from "@/components/ui/label"
+
+const Form = FormProvider
+
+type FormFieldContextValue<
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
+> = {
+ name: TName
+}
+
+const FormFieldContext = React.createContext<FormFieldContextValue>(
+ {} as FormFieldContextValue
+)
+
+const FormField = <
+ TFieldValues extends FieldValues = FieldValues,
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
+>({
+ ...props
+}: ControllerProps<TFieldValues, TName>) => {
+ return (
+ <FormFieldContext.Provider value={{ name: props.name }}>
+ <Controller {...props} />
+ </FormFieldContext.Provider>
+ )
+}
+
+const useFormField = () => {
+ const fieldContext = React.useContext(FormFieldContext)
+ const itemContext = React.useContext(FormItemContext)
+ const { getFieldState } = useFormContext()
+ const formState = useFormState({ name: fieldContext.name })
+ const fieldState = getFieldState(fieldContext.name, formState)
+
+ if (!fieldContext) {
+ throw new Error("useFormField should be used within <FormField>")
+ }
+
+ const { id } = itemContext
+
+ return {
+ id,
+ name: fieldContext.name,
+ formItemId: `${id}-form-item`,
+ formDescriptionId: `${id}-form-item-description`,
+ formMessageId: `${id}-form-item-message`,
+ ...fieldState,
+ }
+}
+
+type FormItemContextValue = {
+ id: string
+}
+
+const FormItemContext = React.createContext<FormItemContextValue>(
+ {} as FormItemContextValue
+)
+
+function FormItem({ className, ...props }: React.ComponentProps<"div">) {
+ const id = React.useId()
+
+ return (
+ <FormItemContext.Provider value={{ id }}>
+ <div
+ data-slot="form-item"
+ className={cn("grid gap-2", className)}
+ {...props}
+ />
+ </FormItemContext.Provider>
+ )
+}
+
+function FormLabel({
+ className,
+ ...props
+}: React.ComponentProps<typeof LabelPrimitive.Root>) {
+ const { error, formItemId } = useFormField()
+
+ return (
+ <Label
+ data-slot="form-label"
+ data-error={!!error}
+ className={cn("data-[error=true]:text-destructive", className)}
+ htmlFor={formItemId}
+ {...props}
+ />
+ )
+}
+
+function FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>) {
+ const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
+
+ return (
+ <Slot.Root
+ data-slot="form-control"
+ id={formItemId}
+ aria-describedby={
+ !error
+ ? `${formDescriptionId}`
+ : `${formDescriptionId} ${formMessageId}`
+ }
+ aria-invalid={!!error}
+ {...props}
+ />
+ )
+}
+
+function FormDescription({ className, ...props }: React.ComponentProps<"p">) {
+ const { formDescriptionId } = useFormField()
+
+ return (
+ <p
+ data-slot="form-description"
+ id={formDescriptionId}
+ className={cn("text-muted-foreground text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
+ const { error, formMessageId } = useFormField()
+ const body = error ? String(error?.message ?? "") : props.children
+
+ if (!body) {
+ return null
+ }
+
+ return (
+ <p
+ data-slot="form-message"
+ id={formMessageId}
+ className={cn("text-destructive text-sm", className)}
+ {...props}
+ >
+ {body}
+ </p>
+ )
+}
+
+export {
+ useFormField,
+ Form,
+ FormItem,
+ FormLabel,
+ FormControl,
+ FormDescription,
+ FormMessage,
+ FormField,
+}
diff --git a/frontend/src/components/ui/input.tsx b/frontend/src/components/ui/input.tsx
new file mode 100644
index 00000000..20906288
--- /dev/null
+++ b/frontend/src/components/ui/input.tsx
@@ -0,0 +1,21 @@
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+function Input({ className, type, ...props }: React.ComponentProps<"input">) {
+ return (
+ <input
+ type={type}
+ data-slot="input"
+ className={cn(
+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
+ "focus-visible:border-ring focus-visible:ring-ring/30 focus-visible:ring-[2px]",
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Input }
diff --git a/frontend/src/components/ui/label.tsx b/frontend/src/components/ui/label.tsx
new file mode 100644
index 00000000..f752f82b
--- /dev/null
+++ b/frontend/src/components/ui/label.tsx
@@ -0,0 +1,22 @@
+import * as React from "react"
+import { Label as LabelPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+function Label({
+ className,
+ ...props
+}: React.ComponentProps<typeof LabelPrimitive.Root>) {
+ return (
+ <LabelPrimitive.Root
+ data-slot="label"
+ className={cn(
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Label }
diff --git a/frontend/src/components/ui/popover.tsx b/frontend/src/components/ui/popover.tsx
new file mode 100644
index 00000000..b25b3802
--- /dev/null
+++ b/frontend/src/components/ui/popover.tsx
@@ -0,0 +1,53 @@
+"use client"
+
+import * as React from "react"
+import { Popover as PopoverPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+function Popover({
+ ...props
+}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
+}
+
+function PopoverTrigger({
+ ...props
+}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
+}
+
+function PopoverContent({
+ className,
+ align = "center",
+ sideOffset = 4,
+ ...props
+}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
+ return (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Content
+ data-slot="popover-content"
+ align={align}
+ sideOffset={sideOffset}
+ className={cn(
+ "bg-popover text-popover-foreground z-50 w-auto rounded-xl border border-border p-4 shadow-lg outline-hidden",
+ "data-[state=open]:animate-in data-[state=closed]:animate-out",
+ "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
+ "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
+ "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ className,
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Portal>
+ )
+}
+
+function PopoverAnchor({
+ ...props
+}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
+}
+
+export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
diff --git a/frontend/src/components/ui/separator.tsx b/frontend/src/components/ui/separator.tsx
new file mode 100644
index 00000000..4c24b2a8
--- /dev/null
+++ b/frontend/src/components/ui/separator.tsx
@@ -0,0 +1,28 @@
+"use client"
+
+import * as React from "react"
+import { Separator as SeparatorPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+function Separator({
+ className,
+ orientation = "horizontal",
+ decorative = true,
+ ...props
+}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
+ return (
+ <SeparatorPrimitive.Root
+ data-slot="separator"
+ decorative={decorative}
+ orientation={orientation}
+ className={cn(
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Separator }
diff --git a/frontend/src/components/ui/skeleton.tsx b/frontend/src/components/ui/skeleton.tsx
new file mode 100644
index 00000000..32ea0ef7
--- /dev/null
+++ b/frontend/src/components/ui/skeleton.tsx
@@ -0,0 +1,13 @@
+import { cn } from "@/lib/utils"
+
+function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="skeleton"
+ className={cn("bg-accent animate-pulse rounded-md", className)}
+ {...props}
+ />
+ )
+}
+
+export { Skeleton }
diff --git a/frontend/src/components/ui/sonner.tsx b/frontend/src/components/ui/sonner.tsx
new file mode 100644
index 00000000..9b20afe2
--- /dev/null
+++ b/frontend/src/components/ui/sonner.tsx
@@ -0,0 +1,40 @@
+"use client"
+
+import {
+ CircleCheckIcon,
+ InfoIcon,
+ Loader2Icon,
+ OctagonXIcon,
+ TriangleAlertIcon,
+} from "lucide-react"
+import { useTheme } from "next-themes"
+import { Toaster as Sonner, type ToasterProps } from "sonner"
+
+const Toaster = ({ ...props }: ToasterProps) => {
+ const { theme = "system" } = useTheme()
+
+ return (
+ <Sonner
+ theme={theme as ToasterProps["theme"]}
+ className="toaster group"
+ icons={{
+ success: <CircleCheckIcon className="size-4" />,
+ info: <InfoIcon className="size-4" />,
+ warning: <TriangleAlertIcon className="size-4" />,
+ error: <OctagonXIcon className="size-4" />,
+ loading: <Loader2Icon className="size-4 animate-spin" />,
+ }}
+ style={
+ {
+ "--normal-bg": "var(--popover)",
+ "--normal-text": "var(--popover-foreground)",
+ "--normal-border": "var(--border)",
+ "--border-radius": "var(--radius)",
+ } as React.CSSProperties
+ }
+ {...props}
+ />
+ )
+}
+
+export { Toaster }
diff --git a/frontend/src/components/ui/table.tsx b/frontend/src/components/ui/table.tsx
new file mode 100644
index 00000000..fef0ef1c
--- /dev/null
+++ b/frontend/src/components/ui/table.tsx
@@ -0,0 +1,116 @@
+"use client"
+
+import * as React from "react"
+
+import { cn } from "@/lib/utils"
+
+function Table({ className, ...props }: React.ComponentProps<"table">) {
+ return (
+ <div
+ data-slot="table-container"
+ className="relative w-full overflow-x-auto"
+ >
+ <table
+ data-slot="table"
+ className={cn("w-full caption-bottom text-sm", className)}
+ {...props}
+ />
+ </div>
+ )
+}
+
+function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
+ return (
+ <thead
+ data-slot="table-header"
+ className={cn("[&_tr]:border-b", className)}
+ {...props}
+ />
+ )
+}
+
+function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
+ return (
+ <tbody
+ data-slot="table-body"
+ className={cn("[&_tr:last-child]:border-0", className)}
+ {...props}
+ />
+ )
+}
+
+function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
+ return (
+ <tfoot
+ data-slot="table-footer"
+ className={cn(
+ "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
+ return (
+ <tr
+ data-slot="table-row"
+ className={cn(
+ "hover:bg-muted/40 data-[state=selected]:bg-muted border-b transition-colors",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function TableHead({ className, ...props }: React.ComponentProps<"th">) {
+ return (
+ <th
+ data-slot="table-head"
+ className={cn(
+ "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function TableCell({ className, ...props }: React.ComponentProps<"td">) {
+ return (
+ <td
+ data-slot="table-cell"
+ className={cn(
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function TableCaption({
+ className,
+ ...props
+}: React.ComponentProps<"caption">) {
+ return (
+ <caption
+ data-slot="table-caption"
+ className={cn("text-muted-foreground mt-4 text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableHead,
+ TableRow,
+ TableCell,
+ TableCaption,
+}
diff --git a/frontend/src/components/ui/tabs.tsx b/frontend/src/components/ui/tabs.tsx
new file mode 100644
index 00000000..7bf18aa7
--- /dev/null
+++ b/frontend/src/components/ui/tabs.tsx
@@ -0,0 +1,89 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+import { Tabs as TabsPrimitive } from "radix-ui"
+
+import { cn } from "@/lib/utils"
+
+function Tabs({
+ className,
+ orientation = "horizontal",
+ ...props
+}: React.ComponentProps<typeof TabsPrimitive.Root>) {
+ return (
+ <TabsPrimitive.Root
+ data-slot="tabs"
+ data-orientation={orientation}
+ orientation={orientation}
+ className={cn(
+ "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+const tabsListVariants = cva(
+ "rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",
+ {
+ variants: {
+ variant: {
+ default: "bg-muted",
+ line: "gap-1 bg-transparent",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ },
+ }
+)
+
+function TabsList({
+ className,
+ variant = "default",
+ ...props
+}: React.ComponentProps<typeof TabsPrimitive.List> &
+ VariantProps<typeof tabsListVariants>) {
+ return (
+ <TabsPrimitive.List
+ data-slot="tabs-list"
+ data-variant={variant}
+ className={cn(tabsListVariants({ variant }), className)}
+ {...props}
+ />
+ )
+}
+
+function TabsTrigger({
+ className,
+ ...props
+}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
+ return (
+ <TabsPrimitive.Trigger
+ data-slot="tabs-trigger"
+ className={cn(
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
+ "data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground",
+ "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function TabsContent({
+ className,
+ ...props
+}: React.ComponentProps<typeof TabsPrimitive.Content>) {
+ return (
+ <TabsPrimitive.Content
+ data-slot="tabs-content"
+ className={cn("flex-1 outline-none", className)}
+ {...props}
+ />
+ )
+}
+
+export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
diff --git a/frontend/src/contexts/auth-context.tsx b/frontend/src/contexts/auth-context.tsx
new file mode 100644
index 00000000..d94aad90
--- /dev/null
+++ b/frontend/src/contexts/auth-context.tsx
@@ -0,0 +1,95 @@
+import { createContext, useContext, useState, useEffect, useCallback, type ReactNode } from 'react'
+import { useQueryClient } from '@tanstack/react-query'
+import { auth } from '@/lib/api'
+import type { User } from '@/types'
+
+interface AuthContextType {
+ user: User | null
+ token: string | null
+ isLoading: boolean
+ login: (email: string, password: string) => Promise<void>
+ loginWithToken: (accessToken: string) => void
+ register: (email: string, password: string) => Promise<void>
+ updateUser: (user: User) => void
+ logout: () => void
+}
+
+const AuthContext = createContext<AuthContextType | null>(null)
+
+export function AuthProvider({ children }: { children: ReactNode }) {
+ const [user, setUser] = useState<User | null>(null)
+ const [token, setToken] = useState<string | null>(() => localStorage.getItem('token'))
+ const [isLoading, setIsLoading] = useState(true)
+ const queryClient = useQueryClient()
+
+ useEffect(() => {
+ if (token) {
+ auth.me()
+ .then(setUser)
+ .catch(() => {
+ localStorage.removeItem('token')
+ setToken(null)
+ })
+ .finally(() => setIsLoading(false))
+ } else {
+ setUser(null)
+ setIsLoading(false)
+ }
+ }, [token])
+
+ // Sync token across tabs via storage events
+ useEffect(() => {
+ const handleStorage = (e: StorageEvent) => {
+ if (e.key === 'token') {
+ setToken(e.newValue)
+ }
+ }
+ window.addEventListener('storage', handleStorage)
+ return () => window.removeEventListener('storage', handleStorage)
+ }, [])
+
+ const login = useCallback(async (email: string, password: string) => {
+ const data = await auth.login(email, password)
+ const accessToken = data.access_token
+ localStorage.setItem('token', accessToken)
+ setToken(accessToken)
+ const me = await auth.me()
+ setUser(me)
+ }, [])
+
+ const loginWithToken = useCallback((accessToken: string) => {
+ localStorage.setItem('token', accessToken)
+ setToken(accessToken)
+ auth.me().then(setUser).catch(() => {})
+ }, [])
+
+ const updateUser = useCallback((updatedUser: User) => {
+ setUser(updatedUser)
+ }, [])
+
+ const register = useCallback(async (email: string, password: string) => {
+ await auth.register(email, password)
+ await login(email, password)
+ }, [login])
+
+ const logout = useCallback(() => {
+ localStorage.removeItem('token')
+ setToken(null)
+ setUser(null)
+ queryClient.clear()
+ }, [queryClient])
+
+ return (
+ <AuthContext.Provider value={{ user, token, isLoading, login, loginWithToken, register, updateUser, logout }}>
+ {children}
+ </AuthContext.Provider>
+ )
+}
+
+export function useAuth() {
+ const context = useContext(AuthContext)
+ if (!context) {
+ throw new Error('useAuth must be used within an AuthProvider')
+ }
+ return context
+}
diff --git a/frontend/src/hooks/use-privacy-mode.ts b/frontend/src/hooks/use-privacy-mode.ts
new file mode 100644
index 00000000..fa22697c
--- /dev/null
+++ b/frontend/src/hooks/use-privacy-mode.ts
@@ -0,0 +1,36 @@
+import { useSyncExternalStore, useCallback } from 'react'
+
+const STORAGE_KEY = 'privacyMode'
+const MASK = '\u2022\u2022\u2022\u2022\u2022'
+
+const listeners = new Set<() => void>()
+
+function getSnapshot(): boolean {
+ return localStorage.getItem(STORAGE_KEY) === 'true'
+}
+
+function subscribe(cb: () => void) {
+ listeners.add(cb)
+ return () => listeners.delete(cb)
+}
+
+function notify() {
+ listeners.forEach((cb) => cb())
+}
+
+export function usePrivacyMode() {
+ const privacyMode = useSyncExternalStore(subscribe, getSnapshot, () => false)
+
+ const togglePrivacyMode = useCallback(() => {
+ const next = !getSnapshot()
+ localStorage.setItem(STORAGE_KEY, String(next))
+ notify()
+ }, [])
+
+ const mask = useCallback(
+ (value: string) => (privacyMode ? MASK : value),
+ [privacyMode],
+ )
+
+ return { privacyMode, togglePrivacyMode, mask, MASK } as const
+}
diff --git a/frontend/src/index.css b/frontend/src/index.css
new file mode 100644
index 00000000..5401ed66
--- /dev/null
+++ b/frontend/src/index.css
@@ -0,0 +1,132 @@
+@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap');
+@import "tailwindcss";
+@import "tw-animate-css";
+@import "shadcn/tailwind.css";
+
+@custom-variant dark (&:is(.dark *));
+
+:root {
+ --background: #F8F9FB;
+ --foreground: #0F172A;
+ --card: #FFFFFF;
+ --card-foreground: #0F172A;
+ --popover: #FFFFFF;
+ --popover-foreground: #0F172A;
+ --primary: #6366F1;
+ --primary-foreground: #FFFFFF;
+ --secondary: #F1F5F9;
+ --secondary-foreground: #0F172A;
+ --muted: #F1F5F9;
+ --muted-foreground: #64748B;
+ --accent: #EEF2FF;
+ --accent-foreground: #4F46E5;
+ --destructive: #F43F5E;
+ --destructive-foreground: #FFFFFF;
+ --border: #E8ECF1;
+ --input: #E8ECF1;
+ --ring: #6366F1;
+ --radius: 0.625rem;
+ --chart-1: #6366F1;
+ --chart-2: #8B5CF6;
+ --chart-3: #10B981;
+ --chart-4: #F59E0B;
+ --chart-5: #F43F5E;
+ --sidebar: #FFFFFF;
+ --sidebar-foreground: #0F172A;
+ --sidebar-primary: #6366F1;
+ --sidebar-primary-foreground: #FFFFFF;
+ --sidebar-accent: #F1F5F9;
+ --sidebar-accent-foreground: #4F46E5;
+ --sidebar-border: #E8ECF1;
+ --sidebar-ring: #6366F1;
+ --sidebar-muted: #64748B;
+}
+
+.dark {
+ --background: #0C0D12;
+ --foreground: #F0F0F5;
+ --card: #16171F;
+ --card-foreground: #F0F0F5;
+ --popover: #16171F;
+ --popover-foreground: #F0F0F5;
+ --primary: #818CF8;
+ --primary-foreground: #FFFFFF;
+ --secondary: #252836;
+ --secondary-foreground: #F0F0F5;
+ --muted: #252836;
+ --muted-foreground: #8A8F9E;
+ --accent: #1E1B4B;
+ --accent-foreground: #A5B4FC;
+ --destructive: #FB7185;
+ --destructive-foreground: #0C0D12;
+ --border: #2A2D3A;
+ --input: #2A2D3A;
+ --ring: #818CF8;
+ --sidebar: #16171F;
+ --sidebar-foreground: #F0F0F5;
+ --sidebar-primary: #818CF8;
+ --sidebar-primary-foreground: #FFFFFF;
+ --sidebar-accent: #252836;
+ --sidebar-accent-foreground: #A5B4FC;
+ --sidebar-border: #2A2D3A;
+ --sidebar-ring: #818CF8;
+ --sidebar-muted: #8A8F9E;
+}
+
+@theme inline {
+ --radius-sm: calc(var(--radius) - 4px);
+ --radius-md: calc(var(--radius) - 2px);
+ --radius-lg: var(--radius);
+ --radius-xl: calc(var(--radius) + 4px);
+ --radius-2xl: calc(var(--radius) + 8px);
+ --radius-3xl: calc(var(--radius) + 12px);
+ --radius-4xl: calc(var(--radius) + 16px);
+ --color-background: var(--background);
+ --color-foreground: var(--foreground);
+ --color-card: var(--card);
+ --color-card-foreground: var(--card-foreground);
+ --color-popover: var(--popover);
+ --color-popover-foreground: var(--popover-foreground);
+ --color-primary: var(--primary);
+ --color-primary-foreground: var(--primary-foreground);
+ --color-secondary: var(--secondary);
+ --color-secondary-foreground: var(--secondary-foreground);
+ --color-muted: var(--muted);
+ --color-muted-foreground: var(--muted-foreground);
+ --color-accent: var(--accent);
+ --color-accent-foreground: var(--accent-foreground);
+ --color-destructive: var(--destructive);
+ --color-border: var(--border);
+ --color-input: var(--input);
+ --color-ring: var(--ring);
+ --color-chart-1: var(--chart-1);
+ --color-chart-2: var(--chart-2);
+ --color-chart-3: var(--chart-3);
+ --color-chart-4: var(--chart-4);
+ --color-chart-5: var(--chart-5);
+ --color-sidebar: var(--sidebar);
+ --color-sidebar-foreground: var(--sidebar-foreground);
+ --color-sidebar-primary: var(--sidebar-primary);
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
+ --color-sidebar-accent: var(--sidebar-accent);
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
+ --color-sidebar-border: var(--sidebar-border);
+ --color-sidebar-ring: var(--sidebar-ring);
+ --color-sidebar-muted: var(--sidebar-muted);
+}
+
+@layer base {
+ * {
+ @apply border-border outline-ring/50;
+ }
+ body {
+ @apply bg-background text-foreground;
+ font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
+ font-feature-settings: "cv02","cv03","cv04","cv11";
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ }
+ h1, h2, h3 {
+ letter-spacing: -0.035em;
+ }
+}
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
new file mode 100644
index 00000000..83cce334
--- /dev/null
+++ b/frontend/src/lib/api.ts
@@ -0,0 +1,394 @@
+import axios from 'axios'
+import type {
+ User,
+ Category,
+ CategoryGroup,
+ BankConnection,
+ ConnectionSettings,
+ Account,
+ AccountSummary,
+ Transaction,
+ RecurringTransaction,
+ ProjectedTransaction,
+ Budget,
+ BudgetVsActual,
+ Rule,
+ ImportLog,
+ DashboardSummary,
+ SpendingByCategory,
+ MonthlyTrend,
+ BalanceHistory,
+ PaginatedResponse,
+} from '@/types'
+
+const api = axios.create({
+ baseURL: '/api',
+})
+
+// Add auth token to requests
+api.interceptors.request.use((config) => {
+ const token = localStorage.getItem('token')
+ if (token) {
+ config.headers.Authorization = `Bearer ${token}`
+ }
+ return config
+})
+
+// Handle auth errors
+api.interceptors.response.use(
+ (response) => response,
+ (error) => {
+ if (error.response?.status === 401) {
+ localStorage.removeItem('token')
+ window.location.href = '/login'
+ }
+ return Promise.reject(error)
+ }
+)
+
+// Setup
+export const setup = {
+ status: async (): Promise<{ has_users: boolean }> => {
+ const { data } = await api.get('/setup/status')
+ return data
+ },
+ createAdmin: async (email: string, password: string, currency = 'BRL', name = '', language = 'pt-BR'): Promise<{ access_token: string }> => {
+ const { data } = await api.post('/setup/create-admin', { email, password, currency, name, language })
+ return data
+ },
+}
+
+// Auth
+export const auth = {
+ login: async (email: string, password: string) => {
+ const formData = new URLSearchParams()
+ formData.append('username', email)
+ formData.append('password', password)
+ const { data } = await api.post('/auth/login', formData, {
+ headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+ })
+ return data
+ },
+ register: async (email: string, password: string) => {
+ const { data } = await api.post('/auth/register', { email, password })
+ return data
+ },
+ me: async (): Promise<User> => {
+ const { data } = await api.get('/users/me')
+ return data
+ },
+ updateMe: async (updates: Partial<User>): Promise<User> => {
+ const { data } = await api.patch('/users/me', updates)
+ return data
+ },
+}
+
+// Categories
+export const categories = {
+ list: async (): Promise<Category[]> => {
+ const { data } = await api.get('/categories')
+ return data
+ },
+ create: async (category: Partial<Category>): Promise<Category> => {
+ const { data } = await api.post('/categories', category)
+ return data
+ },
+ update: async (id: string, category: Partial<Category>): Promise<Category> => {
+ const { data } = await api.patch(`/categories/${id}`, category)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/categories/${id}`)
+ },
+}
+
+// Category Groups
+export const categoryGroups = {
+ list: async (): Promise<CategoryGroup[]> => {
+ const { data } = await api.get('/category-groups')
+ return data
+ },
+ create: async (group: Partial<CategoryGroup>): Promise<CategoryGroup> => {
+ const { data } = await api.post('/category-groups', group)
+ return data
+ },
+ update: async (id: string, group: Partial<CategoryGroup>): Promise<CategoryGroup> => {
+ const { data } = await api.patch(`/category-groups/${id}`, group)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/category-groups/${id}`)
+ },
+}
+
+// Bank Connections
+export const connections = {
+ list: async (): Promise<BankConnection[]> => {
+ const { data } = await api.get('/connections')
+ return data
+ },
+ getProviders: async (): Promise<{ name: string; display_name: string; description: string; flow_type: string; configured: boolean }[]> => {
+ const { data } = await api.get('/connections/providers')
+ return data.providers
+ },
+ getConnectToken: async (provider = 'pluggy'): Promise<string> => {
+ const { data } = await api.post('/connections/connect-token', { provider })
+ return data.access_token
+ },
+ getOAuthUrl: async (provider: string): Promise<string> => {
+ const { data } = await api.post('/connections/oauth/url', { provider })
+ return data.url
+ },
+ handleCallback: async (code: string, provider: string): Promise<BankConnection> => {
+ const { data } = await api.post('/connections/oauth/callback', { code, provider })
+ return data
+ },
+ sync: async (id: string): Promise<BankConnection> => {
+ const { data } = await api.post(`/connections/${id}/sync`)
+ return data
+ },
+ getReconnectToken: async (connectionId: string): Promise<string> => {
+ const { data } = await api.post(`/connections/${connectionId}/reconnect-token`)
+ return data.access_token
+ },
+ updateSettings: async (id: string, settings: Partial<ConnectionSettings>): Promise<BankConnection> => {
+ const { data } = await api.patch(`/connections/${id}/settings`, settings)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/connections/${id}`)
+ },
+}
+
+// Accounts
+export const accounts = {
+ list: async (includeClosed = false): Promise<Account[]> => {
+ const { data } = await api.get('/accounts', { params: { include_closed: includeClosed } })
+ return data
+ },
+ get: async (id: string): Promise<Account> => {
+ const { data } = await api.get(`/accounts/${id}`)
+ return data
+ },
+ create: async (account: { name: string; type: string; balance?: number; currency?: string }): Promise<Account> => {
+ const { data } = await api.post('/accounts', account)
+ return data
+ },
+ update: async (id: string, account: Partial<Account>): Promise<Account> => {
+ const { data } = await api.patch(`/accounts/${id}`, account)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/accounts/${id}`)
+ },
+ summary: async (id: string, from?: string, to?: string): Promise<AccountSummary> => {
+ const { data } = await api.get(`/accounts/${id}/summary`, { params: { from, to } })
+ return data
+ },
+ balanceHistory: async (id: string, from?: string, to?: string): Promise<{ date: string; balance: number }[]> => {
+ const { data } = await api.get(`/accounts/${id}/balance-history`, { params: { from, to } })
+ return data
+ },
+ close: async (id: string): Promise<Account> => {
+ const { data } = await api.post(`/accounts/${id}/close`)
+ return data
+ },
+ reopen: async (id: string): Promise<Account> => {
+ const { data } = await api.post(`/accounts/${id}/reopen`)
+ return data
+ },
+}
+
+// Transactions
+export const transactions = {
+ list: async (params?: {
+ account_id?: string
+ category_id?: string
+ uncategorized?: boolean
+ type?: string
+ from?: string
+ to?: string
+ q?: string
+ page?: number
+ limit?: number
+ include_opening_balance?: boolean
+ }): Promise<PaginatedResponse<Transaction>> => {
+ const { data } = await api.get('/transactions', { params })
+ return data
+ },
+ get: async (id: string): Promise<Transaction> => {
+ const { data } = await api.get(`/transactions/${id}`)
+ return data
+ },
+ create: async (transaction: Partial<Transaction>): Promise<Transaction> => {
+ const { data } = await api.post('/transactions', transaction)
+ return data
+ },
+ update: async (id: string, transaction: Partial<Transaction>): Promise<Transaction> => {
+ const { data } = await api.patch(`/transactions/${id}`, transaction)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/transactions/${id}`)
+ },
+ bulkCategorize: async (transactionIds: string[], categoryId: string | null): Promise<{ updated: number }> => {
+ const { data } = await api.patch('/transactions/bulk-categorize', {
+ transaction_ids: transactionIds,
+ category_id: categoryId,
+ })
+ return data
+ },
+ previewImport: async (file: File, options?: {
+ date_format?: string
+ flip_amount?: boolean
+ inflow_column?: string
+ outflow_column?: string
+ }): Promise<{ transactions: Transaction[]; detected_format: string }> => {
+ const formData = new FormData()
+ formData.append('file', file)
+ if (options?.date_format) formData.append('date_format', options.date_format)
+ if (options?.flip_amount) formData.append('flip_amount', 'true')
+ if (options?.inflow_column) formData.append('inflow_column', options.inflow_column)
+ if (options?.outflow_column) formData.append('outflow_column', options.outflow_column)
+ const { data } = await api.post('/transactions/import/preview', formData)
+ return data
+ },
+ import: async (account_id: string, transactions: Transaction[], filename: string, detected_format: string): Promise<{ imported: number; skipped: number; import_log_id: string }> => {
+ const { data } = await api.post('/transactions/import', { account_id, transactions, filename, detected_format })
+ return data
+ },
+ export: async (params?: {
+ account_id?: string
+ category_id?: string
+ uncategorized?: boolean
+ type?: string
+ from?: string
+ to?: string
+ q?: string
+ }): Promise<void> => {
+ const { data } = await api.get('/transactions/export', { params, responseType: 'blob' })
+ const blob = new Blob([data], { type: 'text/csv;charset=utf-8;' })
+ const url = URL.createObjectURL(blob)
+ const a = document.createElement('a')
+ a.href = url
+ a.download = `transactions-${new Date().toISOString().slice(0, 10)}.csv`
+ document.body.appendChild(a)
+ a.click()
+ document.body.removeChild(a)
+ URL.revokeObjectURL(url)
+ },
+}
+
+// Categorization Rules
+export const rules = {
+ list: async (): Promise<Rule[]> => {
+ const { data } = await api.get('/rules')
+ return data
+ },
+ create: async (rule: Omit<Rule, 'id' | 'user_id'>): Promise<Rule> => {
+ const { data } = await api.post('/rules', rule)
+ return data
+ },
+ update: async (id: string, rule: Partial<Rule>): Promise<Rule> => {
+ const { data } = await api.patch(`/rules/${id}`, rule)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/rules/${id}`)
+ },
+ applyAll: async (): Promise<{ applied: number }> => {
+ const { data } = await api.post('/rules/apply-all')
+ return data
+ },
+ packs: async (): Promise<{ code: string; name: string; flag: string; rule_count: number; installed: boolean }[]> => {
+ const { data } = await api.get('/rules/packs')
+ return data
+ },
+ installPack: async (packCode: string): Promise<{ installed: number }> => {
+ const { data } = await api.post(`/rules/packs/${packCode}/install`)
+ return data
+ },
+}
+
+// Recurring Transactions
+export const recurring = {
+ list: async (): Promise<RecurringTransaction[]> => {
+ const { data } = await api.get('/recurring-transactions')
+ return data
+ },
+ create: async (rt: Partial<RecurringTransaction>): Promise<RecurringTransaction> => {
+ const { data } = await api.post('/recurring-transactions', rt)
+ return data
+ },
+ update: async (id: string, rt: Partial<RecurringTransaction>): Promise<RecurringTransaction> => {
+ const { data } = await api.patch(`/recurring-transactions/${id}`, rt)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/recurring-transactions/${id}`)
+ },
+ generate: async (): Promise<{ generated: number }> => {
+ const { data } = await api.post('/recurring-transactions/generate')
+ return data
+ },
+}
+
+// Budgets
+export const budgets = {
+ list: async (month?: string): Promise<Budget[]> => {
+ const { data } = await api.get('/budgets', { params: { month } })
+ return data
+ },
+ create: async (budget: { category_id: string; amount: number; month: string; is_recurring?: boolean }): Promise<Budget> => {
+ const { data } = await api.post('/budgets', budget)
+ return data
+ },
+ update: async (id: string, budget: { amount?: number }): Promise<Budget> => {
+ const { data } = await api.patch(`/budgets/${id}`, budget)
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/budgets/${id}`)
+ },
+ comparison: async (month?: string): Promise<BudgetVsActual[]> => {
+ const { data } = await api.get('/budgets/comparison', { params: { month } })
+ return data
+ },
+}
+
+// Dashboard
+export const dashboard = {
+ summary: async (month?: string, balanceDate?: string): Promise<DashboardSummary> => {
+ const { data } = await api.get('/dashboard/summary', { params: { month, balance_date: balanceDate } })
+ return data
+ },
+ spendingByCategory: async (month?: string): Promise<SpendingByCategory[]> => {
+ const { data } = await api.get('/dashboard/spending-by-category', { params: { month } })
+ return data
+ },
+ monthlyTrend: async (months = 6): Promise<MonthlyTrend[]> => {
+ const { data } = await api.get('/dashboard/monthly-trend', { params: { months } })
+ return data
+ },
+ projectedTransactions: async (month?: string): Promise<ProjectedTransaction[]> => {
+ const { data } = await api.get('/dashboard/projected-transactions', { params: { month } })
+ return data
+ },
+ balanceHistory: async (month?: string): Promise<BalanceHistory> => {
+ const { data } = await api.get('/dashboard/balance-history', { params: { month } })
+ return data
+ },
+}
+
+// Import Logs
+export const importLogs = {
+ list: async (): Promise<ImportLog[]> => {
+ const { data } = await api.get('/import-logs')
+ return data
+ },
+ delete: async (id: string): Promise<void> => {
+ await api.delete(`/import-logs/${id}`)
+ },
+}
+
+export default api
diff --git a/frontend/src/lib/category-icons.ts b/frontend/src/lib/category-icons.ts
new file mode 100644
index 00000000..82db7fab
--- /dev/null
+++ b/frontend/src/lib/category-icons.ts
@@ -0,0 +1,103 @@
+import type { LucideIcon } from 'lucide-react'
+import {
+ House, UtensilsCrossed, Car, ShoppingCart, Pill, Gamepad2,
+ Smartphone, BookOpen, ArrowLeftRight, CircleHelp,
+ Wallet, CreditCard, Banknote, PiggyBank, TrendingUp, TrendingDown,
+ Receipt, ShoppingBag, Gift, Heart, Baby, Dog, Cat,
+ Plane, Train, Bus, Fuel, Bike,
+ Lightbulb, Droplets, Flame, Wifi, Tv,
+ GraduationCap, Briefcase, Building2, Landmark,
+ Dumbbell, Shirt, Scissors, Wrench, Hammer,
+ Music, Film, Coffee, Beer, Pizza, Salad,
+ Stethoscope, Syringe, Cross,
+ PartyPopper, TreePine, Umbrella, Globe, Sparkles
+} from 'lucide-react'
+
+export interface CategoryIconEntry {
+ name: string // Lucide icon name (stored in DB)
+ label: string // Portuguese label for search
+ icon: LucideIcon // Component reference
+}
+
+export const CATEGORY_ICONS: CategoryIconEntry[] = [
+ // Moradia & Casa
+ { name: 'house', label: 'Casa / Moradia', icon: House },
+ { name: 'lightbulb', label: 'Luz / Energia', icon: Lightbulb },
+ { name: 'droplets', label: 'Água', icon: Droplets },
+ { name: 'flame', label: 'Gás', icon: Flame },
+ { name: 'wifi', label: 'Internet / Wi-Fi', icon: Wifi },
+ { name: 'tv', label: 'TV / Streaming', icon: Tv },
+ // Alimentação
+ { name: 'utensils-crossed', label: 'Alimentação / Restaurante', icon: UtensilsCrossed },
+ { name: 'coffee', label: 'Café', icon: Coffee },
+ { name: 'beer', label: 'Bebidas / Bar', icon: Beer },
+ { name: 'pizza', label: 'Pizza / Fast Food', icon: Pizza },
+ { name: 'salad', label: 'Salada / Saudável', icon: Salad },
+ // Transporte
+ { name: 'car', label: 'Carro / Transporte', icon: Car },
+ { name: 'fuel', label: 'Combustível / Gasolina', icon: Fuel },
+ { name: 'bus', label: 'Ônibus', icon: Bus },
+ { name: 'train', label: 'Trem / Metrô', icon: Train },
+ { name: 'plane', label: 'Avião / Viagem', icon: Plane },
+ { name: 'bike', label: 'Bicicleta', icon: Bike },
+ // Compras
+ { name: 'shopping-cart', label: 'Mercado / Supermercado', icon: ShoppingCart },
+ { name: 'shopping-bag', label: 'Compras / Loja', icon: ShoppingBag },
+ { name: 'gift', label: 'Presente', icon: Gift },
+ { name: 'shirt', label: 'Roupa / Vestuário', icon: Shirt },
+ // Saúde
+ { name: 'pill', label: 'Remédio / Farmácia', icon: Pill },
+ { name: 'stethoscope', label: 'Médico / Consulta', icon: Stethoscope },
+ { name: 'syringe', label: 'Vacina / Exame', icon: Syringe },
+ { name: 'cross', label: 'Hospital / Emergência', icon: Cross },
+ { name: 'heart', label: 'Saúde / Bem-estar', icon: Heart },
+ { name: 'dumbbell', label: 'Academia / Exercício', icon: Dumbbell },
+ // Lazer
+ { name: 'gamepad-2', label: 'Jogos / Lazer', icon: Gamepad2 },
+ { name: 'music', label: 'Música', icon: Music },
+ { name: 'film', label: 'Cinema / Filme', icon: Film },
+ { name: 'party-popper', label: 'Festa / Evento', icon: PartyPopper },
+ // Tecnologia & Assinaturas
+ { name: 'smartphone', label: 'Celular / Telefone', icon: Smartphone },
+ { name: 'credit-card', label: 'Cartão de Crédito', icon: CreditCard },
+ // Educação
+ { name: 'book-open', label: 'Livro / Leitura', icon: BookOpen },
+ { name: 'graduation-cap', label: 'Educação / Curso', icon: GraduationCap },
+ // Trabalho & Negócios
+ { name: 'briefcase', label: 'Trabalho / Negócios', icon: Briefcase },
+ { name: 'building-2', label: 'Empresa / Escritório', icon: Building2 },
+ { name: 'landmark', label: 'Banco / Governo', icon: Landmark },
+ // Finanças
+ { name: 'wallet', label: 'Carteira', icon: Wallet },
+ { name: 'banknote', label: 'Dinheiro', icon: Banknote },
+ { name: 'piggy-bank', label: 'Poupança / Investimento', icon: PiggyBank },
+ { name: 'trending-up', label: 'Rendimento / Lucro', icon: TrendingUp },
+ { name: 'trending-down', label: 'Prejuízo / Perda', icon: TrendingDown },
+ { name: 'receipt', label: 'Recibo / Nota Fiscal', icon: Receipt },
+ { name: 'arrow-left-right', label: 'Transferência', icon: ArrowLeftRight },
+ // Família & Pets
+ { name: 'baby', label: 'Bebê / Criança', icon: Baby },
+ { name: 'dog', label: 'Pet / Cachorro', icon: Dog },
+ { name: 'cat', label: 'Pet / Gato', icon: Cat },
+ // Serviços & Manutenção
+ { name: 'scissors', label: 'Cabelo / Beleza', icon: Scissors },
+ { name: 'wrench', label: 'Manutenção / Reparo', icon: Wrench },
+ { name: 'hammer', label: 'Construção / Reforma', icon: Hammer },
+ // Outros
+ { name: 'tree-pine', label: 'Natureza / Jardim', icon: TreePine },
+ { name: 'umbrella', label: 'Seguro', icon: Umbrella },
+ { name: 'globe', label: 'Internacional', icon: Globe },
+ { name: 'sparkles', label: 'Especial', icon: Sparkles },
+ { name: 'circle-help', label: 'Outros / Indefinido', icon: CircleHelp },
+]
+
+// O(1) lookup map: icon-name → LucideIcon component
+export const ICON_MAP: Record<string, LucideIcon> = Object.fromEntries(
+ CATEGORY_ICONS.map((entry) => [entry.name, entry.icon])
+)
+
+// Check if a string is an emoji (for backward compatibility with old data)
+export function isEmoji(str: string): boolean {
+ // Emoji strings are typically 1-2 characters with high code points
+ return str.length <= 2 && /\p{Emoji}/u.test(str)
+}
diff --git a/frontend/src/lib/i18n.ts b/frontend/src/lib/i18n.ts
new file mode 100644
index 00000000..8d3cce3f
--- /dev/null
+++ b/frontend/src/lib/i18n.ts
@@ -0,0 +1,29 @@
+import i18n from 'i18next'
+import { initReactI18next } from 'react-i18next'
+import LanguageDetector from 'i18next-browser-languagedetector'
+
+import ptBR from '@/locales/pt-BR.json'
+import en from '@/locales/en.json'
+
+function syncHtmlLang(lng: string) {
+ document.documentElement.lang = lng
+}
+
+i18n
+ .use(LanguageDetector)
+ .use(initReactI18next)
+ .init({
+ resources: {
+ 'pt-BR': { translation: ptBR },
+ en: { translation: en },
+ },
+ fallbackLng: 'pt-BR',
+ interpolation: {
+ escapeValue: false,
+ },
+ })
+
+syncHtmlLang(i18n.language)
+i18n.on('languageChanged', syncHtmlLang)
+
+export default i18n
diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts
new file mode 100644
index 00000000..bd0c391d
--- /dev/null
+++ b/frontend/src/lib/utils.ts
@@ -0,0 +1,6 @@
+import { clsx, type ClassValue } from "clsx"
+import { twMerge } from "tailwind-merge"
+
+export function cn(...inputs: ClassValue[]) {
+ return twMerge(clsx(inputs))
+}
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
new file mode 100644
index 00000000..89c72828
--- /dev/null
+++ b/frontend/src/locales/en.json
@@ -0,0 +1,401 @@
+{
+ "app": {
+ "name": "Securo"
+ },
+ "nav": {
+ "dashboard": "Dashboard",
+ "transactions": "Transactions",
+ "accounts": "Accounts",
+ "import": "Import",
+ "rules": "Rules",
+ "categories": "Categories",
+ "budgets": "Budgets",
+ "settings": "Settings",
+ "recurring": "Recurring"
+ },
+ "auth": {
+ "login": "Login",
+ "register": "Create account",
+ "logout": "Logout",
+ "email": "Email",
+ "password": "Password",
+ "forgotPassword": "Forgot password?",
+ "loginDescription": "Sign in to access your account",
+ "invalidCredentials": "Invalid email or password",
+ "noAccount": "Don't have an account?",
+ "hasAccount": "Already have an account?"
+ },
+ "dashboard": {
+ "title": "Dashboard",
+ "greetingMorning": "Good morning",
+ "greetingAfternoon": "Good afternoon",
+ "greetingEvening": "Good evening",
+ "totalBalance": "Total Balance",
+ "monthlyIncome": "Monthly Income",
+ "monthlyExpenses": "Monthly Expenses",
+ "pendingCategorization": "Uncategorized",
+ "recentTransactions": "Recent Transactions",
+ "periodTransactions": "Period Transactions",
+ "spendingByCategory": "Spending by Category",
+ "monthlyTrend": "Monthly Trend",
+ "budgetVsActual": "Budget vs Actual",
+ "balanceFlow": "Balance Flow",
+ "balanceFlowVsPrev": "In {{month}} on day {{day}}: {{amount}} ({{delta}})",
+ "day": "Day {{day}}",
+ "noData": "No data available",
+ "noTransactions": "No transactions in this period",
+ "ofBudget": "of {{budget}}",
+ "previous": "Previous",
+ "next": "Next",
+ "balanceAsOf": "as of {{date}}",
+ "today": "today",
+ "drillDownIncome": "Income — {{month}}",
+ "drillDownExpenses": "Expenses — {{month}}",
+ "drillDownCategory": "{{category}} — {{month}}",
+ "drillDownUncategorized": "Uncategorized transactions",
+ "drillDownDay": "Transactions — {{date}}",
+ "drillDownTotal": "{{count}} transactions · {{total}}",
+ "drillDownEmpty": "No transactions found",
+ "drillDownClose": "Close",
+ "savingsRate": "Savings Rate",
+ "spendingProjection": "At this pace, you'll spend {{amount}} by month end",
+ "uncategorizedCta": "{{count}} transactions need categorizing",
+ "uncategorizedTotal": "{{amount}} in total",
+ "categorizeNow": "Categorize now",
+ "allCategorized": "All caught up!",
+ "allCategorizedDesc": "All transactions are categorized"
+ },
+ "transactions": {
+ "title": "Transactions",
+ "section": "Financial",
+ "description": "Description",
+ "amount": "Amount",
+ "date": "Date",
+ "category": "Category",
+ "account": "Account",
+ "noCategory": "No category",
+ "addManual": "Add Transaction",
+ "created": "Transaction created",
+ "updated": "Transaction updated",
+ "deleted": "Transaction deleted",
+ "confirmDelete": "Are you sure you want to delete this transaction?",
+ "makeRecurring": "Make recurring",
+ "recurringBadge": "Recurring",
+ "transfer": "Transfer",
+ "pending": "Pending",
+ "recurringInfo": "Recurring transaction ({{frequency}}). Next: {{next}}",
+ "from": "From",
+ "to": "To",
+ "all": "All",
+ "searchPlaceholder": "Search transactions...",
+ "clearFilters": "Clear filters",
+ "exportCsv": "Export CSV",
+ "exporting": "Exporting...",
+ "exportSuccess": "Transactions exported successfully",
+ "exportError": "Failed to export transactions",
+ "syncedInfo": "Bank-synced transaction — only category and notes can be edited",
+ "uncategorized": "Uncategorized",
+ "selected": "{{count}} selected",
+ "bulkCategorize": "Apply",
+ "bulkSuccess": "{{count}} transactions categorized",
+ "selectCategory": "Select category...",
+ "noResults": "No transactions found",
+ "previous": "Previous",
+ "next": "Next"
+ },
+ "accounts": {
+ "title": "Accounts",
+ "connectBank": "Connect Bank",
+ "confirmDeleteTitle": "Delete account?",
+ "confirmDeleteDesc": "This action is irreversible and will remove all transactions associated with this account.",
+ "openingBalance": "opening balance",
+ "notFound": "Account not found.",
+ "balance": "Balance",
+ "lastSync": "Last sync",
+ "sync": "Sync",
+ "disconnect": "Disconnect",
+ "addManual": "Add Account",
+ "editAccount": "Edit Account",
+ "manualAccounts": "Manual Accounts",
+ "bankConnections": "Bank Connections",
+ "noManualAccounts": "No manual accounts yet",
+ "noBankConnections": "No bank connections",
+ "noAccountsFound": "No accounts found",
+ "accountName": "Account name",
+ "accountType": "Type",
+ "currency": "Currency",
+ "typeChecking": "Checking",
+ "typeSavings": "Savings",
+ "typeCreditCard": "Credit Card",
+ "typeInvestment": "Investment",
+ "typeWallet": "Wallet",
+ "created": "Account created",
+ "updated": "Account updated",
+ "deleted": "Account deleted",
+ "syncDone": "Sync completed",
+ "syncError": "Sync failed",
+ "connected": "Bank connected successfully",
+ "connectError": "Failed to connect bank",
+ "disconnected": "Connection removed",
+ "viewTransactions": "View transactions",
+ "currentBalance": "Current balance",
+ "income": "Income",
+ "expenses": "Expenses",
+ "thisMonth": "This month",
+ "backToAccounts": "Back to accounts",
+ "runningBalance": "Balance",
+ "noTransactions": "No transactions for this account",
+ "syncFailed": "Sync failed",
+ "reconnect": "Reconnect",
+ "connectionError": "Connection error — reconnect to fix",
+ "close": "Close account",
+ "reopen": "Reopen account",
+ "accountClosed": "Account closed",
+ "accountReopened": "Account reopened",
+ "closedBanner": "This account is closed",
+ "closedAccounts": "Closed Accounts",
+ "confirmClose": "Close this account? It will be hidden from totals.",
+ "confirmCloseBank": "This will also stop syncing this account.",
+ "mergedCount": "{{count}} transactions merged with synced data",
+ "selectConnector": "Select Connector",
+ "selectConnectorDesc": "Choose a bank connection provider",
+ "connectorNotConfigured": "This connector requires configuration. Set up the required credentials to enable it.",
+ "noConnectorsAvailable": "No bank connectors available"
+ },
+ "connections": {
+ "settings": "Connection settings",
+ "payeeSource": "Payee source",
+ "payeeAuto": "Auto (merchant > payment data)",
+ "payeeMerchant": "Merchant name only",
+ "payeePaymentData": "Payer/receiver name",
+ "payeeDescription": "Transaction description",
+ "payeeNone": "Don't set payee",
+ "importPending": "Import pending transactions"
+ },
+ "settings": {
+ "rules": "Rules",
+ "recurring": "Recurring",
+ "budgets": "Budgets",
+ "preferences": "Preferences",
+ "theme": "Theme",
+ "themeLight": "Light",
+ "themeDark": "Dark",
+ "themeSystem": "System"
+ },
+ "budgets": {
+ "title": "Budgets",
+ "add": "Add Budget",
+ "edit": "Edit Budget",
+ "category": "Category",
+ "amount": "Limit",
+ "actions": "Actions",
+ "selectCategory": "Select category",
+ "empty": "No budgets for this month",
+ "created": "Budget created",
+ "updated": "Budget updated",
+ "deleted": "Budget deleted",
+ "repeatEveryMonth": "Repeat every month",
+ "recurringLabel": "Recurring"
+ },
+ "recurring": {
+ "title": "Recurring Transactions",
+ "add": "Add Recurring",
+ "edit": "Edit Recurring",
+ "description": "Description",
+ "amount": "Amount",
+ "currency": "Currency",
+ "type": "Type",
+ "expense": "Expense",
+ "income": "Income",
+ "frequency": "Frequency",
+ "monthly": "Monthly",
+ "weekly": "Weekly",
+ "yearly": "Yearly",
+ "dayOfMonth": "Day of month",
+ "startDate": "Start date",
+ "endDate": "End date (optional)",
+ "category": "Category",
+ "account": "Account",
+ "noAccount": "None",
+ "nextOccurrence": "Next",
+ "status": "Status",
+ "actions": "Actions",
+ "active": "Active",
+ "inactive": "Inactive",
+ "empty": "No recurring transactions",
+ "created": "Recurring transaction created",
+ "updated": "Recurring transaction updated",
+ "deleted": "Recurring transaction deleted",
+ "generated": "{{count}} transactions generated",
+ "generatePending": "Generate Pending"
+ },
+ "rules": {
+ "section": "Automation",
+ "packs": "Rule Packs",
+ "packRuleCount": "{{count}} rules",
+ "installPack": "Install",
+ "packInstalled": "{{count}} rules installed",
+ "installed": "Installed",
+ "packAlreadyInstalled": "Pack already installed",
+ "duplicateName": "A rule with this name already exists",
+ "sectionTitle": "Categorization Rules",
+ "reapplyAll": "Reapply all",
+ "add": "Add",
+ "created": "Rule created",
+ "updated": "Rule updated",
+ "deleted": "Rule deleted",
+ "applied": "Rules applied to {{count}} transactions",
+ "inactive": "inactive",
+ "empty": "No rules created",
+ "editRule": "Edit Rule",
+ "newRule": "New Rule",
+ "name": "Name",
+ "priority": "Priority",
+ "conditions": "Conditions",
+ "actions": "Actions",
+ "andOp": "AND",
+ "orOp": "OR",
+ "addCondition": "Add condition",
+ "addAction": "Add action",
+ "setCategory": "Set category",
+ "appendNotes": "Append tags/notes",
+ "selectCategory": "Select category...",
+ "selectAccount": "Select account...",
+ "ruleActive": "Active rule",
+ "noConditions": "(no conditions)",
+ "noActions": "(no actions)",
+ "fieldDescription": "Description",
+ "fieldNotes": "Notes",
+ "fieldAmount": "Amount",
+ "fieldType": "Type",
+ "fieldAccount": "Account",
+ "fieldDate": "Date",
+ "opContains": "contains",
+ "opNotContains": "does not contain",
+ "opEquals": "equals",
+ "opNotEquals": "not equal to",
+ "opStartsWith": "starts with",
+ "opEndsWith": "ends with",
+ "opRegex": "regex",
+ "opIs": "is",
+ "typeExpense": "Expense (debit)",
+ "typeIncome": "Income (credit)",
+ "valuePlaceholder": "Value..."
+ },
+ "categories": {
+ "title": "Categories",
+ "addCategory": "Add Category",
+ "editCategory": "Edit Category",
+ "newCategory": "New Category",
+ "group": "Group",
+ "noGroup": "No group",
+ "selectGroup": "Select group",
+ "created": "Category created",
+ "updated": "Category updated",
+ "deleted": "Category deleted",
+ "expandAll": "Expand all",
+ "collapseAll": "Collapse all"
+ },
+ "groups": {
+ "title": "Category Groups",
+ "add": "Add Group",
+ "edit": "Edit Group",
+ "new": "New Group",
+ "name": "Name",
+ "icon": "Icon",
+ "color": "Color",
+ "position": "Position",
+ "created": "Group created",
+ "updated": "Group updated",
+ "deleted": "Group deleted",
+ "noGroup": "No group",
+ "systemGroup": "System group"
+ },
+ "import": {
+ "acceptedFormats": "Accepted formats: OFX, CSV, QIF, CAMT",
+ "transactionsImported": "transactions imported",
+ "importedWithSkipped": "{{imported}} imported, {{skipped}} duplicates skipped",
+ "csvOptions": "CSV Options",
+ "dateFormat": "Date format",
+ "dateFormatAuto": "Auto (detect)",
+ "flipAmounts": "Negate amounts (swap income/expense)",
+ "splitColumns": "Split inflow/outflow columns",
+ "inflowColumn": "Inflow column",
+ "outflowColumn": "Outflow column",
+ "selectColumn": "Select column...",
+ "title": "Import",
+ "subtitle": "Bank statement",
+ "processing": "Processing file…",
+ "removeFile": "Remove file",
+ "dragOrClick": "Drag a file or click to select",
+ "preview": "Preview",
+ "incomeCount": "{{count}} income",
+ "expenseCount": "{{count}} expenses",
+ "importTo": "Import to:",
+ "selectAccount": "Select account…",
+ "selectAccountWarning": "Select an account",
+ "showingPreview": "Showing {{shown}} of {{total}} transactions",
+ "importButton": "Import {{count}} transactions",
+ "history": "Import History",
+ "noHistory": "No imports yet",
+ "historyDate": "Date",
+ "historyFile": "File",
+ "historyFormat": "Format",
+ "historyAccount": "Account",
+ "historyCount": "Qty",
+ "historyCredit": "Credit",
+ "historyDebit": "Debit",
+ "undoImport": "Undo import?",
+ "undoDescription": "This will delete {{count}} imported transactions from {{filename}}. This action cannot be undone.",
+ "deleting": "Deleting...",
+ "deleteAll": "Delete all",
+ "processError": "Error processing file",
+ "importError": "Error importing transactions",
+ "previewInfo": "{{count}} transactions · format {{format}}"
+ },
+ "common": {
+ "save": "Save",
+ "cancel": "Cancel",
+ "delete": "Delete",
+ "edit": "Edit",
+ "loading": "Loading...",
+ "error": "Error",
+ "success": "Success"
+ },
+ "privacy": {
+ "hide": "Hide values",
+ "show": "Show values"
+ },
+ "setup": {
+ "title": "Welcome to Securo",
+ "description": "Create your admin account to get started.",
+ "confirmPassword": "Confirm password",
+ "createAdmin": "Create Admin Account",
+ "creating": "Creating...",
+ "passwordMismatch": "Passwords do not match",
+ "error": "Failed to create account. Please try again.",
+ "language": "Language",
+ "theme": "Theme",
+ "currency": "Currency",
+ "name": "Your name",
+ "namePlaceholder": "How should we call you?"
+ },
+ "onboarding": {
+ "sidebar": "Sidebar Navigation",
+ "sidebarDesc": "Use the sidebar to navigate between sections of the app.",
+ "dashboard": "Dashboard",
+ "dashboardDesc": "Your financial overview at a glance — balances, trends, and spending.",
+ "accounts": "Accounts",
+ "accountsDesc": "Manage your accounts or connect your bank.",
+ "transactions": "Transactions",
+ "transactionsDesc": "View, search, and categorize your transactions.",
+ "import": "Import",
+ "importDesc": "Import bank statements in OFX, CSV, QIF, or CAMT format.",
+ "categories": "Categories",
+ "categoriesDesc": "Organize your spending with custom categories.",
+ "skip": "Skip tour",
+ "next": "Next",
+ "back": "Back",
+ "finish": "Get Started"
+ }
+}
diff --git a/frontend/src/locales/pt-BR.json b/frontend/src/locales/pt-BR.json
new file mode 100644
index 00000000..d8d373d1
--- /dev/null
+++ b/frontend/src/locales/pt-BR.json
@@ -0,0 +1,401 @@
+{
+ "app": {
+ "name": "Securo"
+ },
+ "nav": {
+ "dashboard": "Painel",
+ "transactions": "Transações",
+ "accounts": "Contas",
+ "import": "Importar",
+ "rules": "Regras",
+ "categories": "Categorias",
+ "budgets": "Orçamentos",
+ "settings": "Configurações",
+ "recurring": "Recorrentes"
+ },
+ "auth": {
+ "login": "Entrar",
+ "register": "Criar conta",
+ "logout": "Sair",
+ "email": "E-mail",
+ "password": "Senha",
+ "forgotPassword": "Esqueceu a senha?",
+ "loginDescription": "Entre para acessar sua conta",
+ "invalidCredentials": "E-mail ou senha incorretos",
+ "noAccount": "Não tem uma conta?",
+ "hasAccount": "Já tem uma conta?"
+ },
+ "dashboard": {
+ "title": "Painel",
+ "greetingMorning": "Bom dia",
+ "greetingAfternoon": "Boa tarde",
+ "greetingEvening": "Boa noite",
+ "totalBalance": "Saldo Total",
+ "monthlyIncome": "Entradas do Mês",
+ "monthlyExpenses": "Saídas do Mês",
+ "pendingCategorization": "Sem Categoria",
+ "recentTransactions": "Transações Recentes",
+ "periodTransactions": "Transações do Período",
+ "spendingByCategory": "Gastos por Categoria",
+ "monthlyTrend": "Tendência Mensal",
+ "budgetVsActual": "Orçamento vs Realizado",
+ "balanceFlow": "Fluxo de Saldo",
+ "balanceFlowVsPrev": "Em {{month}} no dia {{day}}: {{amount}} ({{delta}})",
+ "day": "Dia {{day}}",
+ "noData": "Nenhum dado disponível",
+ "noTransactions": "Nenhuma transação no período",
+ "ofBudget": "de {{budget}}",
+ "previous": "Anterior",
+ "next": "Próxima",
+ "balanceAsOf": "em {{date}}",
+ "today": "hoje",
+ "drillDownIncome": "Entradas — {{month}}",
+ "drillDownExpenses": "Saídas — {{month}}",
+ "drillDownCategory": "{{category}} — {{month}}",
+ "drillDownUncategorized": "Transações sem categoria",
+ "drillDownDay": "Transações — {{date}}",
+ "drillDownTotal": "{{count}} transações · {{total}}",
+ "drillDownEmpty": "Nenhuma transação encontrada",
+ "drillDownClose": "Fechar",
+ "savingsRate": "Taxa de Economia",
+ "spendingProjection": "Nesse ritmo, você gastará {{amount}} até o fim do mês",
+ "uncategorizedCta": "{{count}} transações precisam ser categorizadas",
+ "uncategorizedTotal": "{{amount}} no total",
+ "categorizeNow": "Categorizar agora",
+ "allCategorized": "Tudo em dia!",
+ "allCategorizedDesc": "Todas as transações estão categorizadas"
+ },
+ "transactions": {
+ "title": "Transações",
+ "section": "Financeiro",
+ "description": "Descrição",
+ "amount": "Valor",
+ "date": "Data",
+ "category": "Categoria",
+ "account": "Conta",
+ "noCategory": "Sem categoria",
+ "addManual": "Adicionar Transação",
+ "created": "Transação criada",
+ "updated": "Transação atualizada",
+ "deleted": "Transação excluída",
+ "confirmDelete": "Tem certeza que deseja excluir esta transação?",
+ "makeRecurring": "Tornar recorrente",
+ "recurringBadge": "Recorrente",
+ "transfer": "Transferência",
+ "pending": "Pendente",
+ "recurringInfo": "Transação recorrente ({{frequency}}). Próxima: {{next}}",
+ "from": "De",
+ "to": "Até",
+ "all": "Todas",
+ "searchPlaceholder": "Buscar transações...",
+ "clearFilters": "Limpar filtros",
+ "exportCsv": "Exportar CSV",
+ "exporting": "Exportando...",
+ "exportSuccess": "Transações exportadas com sucesso",
+ "exportError": "Erro ao exportar transações",
+ "syncedInfo": "Transação sincronizada — apenas categoria e notas podem ser editadas",
+ "uncategorized": "Sem categoria",
+ "selected": "{{count}} selecionadas",
+ "bulkCategorize": "Aplicar",
+ "bulkSuccess": "{{count}} transações categorizadas",
+ "selectCategory": "Selecionar categoria...",
+ "noResults": "Nenhuma transação encontrada",
+ "previous": "Anterior",
+ "next": "Próxima"
+ },
+ "accounts": {
+ "title": "Contas",
+ "connectBank": "Conectar Banco",
+ "confirmDeleteTitle": "Excluir conta?",
+ "confirmDeleteDesc": "Esta ação é irreversível e removerá todas as transações associadas a esta conta.",
+ "openingBalance": "saldo inicial",
+ "notFound": "Conta não encontrada.",
+ "balance": "Saldo",
+ "lastSync": "Última sincronização",
+ "sync": "Sincronizar",
+ "disconnect": "Desconectar",
+ "addManual": "Adicionar Conta",
+ "editAccount": "Editar Conta",
+ "manualAccounts": "Contas Manuais",
+ "bankConnections": "Conexões Bancárias",
+ "noManualAccounts": "Nenhuma conta manual ainda",
+ "noBankConnections": "Nenhuma conexão bancária",
+ "noAccountsFound": "Nenhuma conta encontrada",
+ "accountName": "Nome da conta",
+ "accountType": "Tipo",
+ "currency": "Moeda",
+ "typeChecking": "Conta Corrente",
+ "typeSavings": "Poupança",
+ "typeCreditCard": "Cartão de Crédito",
+ "typeInvestment": "Investimento",
+ "typeWallet": "Carteira",
+ "created": "Conta criada",
+ "updated": "Conta atualizada",
+ "deleted": "Conta excluída",
+ "syncDone": "Sincronização concluída",
+ "syncError": "Erro ao sincronizar",
+ "connected": "Banco conectado com sucesso",
+ "connectError": "Erro ao conectar banco",
+ "disconnected": "Conexão removida",
+ "viewTransactions": "Ver transações",
+ "currentBalance": "Saldo atual",
+ "income": "Entradas",
+ "expenses": "Saídas",
+ "thisMonth": "Este mês",
+ "backToAccounts": "Voltar para contas",
+ "runningBalance": "Saldo",
+ "noTransactions": "Nenhuma transação para esta conta",
+ "syncFailed": "Sincronização falhou",
+ "reconnect": "Reconectar",
+ "connectionError": "Erro na conexão — reconecte para corrigir",
+ "close": "Encerrar conta",
+ "reopen": "Reabrir conta",
+ "accountClosed": "Conta encerrada",
+ "accountReopened": "Conta reaberta",
+ "closedBanner": "Esta conta está encerrada",
+ "closedAccounts": "Contas Encerradas",
+ "confirmClose": "Encerrar esta conta? Ela será ocultada dos totais.",
+ "confirmCloseBank": "Isso também interromperá a sincronização desta conta.",
+ "mergedCount": "{{count}} transações mescladas com dados sincronizados",
+ "selectConnector": "Selecionar Conector",
+ "selectConnectorDesc": "Escolha um provedor de conexão bancária",
+ "connectorNotConfigured": "Este conector requer configuração. Configure as credenciais necessárias para habilitá-lo.",
+ "noConnectorsAvailable": "Nenhum conector bancário disponível"
+ },
+ "connections": {
+ "settings": "Configurações da conexão",
+ "payeeSource": "Origem do beneficiário",
+ "payeeAuto": "Automático (comerciante > dados de pagamento)",
+ "payeeMerchant": "Apenas nome do comerciante",
+ "payeePaymentData": "Nome do pagador/recebedor",
+ "payeeDescription": "Descrição da transação",
+ "payeeNone": "Não definir beneficiário",
+ "importPending": "Importar transações pendentes"
+ },
+ "settings": {
+ "rules": "Regras",
+ "recurring": "Recorrentes",
+ "budgets": "Orçamentos",
+ "preferences": "Preferências",
+ "theme": "Tema",
+ "themeLight": "Claro",
+ "themeDark": "Escuro",
+ "themeSystem": "Sistema"
+ },
+ "budgets": {
+ "title": "Orçamentos",
+ "add": "Adicionar Orçamento",
+ "edit": "Editar Orçamento",
+ "category": "Categoria",
+ "amount": "Limite",
+ "actions": "Ações",
+ "selectCategory": "Selecionar categoria",
+ "empty": "Nenhum orçamento para este mês",
+ "created": "Orçamento criado",
+ "updated": "Orçamento atualizado",
+ "deleted": "Orçamento excluído",
+ "repeatEveryMonth": "Repetir todo mês",
+ "recurringLabel": "Recorrente"
+ },
+ "recurring": {
+ "title": "Transações Recorrentes",
+ "add": "Adicionar Recorrente",
+ "edit": "Editar Recorrente",
+ "description": "Descrição",
+ "amount": "Valor",
+ "currency": "Moeda",
+ "type": "Tipo",
+ "expense": "Saída",
+ "income": "Entrada",
+ "frequency": "Frequência",
+ "monthly": "Mensal",
+ "weekly": "Semanal",
+ "yearly": "Anual",
+ "dayOfMonth": "Dia do mês",
+ "startDate": "Data de início",
+ "endDate": "Data de fim (opcional)",
+ "category": "Categoria",
+ "account": "Conta",
+ "noAccount": "Nenhuma",
+ "nextOccurrence": "Próxima",
+ "status": "Status",
+ "actions": "Ações",
+ "active": "Ativo",
+ "inactive": "Inativo",
+ "empty": "Nenhuma transação recorrente",
+ "created": "Transação recorrente criada",
+ "updated": "Transação recorrente atualizada",
+ "deleted": "Transação recorrente excluída",
+ "generated": "{{count}} transações geradas",
+ "generatePending": "Gerar Pendentes"
+ },
+ "rules": {
+ "section": "Automação",
+ "packs": "Pacotes de Regras",
+ "packRuleCount": "{{count}} regras",
+ "installPack": "Instalar",
+ "packInstalled": "{{count}} regras instaladas",
+ "installed": "Instalado",
+ "packAlreadyInstalled": "Pacote já instalado",
+ "duplicateName": "Já existe uma regra com este nome",
+ "sectionTitle": "Regras de Categorização",
+ "reapplyAll": "Reaplicar todas",
+ "add": "Adicionar",
+ "created": "Regra criada",
+ "updated": "Regra atualizada",
+ "deleted": "Regra excluída",
+ "applied": "Regras aplicadas a {{count}} transações",
+ "inactive": "inativa",
+ "empty": "Nenhuma regra criada",
+ "editRule": "Editar Regra",
+ "newRule": "Nova Regra",
+ "name": "Nome",
+ "priority": "Prioridade",
+ "conditions": "Condições",
+ "actions": "Ações",
+ "andOp": "E (AND)",
+ "orOp": "OU (OR)",
+ "addCondition": "Adicionar condição",
+ "addAction": "Adicionar ação",
+ "setCategory": "Definir categoria",
+ "appendNotes": "Adicionar tags/notas",
+ "selectCategory": "Selecionar categoria...",
+ "selectAccount": "Selecionar conta...",
+ "ruleActive": "Regra ativa",
+ "noConditions": "(sem condições)",
+ "noActions": "(sem ações)",
+ "fieldDescription": "Descrição",
+ "fieldNotes": "Notas",
+ "fieldAmount": "Valor",
+ "fieldType": "Tipo",
+ "fieldAccount": "Conta",
+ "fieldDate": "Data",
+ "opContains": "contém",
+ "opNotContains": "não contém",
+ "opEquals": "é igual a",
+ "opNotEquals": "é diferente de",
+ "opStartsWith": "começa com",
+ "opEndsWith": "termina com",
+ "opRegex": "regex",
+ "opIs": "é",
+ "typeExpense": "Despesa (debit)",
+ "typeIncome": "Receita (credit)",
+ "valuePlaceholder": "Valor..."
+ },
+ "categories": {
+ "title": "Categorias",
+ "addCategory": "Adicionar Categoria",
+ "editCategory": "Editar Categoria",
+ "newCategory": "Nova Categoria",
+ "group": "Grupo",
+ "noGroup": "Sem grupo",
+ "selectGroup": "Selecionar grupo",
+ "created": "Categoria criada",
+ "updated": "Categoria atualizada",
+ "deleted": "Categoria excluída",
+ "expandAll": "Expandir tudo",
+ "collapseAll": "Recolher tudo"
+ },
+ "groups": {
+ "title": "Grupos de Categorias",
+ "add": "Adicionar Grupo",
+ "edit": "Editar Grupo",
+ "new": "Novo Grupo",
+ "name": "Nome",
+ "icon": "Ícone",
+ "color": "Cor",
+ "position": "Posição",
+ "created": "Grupo criado",
+ "updated": "Grupo atualizado",
+ "deleted": "Grupo excluído",
+ "noGroup": "Sem grupo",
+ "systemGroup": "Grupo do sistema"
+ },
+ "import": {
+ "acceptedFormats": "Formatos aceitos: OFX, CSV, QIF, CAMT",
+ "transactionsImported": "transações importadas",
+ "importedWithSkipped": "{{imported}} importadas, {{skipped}} duplicatas ignoradas",
+ "csvOptions": "Opções do CSV",
+ "dateFormat": "Formato da data",
+ "dateFormatAuto": "Automático (detectar)",
+ "flipAmounts": "Inverter valores (trocar entrada/saída)",
+ "splitColumns": "Separar colunas entrada/saída",
+ "inflowColumn": "Coluna de entrada",
+ "outflowColumn": "Coluna de saída",
+ "selectColumn": "Selecionar coluna...",
+ "title": "Importar",
+ "subtitle": "Extrato bancário",
+ "processing": "Processando arquivo…",
+ "removeFile": "Remover arquivo",
+ "dragOrClick": "Arraste um arquivo ou clique para selecionar",
+ "preview": "Pré-visualização",
+ "incomeCount": "{{count}} receitas",
+ "expenseCount": "{{count}} despesas",
+ "importTo": "Importar para:",
+ "selectAccount": "Selecionar conta…",
+ "selectAccountWarning": "Selecione uma conta",
+ "showingPreview": "Mostrando {{shown}} de {{total}} transações",
+ "importButton": "Importar {{count}} transações",
+ "history": "Histórico de Importações",
+ "noHistory": "Nenhuma importação ainda",
+ "historyDate": "Data",
+ "historyFile": "Arquivo",
+ "historyFormat": "Formato",
+ "historyAccount": "Conta",
+ "historyCount": "Qtd",
+ "historyCredit": "Crédito",
+ "historyDebit": "Débito",
+ "undoImport": "Desfazer importação?",
+ "undoDescription": "Isso vai excluir {{count}} transações importadas de {{filename}}. Esta ação não pode ser desfeita.",
+ "deleting": "Excluindo...",
+ "deleteAll": "Excluir tudo",
+ "processError": "Erro ao processar arquivo",
+ "importError": "Erro ao importar transações",
+ "previewInfo": "{{count}} transações · formato {{format}}"
+ },
+ "common": {
+ "save": "Salvar",
+ "cancel": "Cancelar",
+ "delete": "Excluir",
+ "edit": "Editar",
+ "loading": "Carregando...",
+ "error": "Erro",
+ "success": "Sucesso"
+ },
+ "privacy": {
+ "hide": "Ocultar valores",
+ "show": "Mostrar valores"
+ },
+ "setup": {
+ "title": "Bem-vindo ao Securo",
+ "description": "Crie sua conta de administrador para começar.",
+ "confirmPassword": "Confirmar senha",
+ "createAdmin": "Criar Conta Admin",
+ "creating": "Criando...",
+ "passwordMismatch": "As senhas não coincidem",
+ "error": "Falha ao criar conta. Tente novamente.",
+ "language": "Idioma",
+ "theme": "Tema",
+ "currency": "Moeda",
+ "name": "Seu nome",
+ "namePlaceholder": "Como devemos te chamar?"
+ },
+ "onboarding": {
+ "sidebar": "Navegação Lateral",
+ "sidebarDesc": "Use a barra lateral para navegar entre as seções do app.",
+ "dashboard": "Painel",
+ "dashboardDesc": "Sua visão financeira resumida — saldos, tendências e gastos.",
+ "accounts": "Contas",
+ "accountsDesc": "Gerencie suas contas ou conecte seu banco.",
+ "transactions": "Transações",
+ "transactionsDesc": "Visualize, busque e categorize suas transações.",
+ "import": "Importar",
+ "importDesc": "Importe extratos bancários nos formatos OFX, CSV, QIF ou CAMT.",
+ "categories": "Categorias",
+ "categoriesDesc": "Organize seus gastos com categorias personalizadas.",
+ "skip": "Pular tour",
+ "next": "Próximo",
+ "back": "Voltar",
+ "finish": "Começar"
+ }
+}
diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx
new file mode 100644
index 00000000..89ac5b11
--- /dev/null
+++ b/frontend/src/main.tsx
@@ -0,0 +1,11 @@
+import { StrictMode } from 'react'
+import { createRoot } from 'react-dom/client'
+import './index.css'
+import './lib/i18n'
+import App from './App.tsx'
+
+createRoot(document.getElementById('root')!).render(
+ <StrictMode>
+ <App />
+ </StrictMode>,
+)
diff --git a/frontend/src/pages/account-detail.tsx b/frontend/src/pages/account-detail.tsx
new file mode 100644
index 00000000..ab4fafa4
--- /dev/null
+++ b/frontend/src/pages/account-detail.tsx
@@ -0,0 +1,465 @@
+import { useState, useMemo } from 'react'
+import { useParams, Link } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { format } from 'date-fns'
+import { accounts, transactions, categories as categoriesApi } from '@/lib/api'
+import { toast } from 'sonner'
+import type { Transaction } from '@/types'
+import { Skeleton } from '@/components/ui/skeleton'
+import { Button } from '@/components/ui/button'
+import { ArrowLeft, ArrowLeftRight, Clock, X } from 'lucide-react'
+import { CategoryIcon } from '@/components/category-icon'
+import { TransactionDialog, extractApiError } from '@/components/transaction-dialog'
+import { DatePickerInput } from '@/components/ui/date-picker-input'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+import { useAuth } from '@/contexts/auth-context'
+import {
+ AreaChart,
+ Area,
+ XAxis,
+ YAxis,
+ Tooltip,
+ ResponsiveContainer,
+} from 'recharts'
+
+function defaultFrom() {
+ const now = new Date()
+ return format(new Date(now.getFullYear(), now.getMonth(), 1), 'yyyy-MM-dd')
+}
+
+function defaultTo() {
+ return format(new Date(), 'yyyy-MM-dd')
+}
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+function formatDateStr(dateStr: string, locale = 'pt-BR') {
+ return new Date(dateStr + 'T00:00:00').toLocaleDateString(locale)
+}
+
+type TxWithBalance = Transaction & { runningBalance: number }
+
+export default function AccountDetailPage() {
+ const { id } = useParams<{ id: string }>()
+ const { t, i18n } = useTranslation()
+ const { mask, privacyMode, MASK } = usePrivacyMode()
+ const { user } = useAuth()
+ const userCurrency = user?.preferences?.currency_display ?? 'BRL'
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const queryClient = useQueryClient()
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const [editingTx, setEditingTx] = useState<Transaction | null>(null)
+ const [filterFrom, setFilterFrom] = useState(defaultFrom)
+ const [filterTo, setFilterTo] = useState(defaultTo)
+
+ const { data: account, isLoading: accountLoading } = useQuery({
+ queryKey: ['accounts', id],
+ queryFn: () => accounts.get(id!),
+ enabled: !!id,
+ })
+
+ const { data: summary, isLoading: summaryLoading } = useQuery({
+ queryKey: ['accounts', id, 'summary', filterFrom, filterTo],
+ queryFn: () => accounts.summary(id!, filterFrom || undefined, filterTo || undefined),
+ enabled: !!id,
+ })
+
+ const { data: balanceHistory, isLoading: balanceHistoryLoading } = useQuery({
+ queryKey: ['accounts', id, 'balance-history', filterFrom, filterTo],
+ queryFn: () => accounts.balanceHistory(id!, filterFrom || undefined, filterTo || undefined),
+ enabled: !!id,
+ })
+
+ const { data: txData, isLoading: txLoading } = useQuery({
+ queryKey: ['transactions', { account_id: id, from: filterFrom, to: filterTo, limit: 500, include_opening_balance: true }],
+ queryFn: () => transactions.list({
+ account_id: id,
+ from: filterFrom || undefined,
+ to: filterTo || undefined,
+ limit: 500,
+ include_opening_balance: true,
+ }),
+ enabled: !!id,
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id: txId, ...data }: Partial<Transaction> & { id: string }) =>
+ transactions.update(txId, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['accounts', id, 'summary'] })
+ queryClient.invalidateQueries({ queryKey: ['accounts', id, 'balance-history'] })
+ setDialogOpen(false)
+ setEditingTx(null)
+ toast.success(t('accounts.updated'))
+ },
+ onError: (error) => {
+ toast.error(extractApiError(error))
+ },
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (txId: string) => transactions.delete(txId),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['accounts', id, 'summary'] })
+ queryClient.invalidateQueries({ queryKey: ['accounts', id, 'balance-history'] })
+ setDialogOpen(false)
+ setEditingTx(null)
+ toast.success(t('transactions.deleted'))
+ },
+ onError: (error) => {
+ toast.error(extractApiError(error))
+ },
+ })
+
+ const reopenMutation = useMutation({
+ mutationFn: () => accounts.reopen(id!),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['accounts', id] })
+ toast.success(t('accounts.accountReopened'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ // Chart data — simple daily balance series
+ const chartData = useMemo(() => {
+ if (!balanceHistory) return []
+ return balanceHistory.map(p => ({
+ label: formatDateStr(p.date, locale),
+ date: p.date,
+ balance: p.balance,
+ }))
+ }, [balanceHistory, locale])
+
+ // Running balance computation for transaction table
+ const isCreditCard = account?.type === 'credit_card'
+ const txWithRunningBalance = useMemo((): TxWithBalance[] => {
+ if (!txData?.items || summary === undefined) return []
+ // Use the last chart point as reference if available, else current_balance
+ const endBalance = balanceHistory?.length
+ ? balanceHistory[balanceHistory.length - 1].balance
+ : summary.current_balance
+ const sorted = [...txData.items].sort(
+ (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime()
+ )
+ let running = endBalance
+ return sorted.map((tx) => {
+ const balanceAtPoint = running
+ const amt = Number(tx.amount)
+ if (isCreditCard) {
+ running -= tx.type === 'debit' ? amt : -amt
+ } else {
+ running -= tx.type === 'credit' ? amt : -amt
+ }
+ return { ...tx, runningBalance: balanceAtPoint }
+ })
+ }, [txData, summary, isCreditCard, balanceHistory])
+
+ const hasFilters = filterFrom !== defaultFrom() || filterTo !== defaultTo()
+
+ const isLoading = accountLoading || summaryLoading
+
+ if (isLoading) {
+ return (
+ <div className="space-y-6">
+ <Skeleton className="h-8 w-48" />
+ <Skeleton className="h-32" />
+ <Skeleton className="h-64" />
+ </div>
+ )
+ }
+
+ if (!account) {
+ return <p className="text-muted-foreground">{t('accounts.notFound')}</p>
+ }
+
+ const currency = account.currency || userCurrency
+
+ return (
+ <div>
+ {/* Header bar with date range */}
+ <div className="mb-6 space-y-3">
+ <div className="flex items-center gap-3 flex-wrap">
+ <Button variant="ghost" size="sm" asChild className="text-muted-foreground hover:text-foreground">
+ <Link to="/accounts">
+ <ArrowLeft className="h-4 w-4 mr-1" />
+ <span className="hidden sm:inline">{t('accounts.backToAccounts')}</span>
+ </Link>
+ </Button>
+ <h1 className="text-xl sm:text-2xl font-bold text-foreground">{account.name}</h1>
+ <span className="text-xs font-medium bg-muted text-muted-foreground px-2.5 py-1 rounded-full capitalize">
+ {account.type}
+ </span>
+ </div>
+ <div className="flex items-center gap-2 sm:gap-3 flex-wrap">
+ <div className="flex items-center gap-2">
+ <label className="text-sm text-muted-foreground hidden md:inline">{t('transactions.from')}</label>
+ <DatePickerInput
+ value={filterFrom}
+ onChange={setFilterFrom}
+ placeholder={t('transactions.from')}
+ />
+ </div>
+ <div className="flex items-center gap-2">
+ <label className="text-sm text-muted-foreground hidden md:inline">{t('transactions.to')}</label>
+ <DatePickerInput
+ value={filterTo}
+ onChange={setFilterTo}
+ placeholder={t('transactions.to')}
+ />
+ </div>
+ {hasFilters && (
+ <Button
+ variant="ghost"
+ size="sm"
+ className="text-muted-foreground hover:text-foreground"
+ onClick={() => { setFilterFrom(defaultFrom()); setFilterTo(defaultTo()) }}
+ >
+ <X className="h-3.5 w-3.5 mr-1" />
+ {t('transactions.clearFilters')}
+ </Button>
+ )}
+ </div>
+ </div>
+
+ {account.is_closed && (
+ <div className="flex items-center justify-between rounded-lg border border-border bg-muted px-4 py-3 mb-6">
+ <span className="text-sm text-muted-foreground">{t('accounts.closedBanner')}</span>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => reopenMutation.mutate()}
+ disabled={reopenMutation.isPending}
+ >
+ {t('accounts.reopen')}
+ </Button>
+ </div>
+ )}
+
+ {/* Compact stat bar */}
+ <div className="grid grid-cols-3 gap-2 sm:gap-4 mb-6">
+ <div className="bg-card rounded-xl border border-border shadow-sm p-3 sm:p-4">
+ <p className="text-[10px] sm:text-xs font-medium text-muted-foreground mb-1">
+ {t('accounts.currentBalance')}
+ </p>
+ <p className={`text-base sm:text-2xl font-bold tabular-nums ${(account.type === 'credit_card' ? (summary?.current_balance ?? 0) > 0 : (summary?.current_balance ?? 0) < 0) ? 'text-rose-500' : 'text-foreground'}`}>
+ {mask(formatCurrency(summary?.current_balance ?? 0, currency, locale))}
+ </p>
+ </div>
+ <div className="bg-card rounded-xl border border-border shadow-sm p-3 sm:p-4">
+ <p className="text-[10px] sm:text-xs font-medium text-muted-foreground mb-1">
+ {t('accounts.income')}
+ </p>
+ <p className="text-base sm:text-2xl font-bold tabular-nums text-emerald-600">
+ {mask(formatCurrency(summary?.monthly_income ?? 0, currency, locale))}
+ </p>
+ </div>
+ <div className="bg-card rounded-xl border border-border shadow-sm p-3 sm:p-4">
+ <p className="text-[10px] sm:text-xs font-medium text-muted-foreground mb-1">
+ {t('accounts.expenses')}
+ </p>
+ <p className="text-base sm:text-2xl font-bold tabular-nums text-rose-500">
+ {mask(formatCurrency(summary?.monthly_expenses ?? 0, currency, locale))}
+ </p>
+ </div>
+ </div>
+
+ {/* Balance chart */}
+ <div className="bg-card rounded-xl border border-border shadow-sm mb-6">
+ <div className="px-5 pt-5 pb-3">
+ <p className="text-base font-bold text-foreground">{t('dashboard.balanceFlow')}</p>
+ </div>
+ <div className="px-1 pb-4 h-[280px]">
+ {balanceHistoryLoading ? (
+ <Skeleton className="h-full w-full" />
+ ) : chartData.length > 0 ? (
+ <ResponsiveContainer width="100%" height="100%">
+ <AreaChart
+ data={chartData}
+ margin={{ top: 4, right: 8, left: 0, bottom: 0 }}
+ >
+ <defs>
+ <linearGradient id="acctBalGrad" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="#10B981" stopOpacity={0.18} />
+ <stop offset="95%" stopColor="#10B981" stopOpacity={0.02} />
+ </linearGradient>
+ </defs>
+ <XAxis
+ dataKey="label"
+ tick={{ fontSize: 10, fill: 'var(--muted-foreground)' }}
+ axisLine={false}
+ tickLine={false}
+ interval="preserveStartEnd"
+ minTickGap={40}
+ />
+ <YAxis
+ tickFormatter={(v) => {
+ if (privacyMode) return ''
+ if (v === 0) return '0'
+ return formatCurrency(v, currency, locale).replace(/,00$/, '').replace(/\.00$/, '')
+ }}
+ tick={{ fontSize: 10, fill: 'var(--muted-foreground)' }}
+ axisLine={false}
+ tickLine={false}
+ width={56}
+ tickCount={5}
+ domain={[
+ (dataMin: number) => dataMin < 0 ? Math.floor(dataMin / 100) * 100 : 0,
+ (dataMax: number) => Math.ceil(dataMax / 100) * 100,
+ ]}
+ />
+ <Tooltip
+ formatter={(value) => [
+ value !== null ? (privacyMode ? MASK : formatCurrency(Number(value), currency, locale)) : '\u2014',
+ t('accounts.currentBalance'),
+ ]}
+ labelFormatter={(label) => label}
+ contentStyle={{
+ background: 'var(--card)',
+ color: 'var(--foreground)',
+ border: '1px solid var(--border)',
+ borderRadius: '0.75rem',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.08)',
+ fontSize: '12px',
+ }}
+ />
+ <Area
+ type="monotone"
+ dataKey="balance"
+ stroke="#10B981"
+ strokeWidth={2}
+ fill="url(#acctBalGrad)"
+ dot={false}
+ activeDot={{ r: 3, fill: '#10B981' }}
+ />
+ </AreaChart>
+ </ResponsiveContainer>
+ ) : (
+ <p className="text-muted-foreground text-sm text-center py-12">{t('dashboard.noData')}</p>
+ )}
+ </div>
+ </div>
+
+ {/* Transaction table */}
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ <div className="px-5 py-4 border-b border-border">
+ <p className="font-semibold text-foreground">{t('transactions.title')}</p>
+ </div>
+ <div className="p-0">
+ {txLoading ? (
+ <div className="p-6 space-y-3">
+ {Array.from({ length: 5 }).map((_, i) => <Skeleton key={i} className="h-10" />)}
+ </div>
+ ) : txWithRunningBalance.length === 0 ? (
+ <p className="p-6 text-center text-muted-foreground">{t('accounts.noTransactions')}</p>
+ ) : (
+ <div className="overflow-x-auto">
+ <table className="w-full text-sm">
+ <thead>
+ <tr className="border-b">
+ <th className="px-3 sm:px-4 py-3 text-left font-medium">{t('transactions.date')}</th>
+ <th className="px-3 sm:px-4 py-3 text-left font-medium">{t('transactions.description')}</th>
+ <th className="px-4 py-3 text-left font-medium hidden md:table-cell">{t('transactions.category')}</th>
+ <th className="px-3 sm:px-4 py-3 text-right font-medium">{t('transactions.amount')}</th>
+ <th className="px-4 py-3 text-right font-medium hidden sm:table-cell">{t('accounts.runningBalance')}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {txWithRunningBalance.map((tx) => {
+ const isOpening = tx.source === 'opening_balance'
+ const isTransfer = !!tx.transfer_pair_id
+ const isPending = tx.status === 'pending'
+ return (
+ <tr
+ key={tx.id}
+ className={`border-b last:border-0 transition-colors ${isOpening ? 'bg-muted/60' : isPending ? 'opacity-60' : 'hover:bg-muted cursor-pointer'}`}
+ onClick={() => {
+ if (!isOpening) {
+ setEditingTx(tx)
+ setDialogOpen(true)
+ }
+ }}
+ >
+ <td className="px-3 sm:px-4 py-3 text-xs text-muted-foreground whitespace-nowrap">
+ {formatDateStr(tx.date, locale)}
+ </td>
+ <td className="px-3 sm:px-4 py-3">
+ <div>
+ <span className="font-semibold text-foreground text-sm">{tx.description}</span>
+ {isOpening && (
+ <span className="ml-2 text-xs text-muted-foreground font-normal border border-border rounded px-1.5 py-0.5">
+ {t('accounts.openingBalance')}
+ </span>
+ )}
+ {isTransfer && (
+ <span className="ml-2 inline-flex items-center gap-1 text-xs text-blue-600 font-normal bg-blue-50 border border-blue-200 rounded px-1.5 py-0.5">
+ <ArrowLeftRight className="h-3 w-3" />
+ {t('transactions.transfer')}
+ </span>
+ )}
+ {isPending && (
+ <span className="ml-2 inline-flex items-center gap-1 text-xs text-amber-600 font-normal bg-amber-50 border border-amber-200 rounded px-1.5 py-0.5">
+ <Clock className="h-3 w-3" />
+ {t('transactions.pending')}
+ </span>
+ )}
+ </div>
+ {tx.payee && tx.payee !== tx.description && (
+ <p className="text-xs text-muted-foreground mt-0.5">{tx.payee}</p>
+ )}
+ </td>
+ <td className="px-4 py-3 hidden md:table-cell">
+ {tx.category ? (
+ <span className="flex items-center gap-1.5">
+ <CategoryIcon icon={tx.category.icon} color={tx.category.color} size="sm" />
+ <span className="text-sm text-muted-foreground">{tx.category.name}</span>
+ </span>
+ ) : (
+ <span className="text-muted-foreground">—</span>
+ )}
+ </td>
+ <td className={`px-3 sm:px-4 py-3 text-right text-xs sm:text-sm font-semibold tabular-nums ${tx.type === 'credit' ? 'text-emerald-600' : 'text-rose-500'}`}>
+ {mask(`${tx.type === 'credit' ? '+' : '-'}${formatCurrency(Math.abs(Number(tx.amount)), currency, locale)}`)}
+ </td>
+ <td className={`px-4 py-3 text-right tabular-nums text-sm hidden sm:table-cell ${(account.type === 'credit_card' ? tx.runningBalance > 0 : tx.runningBalance < 0) ? 'text-rose-500' : 'text-muted-foreground'}`}>
+ {mask(formatCurrency(tx.runningBalance, currency, locale))}
+ </td>
+ </tr>
+ )
+ })}
+ </tbody>
+ </table>
+ </div>
+ )}
+ </div>
+ </div>
+
+ <TransactionDialog
+ open={dialogOpen}
+ onClose={() => { setDialogOpen(false); setEditingTx(null) }}
+ transaction={editingTx}
+ categories={categoriesList ?? []}
+ accounts={[]}
+ onSave={(data) => {
+ if (editingTx) {
+ updateMutation.mutate({ id: editingTx.id, ...data })
+ }
+ }}
+ onDelete={editingTx ? () => deleteMutation.mutate(editingTx.id) : undefined}
+ loading={updateMutation.isPending || deleteMutation.isPending}
+ error={updateMutation.error ? extractApiError(updateMutation.error) : null}
+ isSynced={editingTx?.source === 'sync'}
+ />
+ </div>
+ )
+}
diff --git a/frontend/src/pages/accounts.tsx b/frontend/src/pages/accounts.tsx
new file mode 100644
index 00000000..6cb9a476
--- /dev/null
+++ b/frontend/src/pages/accounts.tsx
@@ -0,0 +1,613 @@
+import { useState } from 'react'
+import { Link } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { accounts, connections } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import { Badge } from '@/components/ui/badge'
+import { Skeleton } from '@/components/ui/skeleton'
+import type { Account, BankConnection } from '@/types'
+import {
+ Building2,
+ PiggyBank,
+ CreditCard,
+ TrendingUp,
+ Wallet,
+ Pencil,
+ Trash2,
+ RefreshCw,
+ Unlink,
+ Plus,
+ Settings,
+ Archive,
+} from 'lucide-react'
+import { PageHeader } from '@/components/page-header'
+import { BankConnectDialog } from '@/components/bank-connect-dialog'
+import { ConnectorSelectDialog } from '@/components/connector-select-dialog'
+import { ConnectionSettingsDialog } from '@/components/connection-settings-dialog'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+const ACCOUNT_TYPE_CONFIG: Record<string, { icon: React.ElementType; color: string; bg: string; label: string }> = {
+ checking: { icon: Building2, color: 'text-indigo-600', bg: 'bg-indigo-100', label: 'accounts.typeChecking' },
+ savings: { icon: PiggyBank, color: 'text-emerald-600', bg: 'bg-emerald-100', label: 'accounts.typeSavings' },
+ credit_card: { icon: CreditCard, color: 'text-violet-600', bg: 'bg-violet-100', label: 'accounts.typeCreditCard' },
+ investment: { icon: TrendingUp, color: 'text-amber-600', bg: 'bg-amber-100', label: 'accounts.typeInvestment' },
+ wallet: { icon: Wallet, color: 'text-rose-600', bg: 'bg-rose-100', label: 'accounts.typeWallet' },
+}
+
+function getTypeConfig(type: string) {
+ return ACCOUNT_TYPE_CONFIG[type] ?? ACCOUNT_TYPE_CONFIG['checking']
+}
+
+export default function AccountsPage() {
+ const { t, i18n } = useTranslation()
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const { mask } = usePrivacyMode()
+ const queryClient = useQueryClient()
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const [editingAccount, setEditingAccount] = useState<Account | null>(null)
+ const [deletingId, setDeletingId] = useState<string | null>(null)
+ const [connectorSelectOpen, setConnectorSelectOpen] = useState(false)
+ const [selectedProvider, setSelectedProvider] = useState<string | null>(null)
+ const [settingsConnection, setSettingsConnection] = useState<BankConnection | null>(null)
+ const [closingAccountId, setClosingAccountId] = useState<string | null>(null)
+ const [reconnectConnId, setReconnectConnId] = useState<string | null>(null)
+ const [reconnectItemId, setReconnectItemId] = useState<string | null>(null)
+
+ const { data: accountsList, isLoading: accountsLoading } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accounts.list(),
+ })
+
+ const { data: connectionsList, isLoading: connectionsLoading } = useQuery({
+ queryKey: ['connections'],
+ queryFn: connections.list,
+ })
+
+ const { data: closedAccountsList } = useQuery({
+ queryKey: ['accounts', 'closed'],
+ queryFn: () => accounts.list(true),
+ })
+ const closedAccounts = closedAccountsList?.filter((a) => a.is_closed) ?? []
+
+ const syncMutation = useMutation({
+ mutationFn: (id: string) => connections.sync(id),
+ onSuccess: (result) => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['connections'] })
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ toast.success(t('accounts.syncDone'))
+ const merged = (result as BankConnection & { merged_count?: number })?.merged_count
+ if (merged && merged > 0) {
+ toast.info(t('accounts.mergedCount', { count: merged }))
+ }
+ },
+ onError: () => toast.error(t('accounts.syncError')),
+ })
+
+ const disconnectMutation = useMutation({
+ mutationFn: (id: string) => connections.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['connections'] })
+ toast.success(t('accounts.disconnected'))
+ },
+ })
+
+ const createMutation = useMutation({
+ mutationFn: (data: { name: string; type: string; balance?: number; currency?: string }) =>
+ accounts.create(data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ setDialogOpen(false)
+ toast.success(t('accounts.created'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<Account> & { id: string }) =>
+ accounts.update(id, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ setDialogOpen(false)
+ setEditingAccount(null)
+ toast.success(t('accounts.updated'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => accounts.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ setDeletingId(null)
+ toast.success(t('accounts.deleted'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const closeMutation = useMutation({
+ mutationFn: (id: string) => accounts.close(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ setClosingAccountId(null)
+ toast.success(t('accounts.accountClosed'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const reopenMutation = useMutation({
+ mutationFn: (id: string) => accounts.reopen(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ toast.success(t('accounts.accountReopened'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const isLoading = accountsLoading || connectionsLoading
+ const manualAccounts = accountsList?.filter((a) => a.connection_id === null) ?? []
+ const bankAccounts = accountsList?.filter((a) => a.connection_id !== null) ?? []
+
+ return (
+ <div className="space-y-6">
+ <PageHeader
+ section={t('accounts.title')}
+ title={t('accounts.title')}
+ action={
+ <div className="flex gap-2">
+ <Button variant="outline" className="gap-1.5" onClick={() => setConnectorSelectOpen(true)}>
+ <Plus size={16} />
+ {t('accounts.connectBank')}
+ </Button>
+ <Button onClick={() => { setEditingAccount(null); setDialogOpen(true) }} className="gap-1.5">
+ <Plus size={16} />
+ {t('accounts.addManual')}
+ </Button>
+ </div>
+ }
+ />
+
+ {isLoading ? (
+ <div className="space-y-3">
+ {Array.from({ length: 3 }).map((_, i) => <Skeleton key={i} className="h-16 rounded-xl" />)}
+ </div>
+ ) : (
+ <div className="space-y-6">
+ {/* Manual Accounts */}
+ <div className="bg-card rounded-xl border border-border shadow-sm">
+ <div className="flex items-center justify-between px-5 py-3.5 border-b border-border">
+ <h2 className="text-sm font-medium text-muted-foreground">{t('accounts.manualAccounts')}</h2>
+ </div>
+ {manualAccounts.length > 0 ? (
+ <div className="divide-y divide-muted">
+ {manualAccounts.map((acc) => {
+ const cfg = getTypeConfig(acc.type)
+ const Icon = cfg.icon
+ const bal = Number(acc.current_balance)
+ return (
+ <div key={acc.id} className="group flex items-center px-5 py-3 hover:bg-muted/50 transition-colors">
+ <Link to={`/accounts/${acc.id}`} className="flex items-center gap-3 flex-1 min-w-0">
+ <div className={`w-8 h-8 rounded-lg ${cfg.bg} flex items-center justify-center shrink-0`}>
+ <Icon size={14} className={cfg.color} />
+ </div>
+ <div className="min-w-0 flex-1">
+ <p className="text-sm font-medium text-foreground truncate">{acc.name}</p>
+ <p className="text-xs text-muted-foreground">{t(cfg.label)}</p>
+ </div>
+ </Link>
+ <div className="flex items-center gap-1 mr-3 opacity-0 group-hover:opacity-100 transition-opacity">
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"
+ onClick={() => { setEditingAccount(acc); setDialogOpen(true) }}
+ title={t('common.edit')}
+ >
+ <Pencil size={13} />
+ </button>
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-amber-600 hover:bg-amber-50 transition-colors"
+ onClick={() => setClosingAccountId(acc.id)}
+ title={t('accounts.close')}
+ >
+ <Archive size={13} />
+ </button>
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-rose-500 hover:bg-rose-50 transition-colors"
+ onClick={() => setDeletingId(acc.id)}
+ disabled={deleteMutation.isPending}
+ title={t('common.delete')}
+ >
+ <Trash2 size={13} />
+ </button>
+ </div>
+ <p className={`text-xs sm:text-sm font-semibold tabular-nums text-right ${(acc.type === 'credit_card' ? bal > 0 : bal < 0) ? 'text-rose-500' : 'text-foreground'}`}>
+ {mask(formatCurrency(bal, acc.currency, locale))}
+ </p>
+ </div>
+ )
+ })}
+ </div>
+ ) : (
+ <div className="px-5 py-8 text-center">
+ <p className="text-sm text-muted-foreground">{t('accounts.noManualAccounts')}</p>
+ </div>
+ )}
+ </div>
+
+ {/* Bank Connections */}
+ {connectionsList && connectionsList.length > 0 ? (
+ <div className="space-y-3">
+ {connectionsList.map((conn) => {
+ const connAccounts = bankAccounts.filter((a) => a.connection_id === conn.id)
+ return (
+ <div key={conn.id} className="bg-card rounded-xl border border-border shadow-sm">
+ {/* Connection header */}
+ <div className="flex items-center justify-between px-5 py-3.5 border-b border-border">
+ <div className="flex items-center gap-3">
+ <div className="w-8 h-8 rounded-lg bg-muted flex items-center justify-center">
+ <Building2 size={14} className="text-muted-foreground" />
+ </div>
+ <div>
+ <div className="flex items-center gap-2">
+ <p className="text-sm font-semibold text-foreground">{conn.institution_name}</p>
+ <Badge
+ variant={conn.status === 'active' ? 'default' : 'secondary'}
+ className="text-[10px] px-1.5 py-0 h-4"
+ >
+ {conn.status}
+ </Badge>
+ </div>
+ {conn.last_sync_at && (
+ <p className="text-[11px] text-muted-foreground mt-0.5">
+ {t('accounts.lastSync')}: {new Date(conn.last_sync_at).toLocaleString(locale)}
+ </p>
+ )}
+ </div>
+ </div>
+ <div className="flex items-center gap-1.5">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
+ onClick={() => setSettingsConnection(conn)}
+ >
+ <Settings size={14} />
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
+ onClick={() => syncMutation.mutate(conn.id)}
+ disabled={syncMutation.isPending}
+ >
+ <RefreshCw size={14} className={syncMutation.isPending ? 'animate-spin' : ''} />
+ </Button>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-8 w-8 p-0 text-muted-foreground hover:text-rose-500"
+ onClick={() => disconnectMutation.mutate(conn.id)}
+ disabled={disconnectMutation.isPending}
+ >
+ <Unlink size={14} />
+ </Button>
+ </div>
+ </div>
+ {/* Reconnect banner */}
+ {conn.status !== 'active' && (
+ <div className="mx-5 mt-3 flex items-center justify-between rounded-lg border border-amber-200 bg-amber-50 px-4 py-2.5">
+ <span className="text-sm text-amber-800">
+ {t('accounts.connectionError')}
+ </span>
+ <Button
+ variant="outline"
+ size="sm"
+ className="border-amber-300 text-amber-700 hover:bg-amber-100 gap-1.5 h-8"
+ onClick={() => {
+ setReconnectConnId(conn.id)
+ setReconnectItemId(conn.external_id)
+ }}
+ >
+ <RefreshCw size={12} />
+ {t('accounts.reconnect')}
+ </Button>
+ </div>
+ )}
+ {/* Accounts list */}
+ {connAccounts.length > 0 ? (
+ <div className="divide-y divide-muted">
+ {connAccounts.map((acc) => {
+ const cfg = getTypeConfig(acc.type)
+ const Icon = cfg.icon
+ const bal = Number(acc.current_balance)
+ return (
+ <div key={acc.id} className="group flex items-center px-5 py-3 hover:bg-muted/50 transition-colors">
+ <Link to={`/accounts/${acc.id}`} className="flex items-center gap-3 flex-1 min-w-0">
+ <div className={`w-8 h-8 rounded-lg ${cfg.bg} flex items-center justify-center shrink-0`}>
+ <Icon size={14} className={cfg.color} />
+ </div>
+ <div className="min-w-0 flex-1">
+ <p className="text-sm font-medium text-foreground truncate">{acc.name}</p>
+ <p className="text-xs text-muted-foreground">{t(cfg.label)}</p>
+ </div>
+ </Link>
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-amber-600 hover:bg-amber-50 transition-colors opacity-0 group-hover:opacity-100 mr-3"
+ onClick={(e) => { e.preventDefault(); setClosingAccountId(acc.id) }}
+ title={t('accounts.close')}
+ >
+ <Archive size={13} />
+ </button>
+ <p className={`text-xs sm:text-sm font-semibold tabular-nums text-right ${(acc.type === 'credit_card' ? bal > 0 : bal < 0) ? 'text-rose-500' : 'text-foreground'}`}>
+ {mask(formatCurrency(bal, acc.currency, locale))}
+ </p>
+ </div>
+ )
+ })}
+ </div>
+ ) : (
+ <div className="px-5 py-4">
+ <p className="text-sm text-muted-foreground">{t('accounts.noAccountsFound')}</p>
+ </div>
+ )}
+ </div>
+ )
+ })}
+ </div>
+ ) : (
+ <div className="bg-card rounded-xl border border-dashed border-border p-8 text-center">
+ <p className="text-sm text-muted-foreground">{t('accounts.noBankConnections')}</p>
+ </div>
+ )}
+
+ {/* Closed Accounts */}
+ {closedAccounts.length > 0 && (
+ <div className="bg-card rounded-xl border border-border shadow-sm opacity-60">
+ <div className="flex items-center justify-between px-5 py-3.5 border-b border-border">
+ <h2 className="text-sm font-medium text-muted-foreground">{t('accounts.closedAccounts')}</h2>
+ </div>
+ <div className="divide-y divide-muted">
+ {closedAccounts.map((acc) => {
+ const cfg = getTypeConfig(acc.type)
+ const Icon = cfg.icon
+ return (
+ <div key={acc.id} className="flex items-center px-5 py-3">
+ <div className="flex items-center gap-3 flex-1 min-w-0">
+ <div className={`w-8 h-8 rounded-lg ${cfg.bg} flex items-center justify-center shrink-0`}>
+ <Icon size={14} className={cfg.color} />
+ </div>
+ <p className="text-sm font-medium text-muted-foreground truncate">{acc.name}</p>
+ </div>
+ <Button
+ variant="ghost"
+ size="sm"
+ className="text-xs text-muted-foreground hover:text-foreground h-7 px-2 mr-3"
+ onClick={() => reopenMutation.mutate(acc.id)}
+ disabled={reopenMutation.isPending}
+ >
+ {t('accounts.reopen')}
+ </Button>
+ <p className="text-sm font-semibold tabular-nums text-muted-foreground w-32 text-right">
+ {mask(formatCurrency(Number(acc.current_balance), acc.currency, locale))}
+ </p>
+ </div>
+ )
+ })}
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+
+ {/* Confirm delete dialog */}
+ <Dialog open={!!deletingId} onOpenChange={() => setDeletingId(null)}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{t('accounts.confirmDeleteTitle')}</DialogTitle>
+ </DialogHeader>
+ <p className="text-sm text-muted-foreground">
+ {t('accounts.confirmDeleteDesc')}
+ </p>
+ <DialogFooter>
+ <Button variant="outline" onClick={() => setDeletingId(null)}>
+ {t('common.cancel')}
+ </Button>
+ <Button
+ variant="destructive"
+ onClick={() => deletingId && deleteMutation.mutate(deletingId)}
+ disabled={deleteMutation.isPending}
+ >
+ {deleteMutation.isPending ? t('common.loading') : t('common.delete')}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+
+ {/* Confirm close dialog */}
+ <Dialog open={!!closingAccountId} onOpenChange={() => setClosingAccountId(null)}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{t('accounts.close')}</DialogTitle>
+ </DialogHeader>
+ <p className="text-sm text-muted-foreground">
+ {t('accounts.confirmClose')}
+ </p>
+ {accountsList?.find(a => a.id === closingAccountId)?.connection_id && (
+ <p className="text-sm text-amber-600 font-medium">
+ {t('accounts.confirmCloseBank')}
+ </p>
+ )}
+ <DialogFooter>
+ <Button variant="outline" onClick={() => setClosingAccountId(null)}>
+ {t('common.cancel')}
+ </Button>
+ <Button
+ variant="default"
+ onClick={() => closingAccountId && closeMutation.mutate(closingAccountId)}
+ disabled={closeMutation.isPending}
+ >
+ {closeMutation.isPending ? t('common.loading') : t('accounts.close')}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+
+ {/* Connector Select Dialog */}
+ <ConnectorSelectDialog
+ open={connectorSelectOpen}
+ onClose={() => setConnectorSelectOpen(false)}
+ onSelect={(provider) => setSelectedProvider(provider)}
+ />
+
+ {/* Bank Connect Dialog */}
+ <BankConnectDialog
+ open={!!selectedProvider}
+ onClose={() => setSelectedProvider(null)}
+ provider={selectedProvider ?? undefined}
+ />
+
+ {/* Reconnect Dialog */}
+ <BankConnectDialog
+ open={!!reconnectConnId}
+ onClose={() => { setReconnectConnId(null); setReconnectItemId(null) }}
+ reconnectConnectionId={reconnectConnId ?? undefined}
+ updateItemId={reconnectItemId ?? undefined}
+ />
+
+ {/* Connection Settings Dialog */}
+ <ConnectionSettingsDialog
+ open={!!settingsConnection}
+ onClose={() => setSettingsConnection(null)}
+ connection={settingsConnection}
+ />
+
+ {/* Account Dialog */}
+ <AccountDialog
+ open={dialogOpen}
+ onClose={() => { setDialogOpen(false); setEditingAccount(null) }}
+ account={editingAccount}
+ onSave={(data) => {
+ if (editingAccount) {
+ updateMutation.mutate({ id: editingAccount.id, ...data })
+ } else {
+ createMutation.mutate(data as { name: string; type: string; balance?: number; currency?: string })
+ }
+ }}
+ loading={createMutation.isPending || updateMutation.isPending}
+ />
+ </div>
+ )
+}
+
+function AccountDialog({
+ open,
+ onClose,
+ account,
+ onSave,
+ loading,
+}: {
+ open: boolean
+ onClose: () => void
+ account: Account | null
+ onSave: (data: { name?: string; type?: string; balance?: number; currency?: string }) => void
+ loading: boolean
+}) {
+ const { t } = useTranslation()
+ const [name, setName] = useState(account?.name ?? '')
+ const [type, setType] = useState(account?.type ?? 'checking')
+ const [balance, setBalance] = useState(account?.balance?.toString() ?? '0')
+ const [currency, setCurrency] = useState(account?.currency ?? 'BRL')
+
+ return (
+ <Dialog open={open} onOpenChange={onClose}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>
+ {account ? t('accounts.editAccount') : t('accounts.addManual')}
+ </DialogTitle>
+ </DialogHeader>
+ <form
+ key={account?.id ?? 'new'}
+ onSubmit={(e) => {
+ e.preventDefault()
+ onSave(account
+ ? { name, type, currency }
+ : { name, type, balance: parseFloat(balance), currency }
+ )
+ }}
+ className="space-y-4"
+ >
+ <div className="space-y-2">
+ <Label>{t('accounts.accountName')}</Label>
+ <Input value={name} onChange={(e) => setName(e.target.value)} required />
+ </div>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label>{t('accounts.accountType')}</Label>
+ <select
+ className="w-full border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={type}
+ onChange={(e) => setType(e.target.value)}
+ >
+ <option value="checking">{t('accounts.typeChecking')}</option>
+ <option value="savings">{t('accounts.typeSavings')}</option>
+ <option value="credit_card">{t('accounts.typeCreditCard')}</option>
+ <option value="investment">{t('accounts.typeInvestment')}</option>
+ <option value="wallet">{t('accounts.typeWallet')}</option>
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('accounts.currency')}</Label>
+ <select
+ className="w-full border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={currency}
+ onChange={(e) => setCurrency(e.target.value)}
+ >
+ <option value="BRL">BRL (R$)</option>
+ </select>
+ </div>
+ </div>
+ {!account && (
+ <div className="space-y-2">
+ <Label>{t('accounts.balance')}</Label>
+ <Input
+ type="number"
+ step="0.01"
+ value={balance}
+ onChange={(e) => setBalance(e.target.value)}
+ />
+ </div>
+ )}
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={onClose}>
+ {t('common.cancel')}
+ </Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? t('common.loading') : t('common.save')}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+ )
+}
diff --git a/frontend/src/pages/budgets.tsx b/frontend/src/pages/budgets.tsx
new file mode 100644
index 00000000..a4af009f
--- /dev/null
+++ b/frontend/src/pages/budgets.tsx
@@ -0,0 +1,314 @@
+import React, { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { categories as categoriesApi, categoryGroups as groupsApi, budgets as budgetsApi } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import type { Budget } from '@/types'
+import { Pencil, Trash2, Plus, Repeat, CalendarIcon } from 'lucide-react'
+import { format } from 'date-fns'
+import { ptBR, enUS } from 'date-fns/locale'
+import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover'
+import { Calendar } from '@/components/ui/calendar'
+import { PageHeader } from '@/components/page-header'
+import { CategoryIcon } from '@/components/category-icon'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+import { useAuth } from '@/contexts/auth-context'
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+function currentMonth() {
+ const now = new Date()
+ return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}`
+}
+
+const TH = 'text-xs font-medium text-muted-foreground py-3'
+
+function SectionCard({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ {children}
+ </div>
+ )
+}
+function SectionHeader({ title, action }: { title: string; action?: React.ReactNode }) {
+ return (
+ <div className="px-4 sm:px-5 py-4 border-b border-border flex flex-wrap items-center justify-between gap-2">
+ <p className="text-sm font-semibold text-foreground">{title}</p>
+ {action}
+ </div>
+ )
+}
+
+export default function BudgetsPage() {
+ const { t, i18n } = useTranslation()
+ const { mask } = usePrivacyMode()
+ const { user } = useAuth()
+ const userCurrency = user?.preferences?.currency_display ?? 'BRL'
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const queryClient = useQueryClient()
+ const [selectedMonth, setSelectedMonth] = useState(currentMonth)
+ const [monthCalOpen, setMonthCalOpen] = useState(false)
+ const dateFnsLocale = i18n.language === 'pt-BR' ? ptBR : enUS
+ const monthParam = `${selectedMonth}-01`
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const [editing, setEditing] = useState<Budget | null>(null)
+
+ const { data: budgetsList } = useQuery({
+ queryKey: ['budgets', selectedMonth],
+ queryFn: () => budgetsApi.list(monthParam),
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const { data: groupsList } = useQuery({
+ queryKey: ['category-groups'],
+ queryFn: groupsApi.list,
+ })
+
+ const createMutation = useMutation({
+ mutationFn: (data: { category_id: string; amount: number; month: string; is_recurring?: boolean }) =>
+ budgetsApi.create(data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['budgets'] })
+ setDialogOpen(false)
+ toast.success(t('budgets.created'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id, amount }: { id: string; amount: number }) =>
+ budgetsApi.update(id, { amount }),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['budgets'] })
+ setDialogOpen(false)
+ setEditing(null)
+ toast.success(t('budgets.updated'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => budgetsApi.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['budgets'] })
+ toast.success(t('budgets.deleted'))
+ },
+ })
+
+ const getCategoryDisplay = (categoryId: string) => {
+ const cat = categoriesList?.find((c) => c.id === categoryId)
+ if (!cat) return <span>{categoryId}</span>
+ return (
+ <span className="flex items-center gap-2">
+ <CategoryIcon icon={cat.icon} color={cat.color} size="sm" />
+ <span>{cat.name}</span>
+ </span>
+ )
+ }
+
+ const monthTitle = new Date(selectedMonth + '-02').toLocaleDateString(locale, { month: 'long', year: 'numeric' }).replace(/^\w/, c => c.toUpperCase())
+
+ return (
+ <div>
+ <PageHeader
+ section={t('budgets.title')}
+ title={monthTitle}
+ action={
+ <div className="flex items-center gap-1">
+ <button
+ className="h-8 w-8 flex items-center justify-center rounded-lg border border-border bg-card text-muted-foreground hover:border-border hover:text-foreground transition-all text-base"
+ onClick={() => {
+ const [y, m] = selectedMonth.split('-').map(Number)
+ const d = new Date(y, m - 2, 1)
+ setSelectedMonth(`${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}`)
+ }}
+ >‹</button>
+ <Popover open={monthCalOpen} onOpenChange={setMonthCalOpen}>
+ <PopoverTrigger asChild>
+ <button
+ type="button"
+ className="inline-flex items-center gap-2 border border-border rounded-lg px-3 py-1.5 text-sm bg-card text-foreground hover:bg-muted/50 transition-all cursor-pointer"
+ >
+ <CalendarIcon className="size-3.5 text-muted-foreground" />
+ {monthTitle}
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align="center" className="w-auto p-0">
+ <Calendar
+ mode="single"
+ locale={dateFnsLocale}
+ selected={new Date(`${selectedMonth}-01T00:00:00`)}
+ defaultMonth={new Date(`${selectedMonth}-01T00:00:00`)}
+ onSelect={(date) => {
+ if (!date) return
+ setSelectedMonth(format(date, 'yyyy-MM'))
+ setMonthCalOpen(false)
+ }}
+ />
+ </PopoverContent>
+ </Popover>
+ <button
+ className="h-8 w-8 flex items-center justify-center rounded-lg border border-border bg-card text-muted-foreground hover:border-border hover:text-foreground transition-all text-base"
+ onClick={() => {
+ const [y, m] = selectedMonth.split('-').map(Number)
+ const d = new Date(y, m, 1)
+ setSelectedMonth(`${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}`)
+ }}
+ >›</button>
+ </div>
+ }
+ />
+
+ <SectionCard>
+ <SectionHeader
+ title={t('budgets.title')}
+ action={
+ <Button size="sm" className="gap-1.5 h-8" onClick={() => { setEditing(null); setDialogOpen(true) }}>
+ <Plus size={13} /> {t('budgets.add')}
+ </Button>
+ }
+ />
+ {budgetsList && budgetsList.length > 0 ? (
+ <table className="w-full">
+ <thead>
+ <tr className="border-b border-border">
+ <th className={`${TH} pl-4 sm:pl-5 text-left`}>{t('budgets.category')}</th>
+ <th className={`${TH} text-left w-36`}>{t('budgets.amount')}</th>
+ <th className={`${TH} pr-4 sm:pr-5 text-right w-24`}>{t('budgets.actions')}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {budgetsList.map((budget) => (
+ <tr key={budget.id} className="border-b border-border last:border-0 hover:bg-muted transition-colors">
+ <td className="py-3 pl-4 sm:pl-5 text-sm font-medium text-foreground">
+ <span className="flex items-center gap-1.5">
+ {getCategoryDisplay(budget.category_id)}
+ {budget.is_recurring && (
+ <span title={t('budgets.recurringLabel')} className="text-muted-foreground">
+ <Repeat size={12} />
+ </span>
+ )}
+ </span>
+ </td>
+ <td className="py-3 text-sm font-semibold tabular-nums text-foreground">{mask(formatCurrency(budget.amount, userCurrency, locale))}</td>
+ <td className="py-3 pr-4 sm:pr-5">
+ <div className="flex items-center justify-end gap-1">
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-primary hover:bg-primary/5 transition-colors"
+ onClick={() => { setEditing(budget); setDialogOpen(true) }}
+ >
+ <Pencil size={13} />
+ </button>
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-rose-500 hover:bg-rose-50 transition-colors"
+ onClick={() => deleteMutation.mutate(budget.id)}
+ disabled={deleteMutation.isPending}
+ >
+ <Trash2 size={13} />
+ </button>
+ </div>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ ) : (
+ <p className="text-sm text-muted-foreground text-center py-10">{t('budgets.empty')}</p>
+ )}
+ </SectionCard>
+
+ <Dialog open={dialogOpen} onOpenChange={() => { setDialogOpen(false); setEditing(null) }}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{editing ? t('budgets.edit') : t('budgets.add')}</DialogTitle>
+ </DialogHeader>
+ <form
+ key={editing?.id ?? 'new'}
+ onSubmit={(e) => {
+ e.preventDefault()
+ const formData = new FormData(e.currentTarget)
+ if (editing) {
+ updateMutation.mutate({
+ id: editing.id,
+ amount: parseFloat(formData.get('amount') as string),
+ })
+ } else {
+ const isRecurring = formData.get('is_recurring') === 'on'
+ createMutation.mutate({
+ category_id: formData.get('category_id') as string,
+ amount: parseFloat(formData.get('amount') as string),
+ month: monthParam,
+ is_recurring: isRecurring,
+ })
+ }
+ }}
+ className="space-y-4"
+ >
+ {!editing && (
+ <>
+ <div className="space-y-2">
+ <Label>{t('budgets.category')}</Label>
+ <select
+ name="category_id"
+ className="w-full border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ required
+ >
+ <option value="">{t('budgets.selectCategory')}</option>
+ {groupsList?.map((group) => (
+ <optgroup key={group.id} label={group.name}>
+ {group.categories.map((cat) => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </optgroup>
+ ))}
+ {categoriesList?.filter((c) => !c.group_id).map((cat) => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </select>
+ </div>
+ <label className="flex items-center gap-2 cursor-pointer">
+ <input type="checkbox" name="is_recurring" className="rounded border-border" />
+ <span className="text-sm text-foreground">{t('budgets.repeatEveryMonth')}</span>
+ </label>
+ </>
+ )}
+ <div className="space-y-2">
+ <Label>{t('budgets.amount')}</Label>
+ <Input
+ name="amount"
+ type="number"
+ step="0.01"
+ defaultValue={editing?.amount?.toString() ?? ''}
+ required
+ />
+ </div>
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={() => { setDialogOpen(false); setEditing(null) }}>
+ {t('common.cancel')}
+ </Button>
+ <Button type="submit" disabled={createMutation.isPending || updateMutation.isPending}>
+ {t('common.save')}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/categories.tsx b/frontend/src/pages/categories.tsx
new file mode 100644
index 00000000..e65932c3
--- /dev/null
+++ b/frontend/src/pages/categories.tsx
@@ -0,0 +1,349 @@
+import React, { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { categories as categoriesApi, categoryGroups as groupsApi } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import type { Category, CategoryGroup } from '@/types'
+import { Pencil, Trash2, Plus, ChevronDown, ChevronRight, ChevronsUpDown } from 'lucide-react'
+import { PageHeader } from '@/components/page-header'
+import { CategoryIcon } from '@/components/category-icon'
+import { IconPicker } from '@/components/icon-picker'
+
+function SectionCard({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ {children}
+ </div>
+ )
+}
+function SectionHeader({ title, titleExtra, action }: { title: string; titleExtra?: React.ReactNode; action?: React.ReactNode }) {
+ return (
+ <div className="px-4 sm:px-5 py-4 border-b border-border flex flex-wrap items-center justify-between gap-2">
+ <div className="flex items-center gap-3">
+ <p className="text-sm font-semibold text-foreground">{title}</p>
+ {titleExtra}
+ </div>
+ {action}
+ </div>
+ )
+}
+
+export default function CategoriesPage() {
+ const { t } = useTranslation()
+ const queryClient = useQueryClient()
+ const [catDialogOpen, setCatDialogOpen] = useState(false)
+ const [editingCat, setEditingCat] = useState<Category | null>(null)
+ const [formIcon, setFormIcon] = useState('circle-help')
+ const [formColor, setFormColor] = useState('#6366f1')
+ const [groupDialogOpen, setGroupDialogOpen] = useState(false)
+ const [editingGroup, setEditingGroup] = useState<CategoryGroup | null>(null)
+ const [groupFormIcon, setGroupFormIcon] = useState('folder')
+ const [groupFormColor, setGroupFormColor] = useState('#6B7280')
+ const [collapsedGroups, setCollapsedGroups] = useState<Set<string>>(new Set())
+
+ const { data: groups } = useQuery({
+ queryKey: ['category-groups'],
+ queryFn: groupsApi.list,
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const invalidateAll = () => {
+ queryClient.invalidateQueries({ queryKey: ['categories'] })
+ queryClient.invalidateQueries({ queryKey: ['category-groups'] })
+ }
+
+ const createCatMutation = useMutation({
+ mutationFn: (cat: Partial<Category>) => categoriesApi.create(cat),
+ onSuccess: () => { invalidateAll(); setCatDialogOpen(false); toast.success(t('categories.created')) },
+ })
+ const updateCatMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<Category> & { id: string }) => categoriesApi.update(id, data),
+ onSuccess: () => { invalidateAll(); setCatDialogOpen(false); setEditingCat(null); toast.success(t('categories.updated')) },
+ })
+ const deleteCatMutation = useMutation({
+ mutationFn: (id: string) => categoriesApi.delete(id),
+ onSuccess: () => { invalidateAll(); toast.success(t('categories.deleted')) },
+ })
+
+ const createGroupMutation = useMutation({
+ mutationFn: (g: Partial<CategoryGroup>) => groupsApi.create(g),
+ onSuccess: () => { invalidateAll(); setGroupDialogOpen(false); toast.success(t('groups.created')) },
+ })
+ const updateGroupMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<CategoryGroup> & { id: string }) => groupsApi.update(id, data),
+ onSuccess: () => { invalidateAll(); setGroupDialogOpen(false); setEditingGroup(null); toast.success(t('groups.updated')) },
+ })
+ const deleteGroupMutation = useMutation({
+ mutationFn: (id: string) => groupsApi.delete(id),
+ onSuccess: () => { invalidateAll(); toast.success(t('groups.deleted')) },
+ })
+
+ const toggleCollapse = (groupId: string) => {
+ setCollapsedGroups((prev) => {
+ const next = new Set(prev)
+ if (next.has(groupId)) next.delete(groupId)
+ else next.add(groupId)
+ return next
+ })
+ }
+
+ const ungrouped = categoriesList?.filter((c) => !c.group_id) ?? []
+
+ const openCatDialog = (cat: Category | null) => {
+ setEditingCat(cat)
+ setFormIcon(cat?.icon ?? 'circle-help')
+ setFormColor(cat?.color ?? '#6366f1')
+ setCatDialogOpen(true)
+ }
+
+ const openGroupDialog = (group: CategoryGroup | null) => {
+ setEditingGroup(group)
+ setGroupFormIcon(group?.icon ?? 'folder')
+ setGroupFormColor(group?.color ?? '#6B7280')
+ setGroupDialogOpen(true)
+ }
+
+ const renderCategoryItem = (cat: Category) => (
+ <div key={cat.id} className="flex items-center gap-3 px-4 sm:px-5 pl-6 sm:pl-12 py-2.5 border-b border-border last:border-0 hover:bg-muted transition-colors">
+ <CategoryIcon icon={cat.icon} color={cat.color} size="md" />
+ <span className="text-sm font-medium text-foreground flex-1 min-w-0 truncate">{cat.name}</span>
+ <div className="hidden sm:flex items-center gap-2 shrink-0">
+ <span className="inline-block w-3.5 h-3.5 rounded-full border border-black/10" style={{ backgroundColor: cat.color }} />
+ <span className="text-xs text-muted-foreground font-mono">{cat.color}</span>
+ </div>
+ <div className="flex items-center gap-1 shrink-0 ml-2">
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-primary hover:bg-primary/5 transition-colors"
+ onClick={() => openCatDialog(cat)}
+ title={t('common.edit')}
+ >
+ <Pencil size={13} />
+ </button>
+ {!cat.is_system && (
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-rose-500 hover:bg-rose-50 transition-colors"
+ onClick={() => deleteCatMutation.mutate(cat.id)}
+ disabled={deleteCatMutation.isPending}
+ title={t('common.delete')}
+ >
+ <Trash2 size={13} />
+ </button>
+ )}
+ </div>
+ </div>
+ )
+
+ return (
+ <div>
+ <PageHeader section={t('categories.title')} title={t('categories.title')} />
+
+ <SectionCard>
+ <SectionHeader
+ title={t('categories.title')}
+ titleExtra={
+ <button
+ className="flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors"
+ onClick={() => {
+ if (!groups) return
+ const allCollapsed = groups.every((g) => collapsedGroups.has(g.id))
+ if (allCollapsed) {
+ setCollapsedGroups(new Set())
+ } else {
+ setCollapsedGroups(new Set(groups.map((g) => g.id)))
+ }
+ }}
+ >
+ <ChevronsUpDown size={13} />
+ {groups && groups.every((g) => collapsedGroups.has(g.id)) ? t('categories.expandAll') : t('categories.collapseAll')}
+ </button>
+ }
+ action={
+ <div className="flex gap-2">
+ <Button variant="outline" size="sm" className="gap-1.5 h-8" onClick={() => openGroupDialog(null)}>
+ <Plus size={13} /> <span className="hidden sm:inline">{t('groups.add')}</span>
+ </Button>
+ <Button size="sm" className="gap-1.5 h-8" onClick={() => openCatDialog(null)}>
+ <Plus size={13} /> <span className="hidden sm:inline">{t('categories.addCategory')}</span>
+ </Button>
+ </div>
+ }
+ />
+ <div>
+ {groups?.map((group) => {
+ const isCollapsed = collapsedGroups.has(group.id)
+ return (
+ <div key={group.id}>
+ <div className="flex items-center gap-2 px-4 sm:px-5 py-3 border-b border-border bg-muted/40">
+ <button
+ className="flex items-center gap-2 flex-1 min-w-0 text-left"
+ onClick={() => toggleCollapse(group.id)}
+ >
+ {isCollapsed ? <ChevronRight size={14} className="text-muted-foreground shrink-0" /> : <ChevronDown size={14} className="text-muted-foreground shrink-0" />}
+ <CategoryIcon icon={group.icon} color={group.color} size="md" />
+ <span className="text-sm font-semibold" style={{ color: group.color }}>{group.name}</span>
+ <span className="text-xs text-muted-foreground">({group.categories.length})</span>
+ </button>
+ <div className="flex items-center gap-1 shrink-0">
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-primary hover:bg-primary/5 transition-colors"
+ onClick={() => openGroupDialog(group)}
+ title={t('common.edit')}
+ >
+ <Pencil size={13} />
+ </button>
+ {!group.is_system && (
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-rose-500 hover:bg-rose-50 transition-colors"
+ onClick={() => deleteGroupMutation.mutate(group.id)}
+ disabled={deleteGroupMutation.isPending}
+ title={t('common.delete')}
+ >
+ <Trash2 size={13} />
+ </button>
+ )}
+ </div>
+ </div>
+ {!isCollapsed && group.categories.map(renderCategoryItem)}
+ </div>
+ )
+ })}
+ {ungrouped.length > 0 && (
+ <div>
+ <div className="px-5 py-3 border-b border-border bg-muted/40">
+ <span className="text-sm font-semibold text-muted-foreground">{t('groups.noGroup')}</span>
+ </div>
+ {ungrouped.map(renderCategoryItem)}
+ </div>
+ )}
+ </div>
+ </SectionCard>
+
+ {/* Category Dialog */}
+ <Dialog open={catDialogOpen} onOpenChange={() => { setCatDialogOpen(false); setEditingCat(null) }}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{editingCat ? t('categories.editCategory') : t('categories.newCategory')}</DialogTitle>
+ </DialogHeader>
+ <form
+ key={editingCat?.id ?? 'new'}
+ onSubmit={(e) => {
+ e.preventDefault()
+ const formData = new FormData(e.currentTarget)
+ const data = {
+ name: formData.get('name') as string,
+ icon: formData.get('icon') as string,
+ color: formData.get('color') as string,
+ group_id: (formData.get('group_id') as string) || null,
+ }
+ if (editingCat) {
+ updateCatMutation.mutate({ id: editingCat.id, ...data })
+ } else {
+ createCatMutation.mutate(data)
+ }
+ }}
+ className="space-y-4"
+ >
+ <div className="space-y-2">
+ <Label>{t('groups.name')}</Label>
+ <Input name="name" defaultValue={editingCat?.name ?? ''} required />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('categories.group')}</Label>
+ <select
+ name="group_id"
+ defaultValue={editingCat?.group_id ?? ''}
+ className="w-full border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ >
+ <option value="">{t('categories.noGroup')}</option>
+ {groups?.map((g) => (
+ <option key={g.id} value={g.id}>{g.name}</option>
+ ))}
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('groups.color')}</Label>
+ <Input name="color" type="color" value={formColor} onChange={(e) => setFormColor(e.target.value)} required className="h-9 px-2 py-1" />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('groups.icon')}</Label>
+ <IconPicker value={formIcon} color={formColor} onChange={setFormIcon} />
+ <input type="hidden" name="icon" value={formIcon} />
+ </div>
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={() => { setCatDialogOpen(false); setEditingCat(null) }}>
+ {t('common.cancel')}
+ </Button>
+ <Button type="submit">{t('common.save')}</Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+
+ {/* Group Dialog */}
+ <Dialog open={groupDialogOpen} onOpenChange={() => { setGroupDialogOpen(false); setEditingGroup(null) }}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{editingGroup ? t('groups.edit') : t('groups.new')}</DialogTitle>
+ </DialogHeader>
+ <form
+ key={editingGroup?.id ?? 'new-group'}
+ onSubmit={(e) => {
+ e.preventDefault()
+ const formData = new FormData(e.currentTarget)
+ const data = {
+ name: formData.get('name') as string,
+ icon: formData.get('icon') as string,
+ color: formData.get('color') as string,
+ position: parseInt(formData.get('position') as string) || 0,
+ }
+ if (editingGroup) {
+ updateGroupMutation.mutate({ id: editingGroup.id, ...data })
+ } else {
+ createGroupMutation.mutate(data)
+ }
+ }}
+ className="space-y-4"
+ >
+ <div className="space-y-2">
+ <Label>{t('groups.name')}</Label>
+ <Input name="name" defaultValue={editingGroup?.name ?? ''} required />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('groups.position')}</Label>
+ <Input name="position" type="number" defaultValue={editingGroup?.position?.toString() ?? '0'} />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('groups.color')}</Label>
+ <Input name="color" type="color" value={groupFormColor} onChange={(e) => setGroupFormColor(e.target.value)} required className="h-9 px-2 py-1" />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('groups.icon')}</Label>
+ <IconPicker value={groupFormIcon} color={groupFormColor} onChange={setGroupFormIcon} />
+ <input type="hidden" name="icon" value={groupFormIcon} />
+ </div>
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={() => { setGroupDialogOpen(false); setEditingGroup(null) }}>
+ {t('common.cancel')}
+ </Button>
+ <Button type="submit">{t('common.save')}</Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/dashboard.tsx b/frontend/src/pages/dashboard.tsx
new file mode 100644
index 00000000..7106eb0d
--- /dev/null
+++ b/frontend/src/pages/dashboard.tsx
@@ -0,0 +1,844 @@
+import { useState, useEffect, useMemo } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { format } from 'date-fns'
+import { ptBR, enUS } from 'date-fns/locale'
+import { dashboard, transactions, budgets, categories as categoriesApi, accounts as accountsApi } from '@/lib/api'
+import { Skeleton } from '@/components/ui/skeleton'
+import { Button } from '@/components/ui/button'
+import { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover'
+import { Calendar } from '@/components/ui/calendar'
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/ui/table'
+import {
+ ComposedChart,
+ Area,
+ Line,
+ XAxis,
+ YAxis,
+ Tooltip,
+ ResponsiveContainer,
+} from 'recharts'
+import { CheckCircle2, CalendarIcon } from 'lucide-react'
+import { PageHeader } from '@/components/page-header'
+import { CategoryIcon } from '@/components/category-icon'
+import { TransactionDrillDown, type DrillDownFilter } from '@/components/transaction-drill-down'
+import { TransactionDialog, extractApiError } from '@/components/transaction-dialog'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+import { useAuth } from '@/contexts/auth-context'
+import type { Transaction } from '@/types'
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+function currentMonth() {
+ const now = new Date()
+ return `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}`
+}
+
+function shiftMonth(yearMonth: string, delta: number) {
+ const [y, m] = yearMonth.split('-').map(Number)
+ const d = new Date(y, m - 1 + delta, 1)
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}`
+}
+
+function monthLastDay(yearMonth: string) {
+ const [y, m] = yearMonth.split('-').map(Number)
+ return new Date(y, m, 0).getDate()
+}
+
+function monthLabel(yearMonth: string, locale = 'pt-BR') {
+ const [y, m] = yearMonth.split('-').map(Number)
+ return new Date(y, m - 1, 2).toLocaleDateString(locale, { month: 'long', year: 'numeric' })
+}
+
+function formatDate(dateStr: string, locale = 'pt-BR') {
+ return new Date(dateStr + 'T00:00:00').toLocaleDateString(locale)
+}
+
+
+export default function DashboardPage() {
+ const { t, i18n } = useTranslation()
+ const { mask, privacyMode, MASK } = usePrivacyMode()
+ const { user } = useAuth()
+ const userCurrency = user?.preferences?.currency_display ?? 'BRL'
+ const displayName = user?.preferences?.display_name || ''
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+
+ const greeting = (() => {
+ const hour = new Date().getHours()
+ const key = hour < 12 ? 'greetingMorning' : hour < 18 ? 'greetingAfternoon' : 'greetingEvening'
+ const base = t(`dashboard.${key}`)
+ return displayName ? `${base}, ${displayName}` : base
+ })()
+ const [selectedMonth, setSelectedMonth] = useState(currentMonth)
+ const [balanceDate, setBalanceDate] = useState<string | undefined>()
+ const [drillDown, setDrillDown] = useState<DrillDownFilter | null>(null)
+ const [editingTx, setEditingTx] = useState<Transaction | null>(null)
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const queryClient = useQueryClient()
+ const [headerCalOpen, setHeaderCalOpen] = useState(false)
+ const [hoveredDay, setHoveredDay] = useState<number | null>(null)
+ const [balanceCalOpen, setBalanceCalOpen] = useState(false)
+ const dateFnsLocale = i18n.language === 'pt-BR' ? ptBR : enUS
+ const monthParam = `${selectedMonth}-01`
+ const monthStart = `${selectedMonth}-01`
+ const monthEnd = `${selectedMonth}-${String(monthLastDay(selectedMonth)).padStart(2, '0')}`
+ const monthLabelStr = monthLabel(selectedMonth, locale)
+
+ const handleMonthChange = (newMonth: string) => {
+ setSelectedMonth(newMonth)
+ setBalanceDate(undefined)
+ }
+
+ const { data: summary, isLoading: summaryLoading } = useQuery({
+ queryKey: ['dashboard', 'summary', selectedMonth, balanceDate],
+ queryFn: () => dashboard.summary(monthParam, balanceDate),
+ })
+
+ const { data: spending, isLoading: spendingLoading } = useQuery({
+ queryKey: ['dashboard', 'spending', selectedMonth],
+ queryFn: () => dashboard.spendingByCategory(monthParam),
+ })
+
+ const prevMonth = shiftMonth(selectedMonth, -1)
+
+ const { data: balanceHistory, isLoading: balanceHistoryLoading } = useQuery({
+ queryKey: ['dashboard', 'balance-history', selectedMonth],
+ queryFn: () => dashboard.balanceHistory(monthParam),
+ })
+
+ const { data: currentMonthTxs, isLoading: currentTxLoading } = useQuery({
+ queryKey: ['transactions', 'cumulative', selectedMonth],
+ queryFn: () => transactions.list({
+ from: `${selectedMonth}-01`,
+ to: `${selectedMonth}-${String(monthLastDay(selectedMonth)).padStart(2, '0')}`,
+ limit: 500,
+ }),
+ })
+
+ const { data: projectedTxs, isLoading: projectedTxLoading } = useQuery({
+ queryKey: ['dashboard', 'projected-transactions', selectedMonth],
+ queryFn: () => dashboard.projectedTransactions(monthParam),
+ })
+
+ const { data: budgetComparison } = useQuery({
+ queryKey: ['budgets', 'comparison', selectedMonth],
+ queryFn: () => budgets.comparison(monthParam),
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const { data: accountsList } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accountsApi.list(),
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<Transaction> & { id: string }) =>
+ transactions.update(id, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ queryClient.invalidateQueries({ queryKey: ['budgets'] })
+ queryClient.invalidateQueries({ queryKey: ['drill-down'] })
+ setDialogOpen(false)
+ setEditingTx(null)
+ },
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => transactions.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ queryClient.invalidateQueries({ queryKey: ['budgets'] })
+ queryClient.invalidateQueries({ queryKey: ['drill-down'] })
+ setDialogOpen(false)
+ setEditingTx(null)
+ },
+ })
+
+ const cumulativeData = useMemo(() => {
+ if (!balanceHistory) return []
+ const daysInMonth = monthLastDay(selectedMonth)
+ const result: { day: number; current: number | null; previous: number }[] = []
+ for (let day = 1; day <= daysInMonth; day++) {
+ const cur = balanceHistory.current.find(d => d.day === day)
+ const prev = balanceHistory.previous.find(d => d.day === day)
+ result.push({
+ day,
+ current: cur?.balance ?? null,
+ previous: prev?.balance ?? 0,
+ })
+ }
+ return result
+ }, [balanceHistory, selectedMonth])
+
+ const lastCurrentPoint = [...cumulativeData].reverse().find(d => d.current !== null)
+ const lastDay = lastCurrentPoint?.day ?? 0
+ const currentStartBalance = balanceHistory?.current.find(d => d.day === 1)?.balance ?? 0
+ const currentLatestBalance = lastCurrentPoint?.current ?? 0
+ const monthVariation = currentLatestBalance - currentStartBalance
+
+ const totalBalance = Object.values(summary?.total_balance ?? {}).reduce((a, b) => a + Number(b), 0)
+
+
+ // Savings rate & projection
+ const income = Number(summary?.monthly_income ?? 0)
+ const expenses = Number(summary?.monthly_expenses ?? 0)
+ const savingsRate = income > 0 ? ((income - expenses) / income) * 100 : 0
+ const isCurrentMonth = selectedMonth === currentMonth()
+ const daysElapsed = isCurrentMonth ? new Date().getDate() : monthLastDay(selectedMonth)
+ const daysInMonth = monthLastDay(selectedMonth)
+ const projectedSpend = expenses > 0 && isCurrentMonth && daysElapsed > 0
+ ? (expenses / daysElapsed) * daysInMonth
+ : null
+
+ // Uncategorized data
+ const uncategorizedCount = summary?.pending_categorization ?? 0
+ const uncategorizedAmount = summary?.pending_categorization_amount ?? 0
+
+ // Merged category bars data
+ const mergedCategories = useMemo(() => {
+ if (!spending) return []
+ const budgetMap = new Map<string, (typeof budgetComparison extends (infer T)[] | undefined ? T : never)>()
+ if (budgetComparison) {
+ for (const b of budgetComparison) {
+ budgetMap.set(b.category_id, b)
+ }
+ }
+ return spending
+ .filter(s => s.category_id !== null)
+ .map(s => {
+ const budget = s.category_id ? budgetMap.get(s.category_id) : undefined
+ const actual = s.total
+ const prevAmount = budget ? Number(budget.prev_month_amount) : 0
+ let momPct: number | null = null
+ if (prevAmount > 0) {
+ momPct = ((actual - prevAmount) / prevAmount) * 100
+ } else if (actual > 0) {
+ momPct = 100
+ }
+ return {
+ category_id: s.category_id!,
+ category_name: s.category_name,
+ category_icon: s.category_icon,
+ category_color: s.category_color,
+ actual,
+ budget_amount: budget ? Number(budget.budget_amount) : null,
+ percentage_used: budget?.percentage_used ?? null,
+ momPct,
+ }
+ })
+ .sort((a, b) => b.actual - a.actual)
+ }, [spending, budgetComparison])
+
+ const [txPage, setTxPage] = useState(1)
+ useEffect(() => setTxPage(1), [selectedMonth])
+
+ type DisplayRow = {
+ key: string
+ description: string
+ date: string
+ type: 'debit' | 'credit'
+ amount: number
+ currency: string
+ categoryIcon: string | null
+ categoryName: string | null
+ categoryColor: string | null
+ isProjected: boolean
+ }
+
+ const TX_PER_PAGE = 10
+ const allDisplayRows = useMemo(() => {
+ const rows: DisplayRow[] = []
+ for (const tx of currentMonthTxs?.items ?? []) {
+ rows.push({
+ key: tx.id,
+ description: tx.description,
+ date: tx.date,
+ type: tx.type,
+ amount: Number(tx.amount),
+ currency: tx.currency,
+ categoryIcon: tx.category?.icon ?? null,
+ categoryName: tx.category?.name ?? null,
+ categoryColor: tx.category?.color ?? null,
+ isProjected: false,
+ })
+ }
+ for (const pt of projectedTxs ?? []) {
+ rows.push({
+ key: `proj-${pt.recurring_id}-${pt.date}`,
+ description: pt.description,
+ date: pt.date,
+ type: pt.type,
+ amount: pt.amount,
+ currency: pt.currency,
+ categoryIcon: pt.category_icon,
+ categoryName: pt.category_name,
+ categoryColor: pt.category_color ?? null,
+ isProjected: true,
+ })
+ }
+ rows.sort((a, b) => a.date.localeCompare(b.date))
+ return rows
+ }, [currentMonthTxs, projectedTxs])
+
+ const txTotalPages = Math.ceil(allDisplayRows.length / TX_PER_PAGE)
+ const pagedRows = allDisplayRows.slice((txPage - 1) * TX_PER_PAGE, txPage * TX_PER_PAGE)
+ const txListLoading = currentTxLoading || projectedTxLoading
+
+ // Savings rate display
+ const savingsRateColor = income === 0 && expenses > 0
+ ? 'text-rose-500'
+ : savingsRate > 0
+ ? 'text-emerald-600'
+ : savingsRate < 0
+ ? 'text-rose-500'
+ : 'text-muted-foreground'
+
+ const savingsRateDisplay = income === 0 && expenses > 0
+ ? '---'
+ : `${savingsRate.toFixed(0)}%`
+
+ return (
+ <div>
+ {/* Header */}
+ <PageHeader
+ section={greeting}
+ title={new Date(selectedMonth + '-02').toLocaleDateString(locale, { month: 'long', year: 'numeric' }).replace(/^\w/, c => c.toUpperCase())}
+ action={
+ <div className="flex items-center gap-1">
+ <button
+ className="h-8 w-8 flex items-center justify-center rounded-lg border border-border bg-card text-muted-foreground hover:border-border hover:text-foreground transition-all text-base"
+ onClick={() => handleMonthChange(shiftMonth(selectedMonth, -1))}
+ >&#8249;</button>
+ <Popover open={headerCalOpen} onOpenChange={setHeaderCalOpen}>
+ <PopoverTrigger asChild>
+ <button
+ type="button"
+ className="inline-flex items-center gap-2 border border-border rounded-lg px-3 py-1.5 text-sm bg-card text-foreground hover:bg-muted/50 transition-all cursor-pointer"
+ >
+ <CalendarIcon className="size-3.5 text-muted-foreground" />
+ {new Date(selectedMonth + '-02').toLocaleDateString(locale, { month: 'long', year: 'numeric' }).replace(/^\w/, c => c.toUpperCase())}
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align="center" className="w-auto p-0">
+ <Calendar
+ mode="single"
+ locale={dateFnsLocale}
+ selected={new Date((balanceDate ?? `${selectedMonth}-01`) + 'T00:00:00')}
+ defaultMonth={new Date(`${selectedMonth}-01T00:00:00`)}
+ onSelect={(date) => {
+ if (!date) return
+ const newMonth = format(date, 'yyyy-MM')
+ setSelectedMonth(newMonth)
+ setBalanceDate(format(date, 'yyyy-MM-dd'))
+ setHeaderCalOpen(false)
+ }}
+ />
+ </PopoverContent>
+ </Popover>
+ <button
+ className="h-8 w-8 flex items-center justify-center rounded-lg border border-border bg-card text-muted-foreground hover:border-border hover:text-foreground transition-all text-base"
+ onClick={() => handleMonthChange(shiftMonth(selectedMonth, 1))}
+ >&#8250;</button>
+ </div>
+ }
+ />
+
+ {/* Hero Card: Savings Rate + Uncategorized CTA */}
+ <div className="bg-card rounded-xl border border-border shadow-sm mb-5">
+ <div className="grid grid-cols-1 lg:grid-cols-3">
+ {/* Left: Savings Rate & Metrics */}
+ <div className="lg:col-span-2 px-5 py-4">
+ <div className="flex items-baseline gap-3 mb-3">
+ <div>
+ <p className="text-xs font-medium text-muted-foreground mb-0.5">{t('dashboard.savingsRate')}</p>
+ {summaryLoading ? (
+ <Skeleton className="h-10 w-28" />
+ ) : (
+ <p className={`text-4xl font-bold tabular-nums leading-tight ${savingsRateColor}`}>
+ {savingsRateDisplay}
+ </p>
+ )}
+ </div>
+ </div>
+
+ <div className="flex flex-wrap gap-6">
+ {/* Balance */}
+ <div className="min-w-0">
+ <p className="text-xs font-medium text-muted-foreground mb-0.5">{t('dashboard.totalBalance')}</p>
+ {summaryLoading ? (
+ <Skeleton className="h-7 w-24" />
+ ) : (
+ <div>
+ <p className={`text-lg font-bold tabular-nums ${totalBalance < 0 ? 'text-rose-500' : 'text-foreground'}`}>
+ {mask(formatCurrency(totalBalance, userCurrency, locale))}
+ </p>
+ <Popover open={balanceCalOpen} onOpenChange={setBalanceCalOpen}>
+ <PopoverTrigger asChild>
+ <button className="inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-primary transition-colors cursor-pointer p-0 bg-transparent border-none outline-none">
+ <CalendarIcon className="size-3" />
+ {(() => {
+ const dateStr = balanceDate ?? summary?.balance_date ?? ''
+ if (!dateStr) return ''
+ return new Date(dateStr + 'T00:00:00').toLocaleDateString(locale)
+ })()}
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align="start" className="w-auto p-0">
+ <Calendar
+ mode="single"
+ locale={dateFnsLocale}
+ selected={(() => {
+ const dateStr = balanceDate ?? summary?.balance_date ?? ''
+ return dateStr ? new Date(dateStr + 'T00:00:00') : undefined
+ })()}
+ defaultMonth={new Date(`${selectedMonth}-01T00:00:00`)}
+ onSelect={(date) => {
+ if (!date) return
+ setBalanceDate(format(date, 'yyyy-MM-dd'))
+ setBalanceCalOpen(false)
+ }}
+ />
+ </PopoverContent>
+ </Popover>
+ </div>
+ )}
+ </div>
+
+ {/* Income */}
+ <div
+ className="min-w-0 cursor-pointer hover:opacity-70 transition-opacity"
+ onClick={() => setDrillDown({
+ title: t('dashboard.drillDownIncome', { month: monthLabelStr }),
+ type: 'credit',
+ from: monthStart,
+ to: monthEnd,
+ })}
+ >
+ <p className="text-xs font-medium text-muted-foreground mb-0.5">{t('dashboard.monthlyIncome')}</p>
+ {summaryLoading ? (
+ <Skeleton className="h-7 w-24" />
+ ) : (
+ <p className="text-lg font-bold tabular-nums text-emerald-600">
+ +{mask(formatCurrency(income, userCurrency, locale))}
+ </p>
+ )}
+ </div>
+
+ {/* Expenses */}
+ <div
+ className="min-w-0 cursor-pointer hover:opacity-70 transition-opacity"
+ onClick={() => setDrillDown({
+ title: t('dashboard.drillDownExpenses', { month: monthLabelStr }),
+ type: 'debit',
+ from: monthStart,
+ to: monthEnd,
+ })}
+ >
+ <p className="text-xs font-medium text-muted-foreground mb-0.5">{t('dashboard.monthlyExpenses')}</p>
+ {summaryLoading ? (
+ <Skeleton className="h-7 w-24" />
+ ) : (
+ <p className="text-lg font-bold tabular-nums text-rose-500">
+ -{mask(formatCurrency(expenses, userCurrency, locale))}
+ </p>
+ )}
+ </div>
+ </div>
+
+ {/* Spending projection */}
+ {projectedSpend !== null && !summaryLoading && (
+ <p className="text-xs text-muted-foreground mt-2">
+ {t('dashboard.spendingProjection', { amount: mask(formatCurrency(projectedSpend, userCurrency, locale)) })}
+ </p>
+ )}
+ </div>
+
+ {/* Right: Uncategorized CTA */}
+ <div className="lg:col-span-1 px-5 py-4 border-t lg:border-t-0 lg:border-l border-border flex flex-col items-center justify-center text-center">
+ {summaryLoading ? (
+ <Skeleton className="h-16 w-16 rounded-full" />
+ ) : uncategorizedCount > 0 ? (
+ <div
+ className="cursor-pointer hover:opacity-80 transition-opacity"
+ onClick={() => setDrillDown({
+ title: t('dashboard.drillDownUncategorized'),
+ uncategorized: true,
+ })}
+ >
+ <div className={`w-14 h-14 rounded-full flex items-center justify-center text-xl font-bold text-white mx-auto mb-2 ${
+ uncategorizedCount >= 20 ? 'bg-amber-500' : 'bg-amber-400'
+ }`}>
+ {uncategorizedCount}
+ </div>
+ <p className="text-sm font-medium text-foreground">
+ {t('dashboard.uncategorizedCta', { count: uncategorizedCount })}
+ </p>
+ {uncategorizedAmount > 0 && (
+ <p className="text-xs text-muted-foreground mt-0.5">
+ {mask(t('dashboard.uncategorizedTotal', { amount: formatCurrency(uncategorizedAmount, userCurrency, locale) }))}
+ </p>
+ )}
+ <p className="text-sm font-semibold text-amber-600 mt-2 hover:underline">
+ {t('dashboard.categorizeNow')} &rarr;
+ </p>
+ </div>
+ ) : (
+ <div>
+ <CheckCircle2 className="w-10 h-10 text-emerald-500 mx-auto mb-1.5" />
+ <p className="text-sm font-semibold text-foreground">{t('dashboard.allCategorized')}</p>
+ <p className="text-xs text-muted-foreground mt-0.5">{t('dashboard.allCategorizedDesc')}</p>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+
+ {/* Charts: Category Spending Bars + Balance Flow */}
+ <div className="grid grid-cols-1 lg:grid-cols-2 gap-5 mb-5" style={{ gridAutoRows: 'minmax(380px, auto)' }}>
+ {/* Category Spending Bars */}
+ <div className="bg-card rounded-xl border border-border shadow-sm flex flex-col max-h-[420px]">
+ <div className="px-5 py-4 border-b border-border shrink-0">
+ <p className="text-sm font-semibold text-foreground">{t('dashboard.spendingByCategory')}</p>
+ </div>
+ <div className="p-3 overflow-y-auto flex-1">
+ {spendingLoading ? (
+ <div className="space-y-3 p-2">
+ {Array.from({ length: 4 }).map((_, i) => (
+ <Skeleton key={i} className="h-12 w-full" />
+ ))}
+ </div>
+ ) : mergedCategories.length > 0 ? (
+ <div className="space-y-1.5">
+ {mergedCategories.map((item) => {
+ const hasBudget = item.budget_amount != null && item.budget_amount > 0
+ const pct = item.percentage_used
+ const barColor = hasBudget
+ ? pct! > 100 ? 'bg-rose-500' : pct! >= 80 ? 'bg-amber-400' : 'bg-emerald-500'
+ : 'bg-muted-foreground/20'
+
+ return (
+ <div
+ key={item.category_id}
+ className="rounded-lg px-3 py-2.5 hover:bg-muted/50 transition-colors cursor-pointer"
+ onClick={() => setDrillDown({
+ title: t('dashboard.drillDownCategory', { category: item.category_name, month: monthLabelStr }),
+ category_id: item.category_id,
+ type: 'debit',
+ from: monthStart,
+ to: monthEnd,
+ })}
+ >
+ <div className="flex items-center gap-3">
+ <CategoryIcon icon={item.category_icon} color={item.category_color} size="lg" />
+ <div className="flex-1 min-w-0">
+ <div className="flex items-center justify-between gap-2 mb-1">
+ <span className="text-sm font-semibold text-foreground truncate">{item.category_name}</span>
+ <div className="flex items-center gap-2 shrink-0">
+ <span className="text-sm font-bold tabular-nums text-foreground">{mask(formatCurrency(item.actual, userCurrency, locale))}</span>
+ {item.momPct !== null && (
+ <span className={`inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold tabular-nums ${
+ item.momPct > 0 ? 'bg-rose-100 text-rose-600 dark:bg-rose-500/20 dark:text-rose-400' : item.momPct < 0 ? 'bg-emerald-100 text-emerald-600 dark:bg-emerald-500/20 dark:text-emerald-400' : 'bg-muted text-muted-foreground'
+ }`}>
+ {item.momPct > 0 ? '\u2191' : item.momPct < 0 ? '\u2193' : '='}{Math.abs(item.momPct).toFixed(0)}%
+ </span>
+ )}
+ </div>
+ </div>
+ {hasBudget && (
+ <div className="flex items-center gap-2">
+ <div className="flex-1 h-1.5 bg-muted/60 rounded-full overflow-hidden">
+ <div
+ className={`h-full rounded-full transition-all ${barColor}`}
+ style={{ width: `${Math.min(pct!, 100)}%` }}
+ />
+ </div>
+ <span className={`text-[11px] tabular-nums font-medium shrink-0 ${
+ pct! > 100 ? 'text-rose-500' : pct! >= 80 ? 'text-amber-500' : 'text-muted-foreground'
+ }`}>
+ {mask(t('dashboard.ofBudget', { budget: formatCurrency(item.budget_amount!, userCurrency, locale) }))}
+ </span>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ )
+ })}
+ </div>
+ ) : (
+ <p className="text-muted-foreground text-sm text-center py-12">{t('dashboard.noData')}</p>
+ )}
+ </div>
+ </div>
+
+ {/* Cumulative Spending Comparison */}
+ <div className="bg-card rounded-xl border border-border shadow-sm max-h-[420px] flex flex-col">
+ <div className="px-5 pt-5 pb-3 shrink-0">
+ <div className="flex items-start justify-between mb-0.5">
+ <div>
+ <p className="text-base font-bold text-foreground">{t('dashboard.balanceFlow')}</p>
+ <p className="text-xs text-muted-foreground mt-0.5">
+ {new Date(`${selectedMonth}-01T00:00:00`).toLocaleDateString(locale)} → {new Date(`${selectedMonth}-${String(lastCurrentPoint?.day ?? monthLastDay(selectedMonth)).padStart(2, '0')}T00:00:00`).toLocaleDateString(locale)}
+ </p>
+ </div>
+ {!balanceHistoryLoading && lastCurrentPoint && (
+ <span className={`text-lg font-bold tabular-nums ${monthVariation >= 0 ? 'text-emerald-600' : 'text-rose-500'}`}>
+ {mask(`${monthVariation > 0 ? '+' : ''}${formatCurrency(monthVariation, userCurrency, locale)}`)}
+ </span>
+ )}
+ </div>
+ </div>
+ <div className="px-1 pb-4 flex-1 min-h-0">
+ {balanceHistoryLoading ? (
+ <Skeleton className="h-full w-full" />
+ ) : cumulativeData.length > 0 ? (
+ <ResponsiveContainer width="100%" height="100%">
+ <ComposedChart
+ data={cumulativeData}
+ margin={{ top: 4, right: 8, left: 0, bottom: 0 }}
+ className="cursor-pointer"
+ onMouseMove={(state) => {
+ const idx = state?.activeTooltipIndex
+ if (typeof idx === 'number') {
+ const point = cumulativeData[idx]
+ if (point) setHoveredDay(point.day)
+ }
+ }}
+ onMouseLeave={() => setHoveredDay(null)}
+ onClick={(_state) => {
+ // Access activePayload from the underlying native event target chart state
+ const chartState = _state as unknown as { activePayload?: Array<{ payload: { day: number } }> }
+ const payload = chartState?.activePayload ?? []
+ if (payload[0]) {
+ const day = String(payload[0].payload.day).padStart(2, '0')
+ const dateStr = `${selectedMonth}-${day}`
+ setDrillDown({
+ title: t('dashboard.drillDownDay', { date: new Date(dateStr + 'T00:00:00').toLocaleDateString(locale) }),
+ from: dateStr,
+ to: dateStr,
+ })
+ }
+ }}
+ >
+ <defs>
+ <linearGradient id="cumGrad" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="5%" stopColor="#10B981" stopOpacity={0.18} />
+ <stop offset="95%" stopColor="#10B981" stopOpacity={0.02} />
+ </linearGradient>
+ </defs>
+ <XAxis
+ dataKey="day"
+ tick={{ fontSize: 10, fill: 'var(--muted-foreground)' }}
+ axisLine={false}
+ tickLine={false}
+ interval={3}
+ />
+ <YAxis
+ tickFormatter={(v) => {
+ if (privacyMode) return ''
+ if (v === 0) return '0'
+ return formatCurrency(v, userCurrency, locale).replace(/,00$/, '').replace(/\.00$/, '')
+ }}
+ tick={{ fontSize: 10, fill: 'var(--muted-foreground)' }}
+ axisLine={false}
+ tickLine={false}
+ width={56}
+ tickCount={5}
+ domain={[
+ (dataMin: number) => dataMin < 0 ? Math.floor(dataMin / 100) * 100 : 0,
+ (dataMax: number) => Math.ceil(dataMax / 100) * 100,
+ ]}
+ />
+ <Tooltip
+ formatter={(value, name) => [
+ value !== null ? (privacyMode ? MASK : formatCurrency(Number(value), userCurrency, locale)) : '\u2014',
+ name === 'current' ? monthLabel(selectedMonth, locale).split(' ')[0] : monthLabel(prevMonth, locale).split(' ')[0],
+ ]}
+ labelFormatter={(day) => t('dashboard.day', { day })}
+ contentStyle={{
+ background: 'var(--card)',
+ color: 'var(--foreground)',
+ border: '1px solid var(--border)',
+ borderRadius: '0.75rem',
+ boxShadow: '0 4px 12px rgba(0,0,0,0.08)',
+ fontSize: '12px',
+ }}
+ />
+ <Area
+ type="monotone"
+ dataKey="current"
+ stroke="#10B981"
+ strokeWidth={2}
+ fill="url(#cumGrad)"
+ dot={false}
+ activeDot={{ r: 3, fill: '#10B981' }}
+ connectNulls={false}
+ />
+ <Line
+ type="monotone"
+ dataKey="previous"
+ stroke="#94A3B8"
+ strokeWidth={2}
+ strokeDasharray="5 3"
+ dot={false}
+ activeDot={{ r: 3, fill: '#94A3B8' }}
+ />
+ </ComposedChart>
+ </ResponsiveContainer>
+ ) : (
+ <p className="text-muted-foreground text-sm text-center py-12">{t('dashboard.noData')}</p>
+ )}
+ </div>
+ {!balanceHistoryLoading && lastCurrentPoint && (() => {
+ const footerDay = hoveredDay ?? lastDay
+ const footerPrev = balanceHistory?.previous.find(d => d.day === footerDay)?.balance ?? 0
+ const footerCurrent = cumulativeData.find(d => d.day === footerDay)?.current ?? totalBalance
+ const footerPct = footerPrev !== 0 ? ((footerCurrent - footerPrev) / Math.abs(footerPrev)) * 100 : null
+ if (footerPrev === 0 || footerPct === null) return null
+ return (
+ <div className="px-5 pb-4 pt-0 shrink-0">
+ <p className="text-xs text-muted-foreground">
+ {t('dashboard.balanceFlowVsPrev', {
+ month: monthLabel(prevMonth, locale).split(' ')[0],
+ day: footerDay,
+ amount: mask(formatCurrency(footerPrev, userCurrency, locale)),
+ delta: `${footerPct >= 0 ? '+' : ''}${footerPct.toFixed(1)}%`,
+ })}
+ {' '}
+ <span className={footerPct >= 0 ? 'text-emerald-600' : 'text-rose-500'}>
+ {footerPct >= 0 ? '\u25B2' : '\u25BC'}
+ </span>
+ </p>
+ </div>
+ )
+ })()}
+ </div>
+ </div>
+
+ {/* Period Transactions */}
+ <div>
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ <div className="px-5 py-4 border-b border-border">
+ <p className="text-sm font-semibold text-foreground">{t('dashboard.periodTransactions')}</p>
+ </div>
+ {txListLoading ? (
+ <div className="p-5 space-y-3">
+ {Array.from({ length: 5 }).map((_, i) => (
+ <Skeleton key={i} className="h-10 w-full" />
+ ))}
+ </div>
+ ) : pagedRows.length > 0 ? (
+ <>
+ <Table>
+ <TableHeader>
+ <TableRow className="border-b border-border hover:bg-transparent">
+ <TableHead className="pl-5 text-xs font-medium text-muted-foreground">{t('transactions.description')}</TableHead>
+ <TableHead className="pr-5 text-right text-xs font-medium text-muted-foreground">{t('transactions.amount')}</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {pagedRows.map((row) => (
+ <TableRow
+ key={row.key}
+ className={`border-b border-border last:border-0 ${!row.isProjected ? 'cursor-pointer hover:bg-muted' : ''}`}
+ onClick={() => {
+ if (row.isProjected) return
+ const tx = currentMonthTxs?.items.find((t) => t.id === row.key)
+ if (tx) { setEditingTx(tx); setDialogOpen(true) }
+ }}
+ >
+ <TableCell className="py-2.5 pl-5">
+ <div className="flex items-center gap-3">
+ <CategoryIcon icon={row.categoryIcon} color={row.categoryColor} size="lg" />
+ <div className="min-w-0">
+ <div className="flex items-center gap-2">
+ <p className="text-sm font-semibold text-foreground truncate">{row.description}</p>
+ {row.isProjected && (
+ <span className="inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold bg-violet-100 text-violet-600 shrink-0">
+ {t('transactions.recurringBadge')}
+ </span>
+ )}
+ </div>
+ <p className="text-xs text-muted-foreground">{formatDate(row.date, locale)}</p>
+ </div>
+ </div>
+ </TableCell>
+ <TableCell className="py-2.5 pr-5 text-right">
+ <span className={`text-sm font-semibold tabular-nums ${row.type === 'credit' ? 'text-emerald-600' : 'text-rose-500'}`}>
+ {mask(`${row.type === 'credit' ? '+' : '-'}${formatCurrency(Math.abs(row.amount), row.currency, locale)}`)}
+ </span>
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ {txTotalPages > 1 && (
+ <div className="flex items-center justify-center gap-2 py-4 border-t border-border">
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={txPage <= 1}
+ onClick={() => setTxPage(txPage - 1)}
+ >
+ {t('dashboard.previous')}
+ </Button>
+ <span className="text-sm text-muted-foreground">
+ {txPage} / {txTotalPages}
+ </span>
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={txPage >= txTotalPages}
+ onClick={() => setTxPage(txPage + 1)}
+ >
+ {t('dashboard.next')}
+ </Button>
+ </div>
+ )}
+ </>
+ ) : (
+ <p className="text-muted-foreground text-sm text-center py-8">{t('dashboard.noTransactions')}</p>
+ )}
+ </div>
+ </div>
+
+ <TransactionDrillDown
+ filter={drillDown}
+ onClose={() => setDrillDown(null)}
+ onTransactionClick={(tx) => { setEditingTx(tx); setDialogOpen(true) }}
+ />
+
+ <TransactionDialog
+ open={dialogOpen}
+ onClose={() => { setDialogOpen(false); setEditingTx(null) }}
+ transaction={editingTx}
+ categories={(categoriesList ?? []).map((c: { id: string; name: string; icon: string }) => ({ id: c.id, name: c.name, icon: c.icon }))}
+ accounts={(accountsList ?? []).map((a: { id: string; name: string }) => ({ id: a.id, name: a.name }))}
+ onSave={(data) => {
+ if (editingTx) updateMutation.mutate({ id: editingTx.id, ...data })
+ }}
+ onDelete={() => {
+ if (editingTx) deleteMutation.mutate(editingTx.id)
+ }}
+ loading={updateMutation.isPending || deleteMutation.isPending}
+ error={updateMutation.error ? extractApiError(updateMutation.error) : deleteMutation.error ? extractApiError(deleteMutation.error) : null}
+ isSynced={!!editingTx?.external_id}
+ />
+ </div>
+ )
+}
diff --git a/frontend/src/pages/import.tsx b/frontend/src/pages/import.tsx
new file mode 100644
index 00000000..c767fa4c
--- /dev/null
+++ b/frontend/src/pages/import.tsx
@@ -0,0 +1,501 @@
+import { useState, useRef, useCallback } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { transactions as transactionsApi, accounts as accountsApi, importLogs as importLogsApi } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import { Label } from '@/components/ui/label'
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/ui/table'
+import type { Transaction, ImportLog } from '@/types'
+import { Upload, FileText, X, CheckCircle2, AlertCircle, History, Trash2, Settings2 } from 'lucide-react'
+import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '@/components/ui/dialog'
+import { PageHeader } from '@/components/page-header'
+import { useAuth } from '@/contexts/auth-context'
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+export default function ImportPage() {
+ const { t, i18n } = useTranslation()
+ const { user } = useAuth()
+ const userCurrency = user?.preferences?.currency_display ?? 'BRL'
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const queryClient = useQueryClient()
+ const fileInputRef = useRef<HTMLInputElement>(null)
+ const [previewData, setPreviewData] = useState<{ transactions: Transaction[]; detected_format: string } | null>(null)
+ const [selectedAccount, setSelectedAccount] = useState('')
+ const [dragOver, setDragOver] = useState(false)
+ const [fileName, setFileName] = useState<string | null>(null)
+ const [currentFile, setCurrentFile] = useState<File | null>(null)
+ const [deleteTarget, setDeleteTarget] = useState<ImportLog | null>(null)
+ const [csvHeaders, setCsvHeaders] = useState<string[]>([])
+
+ // CSV options
+ const [csvDateFormat, setCsvDateFormat] = useState('')
+ const [csvFlipAmount, setCsvFlipAmount] = useState(false)
+ const [csvSplitColumns, setCsvSplitColumns] = useState(false)
+ const [csvInflowColumn, setCsvInflowColumn] = useState('')
+ const [csvOutflowColumn, setCsvOutflowColumn] = useState('')
+
+ const { data: accountsList } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accountsApi.list(),
+ })
+
+ const { data: importHistory = [] } = useQuery({
+ queryKey: ['import-logs'],
+ queryFn: importLogsApi.list,
+ })
+
+ const previewMutation = useMutation({
+ mutationFn: ({ file, options }: { file: File; options?: { date_format?: string; flip_amount?: boolean; inflow_column?: string; outflow_column?: string } }) =>
+ transactionsApi.previewImport(file, options),
+ onSuccess: (data) => setPreviewData(data),
+ onError: () => toast.error(t('import.processError')),
+ })
+
+ const importMutation = useMutation({
+ mutationFn: () => transactionsApi.import(selectedAccount, previewData!.transactions, fileName ?? '', previewData!.detected_format),
+ onSuccess: (data) => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['accounts'] })
+ queryClient.invalidateQueries({ queryKey: ['import-logs'] })
+ const msg = data.skipped > 0
+ ? t('import.importedWithSkipped', { imported: data.imported, skipped: data.skipped })
+ : `${data.imported} ${t('import.transactionsImported')}`
+ toast.success(msg)
+ setPreviewData(null)
+ setSelectedAccount('')
+ setFileName(null)
+ setCurrentFile(null)
+ resetCsvOptions()
+ if (fileInputRef.current) fileInputRef.current.value = ''
+ },
+ onError: () => toast.error(t('import.importError')),
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => importLogsApi.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['import-logs'] })
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ setDeleteTarget(null)
+ },
+ })
+
+ function resetCsvOptions() {
+ setCsvDateFormat('')
+ setCsvFlipAmount(false)
+ setCsvSplitColumns(false)
+ setCsvInflowColumn('')
+ setCsvOutflowColumn('')
+ setCsvHeaders([])
+ }
+
+ function processFile(file: File) {
+ setFileName(file.name)
+ setCurrentFile(file)
+ resetCsvOptions()
+
+ // Extract CSV headers for column mapping
+ if (file.name.toLowerCase().endsWith('.csv')) {
+ const reader = new FileReader()
+ reader.onload = (e) => {
+ const text = e.target?.result as string
+ const firstLine = text.split('\n')[0]
+ if (firstLine) {
+ setCsvHeaders(firstLine.split(',').map(h => h.trim()))
+ }
+ }
+ reader.readAsText(file)
+ }
+
+ previewMutation.mutate({ file })
+ }
+
+ const rePreview = useCallback(() => {
+ if (!currentFile) return
+ const options: { date_format?: string; flip_amount?: boolean; inflow_column?: string; outflow_column?: string } = {}
+ if (csvDateFormat) options.date_format = csvDateFormat
+ if (csvFlipAmount) options.flip_amount = true
+ if (csvSplitColumns && csvInflowColumn && csvOutflowColumn) {
+ options.inflow_column = csvInflowColumn
+ options.outflow_column = csvOutflowColumn
+ }
+ previewMutation.mutate({ file: currentFile, options })
+ }, [currentFile, csvDateFormat, csvFlipAmount, csvSplitColumns, csvInflowColumn, csvOutflowColumn])
+
+ const handleFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+ const file = e.target.files?.[0]
+ if (file) processFile(file)
+ }
+
+ const handleDrop = (e: React.DragEvent) => {
+ e.preventDefault()
+ setDragOver(false)
+ const file = e.dataTransfer.files?.[0]
+ if (file) processFile(file)
+ }
+
+ const handleReset = () => {
+ setPreviewData(null)
+ setFileName(null)
+ setCurrentFile(null)
+ setSelectedAccount('')
+ resetCsvOptions()
+ if (fileInputRef.current) fileInputRef.current.value = ''
+ }
+
+ const isCsvFile = fileName?.toLowerCase().endsWith('.csv') ?? false
+
+ const incomeCount = previewData?.transactions.filter(t => t.type === 'credit').length ?? 0
+ const expenseCount = previewData?.transactions.filter(t => t.type === 'debit').length ?? 0
+
+ return (
+ <div className="space-y-6">
+ {/* Page header */}
+ <PageHeader section={t('import.title')} title={t('import.subtitle')} />
+
+ {/* Upload zone */}
+ <div
+ className={`bg-card rounded-xl border-2 border-dashed transition-all cursor-pointer ${
+ dragOver ? 'border-primary bg-primary/5' : 'border-border hover:border-border'
+ }`}
+ onDragOver={(e) => { e.preventDefault(); setDragOver(true) }}
+ onDragLeave={() => setDragOver(false)}
+ onDrop={handleDrop}
+ onClick={() => !previewMutation.isPending && fileInputRef.current?.click()}
+ >
+ <input
+ ref={fileInputRef}
+ type="file"
+ accept=".ofx,.qfx,.csv,.qif,.xml,.camt"
+ onChange={handleFileChange}
+ className="hidden"
+ />
+
+ <div className="flex flex-col items-center justify-center py-12 px-6 text-center">
+ {previewMutation.isPending ? (
+ <>
+ <div className="w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mb-4 animate-pulse">
+ <FileText size={22} className="text-primary" />
+ </div>
+ <p className="text-sm font-semibold text-foreground">{t('import.processing')}</p>
+ <p className="text-xs text-muted-foreground mt-1">{fileName}</p>
+ </>
+ ) : fileName && previewData ? (
+ <>
+ <div className="w-12 h-12 rounded-full bg-emerald-100 flex items-center justify-center mb-4">
+ <CheckCircle2 size={22} className="text-emerald-500" />
+ </div>
+ <p className="text-sm font-semibold text-foreground">{fileName}</p>
+ <p className="text-xs text-muted-foreground mt-1">
+ {t('import.previewInfo', { count: previewData.transactions.length, format: previewData.detected_format.toUpperCase() })}
+ </p>
+ <button
+ className="mt-3 text-xs text-muted-foreground hover:text-rose-500 transition-colors flex items-center gap-1"
+ onClick={(e) => { e.stopPropagation(); handleReset() }}
+ >
+ <X size={12} /> {t('import.removeFile')}
+ </button>
+ </>
+ ) : (
+ <>
+ <div className="w-12 h-12 rounded-full bg-muted flex items-center justify-center mb-4">
+ <Upload size={22} className="text-muted-foreground" />
+ </div>
+ <p className="text-sm font-semibold text-foreground mb-1">
+ {t('import.dragOrClick')}
+ </p>
+ <p className="text-xs text-muted-foreground">{t('import.acceptedFormats')}</p>
+ </>
+ )}
+ </div>
+ </div>
+
+ {/* Preview section */}
+ {previewData && (
+ <div className="bg-card rounded-xl border border-border shadow-sm">
+ {/* Header */}
+ <div className="px-5 py-4 border-b border-border">
+ <div className="flex items-center justify-between">
+ <p className="text-sm font-semibold text-foreground">{t('import.preview')}</p>
+ <div className="flex items-center gap-3 text-xs text-muted-foreground">
+ <span className="flex items-center gap-1 text-emerald-600">
+ <span className="w-1.5 h-1.5 rounded-full bg-emerald-500 inline-block" />
+ {t('import.incomeCount', { count: incomeCount })}
+ </span>
+ <span className="flex items-center gap-1 text-rose-500">
+ <span className="w-1.5 h-1.5 rounded-full bg-rose-500 inline-block" />
+ {t('import.expenseCount', { count: expenseCount })}
+ </span>
+ </div>
+ </div>
+ </div>
+
+ {/* Account picker */}
+ <div className="px-4 sm:px-5 py-4 border-b border-border bg-muted/50">
+ <div className="flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4">
+ <Label className="text-sm text-muted-foreground whitespace-nowrap shrink-0">
+ {t('import.importTo')}
+ </Label>
+ <select
+ className="flex-1 border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={selectedAccount}
+ onChange={(e) => setSelectedAccount(e.target.value)}
+ >
+ <option value="">{t('import.selectAccount')}</option>
+ {accountsList?.map((acc) => (
+ <option key={acc.id} value={acc.id}>{acc.name}</option>
+ ))}
+ </select>
+ {!selectedAccount && (
+ <div className="flex items-center gap-1.5 text-xs text-amber-600 bg-amber-50 border border-amber-100 px-2.5 py-1.5 rounded-lg shrink-0">
+ <AlertCircle size={12} />
+ {t('import.selectAccountWarning')}
+ </div>
+ )}
+ </div>
+ </div>
+
+ {/* CSV Options */}
+ {isCsvFile && previewData && (
+ <div className="px-5 py-4 border-b border-border bg-muted/30">
+ <div className="flex items-center gap-2 mb-3">
+ <Settings2 size={14} className="text-muted-foreground" />
+ <p className="text-xs font-medium text-muted-foreground">{t('import.csvOptions')}</p>
+ </div>
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
+ {/* Date format */}
+ <div>
+ <Label className="text-xs text-muted-foreground mb-1 block">{t('import.dateFormat')}</Label>
+ <select
+ className="w-full border border-border rounded-lg px-3 py-1.5 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={csvDateFormat}
+ onChange={(e) => { setCsvDateFormat(e.target.value); setTimeout(rePreview, 0) }}
+ >
+ <option value="">{t('import.dateFormatAuto')}</option>
+ <option value="DD/MM/YYYY">DD/MM/YYYY</option>
+ <option value="MM/DD/YYYY">MM/DD/YYYY</option>
+ <option value="YYYY-MM-DD">YYYY-MM-DD</option>
+ </select>
+ </div>
+
+ {/* Flip amounts */}
+ <div className="flex items-center gap-2 pt-4">
+ <input
+ type="checkbox"
+ id="flip-amount"
+ checked={csvFlipAmount}
+ onChange={(e) => { setCsvFlipAmount(e.target.checked); setTimeout(rePreview, 0) }}
+ className="rounded border-border text-primary focus:ring-primary"
+ />
+ <Label htmlFor="flip-amount" className="text-sm text-muted-foreground cursor-pointer">
+ {t('import.flipAmounts')}
+ </Label>
+ </div>
+
+ {/* Split columns toggle */}
+ <div className="flex items-center gap-2 pt-4">
+ <input
+ type="checkbox"
+ id="split-columns"
+ checked={csvSplitColumns}
+ onChange={(e) => setCsvSplitColumns(e.target.checked)}
+ className="rounded border-border text-primary focus:ring-primary"
+ />
+ <Label htmlFor="split-columns" className="text-sm text-muted-foreground cursor-pointer">
+ {t('import.splitColumns')}
+ </Label>
+ </div>
+ </div>
+
+ {/* Split column selectors */}
+ {csvSplitColumns && csvHeaders.length > 0 && (
+ <div className="grid grid-cols-2 gap-4 mt-3">
+ <div>
+ <Label className="text-xs text-muted-foreground mb-1 block">{t('import.inflowColumn')}</Label>
+ <select
+ className="w-full border border-border rounded-lg px-3 py-1.5 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={csvInflowColumn}
+ onChange={(e) => { setCsvInflowColumn(e.target.value); setTimeout(rePreview, 0) }}
+ >
+ <option value="">{t('import.selectColumn')}</option>
+ {csvHeaders.map(h => <option key={h} value={h}>{h}</option>)}
+ </select>
+ </div>
+ <div>
+ <Label className="text-xs text-muted-foreground mb-1 block">{t('import.outflowColumn')}</Label>
+ <select
+ className="w-full border border-border rounded-lg px-3 py-1.5 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary"
+ value={csvOutflowColumn}
+ onChange={(e) => { setCsvOutflowColumn(e.target.value); setTimeout(rePreview, 0) }}
+ >
+ <option value="">{t('import.selectColumn')}</option>
+ {csvHeaders.map(h => <option key={h} value={h}>{h}</option>)}
+ </select>
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+
+ {/* Table */}
+ <div className="max-h-96 overflow-auto">
+ <Table>
+ <TableHeader>
+ <TableRow className="hover:bg-transparent bg-transparent border-b border-border">
+ <TableHead className="text-xs font-medium text-muted-foreground py-3 pl-5 w-[110px]">
+ {t('transactions.date')}
+ </TableHead>
+ <TableHead className="text-xs font-medium text-muted-foreground py-3">
+ {t('transactions.description')}
+ </TableHead>
+ <TableHead className="text-xs font-medium text-muted-foreground py-3 pr-5 text-right w-[160px]">
+ {t('transactions.amount')}
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {previewData.transactions.slice(0, 50).map((tx, i) => (
+ <TableRow key={i} className="border-b border-border last:border-0 hover:bg-muted">
+ <TableCell className="py-3 pl-5 text-xs text-muted-foreground whitespace-nowrap">
+ {new Date(tx.date).toLocaleDateString(locale)}
+ </TableCell>
+ <TableCell className="py-3 text-sm text-foreground">{tx.description}</TableCell>
+ <TableCell className={`py-3 pr-5 text-right text-sm font-bold tabular-nums ${tx.type === 'credit' ? 'text-emerald-600' : 'text-rose-500'}`}>
+ {tx.type === 'credit' ? '+' : '−'}{formatCurrency(Math.abs(Number(tx.amount)), userCurrency, locale)}
+ </TableCell>
+ </TableRow>
+ ))}
+ </TableBody>
+ </Table>
+ {previewData.transactions.length > 50 && (
+ <p className="text-xs text-muted-foreground text-center py-3 border-t border-border">
+ {t('import.showingPreview', { shown: 50, total: previewData.transactions.length })}
+ </p>
+ )}
+ </div>
+
+ {/* Footer actions */}
+ <div className="px-4 sm:px-5 py-4 border-t border-border flex items-center justify-between">
+ <button
+ className="text-sm text-muted-foreground hover:text-foreground transition-colors"
+ onClick={handleReset}
+ >
+ {t('common.cancel')}
+ </button>
+ <Button
+ onClick={() => importMutation.mutate()}
+ disabled={!selectedAccount || importMutation.isPending}
+ className="gap-2"
+ >
+ <Upload size={14} />
+ {importMutation.isPending
+ ? t('common.loading')
+ : t('import.importButton', { count: previewData.transactions.length })}
+ </Button>
+ </div>
+ </div>
+ )}
+
+ {/* Import History */}
+ <div className="mt-8">
+ <div className="flex items-center gap-2 mb-4">
+ <History className="w-5 h-5 text-muted-foreground" />
+ <h2 className="text-lg font-semibold text-foreground">{t('import.history')}</h2>
+ </div>
+
+ {importHistory.length === 0 ? (
+ <div className="bg-card rounded-xl border border-border p-8 text-center text-muted-foreground">
+ {t('import.noHistory')}
+ </div>
+ ) : (
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ <table className="w-full text-sm">
+ <thead>
+ <tr className="border-b border-border">
+ <th className="text-left px-3 sm:px-4 py-3 font-medium text-muted-foreground">{t('import.historyDate')}</th>
+ <th className="text-left px-3 sm:px-4 py-3 font-medium text-muted-foreground">{t('import.historyFile')}</th>
+ <th className="text-left px-4 py-3 font-medium text-muted-foreground hidden lg:table-cell">{t('import.historyFormat')}</th>
+ <th className="text-left px-4 py-3 font-medium text-muted-foreground hidden md:table-cell">{t('import.historyAccount')}</th>
+ <th className="text-right px-3 sm:px-4 py-3 font-medium text-muted-foreground">{t('import.historyCount')}</th>
+ <th className="text-right px-4 py-3 font-medium text-muted-foreground hidden sm:table-cell">{t('import.historyCredit')}</th>
+ <th className="text-right px-4 py-3 font-medium text-muted-foreground hidden sm:table-cell">{t('import.historyDebit')}</th>
+ <th className="px-3 sm:px-4 py-3"></th>
+ </tr>
+ </thead>
+ <tbody className="divide-y divide-border">
+ {importHistory.map((log) => (
+ <tr key={log.id} className="hover:bg-muted">
+ <td className="px-3 sm:px-4 py-3 text-xs sm:text-sm text-muted-foreground whitespace-nowrap">
+ {new Date(log.created_at).toLocaleString(locale, { dateStyle: 'short', timeStyle: 'short' })}
+ </td>
+ <td className="px-3 sm:px-4 py-3 font-mono text-xs text-foreground max-w-[120px] sm:max-w-none truncate">{log.filename || '—'}</td>
+ <td className="px-4 py-3 hidden lg:table-cell">
+ <span className="bg-muted text-muted-foreground text-xs px-2 py-0.5 rounded font-mono uppercase">
+ {log.format || '—'}
+ </span>
+ </td>
+ <td className="px-4 py-3 text-muted-foreground hidden md:table-cell">{log.account_name || '—'}</td>
+ <td className="px-3 sm:px-4 py-3 text-right text-foreground">{log.transaction_count}</td>
+ <td className="px-4 py-3 text-right text-emerald-600 font-medium hidden sm:table-cell">
+ {formatCurrency(log.total_credit, userCurrency, locale)}
+ </td>
+ <td className="px-4 py-3 text-right text-rose-600 font-medium hidden sm:table-cell">
+ {formatCurrency(log.total_debit, userCurrency, locale)}
+ </td>
+ <td className="px-3 sm:px-4 py-3 text-right">
+ <button
+ onClick={() => setDeleteTarget(log)}
+ className="text-muted-foreground hover:text-rose-500 transition-colors"
+ title={t('import.undoImport')}
+ >
+ <Trash2 className="w-4 h-4" />
+ </button>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ )}
+ </div>
+
+ {/* Delete confirmation dialog */}
+ <Dialog open={!!deleteTarget} onOpenChange={(open) => !open && setDeleteTarget(null)}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{t('import.undoImport')}</DialogTitle>
+ <DialogDescription>
+ {t('import.undoDescription', { count: deleteTarget?.transaction_count, filename: deleteTarget?.filename || '—' })}
+ </DialogDescription>
+ </DialogHeader>
+ <DialogFooter>
+ <button
+ onClick={() => setDeleteTarget(null)}
+ className="px-4 py-2 text-sm text-muted-foreground hover:text-foreground"
+ >
+ {t('common.cancel')}
+ </button>
+ <button
+ onClick={() => deleteTarget && deleteMutation.mutate(deleteTarget.id)}
+ disabled={deleteMutation.isPending}
+ className="px-4 py-2 text-sm bg-rose-500 text-white rounded-lg hover:bg-rose-600 disabled:opacity-50"
+ >
+ {deleteMutation.isPending ? t('import.deleting') : t('import.deleteAll')}
+ </button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/login.tsx b/frontend/src/pages/login.tsx
new file mode 100644
index 00000000..d012b1b4
--- /dev/null
+++ b/frontend/src/pages/login.tsx
@@ -0,0 +1,106 @@
+import { useState, useEffect } from 'react'
+import { Link, useNavigate } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { useAuth } from '@/contexts/auth-context'
+import { setup } from '@/lib/api'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
+import { ShellLogo } from '@/components/shell-logo'
+
+export default function LoginPage() {
+ const { t } = useTranslation()
+ const { login, token } = useAuth()
+ const navigate = useNavigate()
+ const [email, setEmail] = useState('')
+ const [password, setPassword] = useState('')
+ const [error, setError] = useState('')
+ const [isLoading, setIsLoading] = useState(false)
+
+ useEffect(() => {
+ if (token) {
+ navigate('/', { replace: true })
+ return
+ }
+ setup.status().then(({ has_users }) => {
+ if (!has_users) {
+ navigate('/setup', { replace: true })
+ }
+ }).catch(() => {})
+ }, [navigate, token])
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault()
+ setError('')
+ setIsLoading(true)
+ try {
+ await login(email, password)
+ navigate('/')
+ } catch {
+ setError(t('auth.invalidCredentials'))
+ } finally {
+ setIsLoading(false)
+ }
+ }
+
+ return (
+ <div className="flex flex-col items-center justify-center min-h-screen bg-gradient-to-br from-background via-background to-primary/5 px-4">
+ <div className="flex items-center gap-3 mb-10">
+ <div className="w-12 h-12 rounded-2xl bg-primary/10 flex items-center justify-center">
+ <ShellLogo size={24} className="text-primary" />
+ </div>
+ <span className="text-2xl font-bold tracking-tight text-foreground">{t('app.name')}</span>
+ </div>
+ <Card className="w-full max-w-[400px] shadow-lg border-border/60">
+ <form onSubmit={handleSubmit}>
+ <CardHeader className="text-center pb-2 pt-8 px-8">
+ <CardTitle className="text-2xl font-bold tracking-tight">{t('auth.login')}</CardTitle>
+ <CardDescription className="text-[13px] mt-1">{t('auth.loginDescription')}</CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-5 px-8 pt-4">
+ {error && (
+ <div className="p-3 text-sm text-destructive bg-destructive/10 rounded-lg">
+ {error}
+ </div>
+ )}
+ <div className="space-y-1.5">
+ <Label htmlFor="email" className="text-[13px] font-medium">{t('auth.email')}</Label>
+ <Input
+ id="email"
+ type="email"
+ value={email}
+ onChange={(e) => setEmail(e.target.value)}
+ className="h-11 rounded-lg text-sm"
+ placeholder="[email protected]"
+ required
+ />
+ </div>
+ <div className="space-y-1.5">
+ <Label htmlFor="password" className="text-[13px] font-medium">{t('auth.password')}</Label>
+ <Input
+ id="password"
+ type="password"
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ className="h-11 rounded-lg text-sm"
+ required
+ />
+ </div>
+ </CardContent>
+ <CardFooter className="flex flex-col gap-4 px-8 pb-8 pt-2">
+ <Button type="submit" className="w-full h-11 rounded-lg text-sm font-semibold" disabled={isLoading}>
+ {isLoading ? t('common.loading') : t('auth.login')}
+ </Button>
+ <p className="text-[13px] text-muted-foreground">
+ {t('auth.noAccount')}{' '}
+ <Link to="/register" className="text-primary font-medium hover:underline">
+ {t('auth.register')}
+ </Link>
+ </p>
+ </CardFooter>
+ </form>
+ </Card>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/recurring.tsx b/frontend/src/pages/recurring.tsx
new file mode 100644
index 00000000..453a0643
--- /dev/null
+++ b/frontend/src/pages/recurring.tsx
@@ -0,0 +1,375 @@
+import React, { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { categories as categoriesApi, recurring as recurringApi, accounts as accountsApi } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import type { Category, RecurringTransaction } from '@/types'
+import { Pencil, Trash2, Plus, RefreshCw } from 'lucide-react'
+import { cn } from '@/lib/utils'
+import { PageHeader } from '@/components/page-header'
+import { DatePickerInput } from '@/components/ui/date-picker-input'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+const TH = 'text-xs font-medium text-muted-foreground py-3'
+
+function SectionCard({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ {children}
+ </div>
+ )
+}
+
+function SectionHeader({ title, action }: { title: string; action?: React.ReactNode }) {
+ return (
+ <div className="px-4 sm:px-5 py-4 border-b border-border flex flex-wrap items-center justify-between gap-2">
+ <p className="text-sm font-semibold text-foreground">{title}</p>
+ {action}
+ </div>
+ )
+}
+
+export default function RecurringPage() {
+ const { t } = useTranslation()
+
+ return (
+ <div>
+ <PageHeader section={t('recurring.title')} title={t('recurring.title')} />
+ <RecurringTab />
+ </div>
+ )
+}
+
+function RecurringTab() {
+ const { t, i18n } = useTranslation()
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const { mask } = usePrivacyMode()
+ const queryClient = useQueryClient()
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const [editing, setEditing] = useState<RecurringTransaction | null>(null)
+
+ const { data: recurringList } = useQuery({
+ queryKey: ['recurring'],
+ queryFn: recurringApi.list,
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const { data: accountsList } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accountsApi.list(),
+ })
+
+ const createMutation = useMutation({
+ mutationFn: (data: Partial<RecurringTransaction>) => recurringApi.create(data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['recurring'] })
+ setDialogOpen(false)
+ toast.success(t('recurring.created'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<RecurringTransaction> & { id: string }) =>
+ recurringApi.update(id, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['recurring'] })
+ setDialogOpen(false)
+ setEditing(null)
+ toast.success(t('recurring.updated'))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => recurringApi.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['recurring'] })
+ toast.success(t('recurring.deleted'))
+ },
+ })
+
+ const generateMutation = useMutation({
+ mutationFn: () => recurringApi.generate(),
+ onSuccess: (data) => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ toast.success(t('recurring.generated', { count: data.generated }))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const frequencyLabel = (f: string) => {
+ const map: Record<string, string> = { monthly: t('recurring.monthly'), weekly: t('recurring.weekly'), yearly: t('recurring.yearly') }
+ return map[f] ?? f
+ }
+
+ return (
+ <>
+ <SectionCard>
+ <SectionHeader
+ title={t('recurring.title')}
+ action={
+ <div className="flex gap-2">
+ <Button
+ variant="outline"
+ size="sm"
+ className="gap-1.5 h-8"
+ onClick={() => generateMutation.mutate()}
+ disabled={generateMutation.isPending}
+ >
+ <RefreshCw size={12} />
+ <span className="hidden sm:inline">{t('recurring.generatePending')}</span>
+ </Button>
+ <Button size="sm" className="gap-1.5 h-8" onClick={() => { setEditing(null); setDialogOpen(true) }}>
+ <Plus size={13} /> <span className="hidden sm:inline">{t('recurring.add')}</span>
+ </Button>
+ </div>
+ }
+ />
+ {recurringList && recurringList.length > 0 ? (
+ <table className="w-full">
+ <thead>
+ <tr className="border-b border-border">
+ <th className={`${TH} pl-4 sm:pl-5 text-left`}>{t('recurring.description')}</th>
+ <th className={`${TH} text-left w-36`}>{t('recurring.amount')}</th>
+ <th className={`${TH} text-left w-28 hidden md:table-cell`}>{t('recurring.frequency')}</th>
+ <th className={`${TH} text-left w-32 hidden md:table-cell`}>{t('recurring.nextOccurrence')}</th>
+ <th className={`${TH} text-left w-24 hidden sm:table-cell`}>{t('recurring.status')}</th>
+ <th className={`${TH} pr-4 sm:pr-5 text-right w-24`}>{t('recurring.actions')}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {recurringList.map((rt) => (
+ <tr key={rt.id} className="border-b border-border last:border-0 hover:bg-muted transition-colors">
+ <td className="py-3 pl-4 sm:pl-5 text-sm font-medium text-foreground">{rt.description}</td>
+ <td className={`py-3 text-xs sm:text-sm font-bold tabular-nums ${rt.type === 'credit' ? 'text-emerald-600' : 'text-rose-500'}`}>
+ {mask(`${rt.type === 'credit' ? '+' : '−'}${formatCurrency(rt.amount, rt.currency, locale)}`)}
+ </td>
+ <td className="py-3 hidden md:table-cell">
+ <span className="text-xs bg-muted text-muted-foreground px-2 py-0.5 rounded-full font-medium">
+ {frequencyLabel(rt.frequency)}
+ </span>
+ </td>
+ <td className="py-3 text-xs text-muted-foreground tabular-nums hidden md:table-cell">
+ {new Date(rt.next_occurrence + 'T00:00:00').toLocaleDateString(locale)}
+ </td>
+ <td className="py-3 hidden sm:table-cell">
+ <span className={cn(
+ 'text-[11px] font-semibold px-2 py-0.5 rounded-full border',
+ rt.is_active
+ ? 'bg-emerald-50 text-emerald-600 border-emerald-100'
+ : 'bg-muted text-muted-foreground border-border'
+ )}>
+ {rt.is_active ? t('recurring.active') : t('recurring.inactive')}
+ </span>
+ </td>
+ <td className="py-3 pr-4 sm:pr-5">
+ <div className="flex items-center justify-end gap-1">
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-primary hover:bg-primary/5 transition-colors"
+ onClick={() => { setEditing(rt); setDialogOpen(true) }}
+ >
+ <Pencil size={13} />
+ </button>
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-rose-500 hover:bg-rose-50 transition-colors"
+ onClick={() => deleteMutation.mutate(rt.id)}
+ disabled={deleteMutation.isPending}
+ >
+ <Trash2 size={13} />
+ </button>
+ </div>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ ) : (
+ <p className="text-sm text-muted-foreground text-center py-10">{t('recurring.empty')}</p>
+ )}
+ </SectionCard>
+
+ <Dialog open={dialogOpen} onOpenChange={() => { setDialogOpen(false); setEditing(null) }}>
+ <DialogContent>
+ <DialogHeader>
+ <DialogTitle>{editing ? t('recurring.edit') : t('recurring.add')}</DialogTitle>
+ </DialogHeader>
+ <RecurringForm
+ key={editing?.id ?? 'new'}
+ recurring={editing}
+ categories={categoriesList ?? []}
+ accounts={accountsList ?? []}
+ onSave={(data) => {
+ if (editing) {
+ updateMutation.mutate({ id: editing.id, ...data })
+ } else {
+ createMutation.mutate(data)
+ }
+ }}
+ onCancel={() => { setDialogOpen(false); setEditing(null) }}
+ loading={createMutation.isPending || updateMutation.isPending}
+ />
+ </DialogContent>
+ </Dialog>
+ </>
+ )
+}
+
+function RecurringForm({
+ recurring,
+ categories,
+ accounts,
+ onSave,
+ onCancel,
+ loading,
+}: {
+ recurring: RecurringTransaction | null
+ categories: Category[]
+ accounts: { id: string; name: string }[]
+ onSave: (data: Partial<RecurringTransaction>) => void
+ onCancel: () => void
+ loading: boolean
+}) {
+ const { t } = useTranslation()
+ const [description, setDescription] = useState(recurring?.description ?? '')
+ const [amount, setAmount] = useState(recurring?.amount?.toString() ?? '')
+ const [currency, setCurrency] = useState(recurring?.currency ?? 'BRL')
+ const [type, setType] = useState<'debit' | 'credit'>(recurring?.type ?? 'debit')
+ const [frequency, setFrequency] = useState(recurring?.frequency ?? 'monthly')
+ const [dayOfMonth, setDayOfMonth] = useState(recurring?.day_of_month?.toString() ?? '')
+ const [startDate, setStartDate] = useState(recurring?.start_date ?? new Date().toISOString().split('T')[0])
+ const [endDate, setEndDate] = useState(recurring?.end_date ?? '')
+ const [categoryId, setCategoryId] = useState(recurring?.category_id ?? '')
+ const [accountId, setAccountId] = useState(recurring?.account_id ?? '')
+ const [isActive, setIsActive] = useState(recurring?.is_active ?? true)
+
+ const selectClass = 'w-full border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary'
+
+ return (
+ <form
+ onSubmit={(e) => {
+ e.preventDefault()
+ onSave({
+ description,
+ amount: parseFloat(amount),
+ currency,
+ type,
+ frequency,
+ day_of_month: dayOfMonth ? parseInt(dayOfMonth) : null,
+ start_date: startDate,
+ end_date: endDate || null,
+ category_id: categoryId || null,
+ account_id: accountId || null,
+ is_active: isActive,
+ } as Partial<RecurringTransaction>)
+ }}
+ className="space-y-4"
+ >
+ <div className="space-y-2">
+ <Label>{t('recurring.description')}</Label>
+ <Input value={description} onChange={(e) => setDescription(e.target.value)} required />
+ </div>
+ <div className="grid grid-cols-3 gap-4">
+ <div className="space-y-2">
+ <Label>{t('recurring.amount')}</Label>
+ <Input type="number" step="0.01" value={amount} onChange={(e) => setAmount(e.target.value)} required />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('recurring.currency')}</Label>
+ <select className={selectClass} value={currency} onChange={(e) => setCurrency(e.target.value)}>
+ <option value="BRL">BRL (R$)</option>
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('recurring.type')}</Label>
+ <select className={selectClass} value={type} onChange={(e) => setType(e.target.value as 'debit' | 'credit')}>
+ <option value="debit">{t('recurring.expense')}</option>
+ <option value="credit">{t('recurring.income')}</option>
+ </select>
+ </div>
+ </div>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label>{t('recurring.frequency')}</Label>
+ <select className={selectClass} value={frequency} onChange={(e) => setFrequency(e.target.value as 'monthly' | 'weekly' | 'yearly')}>
+ <option value="monthly">{t('recurring.monthly')}</option>
+ <option value="weekly">{t('recurring.weekly')}</option>
+ <option value="yearly">{t('recurring.yearly')}</option>
+ </select>
+ </div>
+ {frequency === 'monthly' && (
+ <div className="space-y-2">
+ <Label>{t('recurring.dayOfMonth')}</Label>
+ <Input type="number" min="1" max="31" value={dayOfMonth} onChange={(e) => setDayOfMonth(e.target.value)} />
+ </div>
+ )}
+ </div>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label>{t('recurring.startDate')}</Label>
+ <DatePickerInput value={startDate} onChange={setStartDate} className="w-full justify-start" />
+ </div>
+ <div className="space-y-2">
+ <Label>{t('recurring.endDate')}</Label>
+ <DatePickerInput value={endDate} onChange={setEndDate} placeholder={t('recurring.endDate')} className="w-full justify-start" />
+ </div>
+ </div>
+ <div className="grid grid-cols-2 gap-4">
+ <div className="space-y-2">
+ <Label>{t('recurring.category')}</Label>
+ <select className={selectClass} value={categoryId} onChange={(e) => setCategoryId(e.target.value)}>
+ <option value="">{t('transactions.noCategory')}</option>
+ {categories.map((cat) => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </select>
+ </div>
+ <div className="space-y-2">
+ <Label>{t('recurring.account')}</Label>
+ <select className={selectClass} value={accountId} onChange={(e) => setAccountId(e.target.value)}>
+ <option value="">{t('recurring.noAccount')}</option>
+ {accounts.map((acc) => (
+ <option key={acc.id} value={acc.id}>{acc.name}</option>
+ ))}
+ </select>
+ </div>
+ </div>
+ {recurring && (
+ <label className="flex items-center gap-2 cursor-pointer">
+ <input
+ type="checkbox"
+ checked={isActive}
+ onChange={(e) => setIsActive(e.target.checked)}
+ className="h-4 w-4 rounded border-border"
+ />
+ <span className="text-sm text-foreground">{t('recurring.active')}</span>
+ </label>
+ )}
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={onCancel}>{t('common.cancel')}</Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? t('common.loading') : t('common.save')}
+ </Button>
+ </DialogFooter>
+ </form>
+ )
+}
diff --git a/frontend/src/pages/register.tsx b/frontend/src/pages/register.tsx
new file mode 100644
index 00000000..0133c832
--- /dev/null
+++ b/frontend/src/pages/register.tsx
@@ -0,0 +1,113 @@
+import { useState } from 'react'
+import { Link, useNavigate } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { useAuth } from '@/contexts/auth-context'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
+import { ShellLogo } from '@/components/shell-logo'
+
+export default function RegisterPage() {
+ const { t } = useTranslation()
+ const { register } = useAuth()
+ const navigate = useNavigate()
+ const [email, setEmail] = useState('')
+ const [password, setPassword] = useState('')
+ const [confirmPassword, setConfirmPassword] = useState('')
+ const [error, setError] = useState('')
+ const [isLoading, setIsLoading] = useState(false)
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault()
+ setError('')
+
+ if (password !== confirmPassword) {
+ setError('As senhas não conferem')
+ return
+ }
+
+ if (password.length < 8) {
+ setError('A senha deve ter pelo menos 8 caracteres')
+ return
+ }
+
+ setIsLoading(true)
+ try {
+ await register(email, password)
+ navigate('/')
+ } catch {
+ setError('Erro ao criar conta. Tente novamente.')
+ } finally {
+ setIsLoading(false)
+ }
+ }
+
+ return (
+ <div className="flex flex-col items-center justify-center min-h-screen bg-gradient-to-br from-background via-background to-primary/5">
+ <div className="flex items-center gap-2.5 mb-8">
+ <div className="w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center">
+ <ShellLogo size={20} className="text-primary" />
+ </div>
+ <span className="text-xl font-bold tracking-tight text-foreground">{t('app.name')}</span>
+ </div>
+ <Card className="w-full max-w-sm">
+ <CardHeader className="text-center">
+ <CardTitle className="text-xl font-semibold">{t('auth.register')}</CardTitle>
+ <CardDescription>{t('auth.register')}</CardDescription>
+ </CardHeader>
+ <form onSubmit={handleSubmit}>
+ <CardContent className="space-y-4">
+ {error && (
+ <div className="p-3 text-sm text-destructive bg-destructive/10 rounded-md">
+ {error}
+ </div>
+ )}
+ <div className="space-y-2">
+ <Label htmlFor="email">{t('auth.email')}</Label>
+ <Input
+ id="email"
+ type="email"
+ value={email}
+ onChange={(e) => setEmail(e.target.value)}
+ required
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="password">{t('auth.password')}</Label>
+ <Input
+ id="password"
+ type="password"
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ required
+ minLength={8}
+ />
+ </div>
+ <div className="space-y-2">
+ <Label htmlFor="confirmPassword">Confirmar senha</Label>
+ <Input
+ id="confirmPassword"
+ type="password"
+ value={confirmPassword}
+ onChange={(e) => setConfirmPassword(e.target.value)}
+ required
+ />
+ </div>
+ </CardContent>
+ <CardFooter className="flex flex-col gap-4">
+ <Button type="submit" className="w-full" disabled={isLoading}>
+ {isLoading ? t('common.loading') : t('auth.register')}
+ </Button>
+ <p className="text-sm text-muted-foreground">
+ {t('auth.hasAccount')}{' '}
+ <Link to="/login" className="text-primary hover:underline">
+ {t('auth.login')}
+ </Link>
+ </p>
+ </CardFooter>
+ </form>
+ </Card>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/rules.tsx b/frontend/src/pages/rules.tsx
new file mode 100644
index 00000000..e8cce094
--- /dev/null
+++ b/frontend/src/pages/rules.tsx
@@ -0,0 +1,583 @@
+import { useState } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { categories as categoriesApi, rules as rulesApi, accounts as accountsApi } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import {
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogFooter,
+} from '@/components/ui/dialog'
+import type { Category, Rule, RuleCondition, RuleAction } from '@/types'
+import { Trash2, Plus, RefreshCw, X, Package, Check } from 'lucide-react'
+import { cn } from '@/lib/utils'
+import { PageHeader } from '@/components/page-header'
+
+function SectionCard({ children }: { children: React.ReactNode }) {
+ return (
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden">
+ {children}
+ </div>
+ )
+}
+
+function SectionHeader({ title, action }: { title: string; action?: React.ReactNode }) {
+ return (
+ <div className="px-4 sm:px-5 py-4 border-b border-border flex flex-wrap items-center justify-between gap-2">
+ <p className="text-sm font-semibold text-foreground">{title}</p>
+ {action}
+ </div>
+ )
+}
+
+const CONDITION_FIELDS = [
+ { value: 'description', label: 'rules.fieldDescription' },
+ { value: 'notes', label: 'rules.fieldNotes' },
+ { value: 'amount', label: 'rules.fieldAmount' },
+ { value: 'type', label: 'rules.fieldType' },
+ { value: 'account_id', label: 'rules.fieldAccount' },
+ { value: 'date', label: 'rules.fieldDate' },
+] as const
+
+const STRING_OPS = [
+ { value: 'contains', label: 'rules.opContains' },
+ { value: 'not_contains', label: 'rules.opNotContains' },
+ { value: 'equals', label: 'rules.opEquals' },
+ { value: 'not_equals', label: 'rules.opNotEquals' },
+ { value: 'starts_with', label: 'rules.opStartsWith' },
+ { value: 'ends_with', label: 'rules.opEndsWith' },
+ { value: 'regex', label: 'rules.opRegex' },
+]
+
+const NUMERIC_OPS = [
+ { value: 'equals', label: '=' },
+ { value: 'gt', label: '>' },
+ { value: 'gte', label: '>=' },
+ { value: 'lt', label: '<' },
+ { value: 'lte', label: '<=' },
+]
+
+function getOpsForField(field: string) {
+ if (field === 'amount' || field === 'date') return NUMERIC_OPS
+ if (field === 'type') return [{ value: 'equals', label: 'rules.opIs' }]
+ return STRING_OPS
+}
+
+function conditionSummary(conditions: RuleCondition[], conditionsOp: string, t: (key: string) => string): string {
+ const fieldLabel = (f: string) => {
+ const key = CONDITION_FIELDS.find(x => x.value === f)?.label
+ return key ? t(key) : f
+ }
+ const opLabel = (f: string, op: string) => {
+ const key = getOpsForField(f).find(x => x.value === op)?.label
+ return key ? t(key) : op
+ }
+ const parts = conditions.map(c => `${fieldLabel(c.field)} ${opLabel(c.field, c.op)} "${c.value}"`)
+ return parts.join(` ${conditionsOp === 'or' ? t('rules.orOp') : t('rules.andOp')} `) || t('rules.noConditions')
+}
+
+function actionSummary(actions: RuleAction[], categories: Category[], t: (key: string) => string): string {
+ return actions.map(a => {
+ if (a.op === 'set_category') {
+ const cat = categories.find(c => c.id === a.value)
+ return cat ? `→ ${cat.name}` : `→ ${t('transactions.category')}`
+ }
+ if (a.op === 'append_notes') return `→ ${t('rules.fieldNotes')}: ${a.value}`
+ return a.op
+ }).join(' ') || t('rules.noActions')
+}
+
+export default function RulesPage() {
+ const { t } = useTranslation()
+ const queryClient = useQueryClient()
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const [packsDialogOpen, setPacksDialogOpen] = useState(false)
+ const [editing, setEditing] = useState<Rule | null>(null)
+
+ const { data: rulesList } = useQuery({
+ queryKey: ['rules'],
+ queryFn: rulesApi.list,
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const { data: accountsList } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accountsApi.list(),
+ })
+
+ const createMutation = useMutation({
+ mutationFn: (data: Omit<Rule, 'id' | 'user_id'>) => rulesApi.create(data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['rules'] })
+ queryClient.invalidateQueries({ queryKey: ['rule-packs'] })
+ setDialogOpen(false)
+ toast.success(t('rules.created'))
+ },
+ onError: (error: unknown) => {
+ const err = error as { response?: { status?: number } }
+ if (err?.response?.status === 409) {
+ toast.error(t('rules.duplicateName'))
+ } else {
+ toast.error(t('common.error'))
+ }
+ },
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<Rule> & { id: string }) => rulesApi.update(id, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['rules'] })
+ queryClient.invalidateQueries({ queryKey: ['rule-packs'] })
+ setDialogOpen(false)
+ setEditing(null)
+ toast.success(t('rules.updated'))
+ },
+ onError: (error: unknown) => {
+ const err = error as { response?: { status?: number } }
+ if (err?.response?.status === 409) {
+ toast.error(t('rules.duplicateName'))
+ } else {
+ toast.error(t('common.error'))
+ }
+ },
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => rulesApi.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['rules'] })
+ queryClient.invalidateQueries({ queryKey: ['rule-packs'] })
+ toast.success(t('rules.deleted'))
+ },
+ })
+
+ const applyAllMutation = useMutation({
+ mutationFn: () => rulesApi.applyAll(),
+ onSuccess: (data) => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ toast.success(t('rules.applied', { count: data.applied }))
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ const categories = categoriesList ?? []
+
+ return (
+ <div>
+ <PageHeader section={t('rules.section')} title={t('nav.rules')} />
+
+ <SectionCard>
+ <SectionHeader
+ title={t('rules.sectionTitle')}
+ action={
+ <div className="flex gap-2">
+ <Button
+ variant="outline"
+ size="sm"
+ className="gap-1.5 h-8"
+ onClick={() => setPacksDialogOpen(true)}
+ >
+ <Package size={12} />
+ <span className="hidden sm:inline">{t('rules.packs')}</span>
+ </Button>
+ <Button
+ variant="outline"
+ size="sm"
+ className="gap-1.5 h-8"
+ onClick={() => applyAllMutation.mutate()}
+ disabled={applyAllMutation.isPending}
+ >
+ <RefreshCw size={12} />
+ <span className="hidden sm:inline">{t('rules.reapplyAll')}</span>
+ </Button>
+ <Button size="sm" className="gap-1.5 h-8" onClick={() => { setEditing(null); setDialogOpen(true) }}>
+ <Plus size={13} /> <span className="hidden sm:inline">{t('rules.add')}</span>
+ </Button>
+ </div>
+ }
+ />
+ {rulesList && rulesList.length > 0 ? (
+ <div className="divide-y divide-border">
+ {rulesList.map((rule) => (
+ <div
+ key={rule.id}
+ className="px-4 sm:px-5 py-3 hover:bg-muted transition-colors cursor-pointer"
+ onClick={() => { setEditing(rule); setDialogOpen(true) }}
+ >
+ <div className="flex items-start justify-between gap-4">
+ <div className="flex-1 min-w-0">
+ <div className="flex items-center gap-2 mb-1">
+ <p className="text-sm font-semibold text-foreground">{rule.name}</p>
+ {!rule.is_active && (
+ <span className="text-[10px] font-semibold bg-muted text-muted-foreground px-1.5 py-0 rounded-full">
+ {t('rules.inactive')}
+ </span>
+ )}
+ <span className="text-[10px] font-semibold bg-muted text-muted-foreground px-1.5 py-0 rounded-full">
+ p:{rule.priority}
+ </span>
+ </div>
+ <p className="text-xs text-muted-foreground font-mono truncate">
+ {conditionSummary(rule.conditions, rule.conditions_op, t)}
+ </p>
+ <p className="text-xs text-emerald-600 font-medium mt-0.5">
+ {actionSummary(rule.actions, categories, t)}
+ </p>
+ </div>
+ <div className="flex items-center gap-1 shrink-0">
+ <button
+ className="p-1.5 rounded-md text-muted-foreground hover:text-rose-500 hover:bg-rose-50 transition-colors"
+ onClick={(e) => { e.stopPropagation(); deleteMutation.mutate(rule.id) }}
+ disabled={deleteMutation.isPending}
+ >
+ <Trash2 size={13} />
+ </button>
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ ) : (
+ <p className="text-sm text-muted-foreground text-center py-10">{t('rules.empty')}</p>
+ )}
+ </SectionCard>
+
+ <RulePacksDialog
+ open={packsDialogOpen}
+ onClose={() => setPacksDialogOpen(false)}
+ />
+
+ <RuleDialog
+ key={editing?.id ?? 'new'}
+ open={dialogOpen}
+ onClose={() => { setDialogOpen(false); setEditing(null) }}
+ rule={editing}
+ categories={categories}
+ accounts={accountsList ?? []}
+ onSave={(data) => {
+ if (editing) {
+ updateMutation.mutate({ id: editing.id, ...data })
+ } else {
+ createMutation.mutate(data as Omit<Rule, 'id' | 'user_id'>)
+ }
+ }}
+ loading={createMutation.isPending || updateMutation.isPending}
+ />
+ </div>
+ )
+}
+
+function RulePacksDialog({ open, onClose }: { open: boolean; onClose: () => void }) {
+ const { t } = useTranslation()
+ const queryClient = useQueryClient()
+
+ const { data: rulePacks } = useQuery({
+ queryKey: ['rule-packs'],
+ queryFn: rulesApi.packs,
+ enabled: open,
+ })
+
+ const installPackMutation = useMutation({
+ mutationFn: (code: string) => rulesApi.installPack(code),
+ onSuccess: (data) => {
+ queryClient.invalidateQueries({ queryKey: ['rules'] })
+ queryClient.invalidateQueries({ queryKey: ['rule-packs'] })
+ if (data.installed === 0) {
+ toast.info(t('rules.packAlreadyInstalled'))
+ } else {
+ toast.success(t('rules.packInstalled', { count: data.installed }))
+ }
+ },
+ onError: () => toast.error(t('common.error')),
+ })
+
+ return (
+ <Dialog open={open} onOpenChange={onClose}>
+ <DialogContent className="max-w-md">
+ <DialogHeader>
+ <DialogTitle>{t('rules.packs')}</DialogTitle>
+ </DialogHeader>
+ <div className="space-y-2">
+ {rulePacks?.map((pack) => (
+ <div
+ key={pack.code}
+ className="flex items-center gap-3 p-3 rounded-lg border border-border"
+ >
+ <span className="text-2xl">{pack.flag}</span>
+ <div className="flex-1 min-w-0">
+ <p className="text-sm font-semibold text-foreground">{pack.name}</p>
+ <p className="text-xs text-muted-foreground">
+ {t('rules.packRuleCount', { count: pack.rule_count })}
+ </p>
+ </div>
+ {pack.installed ? (
+ <span className="flex items-center gap-1 text-xs font-medium text-emerald-600">
+ <Check size={14} />
+ {t('rules.installed')}
+ </span>
+ ) : (
+ <Button
+ size="sm"
+ variant="outline"
+ className="gap-1.5 h-7 text-xs"
+ onClick={() => installPackMutation.mutate(pack.code)}
+ disabled={installPackMutation.isPending}
+ >
+ <Package size={11} />
+ {t('rules.installPack')}
+ </Button>
+ )}
+ </div>
+ ))}
+ </div>
+ </DialogContent>
+ </Dialog>
+ )
+}
+
+function RuleDialog({
+ open, onClose, rule, categories, accounts, onSave, loading,
+}: {
+ open: boolean
+ onClose: () => void
+ rule: Rule | null
+ categories: Category[]
+ accounts: { id: string; name: string }[]
+ onSave: (data: Partial<Rule>) => void
+ loading: boolean
+}) {
+ const { t } = useTranslation()
+ const [name, setName] = useState(rule?.name ?? '')
+ const [conditionsOp, setConditionsOp] = useState<'and' | 'or'>(rule?.conditions_op ?? 'and')
+ const [conditions, setConditions] = useState<RuleCondition[]>(
+ rule?.conditions?.length ? rule.conditions as RuleCondition[] : [{ field: 'description', op: 'contains', value: '' }]
+ )
+ const [actions, setActions] = useState<RuleAction[]>(
+ rule?.actions?.length ? rule.actions as RuleAction[] : [{ op: 'set_category', value: '' }]
+ )
+ const [priority, setPriority] = useState(rule?.priority ?? 0)
+ const [isActive, setIsActive] = useState(rule?.is_active ?? true)
+
+ const selectClass = 'border border-border rounded-lg px-2 py-1.5 text-sm bg-card text-foreground focus:outline-none focus:ring-2 focus:ring-primary'
+
+ function updateCondition(i: number, field: keyof RuleCondition, val: string | number) {
+ setConditions(prev => prev.map((c, idx) => idx === i ? { ...c, [field]: val } : c))
+ }
+
+ function removeCondition(i: number) {
+ setConditions(prev => prev.filter((_, idx) => idx !== i))
+ }
+
+ function addCondition() {
+ setConditions(prev => [...prev, { field: 'description', op: 'contains', value: '' }])
+ }
+
+ function updateAction(i: number, field: keyof RuleAction, val: string) {
+ setActions(prev => prev.map((a, idx) => idx === i ? { ...a, [field]: val } : a))
+ }
+
+ function removeAction(i: number) {
+ setActions(prev => prev.filter((_, idx) => idx !== i))
+ }
+
+ function addAction() {
+ setActions(prev => [...prev, { op: 'set_category', value: '' }])
+ }
+
+ function handleSubmit(e: React.FormEvent) {
+ e.preventDefault()
+ onSave({ name, conditions_op: conditionsOp, conditions, actions, priority, is_active: isActive })
+ }
+
+ return (
+ <Dialog open={open} onOpenChange={onClose}>
+ <DialogContent className="max-w-2xl max-h-[90vh] overflow-y-auto">
+ <DialogHeader>
+ <DialogTitle>{rule ? t('rules.editRule') : t('rules.newRule')}</DialogTitle>
+ </DialogHeader>
+ <form key={rule?.id ?? 'new'} onSubmit={handleSubmit} className="space-y-5">
+ {/* Name + Priority */}
+ <div className="grid grid-cols-3 gap-3">
+ <div className="col-span-2 space-y-1.5">
+ <Label>{t('rules.name')}</Label>
+ <Input value={name} onChange={(e) => setName(e.target.value)} required placeholder="Ex: Uber" />
+ </div>
+ <div className="space-y-1.5">
+ <Label>{t('rules.priority')}</Label>
+ <Input type="number" value={priority} onChange={(e) => setPriority(Number(e.target.value))} />
+ </div>
+ </div>
+
+ {/* Conditions */}
+ <div className="space-y-2">
+ <div className="flex items-center justify-between">
+ <Label>{t('rules.conditions')}</Label>
+ <div className="flex items-center gap-1 bg-muted rounded-lg p-0.5">
+ {(['and', 'or'] as const).map(op => (
+ <button
+ key={op}
+ type="button"
+ className={cn(
+ 'px-3 py-1 text-xs font-semibold rounded-md transition-all',
+ conditionsOp === op ? 'bg-card shadow-sm text-foreground' : 'text-muted-foreground hover:text-foreground'
+ )}
+ onClick={() => setConditionsOp(op)}
+ >
+ {op === 'and' ? t('rules.andOp') : t('rules.orOp')}
+ </button>
+ ))}
+ </div>
+ </div>
+ <div className="space-y-2">
+ {conditions.map((cond, i) => (
+ <div key={i} className="flex items-center gap-2">
+ <select
+ className={`${selectClass} w-32 shrink-0`}
+ value={cond.field}
+ onChange={(e) => updateCondition(i, 'field', e.target.value)}
+ >
+ {CONDITION_FIELDS.map(f => (
+ <option key={f.value} value={f.value}>{t(f.label)}</option>
+ ))}
+ </select>
+ <select
+ className={`${selectClass} w-32 shrink-0`}
+ value={cond.op}
+ onChange={(e) => updateCondition(i, 'op', e.target.value)}
+ >
+ {getOpsForField(cond.field).map(o => (
+ <option key={o.value} value={o.value}>{t(o.label)}</option>
+ ))}
+ </select>
+ {cond.field === 'type' ? (
+ <select
+ className={`${selectClass} flex-1`}
+ value={String(cond.value)}
+ onChange={(e) => updateCondition(i, 'value', e.target.value)}
+ >
+ <option value="debit">{t('rules.typeExpense')}</option>
+ <option value="credit">{t('rules.typeIncome')}</option>
+ </select>
+ ) : cond.field === 'account_id' ? (
+ <select
+ className={`${selectClass} flex-1`}
+ value={String(cond.value)}
+ onChange={(e) => updateCondition(i, 'value', e.target.value)}
+ >
+ <option value="">{t('rules.selectAccount')}</option>
+ {accounts.map(acc => (
+ <option key={acc.id} value={acc.id}>{acc.name}</option>
+ ))}
+ </select>
+ ) : (
+ <Input
+ className="flex-1 h-8 text-sm"
+ value={String(cond.value)}
+ onChange={(e) => updateCondition(i, 'value', e.target.value)}
+ placeholder={cond.field === 'amount' ? '0.00' : cond.field === 'date' ? 'YYYY-MM-DD' : t('rules.valuePlaceholder')}
+ type={cond.field === 'amount' ? 'number' : cond.field === 'date' ? 'date' : 'text'}
+ />
+ )}
+ <button
+ type="button"
+ className="p-1 text-muted-foreground hover:text-rose-500 transition-colors shrink-0"
+ onClick={() => removeCondition(i)}
+ >
+ <X size={13} />
+ </button>
+ </div>
+ ))}
+ <button
+ type="button"
+ className="text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1"
+ onClick={addCondition}
+ >
+ <Plus size={12} /> {t('rules.addCondition')}
+ </button>
+ </div>
+ </div>
+
+ {/* Actions */}
+ <div className="space-y-2">
+ <Label>{t('rules.actions')}</Label>
+ <div className="space-y-2">
+ {actions.map((action, i) => (
+ <div key={i} className="flex items-center gap-2">
+ <select
+ className={`${selectClass} w-40 shrink-0`}
+ value={action.op}
+ onChange={(e) => updateAction(i, 'op', e.target.value)}
+ >
+ <option value="set_category">{t('rules.setCategory')}</option>
+ <option value="append_notes">{t('rules.appendNotes')}</option>
+ </select>
+ {action.op === 'set_category' ? (
+ <select
+ className={`${selectClass} flex-1`}
+ value={action.value}
+ onChange={(e) => updateAction(i, 'value', e.target.value)}
+ required
+ >
+ <option value="">{t('rules.selectCategory')}</option>
+ {categories.map(cat => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </select>
+ ) : (
+ <Input
+ className="flex-1 h-8 text-sm"
+ value={action.value}
+ onChange={(e) => updateAction(i, 'value', e.target.value)}
+ placeholder="Ex: #work #reimbursable"
+ />
+ )}
+ <button
+ type="button"
+ className="p-1 text-muted-foreground hover:text-rose-500 transition-colors shrink-0"
+ onClick={() => removeAction(i)}
+ >
+ <X size={13} />
+ </button>
+ </div>
+ ))}
+ <button
+ type="button"
+ className="text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1"
+ onClick={addAction}
+ >
+ <Plus size={12} /> {t('rules.addAction')}
+ </button>
+ </div>
+ </div>
+
+ {/* Active toggle */}
+ <label className="flex items-center gap-2 cursor-pointer">
+ <input
+ type="checkbox"
+ checked={isActive}
+ onChange={(e) => setIsActive(e.target.checked)}
+ className="h-4 w-4 rounded border-border"
+ />
+ <span className="text-sm text-foreground">{t('rules.ruleActive')}</span>
+ </label>
+
+ <DialogFooter>
+ <Button type="button" variant="outline" onClick={onClose}>{t('common.cancel')}</Button>
+ <Button type="submit" disabled={loading}>
+ {loading ? t('common.loading') : t('common.save')}
+ </Button>
+ </DialogFooter>
+ </form>
+ </DialogContent>
+ </Dialog>
+ )
+}
diff --git a/frontend/src/pages/setup.tsx b/frontend/src/pages/setup.tsx
new file mode 100644
index 00000000..1a4088d5
--- /dev/null
+++ b/frontend/src/pages/setup.tsx
@@ -0,0 +1,242 @@
+import { useState, useEffect } from 'react'
+import { useNavigate } from 'react-router-dom'
+import { useTranslation } from 'react-i18next'
+import { useTheme } from 'next-themes'
+import { setup } from '@/lib/api'
+import { useAuth } from '@/contexts/auth-context'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Label } from '@/components/ui/label'
+import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
+import { cn } from '@/lib/utils'
+import { Sun, Moon, Globe } from 'lucide-react'
+import { ShellLogo } from '@/components/shell-logo'
+
+export default function SetupPage() {
+ const { t, i18n } = useTranslation()
+ const navigate = useNavigate()
+ const { loginWithToken, token } = useAuth()
+ const { theme, setTheme } = useTheme()
+ const currentLang = i18n.language?.startsWith('pt') ? 'pt-BR' : 'en'
+ const [name, setName] = useState('')
+ const [email, setEmail] = useState('')
+ const [password, setPassword] = useState('')
+ const [confirmPassword, setConfirmPassword] = useState('')
+ const [currency, setCurrency] = useState('BRL')
+ const [error, setError] = useState('')
+ const [isLoading, setIsLoading] = useState(false)
+ const [checking, setChecking] = useState(true)
+
+ useEffect(() => {
+ if (token) {
+ navigate('/', { replace: true })
+ return
+ }
+ setup.status().then(({ has_users }) => {
+ if (has_users) {
+ navigate('/login', { replace: true })
+ } else {
+ setChecking(false)
+ }
+ }).catch(() => {
+ setChecking(false)
+ })
+ }, [navigate, token])
+
+ const handleSubmit = async (e: React.FormEvent) => {
+ e.preventDefault()
+ setError('')
+
+ if (password !== confirmPassword) {
+ setError(t('setup.passwordMismatch'))
+ return
+ }
+
+ setIsLoading(true)
+ try {
+ const { access_token } = await setup.createAdmin(email, password, currency, name, currentLang)
+ loginWithToken(access_token)
+ navigate('/')
+ } catch {
+ setError(t('setup.error'))
+ } finally {
+ setIsLoading(false)
+ }
+ }
+
+ if (checking) {
+ return (
+ <div className="flex items-center justify-center min-h-screen">
+ <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary" />
+ </div>
+ )
+ }
+
+ return (
+ <div className="flex flex-col items-center justify-center min-h-screen bg-gradient-to-br from-background via-background to-primary/5 px-4">
+ <div className="flex items-center gap-3 mb-10">
+ <div className="w-12 h-12 rounded-2xl bg-primary/10 flex items-center justify-center">
+ <ShellLogo size={24} className="text-primary" />
+ </div>
+ <span className="text-2xl font-bold tracking-tight text-foreground">{t('app.name')}</span>
+ </div>
+ <Card className="w-full max-w-[400px] shadow-lg border-border/60">
+ <form onSubmit={handleSubmit}>
+ <CardHeader className="text-center pb-2 pt-8 px-8">
+ <CardTitle className="text-2xl font-bold tracking-tight">{t('setup.title')}</CardTitle>
+ <CardDescription className="text-[13px] mt-1">{t('setup.description')}</CardDescription>
+ </CardHeader>
+ <CardContent className="space-y-5 px-8 pt-4">
+ {error && (
+ <div className="p-3 text-sm text-destructive bg-destructive/10 rounded-lg">
+ {error}
+ </div>
+ )}
+ <div className="space-y-1.5">
+ <Label htmlFor="name" className="text-[13px] font-medium">{t('setup.name')}</Label>
+ <Input
+ id="name"
+ type="text"
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ className="h-11 rounded-lg text-sm"
+ placeholder={t('setup.namePlaceholder')}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <Label htmlFor="email" className="text-[13px] font-medium">{t('auth.email')}</Label>
+ <Input
+ id="email"
+ type="email"
+ value={email}
+ onChange={(e) => setEmail(e.target.value)}
+ className="h-11 rounded-lg text-sm"
+ placeholder="[email protected]"
+ required
+ />
+ </div>
+ <div className="space-y-1.5">
+ <Label htmlFor="password" className="text-[13px] font-medium">{t('auth.password')}</Label>
+ <Input
+ id="password"
+ type="password"
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ className="h-11 rounded-lg text-sm"
+ required
+ minLength={8}
+ />
+ </div>
+ <div className="space-y-1.5">
+ <Label htmlFor="confirmPassword" className="text-[13px] font-medium">{t('setup.confirmPassword')}</Label>
+ <Input
+ id="confirmPassword"
+ type="password"
+ value={confirmPassword}
+ onChange={(e) => setConfirmPassword(e.target.value)}
+ className="h-11 rounded-lg text-sm"
+ required
+ minLength={8}
+ />
+ </div>
+ <div className="space-y-2 pt-1">
+ <Label className="text-[13px] font-medium">{t('setup.currency')}</Label>
+ <div className="grid grid-cols-4 gap-2">
+ {([
+ { code: 'BRL', flag: '\u{1F1E7}\u{1F1F7}', symbol: 'R$' },
+ { code: 'USD', flag: '\u{1F1FA}\u{1F1F8}', symbol: '$' },
+ { code: 'EUR', flag: '\u{1F1EA}\u{1F1FA}', symbol: '\u20AC' },
+ { code: 'GBP', flag: '\u{1F1EC}\u{1F1E7}', symbol: '\u00A3' },
+ ] as const).map(({ code, flag, symbol }) => (
+ <button
+ key={code}
+ type="button"
+ onClick={() => setCurrency(code)}
+ className={cn(
+ 'flex flex-col items-center gap-1 py-2.5 rounded-lg border transition-all',
+ currency === code
+ ? 'border-primary bg-primary/10 text-primary ring-1 ring-primary/30'
+ : 'border-border text-muted-foreground hover:border-foreground/20 hover:text-foreground'
+ )}
+ >
+ <span className="text-lg leading-none">{flag}</span>
+ <span className="text-[11px] font-bold">{code}</span>
+ <span className="text-[10px] opacity-60">{symbol}</span>
+ </button>
+ ))}
+ </div>
+ </div>
+ <div className="flex items-center justify-between gap-4 pt-1">
+ <div className="space-y-1.5">
+ <Label className="text-[13px] font-medium flex items-center gap-1.5">
+ <Globe size={14} />
+ {t('setup.language')}
+ </Label>
+ <div className="flex items-center gap-1">
+ <button
+ type="button"
+ onClick={() => i18n.changeLanguage('pt-BR')}
+ className={cn(
+ 'px-2.5 py-1 rounded text-[11px] font-semibold transition-colors',
+ currentLang === 'pt-BR'
+ ? 'bg-primary/15 text-primary'
+ : 'text-muted-foreground hover:text-foreground'
+ )}
+ >
+ PT
+ </button>
+ <button
+ type="button"
+ onClick={() => i18n.changeLanguage('en')}
+ className={cn(
+ 'px-2.5 py-1 rounded text-[11px] font-semibold transition-colors',
+ currentLang === 'en'
+ ? 'bg-primary/15 text-primary'
+ : 'text-muted-foreground hover:text-foreground'
+ )}
+ >
+ EN
+ </button>
+ </div>
+ </div>
+ <div className="space-y-1.5">
+ <Label className="text-[13px] font-medium">{t('setup.theme')}</Label>
+ <div className="flex items-center gap-1">
+ <button
+ type="button"
+ onClick={() => setTheme('light')}
+ className={cn(
+ 'p-1.5 rounded transition-colors',
+ theme === 'light'
+ ? 'bg-primary/15 text-primary'
+ : 'text-muted-foreground hover:text-foreground'
+ )}
+ >
+ <Sun size={14} />
+ </button>
+ <button
+ type="button"
+ onClick={() => setTheme('dark')}
+ className={cn(
+ 'p-1.5 rounded transition-colors',
+ theme === 'dark'
+ ? 'bg-primary/15 text-primary'
+ : 'text-muted-foreground hover:text-foreground'
+ )}
+ >
+ <Moon size={14} />
+ </button>
+ </div>
+ </div>
+ </div>
+ </CardContent>
+ <CardFooter className="px-8 pb-8 pt-2">
+ <Button type="submit" className="w-full h-11 rounded-lg text-sm font-semibold" disabled={isLoading}>
+ {isLoading ? t('setup.creating') : t('setup.createAdmin')}
+ </Button>
+ </CardFooter>
+ </form>
+ </Card>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/transactions.tsx b/frontend/src/pages/transactions.tsx
new file mode 100644
index 00000000..94b51de0
--- /dev/null
+++ b/frontend/src/pages/transactions.tsx
@@ -0,0 +1,523 @@
+import { useState, useMemo, useEffect, useRef } from 'react'
+import { useTranslation } from 'react-i18next'
+import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
+import { transactions, categories as categoriesApi, accounts as accountsApi, recurring } from '@/lib/api'
+import { toast } from 'sonner'
+import { Button } from '@/components/ui/button'
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/ui/table'
+import { Input } from '@/components/ui/input'
+import { Skeleton } from '@/components/ui/skeleton'
+import { Check, Download, Search, X } from 'lucide-react'
+import type { Transaction } from '@/types'
+import { PageHeader } from '@/components/page-header'
+import { CategoryIcon } from '@/components/category-icon'
+import { TransactionDialog, extractApiError } from '@/components/transaction-dialog'
+import { DatePickerInput } from '@/components/ui/date-picker-input'
+import { usePrivacyMode } from '@/hooks/use-privacy-mode'
+
+function formatCurrency(value: number, currency = 'BRL', locale = 'pt-BR') {
+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value)
+}
+
+function parseHashtags(notes: string | null): string[] {
+ if (!notes) return []
+ const matches = notes.match(/#[\w\u00C0-\u017E-]+/g)
+ return matches ?? []
+}
+
+export default function TransactionsPage() {
+ const { t, i18n } = useTranslation()
+ const locale = i18n.language === 'en' ? 'en-US' : i18n.language
+ const { mask } = usePrivacyMode()
+ const queryClient = useQueryClient()
+ const [page, setPage] = useState(1)
+ const [filterAccount, setFilterAccount] = useState<string>('')
+ const [filterCategory, setFilterCategory] = useState<string>('')
+ const [filterFrom, setFilterFrom] = useState<string>('')
+ const [filterTo, setFilterTo] = useState<string>('')
+ const [searchInput, setSearchInput] = useState('')
+ const [searchQuery, setSearchQuery] = useState('')
+ const [dialogOpen, setDialogOpen] = useState(false)
+ const [editingTx, setEditingTx] = useState<Transaction | null>(null)
+ const [tagFilter, setTagFilter] = useState<string | null>(null)
+ const [exporting, setExporting] = useState(false)
+ const [selectedIds, setSelectedIds] = useState<Set<string>>(new Set())
+ const [bulkCategory, setBulkCategory] = useState<string>('')
+ const debounceRef = useRef<ReturnType<typeof setTimeout>>(null)
+
+ useEffect(() => {
+ if (debounceRef.current) clearTimeout(debounceRef.current)
+ debounceRef.current = setTimeout(() => {
+ setSearchQuery(searchInput)
+ setPage(1)
+ }, 300)
+ return () => { if (debounceRef.current) clearTimeout(debounceRef.current) }
+ }, [searchInput])
+
+ // Clear selection on page/filter change
+ useEffect(() => {
+ setSelectedIds(new Set())
+ setBulkCategory('')
+ }, [page, filterAccount, filterCategory, filterFrom, filterTo, searchQuery])
+
+ const { data, isLoading } = useQuery({
+ queryKey: ['transactions', page, filterAccount, filterCategory, filterFrom, filterTo, searchQuery],
+ queryFn: () =>
+ transactions.list({
+ page,
+ limit: 20,
+ account_id: filterAccount || undefined,
+ category_id: filterCategory === '__uncategorized__' ? undefined : (filterCategory || undefined),
+ uncategorized: filterCategory === '__uncategorized__' ? true : undefined,
+ from: filterFrom || undefined,
+ to: filterTo || undefined,
+ q: searchQuery || undefined,
+ }),
+ })
+
+ const { data: categoriesList } = useQuery({
+ queryKey: ['categories'],
+ queryFn: categoriesApi.list,
+ })
+
+ const { data: accountsList } = useQuery({
+ queryKey: ['accounts'],
+ queryFn: () => accountsApi.list(),
+ })
+
+ const { data: recurringList } = useQuery({
+ queryKey: ['recurring'],
+ queryFn: recurring.list,
+ })
+
+ const createMutation = useMutation({
+ mutationFn: async (payload: { tx: Partial<Transaction>; recurringData?: { frequency: string; end_date?: string } }) => {
+ const created = await transactions.create(payload.tx)
+ if (payload.recurringData) {
+ await recurring.create({
+ description: payload.tx.description,
+ amount: payload.tx.amount,
+ currency: payload.tx.currency ?? 'BRL',
+ type: payload.tx.type,
+ frequency: payload.recurringData.frequency,
+ start_date: payload.tx.date,
+ end_date: payload.recurringData.end_date || undefined,
+ category_id: payload.tx.category_id || undefined,
+ account_id: payload.tx.account_id || undefined,
+ skip_first: true,
+ } as Record<string, unknown>)
+ }
+ return created
+ },
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['recurring'] })
+ setDialogOpen(false)
+ toast.success(t('transactions.created'))
+ },
+ onError: (error) => {
+ toast.error(extractApiError(error))
+ },
+ })
+
+ const updateMutation = useMutation({
+ mutationFn: ({ id, ...data }: Partial<Transaction> & { id: string }) =>
+ transactions.update(id, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ setDialogOpen(false)
+ setEditingTx(null)
+ toast.success(t('transactions.updated'))
+ },
+ onError: (error) => {
+ toast.error(extractApiError(error))
+ },
+ })
+
+ const deleteMutation = useMutation({
+ mutationFn: (id: string) => transactions.delete(id),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ setDialogOpen(false)
+ setEditingTx(null)
+ toast.success(t('transactions.deleted'))
+ },
+ onError: (error) => {
+ toast.error(extractApiError(error))
+ },
+ })
+
+ const bulkCategorizeMutation = useMutation({
+ mutationFn: ({ ids, categoryId }: { ids: string[]; categoryId: string | null }) =>
+ transactions.bulkCategorize(ids, categoryId),
+ onSuccess: (result) => {
+ queryClient.invalidateQueries({ queryKey: ['transactions'] })
+ queryClient.invalidateQueries({ queryKey: ['dashboard'] })
+ setSelectedIds(new Set())
+ setBulkCategory('')
+ toast.success(t('transactions.bulkSuccess', { count: result.updated }))
+ },
+ onError: (error) => {
+ toast.error(extractApiError(error))
+ },
+ })
+
+ const toggleSelect = (id: string) => {
+ setSelectedIds(prev => {
+ const next = new Set(prev)
+ if (next.has(id)) next.delete(id)
+ else next.add(id)
+ return next
+ })
+ }
+
+ const filteredItems = useMemo(() => {
+ if (!tagFilter || !data?.items) return data?.items ?? []
+ return data.items.filter(tx =>
+ tx.notes?.includes(tagFilter)
+ )
+ }, [data?.items, tagFilter])
+
+ const toggleSelectAll = () => {
+ if (!filteredItems.length) return
+ const allSelected = filteredItems.every(tx => selectedIds.has(tx.id))
+ if (allSelected) {
+ setSelectedIds(new Set())
+ } else {
+ setSelectedIds(new Set(filteredItems.map(tx => tx.id)))
+ }
+ }
+
+ const allSelected = filteredItems.length > 0 && filteredItems.every(tx => selectedIds.has(tx.id))
+ const someSelected = filteredItems.some(tx => selectedIds.has(tx.id)) && !allSelected
+
+ const totalPages = data ? Math.ceil(data.total / 20) : 0
+
+ return (
+ <div>
+ <PageHeader
+ section={t('transactions.section')}
+ title={t('transactions.title')}
+ action={
+ <div className="flex items-center gap-2">
+ <Button
+ variant="outline"
+ disabled={exporting}
+ onClick={async () => {
+ setExporting(true)
+ try {
+ await transactions.export({
+ account_id: filterAccount || undefined,
+ category_id: filterCategory === '__uncategorized__' ? undefined : (filterCategory || undefined),
+ uncategorized: filterCategory === '__uncategorized__' ? true : undefined,
+ from: filterFrom || undefined,
+ to: filterTo || undefined,
+ q: searchQuery || undefined,
+ })
+ toast.success(t('transactions.exportSuccess'))
+ } catch {
+ toast.error(t('transactions.exportError'))
+ } finally {
+ setExporting(false)
+ }
+ }}
+ >
+ <Download size={16} className="mr-1.5" />
+ {exporting ? t('transactions.exporting') : t('transactions.exportCsv')}
+ </Button>
+ <Button onClick={() => { setEditingTx(null); setDialogOpen(true) }}>
+ + {t('transactions.addManual')}
+ </Button>
+ </div>
+ }
+ />
+
+ {/* Filters */}
+ <div className="bg-card rounded-xl border border-border shadow-sm p-3 md:p-4 mb-4">
+ <div className="flex flex-col gap-2 md:flex-row md:flex-wrap md:items-end md:gap-3">
+ <div className="relative w-full md:w-auto">
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground" size={16} />
+ <Input
+ type="text"
+ placeholder={t('transactions.searchPlaceholder')}
+ value={searchInput}
+ onChange={(e) => setSearchInput(e.target.value)}
+ className="pl-9 w-full md:w-[240px] h-[38px] text-sm"
+ />
+ </div>
+ <div className="grid grid-cols-2 gap-2 md:flex md:gap-3">
+ <select
+ className="border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px] min-w-0"
+ value={filterAccount}
+ onChange={(e) => { setFilterAccount(e.target.value); setPage(1) }}
+ >
+ <option value="">{t('transactions.account')}: {t('transactions.all')}</option>
+ {accountsList?.map((acc) => (
+ <option key={acc.id} value={acc.id}>{acc.name}</option>
+ ))}
+ </select>
+ <select
+ className="border border-border rounded-lg px-3 py-2 text-sm bg-card text-foreground focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px] min-w-0"
+ value={filterCategory}
+ onChange={(e) => { setFilterCategory(e.target.value); setPage(1) }}
+ >
+ <option value="">{t('transactions.category')}: {t('transactions.all')}</option>
+ <option value="__uncategorized__">{t('transactions.uncategorized')}</option>
+ {categoriesList?.map((cat) => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </select>
+ </div>
+ <div className="grid grid-cols-2 gap-2 md:flex md:gap-3">
+ <div className="flex items-center gap-2">
+ <label className="hidden md:inline text-sm text-muted-foreground">{t('transactions.from')}</label>
+ <DatePickerInput
+ value={filterFrom}
+ onChange={(v) => { setFilterFrom(v); setPage(1) }}
+ placeholder={t('transactions.from')}
+ />
+ </div>
+ <div className="flex items-center gap-2">
+ <label className="hidden md:inline text-sm text-muted-foreground">{t('transactions.to')}</label>
+ <DatePickerInput
+ value={filterTo}
+ onChange={(v) => { setFilterTo(v); setPage(1) }}
+ placeholder={t('transactions.to')}
+ />
+ </div>
+ </div>
+ {(filterFrom || filterTo || filterAccount || filterCategory || searchInput) && (
+ <Button
+ variant="ghost"
+ size="sm"
+ className="text-muted-foreground hover:text-foreground"
+ onClick={() => { setFilterFrom(''); setFilterTo(''); setFilterAccount(''); setFilterCategory(''); setSearchInput(''); setSearchQuery(''); setPage(1) }}
+ >
+ {t('transactions.clearFilters')}
+ </Button>
+ )}
+ {tagFilter && (
+ <div className="flex items-center gap-1.5 px-3 py-1.5 bg-primary/5 border border-primary/10 rounded-lg text-xs text-primary font-medium">
+ <span>{tagFilter}</span>
+ <button
+ onClick={() => setTagFilter(null)}
+ className="text-primary/60 hover:text-primary ml-0.5"
+ >
+ <X size={12} />
+ </button>
+ </div>
+ )}
+ </div>
+ </div>
+
+ {/* Table */}
+ <div className="bg-card rounded-xl border border-border shadow-sm overflow-hidden mb-4">
+ {isLoading ? (
+ <div className="p-6 space-y-3">
+ {Array.from({ length: 5 }).map((_, i) => (
+ <Skeleton key={i} className="h-14 w-full" />
+ ))}
+ </div>
+ ) : (
+ <Table>
+ <TableHeader>
+ <TableRow className="border-b border-border hover:bg-transparent">
+ <TableHead className="w-[40px] py-3 pl-4 pr-0">
+ <input
+ type="checkbox"
+ checked={allSelected}
+ ref={(el) => { if (el) el.indeterminate = someSelected }}
+ onChange={toggleSelectAll}
+ className="h-4 w-4 rounded border-border accent-primary cursor-pointer"
+ />
+ </TableHead>
+ <TableHead className="text-xs font-medium text-muted-foreground py-3 pl-2">{t('transactions.description')}</TableHead>
+ <TableHead className="hidden md:table-cell text-xs font-medium text-muted-foreground py-3 w-[180px]">{t('transactions.category')}</TableHead>
+ <TableHead className="hidden lg:table-cell text-xs font-medium text-muted-foreground py-3 w-[160px]">{t('transactions.account')}</TableHead>
+ <TableHead className="text-xs font-medium text-muted-foreground py-3 pr-5 text-right w-[120px] md:w-[180px]">{t('transactions.amount')}</TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {filteredItems.map((tx) => (
+ <TableRow
+ key={tx.id}
+ className={`cursor-pointer hover:bg-muted border-b border-border last:border-0 ${selectedIds.has(tx.id) ? 'bg-primary/5' : ''}`}
+ onClick={() => { setEditingTx(tx); setDialogOpen(true) }}
+ >
+ <TableCell className="py-2.5 pl-4 pr-0 w-[40px]">
+ <input
+ type="checkbox"
+ checked={selectedIds.has(tx.id)}
+ onChange={() => toggleSelect(tx.id)}
+ onClick={(e) => e.stopPropagation()}
+ className="h-4 w-4 rounded border-border accent-primary cursor-pointer"
+ />
+ </TableCell>
+ <TableCell className="py-2.5 pl-2 max-w-0">
+ <div className="flex items-center gap-2 md:gap-3">
+ <CategoryIcon icon={tx.category?.icon} color={tx.category?.color} size="lg" />
+ <div className="min-w-0 flex-1">
+ <div className="flex items-center gap-2">
+ <p className="text-sm font-semibold text-foreground truncate">{tx.description}</p>
+ {recurringList?.some(r => r.description === tx.description && r.type === tx.type) && (
+ <span className="text-[10px] font-semibold uppercase tracking-wide text-primary bg-primary/5 border border-primary/10 px-1.5 py-0.5 rounded-full">
+ {t('transactions.recurringBadge')}
+ </span>
+ )}
+ </div>
+ <p className="text-xs text-muted-foreground mt-0.5">{new Date(tx.date + 'T00:00:00').toLocaleDateString(locale)}</p>
+ {tx.notes && (
+ <div className="mt-1 space-y-0.5">
+ {tx.notes.replace(/#[\w\u00C0-\u017E-]+/g, '').trim() && (
+ <p className="text-xs text-muted-foreground italic leading-snug">
+ {tx.notes.replace(/#[\w\u00C0-\u017E-]+/g, '').trim()}
+ </p>
+ )}
+ {parseHashtags(tx.notes).length > 0 && (
+ <div className="flex flex-wrap gap-1">
+ {parseHashtags(tx.notes).map((tag) => (
+ <span
+ key={tag}
+ className="inline-block text-[11px] font-medium bg-primary/5 text-primary border border-primary/10 px-1.5 py-0 rounded-full leading-5 cursor-pointer hover:bg-primary/10 transition-colors"
+ onClick={(e) => { e.stopPropagation(); setTagFilter(tag) }}
+ >
+ {tag}
+ </span>
+ ))}
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ </div>
+ </TableCell>
+ <TableCell className="hidden md:table-cell py-2.5">
+ {tx.category ? (
+ <span className="text-sm text-muted-foreground">{tx.category.name}</span>
+ ) : (
+ <span className="text-xs text-muted-foreground italic">{t('transactions.noCategory')}</span>
+ )}
+ </TableCell>
+ <TableCell className="hidden lg:table-cell py-2.5 text-sm text-muted-foreground">
+ {accountsList?.find((a) => a.id === tx.account_id)?.name ?? (
+ <span className="text-muted-foreground">—</span>
+ )}
+ </TableCell>
+ <TableCell className="py-2.5 pr-3 md:pr-5 text-right">
+ <span className={`text-xs md:text-sm font-bold tabular-nums ${tx.type === 'credit' ? 'text-emerald-600' : 'text-rose-500'}`}>
+ {mask(`${tx.type === 'credit' ? '+' : '−'}${formatCurrency(Math.abs(Number(tx.amount)), tx.currency, locale)}`)}
+ </span>
+ </TableCell>
+ </TableRow>
+ ))}
+ {filteredItems.length === 0 && (
+ <TableRow>
+ <TableCell colSpan={5} className="text-center py-16 text-muted-foreground">
+ {t('transactions.noResults')}
+ </TableCell>
+ </TableRow>
+ )}
+ </TableBody>
+ </Table>
+ )}
+ </div>
+
+ {/* Pagination */}
+ {totalPages > 1 && (
+ <div className={`flex items-center justify-center gap-2 ${selectedIds.size > 0 ? 'pb-16' : ''}`}>
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={page <= 1}
+ onClick={() => setPage(page - 1)}
+ >
+ {t('transactions.previous')}
+ </Button>
+ <span className="text-sm text-muted-foreground">
+ {page} / {totalPages}
+ </span>
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={page >= totalPages}
+ onClick={() => setPage(page + 1)}
+ >
+ {t('transactions.next')}
+ </Button>
+ </div>
+ )}
+
+ {/* Bulk Action Bar */}
+ <div
+ className={`fixed bottom-0 left-0 right-0 z-50 transition-transform duration-200 ease-out ${selectedIds.size > 0 ? 'translate-y-0' : 'translate-y-full'}`}
+ >
+ <div className="mx-auto max-w-2xl px-3 md:px-4 pb-4 md:pb-6">
+ <div className="flex items-center gap-2 md:gap-3 bg-card border border-border shadow-lg rounded-xl px-3 md:px-5 py-2.5 md:py-3">
+ <span className="text-xs md:text-sm font-medium text-foreground whitespace-nowrap">
+ {t('transactions.selected', { count: selectedIds.size })}
+ </span>
+ <select
+ className="border border-border rounded-lg px-2 md:px-3 py-1.5 text-xs md:text-sm bg-card text-foreground focus:outline-none focus-visible:ring-ring/30 focus-visible:ring-[2px] flex-1 min-w-0"
+ value={bulkCategory}
+ onChange={(e) => setBulkCategory(e.target.value)}
+ >
+ <option value="">{t('transactions.selectCategory')}</option>
+ {categoriesList?.map((cat) => (
+ <option key={cat.id} value={cat.id}>{cat.name}</option>
+ ))}
+ </select>
+ <Button
+ size="sm"
+ disabled={!bulkCategory || bulkCategorizeMutation.isPending}
+ onClick={() => {
+ bulkCategorizeMutation.mutate({
+ ids: Array.from(selectedIds),
+ categoryId: bulkCategory || null,
+ })
+ }}
+ className="shrink-0"
+ >
+ <Check size={14} className="mr-1" />
+ {t('transactions.bulkCategorize')}
+ </Button>
+ <button
+ onClick={() => { setSelectedIds(new Set()); setBulkCategory('') }}
+ className="text-muted-foreground hover:text-foreground p-1 shrink-0"
+ >
+ <X size={16} />
+ </button>
+ </div>
+ </div>
+ </div>
+
+ {/* Add/Edit Dialog */}
+ <TransactionDialog
+ open={dialogOpen}
+ onClose={() => { setDialogOpen(false); setEditingTx(null) }}
+ transaction={editingTx}
+ categories={categoriesList ?? []}
+ accounts={accountsList ?? []}
+ recurringMatch={editingTx ? recurringList?.find(r => r.description === editingTx.description && r.type === editingTx.type) : undefined}
+ onSave={(data, recurringData) => {
+ if (editingTx) {
+ updateMutation.mutate({ id: editingTx.id, ...data })
+ } else {
+ createMutation.mutate({ tx: data, recurringData })
+ }
+ }}
+ onDelete={editingTx ? () => deleteMutation.mutate(editingTx.id) : undefined}
+ loading={createMutation.isPending || updateMutation.isPending || deleteMutation.isPending}
+ error={createMutation.error || updateMutation.error ? extractApiError(createMutation.error || updateMutation.error) : null}
+ isSynced={editingTx?.source === 'sync'}
+ />
+ </div>
+ )
+}
diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts
new file mode 100644
index 00000000..0c75592b
--- /dev/null
+++ b/frontend/src/types/index.ts
@@ -0,0 +1,223 @@
+export interface User {
+ id: string
+ email: string
+ preferences: UserPreferences
+}
+
+export interface UserPreferences {
+ language?: string
+ date_format?: string
+ timezone?: string
+ currency_display?: string
+ display_name?: string
+ onboarding_completed?: boolean
+}
+
+export interface Category {
+ id: string
+ user_id: string
+ group_id: string | null
+ name: string
+ icon: string
+ color: string
+ is_system: boolean
+}
+
+export interface CategoryGroup {
+ id: string
+ user_id: string
+ name: string
+ icon: string
+ color: string
+ position: number
+ is_system: boolean
+ categories: Category[]
+}
+
+export interface BankConnection {
+ id: string
+ user_id: string
+ provider: string
+ institution_name: string
+ external_id: string
+ status: string
+ settings: ConnectionSettings | null
+ last_sync_at: string | null
+ created_at: string
+}
+
+export interface ConnectionSettings {
+ payee_source?: 'auto' | 'merchant' | 'payment_data' | 'description' | 'none'
+ import_pending?: boolean
+}
+
+export interface Account {
+ id: string
+ user_id: string
+ connection_id: string | null
+ external_id: string | null
+ name: string
+ type: string
+ balance: number
+ current_balance: number
+ previous_balance: number | null
+ currency: string
+ is_closed: boolean
+ closed_at: string | null
+}
+
+export interface AccountSummary {
+ account_id: string
+ current_balance: number
+ monthly_income: number
+ monthly_expenses: number
+}
+
+export interface Transaction {
+ id: string
+ user_id: string
+ account_id: string | null
+ category_id: string | null
+ category: Category | null
+ external_id: string | null
+ description: string
+ amount: number
+ currency: string
+ date: string
+ type: 'debit' | 'credit'
+ source: string
+ status: 'posted' | 'pending'
+ payee: string | null
+ notes: string | null
+ transfer_pair_id: string | null
+}
+
+export interface RuleCondition {
+ field: string
+ op: string
+ value: string | number
+}
+
+export interface RuleAction {
+ op: string
+ value: string
+}
+
+export interface Rule {
+ id: string
+ user_id: string
+ name: string
+ conditions_op: 'and' | 'or'
+ conditions: RuleCondition[]
+ actions: RuleAction[]
+ priority: number
+ is_active: boolean
+}
+
+export interface ImportLog {
+ id: string
+ user_id: string
+ account_id: string
+ account_name: string | null
+ filename: string
+ format: string
+ transaction_count: number
+ total_credit: number
+ total_debit: number
+ created_at: string
+}
+
+export interface RecurringTransaction {
+ id: string
+ user_id: string
+ account_id: string | null
+ category_id: string | null
+ description: string
+ amount: number
+ currency: string
+ type: 'debit' | 'credit'
+ frequency: 'monthly' | 'weekly' | 'yearly'
+ day_of_month: number | null
+ start_date: string
+ end_date: string | null
+ is_active: boolean
+ next_occurrence: string
+}
+
+export interface ProjectedTransaction {
+ recurring_id: string
+ description: string
+ amount: number
+ currency: string
+ type: 'debit' | 'credit'
+ date: string
+ category_id: string | null
+ category_name: string | null
+ category_icon: string | null
+ category_color: string | null
+}
+
+export interface DashboardSummary {
+ total_balance: Record<string, number>
+ balance_date: string
+ monthly_income: number
+ monthly_expenses: number
+ accounts_count: number
+ pending_categorization: number
+ pending_categorization_amount: number
+}
+
+export interface SpendingByCategory {
+ category_id: string | null
+ category_name: string
+ category_icon: string
+ category_color: string
+ total: number
+ percentage: number
+}
+
+export interface MonthlyTrend {
+ month: string
+ income: number
+ expenses: number
+}
+
+export interface DailyBalance {
+ day: number
+ balance: number | null
+}
+
+export interface BalanceHistory {
+ current: DailyBalance[]
+ previous: DailyBalance[]
+}
+
+export interface Budget {
+ id: string
+ user_id: string
+ category_id: string
+ amount: number
+ month: string
+ is_recurring: boolean
+}
+
+export interface BudgetVsActual {
+ category_id: string
+ category_name: string
+ category_icon: string
+ category_color: string
+ group_id: string | null
+ group_name: string | null
+ budget_amount: number | null
+ actual_amount: number
+ prev_month_amount: number
+ percentage_used: number | null
+ is_recurring: boolean
+}
+
+export interface PaginatedResponse<T> {
+ items: T[]
+ total: number
+ page: number
+ limit: number
+}
diff --git a/frontend/tsconfig.app.json b/frontend/tsconfig.app.json
new file mode 100644
index 00000000..1fdd51e5
--- /dev/null
+++ b/frontend/tsconfig.app.json
@@ -0,0 +1,33 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
+ "target": "ES2022",
+ "useDefineForClassFields": true,
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
+ "module": "ESNext",
+ "types": ["vite/client"],
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "verbatimModuleSyntax": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+ "jsx": "react-jsx",
+
+ /* Linting */
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./src/*"]
+ },
+
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "erasableSyntaxOnly": true,
+ "noFallthroughCasesInSwitch": true,
+ "noUncheckedSideEffectImports": true
+ },
+ "include": ["src"]
+}
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
new file mode 100644
index 00000000..aa3c04f1
--- /dev/null
+++ b/frontend/tsconfig.json
@@ -0,0 +1,13 @@
+{
+ "compilerOptions": {
+ "baseUrl": ".",
+ "paths": {
+ "@/*": ["./src/*"]
+ }
+ },
+ "files": [],
+ "references": [
+ { "path": "./tsconfig.app.json" },
+ { "path": "./tsconfig.node.json" }
+ ]
+}
diff --git a/frontend/tsconfig.node.json b/frontend/tsconfig.node.json
new file mode 100644
index 00000000..8a67f62f
--- /dev/null
+++ b/frontend/tsconfig.node.json
@@ -0,0 +1,26 @@
+{
+ "compilerOptions": {
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
+ "target": "ES2023",
+ "lib": ["ES2023"],
+ "module": "ESNext",
+ "types": ["node"],
+ "skipLibCheck": true,
+
+ /* Bundler mode */
+ "moduleResolution": "bundler",
+ "allowImportingTsExtensions": true,
+ "verbatimModuleSyntax": true,
+ "moduleDetection": "force",
+ "noEmit": true,
+
+ /* Linting */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "erasableSyntaxOnly": true,
+ "noFallthroughCasesInSwitch": true,
+ "noUncheckedSideEffectImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
new file mode 100644
index 00000000..889ce04b
--- /dev/null
+++ b/frontend/vite.config.ts
@@ -0,0 +1,26 @@
+import { defineConfig } from 'vite'
+import react from '@vitejs/plugin-react'
+import tailwindcss from '@tailwindcss/vite'
+import path from 'path'
+
+export default defineConfig({
+ plugins: [react(), tailwindcss()],
+ resolve: {
+ alias: {
+ '@': path.resolve(__dirname, './src'),
+ },
+ },
+ server: {
+ port: 5173,
+ host: '0.0.0.0',
+ proxy: {
+ '/api': {
+ target: process.env.BACKEND_URL ?? 'http://localhost:8000',
+ changeOrigin: true,
+ },
+ },
+ watch: {
+ usePolling: true,
+ },
+ },
+})
diff --git a/scripts/dev-frontend.mjs b/scripts/dev-frontend.mjs
new file mode 100644
index 00000000..ac59b6fe
--- /dev/null
+++ b/scripts/dev-frontend.mjs
@@ -0,0 +1,66 @@
+#!/usr/bin/env node
+/**
+ * Frontend dev watcher — rebuilds on file change and auto-deploys to Docker.
+ *
+ * Usage: node scripts/dev-frontend.mjs
+ * npm run dev:frontend (once the script is added to package.json)
+ */
+import { spawn, execSync } from 'child_process'
+import { watch } from 'fs'
+import { resolve, join } from 'path'
+import { existsSync } from 'fs'
+
+const ROOT = new URL('..', import.meta.url).pathname
+const FRONTEND_DIR = join(ROOT, 'frontend')
+const DIST_DIR = join(FRONTEND_DIR, 'dist')
+const CONTAINER = 'finanseu-frontend-1'
+
+function deploy() {
+ try {
+ execSync(`docker cp ${DIST_DIR}/. ${CONTAINER}:/usr/share/nginx/html/`, { stdio: 'pipe' })
+ execSync(`docker exec ${CONTAINER} nginx -s reload`, { stdio: 'pipe' })
+ const time = new Date().toLocaleTimeString('pt-BR')
+ console.log(`\x1b[32m✓ Deployed to Docker [${time}]\x1b[0m`)
+ } catch (e) {
+ console.error('\x1b[31m✗ Deploy failed:\x1b[0m', e.message)
+ }
+}
+
+// Debounce rapid successive builds
+let deployTimer = null
+function scheduleDeploy() {
+ if (deployTimer) clearTimeout(deployTimer)
+ deployTimer = setTimeout(deploy, 300)
+}
+
+console.log('\x1b[36m→ Starting Vite watch build + Docker auto-deploy\x1b[0m')
+console.log(` Container: ${CONTAINER}`)
+console.log(` Watching: ${FRONTEND_DIR}/src\n`)
+
+// Start vite build --watch
+const vite = spawn('npm', ['run', 'build', '--', '--watch'], {
+ cwd: FRONTEND_DIR,
+ stdio: ['inherit', 'pipe', 'inherit'],
+ shell: true,
+})
+
+// Watch vite stdout for build-complete signal
+vite.stdout.on('data', (data) => {
+ const line = data.toString()
+ process.stdout.write(line)
+ if (line.includes('built in') || line.includes('✓')) {
+ scheduleDeploy()
+ }
+})
+
+vite.on('error', (err) => console.error('Vite error:', err.message))
+vite.on('exit', (code) => {
+ console.log(`Vite exited with code ${code}`)
+ process.exit(code ?? 0)
+})
+
+process.on('SIGINT', () => {
+ console.log('\nStopping...')
+ vite.kill()
+ process.exit(0)
+})
diff --git a/vector.svg b/vector.svg
new file mode 100644
index 00000000..7f84b490
--- /dev/null
+++ b/vector.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="460.000000" height="460.000000" preserveAspectRatio="xMidYMid meet" style=""><rect id="backgroundrect" width="100%" height="100%" x="0" y="0" fill="none" stroke="none"/>
+
+
+<g class="currentLayer" style=""><title>Layer 1</title><g transform="translate(0,460) scale(0.10000000149011612,-0.10000000149011612) " fill="#6767e7" stroke="none" id="svg_1" class="" fill-opacity="1">
+<path d="M2125 4149 c-222 -23 -430 -97 -652 -232 -66 -40 -103 -68 -103 -79 0 -9 19 -59 41 -110 197 -446 465 -1250 614 -1845 61 -242 56 -233 -140 252 -299 743 -439 1057 -601 1355 -132 242 -116 226 -200 210 -95 -18 -242 -94 -335 -173 -91 -78 -219 -246 -219 -287 0 -11 364 -501 695 -935 75 -99 202 -265 281 -370 79 -104 200 -264 269 -355 69 -90 125 -168 125 -172 0 -10 -239 236 -405 417 -70 77 -172 187 -225 245 -102 111 -597 675 -764 870 -54 63 -101 116 -106 118 -19 7 -147 -149 -188 -231 -69 -137 -83 -193 -89 -352 -5 -137 -5 -143 24 -227 69 -198 189 -332 419 -462 128 -74 473 -256 889 -470 94 -49 289 -150 435 -226 336 -175 381 -189 500 -154 29 8 193 89 364 178 171 90 435 227 586 306 607 316 773 409 857 481 118 101 213 247 249 379 25 94 23 270 -5 375 -33 126 -102 255 -178 336 l-66 70 -30 -28 c-38 -36 -176 -191 -477 -538 -283 -326 -309 -355 -576 -649 -251 -276 -410 -443 -418 -435 -5 5 65 102 260 354 158 206 589 774 936 1235 l176 235 -30 57 c-97 182 -323 356 -529 405 l-71 17 -19 -23 c-33 -41 -190 -338 -282 -535 -121 -259 -232 -522 -433 -1025 -93 -233 -170 -417 -172 -408 -4 18 107 434 219 827 89 308 250 766 403 1143 31 76 56 142 56 148 0 13 -149 108 -245 156 -262 131 -547 182 -840 152z" id="svg_2" fill="#6767e7" fill-opacity="1"/>
+<path d="M949 1318 c-28 -94 -31 -206 -6 -270 53 -136 217 -187 567 -174 239 8 470 29 457 42 -7 7 -985 474 -993 474 -2 0 -13 -33 -25 -72z" id="svg_3" fill="#6767e7" fill-opacity="1"/>
+<path d="M3280 1227 c-185 -89 -406 -196 -492 -237 -106 -50 -151 -77 -140 -81 85 -30 681 -46 782 -20 160 40 232 126 233 277 0 67 -29 225 -42 223 -3 0 -157 -73 -341 -162z" id="svg_4" fill="#6767e7" fill-opacity="1"/>
+</g></g></svg>
\ No newline at end of file