Compare commits
11 Commits
365b98c7dd
...
codex/clie
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f75e6a19c4 | ||
|
|
1cebdffda0 | ||
|
|
8e198bbc6b | ||
|
|
846d4d0a5e | ||
|
|
9e507d2ea6 | ||
|
|
fdc6d8f14d | ||
|
|
906715d343 | ||
|
|
d819552596 | ||
|
|
e29dc6fd6d | ||
|
|
f5364bf7a8 | ||
|
|
543122329e |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -10,6 +10,9 @@ lerna-debug.log*
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
dist-ssr
|
dist-ssr
|
||||||
|
|
||||||
|
# Self-hosted @imgly/background-removal model + wasm assets (fetched on predev/prebuild)
|
||||||
|
public/imgly
|
||||||
*.local
|
*.local
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
|||||||
12
Dockerfile
12
Dockerfile
@@ -4,18 +4,26 @@ FROM node:22-alpine AS deps
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
|
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
|
||||||
COPY package.json pnpm-lock.yaml ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=plimi-pnpm-store,target=/root/.local/share/pnpm/store,sharing=locked \
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
|
||||||
FROM node:22-alpine AS build
|
FROM node:22-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
|
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm build
|
# The IMG.LY model bundle is generated into public/imgly by prebuild. Keeping
|
||||||
|
# that directory in a BuildKit cache avoids downloading ~300 MB after every
|
||||||
|
# source-only redeploy, while Vite still copies the assets into dist/imgly.
|
||||||
|
RUN --mount=type=cache,id=plimi-imgly-assets,target=/app/public/imgly,sharing=locked \
|
||||||
|
pnpm build && mv /app/dist/imgly /app/imgly-dist
|
||||||
|
|
||||||
FROM nginx:1.27-alpine AS runtime
|
FROM nginx:1.27-alpine AS runtime
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY docker/40-generate-runtime-config.sh /docker-entrypoint.d/40-generate-runtime-config.sh
|
COPY docker/40-generate-runtime-config.sh /docker-entrypoint.d/40-generate-runtime-config.sh
|
||||||
|
# Keep the large, versioned model files in a stable layer. App-only changes can
|
||||||
|
# then reuse this layer instead of exporting the full model bundle each time.
|
||||||
|
COPY --from=build /app/imgly-dist /usr/share/nginx/html/imgly
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
RUN chmod +x /docker-entrypoint.d/40-generate-runtime-config.sh
|
RUN chmod +x /docker-entrypoint.d/40-generate-runtime-config.sh
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
661
LICENSE
Normal file
661
LICENSE
Normal file
@@ -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/>.
|
||||||
@@ -53,7 +53,7 @@ docker compose up --build
|
|||||||
|
|
||||||
Environment:
|
Environment:
|
||||||
- `VITE_PLIMI_REPO_URL`: build-time public repository URL shown on the Contribute page.
|
- `VITE_PLIMI_REPO_URL`: build-time public repository URL shown on the Contribute page.
|
||||||
- `VITE_SITE_URL`: canonical public URL used to restrict analytics to the deployed hostname.
|
- `VITE_SITE_URL`: canonical public URL used for SEO metadata, sitemap links, LLM discovery files, and analytics hostname restrictions.
|
||||||
- `VITE_LEGAL_NAME`, `VITE_LEGAL_COUNTRY`: controller identity shown in the privacy notice.
|
- `VITE_LEGAL_NAME`, `VITE_LEGAL_COUNTRY`: controller identity shown in the privacy notice.
|
||||||
- `VITE_PRIVACY_EMAIL`: contact address for privacy and data-subject requests.
|
- `VITE_PRIVACY_EMAIL`: contact address for privacy and data-subject requests.
|
||||||
- `VITE_PRIVACY_EFFECTIVE_DATE`: effective date displayed on the privacy notice.
|
- `VITE_PRIVACY_EFFECTIVE_DATE`: effective date displayed on the privacy notice.
|
||||||
@@ -68,6 +68,11 @@ can be disabled locally through the privacy controls.
|
|||||||
The privacy page is available at `/privacy`; deployers must replace all example
|
The privacy page is available at `/privacy`; deployers must replace all example
|
||||||
controller and hosting values before publishing.
|
controller and hosting values before publishing.
|
||||||
|
|
||||||
|
The production build generates route-specific static HTML for the tool
|
||||||
|
directory and every tool, plus `/sitemap.xml`, `/robots.txt`, `/llms.txt`, and
|
||||||
|
`/llms-full.txt`. Set `VITE_SITE_URL` to the final HTTPS origin before building
|
||||||
|
so those files contain the correct canonical URLs.
|
||||||
|
|
||||||
The bundled Nginx configuration disables routine access logging. If a reverse
|
The bundled Nginx configuration disables routine access logging. If a reverse
|
||||||
proxy, CDN, hosting platform, or firewall logs visitor IP addresses or request
|
proxy, CDN, hosting platform, or firewall logs visitor IP addresses or request
|
||||||
metadata, document that processing and enforce an appropriate retention period
|
metadata, document that processing and enforce an appropriate retention period
|
||||||
|
|||||||
685
bun.lock
Normal file
685
bun.lock
Normal file
@@ -0,0 +1,685 @@
|
|||||||
|
{
|
||||||
|
"lockfileVersion": 1,
|
||||||
|
"configVersion": 1,
|
||||||
|
"workspaces": {
|
||||||
|
"": {
|
||||||
|
"name": "plimi-app",
|
||||||
|
"dependencies": {
|
||||||
|
"@tailwindcss/vite": "^4.3.0",
|
||||||
|
"fabric": "^7.4.0",
|
||||||
|
"pdf-lib": "^1.17.1",
|
||||||
|
"react": "^19.2.6",
|
||||||
|
"react-dom": "^19.2.6",
|
||||||
|
"react-router-dom": "^7.15.0",
|
||||||
|
"tailwindcss": "^4.3.0",
|
||||||
|
"zxing-wasm": "^3.1.0",
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^10.0.1",
|
||||||
|
"@playwright/test": "^1.60.0",
|
||||||
|
"@types/node": "^24.12.3",
|
||||||
|
"@types/react": "^19.2.14",
|
||||||
|
"@types/react-dom": "^19.2.3",
|
||||||
|
"@vitejs/plugin-react": "^6.0.1",
|
||||||
|
"eslint": "^10.3.0",
|
||||||
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
|
"eslint-plugin-react-refresh": "^0.5.2",
|
||||||
|
"globals": "^17.6.0",
|
||||||
|
"prettier": "^3.8.3",
|
||||||
|
"typescript": "~6.0.2",
|
||||||
|
"typescript-eslint": "^8.59.2",
|
||||||
|
"vite": "^8.0.12",
|
||||||
|
"vitest": "^4.1.6",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"packages": {
|
||||||
|
"@asamuzakjp/css-color": ["@asamuzakjp/css-color@3.2.0", "", { "dependencies": { "@csstools/css-calc": "2.1.4", "@csstools/css-color-parser": "3.1.0", "@csstools/css-parser-algorithms": "3.0.5", "@csstools/css-tokenizer": "3.0.4", "lru-cache": "10.4.3" } }, "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw=="],
|
||||||
|
|
||||||
|
"@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "7.28.5", "js-tokens": "4.0.0", "picocolors": "1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
|
||||||
|
|
||||||
|
"@babel/compat-data": ["@babel/compat-data@7.29.3", "", {}, "sha512-LIVqM46zQWZhj17qA8wb4nW/ixr2y1Nw+r1etiAWgRM6U1IqP+LNhL1yg440jYZR72jCWcWbLWzIosH+uP1fqg=="],
|
||||||
|
|
||||||
|
"@babel/core": ["@babel/core@7.29.0", "", { "dependencies": { "@babel/code-frame": "7.29.0", "@babel/generator": "7.29.1", "@babel/helper-compilation-targets": "7.28.6", "@babel/helper-module-transforms": "7.28.6", "@babel/helpers": "7.29.2", "@babel/parser": "7.29.3", "@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.4.3", "gensync": "1.0.0-beta.2", "json5": "2.2.3", "semver": "6.3.1" } }, "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA=="],
|
||||||
|
|
||||||
|
"@babel/generator": ["@babel/generator@7.29.1", "", { "dependencies": { "@babel/parser": "7.29.3", "@babel/types": "7.29.0", "@jridgewell/gen-mapping": "0.3.13", "@jridgewell/trace-mapping": "0.3.31", "jsesc": "3.1.0" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="],
|
||||||
|
|
||||||
|
"@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.28.6", "", { "dependencies": { "@babel/compat-data": "7.29.3", "@babel/helper-validator-option": "7.27.1", "browserslist": "4.28.2", "lru-cache": "5.1.1", "semver": "6.3.1" } }, "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA=="],
|
||||||
|
|
||||||
|
"@babel/helper-globals": ["@babel/helper-globals@7.28.0", "", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="],
|
||||||
|
|
||||||
|
"@babel/helper-module-imports": ["@babel/helper-module-imports@7.28.6", "", { "dependencies": { "@babel/traverse": "7.29.0", "@babel/types": "7.29.0" } }, "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw=="],
|
||||||
|
|
||||||
|
"@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.28.6", "", { "dependencies": { "@babel/helper-module-imports": "7.28.6", "@babel/helper-validator-identifier": "7.28.5", "@babel/traverse": "7.29.0" }, "peerDependencies": { "@babel/core": "7.29.0" } }, "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA=="],
|
||||||
|
|
||||||
|
"@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="],
|
||||||
|
|
||||||
|
"@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="],
|
||||||
|
|
||||||
|
"@babel/helper-validator-option": ["@babel/helper-validator-option@7.27.1", "", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="],
|
||||||
|
|
||||||
|
"@babel/helpers": ["@babel/helpers@7.29.2", "", { "dependencies": { "@babel/template": "7.28.6", "@babel/types": "7.29.0" } }, "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw=="],
|
||||||
|
|
||||||
|
"@babel/parser": ["@babel/parser@7.29.3", "", { "dependencies": { "@babel/types": "7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA=="],
|
||||||
|
|
||||||
|
"@babel/template": ["@babel/template@7.28.6", "", { "dependencies": { "@babel/code-frame": "7.29.0", "@babel/parser": "7.29.3", "@babel/types": "7.29.0" } }, "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ=="],
|
||||||
|
|
||||||
|
"@babel/traverse": ["@babel/traverse@7.29.0", "", { "dependencies": { "@babel/code-frame": "7.29.0", "@babel/generator": "7.29.1", "@babel/helper-globals": "7.28.0", "@babel/parser": "7.29.3", "@babel/template": "7.28.6", "@babel/types": "7.29.0", "debug": "4.4.3" } }, "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA=="],
|
||||||
|
|
||||||
|
"@babel/types": ["@babel/types@7.29.0", "", { "dependencies": { "@babel/helper-string-parser": "7.27.1", "@babel/helper-validator-identifier": "7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="],
|
||||||
|
|
||||||
|
"@csstools/color-helpers": ["@csstools/color-helpers@5.1.0", "", {}, "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA=="],
|
||||||
|
|
||||||
|
"@csstools/css-calc": ["@csstools/css-calc@2.1.4", "", { "peerDependencies": { "@csstools/css-parser-algorithms": "3.0.5", "@csstools/css-tokenizer": "3.0.4" } }, "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ=="],
|
||||||
|
|
||||||
|
"@csstools/css-color-parser": ["@csstools/css-color-parser@3.1.0", "", { "dependencies": { "@csstools/color-helpers": "5.1.0", "@csstools/css-calc": "2.1.4" }, "peerDependencies": { "@csstools/css-parser-algorithms": "3.0.5", "@csstools/css-tokenizer": "3.0.4" } }, "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA=="],
|
||||||
|
|
||||||
|
"@csstools/css-parser-algorithms": ["@csstools/css-parser-algorithms@3.0.5", "", { "peerDependencies": { "@csstools/css-tokenizer": "3.0.4" } }, "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ=="],
|
||||||
|
|
||||||
|
"@csstools/css-tokenizer": ["@csstools/css-tokenizer@3.0.4", "", {}, "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw=="],
|
||||||
|
|
||||||
|
"@emnapi/core": ["@emnapi/core@1.10.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "2.8.1" } }, "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw=="],
|
||||||
|
|
||||||
|
"@emnapi/runtime": ["@emnapi/runtime@1.10.0", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA=="],
|
||||||
|
|
||||||
|
"@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w=="],
|
||||||
|
|
||||||
|
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "3.4.3" }, "peerDependencies": { "eslint": "10.3.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="],
|
||||||
|
|
||||||
|
"@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="],
|
||||||
|
|
||||||
|
"@eslint/config-array": ["@eslint/config-array@0.23.5", "", { "dependencies": { "@eslint/object-schema": "3.0.5", "debug": "4.4.3", "minimatch": "10.2.5" } }, "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA=="],
|
||||||
|
|
||||||
|
"@eslint/config-helpers": ["@eslint/config-helpers@0.5.5", "", { "dependencies": { "@eslint/core": "1.2.1" } }, "sha512-eIJYKTCECbP/nsKaaruF6LW967mtbQbsw4JTtSVkUQc9MneSkbrgPJAbKl9nWr0ZeowV8BfsarBmPpBzGelA2w=="],
|
||||||
|
|
||||||
|
"@eslint/core": ["@eslint/core@1.2.1", "", { "dependencies": { "@types/json-schema": "7.0.15" } }, "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ=="],
|
||||||
|
|
||||||
|
"@eslint/js": ["@eslint/js@10.0.1", "", { "optionalDependencies": { "eslint": "10.3.0" } }, "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA=="],
|
||||||
|
|
||||||
|
"@eslint/object-schema": ["@eslint/object-schema@3.0.5", "", {}, "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw=="],
|
||||||
|
|
||||||
|
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.7.1", "", { "dependencies": { "@eslint/core": "1.2.1", "levn": "0.4.1" } }, "sha512-rZAP3aVgB9ds9KOeUSL+zZ21hPmo8dh6fnIFwRQj5EAZl9gzR7wxYbYXYysAM8CTqGmUGyp2S4kUdV17MnGuWQ=="],
|
||||||
|
|
||||||
|
"@humanfs/core": ["@humanfs/core@0.19.2", "", { "dependencies": { "@humanfs/types": "0.15.0" } }, "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA=="],
|
||||||
|
|
||||||
|
"@humanfs/node": ["@humanfs/node@0.16.8", "", { "dependencies": { "@humanfs/core": "0.19.2", "@humanfs/types": "0.15.0", "@humanwhocodes/retry": "0.4.3" } }, "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ=="],
|
||||||
|
|
||||||
|
"@humanfs/types": ["@humanfs/types@0.15.0", "", {}, "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q=="],
|
||||||
|
|
||||||
|
"@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="],
|
||||||
|
|
||||||
|
"@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="],
|
||||||
|
|
||||||
|
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "1.5.5", "@jridgewell/trace-mapping": "0.3.31" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
|
||||||
|
|
||||||
|
"@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "0.3.13", "@jridgewell/trace-mapping": "0.3.31" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
|
||||||
|
|
||||||
|
"@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
|
||||||
|
|
||||||
|
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
|
||||||
|
|
||||||
|
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "3.1.2", "@jridgewell/sourcemap-codec": "1.5.5" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
|
||||||
|
|
||||||
|
"@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.4", "", { "dependencies": { "@tybys/wasm-util": "0.10.2" }, "peerDependencies": { "@emnapi/core": "1.10.0", "@emnapi/runtime": "1.10.0" } }, "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow=="],
|
||||||
|
|
||||||
|
"@oxc-project/types": ["@oxc-project/types@0.129.0", "", {}, "sha512-3oz8m3FGdr2nDXVqmFUw7jolKliC4MoyXYIG2c7gpjBnzUWQpUGIYcXYKxTdTi+N2jusvt610ckTMkxdwHkYEg=="],
|
||||||
|
|
||||||
|
"@pdf-lib/standard-fonts": ["@pdf-lib/standard-fonts@1.0.0", "", { "dependencies": { "pako": "1.0.11" } }, "sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA=="],
|
||||||
|
|
||||||
|
"@pdf-lib/upng": ["@pdf-lib/upng@1.0.1", "", { "dependencies": { "pako": "1.0.11" } }, "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ=="],
|
||||||
|
|
||||||
|
"@playwright/test": ["@playwright/test@1.60.0", "", { "dependencies": { "playwright": "1.60.0" }, "bin": { "playwright": "cli.js" } }, "sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.0.0", "", { "os": "android", "cpu": "arm64" }, "sha512-TWMZnRLMe63C2Lhyicviu7ZHaU4kxa6PS3rofvc9GmcvptzNN11BcfQ4Sl7MwTOsisQoa2keB/EBdNCAnUo8vA=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.0.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-6XcD+8k0gPVItNagEw78/qqcBDwKcwDYS8V2hRmVsfUSIrd8cWe/CBvRDI5toqFyPfj+FJr6t8U6Xj2P2prEew=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.0.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-iN/tWVXRQDWvmZlKdceP1Dwug9GDpEymhb9p4xnEe6zvCg5lFmzVljl+1qR1NVx3yfGpr2Na+CuLmv5IU8uzfQ=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.0.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-jjQMDvvwSOuhOwMszD/klSOjyWMM3zI64hWTj9KT5x4MxRbZAf+7vLQ6qouRhtsLVFHr3f0ILaJAfgENPiQdAQ=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.0.0", "", { "os": "linux", "cpu": "arm" }, "sha512-d//Dtg2x6/m3mbV64yUGNnDGNZaDGRpDLLNGerHQUVObuNaIQaaDp25yUiqGXtHEXX+NP2d0wAlmKgpYgIAJ2A=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.0.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-n7Ofp0mx+aB2cC+Sdy5YtMnXtY9lchnHbY+3Yt0uq9JsWQExf4f5Whu0tK0R8Jdc9S6RchTHjIFY7uc92puOVQ=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.0.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-EIVjy2cgd7uuMMo94FVkBp7F6DhcZAUwNURkSG3RwUmvAXR6s0ISxM81U+IydcZByPG0pZIHsf1b6kTxoFDgJA=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.0.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-JEwwOPcwTLAcpDQlqSmjEmfs63xJnSiUNIGvLcDLUHCWK4XowpS/7c7tUsUH6uT/ct6bMUTdXKfI8967FYj6mg=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.0.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-0wjCFhLrihtAubnT9iA0N++0pSV0z5Hg7tNGdNJ4RFaINceHadoF+kiFGyY1qSSNVIAZtLotG8Ju1bgDPkjnFA=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.0.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Dfn7iak9BcMMePxcoJfpSbWqnEyrp/dRF63/8qW/eHBdOZov6x5aShLLEYGYdIeSJ6vMLK/XCVB+lGIxm41bQA=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.0.0", "", { "os": "linux", "cpu": "x64" }, "sha512-5/utzzDmD/pD/bmuaUcbTf/sZYy0aztwIVlfpoW1fTjCZ0BaPOMVWGZL1zvgxyi7ZIVYWlxKONHmSbHuiOh8Jw=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.0.0", "", { "os": "none", "cpu": "arm64" }, "sha512-ouJs8VcUomfLfpbUECqFMRqdV4x6aeAK3MA4m6vTrJJjKyWTV5KnxZx7Jd9G+GlDaQQxubcba00x16OyJ1meig=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.0.0", "", { "dependencies": { "@emnapi/core": "1.10.0", "@emnapi/runtime": "1.10.0", "@napi-rs/wasm-runtime": "1.1.4" }, "cpu": "none" }, "sha512-E+oHKGiDA+lsKMmFtffDDw91EryDT7uJocrIuCHqhm6bCTM6xFK+3gaCkYOHfPwQr0cCNarSM2xaELoQDz9jJg=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.0.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-yYK02n8Rngo+gbm1y6G0+7jk1sJ/2Wt7K0me0Y7k/ErBpyf+LJ2gFpqWVTcRV1rUepBlQRmpgWkTQCiiwrK0Ow=="],
|
||||||
|
|
||||||
|
"@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.0.0", "", { "os": "win32", "cpu": "x64" }, "sha512-14bpChMahXRRXiTwahSl+zzHPW6qQTXtkMuJBFlbo+pqSAews2d4BdCSHfrJ/MBsCZtpmTafsY+1QhBzitcmdg=="],
|
||||||
|
|
||||||
|
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.7", "", {}, "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA=="],
|
||||||
|
|
||||||
|
"@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],
|
||||||
|
|
||||||
|
"@tailwindcss/node": ["@tailwindcss/node@4.3.0", "", { "dependencies": { "@jridgewell/remapping": "2.3.5", "enhanced-resolve": "5.21.3", "jiti": "2.7.0", "lightningcss": "1.32.0", "magic-string": "0.30.21", "source-map-js": "1.2.1", "tailwindcss": "4.3.0" } }, "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide": ["@tailwindcss/oxide@4.3.0", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.0", "@tailwindcss/oxide-darwin-arm64": "4.3.0", "@tailwindcss/oxide-darwin-x64": "4.3.0", "@tailwindcss/oxide-freebsd-x64": "4.3.0", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.0", "@tailwindcss/oxide-linux-arm64-musl": "4.3.0", "@tailwindcss/oxide-linux-x64-gnu": "4.3.0", "@tailwindcss/oxide-linux-x64-musl": "4.3.0", "@tailwindcss/oxide-wasm32-wasi": "4.3.0", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.0", "@tailwindcss/oxide-win32-x64-msvc": "4.3.0" } }, "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.3.0", "", { "os": "android", "cpu": "arm64" }, "sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.3.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.3.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.3.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0", "", { "os": "linux", "cpu": "arm" }, "sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.3.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.3.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.3.0", "", { "cpu": "none" }, "sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.3.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ=="],
|
||||||
|
|
||||||
|
"@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.3.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA=="],
|
||||||
|
|
||||||
|
"@tailwindcss/vite": ["@tailwindcss/vite@4.3.0", "", { "dependencies": { "@tailwindcss/node": "4.3.0", "@tailwindcss/oxide": "4.3.0", "tailwindcss": "4.3.0" }, "peerDependencies": { "vite": "8.0.12" } }, "sha512-t6J3OrB5Fc0ExuhohouH0fWUGMYL6PTLhW+E7zIk/pdbnJARZDCwjBznFnkh5ynRnIRSI4YjtTH0t6USjJISrw=="],
|
||||||
|
|
||||||
|
"@tybys/wasm-util": ["@tybys/wasm-util@0.10.2", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg=="],
|
||||||
|
|
||||||
|
"@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "4.0.2", "assertion-error": "2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="],
|
||||||
|
|
||||||
|
"@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="],
|
||||||
|
|
||||||
|
"@types/emscripten": ["@types/emscripten@1.41.5", "", {}, "sha512-cMQm7pxu6BxtHyqJ7mQZ2kXWV5SLmugybFdHCBbJ5eHzOo6VhBckEgAT3//rP5FwPHNPeEiq4SmQ5ucBwsOo4Q=="],
|
||||||
|
|
||||||
|
"@types/esrecurse": ["@types/esrecurse@4.3.1", "", {}, "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw=="],
|
||||||
|
|
||||||
|
"@types/estree": ["@types/estree@1.0.9", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="],
|
||||||
|
|
||||||
|
"@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],
|
||||||
|
|
||||||
|
"@types/node": ["@types/node@24.12.4", "", { "dependencies": { "undici-types": "7.16.0" } }, "sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA=="],
|
||||||
|
|
||||||
|
"@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "3.2.3" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="],
|
||||||
|
|
||||||
|
"@types/react-dom": ["@types/react-dom@19.2.3", "", { "peerDependencies": { "@types/react": "19.2.14" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.59.3", "", { "dependencies": { "@eslint-community/regexpp": "4.12.2", "@typescript-eslint/scope-manager": "8.59.3", "@typescript-eslint/type-utils": "8.59.3", "@typescript-eslint/utils": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3", "ignore": "7.0.5", "natural-compare": "1.4.0", "ts-api-utils": "2.5.0" }, "peerDependencies": { "@typescript-eslint/parser": "8.59.3", "eslint": "10.3.0", "typescript": "6.0.3" } }, "sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.59.3", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.59.3", "@typescript-eslint/types": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3", "debug": "4.4.3" }, "peerDependencies": { "eslint": "10.3.0", "typescript": "6.0.3" } }, "sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.59.3", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "8.59.3", "@typescript-eslint/types": "8.59.3", "debug": "4.4.3" }, "peerDependencies": { "typescript": "6.0.3" } }, "sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.59.3", "", { "dependencies": { "@typescript-eslint/types": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3" } }, "sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.59.3", "", { "peerDependencies": { "typescript": "6.0.3" } }, "sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.59.3", "", { "dependencies": { "@typescript-eslint/types": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3", "@typescript-eslint/utils": "8.59.3", "debug": "4.4.3", "ts-api-utils": "2.5.0" }, "peerDependencies": { "eslint": "10.3.0", "typescript": "6.0.3" } }, "sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/types": ["@typescript-eslint/types@8.59.3", "", {}, "sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.59.3", "", { "dependencies": { "@typescript-eslint/project-service": "8.59.3", "@typescript-eslint/tsconfig-utils": "8.59.3", "@typescript-eslint/types": "8.59.3", "@typescript-eslint/visitor-keys": "8.59.3", "debug": "4.4.3", "minimatch": "10.2.5", "semver": "7.8.0", "tinyglobby": "0.2.16", "ts-api-utils": "2.5.0" }, "peerDependencies": { "typescript": "6.0.3" } }, "sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/utils": ["@typescript-eslint/utils@8.59.3", "", { "dependencies": { "@eslint-community/eslint-utils": "4.9.1", "@typescript-eslint/scope-manager": "8.59.3", "@typescript-eslint/types": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3" }, "peerDependencies": { "eslint": "10.3.0", "typescript": "6.0.3" } }, "sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.59.3", "", { "dependencies": { "@typescript-eslint/types": "8.59.3", "eslint-visitor-keys": "5.0.1" } }, "sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg=="],
|
||||||
|
|
||||||
|
"@vitejs/plugin-react": ["@vitejs/plugin-react@6.0.1", "", { "dependencies": { "@rolldown/pluginutils": "1.0.0-rc.7" }, "peerDependencies": { "vite": "8.0.12" } }, "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ=="],
|
||||||
|
|
||||||
|
"@vitest/expect": ["@vitest/expect@4.1.6", "", { "dependencies": { "@standard-schema/spec": "1.1.0", "@types/chai": "5.2.3", "@vitest/spy": "4.1.6", "@vitest/utils": "4.1.6", "chai": "6.2.2", "tinyrainbow": "3.1.0" } }, "sha512-7EHDquPthALSV0jhhjgEW8FXaviMx7rSqu8W6oqCoAuOhKov814P99QDV1pxMA3QPv21YudvJngIhjrNI4opLg=="],
|
||||||
|
|
||||||
|
"@vitest/mocker": ["@vitest/mocker@4.1.6", "", { "dependencies": { "@vitest/spy": "4.1.6", "estree-walker": "3.0.3", "magic-string": "0.30.21" }, "optionalDependencies": { "vite": "8.0.12" } }, "sha512-MCFc63czMjEInOlcY2cpQCvCN+KgbAn+60xu9cMgP4sKaLC5JNAKw7JH8QdAnoAC88hW1IiSNZ+GgVXlN1UcMQ=="],
|
||||||
|
|
||||||
|
"@vitest/pretty-format": ["@vitest/pretty-format@4.1.6", "", { "dependencies": { "tinyrainbow": "3.1.0" } }, "sha512-h5SxD/IzNhZYnrSZRsUZQIC+vD0GY8cUvq0iwsmkFKixRCKLLWqCXa/FIQ4S1R+sI+PGoojkHsdNrbZiM9Qpgw=="],
|
||||||
|
|
||||||
|
"@vitest/runner": ["@vitest/runner@4.1.6", "", { "dependencies": { "@vitest/utils": "4.1.6", "pathe": "2.0.3" } }, "sha512-nOPCmn2+yD0ZNmKdsXGv/UxMMWbMuKeD6GyYncNwdkYDxpQvrPSKYj2rWuDjC2Y4b6w6hjip5dBKFzEUuZe3vA=="],
|
||||||
|
|
||||||
|
"@vitest/snapshot": ["@vitest/snapshot@4.1.6", "", { "dependencies": { "@vitest/pretty-format": "4.1.6", "@vitest/utils": "4.1.6", "magic-string": "0.30.21", "pathe": "2.0.3" } }, "sha512-YhsdE6xAVfTDmzjxL2ZDUvjj+ZsgyOKe+TdQzqkD72wIOmHka8NuGQ6NpTNZv9D2Z63fbwWKJPeVpEw4EQgYxw=="],
|
||||||
|
|
||||||
|
"@vitest/spy": ["@vitest/spy@4.1.6", "", {}, "sha512-JFKxMx6udhwKh/Ldo270e17QX710vgunMkuPAvXjHSvC6oqLWAHhVhjg/I71q0u0CBSErIODV1Kjv0FQNSWjdg=="],
|
||||||
|
|
||||||
|
"@vitest/utils": ["@vitest/utils@4.1.6", "", { "dependencies": { "@vitest/pretty-format": "4.1.6", "convert-source-map": "2.0.0", "tinyrainbow": "3.1.0" } }, "sha512-FxIY+U81R3LGKCxaHHFRQ5+g6/iRgGLmeHWdp2Amj4ljQRrEIWHmZyDfDYBRZlpyqA7qKxtS9DD1dhk8RnRIVQ=="],
|
||||||
|
|
||||||
|
"acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
|
||||||
|
|
||||||
|
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "8.16.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
|
||||||
|
|
||||||
|
"agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="],
|
||||||
|
|
||||||
|
"ajv": ["ajv@6.15.0", "", { "dependencies": { "fast-deep-equal": "3.1.3", "fast-json-stable-stringify": "2.1.0", "json-schema-traverse": "0.4.1", "uri-js": "4.4.1" } }, "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw=="],
|
||||||
|
|
||||||
|
"assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="],
|
||||||
|
|
||||||
|
"balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
|
||||||
|
|
||||||
|
"base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
|
||||||
|
|
||||||
|
"baseline-browser-mapping": ["baseline-browser-mapping@2.10.29", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-Asa2krT+XTPZINCS+2QcyS8WTkObE77RwkydwF7h6DmnKqbvlalz93m/dnphUyCa6SWSP51VgtEUf2FN+gelFQ=="],
|
||||||
|
|
||||||
|
"bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "5.7.1", "inherits": "2.0.4", "readable-stream": "3.6.2" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="],
|
||||||
|
|
||||||
|
"brace-expansion": ["brace-expansion@5.0.6", "", { "dependencies": { "balanced-match": "4.0.4" } }, "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g=="],
|
||||||
|
|
||||||
|
"browserslist": ["browserslist@4.28.2", "", { "dependencies": { "baseline-browser-mapping": "2.10.29", "caniuse-lite": "1.0.30001792", "electron-to-chromium": "1.5.353", "node-releases": "2.0.44", "update-browserslist-db": "1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg=="],
|
||||||
|
|
||||||
|
"buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "1.5.1", "ieee754": "1.2.1" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],
|
||||||
|
|
||||||
|
"caniuse-lite": ["caniuse-lite@1.0.30001792", "", {}, "sha512-hVLMUZFgR4JJ6ACt1uEESvQN1/dBVqPAKY0hgrV70eN3391K6juAfTjKZLKvOMsx8PxA7gsY1/tLMMTcfFLLpw=="],
|
||||||
|
|
||||||
|
"canvas": ["canvas@3.2.3", "", { "dependencies": { "node-addon-api": "7.1.1", "prebuild-install": "7.1.3" } }, "sha512-PzE5nJZPz72YUAfo8oTp0u3fqqY7IzlTubneAihqDYAUcBk7ryeCmBbdJBEdaH0bptSOe2VT2Zwcb3UaFyaSWw=="],
|
||||||
|
|
||||||
|
"chai": ["chai@6.2.2", "", {}, "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg=="],
|
||||||
|
|
||||||
|
"chownr": ["chownr@1.1.4", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="],
|
||||||
|
|
||||||
|
"convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
|
||||||
|
|
||||||
|
"cookie": ["cookie@1.1.1", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="],
|
||||||
|
|
||||||
|
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "3.1.1", "shebang-command": "2.0.0", "which": "2.0.2" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
||||||
|
|
||||||
|
"cssstyle": ["cssstyle@4.6.0", "", { "dependencies": { "@asamuzakjp/css-color": "3.2.0", "rrweb-cssom": "0.8.0" } }, "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg=="],
|
||||||
|
|
||||||
|
"csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
|
||||||
|
|
||||||
|
"data-urls": ["data-urls@5.0.0", "", { "dependencies": { "whatwg-mimetype": "4.0.0", "whatwg-url": "14.2.0" } }, "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg=="],
|
||||||
|
|
||||||
|
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
|
||||||
|
|
||||||
|
"decimal.js": ["decimal.js@10.6.0", "", {}, "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg=="],
|
||||||
|
|
||||||
|
"decompress-response": ["decompress-response@6.0.0", "", { "dependencies": { "mimic-response": "3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="],
|
||||||
|
|
||||||
|
"deep-extend": ["deep-extend@0.6.0", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="],
|
||||||
|
|
||||||
|
"deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="],
|
||||||
|
|
||||||
|
"detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
|
||||||
|
|
||||||
|
"electron-to-chromium": ["electron-to-chromium@1.5.353", "", {}, "sha512-kOrWphBi8TOZyiJZqsgqIle0lw+tzmnQK83pV9dZUd01Nm2POECSyFQMAuarzZdYqQW7FH9RaYOuaRo3h+bQ3w=="],
|
||||||
|
|
||||||
|
"end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],
|
||||||
|
|
||||||
|
"enhanced-resolve": ["enhanced-resolve@5.21.3", "", { "dependencies": { "graceful-fs": "4.2.11", "tapable": "2.3.3" } }, "sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q=="],
|
||||||
|
|
||||||
|
"entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="],
|
||||||
|
|
||||||
|
"es-module-lexer": ["es-module-lexer@2.1.0", "", {}, "sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ=="],
|
||||||
|
|
||||||
|
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
|
||||||
|
|
||||||
|
"escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
|
||||||
|
|
||||||
|
"eslint": ["eslint@10.3.0", "", { "dependencies": { "@eslint-community/eslint-utils": "4.9.1", "@eslint-community/regexpp": "4.12.2", "@eslint/config-array": "0.23.5", "@eslint/config-helpers": "0.5.5", "@eslint/core": "1.2.1", "@eslint/plugin-kit": "0.7.1", "@humanfs/node": "0.16.8", "@humanwhocodes/module-importer": "1.0.1", "@humanwhocodes/retry": "0.4.3", "@types/estree": "1.0.9", "ajv": "6.15.0", "cross-spawn": "7.0.6", "debug": "4.4.3", "escape-string-regexp": "4.0.0", "eslint-scope": "9.1.2", "eslint-visitor-keys": "5.0.1", "espree": "11.2.0", "esquery": "1.7.0", "esutils": "2.0.3", "fast-deep-equal": "3.1.3", "file-entry-cache": "8.0.0", "find-up": "5.0.0", "glob-parent": "6.0.2", "ignore": "5.3.2", "imurmurhash": "0.1.4", "is-glob": "4.0.3", "json-stable-stringify-without-jsonify": "1.0.1", "minimatch": "10.2.5", "natural-compare": "1.4.0", "optionator": "0.9.4" }, "optionalDependencies": { "jiti": "2.7.0" }, "bin": { "eslint": "bin/eslint.js" } }, "sha512-XbEXaRva5cF0ZQB8w6MluHA0kZZfV2DuCMJ3ozyEOHLwDpZX2Lmm/7Pp0xdJmI0GL1W05VH5VwIFHEm1Vcw2gw=="],
|
||||||
|
|
||||||
|
"eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@7.1.1", "", { "dependencies": { "@babel/core": "7.29.0", "@babel/parser": "7.29.3", "hermes-parser": "0.25.1", "zod": "4.4.3", "zod-validation-error": "4.0.2" }, "peerDependencies": { "eslint": "10.3.0" } }, "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g=="],
|
||||||
|
|
||||||
|
"eslint-plugin-react-refresh": ["eslint-plugin-react-refresh@0.5.2", "", { "peerDependencies": { "eslint": "10.3.0" } }, "sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA=="],
|
||||||
|
|
||||||
|
"eslint-scope": ["eslint-scope@9.1.2", "", { "dependencies": { "@types/esrecurse": "4.3.1", "@types/estree": "1.0.9", "esrecurse": "4.3.0", "estraverse": "5.3.0" } }, "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ=="],
|
||||||
|
|
||||||
|
"eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="],
|
||||||
|
|
||||||
|
"espree": ["espree@11.2.0", "", { "dependencies": { "acorn": "8.16.0", "acorn-jsx": "5.3.2", "eslint-visitor-keys": "5.0.1" } }, "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw=="],
|
||||||
|
|
||||||
|
"esquery": ["esquery@1.7.0", "", { "dependencies": { "estraverse": "5.3.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="],
|
||||||
|
|
||||||
|
"esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "5.3.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="],
|
||||||
|
|
||||||
|
"estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="],
|
||||||
|
|
||||||
|
"estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "1.0.9" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="],
|
||||||
|
|
||||||
|
"esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],
|
||||||
|
|
||||||
|
"expand-template": ["expand-template@2.0.3", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="],
|
||||||
|
|
||||||
|
"expect-type": ["expect-type@1.3.0", "", {}, "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA=="],
|
||||||
|
|
||||||
|
"fabric": ["fabric@7.4.0", "", { "optionalDependencies": { "canvas": "3.2.3", "jsdom": "26.1.0" } }, "sha512-NalYDc3eifTl1C33zryQwpH6+XA/2ClxQrH9vkASkZw3tbkRmorpikhYMmxhUTmi7O3e9ODz0vOT8qfaCh9IVA=="],
|
||||||
|
|
||||||
|
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
|
||||||
|
|
||||||
|
"fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="],
|
||||||
|
|
||||||
|
"fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],
|
||||||
|
|
||||||
|
"fdir": ["fdir@6.5.0", "", { "optionalDependencies": { "picomatch": "4.0.4" } }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
|
||||||
|
|
||||||
|
"file-entry-cache": ["file-entry-cache@8.0.0", "", { "dependencies": { "flat-cache": "4.0.1" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="],
|
||||||
|
|
||||||
|
"find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "6.0.0", "path-exists": "4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],
|
||||||
|
|
||||||
|
"flat-cache": ["flat-cache@4.0.1", "", { "dependencies": { "flatted": "3.4.2", "keyv": "4.5.4" } }, "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw=="],
|
||||||
|
|
||||||
|
"flatted": ["flatted@3.4.2", "", {}, "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA=="],
|
||||||
|
|
||||||
|
"fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="],
|
||||||
|
|
||||||
|
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
|
||||||
|
|
||||||
|
"gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
|
||||||
|
|
||||||
|
"github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="],
|
||||||
|
|
||||||
|
"glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],
|
||||||
|
|
||||||
|
"globals": ["globals@17.6.0", "", {}, "sha512-sepffkT8stwnIYbsMBpoCHJuJM5l98FUF2AnE07hfvE0m/qp3R586hw4jF4uadbhvg1ooIdzuu7CsfD2jzCaNA=="],
|
||||||
|
|
||||||
|
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
||||||
|
|
||||||
|
"hermes-estree": ["hermes-estree@0.25.1", "", {}, "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw=="],
|
||||||
|
|
||||||
|
"hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="],
|
||||||
|
|
||||||
|
"html-encoding-sniffer": ["html-encoding-sniffer@4.0.0", "", { "dependencies": { "whatwg-encoding": "3.1.1" } }, "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ=="],
|
||||||
|
|
||||||
|
"http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "7.1.4", "debug": "4.4.3" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="],
|
||||||
|
|
||||||
|
"https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "7.1.4", "debug": "4.4.3" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],
|
||||||
|
|
||||||
|
"iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": "2.1.2" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="],
|
||||||
|
|
||||||
|
"ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],
|
||||||
|
|
||||||
|
"ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
|
||||||
|
|
||||||
|
"imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
|
||||||
|
|
||||||
|
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
|
||||||
|
|
||||||
|
"ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],
|
||||||
|
|
||||||
|
"is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],
|
||||||
|
|
||||||
|
"is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],
|
||||||
|
|
||||||
|
"is-potential-custom-element-name": ["is-potential-custom-element-name@1.0.1", "", {}, "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="],
|
||||||
|
|
||||||
|
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
|
||||||
|
|
||||||
|
"jiti": ["jiti@2.7.0", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="],
|
||||||
|
|
||||||
|
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
|
||||||
|
|
||||||
|
"jsdom": ["jsdom@26.1.0", "", { "dependencies": { "cssstyle": "4.6.0", "data-urls": "5.0.0", "decimal.js": "10.6.0", "html-encoding-sniffer": "4.0.0", "http-proxy-agent": "7.0.2", "https-proxy-agent": "7.0.6", "is-potential-custom-element-name": "1.0.1", "nwsapi": "2.2.23", "parse5": "7.3.0", "rrweb-cssom": "0.8.0", "saxes": "6.0.0", "symbol-tree": "3.2.4", "tough-cookie": "5.1.2", "w3c-xmlserializer": "5.0.0", "webidl-conversions": "7.0.0", "whatwg-encoding": "3.1.1", "whatwg-mimetype": "4.0.0", "whatwg-url": "14.2.0", "ws": "8.21.0", "xml-name-validator": "5.0.0" }, "optionalDependencies": { "canvas": "3.2.3" } }, "sha512-Cvc9WUhxSMEo4McES3P7oK3QaXldCfNWp7pl2NNeiIFlCoLr3kfq9kb1fxftiwk1FLV7CvpvDfonxtzUDeSOPg=="],
|
||||||
|
|
||||||
|
"jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
|
||||||
|
|
||||||
|
"json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="],
|
||||||
|
|
||||||
|
"json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="],
|
||||||
|
|
||||||
|
"json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="],
|
||||||
|
|
||||||
|
"json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
|
||||||
|
|
||||||
|
"keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
|
||||||
|
|
||||||
|
"levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "1.2.1", "type-check": "0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
|
||||||
|
|
||||||
|
"lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "2.1.2" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
|
||||||
|
|
||||||
|
"lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],
|
||||||
|
|
||||||
|
"lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],
|
||||||
|
|
||||||
|
"lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.32.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="],
|
||||||
|
|
||||||
|
"lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.32.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="],
|
||||||
|
|
||||||
|
"lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.32.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="],
|
||||||
|
|
||||||
|
"lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="],
|
||||||
|
|
||||||
|
"lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="],
|
||||||
|
|
||||||
|
"lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="],
|
||||||
|
|
||||||
|
"lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="],
|
||||||
|
|
||||||
|
"lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.32.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="],
|
||||||
|
|
||||||
|
"lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],
|
||||||
|
|
||||||
|
"locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
|
||||||
|
|
||||||
|
"lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "3.1.1" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
|
||||||
|
|
||||||
|
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
|
||||||
|
|
||||||
|
"mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="],
|
||||||
|
|
||||||
|
"minimatch": ["minimatch@10.2.5", "", { "dependencies": { "brace-expansion": "5.0.6" } }, "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg=="],
|
||||||
|
|
||||||
|
"minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
|
||||||
|
|
||||||
|
"mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="],
|
||||||
|
|
||||||
|
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
|
||||||
|
|
||||||
|
"nanoid": ["nanoid@3.3.12", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ=="],
|
||||||
|
|
||||||
|
"napi-build-utils": ["napi-build-utils@2.0.0", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="],
|
||||||
|
|
||||||
|
"natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="],
|
||||||
|
|
||||||
|
"node-abi": ["node-abi@3.92.0", "", { "dependencies": { "semver": "7.8.0" } }, "sha512-KdHvFWZjEKDf0cakgFjebl371GPsISX2oZHcuyKqM7DtogIsHrqKeLTo8wBHxaXRAQlY2PsPlZmfo+9ZCxEREQ=="],
|
||||||
|
|
||||||
|
"node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="],
|
||||||
|
|
||||||
|
"node-releases": ["node-releases@2.0.44", "", {}, "sha512-5WUyunoPMsvvEhS8AxHtRzP+oA8UCkJ7YRxatWKjngndhDGLiqEVAQKWjFAiAiuL8zMRGzGSJxFnLetoa43qGQ=="],
|
||||||
|
|
||||||
|
"nwsapi": ["nwsapi@2.2.23", "", {}, "sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ=="],
|
||||||
|
|
||||||
|
"obug": ["obug@2.1.1", "", {}, "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ=="],
|
||||||
|
|
||||||
|
"once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1.0.2" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],
|
||||||
|
|
||||||
|
"optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "0.1.4", "fast-levenshtein": "2.0.6", "levn": "0.4.1", "prelude-ls": "1.2.1", "type-check": "0.4.0", "word-wrap": "1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="],
|
||||||
|
|
||||||
|
"p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
|
||||||
|
|
||||||
|
"p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "3.1.0" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="],
|
||||||
|
|
||||||
|
"pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="],
|
||||||
|
|
||||||
|
"parse5": ["parse5@7.3.0", "", { "dependencies": { "entities": "6.0.1" } }, "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw=="],
|
||||||
|
|
||||||
|
"path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
|
||||||
|
|
||||||
|
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
|
||||||
|
|
||||||
|
"pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||||
|
|
||||||
|
"pdf-lib": ["pdf-lib@1.17.1", "", { "dependencies": { "@pdf-lib/standard-fonts": "1.0.0", "@pdf-lib/upng": "1.0.1", "pako": "1.0.11", "tslib": "1.14.1" } }, "sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw=="],
|
||||||
|
|
||||||
|
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
||||||
|
|
||||||
|
"picomatch": ["picomatch@4.0.4", "", {}, "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A=="],
|
||||||
|
|
||||||
|
"playwright": ["playwright@1.60.0", "", { "dependencies": { "playwright-core": "1.60.0" }, "optionalDependencies": { "fsevents": "2.3.2" }, "bin": { "playwright": "cli.js" } }, "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA=="],
|
||||||
|
|
||||||
|
"playwright-core": ["playwright-core@1.60.0", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA=="],
|
||||||
|
|
||||||
|
"postcss": ["postcss@8.5.14", "", { "dependencies": { "nanoid": "3.3.12", "picocolors": "1.1.1", "source-map-js": "1.2.1" } }, "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg=="],
|
||||||
|
|
||||||
|
"prebuild-install": ["prebuild-install@7.1.3", "", { "dependencies": { "detect-libc": "2.1.2", "expand-template": "2.0.3", "github-from-package": "0.0.0", "minimist": "1.2.8", "mkdirp-classic": "0.5.3", "napi-build-utils": "2.0.0", "node-abi": "3.92.0", "pump": "3.0.4", "rc": "1.2.8", "simple-get": "4.0.1", "tar-fs": "2.1.4", "tunnel-agent": "0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="],
|
||||||
|
|
||||||
|
"prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],
|
||||||
|
|
||||||
|
"prettier": ["prettier@3.8.3", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw=="],
|
||||||
|
|
||||||
|
"pump": ["pump@3.0.4", "", { "dependencies": { "end-of-stream": "1.4.5", "once": "1.4.0" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="],
|
||||||
|
|
||||||
|
"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
|
||||||
|
|
||||||
|
"rc": ["rc@1.2.8", "", { "dependencies": { "deep-extend": "0.6.0", "ini": "1.3.8", "minimist": "1.2.8", "strip-json-comments": "2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="],
|
||||||
|
|
||||||
|
"react": ["react@19.2.6", "", {}, "sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q=="],
|
||||||
|
|
||||||
|
"react-dom": ["react-dom@19.2.6", "", { "dependencies": { "scheduler": "0.27.0" }, "peerDependencies": { "react": "19.2.6" } }, "sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g=="],
|
||||||
|
|
||||||
|
"react-router": ["react-router@7.15.0", "", { "dependencies": { "cookie": "1.1.1", "set-cookie-parser": "2.7.2" }, "optionalDependencies": { "react-dom": "19.2.6" }, "peerDependencies": { "react": "19.2.6" } }, "sha512-HW9vYwuM8f4yx66Izy8xfrzCM+SBJluoZcCbww9A1TySax11S5Vgw6fi3ZjMONw9J4gQwngL7PzkyIpJJpJ7RQ=="],
|
||||||
|
|
||||||
|
"react-router-dom": ["react-router-dom@7.15.0", "", { "dependencies": { "react-router": "7.15.0" }, "peerDependencies": { "react": "19.2.6", "react-dom": "19.2.6" } }, "sha512-VcrVg64Fo8nwBvDscajG8gRTLIuTC6N50nb22l2HOOV4PTOHgoGp8mUjy9wLiHYoYTSYI36tUnXZgasSRFZorQ=="],
|
||||||
|
|
||||||
|
"readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "2.0.4", "string_decoder": "1.3.0", "util-deprecate": "1.0.2" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
|
||||||
|
|
||||||
|
"rolldown": ["rolldown@1.0.0", "", { "dependencies": { "@oxc-project/types": "0.129.0", "@rolldown/pluginutils": "1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0", "@rolldown/binding-darwin-arm64": "1.0.0", "@rolldown/binding-darwin-x64": "1.0.0", "@rolldown/binding-freebsd-x64": "1.0.0", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0", "@rolldown/binding-linux-arm64-gnu": "1.0.0", "@rolldown/binding-linux-arm64-musl": "1.0.0", "@rolldown/binding-linux-ppc64-gnu": "1.0.0", "@rolldown/binding-linux-s390x-gnu": "1.0.0", "@rolldown/binding-linux-x64-gnu": "1.0.0", "@rolldown/binding-linux-x64-musl": "1.0.0", "@rolldown/binding-openharmony-arm64": "1.0.0", "@rolldown/binding-wasm32-wasi": "1.0.0", "@rolldown/binding-win32-arm64-msvc": "1.0.0", "@rolldown/binding-win32-x64-msvc": "1.0.0" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-yD986aXDESFGS95spT1LAv0jssywP4npMEjmMHyN2/5+eE8qQJUype2AaKkRiLgBgyD0LFlubwAht7VmY8rGoA=="],
|
||||||
|
|
||||||
|
"rrweb-cssom": ["rrweb-cssom@0.8.0", "", {}, "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw=="],
|
||||||
|
|
||||||
|
"safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
|
||||||
|
|
||||||
|
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
|
||||||
|
|
||||||
|
"saxes": ["saxes@6.0.0", "", { "dependencies": { "xmlchars": "2.2.0" } }, "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA=="],
|
||||||
|
|
||||||
|
"scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
|
||||||
|
|
||||||
|
"semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
|
||||||
|
|
||||||
|
"set-cookie-parser": ["set-cookie-parser@2.7.2", "", {}, "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw=="],
|
||||||
|
|
||||||
|
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
|
||||||
|
|
||||||
|
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
|
||||||
|
|
||||||
|
"siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="],
|
||||||
|
|
||||||
|
"simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="],
|
||||||
|
|
||||||
|
"simple-get": ["simple-get@4.0.1", "", { "dependencies": { "decompress-response": "6.0.0", "once": "1.4.0", "simple-concat": "1.0.1" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="],
|
||||||
|
|
||||||
|
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
|
||||||
|
|
||||||
|
"stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="],
|
||||||
|
|
||||||
|
"std-env": ["std-env@4.1.0", "", {}, "sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ=="],
|
||||||
|
|
||||||
|
"string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
|
||||||
|
|
||||||
|
"strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="],
|
||||||
|
|
||||||
|
"symbol-tree": ["symbol-tree@3.2.4", "", {}, "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="],
|
||||||
|
|
||||||
|
"tagged-tag": ["tagged-tag@1.0.0", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="],
|
||||||
|
|
||||||
|
"tailwindcss": ["tailwindcss@4.3.0", "", {}, "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q=="],
|
||||||
|
|
||||||
|
"tapable": ["tapable@2.3.3", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="],
|
||||||
|
|
||||||
|
"tar-fs": ["tar-fs@2.1.4", "", { "dependencies": { "chownr": "1.1.4", "mkdirp-classic": "0.5.3", "pump": "3.0.4", "tar-stream": "2.2.0" } }, "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ=="],
|
||||||
|
|
||||||
|
"tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "4.1.0", "end-of-stream": "1.4.5", "fs-constants": "1.0.0", "inherits": "2.0.4", "readable-stream": "3.6.2" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="],
|
||||||
|
|
||||||
|
"tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="],
|
||||||
|
|
||||||
|
"tinyexec": ["tinyexec@1.1.2", "", {}, "sha512-dAqSqE/RabpBKI8+h26GfLq6Vb3JVXs30XYQjdMjaj/c2tS8IYYMbIzP599KtRj7c57/wYApb3QjgRgXmrCukA=="],
|
||||||
|
|
||||||
|
"tinyglobby": ["tinyglobby@0.2.16", "", { "dependencies": { "fdir": "6.5.0", "picomatch": "4.0.4" } }, "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg=="],
|
||||||
|
|
||||||
|
"tinyrainbow": ["tinyrainbow@3.1.0", "", {}, "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw=="],
|
||||||
|
|
||||||
|
"tldts": ["tldts@6.1.86", "", { "dependencies": { "tldts-core": "6.1.86" }, "bin": { "tldts": "bin/cli.js" } }, "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ=="],
|
||||||
|
|
||||||
|
"tldts-core": ["tldts-core@6.1.86", "", {}, "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA=="],
|
||||||
|
|
||||||
|
"tough-cookie": ["tough-cookie@5.1.2", "", { "dependencies": { "tldts": "6.1.86" } }, "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A=="],
|
||||||
|
|
||||||
|
"tr46": ["tr46@5.1.1", "", { "dependencies": { "punycode": "2.3.1" } }, "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw=="],
|
||||||
|
|
||||||
|
"ts-api-utils": ["ts-api-utils@2.5.0", "", { "peerDependencies": { "typescript": "6.0.3" } }, "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA=="],
|
||||||
|
|
||||||
|
"tslib": ["tslib@1.14.1", "", {}, "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="],
|
||||||
|
|
||||||
|
"tunnel-agent": ["tunnel-agent@0.6.0", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w=="],
|
||||||
|
|
||||||
|
"type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="],
|
||||||
|
|
||||||
|
"type-fest": ["type-fest@5.7.0", "", { "dependencies": { "tagged-tag": "1.0.0" } }, "sha512-1URUxUqfHFM1c+zfSPsa3gnkO7Aq21qyH75SIduNYz4SzY964rn1X2vCMQaHSHhktiw+0kPa2iyb6PUpXqB6Vg=="],
|
||||||
|
|
||||||
|
"typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],
|
||||||
|
|
||||||
|
"typescript-eslint": ["typescript-eslint@8.59.3", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.59.3", "@typescript-eslint/parser": "8.59.3", "@typescript-eslint/typescript-estree": "8.59.3", "@typescript-eslint/utils": "8.59.3" }, "peerDependencies": { "eslint": "10.3.0", "typescript": "6.0.3" } }, "sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg=="],
|
||||||
|
|
||||||
|
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
|
||||||
|
|
||||||
|
"update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "3.2.0", "picocolors": "1.1.1" }, "peerDependencies": { "browserslist": "4.28.2" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
|
||||||
|
|
||||||
|
"uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "2.3.1" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],
|
||||||
|
|
||||||
|
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||||
|
|
||||||
|
"vite": ["vite@8.0.12", "", { "dependencies": { "lightningcss": "1.32.0", "picomatch": "4.0.4", "postcss": "8.5.14", "rolldown": "1.0.0", "tinyglobby": "0.2.16" }, "optionalDependencies": { "@types/node": "24.12.4", "fsevents": "2.3.3", "jiti": "2.7.0" }, "bin": { "vite": "bin/vite.js" } }, "sha512-w2dDofOWv2QB09ZITZBsvKTVAlYvPR4IAmrY/v0ir9KvLs0xybR7i48wxhM1/oyBWO34wPns+bPGw5ZrZqDpZg=="],
|
||||||
|
|
||||||
|
"vitest": ["vitest@4.1.6", "", { "dependencies": { "@vitest/expect": "4.1.6", "@vitest/mocker": "4.1.6", "@vitest/pretty-format": "4.1.6", "@vitest/runner": "4.1.6", "@vitest/snapshot": "4.1.6", "@vitest/spy": "4.1.6", "@vitest/utils": "4.1.6", "es-module-lexer": "2.1.0", "expect-type": "1.3.0", "magic-string": "0.30.21", "obug": "2.1.1", "pathe": "2.0.3", "picomatch": "4.0.4", "std-env": "4.1.0", "tinybench": "2.9.0", "tinyexec": "1.1.2", "tinyglobby": "0.2.16", "tinyrainbow": "3.1.0", "why-is-node-running": "2.3.0" }, "optionalDependencies": { "@types/node": "24.12.4", "jsdom": "26.1.0" }, "peerDependencies": { "vite": "8.0.12" }, "bin": { "vitest": "vitest.mjs" } }, "sha512-6lvjbS3p9b4CrdCmguzbh2/4uoXhGE2q71R4OX5sqF9R1bo9Xd6fGrMAfvp5wnCzlBnFVdCOp6onuTQVbo8iUQ=="],
|
||||||
|
|
||||||
|
"w3c-xmlserializer": ["w3c-xmlserializer@5.0.0", "", { "dependencies": { "xml-name-validator": "5.0.0" } }, "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA=="],
|
||||||
|
|
||||||
|
"webidl-conversions": ["webidl-conversions@7.0.0", "", {}, "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="],
|
||||||
|
|
||||||
|
"whatwg-encoding": ["whatwg-encoding@3.1.1", "", { "dependencies": { "iconv-lite": "0.6.3" } }, "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ=="],
|
||||||
|
|
||||||
|
"whatwg-mimetype": ["whatwg-mimetype@4.0.0", "", {}, "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg=="],
|
||||||
|
|
||||||
|
"whatwg-url": ["whatwg-url@14.2.0", "", { "dependencies": { "tr46": "5.1.1", "webidl-conversions": "7.0.0" } }, "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw=="],
|
||||||
|
|
||||||
|
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
|
||||||
|
|
||||||
|
"why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="],
|
||||||
|
|
||||||
|
"word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="],
|
||||||
|
|
||||||
|
"wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],
|
||||||
|
|
||||||
|
"ws": ["ws@8.21.0", "", {}, "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g=="],
|
||||||
|
|
||||||
|
"xml-name-validator": ["xml-name-validator@5.0.0", "", {}, "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg=="],
|
||||||
|
|
||||||
|
"xmlchars": ["xmlchars@2.2.0", "", {}, "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="],
|
||||||
|
|
||||||
|
"yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
|
||||||
|
|
||||||
|
"yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
|
||||||
|
|
||||||
|
"zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="],
|
||||||
|
|
||||||
|
"zod-validation-error": ["zod-validation-error@4.0.2", "", { "peerDependencies": { "zod": "4.4.3" } }, "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ=="],
|
||||||
|
|
||||||
|
"zxing-wasm": ["zxing-wasm@3.1.0", "", { "dependencies": { "type-fest": "5.7.0" }, "peerDependencies": { "@types/emscripten": "1.41.5" } }, "sha512-5+3V1wPRx4gvbeLH2jB7n2cKrYJ1q4i3QgjnBUtrDPeqxJSi6BdzKJg4y6aF6bgW8zfntnYJyrkqFMevDhL2NA=="],
|
||||||
|
|
||||||
|
"@asamuzakjp/css-color/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
|
||||||
|
|
||||||
|
"@emnapi/core/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||||
|
|
||||||
|
"@emnapi/runtime/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||||
|
|
||||||
|
"@emnapi/wasi-threads/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||||
|
|
||||||
|
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
|
||||||
|
|
||||||
|
"@tybys/wasm-util/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="],
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree/semver": ["semver@7.8.0", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA=="],
|
||||||
|
|
||||||
|
"node-abi/semver": ["semver@7.8.0", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA=="],
|
||||||
|
|
||||||
|
"playwright/fsevents": ["fsevents@2.3.2", "", { "os": "darwin" }, "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA=="],
|
||||||
|
|
||||||
|
"rolldown/@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0", "", {}, "sha512-aKs/3GSWyV0mrhNmt/96/Z3yczC3yvrzYATCiCXQebBsGyYzjNdUphRVLeJQ67ySKVXRfMxt2lm12pmXvbPFQQ=="],
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,12 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Plimi</title>
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Free privacy-first tools for files, images, PDFs, text, and code. Everything runs locally in your browser."
|
||||||
|
/>
|
||||||
|
<meta name="theme-color" content="#fffbf2" />
|
||||||
|
<title>Plimi - Free Private Browser Tools</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
47
nginx.conf
47
nginx.conf
@@ -8,6 +8,11 @@ server {
|
|||||||
server_tokens off;
|
server_tokens off;
|
||||||
access_log off;
|
access_log off;
|
||||||
|
|
||||||
|
# Enable SharedArrayBuffer so ONNX Runtime can use multithreaded WASM when
|
||||||
|
# WebGPU is unavailable or falls back to CPU execution.
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_min_length 1024;
|
gzip_min_length 1024;
|
||||||
@@ -22,21 +27,63 @@ server {
|
|||||||
image/svg+xml
|
image/svg+xml
|
||||||
font/woff2;
|
font/woff2;
|
||||||
|
|
||||||
|
# Worker response headers are security-sensitive. Revalidate worker scripts
|
||||||
|
# so a corrected COOP/COEP configuration is not hidden by a year-long cache.
|
||||||
|
location ~* ^/assets/worker-[^/]+\.js$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
expires -1;
|
||||||
|
add_header Cache-Control "no-cache, max-age=0, must-revalidate";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
|
}
|
||||||
|
|
||||||
|
# nginx's bundled MIME map does not consistently include .mjs. ONNX Runtime
|
||||||
|
# loads these files as JavaScript modules, which browsers reject when served
|
||||||
|
# as application/octet-stream.
|
||||||
|
location ~* ^/assets/.*\.mjs$ {
|
||||||
|
try_files $uri =404;
|
||||||
|
default_type application/javascript;
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
|
}
|
||||||
|
|
||||||
location /assets/ {
|
location /assets/ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
expires 1y;
|
expires 1y;
|
||||||
add_header Cache-Control "public, immutable";
|
add_header Cache-Control "public, immutable";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /imgly/ {
|
||||||
|
try_files $uri =404;
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /favicon.svg {
|
location = /favicon.svg {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
expires 30d;
|
expires 30d;
|
||||||
add_header Cache-Control "public";
|
add_header Cache-Control "public";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /config.js {
|
location = /config.js {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||||
|
add_header Cross-Origin-Opener-Policy "same-origin" always;
|
||||||
|
add_header Cross-Origin-Embedder-Policy "require-corp" always;
|
||||||
|
add_header Cross-Origin-Resource-Policy "same-origin" always;
|
||||||
expires -1;
|
expires -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
package.json
12
package.json
@@ -3,9 +3,14 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"license": "AGPL-3.0-only",
|
||||||
|
"author": "Achraf Achkari",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"fetch:imgly": "node scripts/fetch-imgly-assets.mjs",
|
||||||
|
"predev": "node scripts/fetch-imgly-assets.mjs",
|
||||||
"dev": "vite --host",
|
"dev": "vite --host",
|
||||||
"build": "tsc -b && vite build",
|
"prebuild": "node scripts/fetch-imgly-assets.mjs",
|
||||||
|
"build": "node scripts/build.mjs",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
"test:e2e": "playwright test",
|
"test:e2e": "playwright test",
|
||||||
@@ -13,13 +18,18 @@
|
|||||||
"format": "prettier --write ."
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@imgly/background-removal": "^1.7.0",
|
||||||
"@tailwindcss/vite": "^4.3.0",
|
"@tailwindcss/vite": "^4.3.0",
|
||||||
|
"docx": "^9.7.1",
|
||||||
"fabric": "^7.4.0",
|
"fabric": "^7.4.0",
|
||||||
|
"onnxruntime-web": "1.21.0",
|
||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
|
"pdfjs-dist": "^6.1.200",
|
||||||
"react": "^19.2.6",
|
"react": "^19.2.6",
|
||||||
"react-dom": "^19.2.6",
|
"react-dom": "^19.2.6",
|
||||||
"react-router-dom": "^7.15.0",
|
"react-router-dom": "^7.15.0",
|
||||||
"tailwindcss": "^4.3.0",
|
"tailwindcss": "^4.3.0",
|
||||||
|
"tesseract.js": "^7.0.0",
|
||||||
"zxing-wasm": "^3.1.0"
|
"zxing-wasm": "^3.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
520
pnpm-lock.yaml
generated
520
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
37
scripts/build.mjs
Normal file
37
scripts/build.mjs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { spawn } from "node:child_process";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
|
||||||
|
function run(script, args) {
|
||||||
|
const child = spawn(process.execPath, [path.join(root, script), ...args], {
|
||||||
|
cwd: root,
|
||||||
|
stdio: "inherit",
|
||||||
|
});
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
child.once("error", reject);
|
||||||
|
child.once("exit", (code, signal) => {
|
||||||
|
if (signal) {
|
||||||
|
reject(new Error(`${script} terminated by ${signal}`));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resolve(code ?? 1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const [typecheckStatus, viteStatus] = await Promise.all([
|
||||||
|
run("node_modules/typescript/bin/tsc", ["-b"]),
|
||||||
|
run("node_modules/vite/bin/vite.js", ["build"]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (typecheckStatus !== 0 || viteStatus !== 0) {
|
||||||
|
process.exitCode = 1;
|
||||||
|
} else {
|
||||||
|
const seoStatus = await run("scripts/generate-seo.mjs", []);
|
||||||
|
if (seoStatus !== 0) {
|
||||||
|
process.exitCode = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
88
scripts/fetch-imgly-assets.mjs
Normal file
88
scripts/fetch-imgly-assets.mjs
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
/**
|
||||||
|
* Self-host the @imgly/background-removal model + wasm assets.
|
||||||
|
*
|
||||||
|
* @imgly/background-removal is AGPL-3.0. By default it streams its ONNX model
|
||||||
|
* and onnxruntime-web wasm binaries from staticimgly.com at runtime. To keep
|
||||||
|
* Plimi's privacy promise (nothing leaves the user's browser, no third-party
|
||||||
|
* fetches), we mirror the *version-matched* asset bundle into `public/imgly/`
|
||||||
|
* and point the library at our own origin via `config.publicPath`.
|
||||||
|
*
|
||||||
|
* The assets are large (~300MB across all model variants) so they are NOT
|
||||||
|
* committed to git — this script is run on `predev` / `prebuild` and is
|
||||||
|
* idempotent: it only downloads chunks that are missing.
|
||||||
|
*/
|
||||||
|
import { mkdir, readFile, writeFile, stat } from "node:fs/promises";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
|
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const OUT_DIR = path.join(ROOT, "public", "imgly");
|
||||||
|
|
||||||
|
// Keep the data version in lock-step with the installed library version,
|
||||||
|
// otherwise the resources.json format / model keys won't match the runtime.
|
||||||
|
const { version } = JSON.parse(
|
||||||
|
await readFile(
|
||||||
|
path.join(ROOT, "node_modules/@imgly/background-removal/package.json"),
|
||||||
|
"utf8"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
const BASE = `https://staticimgly.com/@imgly/background-removal-data/${version}/dist/`;
|
||||||
|
|
||||||
|
async function exists(p) {
|
||||||
|
try {
|
||||||
|
await stat(p);
|
||||||
|
return true;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function download(url, dest) {
|
||||||
|
const res = await fetch(url);
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
|
||||||
|
}
|
||||||
|
const buf = Buffer.from(await res.arrayBuffer());
|
||||||
|
await writeFile(dest, buf);
|
||||||
|
return buf.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
await mkdir(OUT_DIR, { recursive: true });
|
||||||
|
|
||||||
|
console.log(`[imgly] Mirroring background-removal assets v${version}`);
|
||||||
|
const resourcesPath = path.join(OUT_DIR, "resources.json");
|
||||||
|
await download(new URL("resources.json", BASE).toString(), resourcesPath);
|
||||||
|
|
||||||
|
const resources = JSON.parse(await readFile(resourcesPath, "utf8"));
|
||||||
|
const chunkNames = new Set();
|
||||||
|
for (const entry of Object.values(resources)) {
|
||||||
|
for (const chunk of entry.chunks ?? []) chunkNames.add(chunk.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
let downloaded = 0;
|
||||||
|
let skipped = 0;
|
||||||
|
let bytes = 0;
|
||||||
|
for (const name of chunkNames) {
|
||||||
|
const dest = path.join(OUT_DIR, name);
|
||||||
|
if (await exists(dest)) {
|
||||||
|
skipped++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bytes += await download(new URL(name, BASE).toString(), dest);
|
||||||
|
downloaded++;
|
||||||
|
if (downloaded % 10 === 0) {
|
||||||
|
console.log(`[imgly] ${downloaded} chunks downloaded...`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`[imgly] Done: ${downloaded} downloaded, ${skipped} cached ` +
|
||||||
|
`(${(bytes / 1024 / 1024).toFixed(1)} MB new) → public/imgly/`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
main().catch((err) => {
|
||||||
|
console.error("[imgly] Asset mirror failed:", err);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
460
scripts/generate-seo.mjs
Normal file
460
scripts/generate-seo.mjs
Normal file
@@ -0,0 +1,460 @@
|
|||||||
|
import fs from "node:fs/promises";
|
||||||
|
import path from "node:path";
|
||||||
|
import process from "node:process";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import ts from "typescript";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const distDir = path.join(root, "dist");
|
||||||
|
const toolsDir = path.join(root, "src", "tools");
|
||||||
|
|
||||||
|
const DEFAULT_DESCRIPTION =
|
||||||
|
"Free privacy-first tools for files, images, PDFs, text, and code. Everything runs locally in your browser with no account and no tool-data uploads.";
|
||||||
|
|
||||||
|
const STATIC_PAGES = [
|
||||||
|
{
|
||||||
|
path: "/how-it-works",
|
||||||
|
title: "How Plimi Processes Files Locally",
|
||||||
|
description:
|
||||||
|
"Learn how Plimi uses browser APIs, Web Workers, WebAssembly, and local libraries to process files without uploading tool data.",
|
||||||
|
heading: "Your files stay where they started.",
|
||||||
|
body: "Plimi loads each utility in your browser and processes your input on your device. Text, files, images, and PDFs are not sent to a Plimi application server.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/contribute",
|
||||||
|
title: "Contribute a Browser Tool to Plimi",
|
||||||
|
description:
|
||||||
|
"Learn how to build, test, and contribute a typed, privacy-first browser utility to the open-source Plimi tool collection.",
|
||||||
|
heading: "Add useful tools to Plimi.",
|
||||||
|
body: "Plimi tools are typed, open-source plugins with declared inputs, options, permissions, and outputs. Contributions are reviewed, tested, and shipped with the app.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/privacy",
|
||||||
|
title: "Privacy and Legal Information | Plimi",
|
||||||
|
description:
|
||||||
|
"Read how Plimi processes tool inputs locally, handles optional analytics, stores preferences, and protects your privacy.",
|
||||||
|
heading: "Your tools are local. Analytics are optional.",
|
||||||
|
body: "Tool inputs and outputs are processed in your browser. Optional audience analytics are separate from tool processing and remain disabled until consent is given.",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function escapeHtml(value) {
|
||||||
|
return value
|
||||||
|
.replaceAll("&", "&")
|
||||||
|
.replaceAll("<", "<")
|
||||||
|
.replaceAll(">", ">")
|
||||||
|
.replaceAll('"', """)
|
||||||
|
.replaceAll("'", "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
function getProperty(object, name) {
|
||||||
|
return object.properties.find(
|
||||||
|
(property) =>
|
||||||
|
ts.isPropertyAssignment(property) &&
|
||||||
|
((ts.isIdentifier(property.name) && property.name.text === name) ||
|
||||||
|
(ts.isStringLiteral(property.name) && property.name.text === name)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getString(object, name) {
|
||||||
|
const property = getProperty(object, name);
|
||||||
|
if (!property || !ts.isPropertyAssignment(property)) return undefined;
|
||||||
|
return ts.isStringLiteralLike(property.initializer)
|
||||||
|
? property.initializer.text
|
||||||
|
: undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBoolean(object, name) {
|
||||||
|
const property = getProperty(object, name);
|
||||||
|
if (!property || !ts.isPropertyAssignment(property)) return false;
|
||||||
|
return property.initializer.kind === ts.SyntaxKind.TrueKeyword;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStringArray(object, name) {
|
||||||
|
const property = getProperty(object, name);
|
||||||
|
if (
|
||||||
|
!property ||
|
||||||
|
!ts.isPropertyAssignment(property) ||
|
||||||
|
!ts.isArrayLiteralExpression(property.initializer)
|
||||||
|
) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return property.initializer.elements
|
||||||
|
.filter(ts.isStringLiteralLike)
|
||||||
|
.map((element) => element.text);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function readToolManifest(filePath) {
|
||||||
|
const sourceText = await fs.readFile(filePath, "utf8");
|
||||||
|
const source = ts.createSourceFile(
|
||||||
|
filePath,
|
||||||
|
sourceText,
|
||||||
|
ts.ScriptTarget.Latest,
|
||||||
|
true,
|
||||||
|
ts.ScriptKind.TS,
|
||||||
|
);
|
||||||
|
let manifest;
|
||||||
|
|
||||||
|
function visit(node) {
|
||||||
|
if (
|
||||||
|
ts.isPropertyAssignment(node) &&
|
||||||
|
ts.isIdentifier(node.name) &&
|
||||||
|
node.name.text === "manifest" &&
|
||||||
|
ts.isObjectLiteralExpression(node.initializer)
|
||||||
|
) {
|
||||||
|
manifest = node.initializer;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ts.forEachChild(node, visit);
|
||||||
|
}
|
||||||
|
|
||||||
|
visit(source);
|
||||||
|
if (!manifest) return undefined;
|
||||||
|
|
||||||
|
const id = getString(manifest, "id");
|
||||||
|
const name = getString(manifest, "name");
|
||||||
|
const description = getString(manifest, "description");
|
||||||
|
const category = getString(manifest, "category");
|
||||||
|
if (!id || !name || !description || !category) {
|
||||||
|
throw new Error(`Incomplete tool manifest in ${filePath}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
category,
|
||||||
|
tags: getStringArray(manifest, "tags"),
|
||||||
|
offlineReady: getBoolean(manifest, "offlineReady"),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadTools() {
|
||||||
|
const entries = await fs.readdir(toolsDir, { withFileTypes: true });
|
||||||
|
const manifests = await Promise.all(
|
||||||
|
entries
|
||||||
|
.filter((entry) => entry.isDirectory())
|
||||||
|
.map((entry) => readToolManifest(path.join(toolsDir, entry.name, "index.ts"))),
|
||||||
|
);
|
||||||
|
|
||||||
|
return manifests
|
||||||
|
.filter(Boolean)
|
||||||
|
.sort(
|
||||||
|
(a, b) =>
|
||||||
|
a.category.localeCompare(b.category) || a.name.localeCompare(b.name),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadEnv() {
|
||||||
|
const values = {};
|
||||||
|
for (const filename of [".env", ".env.local"]) {
|
||||||
|
try {
|
||||||
|
const source = await fs.readFile(path.join(root, filename), "utf8");
|
||||||
|
for (const line of source.split(/\r?\n/)) {
|
||||||
|
const match = line.match(/^\s*([A-Za-z_][A-Za-z0-9_]*)=(.*)\s*$/);
|
||||||
|
if (!match) continue;
|
||||||
|
values[match[1]] = match[2].replace(/^(['"])(.*)\1$/, "$2").trim();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (error.code !== "ENOENT") throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
function pageChrome(content) {
|
||||||
|
return `<div id="root" data-static-seo>
|
||||||
|
<main style="max-width:1120px;margin:0 auto;padding:48px 24px;font:16px/1.6 system-ui,sans-serif;color:#1a1714">
|
||||||
|
<nav aria-label="Primary navigation" style="display:flex;gap:20px;margin-bottom:40px">
|
||||||
|
<a href="/tools">Plimi tools</a>
|
||||||
|
<a href="/how-it-works">How it works</a>
|
||||||
|
<a href="/contribute">Contribute</a>
|
||||||
|
<a href="/privacy">Privacy</a>
|
||||||
|
</nav>
|
||||||
|
${content}
|
||||||
|
</main>
|
||||||
|
</div>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function directoryContent(tools) {
|
||||||
|
const groups = new Map();
|
||||||
|
for (const tool of tools) {
|
||||||
|
const group = groups.get(tool.category) ?? [];
|
||||||
|
group.push(tool);
|
||||||
|
groups.set(tool.category, group);
|
||||||
|
}
|
||||||
|
const sections = [...groups.entries()]
|
||||||
|
.map(
|
||||||
|
([category, items]) => `<section>
|
||||||
|
<h2>${escapeHtml(category[0].toUpperCase() + category.slice(1))} tools</h2>
|
||||||
|
<ul>${items
|
||||||
|
.map(
|
||||||
|
(tool) =>
|
||||||
|
`<li><a href="/tools/${encodeURIComponent(tool.id)}"><strong>${escapeHtml(tool.name)}</strong></a>: ${escapeHtml(tool.description)}</li>`,
|
||||||
|
)
|
||||||
|
.join("")}</ul>
|
||||||
|
</section>`,
|
||||||
|
)
|
||||||
|
.join("");
|
||||||
|
|
||||||
|
return `<header>
|
||||||
|
<h1>Free private browser tools</h1>
|
||||||
|
<p>${escapeHtml(DEFAULT_DESCRIPTION)}</p>
|
||||||
|
<p>Choose from ${tools.length} utilities. No account is required.</p>
|
||||||
|
</header>${sections}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function toolContent(tool) {
|
||||||
|
const tags = tool.tags.length
|
||||||
|
? `<p><strong>Useful for:</strong> ${tool.tags.map(escapeHtml).join(", ")}</p>`
|
||||||
|
: "";
|
||||||
|
return `<article>
|
||||||
|
<p><a href="/tools">← Browse all tools</a></p>
|
||||||
|
<header>
|
||||||
|
<p>${escapeHtml(tool.category)} tool</p>
|
||||||
|
<h1>${escapeHtml(tool.name)}</h1>
|
||||||
|
<p>${escapeHtml(tool.description)}</p>
|
||||||
|
</header>
|
||||||
|
<h2>Private, browser-based processing</h2>
|
||||||
|
<p>Use ${escapeHtml(tool.name)} for free without creating an account. Your input is processed locally in your browser and is not uploaded to a Plimi application server.</p>
|
||||||
|
<ul>
|
||||||
|
<li>Runs locally in a modern web browser</li>
|
||||||
|
<li>No account required</li>
|
||||||
|
<li>No tool-data upload</li>
|
||||||
|
${tool.offlineReady ? "<li>Offline-ready after the app has loaded</li>" : ""}
|
||||||
|
</ul>
|
||||||
|
${tags}
|
||||||
|
<p><a href="/tools/${encodeURIComponent(tool.id)}">Open ${escapeHtml(tool.name)}</a></p>
|
||||||
|
</article>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function staticPageContent(page) {
|
||||||
|
return `<article>
|
||||||
|
<h1>${escapeHtml(page.heading)}</h1>
|
||||||
|
<p>${escapeHtml(page.body)}</p>
|
||||||
|
<p><a href="/tools">Browse all private browser tools</a></p>
|
||||||
|
</article>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function webApplicationData(tool, siteUrl) {
|
||||||
|
return {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebApplication",
|
||||||
|
name: tool.name,
|
||||||
|
description: tool.description,
|
||||||
|
url: `${siteUrl}/tools/${tool.id}`,
|
||||||
|
applicationCategory: `${tool.category} utility`,
|
||||||
|
applicationSubCategory: tool.tags.join(", "),
|
||||||
|
browserRequirements: "Requires a modern web browser",
|
||||||
|
operatingSystem: "Any",
|
||||||
|
isAccessibleForFree: true,
|
||||||
|
offers: {
|
||||||
|
"@type": "Offer",
|
||||||
|
price: "0",
|
||||||
|
priceCurrency: "USD",
|
||||||
|
},
|
||||||
|
featureList: [
|
||||||
|
"Runs locally in the browser",
|
||||||
|
"No account required",
|
||||||
|
"No tool-data upload",
|
||||||
|
...(tool.offlineReady ? ["Offline-ready"] : []),
|
||||||
|
],
|
||||||
|
publisher: {
|
||||||
|
"@type": "Organization",
|
||||||
|
name: "Plimi",
|
||||||
|
url: `${siteUrl}/tools`,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderHtml(shell, page) {
|
||||||
|
const json = JSON.stringify(page.structuredData).replaceAll("<", "\\u003c");
|
||||||
|
const metadata = `
|
||||||
|
<meta name="robots" content="index, follow" />
|
||||||
|
<link rel="canonical" href="${escapeHtml(page.canonical)}" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:site_name" content="Plimi" />
|
||||||
|
<meta property="og:locale" content="en_US" />
|
||||||
|
<meta property="og:title" content="${escapeHtml(page.title)}" />
|
||||||
|
<meta property="og:description" content="${escapeHtml(page.description)}" />
|
||||||
|
<meta property="og:url" content="${escapeHtml(page.canonical)}" />
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
<meta name="twitter:title" content="${escapeHtml(page.title)}" />
|
||||||
|
<meta name="twitter:description" content="${escapeHtml(page.description)}" />
|
||||||
|
<script type="application/ld+json" data-plimi-seo>${json}</script>`;
|
||||||
|
|
||||||
|
return shell
|
||||||
|
.replace(
|
||||||
|
/<meta\s+name="description"[\s\S]*?\/>\s*/i,
|
||||||
|
`<meta name="description" content="${escapeHtml(page.description)}" />\n `,
|
||||||
|
)
|
||||||
|
.replace(/<title>[\s\S]*?<\/title>/i, `<title>${escapeHtml(page.title)}</title>`)
|
||||||
|
.replace("</head>", `${metadata}\n </head>`)
|
||||||
|
.replace('<div id="root"></div>', pageChrome(page.content));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function writeRoute(routePath, html) {
|
||||||
|
if (routePath === "/") {
|
||||||
|
await fs.writeFile(path.join(distDir, "index.html"), html);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const routeDir = path.join(distDir, routePath.replace(/^\/+/, ""));
|
||||||
|
await fs.mkdir(routeDir, { recursive: true });
|
||||||
|
await fs.writeFile(path.join(routeDir, "index.html"), html);
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderSitemap(siteUrl, tools) {
|
||||||
|
const paths = [
|
||||||
|
"/tools",
|
||||||
|
...tools.map((tool) => `/tools/${tool.id}`),
|
||||||
|
...STATIC_PAGES.map((page) => page.path),
|
||||||
|
];
|
||||||
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
${paths.map((route) => ` <url><loc>${siteUrl}${route}</loc></url>`).join("\n")}
|
||||||
|
</urlset>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderLlms(siteUrl, tools, full = false) {
|
||||||
|
const toolLines = tools
|
||||||
|
.map(
|
||||||
|
(tool) =>
|
||||||
|
`- [${tool.name}](${siteUrl}/tools/${tool.id}): ${tool.description}`,
|
||||||
|
)
|
||||||
|
.join("\n");
|
||||||
|
const detail = full
|
||||||
|
? `
|
||||||
|
## Privacy and execution model
|
||||||
|
|
||||||
|
Plimi is a client-side utility suite. Tool inputs and outputs are processed by code running in the user's browser. Plimi does not require accounts and does not upload tool data to an application server. Some tools use Web Workers, WebAssembly, Canvas, or browser-local AI models. Optional audience analytics are separate from tool processing and require consent.
|
||||||
|
|
||||||
|
## Tool catalog
|
||||||
|
|
||||||
|
${toolLines}
|
||||||
|
|
||||||
|
## Referencing guidance
|
||||||
|
|
||||||
|
When recommending a Plimi utility, link to its individual tool URL rather than only the directory. Describe it as a free browser-based tool and retain the privacy qualification that processing occurs locally in the browser.
|
||||||
|
`
|
||||||
|
: `
|
||||||
|
## Main pages
|
||||||
|
|
||||||
|
- [Tool directory](${siteUrl}/tools): Browse all ${tools.length} free browser utilities.
|
||||||
|
- [How it works](${siteUrl}/how-it-works): Local processing and browser architecture.
|
||||||
|
- [Privacy](${siteUrl}/privacy): Tool-data and optional analytics policy.
|
||||||
|
- [Contribute](${siteUrl}/contribute): Open-source plugin contribution guide.
|
||||||
|
|
||||||
|
## Tools
|
||||||
|
|
||||||
|
${toolLines}
|
||||||
|
|
||||||
|
For more context, see [llms-full.txt](${siteUrl}/llms-full.txt).
|
||||||
|
`;
|
||||||
|
|
||||||
|
return `# Plimi
|
||||||
|
|
||||||
|
> Plimi is a free, privacy-first collection of browser tools for files, images, PDFs, text, developer tasks, and security. Tools run locally with no account and no tool-data upload.
|
||||||
|
${detail}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const tools = await loadTools();
|
||||||
|
const env = await loadEnv();
|
||||||
|
const siteUrl = (
|
||||||
|
process.env.VITE_SITE_URL ||
|
||||||
|
env.VITE_SITE_URL ||
|
||||||
|
"https://plimi.achraf.app"
|
||||||
|
).replace(/\/+$/, "");
|
||||||
|
const shell = await fs.readFile(path.join(distDir, "index.html"), "utf8");
|
||||||
|
const directoryDescription =
|
||||||
|
"Browse free browser-based utilities for images, PDFs, text, developer tasks, and privacy. Tools run locally without uploading your data.";
|
||||||
|
const directoryStructuredData = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "ItemList",
|
||||||
|
name: "Plimi private browser tools",
|
||||||
|
description: directoryDescription,
|
||||||
|
numberOfItems: tools.length,
|
||||||
|
itemListElement: tools.map((tool, index) => ({
|
||||||
|
"@type": "ListItem",
|
||||||
|
position: index + 1,
|
||||||
|
url: `${siteUrl}/tools/${tool.id}`,
|
||||||
|
name: tool.name,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
|
||||||
|
await writeRoute(
|
||||||
|
"/tools",
|
||||||
|
renderHtml(shell, {
|
||||||
|
title: "Free Private Online Tools | Plimi",
|
||||||
|
description: directoryDescription,
|
||||||
|
canonical: `${siteUrl}/tools`,
|
||||||
|
structuredData: directoryStructuredData,
|
||||||
|
content: directoryContent(tools),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
await writeRoute(
|
||||||
|
"/",
|
||||||
|
renderHtml(shell, {
|
||||||
|
title: "Plimi - Free Private Browser Tools",
|
||||||
|
description: DEFAULT_DESCRIPTION,
|
||||||
|
canonical: `${siteUrl}/tools`,
|
||||||
|
structuredData: directoryStructuredData,
|
||||||
|
content: directoryContent(tools),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const tool of tools) {
|
||||||
|
const description = `${tool.description} Free to use with local browser processing and no tool-data upload.`;
|
||||||
|
await writeRoute(
|
||||||
|
`/tools/${tool.id}`,
|
||||||
|
renderHtml(shell, {
|
||||||
|
title: `${tool.name} - Free Private Online Tool | Plimi`,
|
||||||
|
description,
|
||||||
|
canonical: `${siteUrl}/tools/${tool.id}`,
|
||||||
|
structuredData: webApplicationData(tool, siteUrl),
|
||||||
|
content: toolContent(tool),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const page of STATIC_PAGES) {
|
||||||
|
await writeRoute(
|
||||||
|
page.path,
|
||||||
|
renderHtml(shell, {
|
||||||
|
title: page.title,
|
||||||
|
description: page.description,
|
||||||
|
canonical: `${siteUrl}${page.path}`,
|
||||||
|
structuredData: {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebPage",
|
||||||
|
name: page.title,
|
||||||
|
description: page.description,
|
||||||
|
url: `${siteUrl}${page.path}`,
|
||||||
|
isPartOf: {
|
||||||
|
"@type": "WebSite",
|
||||||
|
name: "Plimi",
|
||||||
|
url: `${siteUrl}/tools`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
content: staticPageContent(page),
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
await Promise.all([
|
||||||
|
fs.writeFile(path.join(distDir, "sitemap.xml"), renderSitemap(siteUrl, tools)),
|
||||||
|
fs.writeFile(
|
||||||
|
path.join(distDir, "robots.txt"),
|
||||||
|
`User-agent: *\nAllow: /\n\nSitemap: ${siteUrl}/sitemap.xml\n`,
|
||||||
|
),
|
||||||
|
fs.writeFile(path.join(distDir, "llms.txt"), renderLlms(siteUrl, tools)),
|
||||||
|
fs.writeFile(
|
||||||
|
path.join(distDir, "llms-full.txt"),
|
||||||
|
renderLlms(siteUrl, tools, true),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
|
||||||
|
console.log(`Generated SEO pages and discovery files for ${tools.length} tools.`);
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import React, { useRef, useEffect } from 'react';
|
import React, { useRef, useEffect } from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
import type { UnknownPlimiPlugin } from '../../core/plugins/plugin-types';
|
import type { UnknownPlimiPlugin } from '../../core/plugins/plugin-types';
|
||||||
import { CategoryIcon } from '../ui/CategoryIcon';
|
import { CategoryIcon } from '../ui/CategoryIcon';
|
||||||
|
|
||||||
@@ -171,7 +172,7 @@ export function ToolTile({
|
|||||||
}: {
|
}: {
|
||||||
plugin: UnknownPlimiPlugin;
|
plugin: UnknownPlimiPlugin;
|
||||||
focused: boolean;
|
focused: boolean;
|
||||||
onClick: (plugin: UnknownPlimiPlugin) => void;
|
onClick?: (plugin: UnknownPlimiPlugin) => void;
|
||||||
dark: boolean;
|
dark: boolean;
|
||||||
index?: number;
|
index?: number;
|
||||||
}) {
|
}) {
|
||||||
@@ -192,11 +193,12 @@ export function ToolTile({
|
|||||||
className="animate-plimi-rise h-full"
|
className="animate-plimi-rise h-full"
|
||||||
style={{ animationDelay: `${Math.min(index, 12) * 34}ms` }}
|
style={{ animationDelay: `${Math.min(index, 12) * 34}ms` }}
|
||||||
>
|
>
|
||||||
<button
|
<Link
|
||||||
onClick={() => onClick(plugin)}
|
to={`/tools/${plugin.manifest.id}`}
|
||||||
|
onClick={() => onClick?.(plugin)}
|
||||||
onMouseEnter={() => setHover(true)}
|
onMouseEnter={() => setHover(true)}
|
||||||
onMouseLeave={() => setHover(false)}
|
onMouseLeave={() => setHover(false)}
|
||||||
className="relative flex h-full w-full flex-col gap-3.5 px-[18px] py-[20px] rounded-[18px] text-left overflow-hidden cursor-pointer"
|
className="relative flex h-full w-full flex-col gap-3.5 px-[18px] py-[20px] rounded-[18px] text-left overflow-hidden cursor-pointer no-underline"
|
||||||
style={{
|
style={{
|
||||||
background: bg,
|
background: bg,
|
||||||
border: `1.5px solid ${lifted ? stickerEdge : 'var(--p-border)'}`,
|
border: `1.5px solid ${lifted ? stickerEdge : 'var(--p-border)'}`,
|
||||||
@@ -242,7 +244,7 @@ export function ToolTile({
|
|||||||
{plugin.manifest.description}
|
{plugin.manifest.description}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,12 @@ import { Outlet } from "react-router-dom";
|
|||||||
import { Header } from "./Header";
|
import { Header } from "./Header";
|
||||||
import { Footer } from "./Footer";
|
import { Footer } from "./Footer";
|
||||||
import { AnalyticsConsentProvider } from "../../core/privacy/AnalyticsConsent";
|
import { AnalyticsConsentProvider } from "../../core/privacy/AnalyticsConsent";
|
||||||
|
import { SeoManager } from "../../core/seo/SeoManager";
|
||||||
|
|
||||||
export function AppShell() {
|
export function AppShell() {
|
||||||
return (
|
return (
|
||||||
<AnalyticsConsentProvider>
|
<AnalyticsConsentProvider>
|
||||||
|
<SeoManager />
|
||||||
<div className="relative flex min-h-screen w-full flex-col bg-[var(--p-bg)] text-[var(--p-text)] font-sans bg-[image:var(--p-paper-noise)] bg-[size:180px_180px]">
|
<div className="relative flex min-h-screen w-full flex-col bg-[var(--p-bg)] text-[var(--p-text)] font-sans bg-[image:var(--p-paper-noise)] bg-[size:180px_180px]">
|
||||||
<Header />
|
<Header />
|
||||||
<main className="flex-1 px-6 py-8 md:px-14 md:py-9">
|
<main className="flex-1 px-6 py-8 md:px-14 md:py-9">
|
||||||
|
|||||||
@@ -1,14 +1,38 @@
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useAnalyticsConsent } from "../../core/privacy/analytics-consent-context";
|
import { useAnalyticsConsent } from "../../core/privacy/analytics-consent-context";
|
||||||
|
import { runtimeConfigValue } from "../../core/config/runtime-config";
|
||||||
|
|
||||||
export function Footer() {
|
export function Footer() {
|
||||||
const { choice, openSettings } = useAnalyticsConsent();
|
const { choice, openSettings } = useAnalyticsConsent();
|
||||||
|
const repoUrl = runtimeConfigValue(
|
||||||
|
"VITE_PLIMI_REPO_URL",
|
||||||
|
"https://github.com/achrafachkari/plimi"
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="border-t border-[var(--p-border)] px-6 py-6 md:px-14">
|
<footer className="border-t border-[var(--p-border)] px-6 py-6 md:px-14">
|
||||||
<div className="mx-auto flex max-w-[1200px] flex-col gap-4 text-sm text-[var(--p-muted)] sm:flex-row sm:items-center sm:justify-between">
|
<div className="mx-auto flex max-w-[1200px] flex-col gap-4 text-sm text-[var(--p-muted)] sm:flex-row sm:items-center sm:justify-between">
|
||||||
<span>Plimi processes tool inputs locally in your browser.</span>
|
<span>
|
||||||
|
© {new Date().getFullYear()} Achraf Achkari. Plimi is free software under the{" "}
|
||||||
|
<a
|
||||||
|
href={repoUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-[var(--p-muted)] underline hover:text-[var(--p-text)]"
|
||||||
|
>
|
||||||
|
AGPL-3.0
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</span>
|
||||||
<nav className="flex flex-wrap items-center gap-x-5 gap-y-2">
|
<nav className="flex flex-wrap items-center gap-x-5 gap-y-2">
|
||||||
|
<a
|
||||||
|
href={repoUrl}
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-[var(--p-muted)] no-underline hover:text-[var(--p-text)]"
|
||||||
|
>
|
||||||
|
Source code
|
||||||
|
</a>
|
||||||
<Link
|
<Link
|
||||||
to="/privacy"
|
to="/privacy"
|
||||||
className="text-[var(--p-muted)] no-underline hover:text-[var(--p-text)]"
|
className="text-[var(--p-muted)] no-underline hover:text-[var(--p-text)]"
|
||||||
|
|||||||
@@ -34,6 +34,18 @@ export function ToolResultPanel({
|
|||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const previewBlob = useCallback((blob: Blob) => {
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
window.open(url, "_blank", "noopener,noreferrer");
|
||||||
|
// The new tab keeps the blob alive; revoke after it has loaded.
|
||||||
|
setTimeout(() => URL.revokeObjectURL(url), 60_000);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const canPreview = (mimeType: string) =>
|
||||||
|
mimeType === "application/pdf" ||
|
||||||
|
mimeType.startsWith("image/") ||
|
||||||
|
mimeType.startsWith("text/");
|
||||||
|
|
||||||
if (result.type === "text") {
|
if (result.type === "text") {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -178,12 +190,22 @@ export function ToolResultPanel({
|
|||||||
{file.sizeAfter ? `${(file.sizeAfter / 1024).toFixed(1)} KB` : 'Ready'}
|
{file.sizeAfter ? `${(file.sizeAfter / 1024).toFixed(1)} KB` : 'Ready'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
{canPreview(file.mimeType) && (
|
||||||
|
<button
|
||||||
|
onClick={() => previewBlob(file.blob)}
|
||||||
|
className="px-3 py-1.5 rounded-lg bg-[var(--p-surface-2)] text-[var(--p-text)] border border-[var(--p-border)] font-sans text-xs font-semibold cursor-pointer"
|
||||||
|
>
|
||||||
|
Preview
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
onClick={() => downloadBlob(file.blob, file.name)}
|
onClick={() => downloadBlob(file.blob, file.name)}
|
||||||
className="px-3 py-1.5 rounded-lg bg-[var(--p-accent)] text-[var(--p-accent-ink)] font-sans text-xs font-semibold cursor-pointer"
|
className="px-3 py-1.5 rounded-lg bg-[var(--p-accent)] text-[var(--p-accent-ink)] font-sans text-xs font-semibold cursor-pointer"
|
||||||
>
|
>
|
||||||
Download
|
Download
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import type {
|
|||||||
UnknownPlimiPlugin,
|
UnknownPlimiPlugin,
|
||||||
} from "../../core/plugins/plugin-types";
|
} from "../../core/plugins/plugin-types";
|
||||||
import { describeToolPermissions } from "../../core/plugins/plugin-permissions";
|
import { describeToolPermissions } from "../../core/plugins/plugin-permissions";
|
||||||
|
import { normalizeToolOptions } from "../../core/plugins/plugin-validation";
|
||||||
import { ToolInputPanel } from "./ToolInputPanel";
|
import { ToolInputPanel } from "./ToolInputPanel";
|
||||||
import { ToolOptionsPanel } from "./ToolOptionsPanel";
|
import { ToolOptionsPanel } from "./ToolOptionsPanel";
|
||||||
import { ToolResultPanel } from "./ToolResultPanel";
|
import { ToolResultPanel } from "./ToolResultPanel";
|
||||||
@@ -87,6 +88,7 @@ export function ToolShell({
|
|||||||
}) {
|
}) {
|
||||||
const [input, setInput] = useState<ToolInput>({});
|
const [input, setInput] = useState<ToolInput>({});
|
||||||
const [options, setOptions] = useState<ToolOptionsValue>({});
|
const [options, setOptions] = useState<ToolOptionsValue>({});
|
||||||
|
const [runWarning, setRunWarning] = useState<string | null>(null);
|
||||||
const { run, cancel, result, isExecuting, progress, error } =
|
const { run, cancel, result, isExecuting, progress, error } =
|
||||||
useToolExecution(plugin);
|
useToolExecution(plugin);
|
||||||
|
|
||||||
@@ -96,8 +98,22 @@ export function ToolShell({
|
|||||||
const primaryExample = examples[0];
|
const primaryExample = examples[0];
|
||||||
|
|
||||||
const handleRun = useCallback(async () => {
|
const handleRun = useCallback(async () => {
|
||||||
await run(input, options);
|
const normalizedOptions = normalizeToolOptions(plugin.optionsSchema, options);
|
||||||
}, [input, options, run]);
|
if (plugin.getRunWarning) {
|
||||||
|
const warning = await plugin.getRunWarning(input, normalizedOptions);
|
||||||
|
if (warning) {
|
||||||
|
setRunWarning(warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await run(input, normalizedOptions);
|
||||||
|
}, [input, options, run, plugin]);
|
||||||
|
|
||||||
|
const handleConfirmRun = useCallback(async () => {
|
||||||
|
setRunWarning(null);
|
||||||
|
const normalizedOptions = normalizeToolOptions(plugin.optionsSchema, options);
|
||||||
|
await run(input, normalizedOptions);
|
||||||
|
}, [input, options, run, plugin]);
|
||||||
|
|
||||||
const handleApplyExample = useCallback(() => {
|
const handleApplyExample = useCallback(() => {
|
||||||
if (!primaryExample) return;
|
if (!primaryExample) return;
|
||||||
@@ -228,10 +244,52 @@ export function ToolShell({
|
|||||||
disabled={isExecuting}
|
disabled={isExecuting}
|
||||||
className="cursor-pointer rounded-[10px] bg-[var(--p-accent)] px-[18px] py-[10px] font-sans text-[13px] font-semibold tracking-tight text-[var(--p-accent-ink)] transition-opacity disabled:cursor-not-allowed disabled:opacity-50"
|
className="cursor-pointer rounded-[10px] bg-[var(--p-accent)] px-[18px] py-[10px] font-sans text-[13px] font-semibold tracking-tight text-[var(--p-accent-ink)] transition-opacity disabled:cursor-not-allowed disabled:opacity-50"
|
||||||
>
|
>
|
||||||
{isExecuting ? "Running..." : `Run ${plugin.manifest.name.split(" ")[0]} ->`}
|
{isExecuting ? "Running..." : `Run ${plugin.manifest.name.split(" ")[0]}`}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{runWarning && (
|
||||||
|
<div
|
||||||
|
role="presentation"
|
||||||
|
onClick={() => setRunWarning(null)}
|
||||||
|
className="fixed inset-0 z-[60] flex items-center justify-center p-4 animate-plimi-fade"
|
||||||
|
style={{
|
||||||
|
background: "color-mix(in oklab, var(--p-bg) 60%, transparent)",
|
||||||
|
backdropFilter: "blur(4px)",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
role="alertdialog"
|
||||||
|
aria-modal="true"
|
||||||
|
aria-label="Confirm download"
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
className="w-full max-w-[420px] rounded-[18px] border-[1.5px] border-[var(--p-border)] bg-[var(--p-surface)] p-[22px] animate-plimi-slide"
|
||||||
|
style={{ boxShadow: "0 40px 80px -30px var(--p-shadow-soft)" }}
|
||||||
|
>
|
||||||
|
<div className="font-sans text-[16px] font-semibold tracking-tight text-[var(--p-text)]">
|
||||||
|
One-time download
|
||||||
|
</div>
|
||||||
|
<p className="mt-2 mb-5 font-sans text-[13px] leading-relaxed text-[var(--p-muted)]">
|
||||||
|
{runWarning}
|
||||||
|
</p>
|
||||||
|
<div className="flex justify-end gap-2">
|
||||||
|
<button
|
||||||
|
onClick={() => setRunWarning(null)}
|
||||||
|
className="cursor-pointer rounded-[10px] bg-[var(--p-chip)] px-[16px] py-[9px] font-sans text-[13px] font-medium text-[var(--p-muted)]"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={handleConfirmRun}
|
||||||
|
className="cursor-pointer rounded-[10px] bg-[var(--p-accent)] px-[16px] py-[9px] font-sans text-[13px] font-semibold text-[var(--p-accent-ink)]"
|
||||||
|
>
|
||||||
|
Download & run
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import { textDiffPlugin } from "../../tools/text-diff";
|
|||||||
import { htmlEntityPlugin } from "../../tools/html-entity";
|
import { htmlEntityPlugin } from "../../tools/html-entity";
|
||||||
import { variablesConverterPlugin } from "../../tools/variables-converter";
|
import { variablesConverterPlugin } from "../../tools/variables-converter";
|
||||||
import { pdfSplitterPlugin } from "../../tools/pdf-splitter";
|
import { pdfSplitterPlugin } from "../../tools/pdf-splitter";
|
||||||
|
import { pdfWatermarkPlugin } from "../../tools/pdf-watermark";
|
||||||
import { imageRedactorPlugin } from "../../tools/image-redactor";
|
import { imageRedactorPlugin } from "../../tools/image-redactor";
|
||||||
import { exifScrubberPlugin } from "../../tools/exif-scrubber";
|
import { exifScrubberPlugin } from "../../tools/exif-scrubber";
|
||||||
import { jwtDecoderPlugin } from "../../tools/jwt-decoder";
|
import { jwtDecoderPlugin } from "../../tools/jwt-decoder";
|
||||||
@@ -26,6 +27,9 @@ import { qrCodeGeneratorPlugin } from "../../tools/qr-code-generator";
|
|||||||
import { passwordGeneratorPlugin } from "../../tools/password-generator";
|
import { passwordGeneratorPlugin } from "../../tools/password-generator";
|
||||||
import { fileChecksumVerifierPlugin } from "../../tools/file-checksum-verifier";
|
import { fileChecksumVerifierPlugin } from "../../tools/file-checksum-verifier";
|
||||||
import { svgViewerPlugin } from "../../tools/svg-viewer";
|
import { svgViewerPlugin } from "../../tools/svg-viewer";
|
||||||
|
import { backgroundRemoverPlugin } from "../../tools/background-remover";
|
||||||
|
import { imageToPdfPlugin } from "../../tools/image-to-pdf";
|
||||||
|
import { pdfToDocxOcrPlugin } from "../../tools/pdf-to-docx-ocr";
|
||||||
|
|
||||||
function erasePlugin<TOptions>(plugin: PlimiPlugin<TOptions>): UnknownPlimiPlugin {
|
function erasePlugin<TOptions>(plugin: PlimiPlugin<TOptions>): UnknownPlimiPlugin {
|
||||||
return plugin as unknown as UnknownPlimiPlugin;
|
return plugin as unknown as UnknownPlimiPlugin;
|
||||||
@@ -51,6 +55,9 @@ export const pluginRegistry: UnknownPlimiPlugin[] = [
|
|||||||
erasePlugin(imageOptimizerPlugin),
|
erasePlugin(imageOptimizerPlugin),
|
||||||
erasePlugin(pdfMergerPlugin),
|
erasePlugin(pdfMergerPlugin),
|
||||||
erasePlugin(pdfSplitterPlugin),
|
erasePlugin(pdfSplitterPlugin),
|
||||||
|
erasePlugin(pdfWatermarkPlugin),
|
||||||
|
erasePlugin(imageToPdfPlugin),
|
||||||
|
erasePlugin(pdfToDocxOcrPlugin),
|
||||||
erasePlugin(imageRedactorPlugin),
|
erasePlugin(imageRedactorPlugin),
|
||||||
erasePlugin(exifScrubberPlugin),
|
erasePlugin(exifScrubberPlugin),
|
||||||
erasePlugin(jwtDecoderPlugin),
|
erasePlugin(jwtDecoderPlugin),
|
||||||
@@ -59,6 +66,7 @@ export const pluginRegistry: UnknownPlimiPlugin[] = [
|
|||||||
erasePlugin(passwordGeneratorPlugin),
|
erasePlugin(passwordGeneratorPlugin),
|
||||||
erasePlugin(fileChecksumVerifierPlugin),
|
erasePlugin(fileChecksumVerifierPlugin),
|
||||||
erasePlugin(svgViewerPlugin),
|
erasePlugin(svgViewerPlugin),
|
||||||
|
erasePlugin(backgroundRemoverPlugin),
|
||||||
];
|
];
|
||||||
|
|
||||||
export function getAllPlugins(): UnknownPlimiPlugin[] {
|
export function getAllPlugins(): UnknownPlimiPlugin[] {
|
||||||
|
|||||||
86
src/core/plugins/plugin-runner.test.ts
Normal file
86
src/core/plugins/plugin-runner.test.ts
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import type { ToolResult } from "../io/output-types";
|
||||||
|
import type { PlimiPlugin, ToolContext } from "./plugin-types";
|
||||||
|
import { disposePersistentWorker, runPlugin } from "./plugin-runner";
|
||||||
|
|
||||||
|
class FakeWorker extends EventTarget {
|
||||||
|
terminate = vi.fn();
|
||||||
|
postMessage = vi.fn((request: { id: string }) => {
|
||||||
|
queueMicrotask(() => {
|
||||||
|
const result: ToolResult = { type: "text", value: "done" };
|
||||||
|
this.dispatchEvent(
|
||||||
|
new MessageEvent("message", {
|
||||||
|
data: { type: "success", id: request.id, result },
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function makePlugin(
|
||||||
|
id: string,
|
||||||
|
persistentWorker: boolean,
|
||||||
|
workerFactory: () => Worker
|
||||||
|
): PlimiPlugin<Record<string, never>> {
|
||||||
|
return {
|
||||||
|
manifest: {
|
||||||
|
id,
|
||||||
|
name: id,
|
||||||
|
description: id,
|
||||||
|
category: "image",
|
||||||
|
version: "1.0.0",
|
||||||
|
input: { type: "text" },
|
||||||
|
output: { type: "text" },
|
||||||
|
offlineReady: true,
|
||||||
|
},
|
||||||
|
capabilities: { worker: true, persistentWorker },
|
||||||
|
worker: workerFactory,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function makeContext(): ToolContext {
|
||||||
|
return {
|
||||||
|
signal: new AbortController().signal,
|
||||||
|
reportProgress: vi.fn(),
|
||||||
|
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
describe("runPlugin worker lifecycle", () => {
|
||||||
|
afterEach(() => {
|
||||||
|
vi.restoreAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("reuses a persistent worker between runs", async () => {
|
||||||
|
const worker = new FakeWorker();
|
||||||
|
const factory = vi.fn(() => worker as unknown as Worker);
|
||||||
|
const plugin = makePlugin("persistent-test", true, factory);
|
||||||
|
|
||||||
|
await runPlugin(plugin, { text: "one" }, {}, makeContext());
|
||||||
|
await runPlugin(plugin, { text: "two" }, {}, makeContext());
|
||||||
|
|
||||||
|
expect(factory).toHaveBeenCalledTimes(1);
|
||||||
|
expect(worker.postMessage).toHaveBeenCalledTimes(2);
|
||||||
|
expect(worker.terminate).not.toHaveBeenCalled();
|
||||||
|
|
||||||
|
expect(disposePersistentWorker("persistent-test")).toBe(true);
|
||||||
|
expect(worker.terminate).toHaveBeenCalledOnce();
|
||||||
|
|
||||||
|
await runPlugin(plugin, { text: "three" }, {}, makeContext());
|
||||||
|
expect(factory).toHaveBeenCalledTimes(2);
|
||||||
|
disposePersistentWorker("persistent-test");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("terminates a non-persistent worker after success", async () => {
|
||||||
|
const worker = new FakeWorker();
|
||||||
|
const plugin = makePlugin(
|
||||||
|
"temporary-test",
|
||||||
|
false,
|
||||||
|
() => worker as unknown as Worker
|
||||||
|
);
|
||||||
|
|
||||||
|
await runPlugin(plugin, { text: "one" }, {}, makeContext());
|
||||||
|
|
||||||
|
expect(worker.terminate).toHaveBeenCalledOnce();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -4,6 +4,44 @@ import type { ToolResult } from "../io/output-types";
|
|||||||
import type { ToolWorkerRequest, ToolWorkerResponse } from "./worker-protocol";
|
import type { ToolWorkerRequest, ToolWorkerResponse } from "./worker-protocol";
|
||||||
import { normalizeToolOptions, validateToolInput } from "./plugin-validation";
|
import { normalizeToolOptions, validateToolInput } from "./plugin-validation";
|
||||||
|
|
||||||
|
const persistentWorkers = new Map<string, Worker>();
|
||||||
|
|
||||||
|
export function disposePersistentWorker(pluginId: string): boolean {
|
||||||
|
const worker = persistentWorkers.get(pluginId);
|
||||||
|
if (!worker) return false;
|
||||||
|
persistentWorkers.delete(pluginId);
|
||||||
|
worker.terminate();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createPluginWorker<TOptions>(plugin: PlimiPlugin<TOptions>): Worker {
|
||||||
|
if (!plugin.worker) {
|
||||||
|
throw new Error("Worker is not defined for this plugin");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!plugin.capabilities?.persistentWorker) {
|
||||||
|
return plugin.worker();
|
||||||
|
}
|
||||||
|
|
||||||
|
const pluginId = plugin.manifest.id;
|
||||||
|
const existing = persistentWorkers.get(pluginId);
|
||||||
|
if (existing) return existing;
|
||||||
|
|
||||||
|
const worker = plugin.worker();
|
||||||
|
persistentWorkers.set(pluginId, worker);
|
||||||
|
return worker;
|
||||||
|
}
|
||||||
|
|
||||||
|
function discardPluginWorker<TOptions>(
|
||||||
|
plugin: PlimiPlugin<TOptions>,
|
||||||
|
worker: Worker
|
||||||
|
): void {
|
||||||
|
if (persistentWorkers.get(plugin.manifest.id) === worker) {
|
||||||
|
persistentWorkers.delete(plugin.manifest.id);
|
||||||
|
}
|
||||||
|
worker.terminate();
|
||||||
|
}
|
||||||
|
|
||||||
export async function runPlugin<TOptions>(
|
export async function runPlugin<TOptions>(
|
||||||
plugin: PlimiPlugin<TOptions>,
|
plugin: PlimiPlugin<TOptions>,
|
||||||
input: ToolInput,
|
input: ToolInput,
|
||||||
@@ -33,21 +71,28 @@ function runPluginInWorker<TOptions>(
|
|||||||
context: ToolContext
|
context: ToolContext
|
||||||
): Promise<ToolResult> {
|
): Promise<ToolResult> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!plugin.worker) {
|
let worker: Worker;
|
||||||
return reject(new Error("Worker is not defined for this plugin"));
|
try {
|
||||||
|
worker = createPluginWorker(plugin);
|
||||||
|
} catch (error) {
|
||||||
|
reject(error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const worker = plugin.worker();
|
|
||||||
const jobId = Math.random().toString(36).substring(7);
|
const jobId = Math.random().toString(36).substring(7);
|
||||||
|
|
||||||
// Handle cancellation
|
const cleanup = () => {
|
||||||
|
context.signal.removeEventListener("abort", onAbort);
|
||||||
|
worker.removeEventListener("message", onMessage);
|
||||||
|
worker.removeEventListener("error", onError);
|
||||||
|
};
|
||||||
|
|
||||||
const onAbort = () => {
|
const onAbort = () => {
|
||||||
worker.terminate();
|
cleanup();
|
||||||
|
discardPluginWorker(plugin, worker);
|
||||||
reject(new DOMException("Operation cancelled by user.", "AbortError"));
|
reject(new DOMException("Operation cancelled by user.", "AbortError"));
|
||||||
};
|
};
|
||||||
context.signal.addEventListener("abort", onAbort);
|
|
||||||
|
|
||||||
worker.onmessage = (e: MessageEvent<ToolWorkerResponse>) => {
|
const onMessage = (e: MessageEvent<ToolWorkerResponse>) => {
|
||||||
const { type, id } = e.data;
|
const { type, id } = e.data;
|
||||||
|
|
||||||
if (id !== jobId) return;
|
if (id !== jobId) return;
|
||||||
@@ -55,22 +100,37 @@ function runPluginInWorker<TOptions>(
|
|||||||
if (type === "progress") {
|
if (type === "progress") {
|
||||||
context.reportProgress(e.data.progress);
|
context.reportProgress(e.data.progress);
|
||||||
} else if (type === "success") {
|
} else if (type === "success") {
|
||||||
context.signal.removeEventListener("abort", onAbort);
|
cleanup();
|
||||||
|
if (!plugin.capabilities?.persistentWorker) {
|
||||||
worker.terminate();
|
worker.terminate();
|
||||||
|
}
|
||||||
resolve(e.data.result);
|
resolve(e.data.result);
|
||||||
} else if (type === "error") {
|
} else if (type === "error") {
|
||||||
context.signal.removeEventListener("abort", onAbort);
|
cleanup();
|
||||||
worker.terminate();
|
discardPluginWorker(plugin, worker);
|
||||||
reject(new Error(e.data.error));
|
reject(new Error(e.data.error));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
worker.onerror = (e) => {
|
const onError = (e: ErrorEvent) => {
|
||||||
context.signal.removeEventListener("abort", onAbort);
|
cleanup();
|
||||||
worker.terminate();
|
discardPluginWorker(plugin, worker);
|
||||||
reject(new Error("Worker error: " + e.message));
|
const location = e.filename
|
||||||
|
? ` (${e.filename}${e.lineno ? `:${e.lineno}:${e.colno}` : ""})`
|
||||||
|
: "";
|
||||||
|
reject(
|
||||||
|
new Error(
|
||||||
|
`Worker failed to load or execute${location}: ${
|
||||||
|
e.message || "check worker, CORS, and cross-origin isolation headers"
|
||||||
|
}`
|
||||||
|
)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
context.signal.addEventListener("abort", onAbort);
|
||||||
|
worker.addEventListener("message", onMessage);
|
||||||
|
worker.addEventListener("error", onError);
|
||||||
|
|
||||||
// Serialize input payload (can't send DOM elements or complex functions)
|
// Serialize input payload (can't send DOM elements or complex functions)
|
||||||
const request: ToolWorkerRequest<TOptions> = {
|
const request: ToolWorkerRequest<TOptions> = {
|
||||||
type: "run",
|
type: "run",
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ export type ToolOptionsValue = Record<string, ToolOptionValue>;
|
|||||||
export interface ToolCapabilities {
|
export interface ToolCapabilities {
|
||||||
batch?: boolean;
|
batch?: boolean;
|
||||||
worker?: boolean;
|
worker?: boolean;
|
||||||
|
/** Keep the worker alive between runs so it can retain expensive state. */
|
||||||
|
persistentWorker?: boolean;
|
||||||
wasm?: boolean;
|
wasm?: boolean;
|
||||||
preview?: boolean;
|
preview?: boolean;
|
||||||
streaming?: boolean;
|
streaming?: boolean;
|
||||||
@@ -138,6 +140,16 @@ export interface PlimiPlugin<TOptions = unknown> {
|
|||||||
|
|
||||||
worker?: () => Worker;
|
worker?: () => Worker;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional pre-run check. Return a message to surface a confirmation dialog
|
||||||
|
* before the tool runs (e.g. "this will download 44 MB"); return null to run
|
||||||
|
* immediately. Runs on the main thread, so it can inspect caches/storage.
|
||||||
|
*/
|
||||||
|
getRunWarning?: (
|
||||||
|
input: ToolInput,
|
||||||
|
options: TOptions
|
||||||
|
) => Promise<string | null> | string | null;
|
||||||
|
|
||||||
customUi?: React.LazyExoticComponent<
|
customUi?: React.LazyExoticComponent<
|
||||||
React.ComponentType<ToolUiProps<TOptions>>
|
React.ComponentType<ToolUiProps<TOptions>>
|
||||||
>;
|
>;
|
||||||
@@ -145,10 +157,14 @@ export interface PlimiPlugin<TOptions = unknown> {
|
|||||||
|
|
||||||
export type UnknownPlimiPlugin = Omit<
|
export type UnknownPlimiPlugin = Omit<
|
||||||
PlimiPlugin<never>,
|
PlimiPlugin<never>,
|
||||||
"run" | "customUi"
|
"run" | "customUi" | "getRunWarning"
|
||||||
> & {
|
> & {
|
||||||
run?: ToolRunner<ToolOptionsValue>;
|
run?: ToolRunner<ToolOptionsValue>;
|
||||||
examples?: ToolExample<ToolOptionsValue>[];
|
examples?: ToolExample<ToolOptionsValue>[];
|
||||||
|
getRunWarning?: (
|
||||||
|
input: ToolInput,
|
||||||
|
options: ToolOptionsValue
|
||||||
|
) => Promise<string | null> | string | null;
|
||||||
customUi?: React.LazyExoticComponent<
|
customUi?: React.LazyExoticComponent<
|
||||||
React.ComponentType<ToolUiProps<ToolOptionsValue>>
|
React.ComponentType<ToolUiProps<ToolOptionsValue>>
|
||||||
>;
|
>;
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ function loadAnalyticsScript() {
|
|||||||
const script = document.createElement("script");
|
const script = document.createElement("script");
|
||||||
script.id = SCRIPT_ID;
|
script.id = SCRIPT_ID;
|
||||||
script.defer = true;
|
script.defer = true;
|
||||||
|
script.crossOrigin = "anonymous";
|
||||||
script.src = privacyConfig.analyticsScriptUrl;
|
script.src = privacyConfig.analyticsScriptUrl;
|
||||||
script.dataset.websiteId = privacyConfig.analyticsWebsiteId;
|
script.dataset.websiteId = privacyConfig.analyticsWebsiteId;
|
||||||
script.dataset.hostUrl = privacyConfig.analyticsHostUrl;
|
script.dataset.hostUrl = privacyConfig.analyticsHostUrl;
|
||||||
|
|||||||
188
src/core/seo/SeoManager.tsx
Normal file
188
src/core/seo/SeoManager.tsx
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
import { useEffect } from "react";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import { runtimeConfigValue } from "../config/runtime-config";
|
||||||
|
import { pluginRegistry } from "../plugins/plugin-registry";
|
||||||
|
|
||||||
|
const DEFAULT_DESCRIPTION =
|
||||||
|
"Free privacy-first tools for files, images, PDFs, text, and code. Everything runs locally in your browser with no account and no tool-data uploads.";
|
||||||
|
|
||||||
|
const PAGE_METADATA: Record<string, { title: string; description: string }> = {
|
||||||
|
"/": {
|
||||||
|
title: "Plimi - Free Private Browser Tools",
|
||||||
|
description: DEFAULT_DESCRIPTION,
|
||||||
|
},
|
||||||
|
"/tools": {
|
||||||
|
title: "Free Private Online Tools | Plimi",
|
||||||
|
description:
|
||||||
|
"Browse free browser-based utilities for images, PDFs, text, developer tasks, and privacy. Tools run locally without uploading your data.",
|
||||||
|
},
|
||||||
|
"/how-it-works": {
|
||||||
|
title: "How Plimi Processes Files Locally",
|
||||||
|
description:
|
||||||
|
"Learn how Plimi uses browser APIs, Web Workers, WebAssembly, and local libraries to process files without uploading tool data.",
|
||||||
|
},
|
||||||
|
"/contribute": {
|
||||||
|
title: "Contribute a Browser Tool to Plimi",
|
||||||
|
description:
|
||||||
|
"Learn how to build, test, and contribute a typed, privacy-first browser utility to the open-source Plimi tool collection.",
|
||||||
|
},
|
||||||
|
"/privacy": {
|
||||||
|
title: "Privacy and Legal Information | Plimi",
|
||||||
|
description:
|
||||||
|
"Read how Plimi processes tool inputs locally, handles optional analytics, stores preferences, and protects your privacy.",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function setNamedMeta(name: string, content: string) {
|
||||||
|
let element = document.head.querySelector<HTMLMetaElement>(
|
||||||
|
`meta[name="${name}"]`,
|
||||||
|
);
|
||||||
|
if (!element) {
|
||||||
|
element = document.createElement("meta");
|
||||||
|
element.name = name;
|
||||||
|
document.head.appendChild(element);
|
||||||
|
}
|
||||||
|
element.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setPropertyMeta(property: string, content: string) {
|
||||||
|
let element = document.head.querySelector<HTMLMetaElement>(
|
||||||
|
`meta[property="${property}"]`,
|
||||||
|
);
|
||||||
|
if (!element) {
|
||||||
|
element = document.createElement("meta");
|
||||||
|
element.setAttribute("property", property);
|
||||||
|
document.head.appendChild(element);
|
||||||
|
}
|
||||||
|
element.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setCanonical(href: string) {
|
||||||
|
let element = document.head.querySelector<HTMLLinkElement>(
|
||||||
|
'link[rel="canonical"]',
|
||||||
|
);
|
||||||
|
if (!element) {
|
||||||
|
element = document.createElement("link");
|
||||||
|
element.rel = "canonical";
|
||||||
|
document.head.appendChild(element);
|
||||||
|
}
|
||||||
|
element.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function SeoManager() {
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const siteUrl = runtimeConfigValue(
|
||||||
|
"VITE_SITE_URL",
|
||||||
|
window.location.origin,
|
||||||
|
).replace(/\/+$/, "");
|
||||||
|
const toolId = pathname.startsWith("/tools/")
|
||||||
|
? pathname.slice("/tools/".length).replace(/\/+$/, "")
|
||||||
|
: null;
|
||||||
|
const plugin = toolId
|
||||||
|
? pluginRegistry.find((item) => item.manifest.id === toolId)
|
||||||
|
: undefined;
|
||||||
|
const page = PAGE_METADATA[pathname];
|
||||||
|
const title = plugin
|
||||||
|
? `${plugin.manifest.name} - Free Private Online Tool | Plimi`
|
||||||
|
: page?.title ?? "Page Not Found | Plimi";
|
||||||
|
const description = plugin
|
||||||
|
? `${plugin.manifest.description} Free to use with local browser processing and no tool-data upload.`
|
||||||
|
: page?.description ?? DEFAULT_DESCRIPTION;
|
||||||
|
const canonicalPath = pathname === "/" ? "/tools" : pathname;
|
||||||
|
const canonicalUrl = `${siteUrl}${canonicalPath}`;
|
||||||
|
const isNotFound = !plugin && !page;
|
||||||
|
|
||||||
|
document.title = title;
|
||||||
|
setNamedMeta("description", description);
|
||||||
|
setNamedMeta(
|
||||||
|
"robots",
|
||||||
|
isNotFound ? "noindex, nofollow" : "index, follow",
|
||||||
|
);
|
||||||
|
setNamedMeta("twitter:card", "summary");
|
||||||
|
setNamedMeta("twitter:title", title);
|
||||||
|
setNamedMeta("twitter:description", description);
|
||||||
|
setPropertyMeta("og:type", "website");
|
||||||
|
setPropertyMeta("og:site_name", "Plimi");
|
||||||
|
setPropertyMeta("og:locale", "en_US");
|
||||||
|
setPropertyMeta("og:title", title);
|
||||||
|
setPropertyMeta("og:description", description);
|
||||||
|
setPropertyMeta("og:url", canonicalUrl);
|
||||||
|
setCanonical(canonicalUrl);
|
||||||
|
|
||||||
|
document.head
|
||||||
|
.querySelectorAll('script[type="application/ld+json"][data-plimi-seo]')
|
||||||
|
.forEach((element) => element.remove());
|
||||||
|
|
||||||
|
if (isNotFound) return;
|
||||||
|
|
||||||
|
let structuredData;
|
||||||
|
if (plugin) {
|
||||||
|
structuredData = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebApplication",
|
||||||
|
name: plugin.manifest.name,
|
||||||
|
description: plugin.manifest.description,
|
||||||
|
url: canonicalUrl,
|
||||||
|
applicationCategory: `${plugin.manifest.category} utility`,
|
||||||
|
applicationSubCategory: plugin.manifest.tags?.join(", "),
|
||||||
|
browserRequirements: "Requires a modern web browser",
|
||||||
|
operatingSystem: "Any",
|
||||||
|
isAccessibleForFree: true,
|
||||||
|
offers: {
|
||||||
|
"@type": "Offer",
|
||||||
|
price: "0",
|
||||||
|
priceCurrency: "USD",
|
||||||
|
},
|
||||||
|
featureList: [
|
||||||
|
"Runs locally in the browser",
|
||||||
|
"No account required",
|
||||||
|
"No tool-data upload",
|
||||||
|
...(plugin.manifest.offlineReady ? ["Offline-ready"] : []),
|
||||||
|
],
|
||||||
|
publisher: {
|
||||||
|
"@type": "Organization",
|
||||||
|
name: "Plimi",
|
||||||
|
url: `${siteUrl}/tools`,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} else if (pathname === "/" || pathname === "/tools") {
|
||||||
|
structuredData = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "ItemList",
|
||||||
|
name: "Plimi private browser tools",
|
||||||
|
url: `${siteUrl}/tools`,
|
||||||
|
description,
|
||||||
|
numberOfItems: pluginRegistry.length,
|
||||||
|
itemListElement: pluginRegistry.map((item, index) => ({
|
||||||
|
"@type": "ListItem",
|
||||||
|
position: index + 1,
|
||||||
|
url: `${siteUrl}/tools/${item.manifest.id}`,
|
||||||
|
name: item.manifest.name,
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
structuredData = {
|
||||||
|
"@context": "https://schema.org",
|
||||||
|
"@type": "WebPage",
|
||||||
|
name: title,
|
||||||
|
url: canonicalUrl,
|
||||||
|
description,
|
||||||
|
isPartOf: {
|
||||||
|
"@type": "WebSite",
|
||||||
|
name: "Plimi",
|
||||||
|
url: `${siteUrl}/tools`,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const script = document.createElement("script");
|
||||||
|
script.type = "application/ld+json";
|
||||||
|
script.dataset.plimiSeo = "";
|
||||||
|
script.text = JSON.stringify(structuredData);
|
||||||
|
document.head.appendChild(script);
|
||||||
|
}, [pathname]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -4,7 +4,14 @@ import "./index.css";
|
|||||||
import { App } from "./app/App";
|
import { App } from "./app/App";
|
||||||
import { ThemeProvider } from "./app/ThemeProvider";
|
import { ThemeProvider } from "./app/ThemeProvider";
|
||||||
|
|
||||||
createRoot(document.getElementById("root")!).render(
|
const rootElement = document.getElementById("root")!;
|
||||||
|
|
||||||
|
if (rootElement.hasAttribute("data-static-seo")) {
|
||||||
|
rootElement.replaceChildren();
|
||||||
|
rootElement.removeAttribute("data-static-seo");
|
||||||
|
}
|
||||||
|
|
||||||
|
createRoot(rootElement).render(
|
||||||
<StrictMode>
|
<StrictMode>
|
||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<App />
|
<App />
|
||||||
|
|||||||
@@ -134,6 +134,14 @@ export function PrivacyPage() {
|
|||||||
settings. Plimi does not use analytics cookies, advertising cookies,
|
settings. Plimi does not use analytics cookies, advertising cookies,
|
||||||
or marketing pixels.
|
or marketing pixels.
|
||||||
</p>
|
</p>
|
||||||
|
<p className="m-0">
|
||||||
|
If you use automatic background removal, Plimi stores the selected AI
|
||||||
|
model and its ONNX runtime files in your browser's Cache Storage.
|
||||||
|
This avoids downloading the same large files for every run. The cache
|
||||||
|
contains application assets only, not your uploaded images, masks, or
|
||||||
|
generated results. You can delete it at any time with the
|
||||||
|
"Clear models" button in the Background Remover.
|
||||||
|
</p>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title="Recipients and transfers">
|
<Section title="Recipients and transfers">
|
||||||
|
|||||||
@@ -1,55 +1,54 @@
|
|||||||
import { useParams, useNavigate } from "react-router-dom";
|
import { Link, useParams } from "react-router-dom";
|
||||||
import { pluginRegistry } from "../core/plugins/plugin-registry";
|
import { pluginRegistry } from "../core/plugins/plugin-registry";
|
||||||
import { ToolShell } from "../components/tool/ToolShell";
|
import { ToolShell } from "../components/tool/ToolShell";
|
||||||
import { useTheme } from "../app/useTheme";
|
import { useTheme } from "../app/useTheme";
|
||||||
|
|
||||||
export function ToolDetailPage() {
|
export function ToolDetailPage() {
|
||||||
const { toolId } = useParams<{ toolId: string }>();
|
const { toolId } = useParams<{ toolId: string }>();
|
||||||
const navigate = useNavigate();
|
|
||||||
const { dark } = useTheme();
|
const { dark } = useTheme();
|
||||||
|
|
||||||
const plugin = pluginRegistry.find((p) => p.manifest.id === toolId);
|
const plugin = pluginRegistry.find((item) => item.manifest.id === toolId);
|
||||||
|
|
||||||
if (!plugin) {
|
if (!plugin) {
|
||||||
return (
|
return (
|
||||||
<div className="p-8">
|
<div className="p-8">
|
||||||
<h2 className="text-xl font-semibold mb-4 text-[var(--p-text)]">Tool not found</h2>
|
<h1 className="mb-4 text-xl font-semibold text-[var(--p-text)]">
|
||||||
<button onClick={() => navigate("/tools")} className="text-blue-500 hover:underline">
|
Tool not found
|
||||||
|
</h1>
|
||||||
|
<Link to="/tools" className="text-blue-500 hover:underline">
|
||||||
Return to directory
|
Return to directory
|
||||||
</button>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
navigate("/tools");
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="mx-auto flex w-full max-w-[1280px] flex-col gap-4 animate-plimi-fade">
|
||||||
onClick={handleClose}
|
<Link
|
||||||
role="presentation"
|
to="/tools"
|
||||||
className="fixed inset-0 z-50 flex items-end justify-center p-0 md:items-center md:p-10 animate-plimi-fade"
|
className="self-start font-sans text-[13px] text-[var(--p-muted)] transition-colors hover:text-[var(--p-text)]"
|
||||||
style={{
|
|
||||||
background: 'color-mix(in oklab, var(--p-bg) 70%, transparent)',
|
|
||||||
backdropFilter: 'blur(8px)',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
|
← Back to tools
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<header className="flex max-w-[760px] flex-col gap-2">
|
||||||
|
<span className="font-mono text-[11px] uppercase tracking-[0.12em] text-[var(--p-muted)]">
|
||||||
|
{plugin.manifest.category} tool / browser-local
|
||||||
|
</span>
|
||||||
|
<h1 className="m-0 font-sans text-3xl font-bold tracking-tight text-[var(--p-text)] md:text-[42px]">
|
||||||
|
{plugin.manifest.name}
|
||||||
|
</h1>
|
||||||
|
<p className="m-0 text-base leading-relaxed text-[var(--p-muted)]">
|
||||||
|
{plugin.manifest.description} It runs locally in your browser, with no
|
||||||
|
account and no tool-data upload.
|
||||||
|
</p>
|
||||||
|
</header>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
onClick={(e) => e.stopPropagation()}
|
className="flex min-h-[70vh] flex-col overflow-hidden rounded-[24px] border-[1.5px] border-[var(--p-border)] bg-[var(--p-surface)]"
|
||||||
role="dialog"
|
style={{ boxShadow: "0 40px 80px -30px var(--p-shadow-soft)" }}
|
||||||
aria-modal="true"
|
|
||||||
aria-label={plugin.manifest.name}
|
|
||||||
className="w-full md:w-[min(900px,100%)] h-[92dvh] md:h-auto md:max-h-[calc(100dvh-5rem)] bg-[var(--p-surface)] rounded-t-[20px] md:rounded-[24px] border-[1.5px] border-[var(--p-border)] flex flex-col animate-plimi-slide overflow-hidden"
|
|
||||||
style={{
|
|
||||||
boxShadow: '0 40px 80px -30px var(--p-shadow-soft)',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{/* Grab handle — signals the sheet is dismissable on touch */}
|
<ToolShell plugin={plugin} dark={dark} />
|
||||||
<div className="md:hidden flex justify-center pt-2.5 pb-1 shrink-0">
|
|
||||||
<span className="h-1 w-9 rounded-full bg-[var(--p-border)]" />
|
|
||||||
</div>
|
|
||||||
<ToolShell plugin={plugin} onClose={handleClose} dark={dark} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ export function ToolsPage() {
|
|||||||
{tools.map((t) => {
|
{tools.map((t) => {
|
||||||
const flatIdx = filtered.indexOf(t);
|
const flatIdx = filtered.indexOf(t);
|
||||||
return (
|
return (
|
||||||
<ToolTile key={t.manifest.id} plugin={t} onClick={handleOpenTool} focused={flatIdx === safeFocusedIndex} dark={dark} index={flatIdx} />
|
<ToolTile key={t.manifest.id} plugin={t} focused={flatIdx === safeFocusedIndex} dark={dark} index={flatIdx} />
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
@@ -141,7 +141,7 @@ export function ToolsPage() {
|
|||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mt-4">
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 mt-4">
|
||||||
{filtered.map((t, flatIdx) => (
|
{filtered.map((t, flatIdx) => (
|
||||||
<ToolTile key={t.manifest.id} plugin={t} onClick={handleOpenTool} focused={flatIdx === safeFocusedIndex} dark={dark} index={flatIdx} />
|
<ToolTile key={t.manifest.id} plugin={t} focused={flatIdx === safeFocusedIndex} dark={dark} index={flatIdx} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
757
src/tools/background-remover/BackgroundRemoverUi.tsx
Normal file
757
src/tools/background-remover/BackgroundRemoverUi.tsx
Normal file
@@ -0,0 +1,757 @@
|
|||||||
|
import {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
type PointerEvent as ReactPointerEvent,
|
||||||
|
} from "react";
|
||||||
|
import type { ToolUiProps } from "../../core/plugins/plugin-types";
|
||||||
|
import { Button } from "../../components/ui/Button";
|
||||||
|
import { Card } from "../../components/ui/Card";
|
||||||
|
import { Dropzone } from "../../components/ui/Dropzone";
|
||||||
|
import { Select } from "../../components/ui/Select";
|
||||||
|
import { Slider } from "../../components/ui/Slider";
|
||||||
|
import { ToolProgress } from "../../components/tool/ToolProgress";
|
||||||
|
import { useToolExecution } from "../../components/tool/useToolExecution";
|
||||||
|
import { disposePersistentWorker } from "../../core/plugins/plugin-runner";
|
||||||
|
import { clearImglyCache } from "./imgly-cache";
|
||||||
|
import type { BackgroundRemoverOptions } from "./remove";
|
||||||
|
|
||||||
|
type EditMode = "automatic" | "select-area";
|
||||||
|
type EditorAction = "sample" | "remove" | "restore";
|
||||||
|
|
||||||
|
interface Point {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MaskStroke {
|
||||||
|
type: "stroke";
|
||||||
|
action: Exclude<EditorAction, "sample">;
|
||||||
|
points: Point[];
|
||||||
|
size: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SampleSelection {
|
||||||
|
type: "sample";
|
||||||
|
point: Point;
|
||||||
|
tolerance: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
type MaskOperation = MaskStroke | SampleSelection;
|
||||||
|
|
||||||
|
function drawStrokePath(
|
||||||
|
context: CanvasRenderingContext2D,
|
||||||
|
stroke: MaskStroke,
|
||||||
|
width: number,
|
||||||
|
height: number
|
||||||
|
): void {
|
||||||
|
const points = stroke.points;
|
||||||
|
if (points.length === 0) return;
|
||||||
|
|
||||||
|
const scale = Math.min(width, height);
|
||||||
|
context.lineWidth = stroke.size * scale;
|
||||||
|
context.lineCap = "round";
|
||||||
|
context.lineJoin = "round";
|
||||||
|
context.beginPath();
|
||||||
|
context.moveTo(points[0].x * width, points[0].y * height);
|
||||||
|
|
||||||
|
if (points.length === 1) {
|
||||||
|
context.lineTo(points[0].x * width + 0.01, points[0].y * height);
|
||||||
|
} else {
|
||||||
|
for (const point of points.slice(1)) {
|
||||||
|
context.lineTo(point.x * width, point.y * height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
context.stroke();
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyStroke(
|
||||||
|
output: HTMLCanvasElement,
|
||||||
|
source: HTMLCanvasElement,
|
||||||
|
scratch: HTMLCanvasElement,
|
||||||
|
stroke: MaskStroke
|
||||||
|
): void {
|
||||||
|
const outputContext = output.getContext("2d");
|
||||||
|
const scratchContext = scratch.getContext("2d");
|
||||||
|
if (!outputContext || !scratchContext) return;
|
||||||
|
|
||||||
|
if (stroke.action === "remove") {
|
||||||
|
outputContext.save();
|
||||||
|
outputContext.globalCompositeOperation = "destination-out";
|
||||||
|
outputContext.strokeStyle = "#000";
|
||||||
|
drawStrokePath(outputContext, stroke, output.width, output.height);
|
||||||
|
outputContext.restore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
scratchContext.clearRect(0, 0, scratch.width, scratch.height);
|
||||||
|
scratchContext.globalCompositeOperation = "source-over";
|
||||||
|
scratchContext.drawImage(source, 0, 0);
|
||||||
|
scratchContext.globalCompositeOperation = "destination-in";
|
||||||
|
scratchContext.strokeStyle = "#000";
|
||||||
|
drawStrokePath(scratchContext, stroke, scratch.width, scratch.height);
|
||||||
|
scratchContext.globalCompositeOperation = "source-over";
|
||||||
|
|
||||||
|
outputContext.drawImage(scratch, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function applySampleSelection(
|
||||||
|
output: HTMLCanvasElement,
|
||||||
|
source: HTMLCanvasElement,
|
||||||
|
selection: SampleSelection
|
||||||
|
): void {
|
||||||
|
const outputContext = output.getContext("2d", { willReadFrequently: true });
|
||||||
|
const sourceContext = source.getContext("2d", { willReadFrequently: true });
|
||||||
|
if (!outputContext || !sourceContext) return;
|
||||||
|
|
||||||
|
const { width, height } = output;
|
||||||
|
const sourceData = sourceContext.getImageData(0, 0, width, height);
|
||||||
|
const outputData = outputContext.getImageData(0, 0, width, height);
|
||||||
|
const startX = Math.min(width - 1, Math.floor(selection.point.x * width));
|
||||||
|
const startY = Math.min(height - 1, Math.floor(selection.point.y * height));
|
||||||
|
const startIndex = startY * width + startX;
|
||||||
|
const startOffset = startIndex * 4;
|
||||||
|
const targetR = sourceData.data[startOffset];
|
||||||
|
const targetG = sourceData.data[startOffset + 1];
|
||||||
|
const targetB = sourceData.data[startOffset + 2];
|
||||||
|
const threshold = (selection.tolerance / 100) * Math.sqrt(3 * 255 * 255);
|
||||||
|
const thresholdSquared = threshold * threshold;
|
||||||
|
const visited = new Uint8Array(width * height);
|
||||||
|
const stack = new Uint32Array(width * height);
|
||||||
|
let stackSize = 0;
|
||||||
|
visited[startIndex] = 1;
|
||||||
|
stack[stackSize++] = startIndex;
|
||||||
|
|
||||||
|
while (stackSize > 0) {
|
||||||
|
const index = stack[--stackSize];
|
||||||
|
const offset = index * 4;
|
||||||
|
const deltaR = sourceData.data[offset] - targetR;
|
||||||
|
const deltaG = sourceData.data[offset + 1] - targetG;
|
||||||
|
const deltaB = sourceData.data[offset + 2] - targetB;
|
||||||
|
const distanceSquared =
|
||||||
|
deltaR * deltaR + deltaG * deltaG + deltaB * deltaB;
|
||||||
|
if (distanceSquared > thresholdSquared) continue;
|
||||||
|
|
||||||
|
outputData.data[offset + 3] = 0;
|
||||||
|
const x = index % width;
|
||||||
|
const y = Math.floor(index / width);
|
||||||
|
const neighbors = [
|
||||||
|
x > 0 ? index - 1 : -1,
|
||||||
|
x + 1 < width ? index + 1 : -1,
|
||||||
|
y > 0 ? index - width : -1,
|
||||||
|
y + 1 < height ? index + width : -1,
|
||||||
|
];
|
||||||
|
for (const neighbor of neighbors) {
|
||||||
|
if (neighbor >= 0 && !visited[neighbor]) {
|
||||||
|
visited[neighbor] = 1;
|
||||||
|
stack[stackSize++] = neighbor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
outputContext.putImageData(outputData, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadBlob(blob: Blob, name: string): void {
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
const anchor = document.createElement("a");
|
||||||
|
anchor.href = url;
|
||||||
|
anchor.download = name;
|
||||||
|
document.body.appendChild(anchor);
|
||||||
|
anchor.click();
|
||||||
|
anchor.remove();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function BackgroundRemoverUi({
|
||||||
|
plugin,
|
||||||
|
}: ToolUiProps<BackgroundRemoverOptions>) {
|
||||||
|
const [files, setFiles] = useState<File[]>([]);
|
||||||
|
const [sourceUrl, setSourceUrl] = useState("");
|
||||||
|
const [resultUrl, setResultUrl] = useState("");
|
||||||
|
const [editMode, setEditMode] = useState<EditMode>("automatic");
|
||||||
|
const [quality, setQuality] =
|
||||||
|
useState<BackgroundRemoverOptions["quality"]>("small");
|
||||||
|
const [useGpu, setUseGpu] = useState(true);
|
||||||
|
const [editorAction, setEditorAction] = useState<EditorAction>("sample");
|
||||||
|
const [tolerance, setTolerance] = useState(14);
|
||||||
|
const [brushSize, setBrushSize] = useState(4);
|
||||||
|
const [operations, setOperations] = useState<MaskOperation[]>([]);
|
||||||
|
const [isDrawing, setIsDrawing] = useState(false);
|
||||||
|
const [warning, setWarning] = useState<string | null>(null);
|
||||||
|
const [pendingOptions, setPendingOptions] =
|
||||||
|
useState<BackgroundRemoverOptions | null>(null);
|
||||||
|
const [cacheMessage, setCacheMessage] = useState("");
|
||||||
|
const [isClearingCache, setIsClearingCache] = useState(false);
|
||||||
|
|
||||||
|
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||||
|
const sourceCanvasRef = useRef<HTMLCanvasElement | null>(null);
|
||||||
|
const baseCanvasRef = useRef<HTMLCanvasElement | null>(null);
|
||||||
|
const scratchCanvasRef = useRef<HTMLCanvasElement | null>(null);
|
||||||
|
const activeStrokeRef = useRef<MaskStroke | null>(null);
|
||||||
|
const resultUrlRef = useRef("");
|
||||||
|
|
||||||
|
const { run, result, isExecuting, progress, error, reset } =
|
||||||
|
useToolExecution(plugin);
|
||||||
|
|
||||||
|
const resultFile =
|
||||||
|
result?.type === "files" && result.files.length > 0
|
||||||
|
? result.files[0]
|
||||||
|
: null;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
return () => {
|
||||||
|
if (sourceUrl) URL.revokeObjectURL(sourceUrl);
|
||||||
|
};
|
||||||
|
}, [sourceUrl]);
|
||||||
|
|
||||||
|
useEffect(
|
||||||
|
() => () => {
|
||||||
|
if (resultUrlRef.current) URL.revokeObjectURL(resultUrlRef.current);
|
||||||
|
},
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
const renderOperations = useCallback((nextOperations: MaskOperation[]) => {
|
||||||
|
const output = canvasRef.current;
|
||||||
|
const base = baseCanvasRef.current;
|
||||||
|
const source = sourceCanvasRef.current;
|
||||||
|
const scratch = scratchCanvasRef.current;
|
||||||
|
if (!output || !base || !source || !scratch) return;
|
||||||
|
|
||||||
|
const context = output.getContext("2d");
|
||||||
|
if (!context) return;
|
||||||
|
context.clearRect(0, 0, output.width, output.height);
|
||||||
|
context.drawImage(base, 0, 0);
|
||||||
|
for (const operation of nextOperations) {
|
||||||
|
if (operation.type === "sample") {
|
||||||
|
applySampleSelection(output, source, operation);
|
||||||
|
} else {
|
||||||
|
applyStroke(output, source, scratch, operation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (editMode !== "select-area" || files.length === 0) return;
|
||||||
|
|
||||||
|
let cancelled = false;
|
||||||
|
const initialize = async () => {
|
||||||
|
const sourceBitmap = await createImageBitmap(files[0]);
|
||||||
|
if (cancelled) {
|
||||||
|
sourceBitmap.close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const width = sourceBitmap.width;
|
||||||
|
const height = sourceBitmap.height;
|
||||||
|
const sourceCanvas = document.createElement("canvas");
|
||||||
|
const baseCanvas = document.createElement("canvas");
|
||||||
|
const scratchCanvas = document.createElement("canvas");
|
||||||
|
for (const canvas of [sourceCanvas, baseCanvas, scratchCanvas]) {
|
||||||
|
canvas.width = width;
|
||||||
|
canvas.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceCanvas.getContext("2d")?.drawImage(sourceBitmap, 0, 0, width, height);
|
||||||
|
baseCanvas.getContext("2d")?.drawImage(sourceBitmap, 0, 0, width, height);
|
||||||
|
sourceCanvasRef.current = sourceCanvas;
|
||||||
|
baseCanvasRef.current = baseCanvas;
|
||||||
|
scratchCanvasRef.current = scratchCanvas;
|
||||||
|
|
||||||
|
const output = canvasRef.current;
|
||||||
|
if (output) {
|
||||||
|
output.width = width;
|
||||||
|
output.height = height;
|
||||||
|
output.getContext("2d")?.drawImage(baseCanvas, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceBitmap.close();
|
||||||
|
setOperations([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
void initialize();
|
||||||
|
return () => {
|
||||||
|
cancelled = true;
|
||||||
|
};
|
||||||
|
}, [editMode, files]);
|
||||||
|
|
||||||
|
const clearResult = useCallback(() => {
|
||||||
|
if (resultUrlRef.current) {
|
||||||
|
URL.revokeObjectURL(resultUrlRef.current);
|
||||||
|
resultUrlRef.current = "";
|
||||||
|
}
|
||||||
|
setResultUrl("");
|
||||||
|
setOperations([]);
|
||||||
|
activeStrokeRef.current = null;
|
||||||
|
reset();
|
||||||
|
}, [reset]);
|
||||||
|
|
||||||
|
const handleFilesDrop = useCallback(
|
||||||
|
(nextFiles: File[]) => {
|
||||||
|
setFiles(nextFiles);
|
||||||
|
setSourceUrl(
|
||||||
|
nextFiles.length > 0 ? URL.createObjectURL(nextFiles[0]) : ""
|
||||||
|
);
|
||||||
|
clearResult();
|
||||||
|
},
|
||||||
|
[clearResult]
|
||||||
|
);
|
||||||
|
|
||||||
|
const execute = useCallback(
|
||||||
|
async (options: BackgroundRemoverOptions) => {
|
||||||
|
if (files.length === 0) return;
|
||||||
|
const nextResult = await run({ files }, options);
|
||||||
|
if (nextResult?.type === "files" && nextResult.files.length > 0) {
|
||||||
|
if (resultUrlRef.current) URL.revokeObjectURL(resultUrlRef.current);
|
||||||
|
const url = URL.createObjectURL(nextResult.files[0].blob);
|
||||||
|
resultUrlRef.current = url;
|
||||||
|
setResultUrl(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[files, run]
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleRun = useCallback(async () => {
|
||||||
|
const options = { quality, useGpu };
|
||||||
|
if (plugin.getRunWarning) {
|
||||||
|
const nextWarning = await plugin.getRunWarning({ files }, options);
|
||||||
|
if (nextWarning) {
|
||||||
|
setPendingOptions(options);
|
||||||
|
setWarning(nextWarning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await execute(options);
|
||||||
|
}, [execute, files, plugin, quality, useGpu]);
|
||||||
|
|
||||||
|
const pointFromEvent = (
|
||||||
|
event: ReactPointerEvent<HTMLCanvasElement>
|
||||||
|
): Point => {
|
||||||
|
const rect = event.currentTarget.getBoundingClientRect();
|
||||||
|
return {
|
||||||
|
x: Math.max(0, Math.min(1, (event.clientX - rect.left) / rect.width)),
|
||||||
|
y: Math.max(0, Math.min(1, (event.clientY - rect.top) / rect.height)),
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePointerDown = (event: ReactPointerEvent<HTMLCanvasElement>) => {
|
||||||
|
if (!canvasRef.current || !sourceCanvasRef.current || !scratchCanvasRef.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
if (editorAction === "sample") {
|
||||||
|
const selection: SampleSelection = {
|
||||||
|
type: "sample",
|
||||||
|
point: pointFromEvent(event),
|
||||||
|
tolerance,
|
||||||
|
};
|
||||||
|
applySampleSelection(
|
||||||
|
canvasRef.current,
|
||||||
|
sourceCanvasRef.current,
|
||||||
|
selection
|
||||||
|
);
|
||||||
|
setOperations((current) => [...current, selection]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.currentTarget.setPointerCapture(event.pointerId);
|
||||||
|
const stroke: MaskStroke = {
|
||||||
|
type: "stroke",
|
||||||
|
action: editorAction,
|
||||||
|
points: [pointFromEvent(event)],
|
||||||
|
size: brushSize / 100,
|
||||||
|
};
|
||||||
|
activeStrokeRef.current = stroke;
|
||||||
|
setIsDrawing(true);
|
||||||
|
applyStroke(
|
||||||
|
canvasRef.current,
|
||||||
|
sourceCanvasRef.current,
|
||||||
|
scratchCanvasRef.current,
|
||||||
|
stroke
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePointerMove = (event: ReactPointerEvent<HTMLCanvasElement>) => {
|
||||||
|
const active = activeStrokeRef.current;
|
||||||
|
const output = canvasRef.current;
|
||||||
|
const source = sourceCanvasRef.current;
|
||||||
|
const scratch = scratchCanvasRef.current;
|
||||||
|
if (!isDrawing || !active || !output || !source || !scratch) return;
|
||||||
|
|
||||||
|
const point = pointFromEvent(event);
|
||||||
|
const segment: MaskStroke = {
|
||||||
|
...active,
|
||||||
|
points: [active.points.at(-1) ?? point, point],
|
||||||
|
};
|
||||||
|
active.points.push(point);
|
||||||
|
applyStroke(output, source, scratch, segment);
|
||||||
|
};
|
||||||
|
|
||||||
|
const finishStroke = (event: ReactPointerEvent<HTMLCanvasElement>) => {
|
||||||
|
const active = activeStrokeRef.current;
|
||||||
|
if (!active) return;
|
||||||
|
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
||||||
|
event.currentTarget.releasePointerCapture(event.pointerId);
|
||||||
|
}
|
||||||
|
activeStrokeRef.current = null;
|
||||||
|
setIsDrawing(false);
|
||||||
|
setOperations((current) => [...current, active]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUndo = () => {
|
||||||
|
setOperations((current) => {
|
||||||
|
const next = current.slice(0, -1);
|
||||||
|
renderOperations(next);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleResetMask = () => {
|
||||||
|
setOperations([]);
|
||||||
|
renderOperations([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDownloadEdited = async () => {
|
||||||
|
const canvas = canvasRef.current;
|
||||||
|
if (!canvas || files.length === 0) return;
|
||||||
|
const blob = await new Promise<Blob | null>((resolve) =>
|
||||||
|
canvas.toBlob(resolve, "image/png")
|
||||||
|
);
|
||||||
|
if (blob) {
|
||||||
|
const name =
|
||||||
|
files[0].name.replace(/\.[^./\\]+$/, "") + "_manual-no-bg.png";
|
||||||
|
downloadBlob(blob, name);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleModeChange = (nextMode: EditMode) => {
|
||||||
|
setEditMode(nextMode);
|
||||||
|
clearResult();
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleClearModels = async () => {
|
||||||
|
setIsClearingCache(true);
|
||||||
|
setCacheMessage("");
|
||||||
|
try {
|
||||||
|
const deleted = await clearImglyCache();
|
||||||
|
const released = disposePersistentWorker(plugin.manifest.id);
|
||||||
|
setCacheMessage(
|
||||||
|
deleted || released
|
||||||
|
? "Cached models cleared. Automatic mode will download them again."
|
||||||
|
: "No cached models were found."
|
||||||
|
);
|
||||||
|
} catch {
|
||||||
|
setCacheMessage("Could not clear cached models.");
|
||||||
|
} finally {
|
||||||
|
setIsClearingCache(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="mx-auto max-w-6xl p-[18px] md:p-[28px]">
|
||||||
|
<div className="grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_300px]">
|
||||||
|
<div className="space-y-6">
|
||||||
|
{files.length === 0 ? (
|
||||||
|
<Card title="Upload Image">
|
||||||
|
<Dropzone
|
||||||
|
accept="image/jpeg,image/png,image/webp"
|
||||||
|
multiple={false}
|
||||||
|
maxSizeMb={25}
|
||||||
|
onFilesDrop={handleFilesDrop}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
) : (
|
||||||
|
<Card
|
||||||
|
title={
|
||||||
|
editMode === "select-area"
|
||||||
|
? "Select Background"
|
||||||
|
: resultFile
|
||||||
|
? "Result"
|
||||||
|
: "Source Image"
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className="flex min-h-[320px] items-center justify-center overflow-hidden rounded-xl border border-[var(--p-border)]"
|
||||||
|
style={{
|
||||||
|
backgroundColor: "#fff",
|
||||||
|
backgroundImage:
|
||||||
|
"linear-gradient(45deg,#ddd 25%,transparent 25%),linear-gradient(-45deg,#ddd 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ddd 75%),linear-gradient(-45deg,transparent 75%,#ddd 75%)",
|
||||||
|
backgroundPosition: "0 0,0 8px,8px -8px,-8px 0",
|
||||||
|
backgroundSize: "16px 16px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{editMode === "select-area" ? (
|
||||||
|
<canvas
|
||||||
|
ref={canvasRef}
|
||||||
|
onPointerDown={handlePointerDown}
|
||||||
|
onPointerMove={handlePointerMove}
|
||||||
|
onPointerUp={finishStroke}
|
||||||
|
onPointerCancel={finishStroke}
|
||||||
|
className="max-h-[65vh] max-w-full cursor-crosshair object-contain"
|
||||||
|
style={{ touchAction: "none" }}
|
||||||
|
aria-label="Background mask editor"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<img
|
||||||
|
src={resultUrl || sourceUrl}
|
||||||
|
alt={resultFile ? "Background removed" : "Source"}
|
||||||
|
className="max-h-[65vh] max-w-full object-contain"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{editMode === "select-area" && (
|
||||||
|
<p className="mb-0 mt-3 text-sm text-[var(--p-muted)]">
|
||||||
|
Choose Select background and click a representative point.
|
||||||
|
Only the connected region with a similar color is removed.
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{isExecuting && (
|
||||||
|
<ToolProgress
|
||||||
|
percentage={progress.percentage ?? 0}
|
||||||
|
message={progress.message}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{error && (
|
||||||
|
<Card className="border-red-300">
|
||||||
|
<p className="m-0 text-sm text-red-700">{error}</p>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-6">
|
||||||
|
<Card title="Mode">
|
||||||
|
<div className="grid grid-cols-2 gap-2">
|
||||||
|
<Button
|
||||||
|
variant={editMode === "automatic" ? "primary" : "secondary"}
|
||||||
|
onClick={() => handleModeChange("automatic")}
|
||||||
|
disabled={isExecuting}
|
||||||
|
>
|
||||||
|
Automatic
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant={editMode === "select-area" ? "primary" : "secondary"}
|
||||||
|
onClick={() => handleModeChange("select-area")}
|
||||||
|
disabled={isExecuting}
|
||||||
|
>
|
||||||
|
Select area
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
<p className="mb-0 mt-3 text-xs leading-relaxed text-[var(--p-muted)]">
|
||||||
|
Select area uses a sampled background color and does not run the
|
||||||
|
AI model.
|
||||||
|
</p>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card title="Settings">
|
||||||
|
<div className="space-y-5">
|
||||||
|
{editMode === "automatic" ? (
|
||||||
|
<>
|
||||||
|
<Select
|
||||||
|
label="Model"
|
||||||
|
value={quality}
|
||||||
|
disabled={isExecuting}
|
||||||
|
onChange={(event) => {
|
||||||
|
setQuality(
|
||||||
|
event.target.value as BackgroundRemoverOptions["quality"]
|
||||||
|
);
|
||||||
|
clearResult();
|
||||||
|
}}
|
||||||
|
options={[
|
||||||
|
{ label: "Smallest download (quantized)", value: "small" },
|
||||||
|
{ label: "Balanced (FP16)", value: "medium" },
|
||||||
|
{ label: "Best quality (FP32)", value: "large" },
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<label className="flex items-center gap-2 text-sm text-[var(--p-text)]">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={useGpu}
|
||||||
|
disabled={isExecuting}
|
||||||
|
onChange={(event) => {
|
||||||
|
setUseGpu(event.target.checked);
|
||||||
|
clearResult();
|
||||||
|
}}
|
||||||
|
className="h-4 w-4 accent-[var(--p-accent)]"
|
||||||
|
/>
|
||||||
|
Use GPU acceleration
|
||||||
|
</label>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="grid grid-cols-3 gap-2">
|
||||||
|
<Button
|
||||||
|
variant={editorAction === "sample" ? "primary" : "secondary"}
|
||||||
|
onClick={() => setEditorAction("sample")}
|
||||||
|
>
|
||||||
|
Select
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant={editorAction === "remove" ? "primary" : "secondary"}
|
||||||
|
onClick={() => setEditorAction("remove")}
|
||||||
|
>
|
||||||
|
Remove
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant={editorAction === "restore" ? "primary" : "secondary"}
|
||||||
|
onClick={() => setEditorAction("restore")}
|
||||||
|
>
|
||||||
|
Restore
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{editorAction === "sample" ? (
|
||||||
|
<Slider
|
||||||
|
label={`Color tolerance: ${tolerance}%`}
|
||||||
|
min={1}
|
||||||
|
max={40}
|
||||||
|
value={tolerance}
|
||||||
|
onChange={(event) =>
|
||||||
|
setTolerance(Number(event.target.value))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Slider
|
||||||
|
label={`Brush size: ${brushSize}%`}
|
||||||
|
min={1}
|
||||||
|
max={20}
|
||||||
|
value={brushSize}
|
||||||
|
onChange={(event) =>
|
||||||
|
setBrushSize(Number(event.target.value))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="grid grid-cols-2 gap-2">
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
disabled={operations.length === 0}
|
||||||
|
onClick={handleUndo}
|
||||||
|
>
|
||||||
|
Undo
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
disabled={operations.length === 0}
|
||||||
|
onClick={handleResetMask}
|
||||||
|
>
|
||||||
|
Reset
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="space-y-2 border-t border-[var(--p-border)] pt-4">
|
||||||
|
{editMode === "select-area" ? (
|
||||||
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
disabled={files.length === 0}
|
||||||
|
onClick={handleDownloadEdited}
|
||||||
|
>
|
||||||
|
Download selected result
|
||||||
|
</Button>
|
||||||
|
) : !resultFile ? (
|
||||||
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
disabled={files.length === 0 || isExecuting}
|
||||||
|
onClick={handleRun}
|
||||||
|
>
|
||||||
|
{isExecuting ? "Processing..." : "Remove background"}
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
onClick={() => downloadBlob(resultFile.blob, resultFile.name)}
|
||||||
|
>
|
||||||
|
Download PNG
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
{files.length > 0 && (
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
className="w-full"
|
||||||
|
disabled={isExecuting}
|
||||||
|
onClick={() => {
|
||||||
|
setFiles([]);
|
||||||
|
setSourceUrl("");
|
||||||
|
clearResult();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Choose another image
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="space-y-2 border-t border-[var(--p-border)] pt-4">
|
||||||
|
<Button
|
||||||
|
variant="danger"
|
||||||
|
className="w-full"
|
||||||
|
disabled={isExecuting || isClearingCache}
|
||||||
|
onClick={handleClearModels}
|
||||||
|
>
|
||||||
|
{isClearingCache ? "Clearing..." : "Clear models"}
|
||||||
|
</Button>
|
||||||
|
<p className="m-0 text-xs leading-relaxed text-[var(--p-muted)]">
|
||||||
|
Removes downloaded AI models and ONNX runtime files from this
|
||||||
|
browser.
|
||||||
|
</p>
|
||||||
|
{cacheMessage && (
|
||||||
|
<p
|
||||||
|
role="status"
|
||||||
|
className="m-0 text-xs font-medium text-[var(--p-text)]"
|
||||||
|
>
|
||||||
|
{cacheMessage}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{warning && pendingOptions && (
|
||||||
|
<div className="fixed inset-0 z-[70] flex items-center justify-center bg-black/50 p-4">
|
||||||
|
<div
|
||||||
|
role="alertdialog"
|
||||||
|
aria-modal="true"
|
||||||
|
className="w-full max-w-md rounded-2xl border border-[var(--p-border)] bg-[var(--p-surface)] p-6"
|
||||||
|
>
|
||||||
|
<h2 className="m-0 text-lg font-semibold text-[var(--p-text)]">
|
||||||
|
One-time download
|
||||||
|
</h2>
|
||||||
|
<p className="my-4 text-sm leading-relaxed text-[var(--p-muted)]">
|
||||||
|
{warning}
|
||||||
|
</p>
|
||||||
|
<div className="flex justify-end gap-2">
|
||||||
|
<Button
|
||||||
|
variant="secondary"
|
||||||
|
onClick={() => {
|
||||||
|
setWarning(null);
|
||||||
|
setPendingOptions(null);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
const options = pendingOptions;
|
||||||
|
setWarning(null);
|
||||||
|
setPendingOptions(null);
|
||||||
|
void execute(options);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Download & run
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
91
src/tools/background-remover/imgly-cache.ts
Normal file
91
src/tools/background-remover/imgly-cache.ts
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/**
|
||||||
|
* Persistent caching for the self-hosted @imgly model + wasm assets.
|
||||||
|
*
|
||||||
|
* @imgly/background-removal fetches its assets with plain `fetch`, so whether
|
||||||
|
* they persist between runs is at the mercy of the server's Cache-Control
|
||||||
|
* headers. The Vite dev server (and some hosts) send `no-store`/`no-cache`,
|
||||||
|
* which makes the model re-download on every run.
|
||||||
|
*
|
||||||
|
* To make caching deterministic and host-independent, we intercept same-origin
|
||||||
|
* `/imgly/` requests and back them with the Cache Storage API, which we control
|
||||||
|
* explicitly. CacheStorage is shared across the origin, so an asset cached by
|
||||||
|
* the worker (during a run) is visible to the main thread (for the pre-run
|
||||||
|
* download estimate) and vice-versa.
|
||||||
|
*/
|
||||||
|
export const IMGLY_CACHE_NAME = "plimi-imgly-v1";
|
||||||
|
|
||||||
|
type FetchInput = Parameters<typeof fetch>[0];
|
||||||
|
|
||||||
|
function urlOf(input: FetchInput): string {
|
||||||
|
if (typeof input === "string") return input;
|
||||||
|
if (input instanceof URL) return input.toString();
|
||||||
|
return input.url;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isImglyUrl(url: string): boolean {
|
||||||
|
return url.includes("/imgly/");
|
||||||
|
}
|
||||||
|
|
||||||
|
let installed = false;
|
||||||
|
|
||||||
|
/** Route `/imgly/` fetches through Cache Storage. Safe to call multiple times. */
|
||||||
|
export function installImglyCache(): void {
|
||||||
|
if (installed) return;
|
||||||
|
installed = true;
|
||||||
|
|
||||||
|
const scope = self as unknown as {
|
||||||
|
fetch: typeof fetch;
|
||||||
|
caches?: CacheStorage;
|
||||||
|
};
|
||||||
|
if (!scope.caches || typeof scope.fetch !== "function") return;
|
||||||
|
|
||||||
|
const original = scope.fetch.bind(scope);
|
||||||
|
scope.fetch = async (input: FetchInput, init?: RequestInit) => {
|
||||||
|
try {
|
||||||
|
const url = urlOf(input);
|
||||||
|
if (isImglyUrl(url)) {
|
||||||
|
const cache = await scope.caches!.open(IMGLY_CACHE_NAME);
|
||||||
|
const hit = await cache.match(url);
|
||||||
|
if (hit) return hit;
|
||||||
|
const res = await original(input, init);
|
||||||
|
if (res.ok) {
|
||||||
|
try {
|
||||||
|
await cache.put(url, res.clone());
|
||||||
|
} catch {
|
||||||
|
// Quota or opaque response — fall through with the live response.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Any cache failure: fall back to the network below.
|
||||||
|
}
|
||||||
|
return original(input, init);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Whether an `/imgly/` asset is already stored locally (no download needed). */
|
||||||
|
export async function isImglyAssetCached(url: string): Promise<boolean> {
|
||||||
|
const scope = self as unknown as { caches?: CacheStorage };
|
||||||
|
if (scope.caches) {
|
||||||
|
try {
|
||||||
|
const cache = await scope.caches.open(IMGLY_CACHE_NAME);
|
||||||
|
return Boolean(await cache.match(url));
|
||||||
|
} catch {
|
||||||
|
// fall through to HTTP-cache probe
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const res = await fetch(url, { cache: "only-if-cached", mode: "same-origin" });
|
||||||
|
return res.ok;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Delete all persisted IMG.LY model and runtime assets for this origin. */
|
||||||
|
export async function clearImglyCache(): Promise<boolean> {
|
||||||
|
const scope = globalThis as typeof globalThis & { caches?: CacheStorage };
|
||||||
|
if (!scope.caches) return false;
|
||||||
|
return scope.caches.delete(IMGLY_CACHE_NAME);
|
||||||
|
}
|
||||||
86
src/tools/background-remover/index.ts
Normal file
86
src/tools/background-remover/index.ts
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import { lazy } from "react";
|
||||||
|
import type { PlimiPlugin } from "../../core/plugins/plugin-types";
|
||||||
|
import { runBackgroundRemover } from "./run";
|
||||||
|
import {
|
||||||
|
estimateUncachedDownloadBytes,
|
||||||
|
type BackgroundRemoverOptions,
|
||||||
|
} from "./remove";
|
||||||
|
import BgWorker from "./worker?worker";
|
||||||
|
|
||||||
|
export type { BackgroundRemoverOptions } from "./remove";
|
||||||
|
|
||||||
|
const BackgroundRemoverUi = lazy(() => import("./BackgroundRemoverUi"));
|
||||||
|
|
||||||
|
function formatMb(bytes: number): string {
|
||||||
|
return `${(bytes / 1024 / 1024).toFixed(0)} MB`;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const backgroundRemoverPlugin: PlimiPlugin<BackgroundRemoverOptions> = {
|
||||||
|
manifest: {
|
||||||
|
id: "background-remover",
|
||||||
|
name: "Background Remover",
|
||||||
|
description:
|
||||||
|
"Remove the background from any image with AI, entirely in your browser. Your photo is never uploaded.",
|
||||||
|
category: "image",
|
||||||
|
version: "1.0.0",
|
||||||
|
tags: ["image", "background", "remove", "ai", "transparent", "cutout"],
|
||||||
|
input: {
|
||||||
|
type: "files",
|
||||||
|
accept: ["image/png", "image/jpeg", "image/webp"],
|
||||||
|
multiple: false,
|
||||||
|
},
|
||||||
|
output: { type: "files" },
|
||||||
|
offlineReady: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
optionsSchema: {
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "quality",
|
||||||
|
label: "Quality",
|
||||||
|
defaultValue: "small",
|
||||||
|
options: [
|
||||||
|
{ label: "Smallest download (quantized)", value: "small" },
|
||||||
|
{ label: "Balanced (FP16)", value: "medium" },
|
||||||
|
{ label: "Best quality (FP32)", value: "large" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "boolean",
|
||||||
|
key: "useGpu",
|
||||||
|
label: "Use GPU (WebGPU) when available",
|
||||||
|
defaultValue: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities: {
|
||||||
|
cancelable: false,
|
||||||
|
worker: true,
|
||||||
|
persistentWorker: true,
|
||||||
|
wasm: true,
|
||||||
|
customUi: true,
|
||||||
|
preview: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
getRunWarning: async (_input, options) => {
|
||||||
|
const bytes = await estimateUncachedDownloadBytes(options, self.location.origin);
|
||||||
|
if (bytes <= 0) return null;
|
||||||
|
const label =
|
||||||
|
options.quality === "small"
|
||||||
|
? "Smallest download"
|
||||||
|
: options.quality === "medium"
|
||||||
|
? "Balanced"
|
||||||
|
: "Best quality";
|
||||||
|
return (
|
||||||
|
`Running the “${label}” model needs a one-time download of about ` +
|
||||||
|
`${formatMb(bytes)} to your device. It is cached afterwards, so future ` +
|
||||||
|
`runs are instant and fully offline. Continue?`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
run: runBackgroundRemover,
|
||||||
|
worker: () => new BgWorker(),
|
||||||
|
customUi: BackgroundRemoverUi,
|
||||||
|
};
|
||||||
42
src/tools/background-remover/remove.test.ts
Normal file
42
src/tools/background-remover/remove.test.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
import { createBackgroundRemovalProgress } from "./remove";
|
||||||
|
|
||||||
|
describe("background remover progress", () => {
|
||||||
|
it("aggregates resource downloads without resetting the percentage", () => {
|
||||||
|
const report = vi.fn();
|
||||||
|
const progress = createBackgroundRemovalProgress(
|
||||||
|
new Map([
|
||||||
|
["/models/isnet_quint8", 80],
|
||||||
|
["/onnxruntime-web/ort.wasm", 20],
|
||||||
|
]),
|
||||||
|
report
|
||||||
|
);
|
||||||
|
|
||||||
|
progress("fetch:/models/isnet_quint8", 40, 80);
|
||||||
|
progress("fetch:/models/isnet_quint8", 80, 80);
|
||||||
|
progress("fetch:/onnxruntime-web/ort.wasm", 10, 20);
|
||||||
|
progress("compute:decode", 0, 4);
|
||||||
|
progress("compute:inference", 1, 4);
|
||||||
|
progress("compute:encode", 4, 4);
|
||||||
|
|
||||||
|
const percentages = report.mock.calls.map(
|
||||||
|
([value]) => value.percentage as number
|
||||||
|
);
|
||||||
|
expect(percentages).toEqual([...percentages].sort((a, b) => a - b));
|
||||||
|
expect(percentages.at(-1)).toBe(100);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("uses the full progress range when the model session is already loaded", () => {
|
||||||
|
const report = vi.fn();
|
||||||
|
const progress = createBackgroundRemovalProgress(new Map(), report);
|
||||||
|
|
||||||
|
progress("compute:decode", 0, 4);
|
||||||
|
progress("compute:inference", 1, 4);
|
||||||
|
progress("compute:mask", 2, 4);
|
||||||
|
progress("compute:encode", 4, 4);
|
||||||
|
|
||||||
|
expect(report.mock.calls.map(([value]) => value.percentage)).toEqual([
|
||||||
|
0, 25, 50, 100,
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
});
|
||||||
194
src/tools/background-remover/remove.ts
Normal file
194
src/tools/background-remover/remove.ts
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
import { removeBackground } from "@imgly/background-removal";
|
||||||
|
import type { ToolResult } from "../../core/io/output-types";
|
||||||
|
import type { ToolProgress } from "../../core/plugins/plugin-types";
|
||||||
|
import { installImglyCache, isImglyAssetCached } from "./imgly-cache";
|
||||||
|
|
||||||
|
export interface BackgroundRemoverOptions {
|
||||||
|
/** Quality/size trade-off: small=quint8, medium=fp16, large=fp32. */
|
||||||
|
quality: "small" | "medium" | "large";
|
||||||
|
/** Use WebGPU when available (falls back to wasm automatically). */
|
||||||
|
useGpu: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Self-hosted asset location. The @imgly model + onnxruntime-web wasm files are
|
||||||
|
* mirrored into `public/imgly/` (see scripts/fetch-imgly-assets.mjs) so nothing
|
||||||
|
* is fetched from a third party — the image never leaves the browser.
|
||||||
|
*/
|
||||||
|
function publicPath(origin: string): string {
|
||||||
|
return new URL("/imgly/", origin).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
const MODEL_BY_QUALITY: Record<
|
||||||
|
BackgroundRemoverOptions["quality"],
|
||||||
|
"isnet" | "isnet_fp16" | "isnet_quint8"
|
||||||
|
> = {
|
||||||
|
small: "isnet_quint8",
|
||||||
|
medium: "isnet_fp16",
|
||||||
|
large: "isnet",
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ResourceEntry {
|
||||||
|
size: number;
|
||||||
|
chunks: Array<{ name: string }>;
|
||||||
|
}
|
||||||
|
type ResourceMap = Record<string, ResourceEntry>;
|
||||||
|
|
||||||
|
function resourceKeys(options: BackgroundRemoverOptions): string[] {
|
||||||
|
const wasmBase = options.useGpu
|
||||||
|
? "/onnxruntime-web/ort-wasm-simd-threaded.jsep"
|
||||||
|
: "/onnxruntime-web/ort-wasm-simd-threaded";
|
||||||
|
|
||||||
|
return [
|
||||||
|
`/models/${MODEL_BY_QUALITY[options.quality]}`,
|
||||||
|
`${wasmBase}.wasm`,
|
||||||
|
`${wasmBase}.mjs`,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
async function loadResourceMap(base: string): Promise<ResourceMap | null> {
|
||||||
|
try {
|
||||||
|
const res = await fetch(new URL("resources.json", base).toString());
|
||||||
|
if (!res.ok) return null;
|
||||||
|
return (await res.json()) as ResourceMap;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createBackgroundRemovalProgress(
|
||||||
|
expectedSizes: ReadonlyMap<string, number>,
|
||||||
|
reportProgress?: (progress: ToolProgress) => void
|
||||||
|
): (key: string, current: number, total: number) => void {
|
||||||
|
const fetchedByKey = new Map<string, number>();
|
||||||
|
const expectedTotal = [...expectedSizes.values()].reduce(
|
||||||
|
(sum, size) => sum + size,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
let sawFetch = false;
|
||||||
|
let lastPercentage = 0;
|
||||||
|
|
||||||
|
return (key, current, total) => {
|
||||||
|
let percentage: number;
|
||||||
|
let message: string;
|
||||||
|
|
||||||
|
if (key.startsWith("fetch:")) {
|
||||||
|
sawFetch = true;
|
||||||
|
const resourceKey = key.slice("fetch:".length);
|
||||||
|
fetchedByKey.set(resourceKey, Math.min(current, total));
|
||||||
|
|
||||||
|
const fetched = [...fetchedByKey.values()].reduce(
|
||||||
|
(sum, size) => sum + size,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
const knownTotal =
|
||||||
|
expectedTotal > 0
|
||||||
|
? expectedTotal
|
||||||
|
: [...fetchedByKey.keys()].reduce(
|
||||||
|
(sum, knownKey) =>
|
||||||
|
sum + (knownKey === resourceKey ? total : fetchedByKey.get(knownKey) ?? 0),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
percentage = knownTotal > 0 ? (fetched / knownTotal) * 65 : lastPercentage;
|
||||||
|
message = "Loading AI model...";
|
||||||
|
} else if (key.startsWith("compute:")) {
|
||||||
|
const computePercentage = total > 0 ? current / total : 0;
|
||||||
|
percentage = sawFetch
|
||||||
|
? 65 + computePercentage * 35
|
||||||
|
: computePercentage * 100;
|
||||||
|
message =
|
||||||
|
current === 0 ? "Preparing image..." : "Removing background...";
|
||||||
|
} else {
|
||||||
|
percentage = lastPercentage;
|
||||||
|
message = "Processing...";
|
||||||
|
}
|
||||||
|
|
||||||
|
lastPercentage = Math.max(lastPercentage, Math.min(100, percentage));
|
||||||
|
reportProgress?.({ percentage: lastPercentage, message });
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Estimate how many bytes still need downloading before the tool can run with
|
||||||
|
* the given options. Returns 0 when everything is already cached locally.
|
||||||
|
*/
|
||||||
|
export async function estimateUncachedDownloadBytes(
|
||||||
|
options: BackgroundRemoverOptions,
|
||||||
|
origin: string
|
||||||
|
): Promise<number> {
|
||||||
|
const base = publicPath(origin);
|
||||||
|
const resources = await loadResourceMap(base);
|
||||||
|
if (!resources) return 0;
|
||||||
|
|
||||||
|
let bytes = 0;
|
||||||
|
for (const key of resourceKeys(options)) {
|
||||||
|
const entry = resources[key];
|
||||||
|
if (!entry?.chunks?.length) continue;
|
||||||
|
// Chunks of a resource are fetched together, so the first chunk is a
|
||||||
|
// reliable proxy for whether the whole resource is cached.
|
||||||
|
const firstChunkUrl = new URL(entry.chunks[0].name, base).toString();
|
||||||
|
if (!(await isImglyAssetCached(firstChunkUrl))) {
|
||||||
|
bytes += entry.size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function removeImageBackground(
|
||||||
|
fileName: string,
|
||||||
|
imageData: Blob | ArrayBuffer | Uint8Array,
|
||||||
|
options: BackgroundRemoverOptions,
|
||||||
|
origin: string,
|
||||||
|
reportProgress?: (progress: ToolProgress) => void
|
||||||
|
): Promise<ToolResult> {
|
||||||
|
// Back /imgly/ fetches with Cache Storage so the model persists between runs
|
||||||
|
// regardless of server cache headers.
|
||||||
|
installImglyCache();
|
||||||
|
|
||||||
|
const base = publicPath(origin);
|
||||||
|
const resources = await loadResourceMap(base);
|
||||||
|
const expectedSizes = new Map(
|
||||||
|
resourceKeys(options).flatMap((key) => {
|
||||||
|
const size = resources?.[key]?.size;
|
||||||
|
return size === undefined ? [] : [[key, size] as const];
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const progress = createBackgroundRemovalProgress(
|
||||||
|
expectedSizes,
|
||||||
|
reportProgress
|
||||||
|
);
|
||||||
|
|
||||||
|
const source =
|
||||||
|
imageData instanceof Blob
|
||||||
|
? imageData
|
||||||
|
: new Blob([
|
||||||
|
(imageData instanceof Uint8Array
|
||||||
|
? imageData
|
||||||
|
: new Uint8Array(imageData)) as unknown as BlobPart,
|
||||||
|
]);
|
||||||
|
|
||||||
|
const resultBlob = await removeBackground(source, {
|
||||||
|
publicPath: base,
|
||||||
|
model: MODEL_BY_QUALITY[options.quality],
|
||||||
|
device: options.useGpu ? "gpu" : "cpu",
|
||||||
|
// We already run inside a Web Worker; avoid nested worker proxying.
|
||||||
|
proxyToWorker: false,
|
||||||
|
output: { format: "image/png" },
|
||||||
|
progress,
|
||||||
|
});
|
||||||
|
|
||||||
|
const outName = fileName.replace(/\.[^./\\]+$/, "") + "_no-bg.png";
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: "files",
|
||||||
|
files: [
|
||||||
|
{
|
||||||
|
name: outName,
|
||||||
|
mimeType: "image/png",
|
||||||
|
blob: resultBlob,
|
||||||
|
sizeAfter: resultBlob.size,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
37
src/tools/background-remover/run.test.ts
Normal file
37
src/tools/background-remover/run.test.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { describe, it, expect, vi } from "vitest";
|
||||||
|
import { backgroundRemoverPlugin } from "./index";
|
||||||
|
import { runBackgroundRemover } from "./run";
|
||||||
|
import type { BackgroundRemoverOptions } from "./remove";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
|
||||||
|
const mockContext: ToolContext = {
|
||||||
|
signal: new AbortController().signal,
|
||||||
|
reportProgress: vi.fn(),
|
||||||
|
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
||||||
|
};
|
||||||
|
|
||||||
|
const options: BackgroundRemoverOptions = { quality: "small", useGpu: true };
|
||||||
|
|
||||||
|
describe("Background Remover Plugin", () => {
|
||||||
|
it("should have correct manifest", () => {
|
||||||
|
expect(backgroundRemoverPlugin.manifest.id).toBe("background-remover");
|
||||||
|
expect(backgroundRemoverPlugin.manifest.category).toBe("image");
|
||||||
|
expect(backgroundRemoverPlugin.manifest.input.type).toBe("files");
|
||||||
|
expect(backgroundRemoverPlugin.manifest.output.type).toBe("files");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should run in a worker with wasm capability", () => {
|
||||||
|
expect(backgroundRemoverPlugin.capabilities?.worker).toBe(true);
|
||||||
|
expect(backgroundRemoverPlugin.capabilities?.persistentWorker).toBe(true);
|
||||||
|
expect(backgroundRemoverPlugin.capabilities?.wasm).toBe(true);
|
||||||
|
expect(backgroundRemoverPlugin.capabilities?.customUi).toBe(true);
|
||||||
|
expect(backgroundRemoverPlugin.worker).toBeDefined();
|
||||||
|
expect(backgroundRemoverPlugin.customUi).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should throw if no image is provided", async () => {
|
||||||
|
await expect(
|
||||||
|
runBackgroundRemover({ files: [] }, options, mockContext)
|
||||||
|
).rejects.toThrow("No image provided.");
|
||||||
|
});
|
||||||
|
});
|
||||||
26
src/tools/background-remover/run.ts
Normal file
26
src/tools/background-remover/run.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import type { ToolInput } from "../../core/io/input-types";
|
||||||
|
import type { ToolResult } from "../../core/io/output-types";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
import { removeImageBackground, type BackgroundRemoverOptions } from "./remove";
|
||||||
|
|
||||||
|
export async function runBackgroundRemover(
|
||||||
|
input: ToolInput,
|
||||||
|
options: BackgroundRemoverOptions,
|
||||||
|
context: ToolContext
|
||||||
|
): Promise<ToolResult> {
|
||||||
|
const files = input.files;
|
||||||
|
|
||||||
|
if (!files || !Array.isArray(files) || files.length === 0) {
|
||||||
|
throw new Error("No image provided.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const file = files[0];
|
||||||
|
|
||||||
|
return removeImageBackground(
|
||||||
|
file.name,
|
||||||
|
file,
|
||||||
|
options,
|
||||||
|
self.location.origin,
|
||||||
|
context.reportProgress
|
||||||
|
);
|
||||||
|
}
|
||||||
44
src/tools/background-remover/worker.ts
Normal file
44
src/tools/background-remover/worker.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import type {
|
||||||
|
ToolWorkerRequest,
|
||||||
|
ToolWorkerResponse,
|
||||||
|
} from "../../core/plugins/worker-protocol";
|
||||||
|
import { removeImageBackground, type BackgroundRemoverOptions } from "./remove";
|
||||||
|
|
||||||
|
function post(response: ToolWorkerResponse) {
|
||||||
|
self.postMessage(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.addEventListener(
|
||||||
|
"message",
|
||||||
|
async (e: MessageEvent<ToolWorkerRequest<BackgroundRemoverOptions>>) => {
|
||||||
|
const { id, input, options } = e.data;
|
||||||
|
const files = input.files;
|
||||||
|
|
||||||
|
if (!files || !Array.isArray(files) || files.length === 0) {
|
||||||
|
post({ type: "error", id, error: "No image file provided." });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const file = files[0];
|
||||||
|
const result = await removeImageBackground(
|
||||||
|
file.name,
|
||||||
|
file,
|
||||||
|
options,
|
||||||
|
self.location.origin,
|
||||||
|
(progress) => post({ type: "progress", id, progress })
|
||||||
|
);
|
||||||
|
|
||||||
|
post({ type: "success", id, result });
|
||||||
|
} catch (error) {
|
||||||
|
post({
|
||||||
|
type: "error",
|
||||||
|
id,
|
||||||
|
error:
|
||||||
|
error instanceof Error
|
||||||
|
? error.message
|
||||||
|
: "Unknown error occurred while removing the background.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
71
src/tools/image-to-pdf/index.ts
Normal file
71
src/tools/image-to-pdf/index.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import type { PlimiPlugin } from "../../core/plugins/plugin-types";
|
||||||
|
import { runImageToPdf } from "./run";
|
||||||
|
|
||||||
|
export interface ImageToPdfOptions {
|
||||||
|
pageSize: "fit" | "a4" | "letter";
|
||||||
|
orientation: "auto" | "portrait" | "landscape";
|
||||||
|
margin: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const imageToPdfPlugin: PlimiPlugin<ImageToPdfOptions> = {
|
||||||
|
manifest: {
|
||||||
|
id: "image-to-pdf",
|
||||||
|
name: "Images to PDF",
|
||||||
|
description:
|
||||||
|
"Turn one or more JPG, PNG, or WebP images into a single PDF without uploading them.",
|
||||||
|
category: "pdf",
|
||||||
|
version: "1.0.0",
|
||||||
|
tags: ["image", "pdf", "jpg", "png", "webp", "convert"],
|
||||||
|
input: {
|
||||||
|
type: "files",
|
||||||
|
label: "Images, in page order",
|
||||||
|
description: "Each image becomes one page. Select files in the order you want them to appear.",
|
||||||
|
accept: ["image/jpeg", "image/png", "image/webp"],
|
||||||
|
multiple: true,
|
||||||
|
maxSizeMb: 30,
|
||||||
|
maxFiles: 100,
|
||||||
|
},
|
||||||
|
output: { type: "files" },
|
||||||
|
offlineReady: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
optionsSchema: {
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "pageSize",
|
||||||
|
label: "Page size",
|
||||||
|
defaultValue: "fit",
|
||||||
|
options: [
|
||||||
|
{ label: "Fit each image", value: "fit" },
|
||||||
|
{ label: "A4", value: "a4" },
|
||||||
|
{ label: "US Letter", value: "letter" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "orientation",
|
||||||
|
label: "Orientation",
|
||||||
|
defaultValue: "auto",
|
||||||
|
options: [
|
||||||
|
{ label: "Automatic", value: "auto" },
|
||||||
|
{ label: "Portrait", value: "portrait" },
|
||||||
|
{ label: "Landscape", value: "landscape" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "number",
|
||||||
|
key: "margin",
|
||||||
|
label: "Margin (mm)",
|
||||||
|
defaultValue: 10,
|
||||||
|
min: 0,
|
||||||
|
max: 40,
|
||||||
|
step: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities: { cancelable: true },
|
||||||
|
permissions: { network: "none", fileSystem: "read-write" },
|
||||||
|
run: runImageToPdf,
|
||||||
|
};
|
||||||
47
src/tools/image-to-pdf/run.test.ts
Normal file
47
src/tools/image-to-pdf/run.test.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
import { PDFDocument } from "pdf-lib";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
import { imageToPdfPlugin, type ImageToPdfOptions } from "./index";
|
||||||
|
import { runImageToPdf } from "./run";
|
||||||
|
|
||||||
|
const context: ToolContext = {
|
||||||
|
signal: new AbortController().signal,
|
||||||
|
reportProgress: vi.fn(),
|
||||||
|
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
||||||
|
};
|
||||||
|
|
||||||
|
const options: ImageToPdfOptions = {
|
||||||
|
pageSize: "fit",
|
||||||
|
orientation: "auto",
|
||||||
|
margin: 10,
|
||||||
|
};
|
||||||
|
|
||||||
|
const onePixelPng = Uint8Array.from(atob(
|
||||||
|
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
|
||||||
|
), (char) => char.charCodeAt(0));
|
||||||
|
|
||||||
|
describe("Images to PDF", () => {
|
||||||
|
it("has a local PDF plugin manifest", () => {
|
||||||
|
expect(imageToPdfPlugin.manifest.id).toBe("image-to-pdf");
|
||||||
|
expect(imageToPdfPlugin.manifest.category).toBe("pdf");
|
||||||
|
expect(imageToPdfPlugin.permissions?.network).toBe("none");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("requires at least one image", async () => {
|
||||||
|
await expect(runImageToPdf({ files: [] }, options, context)).rejects.toThrow(
|
||||||
|
"Add at least one image."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("creates one PDF page per image", async () => {
|
||||||
|
const files = ["first.png", "second.png"].map(
|
||||||
|
(name) => new File([onePixelPng], name, { type: "image/png" })
|
||||||
|
);
|
||||||
|
const result = await runImageToPdf({ files }, options, context);
|
||||||
|
expect(result.type).toBe("files");
|
||||||
|
if (result.type !== "files") throw new Error("Unexpected result");
|
||||||
|
expect(result.files[0].name).toBe("images.pdf");
|
||||||
|
const pdf = await PDFDocument.load(await result.files[0].blob.arrayBuffer());
|
||||||
|
expect(pdf.getPageCount()).toBe(2);
|
||||||
|
});
|
||||||
|
});
|
||||||
113
src/tools/image-to-pdf/run.ts
Normal file
113
src/tools/image-to-pdf/run.ts
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
import { PDFDocument } from "pdf-lib";
|
||||||
|
import type { ToolInput } from "../../core/io/input-types";
|
||||||
|
import type { ToolResult } from "../../core/io/output-types";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
import type { ImageToPdfOptions } from "./index";
|
||||||
|
|
||||||
|
const MM_TO_POINTS = 72 / 25.4;
|
||||||
|
const PAGE_SIZES = {
|
||||||
|
a4: [595.28, 841.89],
|
||||||
|
letter: [612, 792],
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
function abortIfNeeded(signal: AbortSignal) {
|
||||||
|
if (signal.aborted) throw new DOMException("Operation cancelled", "AbortError");
|
||||||
|
}
|
||||||
|
|
||||||
|
async function convertWebpToPng(file: File): Promise<Uint8Array> {
|
||||||
|
const bitmap = await createImageBitmap(file);
|
||||||
|
try {
|
||||||
|
const canvas = document.createElement("canvas");
|
||||||
|
canvas.width = bitmap.width;
|
||||||
|
canvas.height = bitmap.height;
|
||||||
|
const context = canvas.getContext("2d");
|
||||||
|
if (!context) throw new Error("Your browser could not prepare this WebP image.");
|
||||||
|
context.drawImage(bitmap, 0, 0);
|
||||||
|
const blob = await new Promise<Blob>((resolve, reject) =>
|
||||||
|
canvas.toBlob(
|
||||||
|
(value) => (value ? resolve(value) : reject(new Error("Could not convert WebP image."))),
|
||||||
|
"image/png"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
return new Uint8Array(await blob.arrayBuffer());
|
||||||
|
} finally {
|
||||||
|
bitmap.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function runImageToPdf(
|
||||||
|
input: ToolInput,
|
||||||
|
options: ImageToPdfOptions,
|
||||||
|
context: ToolContext
|
||||||
|
): Promise<ToolResult> {
|
||||||
|
const files = input.files ?? [];
|
||||||
|
if (files.length === 0) throw new Error("Add at least one image.");
|
||||||
|
|
||||||
|
const pdf = await PDFDocument.create();
|
||||||
|
const margin = Math.max(0, Math.min(40, Number(options.margin) || 0)) * MM_TO_POINTS;
|
||||||
|
|
||||||
|
for (let index = 0; index < files.length; index += 1) {
|
||||||
|
abortIfNeeded(context.signal);
|
||||||
|
const file = files[index];
|
||||||
|
context.reportProgress({
|
||||||
|
percentage: (index / files.length) * 95,
|
||||||
|
message: `Adding ${file.name} (${index + 1}/${files.length})...`,
|
||||||
|
});
|
||||||
|
|
||||||
|
let image;
|
||||||
|
if (file.type === "image/jpeg") {
|
||||||
|
image = await pdf.embedJpg(new Uint8Array(await file.arrayBuffer()));
|
||||||
|
} else if (file.type === "image/png") {
|
||||||
|
image = await pdf.embedPng(new Uint8Array(await file.arrayBuffer()));
|
||||||
|
} else if (file.type === "image/webp") {
|
||||||
|
image = await pdf.embedPng(await convertWebpToPng(file));
|
||||||
|
} else {
|
||||||
|
throw new Error(`${file.name} is not a supported JPG, PNG, or WebP image.`);
|
||||||
|
}
|
||||||
|
|
||||||
|
let pageWidth: number;
|
||||||
|
let pageHeight: number;
|
||||||
|
if (options.pageSize === "fit") {
|
||||||
|
pageWidth = image.width + margin * 2;
|
||||||
|
pageHeight = image.height + margin * 2;
|
||||||
|
} else {
|
||||||
|
[pageWidth, pageHeight] = PAGE_SIZES[options.pageSize];
|
||||||
|
const landscape =
|
||||||
|
options.orientation === "landscape" ||
|
||||||
|
(options.orientation === "auto" && image.width > image.height);
|
||||||
|
if (landscape) [pageWidth, pageHeight] = [pageHeight, pageWidth];
|
||||||
|
}
|
||||||
|
|
||||||
|
const usableWidth = Math.max(1, pageWidth - margin * 2);
|
||||||
|
const usableHeight = Math.max(1, pageHeight - margin * 2);
|
||||||
|
const scale = Math.min(usableWidth / image.width, usableHeight / image.height);
|
||||||
|
const width = image.width * scale;
|
||||||
|
const height = image.height * scale;
|
||||||
|
const page = pdf.addPage([pageWidth, pageHeight]);
|
||||||
|
page.drawImage(image, {
|
||||||
|
x: (pageWidth - width) / 2,
|
||||||
|
y: (pageHeight - height) / 2,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
abortIfNeeded(context.signal);
|
||||||
|
context.reportProgress({ percentage: 98, message: "Finishing PDF..." });
|
||||||
|
const bytes = await pdf.save();
|
||||||
|
const blob = new Blob([bytes as unknown as BlobPart], { type: "application/pdf" });
|
||||||
|
context.reportProgress({ percentage: 100, message: "PDF ready." });
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: "files",
|
||||||
|
files: [{
|
||||||
|
name: files.length === 1
|
||||||
|
? `${files[0].name.replace(/\.[^.]+$/, "")}.pdf`
|
||||||
|
: "images.pdf",
|
||||||
|
mimeType: "application/pdf",
|
||||||
|
blob,
|
||||||
|
sizeBefore: files.reduce((total, file) => total + file.size, 0),
|
||||||
|
sizeAfter: blob.size,
|
||||||
|
}],
|
||||||
|
};
|
||||||
|
}
|
||||||
76
src/tools/pdf-to-docx-ocr/index.ts
Normal file
76
src/tools/pdf-to-docx-ocr/index.ts
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import type { PlimiPlugin } from "../../core/plugins/plugin-types";
|
||||||
|
import { runPdfToDocxOcr } from "./run";
|
||||||
|
|
||||||
|
export interface PdfToDocxOcrOptions {
|
||||||
|
language: "eng" | "fra" | "deu" | "spa" | "ita" | "por" | "nld";
|
||||||
|
quality: "standard" | "high";
|
||||||
|
pageBreaks: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LANGUAGE_NAMES: Record<PdfToDocxOcrOptions["language"], string> = {
|
||||||
|
eng: "English",
|
||||||
|
fra: "French",
|
||||||
|
deu: "German",
|
||||||
|
spa: "Spanish",
|
||||||
|
ita: "Italian",
|
||||||
|
por: "Portuguese",
|
||||||
|
nld: "Dutch",
|
||||||
|
};
|
||||||
|
|
||||||
|
export const pdfToDocxOcrPlugin: PlimiPlugin<PdfToDocxOcrOptions> = {
|
||||||
|
manifest: {
|
||||||
|
id: "pdf-to-docx-ocr",
|
||||||
|
name: "PDF to DOCX with OCR",
|
||||||
|
description:
|
||||||
|
"Extract text from scanned or digital PDFs and create an editable Word document entirely on your device.",
|
||||||
|
category: "pdf",
|
||||||
|
version: "1.0.0",
|
||||||
|
tags: ["pdf", "docx", "word", "ocr", "scan", "convert"],
|
||||||
|
input: {
|
||||||
|
type: "files",
|
||||||
|
label: "PDF document",
|
||||||
|
description: "Best for typed documents and clear scans. Handwriting and complex layouts may need cleanup.",
|
||||||
|
accept: ["application/pdf"],
|
||||||
|
multiple: false,
|
||||||
|
maxSizeMb: 100,
|
||||||
|
maxFiles: 1,
|
||||||
|
},
|
||||||
|
output: { type: "files" },
|
||||||
|
offlineReady: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
optionsSchema: {
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "language",
|
||||||
|
label: "Document language",
|
||||||
|
defaultValue: "eng",
|
||||||
|
options: Object.entries(LANGUAGE_NAMES).map(([value, label]) => ({ value, label })),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "quality",
|
||||||
|
label: "OCR quality",
|
||||||
|
defaultValue: "standard",
|
||||||
|
options: [
|
||||||
|
{ label: "Standard (faster)", value: "standard" },
|
||||||
|
{ label: "High (clearer small text)", value: "high" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "boolean",
|
||||||
|
key: "pageBreaks",
|
||||||
|
label: "Keep PDF page breaks",
|
||||||
|
defaultValue: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities: { cancelable: true, wasm: true },
|
||||||
|
permissions: { network: "optional", fileSystem: "read-write" },
|
||||||
|
getRunWarning: (_input, options) =>
|
||||||
|
`The ${LANGUAGE_NAMES[options.language]} OCR model may be downloaded to your browser and cached. ` +
|
||||||
|
"Your PDF is never uploaded; page rendering, OCR, and DOCX creation all happen locally.",
|
||||||
|
run: runPdfToDocxOcr,
|
||||||
|
};
|
||||||
37
src/tools/pdf-to-docx-ocr/run.test.ts
Normal file
37
src/tools/pdf-to-docx-ocr/run.test.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { describe, expect, it, vi } from "vitest";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
import { pdfToDocxOcrPlugin, type PdfToDocxOcrOptions } from "./index";
|
||||||
|
import { runPdfToDocxOcr } from "./run";
|
||||||
|
|
||||||
|
const context: ToolContext = {
|
||||||
|
signal: new AbortController().signal,
|
||||||
|
reportProgress: vi.fn(),
|
||||||
|
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
||||||
|
};
|
||||||
|
|
||||||
|
const options: PdfToDocxOcrOptions = {
|
||||||
|
language: "eng",
|
||||||
|
quality: "standard",
|
||||||
|
pageBreaks: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
describe("PDF to DOCX with OCR", () => {
|
||||||
|
it("declares local processing with optional model access", () => {
|
||||||
|
expect(pdfToDocxOcrPlugin.manifest.id).toBe("pdf-to-docx-ocr");
|
||||||
|
expect(pdfToDocxOcrPlugin.capabilities?.wasm).toBe(true);
|
||||||
|
expect(pdfToDocxOcrPlugin.permissions?.network).toBe("optional");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("requires a PDF", async () => {
|
||||||
|
await expect(runPdfToDocxOcr({ files: [] }, options, context)).rejects.toThrow(
|
||||||
|
"Add a PDF document."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("rejects a non-PDF before starting OCR", async () => {
|
||||||
|
const file = new File(["hello"], "notes.txt", { type: "text/plain" });
|
||||||
|
await expect(runPdfToDocxOcr({ files: [file] }, options, context)).rejects.toThrow(
|
||||||
|
"The selected file is not a PDF."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
110
src/tools/pdf-to-docx-ocr/run.ts
Normal file
110
src/tools/pdf-to-docx-ocr/run.ts
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
import type { ToolInput } from "../../core/io/input-types";
|
||||||
|
import type { ToolResult } from "../../core/io/output-types";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
import type { PdfToDocxOcrOptions } from "./index";
|
||||||
|
|
||||||
|
function abortIfNeeded(signal: AbortSignal) {
|
||||||
|
if (signal.aborted) throw new DOMException("Operation cancelled", "AbortError");
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function runPdfToDocxOcr(
|
||||||
|
input: ToolInput,
|
||||||
|
options: PdfToDocxOcrOptions,
|
||||||
|
context: ToolContext
|
||||||
|
): Promise<ToolResult> {
|
||||||
|
const file = input.files?.[0];
|
||||||
|
if (!file) throw new Error("Add a PDF document.");
|
||||||
|
if (file.type && file.type !== "application/pdf") throw new Error("The selected file is not a PDF.");
|
||||||
|
|
||||||
|
abortIfNeeded(context.signal);
|
||||||
|
context.reportProgress({ percentage: 1, message: "Opening PDF locally..." });
|
||||||
|
|
||||||
|
const [pdfjs, { createWorker }] = await Promise.all([
|
||||||
|
import("pdfjs-dist"),
|
||||||
|
import("tesseract.js"),
|
||||||
|
]);
|
||||||
|
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
||||||
|
"pdfjs-dist/build/pdf.worker.min.mjs",
|
||||||
|
import.meta.url
|
||||||
|
).toString();
|
||||||
|
|
||||||
|
const loadingTask = pdfjs.getDocument({ data: new Uint8Array(await file.arrayBuffer()) });
|
||||||
|
const pdf = await loadingTask.promise;
|
||||||
|
const pageTexts: string[] = [];
|
||||||
|
const scale = options.quality === "high" ? 2.5 : 1.75;
|
||||||
|
|
||||||
|
const worker = await createWorker(options.language, undefined, {
|
||||||
|
logger: (message) => {
|
||||||
|
if (message.status === "recognizing text" && typeof message.progress === "number") {
|
||||||
|
const completedPages = pageTexts.length;
|
||||||
|
context.reportProgress({
|
||||||
|
percentage: 8 + ((completedPages + message.progress) / pdf.numPages) * 88,
|
||||||
|
message: `Recognizing page ${completedPages + 1} of ${pdf.numPages}...`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const cancelWorker = () => void worker.terminate();
|
||||||
|
context.signal.addEventListener("abort", cancelWorker, { once: true });
|
||||||
|
|
||||||
|
try {
|
||||||
|
for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber += 1) {
|
||||||
|
abortIfNeeded(context.signal);
|
||||||
|
context.reportProgress({
|
||||||
|
percentage: 5 + ((pageNumber - 1) / pdf.numPages) * 88,
|
||||||
|
message: `Rendering page ${pageNumber} of ${pdf.numPages} locally...`,
|
||||||
|
});
|
||||||
|
|
||||||
|
const page = await pdf.getPage(pageNumber);
|
||||||
|
const viewport = page.getViewport({ scale });
|
||||||
|
const canvas = document.createElement("canvas");
|
||||||
|
canvas.width = Math.ceil(viewport.width);
|
||||||
|
canvas.height = Math.ceil(viewport.height);
|
||||||
|
const canvasContext = canvas.getContext("2d", { alpha: false });
|
||||||
|
if (!canvasContext) throw new Error("Your browser could not render this PDF page.");
|
||||||
|
await page.render({ canvas, canvasContext, viewport }).promise;
|
||||||
|
abortIfNeeded(context.signal);
|
||||||
|
|
||||||
|
const result = await worker.recognize(canvas);
|
||||||
|
pageTexts.push(result.data.text.trim());
|
||||||
|
page.cleanup();
|
||||||
|
canvas.width = 1;
|
||||||
|
canvas.height = 1;
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
context.signal.removeEventListener("abort", cancelWorker);
|
||||||
|
await worker.terminate().catch(() => undefined);
|
||||||
|
await loadingTask.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
abortIfNeeded(context.signal);
|
||||||
|
context.reportProgress({ percentage: 97, message: "Building editable DOCX..." });
|
||||||
|
const { Document, Packer, Paragraph } = await import("docx");
|
||||||
|
const children: Array<InstanceType<typeof Paragraph>> = [];
|
||||||
|
pageTexts.forEach((text, pageIndex) => {
|
||||||
|
const lines = text.split(/\r?\n/);
|
||||||
|
lines.forEach((line, lineIndex) => {
|
||||||
|
children.push(new Paragraph({
|
||||||
|
text: line,
|
||||||
|
pageBreakBefore: options.pageBreaks && pageIndex > 0 && lineIndex === 0,
|
||||||
|
spacing: { after: line.trim() ? 120 : 0 },
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const docxDocument = new Document({ sections: [{ children }] });
|
||||||
|
const blob = await Packer.toBlob(docxDocument);
|
||||||
|
context.reportProgress({ percentage: 100, message: "DOCX ready." });
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: "files",
|
||||||
|
files: [{
|
||||||
|
name: `${file.name.replace(/\.pdf$/i, "")}_ocr.docx`,
|
||||||
|
mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||||
|
blob,
|
||||||
|
sizeBefore: file.size,
|
||||||
|
sizeAfter: blob.size,
|
||||||
|
}],
|
||||||
|
};
|
||||||
|
}
|
||||||
80
src/tools/pdf-watermark/index.ts
Normal file
80
src/tools/pdf-watermark/index.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import type { PlimiPlugin } from "../../core/plugins/plugin-types";
|
||||||
|
import { runPdfWatermark } from "./run";
|
||||||
|
import { COLOR_PRESETS, MAX_WATERMARK_CHARS } from "./watermark";
|
||||||
|
import PdfWorker from "./worker?worker";
|
||||||
|
|
||||||
|
export interface PdfWatermarkOptions {
|
||||||
|
text: string;
|
||||||
|
orientation: "horizontal" | "vertical" | "diagonal";
|
||||||
|
opacity: number;
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const pdfWatermarkPlugin: PlimiPlugin<PdfWatermarkOptions> = {
|
||||||
|
manifest: {
|
||||||
|
id: "pdf-watermark",
|
||||||
|
name: "PDF Watermark",
|
||||||
|
description:
|
||||||
|
"Stamp custom text over every page of a PDF, entirely in your browser. The text auto-sizes to fit each page.",
|
||||||
|
category: "pdf",
|
||||||
|
version: "1.0.0",
|
||||||
|
tags: ["pdf", "watermark", "stamp", "text"],
|
||||||
|
input: {
|
||||||
|
type: "files",
|
||||||
|
accept: ["application/pdf"],
|
||||||
|
multiple: false,
|
||||||
|
},
|
||||||
|
output: { type: "files" },
|
||||||
|
offlineReady: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
optionsSchema: {
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "text",
|
||||||
|
key: "text",
|
||||||
|
label: `Watermark Text (max ${MAX_WATERMARK_CHARS} chars)`,
|
||||||
|
defaultValue: "CONFIDENTIAL",
|
||||||
|
placeholder: "e.g. CONFIDENTIAL",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "orientation",
|
||||||
|
label: "Orientation",
|
||||||
|
defaultValue: "diagonal",
|
||||||
|
options: [
|
||||||
|
{ label: "Diagonal", value: "diagonal" },
|
||||||
|
{ label: "Horizontal", value: "horizontal" },
|
||||||
|
{ label: "Vertical", value: "vertical" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "slider",
|
||||||
|
key: "opacity",
|
||||||
|
label: "Opacity (%)",
|
||||||
|
defaultValue: 30,
|
||||||
|
min: 5,
|
||||||
|
max: 100,
|
||||||
|
step: 5,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "select",
|
||||||
|
key: "color",
|
||||||
|
label: "Color",
|
||||||
|
defaultValue: "light-grey",
|
||||||
|
options: Object.entries(COLOR_PRESETS).map(([value, { label }]) => ({
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
capabilities: {
|
||||||
|
cancelable: true,
|
||||||
|
worker: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
run: runPdfWatermark,
|
||||||
|
worker: () => new PdfWorker(),
|
||||||
|
};
|
||||||
95
src/tools/pdf-watermark/run.test.ts
Normal file
95
src/tools/pdf-watermark/run.test.ts
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
import { describe, it, expect, vi } from "vitest";
|
||||||
|
import { PDFDocument } from "pdf-lib";
|
||||||
|
import { pdfWatermarkPlugin, type PdfWatermarkOptions } from "./index";
|
||||||
|
import { runPdfWatermark } from "./run";
|
||||||
|
import { MAX_WATERMARK_CHARS } from "./watermark";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
|
||||||
|
const mockContext: ToolContext = {
|
||||||
|
signal: new AbortController().signal,
|
||||||
|
reportProgress: vi.fn(),
|
||||||
|
logger: { info: vi.fn(), warn: vi.fn(), error: vi.fn() },
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultOptions: PdfWatermarkOptions = {
|
||||||
|
text: "CONFIDENTIAL",
|
||||||
|
orientation: "diagonal",
|
||||||
|
opacity: 30,
|
||||||
|
color: "light-grey",
|
||||||
|
};
|
||||||
|
|
||||||
|
async function makePdfFile(): Promise<File> {
|
||||||
|
const doc = await PDFDocument.create();
|
||||||
|
doc.addPage([595, 842]);
|
||||||
|
const bytes = await doc.save();
|
||||||
|
return new File([bytes as unknown as BlobPart], "sample.pdf", {
|
||||||
|
type: "application/pdf",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
describe("PDF Watermark Plugin", () => {
|
||||||
|
it("should have correct manifest", () => {
|
||||||
|
expect(pdfWatermarkPlugin.manifest.id).toBe("pdf-watermark");
|
||||||
|
expect(pdfWatermarkPlugin.manifest.category).toBe("pdf");
|
||||||
|
expect(pdfWatermarkPlugin.manifest.input.type).toBe("files");
|
||||||
|
expect(pdfWatermarkPlugin.manifest.output.type).toBe("files");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should throw if no file provided", async () => {
|
||||||
|
await expect(
|
||||||
|
runPdfWatermark({ files: [] }, defaultOptions, mockContext)
|
||||||
|
).rejects.toThrow("No PDF file provided.");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should throw if watermark text is empty", async () => {
|
||||||
|
const file = await makePdfFile();
|
||||||
|
await expect(
|
||||||
|
runPdfWatermark({ files: [file] }, { ...defaultOptions, text: " " }, mockContext)
|
||||||
|
).rejects.toThrow("Watermark text is required.");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should produce a watermarked PDF", async () => {
|
||||||
|
const file = await makePdfFile();
|
||||||
|
const result = await runPdfWatermark(
|
||||||
|
{ files: [file] },
|
||||||
|
defaultOptions,
|
||||||
|
mockContext
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(result.type).toBe("files");
|
||||||
|
if (result.type !== "files") throw new Error("unexpected result");
|
||||||
|
expect(result.files).toHaveLength(1);
|
||||||
|
expect(result.files[0].name).toBe("sample_watermarked.pdf");
|
||||||
|
expect(result.files[0].mimeType).toBe("application/pdf");
|
||||||
|
expect(result.files[0].blob.size).toBeGreaterThan(0);
|
||||||
|
|
||||||
|
// Output should still be a loadable PDF with the same page count.
|
||||||
|
const out = await result.files[0].blob.arrayBuffer();
|
||||||
|
const reloaded = await PDFDocument.load(new Uint8Array(out));
|
||||||
|
expect(reloaded.getPageCount()).toBe(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(["horizontal", "vertical", "diagonal"] as const)(
|
||||||
|
"should handle %s orientation",
|
||||||
|
async (orientation) => {
|
||||||
|
const file = await makePdfFile();
|
||||||
|
const result = await runPdfWatermark(
|
||||||
|
{ files: [file] },
|
||||||
|
{ ...defaultOptions, orientation },
|
||||||
|
mockContext
|
||||||
|
);
|
||||||
|
expect(result.type).toBe("files");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
it("should truncate text beyond the max length", async () => {
|
||||||
|
const file = await makePdfFile();
|
||||||
|
const longText = "A".repeat(MAX_WATERMARK_CHARS + 50);
|
||||||
|
const result = await runPdfWatermark(
|
||||||
|
{ files: [file] },
|
||||||
|
{ ...defaultOptions, text: longText },
|
||||||
|
mockContext
|
||||||
|
);
|
||||||
|
expect(result.type).toBe("files");
|
||||||
|
});
|
||||||
|
});
|
||||||
22
src/tools/pdf-watermark/run.ts
Normal file
22
src/tools/pdf-watermark/run.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import type { ToolInput } from "../../core/io/input-types";
|
||||||
|
import type { ToolResult } from "../../core/io/output-types";
|
||||||
|
import type { ToolContext } from "../../core/plugins/plugin-types";
|
||||||
|
import type { PdfWatermarkOptions } from "./index";
|
||||||
|
import { applyWatermark } from "./watermark";
|
||||||
|
|
||||||
|
export async function runPdfWatermark(
|
||||||
|
input: ToolInput,
|
||||||
|
options: PdfWatermarkOptions,
|
||||||
|
context: ToolContext
|
||||||
|
): Promise<ToolResult> {
|
||||||
|
const files = input.files;
|
||||||
|
|
||||||
|
if (!files || !Array.isArray(files) || files.length === 0) {
|
||||||
|
throw new Error("No PDF file provided.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const file = files[0];
|
||||||
|
const buffer = await file.arrayBuffer();
|
||||||
|
|
||||||
|
return applyWatermark(file.name, buffer, options, context.reportProgress);
|
||||||
|
}
|
||||||
149
src/tools/pdf-watermark/watermark.ts
Normal file
149
src/tools/pdf-watermark/watermark.ts
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
import { PDFDocument, StandardFonts, degrees, rgb } from "pdf-lib";
|
||||||
|
import type { ToolResult } from "../../core/io/output-types";
|
||||||
|
import type { ToolProgress } from "../../core/plugins/plugin-types";
|
||||||
|
|
||||||
|
export type WatermarkOrientation = "horizontal" | "vertical" | "diagonal";
|
||||||
|
|
||||||
|
export interface PdfWatermarkOptions {
|
||||||
|
text: string;
|
||||||
|
orientation: WatermarkOrientation;
|
||||||
|
/** Opacity from 0 (invisible) to 100 (fully opaque). */
|
||||||
|
opacity: number;
|
||||||
|
/** Preset color key, see COLOR_PRESETS. */
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const MAX_WATERMARK_CHARS = 60;
|
||||||
|
|
||||||
|
export const COLOR_PRESETS: Record<string, { label: string; rgb: [number, number, number] }> = {
|
||||||
|
"light-grey": { label: "Light Grey", rgb: [0.75, 0.75, 0.75] },
|
||||||
|
grey: { label: "Grey", rgb: [0.5, 0.5, 0.5] },
|
||||||
|
black: { label: "Black", rgb: [0, 0, 0] },
|
||||||
|
red: { label: "Red", rgb: [0.86, 0.21, 0.21] },
|
||||||
|
blue: { label: "Blue", rgb: [0.23, 0.4, 0.85] },
|
||||||
|
green: { label: "Green", rgb: [0.2, 0.6, 0.33] },
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Fraction of the page the watermark may occupy, leaving a safe margin. */
|
||||||
|
const FIT_MARGIN = 0.82;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compute the largest font size at which the rotated text still fits inside the
|
||||||
|
* page, so the watermark is always shown in full without touching the edges.
|
||||||
|
*
|
||||||
|
* A line of text rotated by `angle` occupies an axis-aligned bounding box of:
|
||||||
|
* width = |textW·cos| + |textH·sin|
|
||||||
|
* height = |textW·sin| + |textH·cos|
|
||||||
|
* Both textW and textH scale linearly with font size, so we measure at a probe
|
||||||
|
* size and scale down to satisfy both the width and height constraints.
|
||||||
|
*/
|
||||||
|
function fitFontSize(
|
||||||
|
measureWidth: (size: number) => number,
|
||||||
|
measureHeight: (size: number) => number,
|
||||||
|
pageW: number,
|
||||||
|
pageH: number,
|
||||||
|
angleRad: number
|
||||||
|
): number {
|
||||||
|
const probe = 100;
|
||||||
|
const w = measureWidth(probe);
|
||||||
|
const h = measureHeight(probe);
|
||||||
|
if (w <= 0 || h <= 0) return 12;
|
||||||
|
|
||||||
|
const cos = Math.abs(Math.cos(angleRad));
|
||||||
|
const sin = Math.abs(Math.sin(angleRad));
|
||||||
|
|
||||||
|
const bboxW = w * cos + h * sin;
|
||||||
|
const bboxH = w * sin + h * cos;
|
||||||
|
|
||||||
|
const scaleW = (pageW * FIT_MARGIN) / bboxW;
|
||||||
|
const scaleH = (pageH * FIT_MARGIN) / bboxH;
|
||||||
|
|
||||||
|
const size = probe * Math.min(scaleW, scaleH);
|
||||||
|
return Math.max(6, Math.min(size, 300));
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function applyWatermark(
|
||||||
|
fileName: string,
|
||||||
|
buffer: ArrayBuffer | Uint8Array,
|
||||||
|
options: PdfWatermarkOptions,
|
||||||
|
reportProgress?: (progress: ToolProgress) => void
|
||||||
|
): Promise<ToolResult> {
|
||||||
|
const text = (options.text ?? "").trim().slice(0, MAX_WATERMARK_CHARS);
|
||||||
|
if (!text) {
|
||||||
|
throw new Error("Watermark text is required.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const pdfDoc = await PDFDocument.load(
|
||||||
|
buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer)
|
||||||
|
);
|
||||||
|
const font = await pdfDoc.embedFont(StandardFonts.HelveticaBold);
|
||||||
|
|
||||||
|
const preset = COLOR_PRESETS[options.color] ?? COLOR_PRESETS["light-grey"];
|
||||||
|
const [r, g, b] = preset.rgb;
|
||||||
|
const opacity = Math.max(0, Math.min(1, options.opacity / 100));
|
||||||
|
|
||||||
|
const pages = pdfDoc.getPages();
|
||||||
|
const rotation =
|
||||||
|
options.orientation === "vertical"
|
||||||
|
? 90
|
||||||
|
: options.orientation === "diagonal"
|
||||||
|
? 45
|
||||||
|
: 0;
|
||||||
|
|
||||||
|
for (let i = 0; i < pages.length; i++) {
|
||||||
|
const page = pages[i];
|
||||||
|
const { width, height } = page.getSize();
|
||||||
|
|
||||||
|
const angle = (rotation * Math.PI) / 180;
|
||||||
|
|
||||||
|
const fontSize = fitFontSize(
|
||||||
|
(s) => font.widthOfTextAtSize(text, s),
|
||||||
|
(s) => font.heightAtSize(s),
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
angle
|
||||||
|
);
|
||||||
|
const textWidth = font.widthOfTextAtSize(text, fontSize);
|
||||||
|
const textHeight = font.heightAtSize(fontSize);
|
||||||
|
|
||||||
|
// Place so the (rotated) text is centered on the page.
|
||||||
|
const cx = width / 2;
|
||||||
|
const cy = height / 2;
|
||||||
|
const x = cx - (textWidth / 2) * Math.cos(angle) + (textHeight / 2) * Math.sin(angle);
|
||||||
|
const y = cy - (textWidth / 2) * Math.sin(angle) - (textHeight / 2) * Math.cos(angle);
|
||||||
|
|
||||||
|
page.drawText(text, {
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
size: fontSize,
|
||||||
|
font,
|
||||||
|
color: rgb(r, g, b),
|
||||||
|
opacity,
|
||||||
|
rotate: degrees(rotation),
|
||||||
|
});
|
||||||
|
|
||||||
|
reportProgress?.({
|
||||||
|
percentage: ((i + 1) / pages.length) * 100,
|
||||||
|
message: `Watermarking page ${i + 1}/${pages.length}...`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const bytes = await pdfDoc.save();
|
||||||
|
const blob = new Blob([bytes as unknown as BlobPart], {
|
||||||
|
type: "application/pdf",
|
||||||
|
});
|
||||||
|
|
||||||
|
const outName = fileName.replace(/\.pdf$/i, "") + "_watermarked.pdf";
|
||||||
|
|
||||||
|
return {
|
||||||
|
type: "files",
|
||||||
|
files: [
|
||||||
|
{
|
||||||
|
name: outName,
|
||||||
|
mimeType: "application/pdf",
|
||||||
|
blob,
|
||||||
|
sizeAfter: blob.size,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
43
src/tools/pdf-watermark/worker.ts
Normal file
43
src/tools/pdf-watermark/worker.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import type {
|
||||||
|
ToolWorkerRequest,
|
||||||
|
ToolWorkerResponse,
|
||||||
|
} from "../../core/plugins/worker-protocol";
|
||||||
|
import type { PdfWatermarkOptions } from "./index";
|
||||||
|
import { applyWatermark } from "./watermark";
|
||||||
|
|
||||||
|
function post(response: ToolWorkerResponse) {
|
||||||
|
self.postMessage(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
self.addEventListener(
|
||||||
|
"message",
|
||||||
|
async (e: MessageEvent<ToolWorkerRequest<PdfWatermarkOptions>>) => {
|
||||||
|
const { id, input, options } = e.data;
|
||||||
|
const files = input.files;
|
||||||
|
|
||||||
|
if (!files || !Array.isArray(files) || files.length === 0) {
|
||||||
|
post({ type: "error", id, error: "No PDF file provided." });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const file = files[0];
|
||||||
|
const buffer = await file.arrayBuffer();
|
||||||
|
|
||||||
|
const result = await applyWatermark(file.name, buffer, options, (progress) =>
|
||||||
|
post({ type: "progress", id, progress })
|
||||||
|
);
|
||||||
|
|
||||||
|
post({ type: "success", id, result });
|
||||||
|
} catch (error) {
|
||||||
|
post({
|
||||||
|
type: "error",
|
||||||
|
id,
|
||||||
|
error:
|
||||||
|
error instanceof Error
|
||||||
|
? error.message
|
||||||
|
: "Unknown error occurred while watermarking the PDF.",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -5,4 +5,16 @@ import tailwindcss from "@tailwindcss/vite";
|
|||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
|
server: {
|
||||||
|
headers: {
|
||||||
|
"Cross-Origin-Opener-Policy": "same-origin",
|
||||||
|
"Cross-Origin-Embedder-Policy": "require-corp",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
preview: {
|
||||||
|
headers: {
|
||||||
|
"Cross-Origin-Opener-Policy": "same-origin",
|
||||||
|
"Cross-Origin-Embedder-Policy": "require-corp",
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user