diff --git a/[esx_addons]/esx_adminmenu/.gitattributes b/[esx_addons]/esx_adminmenu/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/[esx_addons]/esx_adminmenu/LICENSE b/[esx_addons]/esx_adminmenu/LICENSE new file mode 100644 index 00000000..79741e0f --- /dev/null +++ b/[esx_addons]/esx_adminmenu/LICENSE @@ -0,0 +1,630 @@ +Copyright (C) 2022-2026 ESX Framework + +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The GNU General Public License is a free, copyleft license for software and +other kinds of works. + +The licenses for most software and other practical works are designed to take +away your freedom to share and change the works. By contrast, the GNU General +Public License is 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. +We, the Free Software Foundation, use the GNU General Public License for most +of our software; it applies also to any other work released this way by its +authors. You can apply it to your programs, too. + +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. + +To protect your rights, we need to prevent others from denying you these rights +or asking you to surrender the rights. Therefore, you have certain +responsibilities if you distribute copies of the software, or if you modify it: +responsibilities to respect the freedom of others. + +For example, if you distribute copies of such a program, whether gratis or for +a fee, you must pass on to the recipients the same freedoms that you received. +You must make sure that they, too, receive or can get the source code. And you +must show them these terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: (1) assert +copyright on the software, and (2) offer you this License giving you legal +permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains that +there is no warranty for this free software. For both users' and authors' sake, +the GPL requires that modified versions be marked as changed, so that their +problems will not be attributed erroneously to authors of previous versions. + +Some devices are designed to deny users access to install or run modified +versions of the software inside them, although the manufacturer can do so. This +is fundamentally incompatible with the aim of protecting users' freedom to +change the software. The systematic pattern of such abuse occurs in the area of +products for individuals to use, which is precisely where it is most +unacceptable. Therefore, we have designed this version of the GPL to prohibit +the practice for those products. If such problems arise substantially in other +domains, we stand ready to extend this provision to those domains in future +versions of the GPL, as needed to protect the freedom of users. + +Finally, every program is threatened constantly by software patents. States +should not allow patents to restrict development and use of software on +general-purpose computers, but in those that do, we wish to avoid the special +danger that patents applied to a free program could make it effectively +proprietary. To prevent this, the GPL assures that patents cannot be used to +render the program non-free. + +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 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. Use with the GNU Affero General Public License. + +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 Affero 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 special requirements of the GNU Affero +General Public License, section 13, concerning interaction through a network +will apply to the combination as such. + +14. Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions of the GNU +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 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 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 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. + + ESX Admin Menu + Copyright (C) 2022-2026 ESX Framework + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU 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 General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short notice like +this when it starts in an interactive mode: + + ESX Admin Menu Copyright (C) 2022-2026 ESX Framework + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it under certain + conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands might +be different; for a GUI interface, you would use an "about box". + +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 GPL, see +. + +The GNU General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may consider +it more useful to permit linking proprietary applications with the library. If +this is what you want to do, use the GNU Lesser General Public License instead +of this License. diff --git a/[esx_addons]/esx_adminmenu/README.md b/[esx_addons]/esx_adminmenu/README.md new file mode 100644 index 00000000..be6894a3 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/README.md @@ -0,0 +1,142 @@ +# esx_adminmenu + +A modern ESX admin menu for FiveM servers. + +This resource is built for day-to-day server administration: quick self tools, player moderation, vehicle tools, ban management, server management, and a Svelte dashboard that gives staff a clearer view of what is happening on the server. + +It has two UI entry points: + +- **Admin Dashboard** - the full NUI dashboard for player lists, bans, vehicles, server tools, and overview cards. +- **Admin Menu** - a smaller keyboard-driven menu for quick actions while staying mostly in-game. + +## Features + +- Player list, player search, recent players, and detailed player information. +- Player actions such as goto, bring, spectate, kick, ban, revive, freeze, money changes, HP/armor changes, inventory cleanup, routing bucket changes, model changes, and clothing menu access. +- Troll actions are grouped away from the main context menu so the player menu stays usable. +- Ban management with active ban pagination and expiry editing. +- Vehicle list pagination, impound/unimpound/delete tools, `/admincar`, and vehicle ownership support. +- Vehicle spawner and customization tools, including performance levels, turbo, xenon, neon, colors, window tint, wheels, discs, and tires. +- Server management tools for weather, time, blackout, PvP, freeze/unfreeze all, bring all, kick all, kill/revive all, cleanup actions, broadcasts, and money actions. +- Dashboard home page with server and economy overview cards. +- Permission-gated sensitive information such as identifiers and IP addresses. +- Configurable feature permissions, keybinds, revive events, vehicle presets, weather types, limits, and admin groups. +- Frontend error notifications when an NUI callback returns `success = false`. + +## Dependencies + +Required: + +- `es_extended` +- `oxmysql` + +Optional integrations: + +- `esx_ambulancejob` for revive events. +- `esx_garage` for impound lookups. +- `pma-voice` for radio channel changes and lookups. +- `esx_skin` or your clothing resource for clothing menu events. + +## Installation + +1. Put the resource in your server resources folder as `esx_adminmenu`. If you keep ESX addons in `[esx_addons]`, that works too. +2. Make sure `es_extended` and `oxmysql` start before this resource. +3. Add this to your `server.cfg` if you are starting it separately: + +```cfg +ensure esx_adminmenu +``` + +4. Configure your admin groups in `shared/config.lua`. +5. Restart the server, or run `refresh` and `ensure esx_adminmenu`. + +The resource creates the small database tables it needs on start. + +## Permissions + +The main permission setup lives in `shared/config.lua`. + +- `Config.AllowedGroups` controls who can open the menu. +- `Config.FeaturePermissions` controls who can use specific feature groups. +- `Config.AdminMenu.ActionPermissions`, `Config.PlayerActions.ActionPermissions`, and `Config.ServerManagement.ActionPermissions` map actions to those feature groups. + +By default this project is set up around the ESX `admin` group. If your server uses more groups, add them in config instead of hard-coding checks in random files. + +## Commands + +Menu commands: + +- `/admin` opens the small admin menu. +- `/adminmenu` opens the small admin menu. +- `/admindashboard` opens the full dashboard. +- `/information ` opens the dashboard directly to a player's information panel. + +Player/admin commands: + +- `/noclip` +- `/names` +- `/blips` +- `/setmodel ` +- `/goto ` +- `/bring ` +- `/spectate ` +- `/stopspectate` +- `/kick ` +- `/ban ` +- `/notify ` + +Helper commands: + +- `/vec2` +- `/vec3` +- `/vec4` +- `/heading` +- `/coords` or `/copycoords` +- `/rot` or `/rotation` +- `/model` or `/entitymodel` +- `/vehplate` or `/copyplate` +- `/admincar [model]` +- `/refreshbans` or `/refreshbancache` + +## Keybinds + +Defaults are configured in `shared/config.lua`: + +- Admin Menu: `F9` +- Admin Dashboard: `F10` + +Players can change keybinds in their FiveM keybind settings after the commands are registered. + +## Revive Setup + +Revive is configurable because different ESX servers handle death state differently. + +By default, `Config.Revive.Events` triggers: + +```lua +"esx_ambulancejob:revive" +``` + +That event is fired from the server, matching the normal ESX ambulance job command style. A native fallback can also run after a short delay. + +## Web Development + +The NUI is built with Svelte 5 and Vite. + +```powershell +cd web +npm install +npm run dev +npm run check +npm run build +``` + +The committed resource uses `web/dist` for FiveM. During normal development, run `npm run check` before committing source changes and only rebuild `web/dist` when you want to update the shipped UI assets. + +## Notes + +This menu is intentionally configurable. Server owners tend to run slightly different ESX stacks, so things like revive, clothing, vehicles, permissions, limits, and integrations should be adjusted in config instead of patched into the core logic. + +## License + +GPL-3.0. See `LICENSE`. diff --git a/[esx_addons]/esx_adminmenu/client/actions.lua b/[esx_addons]/esx_adminmenu/client/actions.lua new file mode 100644 index 00000000..966e29dd --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/actions.lua @@ -0,0 +1,1255 @@ +local spectating = false +local escCooldownUntil = 0 +local lastCoords = nil +local noClipActive = false +local godmodeActive = false +local invisibleActive = false +local noClipForcedInvisible = false +local namesActive = false +local blipsActive = false +local infiniteAmmoActive = false +local noClipEntity = nil +local godmodeVehicle = nil +local invisibleVehicle = nil +local playerBlips = {} +local vehicleEngineLevel = 1 +local vehicleBrakeLevel = 1 +local vehicleTransmissionLevel = 1 +local vehicleSuspensionLevel = 1 +local vehicleArmorLevel = 1 +local vehicleColorIndex = 1 +local neonColorIndex = 1 + +ClientActions = ClientActions or {} + +local function getNoClipSpeed() + return (Config.AdminMenu and Config.AdminMenu.NoClipSpeed) or 1.5 +end + +local function getCameraDirection() + local ped = PlayerPedId() + local heading = GetEntityHeading(ped) + GetGameplayCamRelativeHeading() + local pitch = GetGameplayCamRelativePitch() + local headingRadians = math.rad(heading) + local pitchRadians = math.rad(pitch) + local cosPitch = math.abs(math.cos(pitchRadians)) + + return vector3( + -math.sin(headingRadians) * cosPitch, + math.cos(headingRadians) * cosPitch, + math.sin(pitchRadians) + ) +end + +local function drawWorldText(coords, text) + local onScreen, screenX, screenY = World3dToScreen2d(coords.x, coords.y, coords.z) + if not onScreen then + return + end + + SetTextScale(0.3, 0.3) + SetTextFont(4) + SetTextProportional(true) + SetTextColour(255, 255, 255, 215) + SetTextCentre(true) + SetTextEntry("STRING") + AddTextComponentString(text) + DrawText(screenX, screenY) +end + +local function requestModel(model) + local modelHash = type(model) == "number" and model or joaat(model) + if not IsModelInCdimage(modelHash) or not IsModelValid(modelHash) then + return nil, "Invalid model." + end + + RequestModel(modelHash) + + local timeout = GetGameTimer() + 5000 + while not HasModelLoaded(modelHash) do + Wait(0) + if GetGameTimer() > timeout then + return nil, "Model load timed out." + end + end + + return modelHash +end + +local function trimString(value) + if type(value) ~= "string" then + return "" + end + + return value:match("^%s*(.-)%s*$") +end + +local function getVehicleConfig() + return Config.VehicleSpawner or {} +end + +local function getColorPresets() + local vehicleConfig = getVehicleConfig() + return vehicleConfig.ColorPresets or {} +end + +local function getNeonPresets() + local vehicleConfig = getVehicleConfig() + return vehicleConfig.NeonPresets or {} +end + +local function getWheelCategories() + local vehicleConfig = getVehicleConfig() + return vehicleConfig.WheelCategories or {} +end + +local function getControlledEntity() + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + + if vehicle ~= 0 then + return vehicle, ped + end + + return ped, ped +end + +local function getCurrentVehicle() + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + + if vehicle == 0 or not DoesEntityExist(vehicle) then + return nil, "You must be in a vehicle." + end + + return vehicle +end + +local function findColorPreset(colorId) + local presets = getColorPresets() + + for i = 1, #presets do + local preset = presets[i] + if preset.id == colorId then + return preset, i + end + end + + return presets[1], 1 +end + +local function applyVehicleColor(vehicle, colorId) + local preset, index = findColorPreset(colorId) + if not preset then + return nil, nil + end + + SetVehicleColours(vehicle, tonumber(preset.primary) or 0, tonumber(preset.secondary) or tonumber(preset.primary) or 0) + vehicleColorIndex = index + + return preset.label or preset.id or "Color", preset.id +end + +local function applyVehicleColors(vehicle, primaryColorId, secondaryColorId) + local primaryPreset, primaryIndex = findColorPreset(primaryColorId) + if not primaryPreset then + return nil, nil + end + + local secondaryPreset = findColorPreset(secondaryColorId) + if not secondaryPreset then + secondaryPreset = primaryPreset + end + + SetVehicleColours( + vehicle, + tonumber(primaryPreset.primary) or 0, + tonumber(secondaryPreset.secondary) or tonumber(secondaryPreset.primary) or tonumber(primaryPreset.secondary) or tonumber(primaryPreset.primary) or 0 + ) + vehicleColorIndex = primaryIndex + + return primaryPreset.label or primaryPreset.id or "Color", primaryPreset.id +end + +local function findNeonPreset(colorId) + local presets = getNeonPresets() + + for i = 1, #presets do + local preset = presets[i] + if preset.id == colorId then + return preset, i + end + end + + return presets[1], 1 +end + +local function findWheelCategory(categoryId) + local categories = getWheelCategories() + + for i = 1, #categories do + local category = categories[i] + if category.id == categoryId then + return category + end + end + + return categories[1] or { id = "sport", label = "Sport", type = 0 } +end + +local function applyVehicleNeon(vehicle, enabled, colorId) + for i = 0, 3 do + SetVehicleNeonLightEnabled(vehicle, i, enabled == true) + end + + local preset, index = findNeonPreset(colorId) + if preset then + SetVehicleNeonLightsColour(vehicle, tonumber(preset.r) or 255, tonumber(preset.g) or 255, tonumber(preset.b) or 255) + neonColorIndex = index + return preset.label or preset.id or "Neon" + end + + return nil +end + +local function applyVehicleWheels(vehicle, categoryId, design) + local category = findWheelCategory(categoryId) + local wheelType = tonumber(category.type) or 0 + local wheelDesign = math.floor(tonumber(design) or -1) + + SetVehicleModKit(vehicle, 0) + SetVehicleWheelType(vehicle, wheelType) + + local frontCount = GetNumVehicleMods(vehicle, 23) + if frontCount > 0 then + local frontIndex = math.max(-1, math.min(wheelDesign, frontCount - 1)) + SetVehicleMod(vehicle, 23, frontIndex, false) + end + + local rearCount = GetNumVehicleMods(vehicle, 24) + if rearCount > 0 then + local rearIndex = math.max(-1, math.min(wheelDesign, rearCount - 1)) + SetVehicleMod(vehicle, 24, rearIndex, false) + end +end + +local function levelToModIndex(vehicle, modType, level) + level = math.max(1, math.min(5, math.floor(tonumber(level) or 1))) + local count = GetNumVehicleMods(vehicle, modType) + + if count <= 0 or level <= 1 then + return -1, level + end + + local modIndex = math.min(count - 1, level - 2) + return modIndex, level +end + +local function applyVehicleModLevel(vehicle, modType, level) + SetVehicleModKit(vehicle, 0) + + local modIndex, normalizedLevel = levelToModIndex(vehicle, modType, level) + SetVehicleMod(vehicle, modType, modIndex, false) + + return normalizedLevel +end + +local function applyVehicleCustomizations(vehicle, data) + data = data or {} + local useMaxPerformance = data.maxPerformance == true + + local engineLevel = applyVehicleModLevel(vehicle, 11, useMaxPerformance and 5 or data.engineLevel or vehicleEngineLevel) + local brakeLevel = applyVehicleModLevel(vehicle, 12, useMaxPerformance and 5 or data.brakeLevel or vehicleBrakeLevel) + local transmissionLevel = applyVehicleModLevel(vehicle, 13, useMaxPerformance and 5 or data.transmissionLevel or vehicleTransmissionLevel) + local suspensionLevel = applyVehicleModLevel(vehicle, 15, useMaxPerformance and 5 or data.suspensionLevel or vehicleSuspensionLevel) + local armorLevel = applyVehicleModLevel(vehicle, 16, useMaxPerformance and 5 or data.armorLevel or vehicleArmorLevel) + + vehicleEngineLevel = engineLevel + vehicleBrakeLevel = brakeLevel + vehicleTransmissionLevel = transmissionLevel + vehicleSuspensionLevel = suspensionLevel + vehicleArmorLevel = armorLevel + + if useMaxPerformance then + ToggleVehicleMod(vehicle, 18, true) + end + + if data.turbo ~= nil then + ToggleVehicleMod(vehicle, 18, data.turbo == true) + end + + if data.xenon ~= nil then + ToggleVehicleMod(vehicle, 22, data.xenon == true) + end + + if data.primaryColor or data.secondaryColor then + local primaryColor = trimString(data.primaryColor or data.color) + local secondaryColor = trimString(data.secondaryColor or data.primaryColor or data.color) + applyVehicleColors(vehicle, primaryColor, secondaryColor) + elseif data.color then + applyVehicleColor(vehicle, trimString(data.color)) + end + + if data.neon ~= nil or data.neonColor then + applyVehicleNeon(vehicle, data.neon == true, trimString(data.neonColor)) + end + + if data.windowTint ~= nil then + SetVehicleWindowTint(vehicle, math.floor(tonumber(data.windowTint) or 0)) + end + + if data.wheelCategory ~= nil or data.wheelDesign ~= nil then + applyVehicleWheels(vehicle, trimString(data.wheelCategory), data.wheelDesign) + end + + if data.bulletproofTires ~= nil then + SetVehicleTyresCanBurst(vehicle, data.bulletproofTires ~= true) + end + + return { + engineLevel = engineLevel, + brakeLevel = brakeLevel, + transmissionLevel = transmissionLevel, + suspensionLevel = suspensionLevel, + armorLevel = armorLevel, + } +end + +local function applyVehiclePerformance(vehicle, engineLevel, brakeLevel, maxPerformance) + local levels = applyVehicleCustomizations(vehicle, { + engineLevel = engineLevel, + brakeLevel = brakeLevel, + transmissionLevel = maxPerformance and 5 or vehicleTransmissionLevel, + suspensionLevel = maxPerformance and 5 or vehicleSuspensionLevel, + armorLevel = maxPerformance and 5 or vehicleArmorLevel, + turbo = maxPerformance and true or nil, + maxPerformance = maxPerformance, + }) + + return levels.engineLevel, levels.brakeLevel +end + +local function notifyAction(message, notificationType) + if ESX and ESX.ShowNotification then + ESX.ShowNotification(message, notificationType or "success") + end +end + +local function setNoClipEntityState(entity, enabled) + if not entity or entity == 0 or not DoesEntityExist(entity) then + return + end + + FreezeEntityPosition(entity, enabled) + SetEntityCollision(entity, not enabled, not enabled) + SetEntityInvincible(entity, enabled) + SetEntityVelocity(entity, 0.0, 0.0, 0.0) +end + +local function applyGodmodeVehicle(vehicle) + if godmodeVehicle and godmodeVehicle ~= vehicle and DoesEntityExist(godmodeVehicle) then + SetEntityInvincible(godmodeVehicle, false) + end + + if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then + SetEntityInvincible(vehicle, godmodeActive) + godmodeVehicle = godmodeActive and vehicle or nil + else + godmodeVehicle = nil + end +end + +local function applyInvisibleVehicle(vehicle) + if invisibleVehicle and invisibleVehicle ~= vehicle and DoesEntityExist(invisibleVehicle) then + SetEntityVisible(invisibleVehicle, true, false) + NetworkSetEntityInvisibleToNetwork(invisibleVehicle, false) + end + + if vehicle and vehicle ~= 0 and DoesEntityExist(vehicle) then + SetEntityVisible(vehicle, not invisibleActive, false) + NetworkSetEntityInvisibleToNetwork(vehicle, invisibleActive) + invisibleVehicle = invisibleActive and vehicle or nil + else + invisibleVehicle = nil + end +end + +local function watchGodmodeVehicle() + CreateThread(function() + while godmodeActive do + applyGodmodeVehicle(GetVehiclePedIsIn(PlayerPedId(), false)) + Wait(500) + end + + applyGodmodeVehicle(0) + end) +end + +local function watchInvisibleVehicle() + CreateThread(function() + while invisibleActive do + applyInvisibleVehicle(GetVehiclePedIsIn(PlayerPedId(), false)) + Wait(500) + end + + applyInvisibleVehicle(0) + end) +end + +local function setInvisibleActive(enabled) + enabled = enabled == true + + if invisibleActive == enabled then + local ped = PlayerPedId() + SetEntityVisible(ped, not invisibleActive, false) + NetworkSetEntityInvisibleToNetwork(ped, invisibleActive) + applyInvisibleVehicle(GetVehiclePedIsIn(ped, false)) + return invisibleActive + end + + invisibleActive = enabled + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + + SetEntityVisible(ped, not invisibleActive, false) + NetworkSetEntityInvisibleToNetwork(ped, invisibleActive) + applyInvisibleVehicle(vehicle) + + if invisibleActive then + watchInvisibleVehicle() + end + + return invisibleActive +end + +local function runNoClip() + CreateThread(function() + local entity, ped = getControlledEntity() + noClipEntity = entity + setNoClipEntityState(entity, true) + + while noClipActive do + Wait(0) + + local currentEntity, currentPed = getControlledEntity() + if currentEntity ~= entity then + setNoClipEntityState(entity, false) + entity = currentEntity + noClipEntity = entity + setNoClipEntityState(entity, true) + end + + ped = currentPed + local coords = GetEntityCoords(entity) + local forward = getCameraDirection() + local right = vector3(forward.y, -forward.x, 0.0) + local speed = getNoClipSpeed() + + if IsDisabledControlPressed(0, 21) then + speed = speed * 3.0 + elseif IsDisabledControlPressed(0, 36) then + speed = speed * 0.35 + end + + DisableControlAction(0, 30, true) + DisableControlAction(0, 31, true) + DisableControlAction(0, 32, true) + DisableControlAction(0, 33, true) + DisableControlAction(0, 34, true) + DisableControlAction(0, 35, true) + DisableControlAction(0, 22, true) + DisableControlAction(0, 44, true) + DisableControlAction(0, 75, true) + + if IsDisabledControlPressed(0, 32) then + coords = coords + forward * speed + end + if IsDisabledControlPressed(0, 33) then + coords = coords - forward * speed + end + if IsDisabledControlPressed(0, 34) then + coords = coords - right * speed + end + if IsDisabledControlPressed(0, 35) then + coords = coords + right * speed + end + if IsDisabledControlPressed(0, 22) then + coords = coords + vector3(0.0, 0.0, speed) + end + if IsDisabledControlPressed(0, 44) then + coords = coords - vector3(0.0, 0.0, speed) + end + + SetEntityCoordsNoOffset(entity, coords.x, coords.y, coords.z, true, true, true) + SetEntityHeading(entity, GetGameplayCamRot(0).z) + end + + setNoClipEntityState(entity, false) + noClipEntity = nil + end) +end + +function ClientActions.ToggleNoClip() + noClipActive = not noClipActive + + if noClipActive then + if not invisibleActive then + noClipForcedInvisible = true + setInvisibleActive(true) + else + noClipForcedInvisible = false + end + + runNoClip() + else + local entity = noClipEntity + if not entity then + entity = getControlledEntity() + end + + setNoClipEntityState(entity, false) + noClipEntity = nil + + if noClipForcedInvisible then + noClipForcedInvisible = false + setInvisibleActive(false) + end + end + + return noClipActive +end + +local function nativeRevivePlayer() + local ped = PlayerPedId() + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + + NetworkResurrectLocalPlayer(coords.x, coords.y, coords.z, heading, true, false) + ped = PlayerPedId() + ClearPedTasksImmediately(ped) + ClearPedBloodDamage(ped) + SetEntityHealth(ped, GetEntityMaxHealth(ped)) +end + +function ClientActions.Revive() + local ped = PlayerPedId() + + if IsEntityDead(ped) or IsPedFatallyInjured(ped) or GetEntityHealth(ped) <= 0 then + nativeRevivePlayer() + else + ClearPedTasksImmediately(ped) + ClearPedBloodDamage(ped) + SetEntityHealth(ped, GetEntityMaxHealth(ped)) + end + + return true +end + +function ClientActions.Heal() + local ped = PlayerPedId() + + ClearPedBloodDamage(ped) + SetEntityHealth(ped, GetEntityMaxHealth(ped)) + + return true +end + +function ClientActions.SetArmor(amount) + SetPedArmour(PlayerPedId(), amount or 100) + + return true +end + +function ClientActions.ToggleGodmode() + godmodeActive = not godmodeActive + local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) + + SetPlayerInvincible(PlayerId(), godmodeActive) + SetEntityInvincible(PlayerPedId(), godmodeActive) + applyGodmodeVehicle(vehicle) + + if godmodeActive then + watchGodmodeVehicle() + end + + return godmodeActive +end + +function ClientActions.ToggleInvisible() + if noClipActive then + if not invisibleActive then + noClipForcedInvisible = true + end + + return setInvisibleActive(true) + end + + noClipForcedInvisible = false + return setInvisibleActive(not invisibleActive) +end + +function ClientActions.IsInvisibleActive() + return invisibleActive +end + +function ClientActions.ToggleInfiniteAmmo() + infiniteAmmoActive = not infiniteAmmoActive + local ped = PlayerPedId() + + SetPedInfiniteAmmoClip(ped, infiniteAmmoActive) + + if infiniteAmmoActive then + CreateThread(function() + while infiniteAmmoActive do + ped = PlayerPedId() + + SetPedInfiniteAmmoClip(ped, true) + + Wait(500) + end + + SetPedInfiniteAmmoClip(PlayerPedId(), false) + end) + end + + return infiniteAmmoActive +end + +function ClientActions.ToggleNames() + namesActive = not namesActive + + if namesActive then + CreateThread(function() + while namesActive do + Wait(0) + + local myPed = PlayerPedId() + local myCoords = GetEntityCoords(myPed) + local maxDistance = (Config.AdminMenu and Config.AdminMenu.NamesDistance) or 75.0 + + for _, player in ipairs(GetActivePlayers()) do + if player ~= PlayerId() then + local ped = GetPlayerPed(player) + if ped ~= 0 and DoesEntityExist(ped) then + local coords = GetEntityCoords(ped) + local distance = #(myCoords - coords) + + if distance <= maxDistance then + local serverId = GetPlayerServerId(player) + drawWorldText(coords + vector3(0.0, 0.0, 1.05), ("[%s] %s"):format(serverId, GetPlayerName(player))) + end + end + end + end + end + end) + end + + return namesActive +end + +function ClientActions.ToggleBlips() + blipsActive = not blipsActive + + if not blipsActive then + for serverId, blip in pairs(playerBlips) do + if DoesBlipExist(blip) then + RemoveBlip(blip) + end + playerBlips[serverId] = nil + end + + return false + end + + CreateThread(function() + while blipsActive do + local activeServerIds = {} + + for _, player in ipairs(GetActivePlayers()) do + if player ~= PlayerId() then + local ped = GetPlayerPed(player) + local serverId = GetPlayerServerId(player) + activeServerIds[serverId] = true + + if ped ~= 0 and DoesEntityExist(ped) then + if not playerBlips[serverId] or not DoesBlipExist(playerBlips[serverId]) then + local blip = AddBlipForEntity(ped) + SetBlipSprite(blip, 1) + SetBlipScale(blip, 0.85) + SetBlipColour(blip, 5) + ShowHeadingIndicatorOnBlip(blip, true) + BeginTextCommandSetBlipName("STRING") + AddTextComponentString(("[%s] %s"):format(serverId, GetPlayerName(player))) + EndTextCommandSetBlipName(blip) + playerBlips[serverId] = blip + end + end + end + end + + for serverId, blip in pairs(playerBlips) do + if not activeServerIds[serverId] then + if DoesBlipExist(blip) then + RemoveBlip(blip) + end + playerBlips[serverId] = nil + end + end + + Wait(1500) + end + end) + + return true +end + +function ClientActions.RepairVehicle() + local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) + if vehicle == 0 then + return false, "You must be in a vehicle." + end + + SetVehicleFixed(vehicle) + SetVehicleDeformationFixed(vehicle) + SetVehicleUndriveable(vehicle, false) + SetVehicleEngineOn(vehicle, true, true, false) + + return true +end + +function ClientActions.CleanVehicle() + local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) + if vehicle == 0 then + return false, "You must be in a vehicle." + end + + SetVehicleDirtLevel(vehicle, 0.0) + + return true +end + +function ClientActions.FlipVehicle() + local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) + if vehicle == 0 then + return false, "You must be in a vehicle." + end + + SetVehicleOnGroundProperly(vehicle) + + return true +end + +function ClientActions.DeleteVehicle() + local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) + if vehicle == 0 then + return false, "You must be in a vehicle." + end + + SetEntityAsMissionEntity(vehicle, true, true) + DeleteEntity(vehicle) + + return true +end + +function ClientActions.SpawnVehicle(data) + data = data or {} + local vehicleConfig = getVehicleConfig() + local model = trimString(data.model) + + if model == "" then + model = vehicleConfig.DefaultModel or "sultan" + end + + local modelHash, err = requestModel(model) + if not modelHash then + return false, err or "Invalid vehicle model." + end + if not IsModelAVehicle(modelHash) then + SetModelAsNoLongerNeeded(modelHash) + return false, "Model must be a vehicle." + end + + local ped = PlayerPedId() + local currentVehicle = GetVehiclePedIsIn(ped, false) + local deleteCurrent = true + + if currentVehicle ~= 0 and deleteCurrent then + SetEntityAsMissionEntity(currentVehicle, true, true) + DeleteEntity(currentVehicle) + end + + local coords = GetOffsetFromEntityInWorldCoords(ped, 0.0, 4.5, 0.0) + local heading = GetEntityHeading(ped) + local vehicle = CreateVehicle(modelHash, coords.x, coords.y, coords.z, heading, true, false) + + if not vehicle or vehicle == 0 then + SetModelAsNoLongerNeeded(modelHash) + return false, "Failed to spawn vehicle." + end + + SetEntityAsMissionEntity(vehicle, true, true) + SetVehicleOnGroundProperly(vehicle) + SetVehicleHasBeenOwnedByPlayer(vehicle, true) + SetVehicleNeedsToBeHotwired(vehicle, false) + SetVehRadioStation(vehicle, "OFF") + + local fallbackColor = trimString(data.color) + if fallbackColor == "" then + fallbackColor = vehicleConfig.DefaultColor or "black" + end + + local primaryColor = trimString(data.primaryColor) + if primaryColor == "" then + primaryColor = fallbackColor + end + + local secondaryColor = trimString(data.secondaryColor) + if secondaryColor == "" then + secondaryColor = primaryColor + end + + local colorLabel = applyVehicleColors(vehicle, primaryColor, secondaryColor) + if data.maxPerformance == true then + applyVehicleCustomizations(vehicle, { + engineLevel = 5, + brakeLevel = 5, + transmissionLevel = 5, + suspensionLevel = 5, + armorLevel = 5, + turbo = true, + xenon = true, + color = fallbackColor, + primaryColor = primaryColor, + secondaryColor = secondaryColor, + maxPerformance = true, + }) + elseif data.engineLevel or data.brakeLevel or data.transmissionLevel or data.suspensionLevel or data.armorLevel or data.turbo ~= nil or data.xenon ~= nil or data.neon ~= nil or data.windowTint ~= nil or data.wheelCategory ~= nil or data.wheelDesign ~= nil or data.bulletproofTires ~= nil then + applyVehicleCustomizations(vehicle, data) + end + + if vehicleConfig.WarpIntoVehicle ~= false and data.warp ~= false then + SetPedIntoVehicle(ped, vehicle, -1) + end + + SetModelAsNoLongerNeeded(modelHash) + + local label = Helpers and Helpers.resolveVehicleName and Helpers.resolveVehicleName(modelHash) or model + notifyAction(("Spawned %s%s."):format(label, colorLabel and (" (" .. colorLabel .. ")") or "")) + + return true +end + +function ClientActions.SetVehiclePerformance(data) + data = data or {} + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + local levels = applyVehicleCustomizations(vehicle, data) + return true, nil, { value = ("E%s B%s T%s S%s A%s"):format(levels.engineLevel, levels.brakeLevel, levels.transmissionLevel, levels.suspensionLevel, levels.armorLevel) } +end + +function ClientActions.CustomizeVehicle(data) + return ClientActions.SetVehiclePerformance(data) +end + +function ClientActions.CycleVehicleEngine() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + vehicleEngineLevel = vehicleEngineLevel + 1 + if vehicleEngineLevel > 5 then + vehicleEngineLevel = 1 + end + + applyVehiclePerformance(vehicle, vehicleEngineLevel, vehicleBrakeLevel, false) + return true, nil, { active = true, value = ("%s/5"):format(vehicleEngineLevel) } +end + +function ClientActions.CycleVehicleBrakes() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + vehicleBrakeLevel = vehicleBrakeLevel + 1 + if vehicleBrakeLevel > 5 then + vehicleBrakeLevel = 1 + end + + applyVehiclePerformance(vehicle, vehicleEngineLevel, vehicleBrakeLevel, false) + return true, nil, { active = true, value = ("%s/5"):format(vehicleBrakeLevel) } +end + +function ClientActions.CycleVehicleTransmission() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + vehicleTransmissionLevel = vehicleTransmissionLevel + 1 + if vehicleTransmissionLevel > 5 then + vehicleTransmissionLevel = 1 + end + + applyVehicleCustomizations(vehicle, { transmissionLevel = vehicleTransmissionLevel }) + return true, nil, { active = true, value = ("%s/5"):format(vehicleTransmissionLevel) } +end + +function ClientActions.CycleVehicleSuspension() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + vehicleSuspensionLevel = vehicleSuspensionLevel + 1 + if vehicleSuspensionLevel > 5 then + vehicleSuspensionLevel = 1 + end + + applyVehicleCustomizations(vehicle, { suspensionLevel = vehicleSuspensionLevel }) + return true, nil, { active = true, value = ("%s/5"):format(vehicleSuspensionLevel) } +end + +function ClientActions.CycleVehicleArmor() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + vehicleArmorLevel = vehicleArmorLevel + 1 + if vehicleArmorLevel > 5 then + vehicleArmorLevel = 1 + end + + applyVehicleCustomizations(vehicle, { armorLevel = vehicleArmorLevel }) + return true, nil, { active = true, value = ("%s/5"):format(vehicleArmorLevel) } +end + +function ClientActions.CycleVehicleColor() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + local presets = getColorPresets() + if #presets == 0 then + return false, "No vehicle color presets configured." + end + + vehicleColorIndex = vehicleColorIndex + 1 + if vehicleColorIndex > #presets then + vehicleColorIndex = 1 + end + + local preset = presets[vehicleColorIndex] + local label = applyVehicleColor(vehicle, preset.id) + + return true, nil, { active = true, value = label or preset.id or "Color" } +end + +function ClientActions.CycleVehicleNeonColor() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + local presets = getNeonPresets() + if #presets == 0 then + return false, "No neon color presets configured." + end + + neonColorIndex = neonColorIndex + 1 + if neonColorIndex > #presets then + neonColorIndex = 1 + end + + local preset = presets[neonColorIndex] + local label = applyVehicleNeon(vehicle, true, preset.id) + + return true, nil, { active = true, value = label or preset.id or "Neon" } +end + +function ClientActions.MaxVehiclePerformance() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + local levels = applyVehicleCustomizations(vehicle, { maxPerformance = true }) + return true, nil, { active = true, value = ("E%s B%s T%s S%s A%s"):format(levels.engineLevel, levels.brakeLevel, levels.transmissionLevel, levels.suspensionLevel, levels.armorLevel) } +end + +function ClientActions.TeleportToWaypoint() + local waypoint = GetFirstBlipInfoId(8) + if not DoesBlipExist(waypoint) then + return false, "No waypoint set." + end + + local coords = GetBlipInfoIdCoord(waypoint) + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + local entity = vehicle ~= 0 and vehicle or ped + local foundGround = false + local groundZ = coords.z + + for height = 0, 1000, 25 do + SetEntityCoordsNoOffset(entity, coords.x, coords.y, height + 0.0, false, false, false) + Wait(0) + + foundGround, groundZ = GetGroundZFor_3dCoord(coords.x, coords.y, height + 0.0, false) + if foundGround then + break + end + end + + SetEntityCoordsNoOffset(entity, coords.x, coords.y, (foundGround and groundZ or coords.z) + 1.0, false, false, false) + + return true +end + +function ClientActions.CopyCoords() + local ped = PlayerPedId() + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + local text = string.format("vec4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading) + + SendNUIMessage({ + action = "copyToClipboard", + data = text, + }) + + return true +end + +function ClientActions.SetWeather(weather) + ClearOverrideWeather() + ClearWeatherTypePersist() + SetWeatherTypeNowPersist(weather) + SetWeatherTypeNow(weather) + SetWeatherTypePersist(weather) +end + +function ClientActions.SetTime(hour, minute) + NetworkOverrideClockTime(hour or 12, minute or 0, 0) +end + +function ClientActions.SetBlackout(enabled) + SetArtificialLightsState(enabled == true) + SetArtificialLightsStateAffectsVehicles(enabled == true) +end + +function ClientActions.SetPvp(enabled) + NetworkSetFriendlyFireOption(enabled == true) + SetCanAttackFriendly(PlayerPedId(), enabled == true, false) +end + +function ClientActions.SetFrozen(enabled) + local entity = getControlledEntity() + FreezeEntityPosition(entity, enabled == true) +end + +function ClientActions.Kill() + SetEntityHealth(PlayerPedId(), 0) +end + +function ClientActions.DeleteGamePool(poolName) + for _, entity in ipairs(GetGamePool(poolName)) do + if DoesEntityExist(entity) then + if poolName ~= "CPed" or not IsPedAPlayer(entity) then + SetEntityAsMissionEntity(entity, true, true) + DeleteEntity(entity) + end + end + end +end + +RegisterNetEvent("esx-adminmenu:client:setWeather", function(weather) + ClientActions.SetWeather(weather) +end) + +RegisterNetEvent("esx-adminmenu:client:setTime", function(hour, minute) + ClientActions.SetTime(hour, minute) +end) + +RegisterNetEvent("esx-adminmenu:client:setBlackout", function(enabled) + ClientActions.SetBlackout(enabled) +end) + +RegisterNetEvent("esx-adminmenu:client:setPvp", function(enabled) + ClientActions.SetPvp(enabled) +end) + +RegisterNetEvent("esx-adminmenu:client:setFrozen", function(enabled) + ClientActions.SetFrozen(enabled) +end) + +RegisterNetEvent("esx-adminmenu:client:kill", function() + ClientActions.Kill() +end) + +RegisterNetEvent("esx-adminmenu:client:revive", function() + ClientActions.Revive() +end) + +RegisterNetEvent("esx-adminmenu:client:deletePool", function(poolName) + ClientActions.DeleteGamePool(poolName) +end) + +RegisterNetEvent("esx-adminmenu:client:setPlayerStats", function(health, armor) + local ped = PlayerPedId() + + if health ~= nil then + local maxHealth = GetEntityMaxHealth(ped) + SetEntityHealth(ped, math.max(0, math.min(maxHealth, tonumber(health) + 100))) + end + + if armor ~= nil then + SetPedArmour(ped, math.max(0, math.min(100, tonumber(armor)))) + end +end) + +RegisterNetEvent("esx-adminmenu:client:setModel", function(model) + local modelHash, err = requestModel(model) + if not modelHash then + if ESX and ESX.ShowNotification then + ESX.ShowNotification(err or "Invalid model.", "error") + end + return + end + + SetPlayerModel(PlayerId(), modelHash) + SetPedDefaultComponentVariation(PlayerPedId()) + SetModelAsNoLongerNeeded(modelHash) +end) + +RegisterNetEvent("esx-adminmenu:client:openClothing", function() + local events = (Config.Clothing and Config.Clothing.Events) or { "esx_skin:openSaveableMenu" } + + for i = 1, #events do + TriggerEvent(events[i]) + end +end) + +RegisterNetEvent("esx-adminmenu:client:setRadioChannel", function(channel) + channel = tonumber(channel) or 0 + + local ok = pcall(function() + exports["pma-voice"]:setRadioChannel(channel) + end) + + if not ok and ESX and ESX.ShowNotification then + ESX.ShowNotification("pma-voice radio export was not available.", "error") + end +end) + +RegisterNetEvent("esx-adminmenu:client:troll", function(action) + local ped = PlayerPedId() + local coords = GetEntityCoords(ped) + + if action == "burn" then + StartEntityFire(ped) + elseif action == "explode" then + AddExplosion(coords.x, coords.y, coords.z, 2, 1.0, true, false, 1.0) + elseif action == "sky" then + SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z + 120.0, false, false, false) + elseif action == "randomTeleport" then + local xOffset = math.random(-500, 500) + 0.0 + local yOffset = math.random(-500, 500) + 0.0 + SetEntityCoordsNoOffset(ped, coords.x + xOffset, coords.y + yOffset, coords.z + 40.0, false, false, false) + elseif action == "nausea" then + ShakeGameplayCam("DRUNK_SHAKE", 1.0) + AnimpostfxPlay("DrugsMichaelAliensFight", 5000, false) + end +end) + +local function StopSpectate() + ToggleNUIFocus(true) + if not spectating then + return + end + + local ped = PlayerPedId() + + NetworkSetInSpectatorMode(false, ped) + + FreezeEntityPosition(ped, false) + SetEntityVisible(ped, true, false) + SetEntityCollision(ped, true, true) + SetPlayerInvincible(PlayerId(), false) + NetworkSetEntityInvisibleToNetwork(ped, false) + + if lastCoords then + SetEntityCoords(ped, lastCoords) + end + + spectating = false + + SendNUIMessage({ + action = "stopSpectate", + data = true, + }) +end + +function Spectate(targetId, targetCoords) + ToggleNUIFocus(false) + + if spectating then + StopSpectate() + Wait(500) + end + + local myPed = PlayerPedId() + lastCoords = GetEntityCoords(myPed) + + FreezeEntityPosition(myPed, true) + SetEntityVisible(myPed, false, false) + SetEntityCollision(myPed, false, false) + SetPlayerInvincible(PlayerId(), true) + NetworkSetEntityInvisibleToNetwork(myPed, true) + + SetEntityCoordsNoOffset(myPed, targetCoords.x, targetCoords.y, targetCoords.z + 15.0, false, false, false) + + Wait(500) + local targetPlayer = GetPlayerFromServerId(targetId) + + if targetPlayer == -1 then + print("Spectate failed: player not streamed") + return + end + + local targetPed = GetPlayerPed(targetPlayer) + + if not DoesEntityExist(targetPed) then + print("Spectate failed: ped missing") + return + end + + spectating = true + NetworkSetInSpectatorMode(true, targetPed) + + CreateThread(function() + while spectating do + Wait(0) + + DisableFrontendThisFrame() + + if IsDisabledControlJustPressed(0, 322) and GetGameTimer() >= escCooldownUntil then + escCooldownUntil = GetGameTimer() + 5000 + + ESX.TriggerServerCallback("esx-adminmenu:server:spectate:stop", function(res) + if not res or res.err then + print("[esx-adminmenu]", res and res.err) + return + end + + StopSpectate() + end) + end + end + end) +end diff --git a/[esx_addons]/esx_adminmenu/client/helpers.lua b/[esx_addons]/esx_adminmenu/client/helpers.lua new file mode 100644 index 00000000..cdc44a8a --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/helpers.lua @@ -0,0 +1,81 @@ +Helpers = {} + +function Helpers.resolveVehicleName(hash) + if not hash then + return "Unknown" + end + + local display = GetDisplayNameFromVehicleModel(hash) + if not display or display == "CARNOTFOUND" then + return tostring(hash) + end + + local label = GetLabelText(display) + if label and label ~= "NULL" then + return label + end + + return display +end + +-- Callback helper for the /admincar command. +ESX.RegisterClientCallback("esx-adminmenu:client:getVehicleProps", function(cb) + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + + if vehicle == 0 then + cb(nil) + return + end + + local props = ESX.Game.GetVehicleProperties(vehicle) + cb(props) +end) + +ESX.RegisterClientCallback("esx-adminmenu:client:adminCarVehicleProps", function(cb, data) + data = data or {} + local ped = PlayerPedId() + local vehicle = GetVehiclePedIsIn(ped, false) + local plate = data.plate + + if data.model and data.model ~= "" then + local model = joaat(data.model) + if not IsModelInCdimage(model) or not IsModelAVehicle(model) then + cb(nil) + return + end + + RequestModel(model) + local timeout = GetGameTimer() + 5000 + while not HasModelLoaded(model) do + Wait(0) + if GetGameTimer() > timeout then + cb(nil) + return + end + end + + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + vehicle = CreateVehicle(model, coords.x, coords.y, coords.z, heading, true, false) + SetEntityAsMissionEntity(vehicle, true, true) + SetVehicleOnGroundProperly(vehicle) + SetPedIntoVehicle(ped, vehicle, -1) + SetModelAsNoLongerNeeded(model) + end + + if vehicle == 0 then + cb(nil) + return + end + + if plate and plate ~= "" then + SetVehicleNumberPlateText(vehicle, plate) + end + + local props = ESX.Game.GetVehicleProperties(vehicle) + props.model = GetEntityModel(vehicle) + props.plate = ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) + + cb(props) +end) diff --git a/[esx_addons]/esx_adminmenu/client/main.lua b/[esx_addons]/esx_adminmenu/client/main.lua new file mode 100644 index 00000000..98e3c7c8 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/main.lua @@ -0,0 +1,13 @@ +ESX.TriggerServerCallback('esx-adminmenu:server:getInitData', function(data) + if not data or data.error then + if data.error and Config.Debug then + print(data.error) + end + return + end + SendNUIMessage({ + action = 'initResource', + data = data + }) +end) + diff --git a/[esx_addons]/esx_adminmenu/client/nui.lua b/[esx_addons]/esx_adminmenu/client/nui.lua new file mode 100644 index 00000000..787af583 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/nui.lua @@ -0,0 +1,719 @@ +AdminOpen = false +AdminMode = nil + +local function getCallbackError(res, fallback) + if not res then + return fallback or "No response from server." + end + + return res.err or res.error or fallback or "Action failed." +end + +local function respondFailure(cb, label, res, fallback) + local err = getCallbackError(res, fallback) + print(label, err) + + cb({ + success = false, + err = err, + playerOnline = res and res.playerOnline, + }) +end + +local function sendQuickMenuState(action, active, value) + SendNUIMessage({ + action = "adminMenuState", + data = { + action = action, + active = active == true, + value = value, + }, + }) +end + +local function closeAdminUi() + SetNuiFocus(false, false) + SetNuiFocusKeepInput(false) + AdminOpen = false + AdminMode = nil + SendNUIMessage({ action = "closeAdmin" }) + + CreateThread(function() + Wait(0) + SetNuiFocus(false, false) + SetNuiFocusKeepInput(false) + end) +end + +local function applyAdminFocus(mode) + AdminOpen = true + AdminMode = mode + + if mode == "dashboard" then + SetNuiFocus(true, true) + SetNuiFocusKeepInput(false) + return + end + + SetNuiFocus(true, false) + SetNuiFocusKeepInput(true) +end + +function ToggleNUIFocus(bool, mode) + if not bool then + closeAdminUi() + return + end + + applyAdminFocus(mode or "dashboard") +end + +local function notifyClientError(err) + if ESX and ESX.ShowNotification then + ESX.ShowNotification(err or "Action failed.", "error") + end +end + +local function openDashboard(cb) + ESX.TriggerServerCallback("esx-adminmenu:server:openDashboard", function(res) + if not res or not res.success then + local err = getCallbackError(res, "You do not have permission to open the admin dashboard.") + notifyClientError(err) + + if cb then + cb({ success = false, err = err }) + end + return + end + + ToggleNUIFocus(true, "dashboard") + SendNUIMessage({ + action = "openAdminDashboard", + data = { + players = res.players or {}, + serverData = res.serverData, + }, + }) + + if cb then + cb({ success = true }) + end + end) +end + +local function openAdminMenu(cb) + ESX.TriggerServerCallback("esx-adminmenu:server:canOpen", function(res) + if not res or not res.success then + local err = getCallbackError(res, "You do not have permission to open the admin menu.") + notifyClientError(err) + + if cb then + cb({ success = false, err = err }) + end + return + end + + ToggleNUIFocus(true, "menu") + SendNUIMessage({ + action = "openAdminMenu", + data = { + serverData = res.serverData, + }, + }) + + if cb then + cb({ success = true }) + end + end) +end + +local function pushServerData() + if not AdminOpen then + return + end + + ESX.TriggerServerCallback("esx-adminmenu:server:canOpen", function(res) + if not res or not res.success then + return + end + + SendNUIMessage({ + action = "updateServerData", + data = res.serverData, + }) + end) +end + +local function checkAdminAction(action, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:canUseAdminAction", cb, { action = action }) +end + +local function runProtectedClientAction(cb, label, action, permissionAction) + if not permissionAction then + cb({ success = false, err = "Missing admin action permission." }) + return + end + + checkAdminAction(permissionAction, function(res) + if not res or not res.success then + respondFailure(cb, label, res) + return + end + + local ok, success, err, extra = pcall(action) + if not ok then + cb({ success = false, err = success }) + return + end + + if not success then + cb({ success = false, err = err or "Action failed." }) + return + end + + extra = extra or {} + extra.success = true + cb(extra) + end) +end + +function OpenAdminDashboard() + openDashboard() +end + +function OpenAdminMenu() + openAdminMenu() +end + +RegisterCommand("adminmenu", function() + OpenAdminMenu() +end, false) + +RegisterCommand("admindashboard", function() + OpenAdminDashboard() +end, false) + +local function runAdminCommandAction(action, handler) + checkAdminAction(action, function(res) + if not res or not res.success then + notifyClientError(getCallbackError(res, "You do not have permission to use this command.")) + return + end + + local active = handler() + sendQuickMenuState(action, active) + + if action == "noclip" and ClientActions.IsInvisibleActive then + sendQuickMenuState("invisible", ClientActions.IsInvisibleActive()) + end + end) +end + +RegisterCommand("noclip", function() + runAdminCommandAction("noclip", ClientActions.ToggleNoClip) +end, false) + +RegisterCommand("names", function() + runAdminCommandAction("names", ClientActions.ToggleNames) +end, false) + +RegisterCommand("blips", function() + runAdminCommandAction("blips", ClientActions.ToggleBlips) +end, false) + +RegisterKeyMapping("adminmenu", "Open Admin Menu", "keyboard", Config.Keybinds.AdminMenu) +RegisterKeyMapping("admindashboard", "Open Admin Dashboard", "keyboard", Config.Keybinds.AdminDashboard) + +RegisterNUICallback("openDashboard", function(data, cb) + openDashboard(cb) +end) + +RegisterNUICallback("openAdminMenu", function(data, cb) + openAdminMenu(cb) +end) + +RegisterNUICallback("adminMenu:noclip", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:noclip]", function() + local active = ClientActions.ToggleNoClip() + sendQuickMenuState("noclip", active) + if ClientActions.IsInvisibleActive then + sendQuickMenuState("invisible", ClientActions.IsInvisibleActive()) + end + return true, nil, { active = active } + end, "noclip") +end) + +RegisterNUICallback("adminMenu:names", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:names]", function() + local active = ClientActions.ToggleNames() + sendQuickMenuState("names", active) + return true, nil, { active = active } + end, "names") +end) + +RegisterNUICallback("adminMenu:blips", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:blips]", function() + local active = ClientActions.ToggleBlips() + sendQuickMenuState("blips", active) + return true, nil, { active = active } + end, "blips") +end) + +RegisterNUICallback("adminMenu:godmode", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:godmode]", function() + local active = ClientActions.ToggleGodmode() + sendQuickMenuState("godmode", active) + return true, nil, { active = active } + end, "godmode") +end) + +RegisterNUICallback("adminMenu:invisible", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:invisible]", function() + local active = ClientActions.ToggleInvisible() + sendQuickMenuState("invisible", active) + return true, nil, { active = active } + end, "invisible") +end) + +RegisterNUICallback("adminMenu:infiniteAmmo", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:infiniteAmmo]", function() + local active = ClientActions.ToggleInfiniteAmmo() + sendQuickMenuState("infiniteAmmo", active) + return true, nil, { active = active } + end, "infiniteAmmo") +end) + +RegisterNUICallback("adminMenu:revive", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:selfAction", function(res) + if not res or not res.success then + respondFailure(cb, "[esx-adminmenu:revive]", res) + return + end + + cb({ success = true }) + end, { action = "revive" }) +end) + +RegisterNUICallback("adminMenu:heal", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:heal]", ClientActions.Heal, "heal") +end) + +RegisterNUICallback("adminMenu:armor", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:armor]", function() + return ClientActions.SetArmor(100) + end, "armor") +end) + +RegisterNUICallback("adminMenu:repairVehicle", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:repairVehicle]", ClientActions.RepairVehicle, "repairVehicle") +end) + +RegisterNUICallback("adminMenu:cleanVehicle", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cleanVehicle]", ClientActions.CleanVehicle, "cleanVehicle") +end) + +RegisterNUICallback("adminMenu:deleteVehicle", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:deleteVehicle]", ClientActions.DeleteVehicle, "deleteVehicle") +end) + +RegisterNUICallback("adminMenu:waypoint", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:waypoint]", ClientActions.TeleportToWaypoint, "waypoint") +end) + +RegisterNUICallback("adminMenu:spawnVehicle", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:spawnVehicle]", function() + return ClientActions.SpawnVehicle(data or {}) + end, "spawnVehicle") +end) + +RegisterNUICallback("adminMenu:flipVehicle", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:flipVehicle]", ClientActions.FlipVehicle, "flipVehicle") +end) + +RegisterNUICallback("adminMenu:setVehiclePerformance", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:setVehiclePerformance]", function() + local success, err, extra = ClientActions.SetVehiclePerformance(data or {}) + if success then + sendQuickMenuState("engineLevel", true, + data and data.engineLevel and (tostring(data.engineLevel) .. "/5") or nil) + sendQuickMenuState("brakeLevel", true, + data and data.brakeLevel and (tostring(data.brakeLevel) .. "/5") or nil) + end + + return success, err, extra + end, "customizeVehicle") +end) + +RegisterNUICallback("adminMenu:customizeVehicle", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:customizeVehicle]", function() + return ClientActions.CustomizeVehicle(data or {}) + end, "customizeVehicle") +end) + +RegisterNUICallback("adminMenu:cycleVehicleEngine", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleEngine]", function() + local success, err, extra = ClientActions.CycleVehicleEngine() + if success then + sendQuickMenuState("engineLevel", extra and extra.active or true, extra and extra.value) + end + return success, err, extra + end, "engineLevel") +end) + +RegisterNUICallback("adminMenu:cycleVehicleBrakes", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleBrakes]", function() + local success, err, extra = ClientActions.CycleVehicleBrakes() + if success then + sendQuickMenuState("brakeLevel", extra and extra.active or true, extra and extra.value) + end + return success, err, extra + end, "brakeLevel") +end) + +RegisterNUICallback("adminMenu:cycleVehicleTransmission", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleTransmission]", function() + return ClientActions.CycleVehicleTransmission() + end, "transmissionLevel") +end) + +RegisterNUICallback("adminMenu:cycleVehicleSuspension", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleSuspension]", function() + return ClientActions.CycleVehicleSuspension() + end, "suspensionLevel") +end) + +RegisterNUICallback("adminMenu:cycleVehicleArmor", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleArmor]", function() + return ClientActions.CycleVehicleArmor() + end, "armorLevel") +end) + +RegisterNUICallback("adminMenu:cycleVehicleColor", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleColor]", function() + local success, err, extra = ClientActions.CycleVehicleColor() + if success then + sendQuickMenuState("colorCycle", extra and extra.active or true, extra and extra.value) + end + return success, err, extra + end, "colorCycle") +end) + +RegisterNUICallback("adminMenu:cycleVehicleNeonColor", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:cycleVehicleNeonColor]", function() + return ClientActions.CycleVehicleNeonColor() + end, "neonColorCycle") +end) + +RegisterNUICallback("adminMenu:maxVehiclePerformance", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:maxVehiclePerformance]", function() + local success, err, extra = ClientActions.MaxVehiclePerformance() + if success then + sendQuickMenuState("maxPerformance", extra and extra.active or true, extra and extra.value) + end + return success, err, extra + end, "maxPerformance") +end) + +RegisterNUICallback("adminMenu:copyCoords", function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:copyCoords]", ClientActions.CopyCoords, "copyCoords") +end) + +RegisterNUICallback("server:action", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:serverAction", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:serverAction]", res) + return + end + + cb({ success = res.success, serverData = res.serverData }) + end, data) +end) + +RegisterNUICallback("server:radioPlayers", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:getRadioChannelPlayers", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:radioPlayers]", res) + return + end + + cb({ success = true, players = res.players or {} }) + end, data) +end) + +RegisterNUICallback("player:action", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:playerAction", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:playerAction]", res) + return + end + + cb({ success = res.success, playerOnline = res.playerOnline }) + end, data) +end) + +RegisterNUICallback("goto", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:goto", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:goto]", res) + return + end + + cb({ success = res.success, playerOnline = res.playerOnline }) + end, data) +end) + +RegisterNUICallback("bring", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:bring", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:bring]", res) + return + end + + cb({ success = res.success, playerOnline = res.playerOnline }) + end, data) +end) + +RegisterNUICallback("spectate", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:spectate", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:spectate]", res) + return + end + + if not res.isAdmin or not res.playerOnline then + cb({ success = false, err = getCallbackError(res), playerOnline = res.playerOnline }) + return + end + + cb({ success = true, playerOnline = res.playerOnline }) + Spectate(data.id, res.targetCoords) + end, data) +end) + +RegisterNUICallback("kick", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:kick", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:kick]", res) + return + end + + cb({ success = res.success, playerOnline = res.playerOnline }) + end, data) +end) + +RegisterNUICallback("ban", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:ban", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:ban]", res) + return + end + + cb({ success = res.success, playerOnline = res.playerOnline }) + end, data) +end) + +RegisterNUICallback("ban:offline", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:ban:offline", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:banOffline]", res) + return + end + + cb({ success = res.success }) + end, data) +end) + +RegisterNUICallback("ban:changeExpiry", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:ban:changeExpiry", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:changeExpiry]", res) + return + end + + cb({ success = res.success }) + end, data) +end) + +RegisterNUICallback("ban:revoke", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:ban:revoke", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:revokeBan]", res) + return + end + + cb({ success = res.success }) + end, data) +end) + +RegisterNUICallback("releaseFocus", function(data, cb) + ToggleNUIFocus(false) + cb({ success = true }) +end) + +RegisterNUICallback("adminMenu:setInputFocus", function(data, cb) + local enabled = data and data.enabled == true + + if AdminOpen and AdminMode == "menu" then + if enabled then + SetNuiFocus(true, true) + SetNuiFocusKeepInput(false) + else + SetNuiFocus(true, false) + SetNuiFocusKeepInput(true) + end + end + + cb({ success = true }) +end) + +RegisterNUICallback("getVehicles", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:getVehicles", function(res) + if not res or res.err then + print("[esx-adminmenu:getVehicles]", res and res.err) + cb({ success = false, err = getCallbackError(res, "Failed to fetch vehicles."), vehicles = {} }) + return + end + + local vehicles = res.vehicles or {} + + for i = 1, #vehicles do + local v = vehicles[i] + v.name = Helpers.resolveVehicleName(v.model) + end + + cb({ + success = true, + vehicles = vehicles, + hasMore = res.hasMore == true, + nextOffset = res.nextOffset or #vehicles, + limit = res.limit, + }) + end, data) +end) + +RegisterNUICallback("player:notify", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:notify", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:notifyPlayer]", res) + return + end + + cb({ success = res.success, playerOnline = res.playerOnline }) + end, data) +end) + +RegisterNUICallback("getBans", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:getBans", function(res) + if not res or res.err then + print("[esx-adminmenu:getBans]", res and res.err) + cb({ success = false, err = getCallbackError(res, "Failed to fetch bans."), bans = {} }) + return + end + + cb({ + success = true, + bans = res.bans or {}, + hasMore = res.hasMore == true, + nextOffset = res.nextOffset or #(res.bans or {}), + limit = res.limit, + }) + end, data) +end) + +RegisterNUICallback("getRecentPlayers", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:getRecentPlayers", function(res) + if not res or res.err then + print("[esx-adminmenu:getRecentPlayers]", res and res.err) + cb({ success = false, err = getCallbackError(res, "Failed to fetch recent players."), players = {} }) + return + end + + cb({ success = true, players = res.players or {} }) + end) +end) + +RegisterNUICallback("player:searchOffline", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:searchOfflinePlayer", function(res) + if not res or res.err then + print("[esx-adminmenu:searchOffline]", res and res.err) + cb({ success = false, err = getCallbackError(res, "Failed to search offline players."), players = {} }) + return + end + + cb({ success = true, players = res.players or {} }) + end, data) +end) + +RegisterNUICallback("vehicle:impound", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:vehicleImpound", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:vehicleImpound]", res) + return + end + + cb({ success = res.success }) + end, data) +end) + +RegisterNUICallback("vehicle:unimpound", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:vehicleUnimpound", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:vehicleUnimpound]", res) + return + end + + cb({ success = res.success }) + end, data) +end) + +RegisterNUICallback("vehicle:delete", function(data, cb) + ESX.TriggerServerCallback("esx-adminmenu:server:vehicleDelete", function(res) + if not res or res.err then + respondFailure(cb, "[esx-adminmenu:vehicleDelete]", res) + return + end + + cb({ success = res.success }) + end, data) +end) + +RegisterNetEvent("esx-adminmenu:client:copyToClipboard", function(text) + SendNUIMessage({ + action = "copyToClipboard", + data = text, + }) +end) + +RegisterNetEvent("esx-adminmenu:client:open", function(data) + ToggleNUIFocus(true, "dashboard") + SendNUIMessage({ + action = "openAdminDashboard", + data = { + players = data or {}, + }, + }) +end) + +RegisterNetEvent("esx-adminmenu:client:openAdminMenu", function() + openAdminMenu() +end) + +RegisterNetEvent("esx-adminmenu:client:openInformation", function(data) + data = data or {} + ToggleNUIFocus(true, "dashboard") + SendNUIMessage({ + action = "openAdminDashboard", + data = { + players = data.players or {}, + selectedPlayerId = data.selectedPlayerId, + serverData = data.serverData, + }, + }) +end) + +CreateThread(function() + while true do + Wait(60000) + pushServerData() + end +end) diff --git a/[esx_addons]/esx_adminmenu/fxmanifest.lua b/[esx_addons]/esx_adminmenu/fxmanifest.lua new file mode 100644 index 00000000..5dc9f431 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/fxmanifest.lua @@ -0,0 +1,41 @@ +fx_version("cerulean") +game("gta5") +lua54("yes") + +author("ESX (Zox)") +description("ESX Admin Menu") +version("0.3.2") + +shared_scripts({ + "@es_extended/imports.lua", + "@es_extended/locale.lua", + "locales/*.lua", + "shared/*.lua", +}) + +client_scripts({ + "client/*.lua", +}) + +server_scripts({ + "@oxmysql/lib/MySQL.lua", + "server/ban_cache.lua", + "server/database.lua", + "server/helpers.lua", + "server/actions.lua", + "server/commands.lua", + "server/events.lua", + "server/main.lua", +}) + +ui_page("web/dist/index.html") + +files({ + "web/dist/index.html", + "web/dist/**/*", +}) + +dependencies({ + "es_extended", + "oxmysql", +}) diff --git a/[esx_addons]/esx_adminmenu/locales/en.lua b/[esx_addons]/esx_adminmenu/locales/en.lua new file mode 100644 index 00000000..c02798bf --- /dev/null +++ b/[esx_addons]/esx_adminmenu/locales/en.lua @@ -0,0 +1,204 @@ +Locales["en"] = { + -- General UI Texts + ["admin_menu"] = "Admin Menu", + ["admin_dashboard"] = "Admin Dashboard", + ["dashboard_home"] = "Dashboard Home", + ["dashboard_snapshot"] = "Current server snapshot and player economy overview.", + ["admin_menu_desc"] = "Manage everything in your server", + ["quick_admin_menu"] = "Quick Admin Menu", + ["quick_actions"] = "Quick Actions", + ["open_admin_dashboard"] = "Open Admin Dashboard", + ["open_admin_menu"] = "Open Admin Menu", + ["admin_menu_self"] = "Self", + ["admin_menu_vehicle"] = "Vehicle", + ["admin_menu_utility"] = "Utility", + ["search_anything"] = "Search anything...", + ["server_online"] = "Server Online", + ["server_uptime"] = "Uptime", + ["players"] = "Players", + ["search_player"] = "Search player...", + ["search_vehicle"] = "Search vehicle...", + ["search_banned_identifier"] = "Search banned identifier or ban reason...", + ["player_management"] = "Player Management", + ["players_list"] = "Players List", + ["vehicles_list"] = "Vehicles List", + ["player_search"] = "Player Search", + ["recent_players"] = "Recent Players", + ["no_players_found"] = "No players found...", + ["bans_list"] = "Bans List", + + -- Player Data Titles + ["id"] = "ID", + ["name"] = "Name", + ["money"] = "Cash", + ["total_money"] = "Total Money", + ["avg_money"] = "Avg Money", + ["avg_money_per_player"] = "Avg Money / Player", + ["active_staff"] = "Active Staff", + ["non_staff"] = "Non Staff", + ["available_slots"] = "Available Slots", + ["money_distribution"] = "Money Distribution", + ["economy_summary"] = "Economy Summary", + ["median_money"] = "Median Money", + ["richest_player"] = "Richest Player", + ["avg_money_breakdown"] = "Avg Money Breakdown", + ["health_distribution"] = "Health Distribution", + ["avg_health"] = "Avg Health", + ["avg_armor"] = "Avg Armor", + ["player_counts"] = "Player Counts", + ["player_condition"] = "Player Condition", + ["staff_overview"] = "Staff Overview", + ["active_player_job_distribution"] = "Active Player Job Distribution", + ["top_jobs"] = "Top Jobs", + ["wealth_bands"] = "Wealth Bands", + ["bank_money"] = "Bank Money", + ["black_money"] = "Black Money", + ["health"] = "Health", + ["armor"] = "Armor", + ["last_visited"] = "Last visited", + ["gender"] = "Gender", + ["male"] = "Male", + ["female"] = "Female", + ["job"] = "Job", + ["job_grade"] = "Job Grade", + ["identifier"] = "Identifier", + ["ip_address"] = "IP Address", + ["char_identifier"] = "Character Identifier", + ["play_time"] = "Play Time", + ["position"] = "Position", + ["identifiers"] = "Identifiers", + ["routing_bucket"] = "Routing Bucket", + ["radio_channel"] = "Radio Channel", + ["thirst"] = "Thirst", + ["hunger"] = "Hunger", + + -- Actions & Miscellaneous + ["player_information"] = "Player Information", + ["information"] = "Information", + ["teleport"] = "Teleport", + ["bring"] = "Bring", + ["spectate"] = "Spectate", + ["notify_player"] = "Notify Player", + ["notification_message"] = "Message", + ["give_money"] = "Give Cash", + ["take_money"] = "Take Cash", + ["set_health"] = "Set Health", + ["set_armor"] = "Set Armor", + ["clean_inventory"] = "Clean Inventory", + ["player_tools"] = "Player Tools", + ["kill_player"] = "Kill Player", + ["revive_player"] = "Revive Player", + ["freeze_player"] = "Freeze Player", + ["unfreeze_player"] = "Unfreeze Player", + ["set_model"] = "Set Model", + ["open_clothing"] = "Open Clothing", + ["give_all_weapons"] = "Give All Weapons", + ["set_bucket"] = "Set Bucket", + ["set_radio"] = "Set Radio", + ["set_job"] = "Set Job", + ["set_name"] = "Set Name", + ["set_thirst"] = "Set Thirst", + ["set_hunger"] = "Set Hunger", + ["ace_add"] = "Add ACE Group", + ["ace_remove"] = "Remove ACE Group", + ["model_name"] = "Model Name", + ["ace_group"] = "ACE Group", + ["first_name"] = "First Name", + ["last_name"] = "Last Name", + ["delete_character"] = "Delete Character", + ["troll_options"] = "Troll Options", + ["troll_burn"] = "Burn", + ["troll_explode"] = "Explode", + ["troll_sky"] = "Teleport to Sky", + ["troll_random"] = "Random Teleport", + ["troll_nausea"] = "Nausea", + ["noclip"] = "NoClip", + ["show_names"] = "Show Names", + ["show_blips"] = "Show Blips", + ["godmode"] = "Godmode", + ["invisible"] = "Invisible", + ["infinite_ammo"] = "Infinite Ammo", + ["revive"] = "Revive", + ["heal"] = "Heal", + ["spawn_vehicle"] = "Spawn Vehicle", + ["vehicle_spawner"] = "Vehicle Spawner", + ["vehicle_model"] = "Vehicle Model", + ["vehicle_color"] = "Vehicle Color", + ["primary_color"] = "Primary Color", + ["secondary_color"] = "Secondary Color", + ["customize_vehicle"] = "Customize Vehicle", + ["customize_vehicle_hint"] = "Use left and right arrows to change vehicle stages.", + ["spawn_tuned"] = "Spawn Tuned", + ["engine_level"] = "Engine", + ["brake_level"] = "Brakes", + ["transmission_level"] = "Transmission", + ["suspension_level"] = "Suspension", + ["vehicle_armor"] = "Vehicle Armor", + ["turbo"] = "Turbo", + ["xenon_lights"] = "Xenon", + ["neon_lights"] = "Neon", + ["neon_color"] = "Neon Color", + ["window_tint"] = "Window Tint", + ["wheel_category"] = "Wheel Category", + ["wheel_design"] = "Disc Design", + ["bulletproof_tires"] = "Bulletproof Tires", + ["apply_performance"] = "Apply Performance", + ["apply_customization"] = "Apply Customization", + ["max_performance"] = "Max Performance", + ["repair_vehicle"] = "Repair Vehicle", + ["clean_vehicle"] = "Clean Vehicle", + ["flip_vehicle"] = "Flip Vehicle", + ["teleport_waypoint"] = "Teleport Waypoint", + ["copy_coords"] = "Copy Coords", + ["delete_current_vehicle"] = "Delete Vehicle", + ["quick_menu_hint"] = "Arrow keys move, Enter runs, Backspace closes.", + ["quick_menu_edit_hint"] = "Up/down move, left/right change values, Enter selects.", + ["back"] = "Back", + ["kick"] = "Kick", + ["ban"] = "Ban", + ["never"] = "Never", + ["copied_to_clipboard"] = "Copied to clipboard", + ["online"] = "Online", + ["offline"] = "Offline", + ["on"] = "On", + ["off"] = "Off", + ["player"] = "Player:", + ["reason"] = "Reason", + ["kick_reason_placeholder"] = "Enter kick reason.", + ["ban_reason_placeholder"] = "Enter ban reason", + ["duration"] = "Duration", + ["minutes"] = "Minutes", + ["hours"] = "Hours", + ["days"] = "Days", + ["months"] = "Months", + ["years"] = "Years", + ["permanent"] = "Permanent", + ["duration_desc"] = "Not entering a duration bans the user permanently.", + ["cancel"] = "Cancel", + ["confirm"] = "Confirm", + ["escape_spectate"] = "Press [ESC] to stop spectating", + ["default_ban"] = "You are banned from this server!", + ["finalizing_connection"] = "Finalizing connection...", + + -- Ban Management + ["banned_by"] = "Banned By", + ["banned_at"] = "Banned At", + ["expires_at"] = "Expires At", + ["change_expiry"] = "Change Expiry", + ["revoke"] = "Revoke", + ["new_expiry_date"] = "New Expiry Date", + + -- Vehicles + ["plate"] = "Plate", + ["owner"] = "Owner", + ["vehicle_name"] = "Vehicle Name", + ["vehicle_type"] = "Vehicle Type", + ["mileage"] = "Mileage", + ["impounded"] = "Impounded", + ["copy_plate"] = "Copy Plate", + ["copy_owner"] = "Copy Owner", + ["impound"] = "Impound", + ["unimpound"] = "Unimpound", + ["delete_vehicle"] = "Delete Vehicle", + ["select_impound"] = "Select Impound", +} diff --git a/[esx_addons]/esx_adminmenu/server/actions.lua b/[esx_addons]/esx_adminmenu/server/actions.lua new file mode 100644 index 00000000..a2a6de4d --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/actions.lua @@ -0,0 +1,1164 @@ +Actions = Actions or {} + +local function async(fn) + CreateThread(function() + local ok, err = pcall(fn) + if not ok then + print("[esx-adminmenu] async error:", err) + end + end) +end + +local function getTargetId(data) + return tonumber(data and data.id) +end + +local function getBoolean(value) + return value == true or value == "true" or value == 1 or value == "1" +end + +local function clampNumber(value, min, max, fallback) + local number = tonumber(value) or fallback + + if not number then + return min + end + + if number < min then + return min + end + + if number > max then + return max + end + + return number +end + +local function trimString(value) + if type(value) ~= "string" then + return "" + end + + return value:match("^%s*(.-)%s*$") +end + +local function limitString(value, maxLength, fallback) + local text = trimString(value) + if text == "" then + text = fallback or "" + end + + maxLength = tonumber(maxLength) or 180 + if #text > maxLength then + text = text:sub(1, maxLength) + end + + return text +end + +local function getLimits() + return Config.AdminLimits or {} +end + +local function isValidIdentifier(identifier) + return type(identifier) == "string" + and #identifier <= 100 + and identifier:match("^[%w]+:[%w%-_]+$") ~= nil +end + +local function isValidCharacterIdentifier(identifier) + return type(identifier) == "string" + and #identifier <= 100 + and identifier:match("^char%d+:[%w%-_]+$") ~= nil +end + +local function normalizePlate(plate) + plate = trimString(plate):upper() + + if plate == "" or #plate > 12 or not plate:match("^[%w%s%-]+$") then + return nil + end + + return plate +end + +local function normalizeBanDuration(minutes) + local duration = tonumber(minutes) + if not duration or duration <= 0 then + return nil + end + + return math.floor(clampNumber(duration, 1, getLimits().MaxBanDurationMinutes or 2628000, 1)) +end + +local function insertBan(identifier, reason, bannedBy, expiresAt, bannedAt) + identifier = Helpers.normalizeLicenseIdentifier(identifier) + if not identifier then + return nil + end + + if expiresAt then + return MySQL.insert.await( + "INSERT INTO bans (identifier, reason, banned_by, expires_at, banned_at) VALUES (?, ?, ?, FROM_UNIXTIME(?), FROM_UNIXTIME(?))", + { identifier, reason, bannedBy, expiresAt, bannedAt } + ) + end + + return MySQL.insert.await( + "INSERT INTO bans (identifier, reason, banned_by, expires_at, banned_at) VALUES (?, ?, ?, NULL, FROM_UNIXTIME(?))", + { identifier, reason, bannedBy, bannedAt } + ) +end + +local function getBanIdentifierVariants(identifier) + local normalized = Helpers.normalizeLicenseIdentifier(identifier) + if not normalized then + return nil, nil + end + + local variants = { normalized } + local bare = normalized:match("^license:(.+)$") + if bare then + variants[#variants + 1] = bare + end + + return normalized, variants +end + +local function updateBanExpiry(identifier, expiresAt) + local _, variants = getBanIdentifierVariants(identifier) + if not variants then + return false + end + + if expiresAt then + for i = 1, #variants do + MySQL.update.await( + "UPDATE bans SET expires_at = FROM_UNIXTIME(?) WHERE identifier = ?", + { expiresAt, variants[i] } + ) + end + return true + end + + for i = 1, #variants do + MySQL.update.await("UPDATE bans SET expires_at = NULL WHERE identifier = ?", { variants[i] }) + end + + return true +end + +local function expireBan(identifier) + local _, variants = getBanIdentifierVariants(identifier) + if not variants then + return false + end + + for i = 1, #variants do + MySQL.update.await("UPDATE bans SET expires_at = NOW() WHERE identifier = ?", { variants[i] }) + end + + return true +end + +local function normalizeMoneyAmount(amount) + return math.floor(clampNumber(amount, 1, getLimits().MaxMoneyAmount or 10000000, 0)) +end + +local function normalizeMoneyAccount(account) + account = trimString(account) + local allowed = getLimits().AllowedMoneyAccounts or { money = true, bank = true, black_money = true } + + if allowed[account] then + return account + end + + return "money" +end + +local function normalizeNotificationType(notificationType) + notificationType = trimString(notificationType) + local allowed = getLimits().AllowedNotificationTypes or { info = true, success = true, error = true } + + if allowed[notificationType] then + return notificationType + end + + return "info" +end + +local function getPlayerIdentifier(xPlayer, source) + if xPlayer and xPlayer.identifier then + return xPlayer.identifier + end + + if xPlayer and xPlayer.getIdentifier then + return xPlayer.getIdentifier() + end + + return nil +end + +local function normalizeAceGroup(value) + local group = trimString(value):gsub("^group%.", "") + + if group == "" or not group:match("^[%w_%.%-]+$") then + return nil + end + + return group +end + +local function setStatusMeta(target, targetId, key, value) + local statusValue = math.floor(clampNumber(value, 0, 100, 100)) + + TriggerClientEvent("esx_status:set", targetId, key, statusValue * 10000) + + if target.setMeta then + pcall(function() + target.setMeta(key, statusValue) + end) + end + + return statusValue +end + +local function getOnlineCharacterIdentifier(target, targetId) + local identifier = getPlayerIdentifier(target, targetId) + + if type(identifier) ~= "string" or identifier == "" then + return nil + end + + return identifier +end + +local function revivePlayer(targetId) + local reviveConfig = Config.Revive or {} + local events = reviveConfig.Events or {} + local triggeredEvent = false + + for i = 1, #events do + local eventName = events[i] + + if type(eventName) == "string" and eventName ~= "" then + TriggerClientEvent(eventName, targetId) + triggeredEvent = true + end + end + + if reviveConfig.UseNativeFallback ~= false then + local delay = triggeredEvent and tonumber(reviveConfig.NativeFallbackDelay) or 0 + + SetTimeout(delay or 0, function() + TriggerClientEvent("esx-adminmenu:client:revive", targetId) + end) + end +end + +local function getServerActionPermission(action) + local serverConfig = Config.ServerManagement or {} + local actionPermissions = serverConfig.ActionPermissions or {} + + return actionPermissions[action] or "serverManagement" +end + +local function withServerData(data) + data = data or {} + data.serverData = Helpers.getServerData() + return data +end + +local function getPlayerActionPermission(action) + local playerConfig = Config.PlayerActions or {} + local actionPermissions = playerConfig.ActionPermissions or {} + + return actionPermissions[action] +end + +-- TELEPORT + +function Actions.Goto(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "playerTeleport") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local targetId = getTargetId(data) + if not Helpers.isOnline(targetId) then + return { success = false, playerOnline = false } + end + + local admin = ESX.Player(src) + local target = ESX.Player(targetId) + if not admin or not target then + return { success = false, playerOnline = target ~= nil } + end + + admin.setCoords(target.getCoords(true)) + return { success = true, playerOnline = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:goto", function(source, cb, data) + cb(Actions.Goto(source, data)) +end) + +function Actions.Bring(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "playerTeleport") then + return { success = false, playerOnline = true } + end + + local targetId = getTargetId(data) + if not Helpers.isOnline(targetId) then + return { success = false, playerOnline = false } + end + + local admin = ESX.Player(src) + local target = ESX.Player(targetId) + if not admin or not target then + return { success = false, playerOnline = target ~= nil } + end + + target.setCoords(admin.getCoords(true)) + return { success = true, playerOnline = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:bring", function(source, cb, data) + cb(Actions.Bring(source, data)) +end) + +-- SPECTATE + +function Actions.Spectate(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "spectate") then + return { success = false, err = "Insufficient Permissions", playerOnline = true, isAdmin = false } + end + + local targetId = getTargetId(data) + if not Helpers.isOnline(targetId) then + return { success = false, err = "Player Not Online", playerOnline = false, isAdmin = true } + end + + if targetId == src then + return { success = false, err = "You cannot spectate yourself.", playerOnline = true, isAdmin = true } + end + + local targetPed = GetPlayerPed(targetId) + local targetCoords = GetEntityCoords(targetPed) + + Helpers.stopSpectate(src) + Helpers.startSpectate(src, targetId) + + return { success = true, playerOnline = true, targetCoords = targetCoords, isAdmin = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:spectate", function(source, cb, data) + cb(Actions.Spectate(source, data)) +end) + +function Actions.StopSpectate(src) + Helpers.stopSpectate(src) + return { success = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:spectate:stop", function(source, cb) + cb(Actions.StopSpectate(source)) +end) + +-- KICK + +function Actions.Kick(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "playerModeration") then + return { success = false, err = "Insufficient Permissions", playerOnline = true, isAdmin = false } + end + + local targetId = getTargetId(data) + if not Helpers.isOnline(targetId) then + return { success = false, err = "Player Not Online", playerOnline = false, isAdmin = true } + end + + if targetId == src then + return { success = false, err = "You cannot kick yourself.", playerOnline = true, isAdmin = true } + end + + async(function() + local identifier = Helpers.getPlayerLicenseIdentifier(targetId) + local reason = limitString(data.reason, getLimits().MaxReasonLength, "Kicked by admin") + + MySQL.insert.await( + "INSERT INTO kicks (identifier, reason, kicked_by) VALUES (?, ?, ?)", + { identifier, reason, GetPlayerName(src) } + ) + + DropPlayer(targetId, reason) + end) + + return { success = true, playerOnline = true, isAdmin = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:kick", function(source, cb, data) + cb(Actions.Kick(source, data)) +end) + +-- BAN +function Actions.Ban(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "banManagement") then + return { success = false, err = "Insufficient Permissions", playerOnline = true, isAdmin = false } + end + + local targetId = getTargetId(data) + + if not Helpers.isOnline(targetId) then + return { success = false, err = "Player Not Online", playerOnline = false, isAdmin = true } + end + + if targetId == src then + return { success = false, err = "You cannot ban yourself.", playerOnline = true, isAdmin = true } + end + + local identifier = Helpers.getPlayerLicenseIdentifier(targetId) + if not identifier then + return { success = false, err = "Missing player license identifier.", playerOnline = true, isAdmin = true } + end + + async(function() + local duration = normalizeBanDuration(data.duration) + local seconds = duration and (os.time() + duration * 60) or nil + local bannedAt = os.time() + local adminName = GetPlayerName(src) + local reason = limitString(data.reason, getLimits().MaxReasonLength, "Banned by admin") + + local banId = insertBan(identifier, reason, adminName, seconds, bannedAt) + + BanCache.add({ + id = banId, + identifier = identifier, + reason = reason, + banned_by = adminName, + banned_at = bannedAt, + expires_at = seconds, + }) + + DropPlayer(targetId, reason) + end) + return { success = true, playerOnline = true, isAdmin = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:ban", function(source, cb, data) + cb(Actions.Ban(source, data)) +end) + +-- OFFLINE BAN + +ESX.RegisterServerCallback("esx-adminmenu:server:ban:offline", function(source, cb, data) + local src = source + if not Helpers.hasFeaturePermission(source, "banManagement") then + cb({ success = false, err = "Insufficient Permissions", isAdmin = false }) + return + end + + data = data or {} + + local normalizedIdentifier = Helpers.normalizeLicenseIdentifier(data.identifier) + if not normalizedIdentifier then + cb({ success = false, err = "Invalid Identifier", isAdmin = true }) + return + end + + cb({ success = true, isAdmin = true }) + + async(function() + local duration = normalizeBanDuration(data.duration) + local seconds = duration and (os.time() + duration * 60) or nil + local bannedAt = os.time() + local identifier = normalizedIdentifier + local adminName = GetPlayerName(src) + local reason = limitString(data.reason, getLimits().MaxReasonLength, "Banned by admin") + + local banId = insertBan(identifier, reason, adminName, seconds, bannedAt) + + BanCache.add({ + id = banId, + identifier = identifier, + reason = reason, + banned_by = adminName, + banned_at = bannedAt, + expires_at = seconds, + }) + end) +end) + +-- CHANGE EXPIRY + +ESX.RegisterServerCallback("esx-adminmenu:server:ban:changeExpiry", function(source, cb, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + cb({ success = false, err = "Insufficient Permissions", isAdmin = false }) + return + end + + data = data or {} + + local normalizedIdentifier = Helpers.normalizeLicenseIdentifier(data.identifier) + if not normalizedIdentifier then + cb({ success = false, err = "Invalid Identifier", isAdmin = true }) + return + end + + local seconds = nil + if data.newDate ~= nil then + local newDate = tonumber(data.newDate) + if not newDate then + cb({ success = false, err = "Invalid expiry date.", isAdmin = true }) + return + end + + local now = os.time() + seconds = math.floor(newDate / 1000) + + if seconds < now then + seconds = now + end + + local maxMinutes = tonumber(getLimits().MaxBanDurationMinutes) + if maxMinutes and maxMinutes > 0 then + seconds = math.min(seconds, now + (maxMinutes * 60)) + end + end + + cb({ success = true, isAdmin = true }) + + async(function() + updateBanExpiry(normalizedIdentifier, seconds) + BanCache.updateExpiry(normalizedIdentifier, seconds) + end) +end) + +-- REVOKE + +ESX.RegisterServerCallback("esx-adminmenu:server:ban:revoke", function(source, cb, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + cb({ success = false, err = "Insufficient Permissions", isAdmin = false }) + return + end + + data = data or {} + + local normalizedIdentifier = Helpers.normalizeLicenseIdentifier(data.identifier) + if not normalizedIdentifier then + cb({ success = false, err = "Invalid Identifier", isAdmin = true }) + return + end + + cb({ success = true, isAdmin = true }) + + async(function() + expireBan(normalizedIdentifier) + BanCache.remove(normalizedIdentifier) + end) +end) + +-- VEHICLES + +local function vehicleAsync(source, cb, data, query, params, feature) + if not Helpers.hasFeaturePermission(source, feature or "vehicleManagement") then + cb({ success = false, err = "Insufficient Permissions" }) + return + end + + data = data or {} + params = params or {} + local plate = normalizePlate(data.plate) + + if not plate then + cb({ success = false, err = "Missing plate" }) + return + end + + params[#params + 1] = plate + cb({ success = true }) + + async(function() + MySQL.update.await(query, params) + Helpers.invalidateVehicles() + end) +end + +ESX.RegisterServerCallback("esx-adminmenu:server:vehicleImpound", function(source, cb, data) + data = data or {} + local impoundName = trimString(data.impoundName) + local impounds = Helpers.getImpounds() or {} + + if impoundName == "" or not impounds[impoundName] then + cb({ success = false, err = "Invalid impound." }) + return + end + + vehicleAsync( + source, + cb, + data, + "UPDATE owned_vehicles SET pound = ? WHERE plate = ?", + { impoundName }, + "vehicleManagement" + ) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:vehicleUnimpound", function(source, cb, data) + data = data or {} + + vehicleAsync(source, cb, data, "UPDATE owned_vehicles SET pound = NULL WHERE plate = ?", {}, "vehicleManagement") +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:vehicleDelete", function(source, cb, data) + data = data or {} + + vehicleAsync(source, cb, data, "DELETE FROM owned_vehicles WHERE plate = ?", {}, "vehicleDestructive") +end) + +-- NOTIFY +function Actions.Notify(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "playerNotify") then + return { success = false, err = "Insufficient Permissions", playerOnline = true, isAdmin = false } + end + + local targetId = getTargetId(data) + + if not Helpers.isOnline(targetId) then + return { success = false, err = "Player Not Online", playerOnline = false, isAdmin = true } + end + + local message = limitString(data.notificationContent, getLimits().MaxNotificationLength, "Notification by Admin") + local notificationType = normalizeNotificationType(data.notificationType) + local duration = math.floor(clampNumber(data.duration, 1000, getLimits().MaxNotificationDuration or 30000, 5000)) + local title = limitString(data.notificationTitle, 80, "") + + TriggerClientEvent( + "esx:showNotification", + targetId, + message, + notificationType, + duration, + title ~= "" and title or nil, + "top-left" + ) + + return { success = true, playerOnline = true, isAdmin = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:notify", function(source, cb, data) + cb(Actions.Notify(source, data)) +end) + +-- SELF ACTIONS + +function Actions.SelfAction(src, data) + data = data or {} + + if not Helpers.hasPermission(src) then + return { success = false, err = "Insufficient Permissions" } + end + + local action = data.action + local actionPermissions = Config.AdminMenu and Config.AdminMenu.ActionPermissions or {} + local feature = actionPermissions[action] + + if not feature or not Helpers.hasFeaturePermission(src, feature) then + return { success = false, err = "Insufficient Permissions" } + end + + if action == "revive" then + revivePlayer(src) + return { success = true } + end + + return { success = false, err = "Unknown self action." } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:selfAction", function(source, cb, data) + cb(Actions.SelfAction(source, data)) +end) + +-- SERVER MANAGEMENT + +function Actions.ServerManagement(src, data) + data = data or {} + + if not Helpers.hasFeaturePermission(src, "serverManagement") then + return { success = false, err = "Insufficient Permissions" } + end + + local action = data.action + local payload = data.payload or {} + + if not Helpers.hasFeaturePermission(src, getServerActionPermission(action)) then + return { success = false, err = "Insufficient Permissions" } + end + + if action == "weather" then + local weather = trimString(payload.weather):upper() + local allowedWeather = Config.ServerManagement and Config.ServerManagement.WeatherTypes or {} + if not allowedWeather[weather] then + weather = "CLEAR" + end + + Helpers.setServerEnvironment({ weather = weather }) + TriggerClientEvent("esx-adminmenu:client:setWeather", -1, weather) + return withServerData({ success = true }) + end + + if action == "time" then + local hour = math.floor(clampNumber(payload.hour, 0, 23, 12)) + local minute = math.floor(clampNumber(payload.minute, 0, 59, 0)) + + Helpers.setServerEnvironment({ hour = hour, minute = minute }) + TriggerClientEvent("esx-adminmenu:client:setTime", -1, hour, minute) + return withServerData({ success = true }) + end + + if action == "blackout" then + local enabled = getBoolean(payload.enabled) + Helpers.setServerEnvironment({ blackout = enabled }) + TriggerClientEvent("esx-adminmenu:client:setBlackout", -1, enabled) + return withServerData({ success = true }) + end + + if action == "pvp" then + local enabled = getBoolean(payload.enabled) + Helpers.setServerEnvironment({ pvp = enabled }) + TriggerClientEvent("esx-adminmenu:client:setPvp", -1, enabled) + return withServerData({ success = true }) + end + + if action == "freezeAll" then + TriggerClientEvent("esx-adminmenu:client:setFrozen", -1, true) + return { success = true } + end + + if action == "unfreezeAll" then + TriggerClientEvent("esx-adminmenu:client:setFrozen", -1, false) + return { success = true } + end + + if action == "bringAll" then + local admin = ESX.Player(src) + if not admin then + return { success = false, err = "Admin player not found." } + end + + local coords = admin.getCoords(true) + local players = ESX.ExtendedPlayers() + + for i = 1, #players do + if players[i].src ~= src then + players[i].setCoords(coords) + end + end + + return { success = true } + end + + if action == "killAll" then + TriggerClientEvent("esx-adminmenu:client:kill", -1) + return { success = true } + end + + if action == "reviveAll" then + revivePlayer(-1) + return { success = true } + end + + if action == "kickAll" then + local reason = limitString( + payload.reason, + getLimits().MaxReasonLength, + (Config.ServerManagement and Config.ServerManagement.DefaultKickReason) or "Kicked by admin" + ) + + for _, playerSource in ipairs(GetPlayers()) do + local targetId = tonumber(playerSource) + if targetId and targetId ~= src then + DropPlayer(targetId, reason) + end + end + + return { success = true } + end + + if action == "deleteVehicles" then + TriggerClientEvent("esx-adminmenu:client:deletePool", -1, "CVehicle") + return { success = true } + end + + if action == "deletePeds" then + TriggerClientEvent("esx-adminmenu:client:deletePool", -1, "CPed") + return { success = true } + end + + if action == "deleteObjects" then + TriggerClientEvent("esx-adminmenu:client:deletePool", -1, "CObject") + return { success = true } + end + + if action == "notifyAll" then + local message = limitString(payload.message, getLimits().MaxNotificationLength, "Notification by Admin") + local notificationType = normalizeNotificationType(payload.notificationType) + local duration = math.floor(clampNumber(payload.duration, 1000, getLimits().MaxNotificationDuration or 30000, + 5000)) + local title = limitString(payload.title, 80, "") + + TriggerClientEvent( + "esx:showNotification", + -1, + message, + notificationType, + duration, + title ~= "" and title or nil, + "top-left" + ) + return { success = true } + end + + if action == "giveMoneyAll" then + local amount = normalizeMoneyAmount(payload.amount) + local account = normalizeMoneyAccount(payload.account) + + if amount <= 0 then + return { success = false, err = "Amount must be greater than 0." } + end + + local players = ESX.ExtendedPlayers() + for i = 1, #players do + if account == "money" then + players[i].addMoney(amount, "Admin menu") + else + players[i].addAccountMoney(account, amount, "Admin menu") + end + end + + return { success = true } + end + + return { success = false, err = "Unknown server action." } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:serverAction", function(source, cb, data) + cb(Actions.ServerManagement(source, data)) +end) + +-- PLAYER MANAGEMENT + +function Actions.PlayerAction(src, data) + data = data or {} + + if not Helpers.hasPermission(src) then + return { success = false, err = "Insufficient Permissions" } + end + + local action = data.action + local payload = data.payload or {} + local targetId = getTargetId(data) + local target = targetId and ESX.GetPlayerFromId(targetId) or nil + local actionPermission = getPlayerActionPermission(action) + + if actionPermission and not Helpers.hasFeaturePermission(src, actionPermission) then + return { success = false, err = "Insufficient Permissions", playerOnline = target ~= nil } + end + + if action == "deleteCharacter" then + local identifier = trimString(payload.identifier) + + if not isValidCharacterIdentifier(identifier) then + return { success = false, err = "Missing character identifier." } + end + + if target then + local targetIdentifier = getOnlineCharacterIdentifier(target, targetId) + + if targetIdentifier ~= identifier then + return { success = false, err = "Character identifier does not match the selected player.", playerOnline = true } + end + end + + async(function() + MySQL.update.await("DELETE FROM users WHERE identifier = ?", { identifier }) + MySQL.update.await("DELETE FROM owned_vehicles WHERE owner = ?", { identifier }) + end) + + if targetId and Helpers.isOnline(targetId) then + DropPlayer(targetId, "Character deleted by an admin.") + end + + return { success = true, playerOnline = targetId and Helpers.isOnline(targetId) or false } + end + + if not target then + return { success = false, err = "Player Not Online", playerOnline = false } + end + + if action == "giveMoney" or action == "takeMoney" then + if not Helpers.hasFeaturePermission(src, "money") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local amount = normalizeMoneyAmount(payload.amount) + local account = normalizeMoneyAccount(payload.account) + + if amount <= 0 then + return { success = false, err = "Amount must be greater than 0.", playerOnline = true } + end + + if action == "giveMoney" then + if account == "money" then + target.addMoney(amount, "Admin menu") + else + target.addAccountMoney(account, amount, "Admin menu") + end + else + if account == "money" then + target.removeMoney(amount, "Admin menu") + else + target.removeAccountMoney(account, amount, "Admin menu") + end + end + + return { success = true, playerOnline = true } + end + + if action == "setHealth" then + TriggerClientEvent("esx-adminmenu:client:setPlayerStats", targetId, clampNumber(payload.amount, 0, 100, 100), nil) + return { success = true, playerOnline = true } + end + + if action == "setArmor" then + TriggerClientEvent("esx-adminmenu:client:setPlayerStats", targetId, nil, clampNumber(payload.amount, 0, 100, 100)) + return { success = true, playerOnline = true } + end + + if action == "cleanInventory" then + local inventory = target.getInventory() + + for i = 1, #inventory do + local item = inventory[i] + if item.count and item.count > 0 then + target.removeInventoryItem(item.name, item.count) + end + end + + return { success = true, playerOnline = true } + end + + if action == "killPlayer" then + TriggerClientEvent("esx-adminmenu:client:kill", targetId) + return { success = true, playerOnline = true } + end + + if action == "revivePlayer" then + revivePlayer(targetId) + return { success = true, playerOnline = true } + end + + if action == "freezePlayer" then + TriggerClientEvent("esx-adminmenu:client:setFrozen", targetId, payload.enabled == true) + return { success = true, playerOnline = true } + end + + if action == "setModel" then + if not Helpers.hasFeaturePermission(src, "setModel") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local model = limitString(payload.model, 64) + if model == "" then + return { success = false, err = "Missing model.", playerOnline = true } + end + + TriggerClientEvent("esx-adminmenu:client:setModel", targetId, model) + return { success = true, playerOnline = true } + end + + if action == "openClothing" then + if not Helpers.hasFeaturePermission(src, "openClothing") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + TriggerClientEvent("esx-adminmenu:client:openClothing", targetId) + return { success = true, playerOnline = true } + end + + if action == "giveAllWeapons" then + if not Helpers.hasFeaturePermission(src, "weapons") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local weapons = Config.AdminWeapons or {} + + for i = 1, #weapons do + local weapon = weapons[i] + local name = weapon.name + + if name and name ~= "" then + if target.hasWeapon and target.hasWeapon(name) and target.addWeaponAmmo then + pcall(function() + target.addWeaponAmmo(name, tonumber(weapon.ammo) or 250) + end) + elseif target.addWeapon then + pcall(function() + target.addWeapon(name, tonumber(weapon.ammo) or 250) + end) + end + end + end + + return { success = true, playerOnline = true } + end + + if action == "setRoutingBucket" then + if not Helpers.hasFeaturePermission(src, "routingBucket") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local bucket = math.floor(clampNumber(payload.bucket, 0, getLimits().MaxRoutingBucket or 2147483647, 0)) + SetPlayerRoutingBucket(targetId, bucket) + return { success = true, playerOnline = true } + end + + if action == "setRadio" then + if not Helpers.hasFeaturePermission(src, "playerData") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local channel = math.floor(clampNumber(payload.channel, 0, getLimits().MaxRadioChannel or 10000, 0)) + TriggerClientEvent("esx-adminmenu:client:setRadioChannel", targetId, channel) + return { success = true, playerOnline = true } + end + + if action == "setJob" then + if not Helpers.hasFeaturePermission(src, "playerData") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local job = limitString(payload.job, 48) + local grade = math.floor(clampNumber(payload.grade, 0, 100, 0)) + + if job == "" or not job:match("^[%w_%-]+$") then + return { success = false, err = "Missing job name.", playerOnline = true } + end + + if ESX.DoesJobExist and not ESX.DoesJobExist(job, grade) then + return { success = false, err = "Invalid job or grade.", playerOnline = true } + end + + if not target.setJob then + return { success = false, err = "This ESX version does not expose setJob.", playerOnline = true } + end + + local ok, err = pcall(function() + target.setJob(job, grade) + end) + + if not ok then + return { success = false, err = err or "Failed to set job.", playerOnline = true } + end + + return { success = true, playerOnline = true } + end + + if action == "setName" then + if not Helpers.hasFeaturePermission(src, "playerData") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local firstName = trimString(payload.firstName) + local lastName = trimString(payload.lastName) + + firstName = limitString(firstName, 32) + lastName = limitString(lastName, 32) + + if firstName == "" or lastName == "" then + return { success = false, err = "Missing first or last name.", playerOnline = true } + end + + local identifier = getPlayerIdentifier(target, targetId) + if not identifier then + return { success = false, err = "Missing character identifier.", playerOnline = true } + end + + MySQL.update.await("UPDATE users SET firstname = ?, lastname = ? WHERE identifier = ?", { + firstName, + lastName, + identifier, + }) + + if target.setName then + pcall(function() + target.setName(firstName .. " " .. lastName) + end) + end + + return { success = true, playerOnline = true } + end + + if action == "setThirst" or action == "setHunger" then + if not Helpers.hasFeaturePermission(src, "playerData") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local statusName = action == "setThirst" and "thirst" or "hunger" + setStatusMeta(target, targetId, statusName, payload.amount) + return { success = true, playerOnline = true } + end + + if action == "aceAdd" or action == "aceRemove" then + if not Helpers.hasFeaturePermission(src, "acePermissions") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local group = normalizeAceGroup(payload.group or payload.permission) + if not group then + return { success = false, err = "Invalid ACE group.", playerOnline = true } + end + + local identifier = Helpers.getPlayerLicenseIdentifier(targetId) + if not isValidIdentifier(identifier) then + return { success = false, err = "Missing player identifier.", playerOnline = true } + end + + local command = action == "aceAdd" and "add_principal" or "remove_principal" + ExecuteCommand(("%s identifier.%s group.%s"):format(command, identifier, group)) + + return { success = true, playerOnline = true } + end + + if action == "troll" then + if not Helpers.hasFeaturePermission(src, "troll") then + return { success = false, err = "Insufficient Permissions", playerOnline = true } + end + + local trollAction = trimString(payload.trollAction) + local allowedTrollActions = Config.TrollActions or {} + if not allowedTrollActions[trollAction] then + return { success = false, err = "Invalid troll action.", playerOnline = true } + end + + TriggerClientEvent("esx-adminmenu:client:troll", targetId, trollAction) + return { success = true, playerOnline = true } + end + + return { success = false, err = "Unknown player action.", playerOnline = true } +end + +ESX.RegisterServerCallback("esx-adminmenu:server:playerAction", function(source, cb, data) + cb(Actions.PlayerAction(source, data)) +end) diff --git a/[esx_addons]/esx_adminmenu/server/ban_cache.lua b/[esx_addons]/esx_adminmenu/server/ban_cache.lua new file mode 100644 index 00000000..132a599c --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/ban_cache.lua @@ -0,0 +1,208 @@ +BanCache = {} +local translations +local bans = {} + +local function normalizeIdentifier(identifier) + if Helpers and Helpers.normalizeLicenseIdentifier then + return Helpers.normalizeLicenseIdentifier(identifier) or identifier + end + + if type(identifier) ~= "string" or identifier == "" then + return identifier + end + + if identifier:match("^license:[%w%-_]+$") then + return identifier + end + + if not identifier:find(":") and identifier:match("^[%w%-_]+$") then + return "license:" .. identifier + end + + return identifier +end + +local function normalizeTimestamp(value) + if Helpers and Helpers.normalizeTimestamp then + return Helpers.normalizeTimestamp(value) + end + + if value == nil or value == "" then + return nil + end + + if type(value) == "number" then + if value <= 0 then + return nil + end + + if value > 1e12 then + return math.floor(value / 1000) + end + + return math.floor(value) + end + + if type(value) == "string" then + value = value:match("^%s*(.-)%s*$") + if value == "" or value:find("^0000%-00%-00") then + return nil + end + + local numeric = tonumber(value) + if numeric then + return normalizeTimestamp(numeric) + end + + local year, month, day, hour, min, sec = value:match("^(%d%d%d%d)%-(%d%d)%-(%d%d)[ T](%d%d):(%d%d):(%d%d)") + if year then + local ok, timestamp = pcall(os.time, { + year = tonumber(year), + month = tonumber(month), + day = tonumber(day), + hour = tonumber(hour), + min = tonumber(min), + sec = tonumber(sec), + }) + + if ok and timestamp and timestamp > 0 then + return timestamp + end + end + end + + return nil +end + +function BanCache.load() + -- Clear existing cache for ex. command usage. + bans = {} + + local rows = MySQL.query.await("SELECT * FROM bans ORDER BY id ASC") + if not rows then + return + end + + for i = 1, #rows do + local ban = rows[i] + local identifier = normalizeIdentifier(ban.identifier) + ban.identifier = identifier + + if not bans[identifier] then + bans[identifier] = {} + end + + bans[identifier][#bans[identifier] + 1] = ban + end +end + +function BanCache.get(identifier) + identifier = normalizeIdentifier(identifier) + if not identifier then + return nil + end + + local list = bans[identifier] + if not list then + return nil + end + + local now = os.time() + + for i = #list, 1, -1 do + local ban = list[i] + + local expires = normalizeTimestamp(ban.expires_at) + + if expires and now >= expires then + table.remove(list, i) + else + if expires then + local remaining = expires - now + ban.remaining_seconds = remaining + ban.remaining_formatted = Helpers.formatRemainingTime(remaining) + else + ban.remaining_seconds = nil + ban.remaining_formatted = Helpers.getTranslation("permanent") + end + + return ban + end + end + + if #list == 0 then + bans[identifier] = nil + end + + return nil +end + +function BanCache.add(ban) + if not ban.banned_at then + ban.banned_at = os.time() + end + + ban.identifier = normalizeIdentifier(ban.identifier) + if not ban.identifier then + return + end + + if not bans[ban.identifier] then + bans[ban.identifier] = {} + end + + bans[ban.identifier][#bans[ban.identifier] + 1] = ban +end + +function BanCache.updateExpiry(identifier, newExpiry) + identifier = normalizeIdentifier(identifier) + if not identifier then + return + end + + local list = bans[identifier] + if not list then + return + end + + for i = #list, 1, -1 do + local ban = list[i] + ban.expires_at = newExpiry + return + end +end + +-- No need for this at the moment but in case the logic changes this might be useful. +function BanCache.expireNow(identifier) + identifier = normalizeIdentifier(identifier) + if not identifier then + return + end + + local list = bans[identifier] + if not list then + return + end + + local now = os.time() + + for i = #list, 1, -1 do + local ban = list[i] + ban.expires_at = now + end +end + +function BanCache.remove(identifier) + identifier = normalizeIdentifier(identifier) + if not identifier then + return + end + + bans[identifier] = nil +end + +function BanCache.getAll() + return bans +end + +return BanCache diff --git a/[esx_addons]/esx_adminmenu/server/commands.lua b/[esx_addons]/esx_adminmenu/server/commands.lua new file mode 100644 index 00000000..3c01c9d4 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/commands.lua @@ -0,0 +1,547 @@ +-- VEC2 +local allowedPermissions = Helpers.getAllowedPermissions() + +local function showActionError(result, showError) + if result and result.success then + return + end + + showError((result and result.err) or "Action failed.") +end + +ESX.RegisterCommand( + "vec2", + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + local coords = GetEntityCoords(ped) + + local text = string.format("vec2(%.2f, %.2f)", coords.x, coords.y) + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, text) + end, + false, + { + help = "Copy your current position as vec2(x, y)", + } +) + +-- VEC3 + +ESX.RegisterCommand( + "vec3", + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + local coords = GetEntityCoords(ped) + + local text = string.format("vec3(%.2f, %.2f, %.2f)", coords.x, coords.y, coords.z) + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, text) + end, + false, + { + help = "Copy your current position as vec3(x, y, z)", + } +) + +-- VEC4 + +ESX.RegisterCommand( + "vec4", + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + + local text = string.format("vec4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading) + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, text) + end, + false, + { + help = "Copy your current position as vec4(x, y, z, heading)", + } +) + +ESX.RegisterCommand( + "heading", + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, string.format("%.2f", GetEntityHeading(ped))) + end, + false, + { + help = "Copy your current heading.", + } +) + +ESX.RegisterCommand( + { "coords", "copycoords" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + local text = string.format("x = %.2f, y = %.2f, z = %.2f, heading = %.2f", coords.x, coords.y, coords.z, heading) + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, text) + end, + false, + { + help = "Copy your current coordinates and heading as fields.", + } +) + +ESX.RegisterCommand( + { "rot", "rotation" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + local rotation = GetEntityRotation(ped, 2) + local text = string.format("vec3(%.2f, %.2f, %.2f)", rotation.x, rotation.y, rotation.z) + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, text) + end, + false, + { + help = "Copy your current rotation as vec3(x, y, z).", + } +) + +ESX.RegisterCommand( + { "model", "entitymodel" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + if ped == 0 then + showError("Failed to get player ped.") + return + end + + local vehicle = GetVehiclePedIsIn(ped, false) + local entity = vehicle ~= 0 and vehicle or ped + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, tostring(GetEntityModel(entity))) + end, + false, + { + help = "Copy your current ped or vehicle model hash.", + } +) + +ESX.RegisterCommand( + { "vehplate", "copyplate" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "helperCommands") then + showError("You do not have permission to use this command.") + return + end + + local ped = GetPlayerPed(xPlayer.source) + local vehicle = GetVehiclePedIsIn(ped, false) + + if vehicle == 0 then + showError("You must be in a vehicle.") + return + end + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, ESX.Math.Trim(GetVehicleNumberPlateText(vehicle))) + end, + false, + { + help = "Copy the current vehicle plate.", + } +) + +ESX.RegisterCommand( + { "admin" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasPermission(xPlayer.source) then + showError("You do not have permission to open the admin menu.") + return + end + + TriggerClientEvent("esx-adminmenu:client:openAdminMenu", xPlayer.source) + end, + true, + { + help = "Opens the ESX Admin Menu", + } +) + +ESX.RegisterCommand( + { "information" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasPermission(xPlayer.source) then + showError("You do not have permission to open player information.") + return + end + + if not Helpers.isOnline(args.playerId) then + showError("Player is not online.") + return + end + + TriggerClientEvent("esx-adminmenu:client:openInformation", xPlayer.source, { + players = Helpers.getPlayerList(xPlayer.source) or {}, + selectedPlayerId = args.playerId, + serverData = Helpers.getServerData(), + }) + end, + true, + { + help = "Open the admin dashboard directly to a player's information panel.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + }, + } +) + +ESX.RegisterCommand( + { "refreshbans", "refreshbancache" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "banManagement") then + showError("You do not have permission to refresh the ban cache.") + return + end + BanCache.load() + end, + true, + { + help = "Refreshes the ban cache if manual changes were made to the database.", + } +) + +ESX.RegisterCommand( + { "admincar" }, + allowedPermissions, + function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + if not Helpers.hasPermission(xPlayer.source) then + showError("No permission.") + return + end + + if not Helpers.hasFeaturePermission(xPlayer.source, "vehicleOwnership") then + showError("You do not have permission to save admin vehicles.") + return + end + + local model = args and args.model or nil + if type(model) == "string" then + model = model:match("^%s*(.-)%s*$") + end + + local ped = GetPlayerPed(xPlayer.source) + local vehicle = GetVehiclePedIsIn(ped, false) + + if (not model or model == "") and (not vehicle or vehicle == 0) then + showError("You must be in a vehicle.") + return + end + + if (not model or model == "") and GetPedInVehicleSeat(vehicle, -1) ~= ped then + showError("You must be the driver.") + return + end + + local plate = model and model ~= "" and Helpers.generatePlate() or ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) + + if not plate or plate == "" or Helpers.isPlateTaken(plate) then + plate = Helpers.generatePlate() + end + + ESX.TriggerClientCallback(xPlayer.source, "esx-adminmenu:client:adminCarVehicleProps", function(props) + if not props then + showError("Failed to get vehicle properties.") + return + end + + if Helpers.isPlateTaken(plate) then + showError("Generated plate was already taken. Try again.") + return + end + + local currentVehicle = GetVehiclePedIsIn(ped, false) + if currentVehicle ~= 0 then + props.model = GetEntityModel(currentVehicle) + end + + if not props.model then + showError("Failed to validate vehicle model.") + return + end + + props.plate = plate + + MySQL.insert("INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)", { + xPlayer.getIdentifier(), + plate, + json.encode(props), + }, function() + Helpers.invalidateVehicles() + xPlayer.showNotification("Vehicle registered to you.") + end) + end, { + model = model, + plate = plate, + }) + end, + false, + { + help = "Spawn and own a vehicle, or register the vehicle you are driving.", + arguments = { + { name = "model", help = "Vehicle model to spawn (optional)", type = "string" }, + }, + } +) + +ESX.RegisterCommand({ "setmodel" }, allowedPermissions, function(xPlayer, args, showError) + if not xPlayer or xPlayer.source == 0 then + showError("Invalid player.") + return + end + + local result = Actions.PlayerAction(xPlayer.source, { + id = args.playerId, + action = "setModel", + payload = { + model = args.model, + }, + }) + + showActionError(result, showError) +end, true, { + help = "Change a player's model.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + { name = "model", help = "Model name", type = "string" }, + }, +}) + +-- ADMINISTRATION COMMANDS + +ESX.RegisterCommand({ "goto" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.Goto(xPlayer.source, { id = args.playerId }) + + showActionError(result, showError) +end, true, { + help = "Teleport to a player.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + }, +}) + +ESX.RegisterCommand({ "bring" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.Bring(xPlayer.source, { id = args.playerId }) + + showActionError(result, showError) +end, true, { + help = "Bring a player to you.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + }, +}) + +ESX.RegisterCommand({ "spectate" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.Spectate(xPlayer.source, { id = args.playerId }) + + showActionError(result, showError) +end, true, { + help = "Spectate a player.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + }, +}) + +ESX.RegisterCommand({ "stopspectate" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.StopSpectate(xPlayer.source) + + showActionError(result, showError) +end, true, { + help = "Stop spectating.", +}) + +ESX.RegisterCommand({ "kick" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.Kick(xPlayer.source, { + id = args.playerId, + reason = args.reason, + }) + + showActionError(result, showError) +end, true, { + help = "Kick a player.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + { name = "reason", help = "Reason for kick", type = "string" }, + }, +}) + +ESX.RegisterCommand({ "ban" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.Ban(xPlayer.source, { + id = args.playerId, + reason = args.reason, + duration = args.duration, + }) + + showActionError(result, showError) +end, true, { + help = "Ban a player.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + { name = "duration", help = "Duration in minutes", type = "number" }, + { name = "reason", help = "Reason for ban", type = "string" }, + }, +}) + +ESX.RegisterCommand({ "notify" }, allowedPermissions, function(xPlayer, args, showError) + local result = Actions.Notify(xPlayer.source, { + id = args.playerId, + notificationContent = args.message, + notificationType = args.type, + duration = args.duration, + notificationTitle = args.title, + }) + + showActionError(result, showError) +end, true, { + help = "Send a notification to a player.", + arguments = { + { name = "playerId", help = "Target player ID", type = "number" }, + { name = "message", help = "Notification message", type = "string" }, + { name = "type", help = "Notification type (info, error, success)", type = "string" }, + { name = "duration", help = "Duration in ms", type = "number" }, + { name = "title", help = "Notification title", type = "string" }, + }, +}) diff --git a/[esx_addons]/esx_adminmenu/server/database.lua b/[esx_addons]/esx_adminmenu/server/database.lua new file mode 100644 index 00000000..69f6a8c1 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/database.lua @@ -0,0 +1,67 @@ +-- Initiate the database if it already doesn't exist. +local function initDB() + -- BANS TABLE + MySQL.query.await([[ + CREATE TABLE IF NOT EXISTS bans ( + id INT AUTO_INCREMENT PRIMARY KEY, + identifier VARCHAR(64) NOT NULL, + reason TEXT, + banned_by VARCHAR(64), + expires_at DATETIME NULL, + banned_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + + INDEX idx_bans_identifier (identifier), + INDEX idx_bans_expires (expires_at) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + ]]) + + -- KICKS TABLE + MySQL.query.await([[ + CREATE TABLE IF NOT EXISTS kicks ( + id INT AUTO_INCREMENT PRIMARY KEY, + identifier VARCHAR(64) NOT NULL, + reason TEXT, + kicked_by VARCHAR(64), + kicked_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + + INDEX idx_kicks_identifier (identifier) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + ]]) + + local hasBannedAt = MySQL.scalar.await( + [[SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = 'bans' + AND COLUMN_NAME = 'banned_at']] + ) + + if tonumber(hasBannedAt) == 0 then + MySQL.query.await("ALTER TABLE bans ADD COLUMN banned_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP") + end + + MySQL.update.await([[ + UPDATE bans + SET banned_at = CURRENT_TIMESTAMP + WHERE banned_at IS NULL + OR CAST(banned_at AS CHAR) = '' + OR CAST(banned_at AS CHAR) = '0000-00-00 00:00:00' + ]]) + + MySQL.update.await([[ + UPDATE bans + SET identifier = CONCAT('license:', identifier) + WHERE identifier IS NOT NULL + AND identifier <> '' + AND identifier NOT LIKE '%:%' + ]]) + print("[esx-adminmenu] Database tables checked/created!") +end + +AddEventHandler("onResourceStart", function(resource) + if resource ~= GetCurrentResourceName() then + return + end + initDB() + BanCache.load() +end) diff --git a/[esx_addons]/esx_adminmenu/server/events.lua b/[esx_addons]/esx_adminmenu/server/events.lua new file mode 100644 index 00000000..4822bc8b --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/events.lua @@ -0,0 +1,36 @@ +AddEventHandler('playerConnecting', function(name, _, deferrals) + deferrals.defer() + + local src = source + deferrals.update('Checking your identifiers...') + + Wait(1000) + local identifier = Helpers.getPlayerLicenseIdentifier(src) + deferrals.update('Checking ban status...') + Wait(3000) + local ban = Helpers.isBanned(identifier) + Wait(1000) + if ban then + local message = Helpers.getTranslation('default_ban') + + if ban.reason then + message = message .. "\n" .. Helpers.getTranslation('reason').. " " .. ban.reason + end + + if ban.remaining_formatted then + message = message .. "\n" .. Helpers.getTranslation('duration') .. " " .. ban.remaining_formatted + end + + deferrals.done(message) + return + end + + deferrals.update(Helpers.getTranslation('finalizing_connection')) + Wait(100) + + deferrals.done() +end) + +AddEventHandler("playerDropped", function() + Helpers.addRecentPlayer(source) +end) diff --git a/[esx_addons]/esx_adminmenu/server/helpers.lua b/[esx_addons]/esx_adminmenu/server/helpers.lua new file mode 100644 index 00000000..6d20ffa4 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/helpers.lua @@ -0,0 +1,1010 @@ +Helpers = {} +local translations = nil +local allowedGroups = {} +local Spectators = {} +local impounds = nil +local vehicles = {} +local vehiclesFetchedAt = 0 +local MAX_VEHICLE_PAGE_SIZE = 100 +local MAX_BAN_PAGE_SIZE = 100 +local recentPlayers = {} +local MAX_RECENT_PLAYERS = 100 +local serverStartedAt = os.time() +local serverManagementConfig = Config.ServerManagement or {} +local serverEnvironment = { + weather = serverManagementConfig.DefaultWeather or "CLEAR", + hour = math.floor(tonumber(serverManagementConfig.DefaultHour) or 12), + minute = math.floor(tonumber(serverManagementConfig.DefaultMinute) or 0), + blackout = serverManagementConfig.DefaultBlackout == true, + pvp = serverManagementConfig.DefaultPvp ~= false, +} + +for group, allowed in pairs(Config.AllowedGroups) do + if allowed then + allowedGroups[#allowedGroups + 1] = group + end +end + +local function capitalize(str) + if type(str) ~= "string" or str == "" then return str end + return str:sub(1, 1):upper() .. str:sub(2) +end + +local function trim(str) + if type(str) ~= "string" then + return "" + end + + return str:match("^%s*(.-)%s*$") +end + +function Helpers.getFormattedPlayTime(playtime) + if playtime == 0 or playtime < 0 then + return 0 + end + local days = math.floor(playtime / 86400) + local hours = math.floor((playtime % 86400) / 3600) + local minutes = math.floor((playtime % 3600) / 60) + return { days = days, hours = hours, minutes = minutes } +end + +function Helpers.isOnline(source) + source = tonumber(source) + if not source then + return false + end + + return GetPlayerName(source) ~= nil +end + +function Helpers.isBanned(identifier) + local ban = BanCache.get(identifier) + if ban then + return ban + end + return nil +end + +function Helpers.getAllowedPermissions() + return allowedGroups +end + +function Helpers.getServerUptimeSeconds() + if GetGameTimer then + return math.floor(GetGameTimer() / 1000) + end + + return os.time() - serverStartedAt +end + +function Helpers.formatServerUptime(seconds) + local total = math.max(0, tonumber(seconds) or 0) + local days = math.floor(total / 86400) + local hours = math.floor((total % 86400) / 3600) + local minutes = math.floor((total % 3600) / 60) + + return ("%02d:%02d:%02d"):format(days, hours, minutes) +end + +function Helpers.setServerEnvironment(data) + data = data or {} + + if data.weather ~= nil then + serverEnvironment.weather = tostring(data.weather) + end + + if data.hour ~= nil then + serverEnvironment.hour = math.max(0, math.min(23, math.floor(tonumber(data.hour) or serverEnvironment.hour))) + end + + if data.minute ~= nil then + serverEnvironment.minute = math.max(0, + math.min(59, math.floor(tonumber(data.minute) or serverEnvironment.minute))) + end + + if data.blackout ~= nil then + serverEnvironment.blackout = data.blackout == true + end + + if data.pvp ~= nil then + serverEnvironment.pvp = data.pvp == true + end +end + +function Helpers.getServerEnvironment() + return { + weather = serverEnvironment.weather, + hour = serverEnvironment.hour, + minute = serverEnvironment.minute, + blackout = serverEnvironment.blackout, + pvp = serverEnvironment.pvp, + } +end + +function Helpers.getServerData() + local uptimeSeconds = Helpers.getServerUptimeSeconds() + + return { + currentPlayers = #GetPlayers(), + maxPlayers = GetConvarInt("sv_maxclients", 32), + uptimeSeconds = uptimeSeconds, + uptimeFormatted = Helpers.formatServerUptime(uptimeSeconds), + environment = Helpers.getServerEnvironment(), + } +end + +function Helpers.hasPermission(source) + local xPlayer = ESX.GetPlayerFromId(source) + if not xPlayer then + return false + end + + return Config.AllowedGroups[xPlayer.getGroup()] == true +end + +function Helpers.hasFeaturePermission(source, feature) + local xPlayer = ESX.GetPlayerFromId(source) + if not xPlayer then + return false + end + + local featurePermissions = Config.FeaturePermissions and Config.FeaturePermissions[feature] + if not featurePermissions then + return Helpers.hasPermission(source) + end + + return featurePermissions[xPlayer.getGroup()] == true +end + +function Helpers.normalizeLicenseIdentifier(identifier) + identifier = trim(identifier) + if identifier == "" or #identifier > 100 then + return nil + end + + local license = identifier:match("^license:([%w%-_]+)$") + if license then + return "license:" .. license + end + + if identifier:find(":") then + return nil + end + + if identifier:match("^[%w%-_]+$") then + return "license:" .. identifier + end + + return nil +end + +function Helpers.getPlayerLicenseIdentifier(source) + local identifiers = GetPlayerIdentifiers(source) or {} + + for i = 1, #identifiers do + local identifier = Helpers.normalizeLicenseIdentifier(identifiers[i]) + if identifier then + return identifier + end + end + + return Helpers.normalizeLicenseIdentifier(ESX.GetIdentifier(source)) +end + +local function getIdentifierMap(source) + local result = {} + local identifiers = GetPlayerIdentifiers(source) or {} + + for i = 1, #identifiers do + local identifier = identifiers[i] + local key = identifier:match("^([^:]+):") or ("identifier_" .. i) + + if result[key] then + key = ("%s_%d"):format(key, i) + end + + result[key] = identifier + end + + return result +end + +function Helpers.getPlayerRadioChannel(source) + local ok, state = pcall(function() + return Player(source).state + end) + + if not ok or not state then + return 0 + end + + return tonumber(state.radioChannel or state.radio or state.radio_channel or 0) or 0 +end + +function Helpers.getPlayerIdentifiers(source) + return getIdentifierMap(source) +end + +local function loadLastSeenFor(identifiers) + if #identifiers == 0 then + return {} + end + + local placeholders = {} + for i = 1, #identifiers do + placeholders[i] = "?" + end + + local rows = MySQL.query.await( + ("SELECT identifier, last_seen FROM users WHERE identifier IN (%s)"):format(table.concat(placeholders, ",")), + identifiers + ) + + local map = {} + for i = 1, #(rows or {}) do + map[rows[i].identifier] = rows[i].last_seen + end + + return map +end + +function Helpers.getPlayerList(viewerSource) + local players = {} + local identifiers = {} + local canSeeSensitive = viewerSource and Helpers.hasFeaturePermission(viewerSource, "sensitiveInfo") + + local xPlayers = ESX.ExtendedPlayers() + + -- One heavy numeric loop + for i = 1, #xPlayers do + local xPlayer = xPlayers[i] + local src = xPlayer.src + local full = ESX.GetPlayerFromId(src) + + local charIdentifier = full and full.identifier + if charIdentifier then + identifiers[#identifiers + 1] = charIdentifier + end + + local ped = GetPlayerPed(src) + local coords = xPlayer.getCoords(true) + local playtime = Helpers.getFormattedPlayTime(xPlayer.getPlayTime() or 0) + + local job = full and full.getJob() + local bank = full and full.getAccount("bank") + local black = full and full.getAccount("black_money") + players[#players + 1] = { + status = "online", + id = src, + name = xPlayer.getName(), + is_staff = Config.AllowedGroups[xPlayer.getGroup()] == true, + group = canSeeSensitive and xPlayer.getGroup() or nil, + + cash = xPlayer.getMoney(), + bank = bank and bank.money or 0, + alt_money = black and black.money or 0, + + health = ped ~= 0 and math.floor(GetEntityHealth(ped) - 100) or 0, + armor = ped ~= 0 and GetPedArmour(ped) or 0, + + char_identifier = canSeeSensitive and charIdentifier or nil, + identifier = canSeeSensitive and Helpers.getPlayerLicenseIdentifier(src) or nil, + ip = canSeeSensitive and GetPlayerEndpoint(src) or nil, + identifiers = canSeeSensitive and getIdentifierMap(src) or nil, + routing_bucket = GetPlayerRoutingBucket(src), + radio_channel = Helpers.getPlayerRadioChannel(src), + + job = job and job.name or "unemployed", + job_grade = job and job.grade_label or "", + + gender = full and full.variables.sex or "m", + + play_time = playtime, + position = coords and { x = coords.x, y = coords.y, z = coords.z } or nil, + } + end + + -- Single DB query + local lastSeenMap = loadLastSeenFor(identifiers) + + -- One light numeric loop for adding the last_seen's after getting all the current xPlayer identifiers. + for i = 1, #players do + local id = players[i].char_identifier + players[i].last_join = id and lastSeenMap[id] or nil + end + + return players +end + +local function upsertRecentPlayer(player) + if not player or not player.identifier then + return + end + + for i = #recentPlayers, 1, -1 do + if recentPlayers[i].identifier == player.identifier then + table.remove(recentPlayers, i) + end + end + + table.insert(recentPlayers, 1, player) + + while #recentPlayers > MAX_RECENT_PLAYERS do + table.remove(recentPlayers) + end +end + +function Helpers.addRecentPlayer(source) + local xPlayer = ESX.GetPlayerFromId(source) + if not xPlayer then + return + end + + local ped = GetPlayerPed(source) + local job = xPlayer.getJob and xPlayer.getJob() or nil + local bank = xPlayer.getAccount and xPlayer.getAccount("bank") or nil + local black = xPlayer.getAccount and xPlayer.getAccount("black_money") or nil + + upsertRecentPlayer({ + status = "offline", + id = nil, + name = xPlayer.getName and xPlayer.getName() or GetPlayerName(source) or "Unknown", + cash = xPlayer.getMoney and xPlayer.getMoney() or 0, + bank = bank and bank.money or 0, + alt_money = black and black.money or 0, + health = ped ~= 0 and math.floor(GetEntityHealth(ped) - 100) or 0, + armor = ped ~= 0 and GetPedArmour(ped) or 0, + char_identifier = xPlayer.identifier, + identifier = Helpers.getPlayerLicenseIdentifier(source), + job = job and job.name or "unemployed", + job_grade = job and (job.grade_label or job.grade_name or tostring(job.grade)) or "", + gender = xPlayer.variables and xPlayer.variables.sex or "m", + play_time = Helpers.getFormattedPlayTime(xPlayer.getPlayTime and xPlayer.getPlayTime() or 0), + last_join = os.time(), + }) +end + +function Helpers.getRecentPlayers(viewerSource) + if Helpers.hasFeaturePermission(viewerSource, "sensitiveInfo") then + return recentPlayers + end + + local sanitized = {} + for i = 1, #recentPlayers do + local player = {} + + for key, value in pairs(recentPlayers[i]) do + if key ~= "identifier" and key ~= "char_identifier" and key ~= "identifiers" and key ~= "ip" then + player[key] = value + end + end + + sanitized[#sanitized + 1] = player + end + + return sanitized +end + +function Helpers.startSpectate(adminSrc, targetSrc) + Spectators[adminSrc] = targetSrc +end + +function Helpers.stopSpectate(adminSrc) + Spectators[adminSrc] = nil +end + +function Helpers.getSpectateTarget(adminSrc) + return Spectators[adminSrc] +end + +function Helpers.getSpectators() + return Spectators +end + +function Helpers.getTranslations() + if not translations then + local keys = { + "admin_menu", + "admin_dashboard", + "dashboard_home", + "dashboard_snapshot", + "admin_menu_desc", + "quick_admin_menu", + "quick_actions", + "open_admin_dashboard", + "open_admin_menu", + "admin_menu_self", + "admin_menu_vehicle", + "admin_menu_utility", + "search_anything", + "server_online", + "server_uptime", + "players", + "search_player", + "search_vehicle", + "search_banned_identifier", + "player_management", + "players_list", + "vehicles_list", + "player_search", + "recent_players", + "no_players_found", + "bans_list", + + "id", + "name", + "money", + "total_money", + "avg_money", + "avg_money_per_player", + "active_staff", + "non_staff", + "available_slots", + "money_distribution", + "economy_summary", + "median_money", + "richest_player", + "avg_money_breakdown", + "health_distribution", + "avg_health", + "avg_armor", + "player_counts", + "player_condition", + "staff_overview", + "active_player_job_distribution", + "top_jobs", + "wealth_bands", + "bank_money", + "black_money", + "health", + "armor", + "last_visited", + "gender", + "male", + "female", + "job", + "job_grade", + "identifier", + "ip_address", + "char_identifier", + "play_time", + "position", + "identifiers", + "routing_bucket", + "radio_channel", + "thirst", + "hunger", + + "player_information", + "information", + "teleport", + "bring", + "spectate", + "notify_player", + "notification_message", + "give_money", + "take_money", + "set_health", + "set_armor", + "clean_inventory", + "player_tools", + "kill_player", + "revive_player", + "freeze_player", + "unfreeze_player", + "set_model", + "open_clothing", + "give_all_weapons", + "set_bucket", + "set_radio", + "set_job", + "set_name", + "set_thirst", + "set_hunger", + "ace_add", + "ace_remove", + "model_name", + "ace_group", + "first_name", + "last_name", + "delete_character", + "troll_options", + "troll_burn", + "troll_explode", + "troll_sky", + "troll_random", + "troll_nausea", + "noclip", + "show_names", + "show_blips", + "godmode", + "invisible", + "infinite_ammo", + "revive", + "heal", + "spawn_vehicle", + "vehicle_spawner", + "vehicle_model", + "vehicle_color", + "primary_color", + "secondary_color", + "customize_vehicle", + "customize_vehicle_hint", + "spawn_tuned", + "engine_level", + "brake_level", + "transmission_level", + "suspension_level", + "vehicle_armor", + "turbo", + "xenon_lights", + "neon_lights", + "neon_color", + "window_tint", + "wheel_category", + "wheel_design", + "bulletproof_tires", + "apply_performance", + "apply_customization", + "max_performance", + "repair_vehicle", + "clean_vehicle", + "flip_vehicle", + "teleport_waypoint", + "copy_coords", + "delete_current_vehicle", + "quick_menu_hint", + "quick_menu_edit_hint", + "back", + "kick", + "ban", + "never", + "copied_to_clipboard", + "online", + "offline", + "on", + "off", + "player", + "reason", + "kick_reason_placeholder", + "ban_reason_placeholder", + "duration", + "minutes", + "hours", + "days", + "months", + "years", + "permanent", + "duration_desc", + "cancel", + "confirm", + "escape_spectate", + "default_ban", + "finalizing_connection", + + "banned_by", + "banned_at", + "expires_at", + "change_expiry", + "revoke", + "new_expiry_date", + + "plate", + "owner", + "vehicle_name", + "vehicle_type", + "mileage", + "impounded", + "copy_plate", + "copy_owner", + "impound", + "unimpound", + "delete_vehicle", + "select_impound" + } + translations = {} + + for i = 1, #keys do + local key = keys[i] + translations[key] = Translate(key) + end + end + + return translations +end + +function Helpers.getTranslation(key) + if not key then + return "missing_key" + end + if translations == nil then + Helpers.getTranslations() + end + return translations[key] or key +end + +function Helpers.getAllVehicles() + -- Return if vehicles has been cached within 20 seconds. + if vehiclesFetchedAt ~= 0 and (os.time() - vehiclesFetchedAt) < 20 then + return vehicles + end + + local rows = MySQL.query.await("SELECT owner, plate, vehicle, stored, pound, type FROM owned_vehicles") + if not rows then return vehicles end + + -- clear existing cache instead of reassigning (important if referenced elsewhere) + for k in pairs(vehicles) do + vehicles[k] = nil + end + + for i = 1, #rows do + local v = rows[i] + + local vehicleProps = {} + if v.vehicle then + local ok, decoded = pcall(json.decode, v.vehicle) + if ok and type(decoded) == "table" then + vehicleProps = decoded + end + end + + local vehicleHash = tonumber(vehicleProps.model) + if not vehicleHash then + goto continue + end + + vehicles[#vehicles + 1] = { + plate = v.plate, + owner = v.owner, + model = vehicleHash, + type = capitalize(v.type or 'car'), + stored = v.stored == 1 or v.stored == "1" or v.stored == true, + impounded = v.pound ~= nil, + } + + ::continue:: + end + + vehiclesFetchedAt = os.time() + return vehicles +end + +function Helpers.invalidateVehicles() + for k in pairs(vehicles) do + vehicles[k] = nil + end + + vehiclesFetchedAt = 0 +end + +local function decodeVehicleProps(rawVehicle) + if not rawVehicle then + return {} + end + + local ok, decoded = pcall(json.decode, rawVehicle) + if ok and type(decoded) == "table" then + return decoded + end + + return {} +end + +local function toVehicleRecord(row) + local vehicleProps = decodeVehicleProps(row.vehicle) + local vehicleHash = tonumber(vehicleProps.model) + + if not vehicleHash then + return nil + end + + return { + plate = row.plate, + owner = row.owner, + model = vehicleHash, + type = capitalize(row.type or "car"), + stored = row.stored == 1 or row.stored == "1" or row.stored == true, + impounded = row.pound ~= nil, + impoundName = row.pound, + } +end + +function Helpers.getVehiclesPage(data) + data = data or {} + + local limit = tonumber(data.limit) or MAX_VEHICLE_PAGE_SIZE + limit = math.max(1, math.min(limit, MAX_VEHICLE_PAGE_SIZE)) + + local offset = tonumber(data.offset) or 0 + offset = math.max(0, offset) + + local search = trim(data.search):sub(1, 64) + local params = {} + local where = "" + + if search ~= "" then + local pattern = "%" .. search .. "%" + where = " WHERE plate LIKE ? OR owner LIKE ? OR type LIKE ?" + params[#params + 1] = pattern + params[#params + 1] = pattern + params[#params + 1] = pattern + end + + params[#params + 1] = limit + 1 + params[#params + 1] = offset + + local rows = MySQL.query.await( + ("SELECT owner, plate, vehicle, stored, pound, type FROM owned_vehicles%s ORDER BY plate ASC LIMIT ? OFFSET ?") + :format(where), + params + ) + + local result = {} + local rowCount = #(rows or {}) + local count = math.min(rowCount, limit) + + for i = 1, count do + local vehicle = toVehicleRecord(rows[i]) + + if vehicle then + result[#result + 1] = vehicle + end + end + + return { + vehicles = result, + hasMore = rowCount > limit, + nextOffset = offset + count, + limit = limit, + } +end + +local function normalizeTimestamp(value) + if value == nil or value == "" then + return nil + end + + if type(value) == "number" then + if value <= 0 then + return nil + end + + if value > 1e12 then + return math.floor(value / 1000) + end + + return math.floor(value) + end + + if type(value) == "string" then + value = trim(value) + if value == "" or value:find("^0000%-00%-00") then + return nil + end + + local numeric = tonumber(value) + if numeric then + return normalizeTimestamp(numeric) + end + + local year, month, day, hour, min, sec = value:match("^(%d%d%d%d)%-(%d%d)%-(%d%d)[ T](%d%d):(%d%d):(%d%d)") + if not year then + return nil + end + + local ok, timestamp = pcall(os.time, { + year = tonumber(year), + month = tonumber(month), + day = tonumber(day), + hour = tonumber(hour), + min = tonumber(min), + sec = tonumber(sec), + }) + + if ok and timestamp and timestamp > 0 then + return timestamp + end + end + + return nil +end + +function Helpers.normalizeTimestamp(value) + return normalizeTimestamp(value) +end + +local function toMilliseconds(seconds) + seconds = normalizeTimestamp(seconds) + return seconds and (seconds * 1000) or nil +end + +local function normalizeBanRecord(ban, now) + local expires = normalizeTimestamp(ban.expires_at) + local bannedAt = normalizeTimestamp(ban.banned_at) + local normalized = {} + + for key, value in pairs(ban) do + normalized[key] = value + end + + normalized.banned_at = toMilliseconds(bannedAt) + normalized.expires_at = toMilliseconds(expires) + + if expires then + local remaining = math.max(0, expires - now) + normalized.remaining_seconds = remaining + normalized.remaining_formatted = Helpers.formatRemainingTime(remaining) + else + normalized.remaining_seconds = nil + normalized.remaining_formatted = Helpers.getTranslation("permanent") + end + + return normalized, expires +end + +function Helpers.formatRemainingTime(seconds) + local yearSeconds = 60 * 60 * 24 * 365 + local weekSeconds = 60 * 60 * 24 * 7 + local daySeconds = 60 * 60 * 24 + local hourSeconds = 60 * 60 + local minuteSeconds = 60 + + local years = math.floor(seconds / yearSeconds) + seconds = seconds % yearSeconds + + local weeks = math.floor(seconds / weekSeconds) + seconds = seconds % weekSeconds + + local days = math.floor(seconds / daySeconds) + seconds = seconds % daySeconds + + local hours = math.floor(seconds / hourSeconds) + seconds = seconds % hourSeconds + + local minutes = math.floor(seconds / minuteSeconds) + + local parts = {} + + if years > 0 then + table.insert(parts, years .. "y") + end + if weeks > 0 then + table.insert(parts, weeks .. "w") + end + if days > 0 then + table.insert(parts, days .. "d") + end + if hours > 0 then + table.insert(parts, hours .. "h") + end + if minutes > 0 then + table.insert(parts, minutes .. "m") + end + if #parts == 0 then + table.insert(parts, "<1m") + end + + return table.concat(parts, ", ") +end + +function Helpers.getActiveBans() + local all = BanCache.getAll() + if not all then + return {} + end + + local now = os.time() + local result = {} + + for identifier, list in pairs(all) do + for i = #list, 1, -1 do + local ban = list[i] + + local normalized, expires = normalizeBanRecord(ban, now) + + if expires and now >= expires then + table.remove(list, i) + else + result[#result + 1] = normalized + end + end + + if #list == 0 then + all[identifier] = nil + end + end + + return result +end + +function Helpers.getActiveBansPage(data) + data = data or {} + + local limit = tonumber(data.limit) or MAX_BAN_PAGE_SIZE + limit = math.max(1, math.min(limit, MAX_BAN_PAGE_SIZE)) + + local offset = tonumber(data.offset) or 0 + offset = math.max(0, offset) + + local bans = Helpers.getActiveBans() + table.sort(bans, function(a, b) + return (tonumber(a.id) or 0) > (tonumber(b.id) or 0) + end) + + local result = {} + local lastIndex = math.min(#bans, offset + limit) + + for i = offset + 1, lastIndex do + result[#result + 1] = bans[i] + end + + return { + bans = result, + hasMore = lastIndex < #bans, + nextOffset = lastIndex, + limit = limit, + } +end + +local NumberCharset, Charset = {}, {} + +for i = 48, 57 do + NumberCharset[#NumberCharset + 1] = string.char(i) +end +for i = 65, 90 do + Charset[#Charset + 1] = string.char(i) +end + +math.randomseed(os.time()) + +local function getRandomNumber(length) + if length <= 0 then + return "" + end + return getRandomNumber(length - 1) .. NumberCharset[math.random(#NumberCharset)] +end + +local function getRandomLetter(length) + if length <= 0 then + return "" + end + return getRandomLetter(length - 1) .. Charset[math.random(#Charset)] +end + +function Helpers.isPlateTaken(plate) + return MySQL.scalar.await("SELECT 1 FROM owned_vehicles WHERE plate = ? LIMIT 1", { plate }) ~= nil +end + +function Helpers.generatePlate() + local plateConfig = Config.Plate or {} + local letters = tonumber(plateConfig.Letters) or 3 + local numbers = tonumber(plateConfig.Numbers) or 3 + local separator = plateConfig.UseSpace == false and "" or " " + + for _ = 1, 50 do + local generatedPlate = string.upper(getRandomLetter(letters) .. separator .. getRandomNumber(numbers)) + + if #generatedPlate > 8 then + generatedPlate = generatedPlate:sub(1, 8) + end + + if not Helpers.isPlateTaken(generatedPlate) then + return generatedPlate + end + end + + return string.upper(getRandomLetter(letters) .. separator .. getRandomNumber(numbers)):sub(1, 8) +end + +function Helpers.getImpounds() + if not impounds then + local ok, result = pcall(function() + return exports["esx_garage"]:getImpounds() + end) + + impounds = ok and result or {} + end + return impounds +end + +return Helpers diff --git a/[esx_addons]/esx_adminmenu/server/main.lua b/[esx_addons]/esx_adminmenu/server/main.lua new file mode 100644 index 00000000..f49f5c1a --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/main.lua @@ -0,0 +1,286 @@ +ESX.RegisterServerCallback("esx-adminmenu:server:getInitData", function(source, cb) + if not Helpers.hasPermission(source) then + cb({ error = "Insufficient Permissions." }) + return + end + + local translations = Helpers.getTranslations() + local impounds = Helpers.getImpounds() + local vehicleConfig = Config.VehicleSpawner or {} + + cb({ + translations = translations, -- can be empty safely + serverData = Helpers.getServerData(), + impounds = impounds, + vehicleConfig = { + defaultModel = vehicleConfig.DefaultModel or "sultan", + defaultColor = vehicleConfig.DefaultColor or "black", + colorPresets = vehicleConfig.ColorPresets or {}, + neonPresets = vehicleConfig.NeonPresets or {}, + windowTints = vehicleConfig.WindowTints or {}, + wheelCategories = vehicleConfig.WheelCategories or {}, + wheelDesigns = vehicleConfig.WheelDesigns or {}, + }, + }) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:canOpen", function(source, cb) + if not Helpers.hasPermission(source) then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + cb({ + success = true, + serverData = Helpers.getServerData(), + }) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:canUseAdminAction", function(source, cb, data) + if not Helpers.hasPermission(source) then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + local action = type(data) == "table" and data.action or data + if type(action) ~= "string" or action == "" then + cb({ success = false, err = "Invalid admin action." }) + return + end + + local actionPermissions = Config.AdminMenu and Config.AdminMenu.ActionPermissions or {} + local feature = actionPermissions[action] + + if not feature then + cb({ success = false, err = "Invalid admin action." }) + return + end + + if feature and not Helpers.hasFeaturePermission(source, feature) then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + cb({ + success = true, + serverData = Helpers.getServerData(), + }) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:openDashboard", function(source, cb) + if not Helpers.hasPermission(source) then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + cb({ + success = true, + players = Helpers.getPlayerList(source) or {}, + serverData = Helpers.getServerData(), + }) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:getVehicles", function(source, cb, data) + if not Helpers.hasPermission(source) then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + local result = Helpers.getVehiclesPage(data) + result.success = true + + cb(result) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:getBans", function(source, cb, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + local result = Helpers.getActiveBansPage(data) + result.success = true + + cb(result) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:getRecentPlayers", function(source, cb) + if not Helpers.hasPermission(source) then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + cb({ + success = true, + players = Helpers.getRecentPlayers(source), + }) +end) + +ESX.RegisterServerCallback("esx-adminmenu:server:getRadioChannelPlayers", function(source, cb, data) + if not Helpers.hasFeaturePermission(source, "radioLookup") then + cb({ success = false, err = "Insufficient Permissions." }) + return + end + + local channel = tonumber(data and data.channel) or 0 + if channel <= 0 then + cb({ success = false, err = "Enter a valid radio channel." }) + return + end + + local players = {} + local canSeeSensitive = Helpers.hasFeaturePermission(source, "sensitiveInfo") + + for _, playerSource in ipairs(GetPlayers()) do + local targetId = tonumber(playerSource) + + if targetId and Helpers.getPlayerRadioChannel(targetId) == channel then + local xPlayer = ESX.GetPlayerFromId(targetId) + + players[#players + 1] = { + id = targetId, + name = xPlayer and xPlayer.getName() or GetPlayerName(targetId) or "Unknown", + char_identifier = canSeeSensitive and xPlayer and xPlayer.identifier or nil, + } + end + end + + cb({ success = true, players = players }) +end) + +local MAX_RESULTS = 25 + +ESX.RegisterServerCallback("esx-adminmenu:server:searchOfflinePlayer", function(source, cb, data) + local src = source + + if not Helpers.hasPermission(src) then + cb({ err = "Insufficient Permissions" }) + return + end + + local canSeeSensitive = Helpers.hasFeaturePermission(src, "sensitiveInfo") + + if not data or type(data.identifier) ~= "string" then + cb({ players = {} }) + return + end + + local inputIdentifier = data.identifier:match("^%s*(.-)%s*$") + if inputIdentifier == "" then + cb({ players = {} }) + return + end + + if #inputIdentifier > 100 then + cb({ players = {} }) + return + end + + local function getBase(identifier) + local base = identifier:match("^[^:]+:(.+)$") + if not base or base == "" then + return nil + end + if #base < 5 or #base > 80 then + return nil + end + return base + end + + local rows + + -- LICENSE SEARCH (In cases of license identifier being inputted) + if inputIdentifier:match("^license:[%w%-_]+$") then + local base = getBase(inputIdentifier) + if not base then + cb({ players = {} }) + return + end + + rows = MySQL.query.await( + [[SELECT identifier, firstname, lastname, sex, job, job_grade, accounts, metadata, last_seen + FROM users + WHERE SUBSTRING_INDEX(identifier, ':', -1) = ? + LIMIT ?]], + { base, MAX_RESULTS + 1 } + ) + + -- CHAR SEARCH (In cases of char identifier being inputted) + elseif inputIdentifier:match("^char%d+:[%w%-_]+$") then + rows = MySQL.query.await( + [[SELECT identifier, firstname, lastname, sex, job, job_grade, accounts, metadata, last_seen + FROM users + WHERE identifier = ? + LIMIT ?]], + { inputIdentifier, MAX_RESULTS + 1 } + ) + else + cb({ players = {} }) + return + end + + if not rows or #rows == 0 then + cb({ players = {} }) + return + end + + local players = {} + + for i = 1, #rows do + if #players >= MAX_RESULTS then + break + end + + local r = rows[i] + + local base = getBase(r.identifier) + if not base then + goto continue + end + + local accounts = {} + if r.accounts then + local ok, decoded = pcall(json.decode, r.accounts) + if ok and type(decoded) == "table" then + accounts = decoded + end + end + + local metadata = {} + if r.metadata then + local ok, decoded = pcall(json.decode, r.metadata) + if ok and type(decoded) == "table" then + metadata = decoded + end + end + + local health = metadata.health and metadata.health - 100 or 0 + local armor = metadata and metadata.armor or 0 + local playTime = Helpers.getFormattedPlayTime(metadata and metadata.lastPlaytime or 0) + + players[#players + 1] = { + status = "offline", + id = nil, + name = (r.firstname or "") .. " " .. (r.lastname or ""), + + cash = tonumber(accounts.money) or 0, + bank = tonumber(accounts.bank) or 0, + alt_money = tonumber(accounts.black_money) or 0, + + health = health, + armor = armor, + + char_identifier = canSeeSensitive and r.identifier or nil, + identifier = canSeeSensitive and ("license:" .. base) or nil, + + play_time = playTime, + gender = r.sex == "m" and "m" or "f", + job = r.job, + job_grade = r.job_grade, + last_join = r.last_seen, + } + ::continue:: + end + + cb({ players = players }) +end) diff --git a/[esx_addons]/esx_adminmenu/shared/config.lua b/[esx_addons]/esx_adminmenu/shared/config.lua new file mode 100644 index 00000000..9a2e410d --- /dev/null +++ b/[esx_addons]/esx_adminmenu/shared/config.lua @@ -0,0 +1,349 @@ +Config = {} + +-- Enables extra debug prints +Config.Debug = false + +-- ESX permission groups allowed +Config.AllowedGroups = { + admin = true, +} + +Config.FeaturePermissions = { + sensitiveInfo = { + admin = true, + }, + destructive = { + admin = true, + }, + troll = { + admin = true, + }, + selfTools = { + admin = true, + }, + playerVisibility = { + admin = true, + }, + vehicleTools = { + admin = true, + }, + vehicleSpawner = { + admin = true, + }, + vehiclePerformance = { + admin = true, + }, + infiniteAmmo = { + admin = true, + }, + helperCommands = { + admin = true, + }, + playerTeleport = { + admin = true, + }, + playerModeration = { + admin = true, + }, + spectate = { + admin = true, + }, + playerNotify = { + admin = true, + }, + banManagement = { + admin = true, + }, + money = { + admin = true, + }, + vehicleManagement = { + admin = true, + }, + vehicleDestructive = { + admin = true, + }, + serverManagement = { + admin = true, + }, + serverEnvironment = { + admin = true, + }, + serverPlayerModeration = { + admin = true, + }, + serverPlayerDestructive = { + admin = true, + }, + serverCleanup = { + admin = true, + }, + serverBroadcast = { + admin = true, + }, + serverEconomy = { + admin = true, + }, + radioLookup = { + admin = true, + }, + playerData = { + admin = true, + }, + acePermissions = { + admin = true, + }, + weapons = { + admin = true, + }, + routingBucket = { + admin = true, + }, + setModel = { + admin = true, + }, + openClothing = { + admin = true, + }, + vehicleOwnership = { + admin = true, + }, +} + +Config.Locale = "en" + +Config.Keybinds = { + AdminMenu = "F9", + AdminDashboard = "F10", +} + +Config.AdminMenu = { + NoClipSpeed = 1.5, + NamesDistance = 75.0, + ActionPermissions = { + noclip = "selfTools", + names = "playerVisibility", + blips = "playerVisibility", + godmode = "selfTools", + invisible = "selfTools", + infiniteAmmo = "infiniteAmmo", + revive = "selfTools", + heal = "selfTools", + armor = "selfTools", + waypoint = "selfTools", + spawnVehicle = "vehicleSpawner", + repairVehicle = "vehicleTools", + cleanVehicle = "vehicleTools", + flipVehicle = "vehicleTools", + engineLevel = "vehiclePerformance", + brakeLevel = "vehiclePerformance", + transmissionLevel = "vehiclePerformance", + suspensionLevel = "vehiclePerformance", + armorLevel = "vehiclePerformance", + turbo = "vehiclePerformance", + xenon = "vehiclePerformance", + neon = "vehiclePerformance", + colorCycle = "vehiclePerformance", + neonColorCycle = "vehiclePerformance", + windowTint = "vehiclePerformance", + wheelCategory = "vehiclePerformance", + wheelDesign = "vehiclePerformance", + bulletproofTires = "vehiclePerformance", + customizeVehicle = "vehiclePerformance", + maxPerformance = "vehiclePerformance", + deleteVehicle = "vehicleDestructive", + copyCoords = "helperCommands", + }, +} + +Config.VehicleSpawner = { + DefaultModel = "sultan", + DeleteCurrentVehicleOnSpawn = true, + WarpIntoVehicle = true, + DefaultColor = "black", + ColorPresets = { + { id = "black", label = "Black", primary = 0, secondary = 0 }, + { id = "white", label = "White", primary = 111, secondary = 111 }, + { id = "silver", label = "Silver", primary = 4, secondary = 4 }, + { id = "red", label = "Red", primary = 27, secondary = 27 }, + { id = "orange", label = "Orange", primary = 38, secondary = 38 }, + { id = "yellow", label = "Yellow", primary = 88, secondary = 88 }, + { id = "green", label = "Green", primary = 55, secondary = 55 }, + { id = "blue", label = "Blue", primary = 64, secondary = 64 }, + { id = "purple", label = "Purple", primary = 145, secondary = 145 }, + }, + NeonPresets = { + { id = "white", label = "White", r = 255, g = 255, b = 255 }, + { id = "orange", label = "Orange", r = 251, g = 155, b = 4 }, + { id = "red", label = "Red", r = 255, g = 32, b = 32 }, + { id = "green", label = "Green", r = 32, g = 255, b = 96 }, + { id = "blue", label = "Blue", r = 32, g = 128, b = 255 }, + { id = "purple", label = "Purple", r = 180, g = 72, b = 255 }, + }, + WindowTints = { + { id = 0, label = "None" }, + { id = 1, label = "Pure Black" }, + { id = 2, label = "Dark Smoke" }, + { id = 3, label = "Light Smoke" }, + { id = 4, label = "Stock" }, + { id = 5, label = "Limo" }, + { id = 6, label = "Green" }, + }, + WheelCategories = { + { id = "sport", label = "Sport", type = 0 }, + { id = "muscle", label = "Muscle", type = 1 }, + { id = "lowrider", label = "Lowrider", type = 2 }, + { id = "suv", label = "SUV", type = 3 }, + { id = "offroad", label = "Offroad", type = 4 }, + { id = "tuner", label = "Tuner", type = 5 }, + { id = "bike", label = "Bike", type = 6 }, + { id = "highend", label = "High End", type = 7 }, + { id = "street", label = "Street", type = 11 }, + { id = "track", label = "Track", type = 12 }, + }, + WheelDesigns = { + { id = -1, label = "Stock" }, + { id = 0, label = "1" }, + { id = 1, label = "2" }, + { id = 2, label = "3" }, + { id = 3, label = "4" }, + { id = 4, label = "5" }, + { id = 5, label = "6" }, + { id = 6, label = "7" }, + { id = 7, label = "8" }, + { id = 8, label = "9" }, + { id = 9, label = "10" }, + { id = 10, label = "11" }, + { id = 11, label = "12" }, + { id = 12, label = "13" }, + { id = 13, label = "14" }, + { id = 14, label = "15" }, + { id = 15, label = "16" }, + { id = 16, label = "17" }, + { id = 17, label = "18" }, + { id = 18, label = "19" }, + { id = 19, label = "20" }, + }, +} + +Config.ServerManagement = { + DefaultKickReason = "Kicked by admin", + DefaultWeather = "CLEAR", + DefaultHour = 12, + DefaultMinute = 0, + DefaultBlackout = false, + DefaultPvp = true, + WeatherTypes = { + CLEAR = true, + EXTRASUNNY = true, + CLOUDS = true, + OVERCAST = true, + RAIN = true, + THUNDER = true, + FOGGY = true, + XMAS = true, + }, + ActionPermissions = { + weather = "serverEnvironment", + time = "serverEnvironment", + blackout = "serverEnvironment", + pvp = "serverEnvironment", + freezeAll = "serverPlayerModeration", + unfreezeAll = "serverPlayerModeration", + bringAll = "serverPlayerModeration", + reviveAll = "serverPlayerModeration", + kickAll = "serverPlayerDestructive", + killAll = "serverPlayerDestructive", + deleteVehicles = "serverCleanup", + deletePeds = "serverCleanup", + deleteObjects = "serverCleanup", + notifyAll = "serverBroadcast", + giveMoneyAll = "serverEconomy", + }, +} + +Config.PlayerActions = { + ActionPermissions = { + giveMoney = "money", + takeMoney = "money", + setHealth = "playerModeration", + setArmor = "playerModeration", + cleanInventory = "playerData", + killPlayer = "playerModeration", + revivePlayer = "playerModeration", + freezePlayer = "playerModeration", + setModel = "setModel", + openClothing = "openClothing", + giveAllWeapons = "weapons", + setRoutingBucket = "routingBucket", + setRadio = "playerData", + setJob = "playerData", + setName = "playerData", + setThirst = "playerData", + setHunger = "playerData", + aceAdd = "acePermissions", + aceRemove = "acePermissions", + troll = "troll", + deleteCharacter = "destructive", + }, +} + +Config.AdminLimits = { + MaxReasonLength = 180, + MaxNotificationLength = 240, + MaxNotificationDuration = 30000, + MaxBanDurationMinutes = 2628000, -- 5 years + MaxMoneyAmount = 10000000, + MaxRoutingBucket = 2147483647, + MaxRadioChannel = 10000, + AllowedMoneyAccounts = { + money = true, + bank = true, + black_money = true, + }, + AllowedNotificationTypes = { + info = true, + success = true, + error = true, + }, +} + +Config.Plate = { + Letters = 3, + Numbers = 3, + UseSpace = true, +} + +Config.Clothing = { + Events = { + "esx_skin:openSaveableMenu", + }, +} + +Config.Revive = { + Events = { + "esx_ambulancejob:revive", + }, + UseNativeFallback = true, + NativeFallbackDelay = 250, +} + +Config.AdminWeapons = { + { name = "WEAPON_PISTOL", ammo = 250 }, + { name = "WEAPON_COMBATPISTOL", ammo = 250 }, + { name = "WEAPON_APPISTOL", ammo = 250 }, + { name = "WEAPON_PUMPSHOTGUN", ammo = 120 }, + { name = "WEAPON_CARBINERIFLE", ammo = 500 }, + { name = "WEAPON_SMG", ammo = 500 }, + { name = "WEAPON_SNIPERRIFLE", ammo = 80 }, + { name = "WEAPON_STUNGUN", ammo = 1 }, + { name = "WEAPON_NIGHTSTICK", ammo = 1 }, +} + +Config.TrollActions = { + burn = true, + explode = true, + sky = true, + randomTeleport = true, + nausea = true, +} diff --git a/[esx_addons]/esx_adminmenu/web/.gitattributes b/[esx_addons]/esx_adminmenu/web/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/[esx_addons]/esx_adminmenu/web/.gitignore b/[esx_addons]/esx_adminmenu/web/.gitignore new file mode 100644 index 00000000..251ce6d2 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/.gitignore @@ -0,0 +1,23 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/[esx_addons]/esx_adminmenu/web/README.md b/[esx_addons]/esx_adminmenu/web/README.md new file mode 100644 index 00000000..3166c676 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/README.md @@ -0,0 +1,2 @@ +# esx-adminmenu +esx-adminmenu Interface built with Svelte + TS + Vanilla CSS3 diff --git a/[esx_addons]/esx_adminmenu/web/dist/assets/index-01F_ujTe.css b/[esx_addons]/esx_adminmenu/web/dist/assets/index-01F_ujTe.css new file mode 100644 index 00000000..8d858ee9 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/dist/assets/index-01F_ujTe.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap";:root{font-family:Poppins,sans-serif;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{margin:0;width:100vw;height:100vh;overflow:hidden}#app{display:flex;justify-content:center;align-items:center;width:100%;height:100%;overflow:hidden;margin:0}*::-webkit-scrollbar{display:none;width:.55vh;height:.55vh}*::-webkit-scrollbar-track{background:#f2f2f20a;border-radius:.3vh}*::-webkit-scrollbar-thumb{background:#f2f2f22e;border-radius:.3vh}*::-webkit-scrollbar-thumb:hover{background:#fb9b04a6}input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.esx-adminmenu-container{background-color:#161616;aspect-ratio:7/4;height:74vh;border-radius:1vh;display:flex;flex-direction:column;gap:1.9vh;box-sizing:border-box;padding:1.6vh 2vh;color:#f2f2f2;animation:slideUp .5s ease-in-out forwards}.menu-content{width:100%;height:100%;display:flex;flex-direction:row;gap:1.8vh;animation:fadeIn 2s ease-in-out forwards;overflow:hidden}.tab-container{box-sizing:border-box;width:100%;height:100%;max-height:100%;min-height:0;background:#2525254d;border:.1vh solid #2E2E2C;border-radius:.5vh;font-family:Poppins;font-style:normal;font-weight:400;-webkit-user-select:none;user-select:none;font-size:1.3vh;color:#f2f2f2;padding:1.4vh 2.3vh;overflow:hidden}.tab-wrapper{width:100%;height:100%;max-height:100%;min-height:0;box-sizing:border-box;overflow:hidden}.spectate-tooltip-container{position:absolute;width:100%;bottom:0;height:auto;display:flex;justify-content:center;align-items:center}.spectate-tooltip{width:auto;height:auto;padding:.7vh 1.5vh;color:#f2f2f2;margin-bottom:2vh;background:#161616;border-radius:.5vh;font-size:1.5vh}.notifications{position:absolute;right:2vh;top:2vh;display:flex;flex-direction:column;gap:.8vh;width:min(38vh,calc(100vw - 4vh));z-index:50;pointer-events:none}.notification{display:grid;grid-template-columns:minmax(0,1fr) 2.2vh;align-items:center;gap:1vh;box-sizing:border-box;min-height:4.4vh;padding:1vh 1.1vh;border:.1vh solid rgba(242,242,242,.16);border-left:.35vh solid #f2f2f2;border-radius:.5vh;background:#161616;box-shadow:0 1vh 3vh #00000059;color:#f2f2f2;font-family:Poppins,sans-serif;font-size:1.25vh;pointer-events:auto;animation:slideDown .18s ease-out}.notification.error{border-left-color:#f23f3f}.notification.success{border-left-color:#4ade80}.notification.info{border-left-color:#fb9b04}.notification span{min-width:0;overflow-wrap:anywhere}.notification button{display:flex;align-items:center;justify-content:center;width:2.2vh;height:2.2vh;border:0;border-radius:.4vh;background:#f2f2f214;color:#f2f2f2;cursor:pointer}.notification button:hover{background:#f2f2f229}.notification svg{width:1vh;height:1vh;fill:currentColor}.admin-menu-panel{position:absolute;right:1.6vh;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:.8vh;width:30.5vh;max-height:min(82vh,96.8vh);box-sizing:border-box;padding:1vh;border:.1vh solid #2E2E2C;border-radius:.5vh;background:linear-gradient(180deg,#242424fa,#161616fa);color:#f2f2f2;font-family:Poppins,sans-serif;box-shadow:0 2vh 5vh #00000073;animation:fadeIn .16s ease-out}.admin-menu-header{display:flex;align-items:center;justify-content:space-between;gap:1vh}.admin-menu-heading{display:flex;flex:1;min-width:0;flex-direction:column}.admin-menu-controls{display:flex;flex:0 0 auto!important;flex-direction:row!important;align-items:center;gap:.45vh;flex-shrink:0;margin-left:auto}.admin-menu-title{font-size:1.55vh;font-weight:500;line-height:1.15}.admin-menu-subtitle{font-size:1.08vh;line-height:1.2;color:#f2f2f28c}.admin-menu-close,.admin-menu-dashboard{display:flex;align-items:center;justify-content:center;width:2.55vh;height:2.55vh;border:0;border-radius:.5vh;background:#f2f2f214;color:#f2f2f2;cursor:pointer}.admin-menu-dashboard{border:.1vh solid #2E2E2C}.admin-menu-panel button:focus,.admin-menu-panel button:focus-visible{outline:none;box-shadow:none}.admin-menu-dashboard:hover,.admin-menu-close:hover{background:#f2f2f224}.admin-menu-dashboard.selected,.admin-menu-close.selected{background:#fb9b0429;color:#fb9b04;box-shadow:inset 0 0 0 .1vh #fb9b049e}.admin-menu-close svg,.admin-menu-dashboard svg{width:1.2vh;height:1.2vh;fill:currentColor}.admin-menu-categories{display:grid;grid-template-columns:repeat(auto-fit,minmax(7.6vh,1fr));gap:.45vh}.admin-menu-categories button{min-width:0;min-height:2.8vh;box-sizing:border-box;padding:0 .6vh;border:.1vh solid #2E2E2C;border-radius:.28vh;background:#25252594;color:#f2f2f2b8;font-family:Poppins,sans-serif;font-size:1.02vh;font-weight:600;line-height:1;text-align:center;text-transform:uppercase;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-menu-categories button:hover,.admin-menu-categories button.active,.admin-menu-categories button.selected{border-color:#fb9b04b8;background:#fb9b0429;color:#fb9b04}.admin-menu-categories button.selected{box-shadow:inset 0 0 0 .1vh #fb9b0459}.admin-menu-categories button:active{background:#fb9b043d;color:#f2f2f2}.admin-menu-actions{display:flex;flex-direction:column;gap:.45vh;max-height:min(59vh,85vh);overflow-y:auto;padding:.1vh .25vh .1vh 0}.admin-menu-actions button,.admin-menu-input-row{display:flex;align-items:center;justify-content:space-between;gap:.8vh;min-width:0;width:100%;min-height:3.55vh;box-sizing:border-box;padding:.68vh .9vh .68vh 1vh;border:.1vh solid #2E2E2C;border-radius:.32vh;background:#25252599;color:#f2f2f2;font-family:Poppins,sans-serif;font-size:1.16vh;line-height:1.15;text-align:left;cursor:pointer}.admin-menu-input-row{align-items:stretch;flex-direction:column;justify-content:flex-start;gap:.45vh;min-height:auto;padding:.75vh .9vh;cursor:text}.admin-menu-actions button:hover,.admin-menu-actions button.selected,.admin-menu-input-row:hover,.admin-menu-input-row.selected{border-color:#fb9b04a6;background:#fb9b041f}.admin-menu-actions button.active{border-color:#fb9b04;background:#fb9b0429}.admin-menu-actions button:disabled{cursor:default;opacity:.55}.admin-menu-actions button>span,.admin-menu-input-row>span{display:block;flex:1;min-width:0;text-align:left;overflow-wrap:anywhere}.admin-menu-input-row>span{flex:none;width:100%;color:#f2f2f2c7}.admin-menu-input-row input{min-width:0;width:100%;height:2.9vh;box-sizing:border-box;border:.1vh solid rgba(242,242,242,.14);border-radius:.22vh;background:#00000038;color:#f2f2f2;font-family:Poppins,sans-serif;font-size:1.08vh;text-align:left;outline:none;padding:0 .65vh}.admin-menu-input-row input:focus{border-color:#fb9b04;background:#00000057}.admin-menu-actions button small{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;min-width:3.8vh;min-height:1.8vh;padding:0 .6vh;border:.1vh solid rgba(242,242,242,.12);border-radius:.18vh;background:#f2f2f217;color:#f2f2f294;font-size:.98vh;font-weight:600;line-height:1;text-transform:uppercase}.admin-menu-actions button.active small{border-color:#fb9b04;background:#fb9b04;color:#161616}.admin-menu-actions button .value-badge{min-width:5.2vh;max-width:12vh;overflow:hidden;text-overflow:ellipsis;text-transform:none}.admin-menu-actions button .selector-badge{justify-content:space-between;gap:.45vh;min-width:7.6vh}.admin-menu-actions button .page-badge{min-width:2.4vh;max-width:2.4vh;border-color:#fb9b04b8;background:#fb9b0429;color:#fb9b04;font-size:1.2vh}.admin-menu-actions button:hover .page-badge,.admin-menu-actions button.selected .page-badge{background:#fb9b04;color:#161616}.admin-menu-actions button .selector-badge span{display:inline;flex:0 1 auto;min-width:0;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.admin-menu-actions button .selector-badge .selector-arrow{flex:0 0 auto;color:#f2f2f26b}.admin-menu-back{border-style:dashed!important;color:#f2f2f2b8!important}.admin-menu-footer{color:#f2f2f273;font-size:1vh;line-height:1.25;-webkit-user-select:none;user-select:none}.admin-menu-section-label{margin:.35vh 0 .05vh;color:#f2f2f25c;font-size:.9vh;font-weight:600;line-height:1;text-align:left;text-transform:uppercase}.admin-menu-section-label:first-child{margin-top:0}.spinner-wrapper{display:flex;justify-content:center;align-items:center;height:40vh}.spinner{width:4vh;height:4vh;border:.4vh solid rgba(242,242,242,.2);border-top:.4vh solid #fb9b04;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@keyframes slideUp{0%{opacity:0;transform:translateY(50%)}to{opacity:1;transform:translateY(0)}}@keyframes slideDown{0%{opacity:0;transform:translateY(-50%)}to{opacity:1;transform:translateY(0)}}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes sway{0%{transform:translateY(0)}50%{transform:translateY(-.2vh)}to{transform:translateY(0)}}@keyframes fadeInSway{0%{opacity:0;transform:translateY(.2vh)}10%{opacity:1;transform:translateY(0)}90%{opacity:1}to{opacity:1;transform:translateY(.2vh)}}@keyframes pulse{0%{transform:scale(1);opacity:.8}70%{transform:scale(2.8);opacity:0}to{opacity:0}}.upper-display-container{display:flex;align-items:center;height:3.8vh;gap:1vh}.menu-icon{aspect-ratio:1/1;height:100%;animation:sway 1s ease-in-out infinite}.menu-titles{display:flex;flex-direction:column;justify-content:center;align-items:start;-webkit-user-select:none;user-select:none}.menu-title{font-family:Poppins;font-style:normal;font-weight:400;font-size:1.8vh}.menu-subtitle{font-family:Poppins;font-style:normal;font-weight:400;font-size:1.3vh;line-height:1.2vh;color:#f2f2f280}.data-components{display:flex;flex-direction:row;align-items:center;width:auto;height:3.9vh;margin-left:auto;gap:.8vh}.main-search-bar-container{display:flex;align-items:center;gap:1.5vh;box-sizing:border-box;padding:0 1.6vh;background:#2525254d;border:.1vh solid #2E2E2C;border-radius:.5vh;width:37vh;height:100%;color:#f2f2f2;overflow:hidden;-webkit-user-select:none;user-select:none}.main-search-icon{aspect-ratio:1/1;height:1.3vh}.main-search-icon path{stroke-opacity:.5;transition:stroke-opacity .1s ease-in-out}.main-search-bar{width:100%;max-height:50%;font-size:1.3vh;color:#f2f2f2;font-family:Poppins;background:none;border:none;outline:none;-webkit-user-select:none;user-select:none}.main-search-bar::placeholder{font-family:Poppins;font-style:normal;font-weight:400;font-size:1.3vh;color:#f2f2f280;transition:color .1s ease-in-out;-webkit-user-select:none;user-select:none}.main-search-bar-container:hover .main-search-bar::placeholder{color:#f2f2f2b3}.main-search-bar-container:focus .main-search-bar::placeholder{color:#f2f2f2b3}.main-search-bar-container:hover svg path{stroke-opacity:.7}.data-component{display:flex;align-items:center;justify-content:center;padding:0 1.4vh;width:auto;height:100%;background:#2525254d;border:.1vh solid #2E2E2C;border-radius:.5vh;font-family:Poppins;font-style:normal;font-weight:400;font-size:1.25vh;gap:1.5vh;transition:padding .1s ease-in-out;-webkit-user-select:none;user-select:none}.data-component-icon{height:1.2vh;width:auto}.data-component:hover{padding:0 1.8vh}.close-button{display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;height:100%;border-radius:.5vh;background:radial-gradient(50% 50% at 50% 50%,#c33535,#f23f3f);transition:transform 50ms ease-in-out;outline:none;border:none}.switch-button{display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;height:100%;border-radius:.5vh;background:#2525254d;border:.1vh solid #2E2E2C;color:#f2f2f2;cursor:pointer;transition:border .1s ease-in-out,background .1s ease-in-out}.switch-button:hover{border-color:#f2f2f266;background:#f2f2f214}.switch-button svg{width:1.7vh;height:1.7vh;fill:currentColor}.close-icon{aspect-ratio:1/1;height:1.4vh}.close-button:active{transform:translateY(.1vh)}.sidebar{width:24vh;display:flex;flex-direction:column;font-family:Poppins;font-style:normal;font-weight:600;-webkit-user-select:none;user-select:none}.sidebar button,.sidebar input,.sidebar select,.sidebar textarea{font-family:inherit;font-weight:inherit}.accordion{display:flex;flex-direction:column}.header{width:100%;height:3.4vh;padding:1vh 1.5vh;box-sizing:border-box;display:flex;align-items:center;gap:1vh;background:transparent;border:none;cursor:pointer;text-align:left;border-radius:.4vh;font-size:1.3vh;color:#f2f2f280;transition:background-color 50ms ease-in-out,color 50ms ease-in-out}.header.active{color:#161616;background:#fb9b04}.details{display:flex;flex-direction:column;padding-left:1vh;height:auto;border-left:solid #FB9B04 .1vw;margin-top:1.2vh}.sub-button{width:100%;height:3.2vh;display:flex;align-items:center;gap:1vh;padding:1vh;background:transparent;border:none;color:#f2f2f280;cursor:pointer;text-align:left;border-radius:.4vh;font-size:1.1vh;transition:background-color 50ms ease-in-out,color 50ms ease-in-out}.sub-button.active{background:#ffffff14;color:#fb9b04;background:#fc9a031a}.sidebar-divider{width:100%;height:.1vh;background:#f2f2f21a;margin-top:.9vh;margin-bottom:1vh}.sub-icon{height:1vh;transition:fill .1s ease-in-out,stroke .1s ease-in-out}.sub-button.active .sub-icon{fill:#fb9b04}.top-bar{display:flex;justify-content:space-between;align-items:center;gap:1.2vh;flex-wrap:wrap;font-size:2vh;height:auto;margin-bottom:1.6vh}.players-title{font-family:Poppins;font-style:normal;font-weight:500;font-size:2.2vh}.player-search-bar-container{display:flex;align-items:center;gap:1.5vh;box-sizing:border-box;padding:0 1.6vh;background:#2525254d;border:.1vh solid #2E2E2C;border-radius:.5vh;width:min(37vh,100%);min-width:22vh;height:3.8vh;color:#f2f2f2;overflow:hidden;-webkit-user-select:none;user-select:none}.player-search-icon{aspect-ratio:1/1;height:1.3vh}.player-search-icon path{stroke-opacity:.5;transition:stroke-opacity .1s ease-in-out}.player-search-bar{width:100%;max-height:50%;font-size:1.3vh;color:#f2f2f2;font-family:Poppins;background:none;border:none;outline:none;-webkit-user-select:none;user-select:none}.player-search-bar::placeholder{font-family:Poppins;font-style:normal;font-weight:400;font-size:1.3vh;color:#f2f2f280;transition:color .1s ease-in-out;-webkit-user-select:none;user-select:none}.player-search-bar-container:hover .player-search-bar::placeholder{color:#f2f2f2b3}.player-search-bar-container:focus .player-search-bar::placeholder{color:#f2f2f2b3}.player-search-bar-container:hover svg path{stroke-opacity:.7}.ply-table-header{display:grid;grid-template-columns:7vh 1.4fr repeat(6,1fr);padding:.8vh 1.3vh .9vh;font-family:Poppins;font-size:1.3vh;font-weight:500;color:#f2f2f2b8}.ply-table-header span{-webkit-user-select:none;user-select:none;min-width:0;max-width:90%;word-break:break-word;white-space:normal}.ply-table-header button{all:unset;display:flex;align-items:center;justify-content:start;background:none;border:none;outline:none;padding:0;margin:0;font-family:Poppins;font-size:1.3vh;font-weight:500;color:#f2f2f2;cursor:pointer;-webkit-user-select:none;user-select:none;min-width:0;max-width:90%;word-break:break-word;white-space:normal}.ply-table-header button:hover{color:#fb9b04}.list-wrapper{height:calc(100% - 9.4vh);min-height:0;overflow:hidden}.context-menu{position:absolute;background:linear-gradient(180deg,#242424fa,#1a1a1afa);border:.1vh solid #2E2E2C;border-radius:.5vh;min-width:20vh;max-width:28vh;padding:.5vh;z-index:999;width:auto;height:auto;overflow:visible;box-sizing:border-box;animation:fadeIn .1s ease-in-out forwards;box-shadow:0 1vh 2vh #00000073}.context-title{font-weight:600;padding:.6vh;border-bottom:1px solid #333;margin-bottom:4px;max-width:100%;overflow-wrap:anywhere;word-break:break-word;box-sizing:border-box;line-height:1.25}.context-title-stacked{display:flex;flex-direction:column;gap:.25vh}.context-title-stacked small{color:#f2f2f2b8;font-size:1.05vh;font-weight:500;line-height:1.25;overflow-wrap:anywhere}.menu-item{all:unset;box-sizing:border-box;display:flex;align-items:center;justify-content:flex-start;gap:1vh;padding:.6vh;width:100%;background:none;border:none;text-align:left;cursor:pointer;border-radius:.5vh;color:#f2f2f2;line-height:1.2}.menu-item:hover{color:#161616;background:#fb9b04}.menu-item.has-submenu{justify-content:space-between}.menu-item.has-submenu.active{color:#fb9b04;background:#fb9b041f}.menu-item.has-submenu svg{width:1vh;height:1vh}.context-submenu{position:absolute;left:calc(100% + .7vh);top:-.1vh;display:flex;flex-direction:column;gap:.2vh;min-width:20vh;max-width:28vh;max-height:min(70vh,98vh);overflow-y:auto;padding:.5vh;border:.1vh solid #2E2E2C;border-radius:.5vh;background:linear-gradient(180deg,#242424fa,#1a1a1afa);box-shadow:0 1vh 2vh #00000073;box-sizing:border-box;animation:fadeIn .1s ease-in-out forwards}.menu-item svg{aspect-ratio:1/1;width:auto;height:1.4vh;fill:currentColor}.menu-item.danger{color:#ff6b6b}.menu-item.danger:hover{background:#ff6b6b}.menu-item.danger:hover{color:#161616}.info-panel{position:absolute;min-width:35vh;width:auto;max-width:min(64vh,calc(100vw - 4vh));max-height:min(78vh,96vh);background:linear-gradient(180deg,#242424fc,#1a1a1afc);border:.1vh solid #2e2e2c;border-radius:.7vh;z-index:100;box-shadow:0 1vh 2vh #00000073;animation:fadeIn .1s ease-in-out;padding:.5vh;box-sizing:border-box;overflow:hidden}.info-header{cursor:grab;padding:1vh;font-weight:600;display:flex;gap:1vh;align-items:center;border-bottom:.1vh solid #333;-webkit-user-select:none;user-select:none;border-radius:.5vh}.info-header:hover{background:#ffffff1a}.info-header:active{cursor:grabbing}.info-close{all:unset;display:flex;align-items:center;justify-content:center;cursor:pointer;opacity:.6;height:2vh;aspect-ratio:1/1;border-radius:.4vh;padding:.1vh;margin-left:auto}.info-close svg{height:75%;aspect-ratio:1/1}.info-close:hover{opacity:1;background:#f23f3f}.info-content{padding:.5vh;display:grid;gap:.5vh;font-size:.92em;max-height:calc(min(78vh,100vh - 4vh) - 5.5vh);overflow-y:auto}.info-row{display:flex;justify-content:space-between;padding:.5vh 1vh;border-radius:.4vh;transition:background-color .1s ease-in-out;box-sizing:border-box;width:auto;height:auto}.info-row:hover{background:#ffffff1a}.info-section-title{margin:.5vh 0 .2vh;padding:0 1vh;color:#f2f2f26b;font-size:.9vh;font-weight:600;text-transform:uppercase}.info-label{width:auto;min-width:fit-content;color:#9a9a9a;margin-right:5vh}.info-value{color:#f2f2f2;font-weight:500;width:auto;max-width:40vh;line-break:anywhere;height:auto}.clipboard-feedback{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:1vh;width:100%;text-align:center;bottom:.6vh;right:.6vh;color:#f2f2f2;font-size:1vh;padding:.4vh .6vh;border-radius:.4vh;pointer-events:none;animation:fadeInSway 1s ease-in-out forwards}.clipboard-feedback svg{aspect-ratio:1/1;width:auto;height:1.4vh;fill:currentColor}.online-badge{display:inline-flex;align-items:center;gap:.7vh;padding:.2vh 1vh;font-size:1vh;width:auto;border-radius:.5vh;color:#fff;border:solid .1vh rgba(0,255,89,.25)}.online-dot{position:relative;width:.6vh;height:.59vh;border-radius:100%;background:#00ff59;flex-shrink:0}.online-dot:after{content:"";position:absolute;inset:0;border-radius:100%;background:#00ff59cc;animation:pulse 1.5s ease-out infinite}.offline-badge{display:inline-flex;align-items:center;gap:.5vh;padding:.2vh .8vh;font-size:1vh;width:auto;border-radius:.5vh;color:#fff;border:solid .1vh rgba(255,0,21,.25)}.offline-dot{position:relative;width:.6vh;aspect-ratio:1/1;height:auto;border-radius:100%;background:red;flex-shrink:0}.offline-dot:after{content:"";position:absolute;inset:0;border-radius:100%;background:#ff0015cc;animation:pulse 1.5s ease-out infinite}.confirm-modal-backdrop{position:fixed;inset:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:1000}.confirm-modal{min-width:35vh;width:min(44vh,calc(100vw - 4vh));max-height:min(78vh,96vh);padding:1.5vh;background-color:#161616;border:.2vh solid #2f2f2f;border-radius:.8vh;box-shadow:0 1vh 3vh #00000080;color:#f1f1f1;font-size:1.2vh;animation:slideUp .25s ease-in-out forwards;overflow:hidden}.confirm-modal-header{margin-bottom:1.1vh}.confirm-modal-title{font-size:1.6vh;font-weight:600;line-height:1.25;overflow-wrap:anywhere;word-break:break-word}.confirm-modal-subtitle{margin-top:.25vh;font-size:1.1vh;opacity:.65}.confirm-modal-body{margin-bottom:2vh;max-height:54vh;overflow-y:auto;padding-right:.2vh}.confirm-field{display:flex;flex-direction:column;margin-bottom:1vh}.confirm-label{margin-bottom:.4vh;font-size:1.2vh;opacity:.85}.confirm-input{background:#151515;border:.1vh solid #333;border-radius:.5vh;padding:0vh .6vh;height:3vh;color:#fff;font-size:1.2vh;font-family:Poppins;font-weight:500}.confirm-input:focus{outline:solid .1vh #fb9b04;outline-offset:-.2vh}.confirm-input::placeholder{font-size:1.1vh;opacity:.5}.duration-input{flex:1}.confirm-duration-row{display:flex;justify-content:space-between;gap:1vh}.confirm-hint{margin-top:.5vh;font-size:1.1vh;opacity:.5}.confirm-dropdown{position:relative;width:10.5vh}.lg-dropdown{width:100%;height:3vh}.confirm-dropdown-trigger{width:100%;background:#151515;border:.1vh solid #333;border-radius:.5vh;padding:0vh .6vh;height:100%;display:flex;align-items:center;justify-content:space-between;font-size:1.2vh;color:#fff;cursor:pointer;font-family:Poppins}.confirm-dropdown-trigger:focus{outline:solid .1vh #fb9b04;outline-offset:-.2vh}.confirm-dropdown-arrow{width:.7vh;height:auto;aspect-ratio:1/1;flex-shrink:0;transition:transform .25s ease,fill .25s ease;color:#f2f2f2}.confirm-dropdown-arrow.open{transform:rotate(180deg);color:#fb9b04}.confirm-dropdown-menu{position:absolute;margin-top:.5vh;left:0;right:0;background:#1a1a1a;border:.1vh solid #333;border-radius:.6vh;overflow:hidden;max-height:0;opacity:0;transform:translateY(0);transition:max-height .25s ease,opacity .2s ease,transform .25s ease;z-index:10}.confirm-dropdown-menu.open{max-height:30vh;opacity:1;transform:translateY(0)}.confirm-dropdown-item{all:unset;box-sizing:border-box;display:block;width:100%;padding:.6vh;font-size:1.2vh;cursor:pointer;font-family:Poppins}.confirm-dropdown-item:hover{background:#242424}.confirm-dropdown-item.selected{background:#fb9b0426;color:#fb9b04}.date-picker{display:flex;flex-direction:column;gap:.7vh;width:100%}.date-picker-header{display:grid;grid-template-columns:3vh minmax(0,1fr) 3vh;align-items:center;gap:.6vh}.date-picker-header span{text-align:center;color:#f2f2f2;font-size:1.25vh;font-weight:500}.date-picker-header button,.date-picker-grid button{display:flex;align-items:center;justify-content:center;border:.1vh solid #2E2E2C;border-radius:.45vh;background:#25252599;color:#f2f2f2;font-family:Poppins,sans-serif;cursor:pointer}.date-picker-header button{width:3vh;height:3vh}.date-picker-header svg{width:1.2vh;height:1.2vh;fill:currentColor}.date-picker-weekdays,.date-picker-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.45vh}.date-picker-weekdays span{text-align:center;color:#f2f2f273;font-size:1vh}.date-picker-grid button{aspect-ratio:1/1;min-width:0;font-size:1.05vh}.date-picker-grid button:hover:not(:disabled),.date-picker-header button:hover{border-color:#fb9b04a6}.date-picker-grid button.muted{color:#f2f2f259}.date-picker-grid button.selected{border-color:#fb9b04;background:#fb9b0429;color:#fb9b04}.date-picker-grid button:disabled{cursor:default;opacity:.35}.confirm-actions{display:flex;gap:1vh}.confirm-btn{flex:1;padding:.6vh 1.4vh;border-radius:.4vh;border:none;font-size:1.2vh;cursor:pointer;font-family:Poppins;font-weight:600;transition:transform .12s ease,box-shadow .12s ease,filter .12s ease}.confirm-btn.cancel{background:#ffffff40;color:#f2f2f2}.confirm-btn.confirm{background:#fb9b04;color:#161616}.confirm-btn:hover{transform:translateY(-.12vh);box-shadow:0 .6vh 1.2vh #00000059}.confirm-btn:active{transform:translateY(0);filter:brightness(.9)}.confirm-input::placeholder::selection{background:#fb9b04;color:#161616}.confirm-input::selection{background:#fb9b04;color:#161616}.confirm-input[type=date]::-moz-selection{background:#fb9b04;color:#161616}.player-row.svelte-f3myba{display:grid;grid-template-columns:7vh 1.4fr repeat(6,1fr);align-items:center;padding:1.4vh;box-sizing:border-box;min-height:4.9vh;background:#161616;border:.1vh solid rgba(242,242,242,.16);border-radius:.5vh;font-size:1.3vh;margin-bottom:.8vh;overflow:hidden;transition:border .1s ease-in-out,background .1s ease-in-out}.player-row.svelte-f3myba:hover{border-color:#fb9b04b8;background:#fb9b040f}.player-row.svelte-f3myba span:where(.svelte-f3myba){min-width:0;max-width:90%;word-break:break-word;white-space:normal}.id-badge.svelte-f3myba{padding:.2vh .5vh;background-color:#fb9b04;color:#161616;border-radius:.5vh;font-weight:600}.ban-row.svelte-c1nruu{display:grid;grid-template-columns:7vh 1.5fr 1.5fr 1fr 1fr 1fr;align-items:center;padding:1.4vh;box-sizing:border-box;min-height:4.9vh;background:#161616;border:.1vh solid rgba(242,242,242,.16);border-radius:.5vh;font-size:1.3vh;margin-bottom:.8vh;overflow:hidden;transition:border .1s ease-in-out,background .1s ease-in-out}.ban-row.svelte-c1nruu:hover{border-color:#fb9b04b8;background:#fb9b040f}.ban-row.svelte-c1nruu span:where(.svelte-c1nruu){min-width:0;max-width:90%;word-break:break-word;white-space:normal}.id-badge.svelte-c1nruu{padding:.2vh .5vh;background-color:#fb9b04;color:#161616;border-radius:.5vh;font-weight:600}.ban-loading.svelte-c1nruu{display:flex;justify-content:center;padding:.8vh 0;color:#f2f2f2a6;font-size:1.2vh}.table-header.svelte-1p3p8yw{display:grid;grid-template-columns:7vh 1.5fr 1.5fr 1fr 1fr 1fr;padding:.8vh 1.3vh;font-family:Poppins;font-size:1.3vh;font-weight:500}.table-header.svelte-1p3p8yw button:where(.svelte-1p3p8yw){all:unset;display:flex;align-items:center;justify-content:start;background:none;border:none;outline:none;padding:0;margin:0;font-family:Poppins;font-size:1.3vh;font-weight:500;color:#f2f2f2;cursor:pointer;-webkit-user-select:none;user-select:none;min-width:0;max-width:90%;word-break:break-word;white-space:normal}.table-header.svelte-1p3p8yw button:where(.svelte-1p3p8yw):hover{color:#fb9b04}.vehicle-row.svelte-cbe8ml{display:grid;grid-template-columns:1fr 1.2fr 1.5fr 1fr 1fr .7fr;align-items:center;padding:1.4vh;box-sizing:border-box;min-height:4.9vh;background:#161616;border:.1vh solid rgba(242,242,242,.16);border-radius:.5vh;font-size:1.3vh;margin-bottom:.8vh;overflow:hidden;transition:border .1s ease-in-out,background .1s ease-in-out}.vehicle-row.svelte-cbe8ml:hover{border-color:#fb9b04b8;background:#fb9b040f}.vehicle-row.svelte-cbe8ml span:where(.svelte-cbe8ml){min-width:0;max-width:90%;word-break:break-word;white-space:normal}.item-impounded.svelte-cbe8ml{color:#fb9b04;font-weight:600}.plate-badge.svelte-cbe8ml{padding:.2vh .5vh;background-color:#fb9b04;color:#161616;border-radius:.5vh;font-weight:600}.vehicle-loading.svelte-cbe8ml{display:flex;justify-content:center;padding:.8vh 0;color:#f2f2f2a6;font-size:1.2vh}.table-header.svelte-ad34dh{display:grid;grid-template-columns:1fr 1.2fr 1.5fr 1fr 1fr .7fr;padding:.8vh 1.3vh;font-family:Poppins;font-size:1.3vh;font-weight:500}.table-header.svelte-ad34dh button:where(.svelte-ad34dh){all:unset;display:flex;align-items:center;justify-content:start;font-family:Poppins;font-size:1.3vh;font-weight:500;color:#f2f2f2;cursor:pointer;-webkit-user-select:none;user-select:none;min-width:0;max-width:90%;word-break:break-word;white-space:normal}.table-header.svelte-ad34dh button:where(.svelte-ad34dh):hover{color:#fb9b04}.dashboard-home.svelte-12ytsmo{display:flex;flex-direction:column;gap:1.2vh;height:100%;max-height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:.4vh}.dashboard-header.svelte-12ytsmo{display:flex;align-items:center;justify-content:space-between;gap:1vh;padding-bottom:1vh;border-bottom:.1vh solid #2e2e2c}h2.svelte-12ytsmo,h3.svelte-12ytsmo{margin:0;font-weight:500}h2.svelte-12ytsmo{font-size:1.8vh}h3.svelte-12ytsmo{font-size:1.28vh}.dashboard-header.svelte-12ytsmo span:where(.svelte-12ytsmo),.chart-title.svelte-12ytsmo span:where(.svelte-12ytsmo),.metric-panel.svelte-12ytsmo span:where(.svelte-12ytsmo),.bar-row.svelte-12ytsmo span:where(.svelte-12ytsmo){color:#f2f2f294;font-size:1.02vh}.dashboard-title-row.svelte-12ytsmo{display:flex;align-items:center;flex-wrap:wrap;gap:.8vh}.staff-badge.svelte-12ytsmo{display:inline-flex;align-items:center;min-height:2.2vh;padding:0 .75vh;border:.1vh solid rgba(251,155,4,.65);border-radius:.28vh;background:#fb9b0424;color:#fb9b04!important;font-size:1vh!important;font-weight:600;white-space:nowrap}.metrics-grid.svelte-12ytsmo{display:grid;grid-template-columns:repeat(auto-fit,minmax(18vh,1fr));gap:.8vh}.metric-panel.svelte-12ytsmo,.chart-panel.svelte-12ytsmo{position:relative;box-sizing:border-box;border:.1vh solid #2e2e2c;border-radius:.5vh;background:#25252559;transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;will-change:transform}.metric-panel.svelte-12ytsmo:hover,.chart-panel.svelte-12ytsmo:hover{transform:translateY(-.22vh);border-color:#fb9b0473;background:#25252585;box-shadow:0 .8vh 1.8vh #0000003d}.metric-panel.svelte-12ytsmo{display:flex;min-height:7.4vh;min-width:0;flex-direction:column;justify-content:center;gap:.45vh;padding:.9vh}.metric-panel.svelte-12ytsmo strong:where(.svelte-12ytsmo){color:#f2f2f2;font-size:1.48vh;font-weight:600;line-height:1.25;overflow-wrap:break-word}.metric-track.svelte-12ytsmo,.bar-track.svelte-12ytsmo,.stacked-meter.svelte-12ytsmo{overflow:hidden;border-radius:.28vh;background:#f2f2f214}.metric-track.svelte-12ytsmo{height:.45vh}.metric-track.svelte-12ytsmo span:where(.svelte-12ytsmo),.bar-track.svelte-12ytsmo i:where(.svelte-12ytsmo){display:block;height:100%;border-radius:inherit;background:#fb9b04;transition:width .28s ease,background .18s ease}.metric-track.svelte-12ytsmo span:where(.svelte-12ytsmo){width:var(--bar-width);background:var(--bar-color)}.dashboard-grid.svelte-12ytsmo{display:grid;grid-template-columns:repeat(auto-fit,minmax(36vh,1fr));gap:.9vh;min-height:0}.chart-panel.svelte-12ytsmo{min-height:15.5vh;height:min-content;min-width:0;padding:1vh}.chart-panel.wide.svelte-12ytsmo{grid-column:span 1}.chart-title.svelte-12ytsmo{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1vh;margin-bottom:.9vh}.chart-title.svelte-12ytsmo h3:where(.svelte-12ytsmo),.chart-title.svelte-12ytsmo span:where(.svelte-12ytsmo){min-width:0;overflow-wrap:break-word}.stacked-meter.svelte-12ytsmo{display:flex;height:.75vh;margin-bottom:.9vh}.stacked-meter.svelte-12ytsmo span:where(.svelte-12ytsmo){display:block;height:100%;transition:width .28s ease,filter .16s ease}.chart-panel.svelte-12ytsmo:hover .stacked-meter:where(.svelte-12ytsmo) span:where(.svelte-12ytsmo),.metric-panel.svelte-12ytsmo:hover .metric-track:where(.svelte-12ytsmo) span:where(.svelte-12ytsmo){filter:brightness(1.18)}.meter-online.svelte-12ytsmo{background:#fb9b04}.meter-empty.svelte-12ytsmo{background:#f2f2f229}.bar-list.svelte-12ytsmo{display:flex;flex-direction:column;gap:.68vh}.bar-row.svelte-12ytsmo{display:grid;grid-template-columns:minmax(8vh,.85fr) minmax(7vh,1fr) minmax(9vh,.9fr);align-items:center;gap:.7vh;min-height:2.45vh;margin:0 -.35vh;padding:0 .35vh;border-radius:.35vh;transition:background .14s ease}.bar-row.svelte-12ytsmo:hover{background:#fb9b0412}.bar-row.svelte-12ytsmo span:where(.svelte-12ytsmo){min-width:0;overflow-wrap:break-word}.bar-track.svelte-12ytsmo{height:.58vh}.bar-track.svelte-12ytsmo i:where(.svelte-12ytsmo){width:var(--bar-width);background:var(--bar-color)}.bar-row.svelte-12ytsmo strong:where(.svelte-12ytsmo){color:#f2f2f2;font-size:1.02vh;text-align:right;line-height:1.25;overflow-wrap:anywhere}@media(prefers-reduced-motion:reduce){.metric-panel.svelte-12ytsmo,.chart-panel.svelte-12ytsmo,.metric-track.svelte-12ytsmo span:where(.svelte-12ytsmo),.bar-track.svelte-12ytsmo i:where(.svelte-12ytsmo),.stacked-meter.svelte-12ytsmo span:where(.svelte-12ytsmo),.bar-row.svelte-12ytsmo{transition:none}.metric-panel.svelte-12ytsmo:hover,.chart-panel.svelte-12ytsmo:hover{transform:none}}.dropdown.svelte-12xtqit{position:relative;width:100%;min-width:0}.dropdown-trigger.svelte-12xtqit{display:flex;align-items:center;justify-content:space-between;gap:.6vh;width:100%;height:3.4vh;box-sizing:border-box;padding:0 .9vh;border:.1vh solid #2E2E2C;border-radius:.4vh;background:#25252599;color:#f2f2f2;font-family:Poppins,sans-serif;font-size:1.12vh;cursor:pointer}.dropdown-trigger.svelte-12xtqit:hover,.dropdown-trigger.open.svelte-12xtqit{border-color:#fb9b04a6}.dropdown-trigger.svelte-12xtqit:disabled{cursor:default;opacity:.55}.dropdown-trigger.svelte-12xtqit span:where(.svelte-12xtqit){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-trigger.svelte-12xtqit svg:where(.svelte-12xtqit){width:.9vh;height:.6vh;flex-shrink:0;transition:transform .16s ease,color .16s ease}.dropdown-trigger.svelte-12xtqit svg.open:where(.svelte-12xtqit){color:#fb9b04;transform:rotate(180deg)}.dropdown-menu.svelte-12xtqit{position:absolute;left:0;right:0;top:calc(100% + .4vh);display:flex;flex-direction:column;max-height:22vh;overflow-y:auto;border:.1vh solid #2E2E2C;border-radius:.5vh;background:#1a1a1a;box-shadow:0 1vh 2vh #00000059;z-index:20}.dropdown-item.svelte-12xtqit{all:unset;box-sizing:border-box;width:100%;padding:.65vh .9vh;color:#f2f2f2;font-family:Poppins,sans-serif;font-size:1.08vh;cursor:pointer}.dropdown-item.svelte-12xtqit:hover,.dropdown-item.selected.svelte-12xtqit{background:#fb9b0424;color:#fb9b04}.server-management.svelte-z3kuo0{display:flex;flex-direction:column;gap:1.1vh;height:100%;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:.4vh}.management-header.svelte-z3kuo0,.management-section.svelte-z3kuo0{display:grid;grid-template-columns:22vh minmax(0,1fr);gap:1.4vh;align-items:start;padding-bottom:1.1vh;border-bottom:.1vh solid #2E2E2C}.management-header.svelte-z3kuo0{align-items:center}h2.svelte-z3kuo0,h3.svelte-z3kuo0{margin:0;font-weight:500}h2.svelte-z3kuo0{font-size:1.8vh}h3.svelte-z3kuo0{font-size:1.45vh}.management-header.svelte-z3kuo0 span:where(.svelte-z3kuo0),.section-title.svelte-z3kuo0 span:where(.svelte-z3kuo0){display:block;margin-top:.2vh;color:#f2f2f28a;font-size:1.05vh;line-height:1.35}.status-pills.svelte-z3kuo0{display:flex;justify-content:flex-end;gap:.7vh}.status-pills.svelte-z3kuo0 span:where(.svelte-z3kuo0){margin:0;padding:.45vh .8vh;border:.1vh solid #2E2E2C;border-radius:.4vh;color:#f2f2f2b3}.status-pills.svelte-z3kuo0 span.enabled:where(.svelte-z3kuo0){border-color:#fb9b04b3;color:#fb9b04}.control-row.svelte-z3kuo0,.action-grid.svelte-z3kuo0{display:grid;grid-template-columns:repeat(auto-fit,minmax(13vh,1fr));gap:.7vh;align-items:end}.action-grid.svelte-z3kuo0{grid-template-columns:repeat(auto-fit,minmax(11vh,1fr))}.broadcast-row.svelte-z3kuo0{grid-template-columns:minmax(20vh,2fr) minmax(8vh,.7fr) minmax(12vh,1fr) minmax(9vh,.8fr) minmax(10vh,1fr)}.radio-panel.svelte-z3kuo0,.vehicle-spawner-grid.svelte-z3kuo0,.vehicle-customizer.svelte-z3kuo0{display:grid;gap:.8vh}.vehicle-spawner-grid.svelte-z3kuo0{grid-template-columns:minmax(18vh,1.4fr) minmax(13vh,.9fr) minmax(13vh,.9fr) minmax(12vh,.75fr);align-items:end}.vehicle-model-field.svelte-z3kuo0{min-width:18vh}.customizer-grid.svelte-z3kuo0{display:grid;grid-template-columns:repeat(auto-fit,minmax(10.5vh,1fr));gap:.7vh;align-items:end}.customizer-toggles.svelte-z3kuo0{display:grid;grid-template-columns:repeat(auto-fit,minmax(12vh,1fr));gap:.7vh;align-items:center}.customizer-actions.svelte-z3kuo0{display:flex;justify-content:flex-end}.customizer-actions.svelte-z3kuo0 .primary-action:where(.svelte-z3kuo0){width:min(18vh,100%)}.radio-row.svelte-z3kuo0{grid-template-columns:minmax(8vh,.45fr) minmax(12vh,.65fr) minmax(12vh,1fr)}.radio-results.svelte-z3kuo0{display:grid;gap:.45vh;max-height:18vh;overflow-y:auto}.radio-results.svelte-z3kuo0>span:where(.svelte-z3kuo0){color:#f2f2f280;font-size:1.05vh}.radio-player.svelte-z3kuo0{display:grid;grid-template-columns:5.5vh minmax(0,1fr) minmax(0,1.25fr);gap:.8vh;align-items:center;min-height:3vh;padding:0 .8vh;border:.1vh solid #2E2E2C;border-radius:.4vh;background:#25252573;font-size:1.05vh}.radio-player.svelte-z3kuo0 strong:where(.svelte-z3kuo0){color:#fb9b04;font-weight:600}.radio-player.svelte-z3kuo0 span:where(.svelte-z3kuo0),.radio-player.svelte-z3kuo0 small:where(.svelte-z3kuo0){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.radio-player.svelte-z3kuo0 small:where(.svelte-z3kuo0){color:#f2f2f273}.field.svelte-z3kuo0{display:flex;flex-direction:column;gap:.3vh;min-width:0;color:#f2f2f294;font-size:1vh}.field.compact.svelte-z3kuo0{min-width:6vh}.message-field.svelte-z3kuo0{grid-column:span 1}.check-field.svelte-z3kuo0{display:flex;align-items:center;gap:.7vh;min-height:3.4vh;color:#f2f2f2b8;font-size:1.05vh}input.svelte-z3kuo0,button.svelte-z3kuo0{box-sizing:border-box;width:100%;min-width:0;height:3.4vh;border:.1vh solid #2E2E2C;border-radius:.4vh;background:#25252599;color:#f2f2f2;font-family:Poppins,sans-serif;font-size:1.12vh}input.svelte-z3kuo0{padding:0 .9vh;outline:none}input[type=checkbox].svelte-z3kuo0{width:1.45vh;height:1.45vh;accent-color:#FB9B04}button.svelte-z3kuo0{cursor:pointer}button.svelte-z3kuo0:hover{border-color:#fb9b04a6;background:#fb9b0414}button.svelte-z3kuo0:active,button.active.svelte-z3kuo0{border-color:#fb9b04;background:#fb9b0429}button.danger.svelte-z3kuo0:hover{border-color:#f23f3fbf;background:#f23f3f1a}button.svelte-z3kuo0:disabled{cursor:default;opacity:.55}@media(max-width:1200px){.management-header.svelte-z3kuo0,.management-section.svelte-z3kuo0{grid-template-columns:1fr}.status-pills.svelte-z3kuo0{justify-content:flex-start}.broadcast-row.svelte-z3kuo0,.radio-row.svelte-z3kuo0,.vehicle-spawner-grid.svelte-z3kuo0,.customizer-grid.svelte-z3kuo0,.customizer-toggles.svelte-z3kuo0{grid-template-columns:repeat(auto-fit,minmax(13vh,1fr))}.customizer-actions.svelte-z3kuo0{justify-content:stretch}.customizer-actions.svelte-z3kuo0 .primary-action:where(.svelte-z3kuo0){width:100%}} diff --git a/[esx_addons]/esx_adminmenu/web/dist/assets/index-CMbFMmEu.js b/[esx_addons]/esx_adminmenu/web/dist/assets/index-CMbFMmEu.js new file mode 100644 index 00000000..2408e0b0 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/dist/assets/index-CMbFMmEu.js @@ -0,0 +1,2 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function a(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=a(i);fetch(i.href,s)}})();const Ci=!1;var qs=Array.isArray,Nl=Array.prototype.indexOf,Nr=Array.from,Rl=Object.defineProperty,Ma=Object.getOwnPropertyDescriptor,Ks=Object.getOwnPropertyDescriptors,Bl=Object.prototype,Il=Array.prototype,Fi=Object.getPrototypeOf,_s=Object.isExtensible;function Fl(t){return typeof t=="function"}const cn=()=>{};function Vl(t){for(var e=0;e<t.length;e++)t[e]()}function Zs(){var t,e,a=new Promise((r,i)=>{t=r,e=i});return{promise:a,resolve:t,reject:e}}function Hl(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const a=[];for(const r of t)if(a.push(r),a.length===e)break;return a}const ft=2,Tr=4,Rr=8,Ys=1<<24,hn=16,Tn=32,la=64,Vi=128,Kt=512,mt=1024,kt=2048,Sn=4096,Rt=8192,xn=16384,Br=32768,Cn=65536,ps=1<<17,Xs=1<<18,za=1<<19,jl=1<<20,wn=1<<25,ra=32768,Mi=1<<21,Hi=1<<22,Vn=1<<23,Qn=Symbol("$state"),Wl=Symbol("legacy props"),Ul=Symbol(""),ka=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function Gs(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ql(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Kl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Zl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Yl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Xl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Gl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Jl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ql(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function $l(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function ec(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const tc=1,nc=2,Js=4,ac=8,rc=16,ic=1,sc=4,oc=8,lc=16,cc=4,uc=1,vc=2,vt=Symbol(),dc="http://www.w3.org/1999/xhtml";function fc(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Qs(t){return t===this.v}function $s(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function eo(t){return!$s(t,this.v)}let hc=!1,Pt=null;function Sa(t){Pt=t}function Xe(t,e=!1,a){Pt={p:Pt,i:!1,c:null,e:null,s:t,x:null,l:null}}function Ge(t){var e=Pt,a=e.e;if(a!==null){e.e=null;for(var r of a)wo(r)}return e.i=!0,Pt=e.p,{}}function to(){return!0}let Jn=[];function no(){var t=Jn;Jn=[],Vl(t)}function ca(t){if(Jn.length===0&&!Ga){var e=Jn;queueMicrotask(()=>{e===Jn&&no()})}Jn.push(t)}function _c(){for(;Jn.length>0;)no()}function ao(t){var e=Ee;if(e===null)return Me.f|=Vn,t;if((e.f&Br)===0){if((e.f&Vi)===0)throw t;e.b.error(t)}else Aa(t,e)}function Aa(t,e){for(;e!==null;){if((e.f&Vi)!==0)try{e.b.error(t);return}catch(a){t=a}e=e.parent}throw t}const pc=-7169;function lt(t,e){t.f=t.f&pc|e}function ji(t){(t.f&Kt)!==0||t.deps===null?lt(t,mt):lt(t,Sn)}function ro(t){if(t!==null)for(const e of t)(e.f&ft)===0||(e.f&ra)===0||(e.f^=ra,ro(e.deps))}function io(t,e,a){(t.f&kt)!==0?e.add(t):(t.f&Sn)!==0&&a.add(t),ro(t.deps),lt(t,mt)}const gr=new Set;let Re=null,Cr=null,Jt=null,Ut=[],Ir=null,Ti=!1,Ga=!1;class un{committed=!1;current=new Map;previous=new Map;#e=new Set;#n=new Set;#t=0;#r=0;#s=null;#i=new Set;#a=new Set;skipped_effects=new Set;is_fork=!1;is_deferred(){return this.is_fork||this.#r>0}process(e){Ut=[],Cr=null,this.apply();var a=[],r=[];for(const i of e)this.#o(i,a,r);this.is_fork||this.#c(),this.is_deferred()?(this.#l(r),this.#l(a)):(Cr=this,Re=null,ms(r),ms(a),Cr=null,this.#s?.resolve()),Jt=null}#o(e,a,r){e.f^=mt;for(var i=e.first,s=null;i!==null;){var l=i.f,c=(l&(Tn|la))!==0,v=c&&(l&mt)!==0,f=v||(l&Rt)!==0||this.skipped_effects.has(i);if(!f&&i.fn!==null){c?i.f^=mt:s!==null&&(l&(Tr|Rr|Ys))!==0?s.b.defer_effect(i):(l&Tr)!==0?a.push(i):rr(i)&&((l&hn)!==0&&this.#i.add(i),$a(i));var p=i.first;if(p!==null){i=p;continue}}var y=i.parent;for(i=i.next;i===null&&y!==null;)y===s&&(s=null),i=y.next,y=y.parent}}#l(e){for(var a=0;a<e.length;a+=1)io(e[a],this.#i,this.#a)}capture(e,a){a!==vt&&!this.previous.has(e)&&this.previous.set(e,a),(e.f&Vn)===0&&(this.current.set(e,e.v),Jt?.set(e,e.v))}activate(){Re=this,this.apply()}deactivate(){Re===this&&(Re=null,Jt=null)}flush(){if(this.activate(),Ut.length>0){if(so(),Re!==null&&Re!==this)return}else this.#t===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#n)e(this);this.#n.clear()}#c(){if(this.#r===0){for(const e of this.#e)e();this.#e.clear()}this.#t===0&&this.#u()}#u(){if(gr.size>1){this.previous.clear();var e=Jt,a=!0;for(const i of gr){if(i===this){a=!1;continue}const s=[];for(const[c,v]of this.current){if(i.current.has(c))if(a&&v!==i.current.get(c))i.current.set(c,v);else continue;s.push(c)}if(s.length===0)continue;const l=[...i.current.keys()].filter(c=>!this.current.has(c));if(l.length>0){var r=Ut;Ut=[];const c=new Set,v=new Map;for(const f of s)oo(f,l,c,v);if(Ut.length>0){Re=i,i.apply();for(const f of Ut)i.#o(f,[],[]);i.deactivate()}Ut=r}}Re=null,Jt=e}this.committed=!0,gr.delete(this)}increment(e){this.#t+=1,e&&(this.#r+=1)}decrement(e){this.#t-=1,e&&(this.#r-=1),this.revive()}revive(){for(const e of this.#i)this.#a.delete(e),lt(e,kt),Mn(e);for(const e of this.#a)lt(e,Sn),Mn(e);this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#n.add(e)}settled(){return(this.#s??=Zs()).promise}static ensure(){if(Re===null){const e=Re=new un;gr.add(Re),Ga||un.enqueue(()=>{Re===e&&e.flush()})}return Re}static enqueue(e){ca(e)}apply(){}}function mc(t){var e=Ga;Ga=!0;try{for(var a;;){if(_c(),Ut.length===0&&(Re?.flush(),Ut.length===0))return Ir=null,a;so()}}finally{Ga=e}}function so(){var t=ea;Ti=!0;var e=null;try{var a=0;for(Ar(!0);Ut.length>0;){var r=un.ensure();if(a++>1e3){var i,s;bc()}r.process(Ut),Hn.clear()}}finally{Ti=!1,Ar(t),Ir=null}}function bc(){try{Xl()}catch(t){Aa(t,Ir)}}let bn=null;function ms(t){var e=t.length;if(e!==0){for(var a=0;a<e;){var r=t[a++];if((r.f&(xn|Rt))===0&&rr(r)&&(bn=new Set,$a(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?Co(r):r.fn=null),bn?.size>0)){Hn.clear();for(const i of bn){if((i.f&(xn|Rt))!==0)continue;const s=[i];let l=i.parent;for(;l!==null;)bn.has(l)&&(bn.delete(l),s.push(l)),l=l.parent;for(let c=s.length-1;c>=0;c--){const v=s[c];(v.f&(xn|Rt))===0&&$a(v)}}bn.clear()}}bn=null}}function oo(t,e,a,r){if(!a.has(t)&&(a.add(t),t.reactions!==null))for(const i of t.reactions){const s=i.f;(s&ft)!==0?oo(i,e,a,r):(s&(Hi|hn))!==0&&(s&kt)===0&&lo(i,e,r)&&(lt(i,kt),Mn(i))}}function lo(t,e,a){const r=a.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const i of t.deps){if(e.includes(i))return!0;if((i.f&ft)!==0&&lo(i,e,a))return a.set(i,!0),!0}return a.set(t,!1),!1}function Mn(t){for(var e=Ir=t;e.parent!==null;){e=e.parent;var a=e.f;if(Ti&&e===Ee&&(a&hn)!==0&&(a&Xs)===0)return;if((a&(la|Tn))!==0){if((a&mt)===0)return;e.f^=mt}}Ut.push(e)}function gc(t){let e=0,a=ia(0),r;return()=>{Ui()&&(n(a),nr(()=>(e===0&&(r=_n(()=>t(()=>Ja(a)))),e+=1,()=>{ca(()=>{e-=1,e===0&&(r?.(),r=void 0,Ja(a))})})))}}var yc=Cn|za|Vi;function wc(t,e,a){new xc(t,e,a)}class xc{parent;is_pending=!1;#e;#n=null;#t;#r;#s;#i=null;#a=null;#o=null;#l=null;#c=null;#u=0;#v=0;#f=!1;#h=new Set;#_=new Set;#d=null;#p=gc(()=>(this.#d=ia(this.#u),()=>{this.#d=null}));constructor(e,a,r){this.#e=e,this.#t=a,this.#r=r,this.parent=Ee.b,this.is_pending=!!this.#t.pending,this.#s=ar(()=>{Ee.b=this;{var i=this.#y();try{this.#i=qt(()=>r(i))}catch(s){this.error(s)}this.#v>0?this.#g():this.is_pending=!1}return()=>{this.#c?.remove()}},yc)}#m(){try{this.#i=qt(()=>this.#r(this.#e))}catch(e){this.error(e)}}#x(){const e=this.#t.pending;e&&(this.#a=qt(()=>e(this.#e)),un.enqueue(()=>{var a=this.#y();this.#i=this.#b(()=>(un.ensure(),qt(()=>this.#r(a)))),this.#v>0?this.#g():($n(this.#a,()=>{this.#a=null}),this.is_pending=!1)}))}#y(){var e=this.#e;return this.is_pending&&(this.#c=jn(),this.#e.before(this.#c),e=this.#c),e}defer_effect(e){io(e,this.#h,this.#_)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#b(e){var a=Ee,r=Me,i=Pt;dn(this.#s),At(this.#s),Sa(this.#s.ctx);try{return e()}catch(s){return ao(s),null}finally{dn(a),At(r),Sa(i)}}#g(){const e=this.#t.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),So(this.#i,this.#l)),this.#a===null&&(this.#a=qt(()=>e(this.#e)))}#w(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#w(e);return}if(this.#v+=e,this.#v===0){this.is_pending=!1;for(const a of this.#h)lt(a,kt),Mn(a);for(const a of this.#_)lt(a,Sn),Mn(a);this.#h.clear(),this.#_.clear(),this.#a&&$n(this.#a,()=>{this.#a=null}),this.#l&&(this.#e.before(this.#l),this.#l=null)}}update_pending_count(e){this.#w(e),this.#u+=e,this.#d&&La(this.#d,this.#u)}get_effect_pending(){return this.#p(),n(this.#d)}error(e){var a=this.#t.onerror;let r=this.#t.failed;if(this.#f||!a&&!r)throw e;this.#i&&(Lt(this.#i),this.#i=null),this.#a&&(Lt(this.#a),this.#a=null),this.#o&&(Lt(this.#o),this.#o=null);var i=!1,s=!1;const l=()=>{if(i){fc();return}i=!0,s&&ec(),un.ensure(),this.#u=0,this.#o!==null&&$n(this.#o,()=>{this.#o=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#b(()=>(this.#f=!1,qt(()=>this.#r(this.#e)))),this.#v>0?this.#g():this.is_pending=!1};var c=Me;try{At(null),s=!0,a?.(e,l),s=!1}catch(v){Aa(v,this.#s&&this.#s.parent)}finally{At(c)}r&&ca(()=>{this.#o=this.#b(()=>{un.ensure(),this.#f=!0;try{return qt(()=>{r(this.#e,()=>e,()=>l)})}catch(v){return Aa(v,this.#s.parent),null}finally{this.#f=!1}})})}}function kc(t,e,a,r){const i=Fr;if(a.length===0&&t.length===0){r(e.map(i));return}var s=Re,l=Ee,c=Cc();function v(){Promise.all(a.map(f=>Mc(f))).then(f=>{c();try{r([...e.map(i),...f])}catch(p){(l.f&xn)===0&&Aa(p,l)}s?.deactivate(),Sr()}).catch(f=>{Aa(f,l)})}t.length>0?Promise.all(t).then(()=>{c();try{return v()}finally{s?.deactivate(),Sr()}}):v()}function Cc(){var t=Ee,e=Me,a=Pt,r=Re;return function(s=!0){dn(t),At(e),Sa(a),s&&r?.activate()}}function Sr(){dn(null),At(null),Sa(null)}function Fr(t){var e=ft|kt,a=Me!==null&&(Me.f&ft)!==0?Me:null;return Ee!==null&&(Ee.f|=za),{ctx:Pt,deps:null,effects:null,equals:Qs,f:e,fn:t,reactions:null,rv:0,v:vt,wv:0,parent:a??Ee,ac:null}}function Mc(t,e,a){let r=Ee;r===null&&ql();var i=r.b,s=void 0,l=ia(vt),c=!Me,v=new Map;return Nc(()=>{var f=Zs();s=f.promise;try{Promise.resolve(t()).then(f.resolve,f.reject).then(()=>{p===Re&&p.committed&&p.deactivate(),Sr()})}catch(m){f.reject(m),Sr()}var p=Re;if(c){var y=i.is_rendered();i.update_pending_count(1),p.increment(y),v.get(p)?.reject(ka),v.delete(p),v.set(p,f)}const b=(m,A=void 0)=>{if(p.activate(),A)A!==ka&&(l.f|=Vn,La(l,A));else{(l.f&Vn)!==0&&(l.f^=Vn),La(l,m);for(const[k,w]of v){if(v.delete(k),k===p)break;w.reject(ka)}}c&&(i.update_pending_count(-1),p.decrement(y))};f.promise.then(b,m=>b(null,m||"unknown"))}),yo(()=>{for(const f of v.values())f.reject(ka)}),new Promise(f=>{function p(y){function b(){y===s?f(l):p(s)}y.then(b,b)}p(s)})}function H(t){const e=Fr(t);return Ao(e),e}function co(t){const e=Fr(t);return e.equals=eo,e}function uo(t){var e=t.effects;if(e!==null){t.effects=null;for(var a=0;a<e.length;a+=1)Lt(e[a])}}function Tc(t){for(var e=t.parent;e!==null;){if((e.f&ft)===0)return(e.f&xn)===0?e:null;e=e.parent}return null}function Wi(t){var e,a=Ee;dn(Tc(t));try{t.f&=~ra,uo(t),e=zo(t)}finally{dn(a)}return e}function vo(t){var e=Wi(t);if(!t.equals(e)&&(t.wv=Po(),(!Re?.is_fork||t.deps===null)&&(t.v=e,t.deps===null))){lt(t,mt);return}qn||(Jt!==null?(Ui()||Re?.is_fork)&&Jt.set(t,e):ji(t))}let Si=new Set;const Hn=new Map;let fo=!1;function ia(t,e){var a={f:0,v:t,reactions:null,equals:Qs,rv:0,wv:0};return a}function T(t,e){const a=ia(t);return Ao(a),a}function Sc(t,e=!1,a=!0){const r=ia(t);return e||(r.equals=eo),r}function _(t,e,a=!1){Me!==null&&(!Qt||(Me.f&ps)!==0)&&to()&&(Me.f&(ft|hn|Hi|ps))!==0&&!kn?.includes(t)&&$l();let r=a?_e(e):e;return La(t,r)}function La(t,e){if(!t.equals(e)){var a=t.v;qn?Hn.set(t,e):Hn.set(t,a),t.v=e;var r=un.ensure();if(r.capture(t,a),(t.f&ft)!==0){const i=t;(t.f&kt)!==0&&Wi(i),ji(i)}t.wv=Po(),ho(t,kt),Ee!==null&&(Ee.f&mt)!==0&&(Ee.f&(Tn|la))===0&&(Wt===null?Ic([t]):Wt.push(t)),!r.is_fork&&Si.size>0&&!fo&&Ac()}return e}function Ac(){fo=!1;var t=ea;Ar(!0);const e=Array.from(Si);try{for(const a of e)(a.f&mt)!==0&<(a,Sn),rr(a)&&$a(a)}finally{Ar(t)}Si.clear()}function Ja(t){_(t,t.v+1)}function ho(t,e){var a=t.reactions;if(a!==null)for(var r=a.length,i=0;i<r;i++){var s=a[i],l=s.f,c=(l&kt)===0;if(c&<(s,e),(l&ft)!==0){var v=s;Jt?.delete(v),(l&ra)===0&&(l&Kt&&(s.f|=ra),ho(v,Sn))}else c&&((l&hn)!==0&&bn!==null&&bn.add(s),Mn(s))}}function _e(t){if(typeof t!="object"||t===null||Qn in t)return t;const e=Fi(t);if(e!==Bl&&e!==Il)return t;var a=new Map,r=qs(t),i=T(0),s=ta,l=c=>{if(ta===s)return c();var v=Me,f=ta;At(null),ys(s);var p=c();return At(v),ys(f),p};return r&&a.set("length",T(t.length)),new Proxy(t,{defineProperty(c,v,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&Jl();var p=a.get(v);return p===void 0?p=l(()=>{var y=T(f.value);return a.set(v,y),y}):_(p,f.value,!0),!0},deleteProperty(c,v){var f=a.get(v);if(f===void 0){if(v in c){const p=l(()=>T(vt));a.set(v,p),Ja(i)}}else _(f,vt),Ja(i);return!0},get(c,v,f){if(v===Qn)return t;var p=a.get(v),y=v in c;if(p===void 0&&(!y||Ma(c,v)?.writable)&&(p=l(()=>{var m=_e(y?c[v]:vt),A=T(m);return A}),a.set(v,p)),p!==void 0){var b=n(p);return b===vt?void 0:b}return Reflect.get(c,v,f)},getOwnPropertyDescriptor(c,v){var f=Reflect.getOwnPropertyDescriptor(c,v);if(f&&"value"in f){var p=a.get(v);p&&(f.value=n(p))}else if(f===void 0){var y=a.get(v),b=y?.v;if(y!==void 0&&b!==vt)return{enumerable:!0,configurable:!0,value:b,writable:!0}}return f},has(c,v){if(v===Qn)return!0;var f=a.get(v),p=f!==void 0&&f.v!==vt||Reflect.has(c,v);if(f!==void 0||Ee!==null&&(!p||Ma(c,v)?.writable)){f===void 0&&(f=l(()=>{var b=p?_e(c[v]):vt,m=T(b);return m}),a.set(v,f));var y=n(f);if(y===vt)return!1}return p},set(c,v,f,p){var y=a.get(v),b=v in c;if(r&&v==="length")for(var m=f;m<y.v;m+=1){var A=a.get(m+"");A!==void 0?_(A,vt):m in c&&(A=l(()=>T(vt)),a.set(m+"",A))}if(y===void 0)(!b||Ma(c,v)?.writable)&&(y=l(()=>T(void 0)),_(y,_e(f)),a.set(v,y));else{b=y.v!==vt;var k=l(()=>_e(f));_(y,k)}var w=Reflect.getOwnPropertyDescriptor(c,v);if(w?.set&&w.set.call(p,f),!b){if(r&&typeof v=="string"){var C=a.get("length"),z=Number(v);Number.isInteger(z)&&z>=C.v&&_(C,z+1)}Ja(i)}return!0},ownKeys(c){n(i);var v=Reflect.ownKeys(c).filter(y=>{var b=a.get(y);return b===void 0||b.v!==vt});for(var[f,p]of a)p.v!==vt&&!(f in c)&&v.push(f);return v},setPrototypeOf(){Ql()}})}var Un,_o,po,mo;function Lc(){if(Un===void 0){Un=window,_o=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,a=Text.prototype;po=Ma(e,"firstChild").get,mo=Ma(e,"nextSibling").get,_s(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),_s(a)&&(a.__t=void 0)}}function jn(t=""){return document.createTextNode(t)}function Pa(t){return po.call(t)}function tr(t){return mo.call(t)}function o(t,e){return Pa(t)}function oe(t,e=!1){{var a=Pa(t);return a instanceof Comment&&a.data===""?tr(a):a}}function u(t,e=1,a=!1){let r=t;for(;e--;)r=tr(r);return r}function Pc(t){t.textContent=""}function bo(){return!1}let bs=!1;function Ec(){bs||(bs=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function Oa(t){var e=Me,a=Ee;At(null),dn(null);try{return t()}finally{At(e),dn(a)}}function go(t,e,a,r=a){t.addEventListener(e,()=>Oa(a));const i=t.__on_r;i?t.__on_r=()=>{i(),r(!0)}:t.__on_r=()=>r(!0),Ec()}function zc(t){Ee===null&&(Me===null&&Yl(),Zl()),qn&&Kl()}function Oc(t,e){var a=e.last;a===null?e.last=e.first=t:(a.next=t,t.prev=a,e.last=t)}function An(t,e,a){var r=Ee;r!==null&&(r.f&Rt)!==0&&(t|=Rt);var i={ctx:Pt,deps:null,nodes:null,f:t|kt|Kt,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(a)try{$a(i),i.f|=Br}catch(c){throw Lt(i),c}else e!==null&&Mn(i);var s=i;if(a&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&za)===0&&(s=s.first,(t&hn)!==0&&(t&Cn)!==0&&s!==null&&(s.f|=Cn)),s!==null&&(s.parent=r,r!==null&&Oc(s,r),Me!==null&&(Me.f&ft)!==0&&(t&la)===0)){var l=Me;(l.effects??=[]).push(s)}return i}function Ui(){return Me!==null&&!Qt}function yo(t){const e=An(Rr,null,!1);return lt(e,mt),e.teardown=t,e}function xt(t){zc();var e=Ee.f,a=!Me&&(e&Tn)!==0&&(e&Br)===0;if(a){var r=Pt;(r.e??=[]).push(t)}else return wo(t)}function wo(t){return An(Tr|jl,t,!1)}function Dc(t){un.ensure();const e=An(la|za,t,!0);return(a={})=>new Promise(r=>{a.outro?$n(e,()=>{Lt(e),r(void 0)}):(Lt(e),r(void 0))})}function Vr(t){return An(Tr,t,!1)}function Nc(t){return An(Hi|za,t,!0)}function nr(t,e=0){return An(Rr|e,t,!0)}function $(t,e=[],a=[],r=[]){kc(r,e,a,i=>{An(Rr,()=>t(...i.map(n)),!0)})}function ar(t,e=0){var a=An(hn|e,t,!0);return a}function qt(t){return An(Tn|za,t,!0)}function xo(t){var e=t.teardown;if(e!==null){const a=qn,r=Me;gs(!0),At(null);try{e.call(null)}finally{gs(a),At(r)}}}function ko(t,e=!1){var a=t.first;for(t.first=t.last=null;a!==null;){const i=a.ac;i!==null&&Oa(()=>{i.abort(ka)});var r=a.next;(a.f&la)!==0?a.parent=null:Lt(a,e),a=r}}function Rc(t){for(var e=t.first;e!==null;){var a=e.next;(e.f&Tn)===0&&Lt(e),e=a}}function Lt(t,e=!0){var a=!1;(e||(t.f&Xs)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(Bc(t.nodes.start,t.nodes.end),a=!0),ko(t,e&&!a),Lr(t,0),lt(t,xn);var r=t.nodes&&t.nodes.t;if(r!==null)for(const s of r)s.stop();xo(t);var i=t.parent;i!==null&&i.first!==null&&Co(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function Bc(t,e){for(;t!==null;){var a=t===e?null:tr(t);t.remove(),t=a}}function Co(t){var e=t.parent,a=t.prev,r=t.next;a!==null&&(a.next=r),r!==null&&(r.prev=a),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=a))}function $n(t,e,a=!0){var r=[];Mo(t,r,!0);var i=()=>{a&&Lt(t),e&&e()},s=r.length;if(s>0){var l=()=>--s||i();for(var c of r)c.out(l)}else i()}function Mo(t,e,a){if((t.f&Rt)===0){t.f^=Rt;var r=t.nodes&&t.nodes.t;if(r!==null)for(const c of r)(c.is_global||a)&&e.push(c);for(var i=t.first;i!==null;){var s=i.next,l=(i.f&Cn)!==0||(i.f&Tn)!==0&&(t.f&hn)!==0;Mo(i,e,l?a:!1),i=s}}}function qi(t){To(t,!0)}function To(t,e){if((t.f&Rt)!==0){t.f^=Rt,(t.f&mt)===0&&(lt(t,kt),Mn(t));for(var a=t.first;a!==null;){var r=a.next,i=(a.f&Cn)!==0||(a.f&Tn)!==0;To(a,i?e:!1),a=r}var s=t.nodes&&t.nodes.t;if(s!==null)for(const l of s)(l.is_global||e)&&l.in()}}function So(t,e){if(t.nodes)for(var a=t.nodes.start,r=t.nodes.end;a!==null;){var i=a===r?null:tr(a);e.append(a),a=i}}let ea=!1;function Ar(t){ea=t}let qn=!1;function gs(t){qn=t}let Me=null,Qt=!1;function At(t){Me=t}let Ee=null;function dn(t){Ee=t}let kn=null;function Ao(t){Me!==null&&(kn===null?kn=[t]:kn.push(t))}let yt=null,Nt=0,Wt=null;function Ic(t){Wt=t}let Lo=1,Qa=0,ta=Qa;function ys(t){ta=t}function Po(){return++Lo}function rr(t){var e=t.f;if((e&kt)!==0)return!0;if(e&ft&&(t.f&=~ra),(e&Sn)!==0){for(var a=t.deps,r=a.length,i=0;i<r;i++){var s=a[i];if(rr(s)&&vo(s),s.wv>t.wv)return!0}(e&Kt)!==0&&Jt===null&<(t,mt)}return!1}function Eo(t,e,a=!0){var r=t.reactions;if(r!==null&&!kn?.includes(t))for(var i=0;i<r.length;i++){var s=r[i];(s.f&ft)!==0?Eo(s,e,!1):e===s&&(a?lt(s,kt):(s.f&mt)!==0&<(s,Sn),Mn(s))}}function zo(t){var e=yt,a=Nt,r=Wt,i=Me,s=kn,l=Pt,c=Qt,v=ta,f=t.f;yt=null,Nt=0,Wt=null,Me=(f&(Tn|la))===0?t:null,kn=null,Sa(t.ctx),Qt=!1,ta=++Qa,t.ac!==null&&(Oa(()=>{t.ac.abort(ka)}),t.ac=null);try{t.f|=Mi;var p=t.fn,y=p(),b=t.deps;if(yt!==null){var m;if(Lr(t,Nt),b!==null&&Nt>0)for(b.length=Nt+yt.length,m=0;m<yt.length;m++)b[Nt+m]=yt[m];else t.deps=b=yt;if(Ui()&&(t.f&Kt)!==0)for(m=Nt;m<b.length;m++)(b[m].reactions??=[]).push(t)}else b!==null&&Nt<b.length&&(Lr(t,Nt),b.length=Nt);if(to()&&Wt!==null&&!Qt&&b!==null&&(t.f&(ft|Sn|kt))===0)for(m=0;m<Wt.length;m++)Eo(Wt[m],t);return i!==null&&i!==t&&(Qa++,Wt!==null&&(r===null?r=Wt:r.push(...Wt))),(t.f&Vn)!==0&&(t.f^=Vn),y}catch(A){return ao(A)}finally{t.f^=Mi,yt=e,Nt=a,Wt=r,Me=i,kn=s,Sa(l),Qt=c,ta=v}}function Fc(t,e){let a=e.reactions;if(a!==null){var r=Nl.call(a,t);if(r!==-1){var i=a.length-1;i===0?a=e.reactions=null:(a[r]=a[i],a.pop())}}if(a===null&&(e.f&ft)!==0&&(yt===null||!yt.includes(e))){var s=e;(s.f&Kt)!==0&&(s.f^=Kt,s.f&=~ra),ji(s),uo(s),Lr(s,0)}}function Lr(t,e){var a=t.deps;if(a!==null)for(var r=e;r<a.length;r++)Fc(t,a[r])}function $a(t){var e=t.f;if((e&xn)===0){lt(t,mt);var a=Ee,r=ea;Ee=t,ea=!0;try{(e&(hn|Ys))!==0?Rc(t):ko(t),xo(t);var i=zo(t);t.teardown=typeof i=="function"?i:null,t.wv=Lo;var s;Ci&&hc&&(t.f&kt)!==0&&t.deps}finally{ea=r,Ee=a}}}async function Ca(){await Promise.resolve(),mc()}function n(t){var e=t.f,a=(e&ft)!==0;if(Me!==null&&!Qt){var r=Ee!==null&&(Ee.f&xn)!==0;if(!r&&!kn?.includes(t)){var i=Me.deps;if((Me.f&Mi)!==0)t.rv<Qa&&(t.rv=Qa,yt===null&&i!==null&&i[Nt]===t?Nt++:yt===null?yt=[t]:yt.includes(t)||yt.push(t));else{(Me.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[Me]:s.includes(Me)||s.push(Me)}}}if(qn&&Hn.has(t))return Hn.get(t);if(a){var l=t;if(qn){var c=l.v;return((l.f&mt)===0&&l.reactions!==null||Do(l))&&(c=Wi(l)),Hn.set(l,c),c}var v=(l.f&Kt)===0&&!Qt&&Me!==null&&(ea||(Me.f&Kt)!==0),f=l.deps===null;rr(l)&&(v&&(l.f|=Kt),vo(l)),v&&!f&&Oo(l)}if(Jt?.has(t))return Jt.get(t);if((t.f&Vn)!==0)throw t.v;return t.v}function Oo(t){if(t.deps!==null){t.f|=Kt;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&ft)!==0&&(e.f&Kt)===0&&Oo(e)}}function Do(t){if(t.v===vt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Hn.has(e)||(e.f&ft)!==0&&Do(e))return!0;return!1}function _n(t){var e=Qt;try{return Qt=!0,t()}finally{Qt=e}}function Vc(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Qn in t)Ai(t);else if(!Array.isArray(t))for(let e in t){const a=t[e];typeof a=="object"&&a&&Qn in a&&Ai(a)}}}function Ai(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Ai(t[r],e)}catch{}const a=Fi(t);if(a!==Object.prototype&&a!==Array.prototype&&a!==Map.prototype&&a!==Set.prototype&&a!==Date.prototype){const r=Ks(a);for(let i in r){const s=r[i].get;if(s)try{s.call(t)}catch{}}}}}const Hc=["touchstart","touchmove"];function jc(t){return Hc.includes(t)}const No=new Set,Li=new Set;function Wc(t,e,a,r={}){function i(s){if(r.capture||Za.call(e,s),!s.cancelBubble)return Oa(()=>a?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?ca(()=>{e.addEventListener(t,i,r)}):e.addEventListener(t,i,r),i}function Kn(t,e,a,r,i){var s={capture:r,passive:i},l=Wc(t,e,a,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&yo(()=>{e.removeEventListener(t,l,s)})}function ht(t){for(var e=0;e<t.length;e++)No.add(t[e]);for(var a of Li)a(t)}let ws=null;function Za(t){var e=this,a=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;ws=t;var l=0,c=ws===t&&t.__root;if(c){var v=i.indexOf(c);if(v!==-1&&(e===document||e===window)){t.__root=e;return}var f=i.indexOf(e);if(f===-1)return;v<=f&&(l=v)}if(s=i[l]||t.target,s!==e){Rl(t,"currentTarget",{configurable:!0,get(){return s||a}});var p=Me,y=Ee;At(null),dn(null);try{for(var b,m=[];s!==null;){var A=s.assignedSlot||s.parentNode||s.host||null;try{var k=s["__"+r];k!=null&&(!s.disabled||t.target===s)&&k.call(s,t)}catch(w){b?m.push(w):b=w}if(t.cancelBubble||A===e||A===null)break;s=A}if(b){for(let w of m)queueMicrotask(()=>{throw w});throw b}}finally{t.__root=e,delete t.currentTarget,At(p),dn(y)}}}function Ro(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Pr(t,e){var a=Ee;a.nodes===null&&(a.nodes={start:t,end:e,a:null,t:null})}function U(t,e){var a=(e&uc)!==0,r=(e&vc)!==0,i,s=!t.startsWith("<!>");return()=>{i===void 0&&(i=Ro(s?t:"<!>"+t),a||(i=Pa(i)));var l=r||_o?document.importNode(i,!0):i.cloneNode(!0);if(a){var c=Pa(l),v=l.lastChild;Pr(c,v)}else Pr(l,l);return l}}function Uc(t,e,a="svg"){var r=!t.startsWith("<!>"),i=`<${a}>${r?t:"<!>"+t}</${a}>`,s;return()=>{if(!s){var l=Ro(i),c=Pa(l);s=Pa(c)}var v=s.cloneNode(!0);return Pr(v,v),v}}function Ki(t,e){return Uc(t,e,"svg")}function Se(){var t=document.createDocumentFragment(),e=document.createComment(""),a=jn();return t.append(e,a),Pr(e,a),t}function E(t,e){t!==null&&t.before(e)}let Pi=!0;function g(t,e){var a=e==null?"":typeof e=="object"?e+"":e;a!==(t.__t??=t.nodeValue)&&(t.__t=a,t.nodeValue=a+"")}function qc(t,e){return Kc(t,e)}const xa=new Map;function Kc(t,{target:e,anchor:a,props:r={},events:i,context:s,intro:l=!0}){Lc();var c=new Set,v=y=>{for(var b=0;b<y.length;b++){var m=y[b];if(!c.has(m)){c.add(m);var A=jc(m);e.addEventListener(m,Za,{passive:A});var k=xa.get(m);k===void 0?(document.addEventListener(m,Za,{passive:A}),xa.set(m,1)):xa.set(m,k+1)}}};v(Nr(No)),Li.add(v);var f=void 0,p=Dc(()=>{var y=a??e.appendChild(jn());return wc(y,{pending:()=>{}},b=>{if(s){Xe({});var m=Pt;m.c=s}i&&(r.$$events=i),Pi=l,f=t(b,r)||{},Pi=!0,s&&Ge()}),()=>{for(var b of c){e.removeEventListener(b,Za);var m=xa.get(b);--m===0?(document.removeEventListener(b,Za),xa.delete(b)):xa.set(b,m)}Li.delete(v),y!==a&&y.parentNode?.removeChild(y)}});return Zc.set(f,p),f}let Zc=new WeakMap;class Zi{anchor;#e=new Map;#n=new Map;#t=new Map;#r=new Set;#s=!0;constructor(e,a=!0){this.anchor=e,this.#s=a}#i=()=>{var e=Re;if(this.#e.has(e)){var a=this.#e.get(e),r=this.#n.get(a);if(r)qi(r),this.#r.delete(a);else{var i=this.#t.get(a);i&&(this.#n.set(a,i.effect),this.#t.delete(a),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,l]of this.#e){if(this.#e.delete(s),s===e)break;const c=this.#t.get(l);c&&(Lt(c.effect),this.#t.delete(l))}for(const[s,l]of this.#n){if(s===a||this.#r.has(s))continue;const c=()=>{if(Array.from(this.#e.values()).includes(s)){var f=document.createDocumentFragment();So(l,f),f.append(jn()),this.#t.set(s,{effect:l,fragment:f})}else Lt(l);this.#r.delete(s),this.#n.delete(s)};this.#s||!r?(this.#r.add(s),$n(l,c,!1)):c()}}};#a=e=>{this.#e.delete(e);const a=Array.from(this.#e.values());for(const[r,i]of this.#t)a.includes(r)||(Lt(i.effect),this.#t.delete(r))};ensure(e,a){var r=Re,i=bo();if(a&&!this.#n.has(e)&&!this.#t.has(e))if(i){var s=document.createDocumentFragment(),l=jn();s.append(l),this.#t.set(e,{effect:qt(()=>a(l)),fragment:s})}else this.#n.set(e,qt(()=>a(this.anchor)));if(this.#e.set(r,e),i){for(const[c,v]of this.#n)c===e?r.skipped_effects.delete(v):r.skipped_effects.add(v);for(const[c,v]of this.#t)c===e?r.skipped_effects.delete(v.effect):r.skipped_effects.add(v.effect);r.oncommit(this.#i),r.ondiscard(this.#a)}else this.#i()}}function ee(t,e,a=!1){var r=new Zi(t),i=a?Cn:0;function s(l,c){r.ensure(l,c)}ar(()=>{var l=!1;e((c,v=!0)=>{l=!0,s(v,c)}),l||s(!1,null)},i)}function Et(t,e){return e}function Yc(t,e,a){for(var r=[],i=e.length,s,l=e.length,c=0;c<i;c++){let y=e[c];$n(y,()=>{if(s){if(s.pending.delete(y),s.done.add(y),s.pending.size===0){var b=t.outrogroups;Ei(Nr(s.done)),b.delete(s),b.size===0&&(t.outrogroups=null)}}else l-=1},!1)}if(l===0){var v=r.length===0&&a!==null;if(v){var f=a,p=f.parentNode;Pc(p),p.append(f),t.items.clear()}Ei(e,!v)}else s={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(s)}function Ei(t,e=!0){for(var a=0;a<t.length;a++)Lt(t[a],e)}var xs;function ot(t,e,a,r,i,s=null){var l=t,c=new Map,v=(e&Js)!==0;if(v){var f=t;l=f.appendChild(jn())}var p=null,y=co(()=>{var C=a();return qs(C)?C:C==null?[]:Nr(C)}),b,m=!0;function A(){w.fallback=p,Xc(w,b,l,e,r),p!==null&&(b.length===0?(p.f&wn)===0?qi(p):(p.f^=wn,Ya(p,null,l)):$n(p,()=>{p=null}))}var k=ar(()=>{b=n(y);for(var C=b.length,z=new Set,R=Re,x=bo(),M=0;M<C;M+=1){var S=b[M],N=r(S,M),K=m?null:c.get(N);K?(K.v&&La(K.v,S),K.i&&La(K.i,M),x&&R.skipped_effects.delete(K.e)):(K=Gc(c,m?l:xs??=jn(),S,N,M,i,e,a),m||(K.e.f|=wn),c.set(N,K)),z.add(N)}if(C===0&&s&&!p&&(m?p=qt(()=>s(l)):(p=qt(()=>s(xs??=jn())),p.f|=wn)),!m)if(x){for(const[D,L]of c)z.has(D)||R.skipped_effects.add(L.e);R.oncommit(A),R.ondiscard(()=>{})}else A();n(y)}),w={effect:k,items:c,outrogroups:null,fallback:p};m=!1}function Xc(t,e,a,r,i){var s=(r&ac)!==0,l=e.length,c=t.items,v=t.effect.first,f,p=null,y,b=[],m=[],A,k,w,C;if(s)for(C=0;C<l;C+=1)A=e[C],k=i(A,C),w=c.get(k).e,(w.f&wn)===0&&(w.nodes?.a?.measure(),(y??=new Set).add(w));for(C=0;C<l;C+=1){if(A=e[C],k=i(A,C),w=c.get(k).e,t.outrogroups!==null)for(const L of t.outrogroups)L.pending.delete(w),L.done.delete(w);if((w.f&wn)!==0)if(w.f^=wn,w===v)Ya(w,null,a);else{var z=p?p.next:v;w===t.effect.last&&(t.effect.last=w.prev),w.prev&&(w.prev.next=w.next),w.next&&(w.next.prev=w.prev),Rn(t,p,w),Rn(t,w,z),Ya(w,z,a),p=w,b=[],m=[],v=p.next;continue}if((w.f&Rt)!==0&&(qi(w),s&&(w.nodes?.a?.unfix(),(y??=new Set).delete(w))),w!==v){if(f!==void 0&&f.has(w)){if(b.length<m.length){var R=m[0],x;p=R.prev;var M=b[0],S=b[b.length-1];for(x=0;x<b.length;x+=1)Ya(b[x],R,a);for(x=0;x<m.length;x+=1)f.delete(m[x]);Rn(t,M.prev,S.next),Rn(t,p,M),Rn(t,S,R),v=R,p=S,C-=1,b=[],m=[]}else f.delete(w),Ya(w,v,a),Rn(t,w.prev,w.next),Rn(t,w,p===null?t.effect.first:p.next),Rn(t,p,w),p=w;continue}for(b=[],m=[];v!==null&&v!==w;)(f??=new Set).add(v),m.push(v),v=v.next;if(v===null)continue}(w.f&wn)===0&&b.push(w),p=w,v=w.next}if(t.outrogroups!==null){for(const L of t.outrogroups)L.pending.size===0&&(Ei(Nr(L.done)),t.outrogroups?.delete(L));t.outrogroups.size===0&&(t.outrogroups=null)}if(v!==null||f!==void 0){var N=[];if(f!==void 0)for(w of f)(w.f&Rt)===0&&N.push(w);for(;v!==null;)(v.f&Rt)===0&&v!==t.fallback&&N.push(v),v=v.next;var K=N.length;if(K>0){var D=(r&Js)!==0&&l===0?a:null;if(s){for(C=0;C<K;C+=1)N[C].nodes?.a?.measure();for(C=0;C<K;C+=1)N[C].nodes?.a?.fix()}Yc(t,N,D)}}s&&ca(()=>{if(y!==void 0)for(w of y)w.nodes?.a?.apply()})}function Gc(t,e,a,r,i,s,l,c){var v=(l&tc)!==0?(l&rc)===0?Sc(a,!1,!1):ia(a):null,f=(l&nc)!==0?ia(i):null;return{v,i:f,e:qt(()=>(s(e,v??a,f??i,c),()=>{t.delete(r)}))}}function Ya(t,e,a){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end,s=e&&(e.f&wn)===0?e.nodes.start:a;r!==null;){var l=tr(r);if(s.before(r),r===i)return;r=l}}function Rn(t,e,a){e===null?t.effect.first=a:e.next=a,a===null?t.effect.last=e:a.prev=e}function Bn(t,e,...a){var r=new Zi(t);ar(()=>{const i=e()??null;r.ensure(i,i&&(s=>i(s,...a)))},Cn)}function zi(t,e,a){var r=new Zi(t);ar(()=>{var i=e()??null;r.ensure(i,i&&(s=>a(s,i)))},Cn)}const Jc=()=>performance.now(),gn={tick:t=>requestAnimationFrame(t),now:()=>Jc(),tasks:new Set};function Bo(){const t=gn.now();gn.tasks.forEach(e=>{e.c(t)||(gn.tasks.delete(e),e.f())}),gn.tasks.size!==0&&gn.tick(Bo)}function Qc(t){let e;return gn.tasks.size===0&&gn.tick(Bo),{promise:new Promise(a=>{gn.tasks.add(e={c:t,f:a})}),abort(){gn.tasks.delete(e)}}}function yr(t,e){Oa(()=>{t.dispatchEvent(new CustomEvent(e))})}function $c(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;const e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(a=>a[0].toUpperCase()+a.slice(1)).join("")}function ks(t){const e={},a=t.split(";");for(const r of a){const[i,s]=r.split(":");if(!i||s===void 0)break;const l=$c(i.trim());e[l]=s.trim()}return e}const eu=t=>t;function tu(t,e,a,r){var i=(t&cc)!==0,s="both",l,c=e.inert,v=e.style.overflow,f,p;function y(){return Oa(()=>l??=a()(e,r?.()??{},{direction:s}))}var b={is_global:i,in(){e.inert=c,yr(e,"introstart"),f=Oi(e,y(),p,1,()=>{yr(e,"introend"),f?.abort(),f=l=void 0,e.style.overflow=v})},out(w){e.inert=!0,yr(e,"outrostart"),p=Oi(e,y(),f,0,()=>{yr(e,"outroend"),w?.()})},stop:()=>{f?.abort(),p?.abort()}},m=Ee;if((m.nodes.t??=[]).push(b),Pi){var A=i;if(!A){for(var k=m.parent;k&&(k.f&Cn)!==0;)for(;(k=k.parent)&&(k.f&hn)===0;);A=!k||(k.f&Br)!==0}A&&Vr(()=>{_n(()=>b.in())})}}function Oi(t,e,a,r,i){var s=r===1;if(Fl(e)){var l,c=!1;return ca(()=>{if(!c){var w=e({direction:s?"in":"out"});l=Oi(t,w,a,r,i)}}),{abort:()=>{c=!0,l?.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(a?.deactivate(),!e?.duration)return i(),{abort:cn,deactivate:cn,reset:cn,t:()=>r};const{delay:v=0,css:f,tick:p,easing:y=eu}=e;var b=[];if(s&&a===void 0&&(p&&p(0,1),f)){var m=ks(f(0,1));b.push(m,m)}var A=()=>1-r,k=t.animate(b,{duration:v,fill:"forwards"});return k.onfinish=()=>{k.cancel();var w=a?.t()??1-r;a?.abort();var C=r-w,z=e.duration*Math.abs(C),R=[];if(z>0){var x=!1;if(f)for(var M=Math.ceil(z/16.666666666666668),S=0;S<=M;S+=1){var N=w+C*y(S/M),K=ks(f(N,1-N));R.push(K),x||=K.overflow==="hidden"}x&&(t.style.overflow="hidden"),A=()=>{var D=k.currentTime;return w+C*y(D/z)},p&&Qc(()=>{if(k.playState!=="running")return!1;var D=A();return p(D,1-D),!0})}k=t.animate(R,{duration:z,fill:"forwards"}),k.onfinish=()=>{A=()=>r,p?.(r,1-r),i()}},{abort:()=>{k&&(k.cancel(),k.effect=null,k.onfinish=cn)},deactivate:()=>{i=cn},reset:()=>{r===0&&p?.(1,0)},t:()=>A()}}function nu(t,e,a){Vr(()=>{var r=_n(()=>e(t,a?.())||{});if(a&&r?.update){var i=!1,s={};nr(()=>{var l=a();Vc(l),i&&$s(s,l)&&(s=l,r.update(l))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Io(t){var e,a,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(a=Io(t[e]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function Mr(){for(var t,e,a=0,r="",i=arguments.length;a<i;a++)(t=arguments[a])&&(e=Io(t))&&(r&&(r+=" "),r+=e);return r}function au(t){return typeof t=="object"?Mr(t):t??""}const Cs=[...` +\r\f \v\uFEFF`];function ru(t,e,a){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),a){for(var i in a)if(a[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,l=0;(l=r.indexOf(i,l))>=0;){var c=l+s;(l===0||Cs.includes(r[l-1]))&&(c===r.length||Cs.includes(r[c]))?r=(l===0?"":r.substring(0,l))+r.substring(c+1):l=c}}return r===""?null:r}function iu(t,e){return t==null?null:String(t)}function Ne(t,e,a,r,i,s){var l=t.__className;if(l!==a||l===void 0){var c=ru(a,r,s);c==null?t.removeAttribute("class"):e?t.className=c:t.setAttribute("class",c),t.__className=a}else if(s&&i!==s)for(var v in s){var f=!!s[v];(i==null||f!==!!i[v])&&t.classList.toggle(v,f)}return s}function yn(t,e,a,r){var i=t.__style;if(i!==e){var s=iu(e);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}return r}const su=Symbol("is custom element"),ou=Symbol("is html");function lu(t,e){var a=Yi(t);a.value===(a.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function cu(t,e){var a=Yi(t);a.checked!==(a.checked=e??void 0)&&(t.checked=e)}function Ke(t,e,a,r){var i=Yi(t);i[e]!==(i[e]=a)&&(e==="loading"&&(t[Ul]=a),a==null?t.removeAttribute(e):typeof a!="string"&&uu(t).includes(e)?t[e]=a:t.setAttribute(e,a))}function Yi(t){return t.__attributes??={[su]:t.nodeName.includes("-"),[ou]:t.namespaceURI===dc}}var Ms=new Map;function uu(t){var e=t.getAttribute("is")||t.nodeName,a=Ms.get(e);if(a)return a;Ms.set(e,a=[]);for(var r,i=t,s=Element.prototype;s!==i;){r=Ks(i);for(var l in r)r[l].set&&a.push(l);i=Fi(i)}return a}function st(t,e,a=e){var r=new WeakSet;go(t,"input",async i=>{var s=i?t.defaultValue:t.value;if(s=yi(t)?wi(s):s,a(s),Re!==null&&r.add(Re),await Ca(),s!==(s=e())){var l=t.selectionStart,c=t.selectionEnd,v=t.value.length;if(t.value=s??"",c!==null){var f=t.value.length;l===c&&c===v&&f>v?(t.selectionStart=f,t.selectionEnd=f):(t.selectionStart=l,t.selectionEnd=Math.min(c,f))}}}),_n(e)==null&&t.value&&(a(yi(t)?wi(t.value):t.value),Re!==null&&r.add(Re)),nr(()=>{var i=e();if(t===document.activeElement){var s=Cr??Re;if(r.has(s))return}yi(t)&&i===wi(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function wr(t,e,a=e){go(t,"change",r=>{var i=r?t.defaultChecked:t.checked;a(i)}),_n(e)==null&&a(t.checked),nr(()=>{var r=e();t.checked=!!r})}function yi(t){var e=t.type;return e==="number"||e==="range"}function wi(t){return t===""?null:+t}class Xi{#e=new WeakMap;#n;#t;static entries=new WeakMap;constructor(e){this.#t=e}observe(e,a){var r=this.#e.get(e)||new Set;return r.add(a),this.#e.set(e,r),this.#r().observe(e,this.#t),()=>{var i=this.#e.get(e);i.delete(a),i.size===0&&(this.#e.delete(e),this.#n.unobserve(e))}}#r(){return this.#n??(this.#n=new ResizeObserver(e=>{for(var a of e){Xi.entries.set(a.target,a);for(var r of this.#e.get(a.target)||[])r(a)}}))}}var vu=new Xi({box:"border-box"});function Ts(t,e,a){var r=vu.observe(t,()=>a(t[e]));Vr(()=>(_n(()=>a(t[e])),r))}function Ss(t,e){return t===e||t?.[Qn]===e}function na(t={},e,a,r){return Vr(()=>{var i,s;return nr(()=>{i=s,s=[],_n(()=>{t!==a(...s)&&(e(t,...s),i&&Ss(a(...i),t)&&e(null,...i))})}),()=>{ca(()=>{s&&Ss(a(...s),t)&&e(null,...s)})}}),t}let xr=!1;function du(t){var e=xr;try{return xr=!1,[t(),xr]}finally{xr=e}}function dt(t,e,a,r){var i=(a&oc)!==0,s=(a&lc)!==0,l=r,c=!0,v=()=>(c&&(c=!1,l=s?_n(r):r),l),f;if(i){var p=Qn in t||Wl in t;f=Ma(t,e)?.set??(p&&e in t?z=>t[e]=z:void 0)}var y,b=!1;i?[y,b]=du(()=>t[e]):y=t[e],y===void 0&&r!==void 0&&(y=v(),f&&(Gl(),f(y)));var m;if(m=()=>{var z=t[e];return z===void 0?v():(c=!0,z)},(a&sc)===0)return m;if(f){var A=t.$$legacy;return(function(z,R){return arguments.length>0?((!R||A||b)&&f(R?m():z),z):m()})}var k=!1,w=((a&ic)!==0?Fr:co)(()=>(k=!1,m()));i&&n(w);var C=Ee;return(function(z,R){if(arguments.length>0){const x=R?n(w):i?_e(z):z;return _(w,x),k=!0,l!==void 0&&(l=x),z}return qn&&k||(C.f&xn)!==0?w.v:n(w)})}function Fo(t){Pt===null&&Gs(),xt(()=>{const e=_n(t);if(typeof e=="function")return e})}function fu(t){Pt===null&&Gs(),Fo(()=>()=>_n(t))}const hu="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(hu);const _u={admin_menu:"Admin Menu",admin_dashboard:"Admin Dashboard",dashboard_home:"Dashboard Home",dashboard_snapshot:"Current server snapshot and player economy overview.",admin_menu_desc:"Manage everything in your server",quick_admin_menu:"Quick Admin Menu",quick_actions:"Quick Actions",open_admin_dashboard:"Open Admin Dashboard",open_admin_menu:"Open Admin Menu",admin_menu_self:"Self",admin_menu_vehicle:"Vehicle",admin_menu_utility:"Utility",search_anything:"Search anything...",server_online:"Server Online",server_uptime:"Uptime",players:"Players",target:"Target",search_player:"Search player...",search_vehicle:"Search vehicle...",search_banned_identifier:"Search banned identifier or ban reason...",player_management:"Player Management",players_list:"Players List",vehicles_list:"Vehicles List",player_search:"Player Search",recent_players:"Recent Players",no_players_found:"No players found...",bans_list:"Bans List",id:"ID",name:"Name",money:"Cash",total_money:"Total Money",avg_money:"Avg Money",avg_money_per_player:"Avg Money / Player",active_staff:"Active Staff",non_staff:"Non Staff",available_slots:"Available Slots",money_distribution:"Money Distribution",economy_summary:"Economy Summary",median_money:"Median Money",richest_player:"Richest Player",avg_money_breakdown:"Avg Money Breakdown",health_distribution:"Health Distribution",avg_health:"Avg Health",avg_armor:"Avg Armor",player_counts:"Player Counts",player_condition:"Player Condition",staff_overview:"Staff Overview",active_player_job_distribution:"Active Player Job Distribution",top_jobs:"Top Jobs",wealth_bands:"Wealth Bands",bank_money:"Bank Money",black_money:"Black Money",health:"Health",armor:"Armor",last_visited:"Last visited",gender:"Gender",male:"Male",female:"Female",job:"Job",job_grade:"Job Grade",identifier:"Identifier",ip_address:"IP Address",char_identifier:"Character Identifier",play_time:"Play Time",position:"Position",identifiers:"Identifiers",routing_bucket:"Routing Bucket",radio_channel:"Radio Channel",thirst:"Thirst",hunger:"Hunger",player_information:"Player Information",information:"Information",teleport:"Teleport",bring:"Bring",spectate:"Spectate",notify_player:"Notify Player",notification_message:"Message",give_money:"Give Cash",take_money:"Take Cash",set_health:"Set Health",set_armor:"Set Armor",clean_inventory:"Clean Inventory",player_tools:"Player Tools",kill_player:"Kill Player",revive_player:"Revive Player",freeze_player:"Freeze Player",unfreeze_player:"Unfreeze Player",set_model:"Set Model",open_clothing:"Open Clothing",give_all_weapons:"Give All Weapons",set_bucket:"Set Bucket",set_radio:"Set Radio",set_job:"Set Job",set_name:"Set Name",set_thirst:"Set Thirst",set_hunger:"Set Hunger",ace_add:"Add ACE Group",ace_remove:"Remove ACE Group",model_name:"Model Name",ace_group:"ACE Group",first_name:"First Name",last_name:"Last Name",delete_character:"Delete Character",troll_options:"Troll Options",troll_burn:"Burn",troll_explode:"Explode",troll_sky:"Teleport to Sky",troll_random:"Random Teleport",troll_nausea:"Nausea",noclip:"NoClip",show_names:"Show Names",show_blips:"Show Blips",godmode:"Godmode",invisible:"Invisible",infinite_ammo:"Infinite Ammo",revive:"Revive",heal:"Heal",spawn_vehicle:"Spawn Vehicle",vehicle_spawner:"Vehicle Spawner",vehicle_model:"Vehicle Model",vehicle_color:"Vehicle Color",primary_color:"Primary Color",secondary_color:"Secondary Color",customize_vehicle:"Customize Vehicle",customize_vehicle_hint:"Use left and right arrows to change vehicle stages.",spawn_tuned:"Spawn Tuned",engine_level:"Engine",brake_level:"Brakes",transmission_level:"Transmission",suspension_level:"Suspension",vehicle_armor:"Vehicle Armor",turbo:"Turbo",xenon_lights:"Xenon",neon_lights:"Neon",neon_color:"Neon Color",window_tint:"Window Tint",wheel_category:"Wheel Category",wheel_design:"Disc Design",bulletproof_tires:"Bulletproof Tires",apply_performance:"Apply Performance",apply_customization:"Apply Customization",max_performance:"Max Performance",repair_vehicle:"Repair Vehicle",clean_vehicle:"Clean Vehicle",flip_vehicle:"Flip Vehicle",teleport_waypoint:"Teleport Waypoint",copy_coords:"Copy Coords",delete_current_vehicle:"Delete Vehicle",quick_menu_hint:"Arrow keys move, Tab changes tabs, Enter runs, Backspace closes.",quick_menu_edit_hint:"Tab changes tabs, left/right change values, Enter selects.",back:"Back",kick:"Kick",ban:"Ban",never:"Never",copied_to_clipboard:"Copied to clipboard",online:"Online",offline:"Offline",on:"On",off:"Off",player:"Player:",reason:"Reason",kick_reason_placeholder:"Enter kick reason.",ban_reason_placeholder:"Enter ban reason",duration:"Duration",minutes:"Minutes",hours:"Hours",days:"Days",months:"Months",years:"Years",permanent:"Permanent",duration_desc:"Not entering a duration bans the user permanently.",cancel:"Cancel",confirm:"Confirm",escape_spectate:"Press [ESC] to stop spectating",default_ban:"You are banned from this server!",finalizing_connection:"Finalizing connection...",banned_by:"Banned By",banned_at:"Banned At",expires_at:"Expires At",change_expiry:"Change Expiry",revoke:"Revoke",new_expiry_date:"New Expiry Date",plate:"Plate",owner:"Owner",vehicle_name:"Vehicle Name",vehicle_type:"Vehicle Type",mileage:"Mileage",impounded:"Impounded",copy_plate:"Copy Plate",copy_owner:"Copy Owner",impound:"Impound",unimpound:"Unimpound",delete_vehicle:"Delete Vehicle",select_impound:"Select Impound"};class pu{#e;get values(){return n(this.#e)}set values(e){_(this.#e,e,!0)}constructor(){this.#e=T(_e(_u))}set(e){this.values=e}}const Vo=new pu,jt=()=>typeof window.invokeNative=="function",h=(t,e)=>t?Vo.values[t]??e??t:e??"",Gi=(t,e=50)=>{if(!document.body)return;const a=document.createElement("textarea");a.value=t,a.style.position="fixed",a.style.top="-9999px",a.style.left="-9999px",a.setAttribute("readonly",""),document.body.appendChild(a),a.focus(),a.select(),a.setSelectionRange(0,a.value.length);try{document.execCommand("copy")}catch(r){console.error("Clipboard fallback failed:",r)}setTimeout(()=>{a.parentNode&&a.parentNode.removeChild(a)},e)},As=["John Doe","Jane Doe","Ryan Reynolds","John Wick","Michael Scott","Walter White","Tony Stark","Bruce Wayne","Arthur Morgan","Geralt of Rivia","Tom Shelby","Joel Miller"],Ls=["Cheating","Exploiting","RDM","VDM","Toxic behavior","Mass rule violation","Ban evasion","Unauthorized modifications","Abuse of bugs"],Ps=["Orbit","System","Console","AntiCheat","Moderator01","SeniorAdmin"],Es=[{name:"Sultan RS",type:"sports"},{name:"Elegy Retro",type:"sports"},{name:"Baller",type:"suv"},{name:"Granger",type:"suv"},{name:"Buffalo STX",type:"muscle"},{name:"Dominator",type:"muscle"},{name:"Futo GTX",type:"compact"},{name:"T20",type:"super"},{name:"Kuruma",type:"sedan"},{name:"Sandking XL",type:"offroad"}];function mu(){const t=()=>String.fromCharCode(65+Math.floor(Math.random()*26)),e=()=>Math.floor(Math.random()*10);return`${t()}${t()}${t()}-${e()}${e()}${e()}`}function zs(t){return Array.from({length:t},(e,a)=>{const r=As[a%As.length],i=Math.random()>.5?"online":"offline",s={name:r,status:i,cash:Math.floor(Math.random()*1e4),bank:Math.floor(Math.random()*1e6),alt_money:Math.floor(Math.random()*5e5),last_join:Date.now()-Math.floor(Math.random()*1e3*60*60*24*30),char_identifier:`char1:${Math.random().toString(16).slice(2)}`,identifier:`license:${Math.random().toString(16).slice(2)}`,job:"Unemployed",job_grade:"Unknown",gender:Math.random()>.5?"m":"f",play_time:{days:Math.floor(Math.random()*30),hours:Math.floor(Math.random()*24),minutes:Math.floor(Math.random()*60)},position:{x:Math.random()*4e3-2e3,y:Math.random()*4e3-2e3,z:Math.random()*100}};return i==="offline"?s:{...s,id:a+1,health:Math.floor(Math.random()*100),armor:Math.floor(Math.random()*100)}})}function bu(t){return Array.from({length:t},(e,a)=>{const r=Date.now(),i=Math.random()>.7,s=Math.floor(Math.random()*30)+1,l=Math.max(1,r-Math.floor(Math.random()*1e3*60*60*24*60));return{id:a+1,identifier:`license:${Math.random().toString(16).slice(2)}`,reason:Ls[Math.floor(Math.random()*Ls.length)],banned_by:Ps[Math.floor(Math.random()*Ps.length)],banned_at:l,expires_at:i?null:l+s*24*60*60*1e3,permanent:i}})}function gu(t){return Array.from({length:t},()=>{const e=Es[Math.floor(Math.random()*Es.length)],a=Math.random()>.2,r=Math.random()>.8;return{owner:a?`license:${Math.random().toString(16).slice(2)}`:void 0,plate:mu(),type:e.type,name:e.name,mileage:Math.random()>.1?Math.floor(Math.random()*2e5):null,impounded:r}})}const yu={city_impound:{getOutPoint:{x:408.9,y:-1625.2,z:29.3},spawnPoint:{x:401.2,y:-1631.5,z:29.3,heading:228.5},sprite:357,scale:.8,colour:3,cost:3e3},sandy_impound:{getOutPoint:{x:1738.5,y:3710.1,z:34.1},spawnPoint:{x:1729.9,y:3707.4,z:34.2,heading:21.2},sprite:357,scale:.8,colour:5,cost:2500},paleto_impound:{getOutPoint:{x:-234.5,y:6198.2,z:31.5},spawnPoint:{x:-230.1,y:6205.6,z:31.5,heading:135},sprite:357,scale:.8,colour:2,cost:2e3}},In={defaultModel:"sultan",defaultColor:"black",colorPresets:[{id:"black",label:"Black",primary:0,secondary:0},{id:"white",label:"White",primary:111,secondary:111},{id:"red",label:"Red",primary:27,secondary:27},{id:"orange",label:"Orange",primary:38,secondary:38},{id:"blue",label:"Blue",primary:64,secondary:64}],neonPresets:[{id:"white",label:"White",r:255,g:255,b:255},{id:"orange",label:"Orange",r:251,g:155,b:4},{id:"red",label:"Red",r:255,g:32,b:32},{id:"blue",label:"Blue",r:32,g:128,b:255}],windowTints:[{id:0,label:"None"},{id:1,label:"Pure Black"},{id:2,label:"Dark Smoke"},{id:3,label:"Light Smoke"},{id:4,label:"Stock"},{id:5,label:"Limo"}],wheelCategories:[{id:"sport",label:"Sport",type:0},{id:"muscle",label:"Muscle",type:1},{id:"lowrider",label:"Lowrider",type:2},{id:"suv",label:"SUV",type:3},{id:"offroad",label:"Offroad",type:4},{id:"tuner",label:"Tuner",type:5},{id:"bike",label:"Bike",type:6},{id:"highend",label:"High End",type:7},{id:"street",label:"Street",type:11},{id:"track",label:"Track",type:12}],wheelDesigns:[{id:-1,label:"Stock"},...Array.from({length:20},(t,e)=>({id:e,label:String(e+1)}))]};class wu{#e;get visible(){return n(this.#e)}set visible(e){_(this.#e,e,!0)}#n;get mode(){return n(this.#n)}set mode(e){_(this.#n,e,!0)}#t;get adminMenuStates(){return n(this.#t)}set adminMenuStates(e){_(this.#t,e,!0)}#r;get adminMenuBadges(){return n(this.#r)}set adminMenuBadges(e){_(this.#r,e,!0)}#s;get spectating(){return n(this.#s)}set spectating(e){_(this.#s,e,!0)}#i;get players(){return n(this.#i)}set players(e){_(this.#i,e,!0)}#a;get recentPlayers(){return n(this.#a)}set recentPlayers(e){_(this.#a,e,!0)}#o;get focusPlayerId(){return n(this.#o)}set focusPlayerId(e){_(this.#o,e,!0)}#l;get bans(){return n(this.#l)}set bans(e){_(this.#l,e,!0)}#c;get banNextOffset(){return n(this.#c)}set banNextOffset(e){_(this.#c,e,!0)}#u;get banHasMore(){return n(this.#u)}set banHasMore(e){_(this.#u,e,!0)}#v;get banLoading(){return n(this.#v)}set banLoading(e){_(this.#v,e,!0)}#f;get vehicles(){return n(this.#f)}set vehicles(e){_(this.#f,e,!0)}#h;get vehicleNextOffset(){return n(this.#h)}set vehicleNextOffset(e){_(this.#h,e,!0)}#_;get vehicleHasMore(){return n(this.#_)}set vehicleHasMore(e){_(this.#_,e,!0)}#d;get vehicleLoading(){return n(this.#d)}set vehicleLoading(e){_(this.#d,e,!0)}#p;get impounds(){return n(this.#p)}set impounds(e){_(this.#p,e,!0)}#m;get vehicleConfig(){return n(this.#m)}set vehicleConfig(e){_(this.#m,e,!0)}constructor(){this.#e=T(!jt()),this.#n=T("dashboard"),this.#t=T(_e({})),this.#r=T(_e({})),this.#s=T(!1),this.#i=T(_e(jt()?null:zs(200))),this.#a=T(_e(jt()?null:zs(20))),this.#o=T(null),this.#l=T(_e(jt()?null:bu(200))),this.#c=T(_e(jt()?0:200)),this.#u=T(_e(jt())),this.#v=T(!1),this.#f=T(_e(jt()?null:gu(200))),this.#h=T(_e(jt()?0:200)),this.#_=T(_e(jt())),this.#d=T(!1),this.#p=T(_e(jt()?null:yu)),this.#m=T(_e(In))}openDashboard(e,a){this.visible=!0,this.mode="dashboard",this.spectating=!1,this.players=e,this.focusPlayerId=a??null,this.bans=null,this.resetBans(),this.resetVehicles()}open(e){this.openDashboard(e)}openMenu(){this.visible=!0,this.mode="menu",this.spectating=!1}setAdminMenuState(e,a){this.adminMenuStates={...this.adminMenuStates,[e]:a}}setAdminMenuBadge(e,a){a&&(this.adminMenuBadges={...this.adminMenuBadges,[e]:a})}close(){this.visible=!1}spectate(){this.spectating=!0,this.visible=!1}stopSpectate(){this.spectating=!1,this.visible=!0,this.mode="dashboard"}setPlayers(e){this.players=e}setRecentPlayers(e){this.recentPlayers=e}clearFocusPlayer(){this.focusPlayerId=null}setVehicles(e){this.vehicles=e}setVehiclePage(e,a,r){this.vehicles=e,this.vehicleHasMore=a,this.vehicleNextOffset=r}appendVehiclePage(e,a,r){this.vehicles=[...this.vehicles??[],...e],this.vehicleHasMore=a,this.vehicleNextOffset=r}resetVehicles(){this.vehicles=null,this.vehicleNextOffset=0,this.vehicleHasMore=!0,this.vehicleLoading=!1}setBans(e){this.bans=e}setBanPage(e,a,r){this.bans=e,this.banHasMore=a,this.banNextOffset=r}appendBanPage(e,a,r){this.bans=[...this.bans??[],...e],this.banHasMore=a,this.banNextOffset=r}resetBans(){this.bans=null,this.banNextOffset=0,this.banHasMore=!0,this.banLoading=!1}setImpounds(e){this.impounds=e}setVehicleConfig(e){e&&(this.vehicleConfig={defaultModel:e.defaultModel??In.defaultModel,defaultColor:e.defaultColor??In.defaultColor,colorPresets:e.colorPresets?.length?e.colorPresets:In.colorPresets,neonPresets:e.neonPresets?.length?e.neonPresets:In.neonPresets,windowTints:e.windowTints?.length?e.windowTints:In.windowTints,wheelCategories:e.wheelCategories?.length?e.wheelCategories:In.wheelCategories,wheelDesigns:e.wheelDesigns?.length?e.wheelDesigns:In.wheelDesigns})}removePlayer(e){this.players&&(this.players=this.players.filter(a=>a.id!==e))}updateBanExpiry(e,a){this.bans&&(this.bans=this.bans.map(r=>r.identifier===e?{...r,expires_at:a}:r))}removeBan(e){this.bans&&(this.bans=this.bans.filter(a=>a.identifier!==e))}updateVehicleImpoundState(e,a){this.vehicles&&(this.vehicles=this.vehicles.map(r=>r.plate===e?{...r,impounded:a}:r))}removeVehicle(e){this.vehicles&&(this.vehicles=this.vehicles.filter(a=>a.plate!==e))}}const V=new wu;var xu=U('<div class="data-component"><!> <span> </span></div>');function Os(t,e){var a=xu(),r=o(a);{var i=c=>{const v=H(()=>e.icon);var f=Se(),p=oe(f);zi(p,()=>n(v),(y,b)=>{b(y,{class:"data-component-icon"})}),E(c,f)};ee(r,c=>{e.icon&&c(i)})}var s=u(r,2),l=o(s);$(()=>g(l,e.content)),E(t,a)}var ku=Ki('<svg viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.3941 3.26274C14.2686 5.13727 14.2686 8.17647 12.3941 10.051M5.60589 10.051C3.73137 8.17639 3.73137 5.13719 5.60589 3.26271M3.34314 12.3137C0.218952 9.18951 0.218952 4.12419 3.34314 1M14.6569 1.00004C17.781 4.12423 17.781 9.18951 14.6569 12.3138M10.6 6.65687C10.6 7.54047 9.88368 8.25687 9 8.25687C8.11632 8.25687 7.4 7.54047 7.4 6.65687C7.4 5.77319 8.11632 5.05686 9 5.05686C9.88368 5.05686 10.6 5.77319 10.6 6.65687Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Di(t,e){var a=ku();$(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),E(t,a)}var Cu=Ki('<svg viewBox="0 0 12 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 7.33333C7.59733 7.33333 9.05 7.796 10.1187 8.44733C10.652 8.774 11.108 9.15733 11.4373 9.574C11.7613 9.98467 12 10.4753 12 11C12 11.5633 11.726 12.0073 11.3313 12.324C10.958 12.624 10.4653 12.8227 9.942 12.9613C8.89 13.2393 7.486 13.3333 6 13.3333C4.514 13.3333 3.11 13.24 2.058 12.9613C1.53467 12.8227 1.042 12.624 0.668667 12.324C0.273333 12.0067 0 11.5633 0 11C0 10.4753 0.238667 9.98467 0.562667 9.574C0.892 9.15733 1.34733 8.774 1.88133 8.44733C2.95 7.796 4.40333 7.33333 6 7.33333ZM6 0C6.88406 0 7.7319 0.351189 8.35702 0.976311C8.98214 1.60143 9.33333 2.44928 9.33333 3.33333C9.33333 4.21739 8.98214 5.06523 8.35702 5.69036C7.7319 6.31548 6.88406 6.66667 6 6.66667C5.11595 6.66667 4.2681 6.31548 3.64298 5.69036C3.01786 5.06523 2.66667 4.21739 2.66667 3.33333C2.66667 2.44928 3.01786 1.60143 3.64298 0.976311C4.2681 0.351189 5.11595 0 6 0Z" fill="currentColor"></path></svg>');function Xa(t,e){var a=Cu();$(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),E(t,a)}const on={currentPlayers:0,maxPlayers:0,uptimeSeconds:0,uptimeFormatted:"00:00:00",environment:{weather:"CLEAR",hour:12,minute:0,blackout:!1,pvp:!0}};class Mu{#e;get currentPlayers(){return n(this.#e)}set currentPlayers(e){_(this.#e,e,!0)}#n;get maxPlayers(){return n(this.#n)}set maxPlayers(e){_(this.#n,e,!0)}#t;get uptimeSeconds(){return n(this.#t)}set uptimeSeconds(e){_(this.#t,e,!0)}#r;get uptimeFormatted(){return n(this.#r)}set uptimeFormatted(e){_(this.#r,e,!0)}#s;get weather(){return n(this.#s)}set weather(e){_(this.#s,e,!0)}#i;get hour(){return n(this.#i)}set hour(e){_(this.#i,e,!0)}#a;get minute(){return n(this.#a)}set minute(e){_(this.#a,e,!0)}#o;get blackout(){return n(this.#o)}set blackout(e){_(this.#o,e,!0)}#l;get pvp(){return n(this.#l)}set pvp(e){_(this.#l,e,!0)}constructor(){this.#e=T(_e(on.currentPlayers)),this.#n=T(_e(on.maxPlayers)),this.#t=T(_e(on.uptimeSeconds)),this.#r=T(_e(on.uptimeFormatted)),this.#s=T(_e(on.environment?.weather)),this.#i=T(_e(on.environment?.hour)),this.#a=T(_e(on.environment?.minute)),this.#o=T(_e(on.environment?.blackout)),this.#l=T(_e(on.environment?.pvp))}set(e){this.currentPlayers=e.currentPlayers,this.maxPlayers=e.maxPlayers,this.uptimeSeconds=e.uptimeSeconds??0,this.uptimeFormatted=e.uptimeFormatted??on.uptimeFormatted,this.setEnvironment(e.environment)}setEnvironment(e){e&&(this.weather=e.weather??this.weather,this.hour=e.hour??this.hour,this.minute=e.minute??this.minute,this.blackout=e.blackout??this.blackout,this.pvp=e.pvp??this.pvp)}}const Ie=new Mu;var Tu=U('<div class="upper-display-container"><svg class="menu-icon" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="44" height="44" rx="4" fill="#FB9B04"></rect><path fill-rule="evenodd" clip-rule="evenodd" d="M13 20.4167C13 17.2191 13 15.6203 13.3775 15.0824C13.755 14.5445 15.2583 14.03 18.2649 13.0008L18.8377 12.8047C20.405 12.2682 21.1886 12 22 12C22.8114 12 23.595 12.2682 25.1623 12.8047L25.7351 13.0008C28.7417 14.03 30.245 14.5445 30.6225 15.0824C31 15.6203 31 17.2191 31 20.4167V21.9914C31 27.6294 26.761 30.3655 24.1014 31.5273C23.38 31.8424 23.0193 32 22 32C20.9807 32 20.62 31.8424 19.8986 31.5273C17.239 30.3655 13 27.6294 13 21.9914V20.4167ZM24 19C24 20.1046 23.1046 21 22 21C20.8954 21 20 20.1046 20 19C20 17.8954 20.8954 17 22 17C23.1046 17 24 17.8954 24 19ZM22 27C26 27 26 26.1046 26 25C26 23.8954 24.2091 23 22 23C19.7909 23 18 23.8954 18 25C18 26.1046 18 27 22 27Z" fill="#161616"></path></svg> <div class="menu-titles"><span class="menu-title"> </span> <span class="menu-subtitle"> </span></div> <div class="data-components"><!> <!> <button class="switch-button"><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3 4.5A1.5 1.5 0 0 1 4.5 3h3A1.5 1.5 0 0 1 9 4.5v3A1.5 1.5 0 0 1 7.5 9h-3A1.5 1.5 0 0 1 3 7.5v-3Zm8 0A1.5 1.5 0 0 1 12.5 3h3A1.5 1.5 0 0 1 17 4.5v3A1.5 1.5 0 0 1 15.5 9h-3A1.5 1.5 0 0 1 11 7.5v-3Zm-8 8A1.5 1.5 0 0 1 4.5 11h3A1.5 1.5 0 0 1 9 12.5v3A1.5 1.5 0 0 1 7.5 17h-3A1.5 1.5 0 0 1 3 15.5v-3Zm8 0a1.5 1.5 0 0 1 1.5-1.5h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3a1.5 1.5 0 0 1-1.5-1.5v-3Z"></path></svg></button> <button class="close-button" aria-label="close-menu"><svg class="close-icon" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 13.6187L13.6187 15L7.5 8.8716L1.38132 15L0 13.6187L6.1284 7.5L0 1.38132L1.38132 0L7.5 6.1284L13.6187 0L15 1.38132L8.8716 7.5L15 13.6187Z" fill="#F2F2F2"></path></svg></button></div></div>');function Su(t,e){Xe(e,!0);const a=H(()=>`${h("players")} ${Ie.currentPlayers}/${Ie.maxPlayers}`),r=H(()=>`${h("server_uptime")}: ${Ie.uptimeFormatted}`);var i=Tu(),s=u(o(i),2),l=o(s),c=o(l),v=u(l,2),f=o(v),p=u(s,2),y=o(p);Os(y,{get content(){return n(r)},get icon(){return Di}});var b=u(y,2);Os(b,{get content(){return n(a)},get icon(){return Xa}});var m=u(b,2);m.__click=function(...k){e.onOpenAdminMenu?.apply(this,k)};var A=u(m,2);A.__click=function(...k){e.onEscape?.apply(this,k)},$((k,w,C)=>{g(c,k),g(f,w),Ke(m,"aria-label",C)},[()=>h("admin_menu"),()=>h("admin_menu_desc"),()=>h("open_admin_menu")]),E(t,i),Ge()}ht(["click"]);class Au{#e;get value(){return n(this.#e)}set value(e){_(this.#e,e,!0)}constructor(){this.#e=T("dashboard_home")}set(e){this.value=e}}const wt=new Au;var Lu=Ki('<svg viewBox="0 0 384 384" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m340 64l44 128v171q0 8-6.5 14.5T363 384h-22q-8 0-14.5-6.5T320 363v-22H64v22q0 8-6.5 14.5T43 384H21q-8 0-14.5-6.5T0 363V192L44 64q8-21 31-21h234q23 0 31 21zM74.5 277q13.5 0 23-9t9.5-22.5t-9.5-23t-23-9.5t-22.5 9.5t-9 23t9 22.5t22.5 9zm235 0q13.5 0 22.5-9t9-22.5t-9-23t-22.5-9.5t-23 9.5t-9.5 23t9.5 22.5t23 9zM43 171h298l-32-96H75z" fill="currentColor"></path></svg>');function Pu(t,e){var a=Lu();$(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),E(t,a)}const Ds=[{label:"Dashboard Home",value:"dashboard_home",icon:Di},{label:"Player Management",value:"ply_management",icon:Xa,subOptions:[{label:"Bans",value:"ply_bans",icon:Xa},{label:"Vehicles",value:"ply_vehicles",icon:Pu},{label:"Player Search",value:"ply_data",icon:Xa},{label:"Recent Players",value:"ply_recent",icon:Xa}]},{label:"Server Management",value:"srv_management",icon:Di}];function Eu(t){const e=t-1;return e*e*e+1}function zu(t,{delay:e=0,duration:a=400,easing:r=Eu,axis:i="y"}={}){const s=getComputedStyle(t),l=+s.opacity,c=i==="y"?"height":"width",v=parseFloat(s[c]),f=i==="y"?["top","bottom"]:["left","right"],p=f.map(C=>`${C[0].toUpperCase()}${C.slice(1)}`),y=parseFloat(s[`padding${p[0]}`]),b=parseFloat(s[`padding${p[1]}`]),m=parseFloat(s[`margin${p[0]}`]),A=parseFloat(s[`margin${p[1]}`]),k=parseFloat(s[`border${p[0]}Width`]),w=parseFloat(s[`border${p[1]}Width`]);return{delay:e,duration:a,easing:r,css:C=>`overflow: hidden;opacity: ${Math.min(C*20,1)*l};${c}: ${C*v}px;padding-${f[0]}: ${C*y}px;padding-${f[1]}: ${C*b}px;margin-${f[0]}: ${C*m}px;margin-${f[1]}: ${C*A}px;border-${f[0]}-width: ${C*k}px;border-${f[1]}-width: ${C*w}px;min-${c}: 0`}}const Ou=4500;class Du{#e;get items(){return n(this.#e)}set items(e){_(this.#e,e,!0)}constructor(){this.#e=T(_e([])),this.#n=1}#n;push(e,a="error",r=Ou){const i={id:this.#n++,type:a,message:e};this.items=[...this.items,i],r>0&&window.setTimeout(()=>this.dismiss(i.id),r)}error(e){this.push(e,"error")}success(e){this.push(e,"success")}info(e){this.push(e,"info")}dismiss(e){this.items=this.items.filter(a=>a.id!==e)}}const Wn=new Du;function Nu(t){return t.err??t.error??t.message??"Action failed."}async function je(t,e={}){try{if(!jt())return null;const a=await fetch(`https://${GetParentResourceName()}/${t}`,{method:"POST",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(e)});if(!a.ok)throw new Error(`[esx-adminmenu:NUI:${t}] Fetch failed: ${a.status}`);const r=await a.json();return r&&typeof r=="object"&&"success"in r&&r.success===!1&&Wn.error(Nu(r)),r}catch(a){return console.error(`[esx-adminmenu:NUI:${t}]`,a),Wn.error("The admin UI could not reach the client callback."),null}}const Ru=100,Bu=100,Iu=t=>je("bring",{id:t}),Fu=t=>je("goto",{id:t}),Vu=async t=>{(await je("spectate",{id:t}))?.success&&V.spectate()},Hu=t=>{t&&V.stopSpectate()},ju=async(t,e)=>{const a=await je("kick",{id:t,reason:e});a&&!a.playerOnline&&V.removePlayer(t)},Wu=async(t,e,a)=>{const r=await je("ban",{id:t,reason:e,duration:a});r&&!r.playerOnline&&V.removePlayer(t)},Uu=async(t,e,a)=>(await je("ban:offline",{identifier:t,reason:e,duration:a}))?.success??!1,qu=async(t,e)=>{(await je("ban:changeExpiry",{identifier:t,newDate:e}))?.success&&V.updateBanExpiry(t,e)},Ku=async t=>{(await je("ban:revoke",{identifier:t}))?.success&&V.removeBan(t)},Zu=async(t,e)=>{(await je("vehicle:impound",{plate:t,impoundName:e}))?.success&&V.updateVehicleImpoundState(t,!0)},Yu=async t=>{(await je("vehicle:unimpound",{plate:t}))?.success&&V.updateVehicleImpoundState(t,!1)},Xu=async t=>{(await je("vehicle:delete",{plate:t}))?.success&&V.removeVehicle(t)},Gu=(t,e)=>je("player:notify",{id:t,notificationContent:e,notificationType:"info"}),He=(t,e,a={})=>je("player:action",{id:t,action:e,payload:a}),Ni=async(t={})=>{if(V.vehicleLoading||!t.reset&&!V.vehicleHasMore)return!1;V.vehicleLoading=!0;try{const e=await je("getVehicles",{offset:t.reset?0:V.vehicleNextOffset,limit:Ru,search:t.search??""});if(!e?.success)return!1;const a=e.vehicles??[],r=e.hasMore??!1,i=e.nextOffset??(t.reset?a.length:V.vehicleNextOffset+a.length);return t.reset?V.setVehiclePage(a,r,i):V.appendVehiclePage(a,r,i),!0}finally{V.vehicleLoading=!1}},Ho=async(t={})=>{if(V.banLoading||!t.reset&&!V.banHasMore)return!1;V.banLoading=!0;try{const e=await je("getBans",{offset:t.reset?0:V.banNextOffset,limit:Bu});if(!e?.success)return!1;const a=e.bans??[],r=e.hasMore??!1,i=e.nextOffset??(t.reset?a.length:V.banNextOffset+a.length);return t.reset?V.setBanPage(a,r,i):V.appendBanPage(a,r,i),!0}finally{V.banLoading=!1}},Ju=(t,e={})=>je("server:action",{action:t,payload:e}),Qu=(t,e={})=>je(`adminMenu:${t}`,e),$u=async t=>{const e=await je("server:radioPlayers",{channel:t});return e?.success?e.players??[]:[]};var ev=U("<button><!> <span> </span></button>"),tv=U('<div class="details"></div>'),nv=U('<div class="sidebar-divider"></div>'),av=U('<div class="accordion"><button><!> <span class="label"> </span></button> <!> <!></div>'),rv=U('<nav class="sidebar"></nav>');function iv(t,e){Xe(e,!0);function a(l,c){return l.subOptions?c===l.value?!0:l.subOptions.some(v=>v.value===c):!1}function r(l){wt.set(l.value)}async function i(l){switch(wt.set(l.value),l.value){case"ply_bans":V.bans||await Ho({reset:!0});break;case"ply_vehicles":V.vehicles||await Ni({reset:!0});break;case"ply_recent":if(!V.recentPlayers){const c=await je("getRecentPlayers");c?.success&&V.setRecentPlayers(c.players??[])}break}}var s=rv();ot(s,21,()=>Ds,Et,(l,c,v)=>{const f=H(()=>n(c).icon),p=H(()=>a(n(c),wt.value));var y=av(),b=o(y);let m;b.__click=()=>r(n(c));var A=o(b);{var k=S=>{var N=Se(),K=oe(N);zi(K,()=>n(f),(D,L)=>{L(D,{class:"accordion-icon"})}),E(S,N)};ee(A,S=>{n(f)&&S(k)})}var w=u(A,2),C=o(w),z=u(b,2);{var R=S=>{var N=tv();ot(N,21,()=>n(c).subOptions,Et,(K,D)=>{const L=H(()=>n(D).icon);var I=ev();let ae;I.__click=()=>i(n(D));var Q=o(I);{var j=Z=>{var X=Se(),re=oe(X);zi(re,()=>n(L),(se,ue)=>{ue(se,{class:"sub-icon"})}),E(Z,X)};ee(Q,Z=>{n(L)&&Z(j)})}var q=u(Q,2),Y=o(q);$(()=>{ae=Ne(I,1,"sub-button",null,ae,{active:wt.value===n(D).value}),g(Y,n(D).label)}),E(K,I)}),tu(3,N,()=>zu),E(S,N)};ee(z,S=>{n(c).subOptions&&n(p)&&S(R)})}var x=u(z,2);{var M=S=>{var N=nv();E(S,N)};ee(x,S=>{v<Ds.length-1&&S(M)})}$(()=>{m=Ne(b,1,"header",null,m,{active:wt.value===n(c).value}),Ke(b,"aria-expanded",n(p)),g(C,n(c).label)}),E(l,y)}),E(t,s),Ge()}ht(["click"]);const sv=(()=>{let t=!1;try{const e=Object.defineProperty({},"passive",{get(){return t={passive:!0},!0}});window.addEventListener("testpassive",e,e),window.remove("testpassive",e,e)}catch{}return t})();var ov=U('<table class="vtlist-inner"><!><tbody><!></tbody></table> <!>',1),lv=U('<div class="vtlist-inner"><!> <!> <!></div>'),cv=U("<div><!></div>");function Ji(t,e){Xe(e,!0);var a;(function(B){B[B.OBSERVED=0]="OBSERVED",B[B.REQUESTED=1]="REQUESTED"})(a||(a={}));const r=dt(e,"items",19,()=>[]),i=dt(e,"isDisabled",3,!1),s=dt(e,"isHorizontal",3,!1),l=dt(e,"isTable",3,!1),c=dt(e,"preRenderCount",3,6),v=dt(e,"scrollToAlignment",19,()=>Gn.AUTO),f=dt(e,"scrollToBehaviour",19,()=>Ri.INSTANT),p=dt(e,"class",3,""),y=dt(e,"style",3,""),b=3;let m=!1,A=-1,k,w=T(void 0),C=T(0),z=T(0),R=T(0),x=T(c()-1),M=T(0),S=T(_e({offset:e.scrollToOffset||0,scrollChangeReason:a.REQUESTED})),N;const K=H(()=>new Array(r().length)),D=H(()=>r().map((F,ne)=>{let ve=e.sizingCalculator?.(ne,F);return ve!==void 0||(ve=n(K)[ne],ve!==void 0)?ve:n(M)})),L=H(()=>{const B=[];return n(D).reduce((F,ne)=>(B.push(F),F+ne),0),B}),I=H(()=>{if(!r()||i())return[];const B=[];for(let F=n(R);F<=n(x);F++){const ne=r()[F];ne&&B.push({item:ne,index:F,size:n(D)[F]})}return B}),ae=()=>n(L).length>0?n(L)[n(L).length-1]+n(D)[n(D).length-1]:0,Q=H(()=>Mr(!i()&&"overflow:auto;",y())),j=H(()=>{const B=n(L)[n(R)]?n(L)[n(R)]:0,F=n(x)>0?ae()-(n(L)[Math.min(n(x),n(L).length-1)]+n(D)[Math.min(n(x),n(D).length-1)]):0;return Mr(!l()&&"display:flex;",!l()&&(!s()&&"flex-direction:column;"||"flex-direction:row;"),!i()&&(!s()&&`margin-top:${B}px;margin-bottom:${F}px`||`margin-left:${B}px;margin-right:${F}px;width:${n(L)[Math.min(n(x),n(L).length-1)]+n(D)[Math.min(n(x),n(D).length-1)]-B}px`))});Fo(()=>{k.addEventListener("scroll",X,sv),ye(),e.scrollToOffset!==void 0?Fe(e.scrollToOffset):e.scrollToIndex!==void 0&&Fe(re(e.scrollToIndex)),m=!0}),fu(()=>{m&&k.removeEventListener("scroll",X)}),xt(()=>{e.scrollToIndex,v(),e.scrollToOffset,r().length,e.sizingCalculator,Y()}),xt(()=>{n(R),n(x),Y()}),xt(()=>{n(S).scrollChangeReason===a.REQUESTED?Fe(n(S).offset):ye()});let q={};async function Y(){if(!m)return;e.scrollToIndex&&e.scrollToOffset&&console.error("VirtualList: scrollToIndex and scrollToOffset MUST NOT be used together.");const B=q?.scrollToIndex!==e.scrollToIndex||q?.scrollToAlignment!==v(),F=q?.modelCount!==r().length||q?.sizingCalculator!==e.sizingCalculator||q?.avgSizeInPx!==n(M)||q?.clientHeight!==n(C)||q?.clientWidth!==n(z);if(F&&await Z(),q?.scrollToOffset!==e.scrollToOffset?_(S,{offset:e.scrollToOffset||0,scrollChangeReason:a.REQUESTED},!0):typeof e.scrollToIndex=="number"&&(B||F)&&_(S,{offset:re(e.scrollToIndex),scrollChangeReason:a.REQUESTED},!0),e.onVisibleRangeUpdate&&(q?.startIdx!==n(R)||q?.endIdx!==n(x))){const ve=me(s()?n(z):n(C),n(S).offset);e.onVisibleRangeUpdate(ve)}q={scrollToIndex:e.scrollToIndex,scrollToAlignment:v(),scrollToOffset:e.scrollToOffset,modelCount:r().length,sizingCalculator:e.sizingCalculator,avgSizeInPx:n(M),clientHeight:n(C),clientWidth:n(z),startIdx:n(R),endIdx:n(x)}}async function Z(B=0){A=Math.min(A,B-1),await ye()}function X(B){const F=s()?k.scrollLeft:k.scrollTop;B.target!==k||F<0||n(S).offset===F||N?.offset!==F&&(_(S,{offset:F,scrollChangeReason:a.OBSERVED},!0),e.onAfterScroll?.({offset:F,event:B}))}function re(B,F=v(),ne=r().length){return B<0?B=0:B>=ne&&(B=ne-1),se(F,s()?n(z):n(C),n(S).offset,B)}function se(B=Gn.START,F,ne,ve){if(F<=0)return 0;const ce=n(D)[ve],Le=n(L)[ve],be=Le-F+ce;let we;switch(B){case Gn.END:we=be;break;case Gn.CENTER:we=Le-(F-ce)/2;break;case Gn.START:we=Le;break;default:we=Math.max(be,Math.min(Le,ne))}return Math.max(0,Math.min(ae()-F,we))}function ue(B){if(isNaN(B))throw Error(`Invalid offset ${B} specified`);B=Math.max(0,B);const F=le(),ne=Math.max(0,A);return F.offset>=B?Ce(0,ne,B):Te(ne,B)}function le(){return A>=0?{offset:n(L)[A],size:n(D)[A]}:{offset:0,size:0}}function Ce(B,F,ne){for(;B<=F;){const ve=B+(F-B>>>1),ce=n(L)[ve];if(ce===ne)return ve;ce<ne?B=ve+1:F=ve-1}return Math.max(0,B-1)}function Te(B,F){let ne=1;for(;B<r().length&&n(L)[B]<F;)B+=ne,ne*=2;return Ce(Math.floor(B/2),Math.min(B,r().length-1),F)}async function ye(){n(M)||_(M,ie(),!0);const B=me(s()?n(z):n(C),n(S).offset,b);_(R,B.start,!0),_(x,B.end,!0),await Ca();let F=0;const ne=new Map,ve=be=>(ne.has(be)||ne.set(be,getComputedStyle(be)),ne.get(be)),ce={},Le=We();for(let be=0;be<Le.length;be++){const we=Le[be],d=ve(we),P=d.position;if(P&&["absolute","fixed"].includes(P))continue;const O=d.display!=="none"?Ae(we):0,te=n(R)+F;ce[te]=(ce[te]||0)+O,F++}for(const be of Object.keys(ce)){const we=parseInt(be);n(K)[we]!==ce[we]&&(n(K)[we]=ce[we])}}function ie(){const F=[],ne=We();for(let ve=0;ve<ne.length;ve++){const ce=ne[ve],Le=getComputedStyle(ce);if(["absolute","fixed"].includes(Le.position))continue;const be=Ae(ce);if(F.push(be),F.length>=10)break}return F.length===0?0:F.reduce((ve,ce)=>ve+ce,0)/F.length}function he(B){const F=getComputedStyle(B);let ne=parseFloat(s()?F.width:F.height);return F.boxSizing==="border-box"&&(s()?ne-=parseFloat(F.borderLeftWidth)-parseFloat(F.borderRightWidth):ne-=parseFloat(F.borderTopWidth)-parseFloat(F.borderBottomWidth)),ne}function me(B=0,F,ne=0){if(ae()===0)return{start:0,end:0};const ve=F+B;let ce=ue(F);if(ce===void 0)throw Error(`Invalid offset ${F} specified`);let Le=n(L)[ce]+n(D)[ce],be=ce;for(;Le<ve&&be<r().length-1;)be++,Le+=n(D)[be];return ne>0&&(ce=Math.max(0,ce-ne),be=Math.min(be+ne,r().length-1)),{start:ce,end:be}}function Ae(B){const F=getComputedStyle(B);let ne=he(B);return s()?ne+=parseFloat(F.borderLeftWidth)+parseFloat(F.borderRightWidth)+parseFloat(F.marginLeft)+parseFloat(F.marginRight):ne+=parseFloat(F.borderTopWidth)+parseFloat(F.borderBottomWidth)+parseFloat(F.marginTop)+parseFloat(F.marginBottom),Number.isNaN(ne)?0:ne}function Fe(B){if("scroll"in k){const F={behavior:f()};F[s()?"left":"top"]=B,k.scroll(F)}else k[s()?"scrollLeft":"scrollTop"]=B}function We(){return l()?n(w).querySelector("tbody").children:n(w).children}var ze=cv(),Je=o(ze);{var $e=B=>{var F=ov(),ne=oe(F),ve=o(ne);Bn(ve,()=>e.header??cn);var ce=u(ve),Le=o(ce);{var be=P=>{var O=Se(),te=oe(O);ot(te,17,r,Et,(G,J,ge)=>{var ke=Se(),Ue=oe(ke);Bn(Ue,()=>e.vl_slot,()=>({index:ge,item:n(J)})),E(G,ke)}),E(P,O)},we=P=>{var O=Se(),te=oe(O);ot(te,17,()=>n(I),G=>G.index,(G,J)=>{var ge=Se(),ke=oe(ge);Bn(ke,()=>e.vl_slot,()=>n(J)),E(G,ge)}),E(P,O)};ee(Le,P=>{i()?P(be):P(we,!1)})}na(ne,P=>_(w,P),()=>n(w));var d=u(ne,2);Bn(d,()=>e.footer??cn),$(()=>yn(ne,n(j))),E(B,F)},at=B=>{var F=lv(),ne=o(F);Bn(ne,()=>e.header??cn);var ve=u(ne,2);{var ce=we=>{var d=Se(),P=oe(d);ot(P,17,r,Et,(O,te,G)=>{var J=Se(),ge=oe(J);Bn(ge,()=>e.vl_slot,()=>({index:G,item:n(te)})),E(O,J)}),E(we,d)},Le=we=>{var d=Se(),P=oe(d);ot(P,16,()=>n(I),O=>O,(O,te)=>{var G=Se(),J=oe(G);Bn(J,()=>e.vl_slot,()=>te),E(O,G)}),E(we,d)};ee(ve,we=>{i()?we(ce):we(Le,!1)})}var be=u(ve,2);Bn(be,()=>e.footer??cn),na(F,we=>_(w,we),()=>n(w)),$(()=>yn(F,n(j))),E(B,F)};ee(Je,B=>{l()?B($e):B(at,!1)})}na(ze,B=>k=B,()=>k),$(B=>{Ne(ze,1,B),yn(ze,n(Q))},[()=>au(Mr("vtlist",p()))]),Ts(ze,"clientHeight",B=>_(C,B)),Ts(ze,"clientWidth",B=>_(z,B)),E(t,ze),Ge()}var Ri;(function(t){t.AUTO="auto",t.SMOOTH="smooth",t.INSTANT="instant"})(Ri||(Ri={}));var Gn;(function(t){t.AUTO="auto",t.START="start",t.CENTER="center",t.END="end"})(Gn||(Gn={}));const Er=Math.min,aa=Math.max,zr=Math.round,kr=Math.floor,vn=t=>({x:t,y:t}),uv={left:"right",right:"left",bottom:"top",top:"bottom"},vv={start:"end",end:"start"};function Ns(t,e,a){return aa(t,Er(e,a))}function Hr(t,e){return typeof t=="function"?t(e):t}function sa(t){return t.split("-")[0]}function jr(t){return t.split("-")[1]}function jo(t){return t==="x"?"y":"x"}function Wo(t){return t==="y"?"height":"width"}const dv=new Set(["top","bottom"]);function Fn(t){return dv.has(sa(t))?"y":"x"}function Uo(t){return jo(Fn(t))}function fv(t,e,a){a===void 0&&(a=!1);const r=jr(t),i=Uo(t),s=Wo(i);let l=i==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=Or(l)),[l,Or(l)]}function hv(t){const e=Or(t);return[Bi(t),e,Bi(e)]}function Bi(t){return t.replace(/start|end/g,e=>vv[e])}const Rs=["left","right"],Bs=["right","left"],_v=["top","bottom"],pv=["bottom","top"];function mv(t,e,a){switch(t){case"top":case"bottom":return a?e?Bs:Rs:e?Rs:Bs;case"left":case"right":return e?_v:pv;default:return[]}}function bv(t,e,a,r){const i=jr(t);let s=mv(sa(t),a==="start",r);return i&&(s=s.map(l=>l+"-"+i),e&&(s=s.concat(s.map(Bi)))),s}function Or(t){return t.replace(/left|right|bottom|top/g,e=>uv[e])}function gv(t){return{top:0,right:0,bottom:0,left:0,...t}}function yv(t){return typeof t!="number"?gv(t):{top:t,right:t,bottom:t,left:t}}function Dr(t){const{x:e,y:a,width:r,height:i}=t;return{width:r,height:i,top:a,left:e,right:e+r,bottom:a+i,x:e,y:a}}function Is(t,e,a){let{reference:r,floating:i}=t;const s=Fn(e),l=Uo(e),c=Wo(l),v=sa(e),f=s==="y",p=r.x+r.width/2-i.width/2,y=r.y+r.height/2-i.height/2,b=r[c]/2-i[c]/2;let m;switch(v){case"top":m={x:p,y:r.y-i.height};break;case"bottom":m={x:p,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y};break;case"left":m={x:r.x-i.width,y};break;default:m={x:r.x,y:r.y}}switch(jr(e)){case"start":m[l]-=b*(a&&f?-1:1);break;case"end":m[l]+=b*(a&&f?-1:1);break}return m}const wv=async(t,e,a)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:l}=a,c=s.filter(Boolean),v=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y}=Is(f,r,v),b=r,m={},A=0;for(let k=0;k<c.length;k++){const{name:w,fn:C}=c[k],{x:z,y:R,data:x,reset:M}=await C({x:p,y,initialPlacement:r,placement:b,strategy:i,middlewareData:m,rects:f,platform:l,elements:{reference:t,floating:e}});p=z??p,y=R??y,m={...m,[w]:{...m[w],...x}},M&&A<=50&&(A++,typeof M=="object"&&(M.placement&&(b=M.placement),M.rects&&(f=M.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):M.rects),{x:p,y}=Is(f,b,v)),k=-1)}return{x:p,y,placement:b,strategy:i,middlewareData:m}};async function qo(t,e){var a;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:l,elements:c,strategy:v}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:y="floating",altBoundary:b=!1,padding:m=0}=Hr(e,t),A=yv(m),w=c[b?y==="floating"?"reference":"floating":y],C=Dr(await s.getClippingRect({element:(a=await(s.isElement==null?void 0:s.isElement(w)))==null||a?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:v})),z=y==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),x=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},M=Dr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:z,offsetParent:R,strategy:v}):z);return{top:(C.top-M.top+A.top)/x.y,bottom:(M.bottom-C.bottom+A.bottom)/x.y,left:(C.left-M.left+A.left)/x.x,right:(M.right-C.right+A.right)/x.x}}const xv=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var a,r;const{placement:i,middlewareData:s,rects:l,initialPlacement:c,platform:v,elements:f}=e,{mainAxis:p=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:k=!0,...w}=Hr(t,e);if((a=s.arrow)!=null&&a.alignmentOffset)return{};const C=sa(i),z=Fn(c),R=sa(c)===c,x=await(v.isRTL==null?void 0:v.isRTL(f.floating)),M=b||(R||!k?[Or(c)]:hv(c)),S=A!=="none";!b&&S&&M.push(...bv(c,k,A,x));const N=[c,...M],K=await qo(e,w),D=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(p&&D.push(K[C]),y){const j=fv(i,l,x);D.push(K[j[0]],K[j[1]])}if(L=[...L,{placement:i,overflows:D}],!D.every(j=>j<=0)){var I,ae;const j=(((I=s.flip)==null?void 0:I.index)||0)+1,q=N[j];if(q&&(!(y==="alignment"?z!==Fn(q):!1)||L.every(X=>Fn(X.placement)===z?X.overflows[0]>0:!0)))return{data:{index:j,overflows:L},reset:{placement:q}};let Y=(ae=L.filter(Z=>Z.overflows[0]<=0).sort((Z,X)=>Z.overflows[1]-X.overflows[1])[0])==null?void 0:ae.placement;if(!Y)switch(m){case"bestFit":{var Q;const Z=(Q=L.filter(X=>{if(S){const re=Fn(X.placement);return re===z||re==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(re=>re>0).reduce((re,se)=>re+se,0)]).sort((X,re)=>X[1]-re[1])[0])==null?void 0:Q[0];Z&&(Y=Z);break}case"initialPlacement":Y=c;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}},kv=new Set(["left","top"]);async function Cv(t,e){const{placement:a,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=sa(a),c=jr(a),v=Fn(a)==="y",f=kv.has(l)?-1:1,p=s&&v?-1:1,y=Hr(e,t);let{mainAxis:b,crossAxis:m,alignmentAxis:A}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return c&&typeof A=="number"&&(m=c==="end"?A*-1:A),v?{x:m*p,y:b*f}:{x:b*f,y:m*p}}const Mv=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var a,r;const{x:i,y:s,placement:l,middlewareData:c}=e,v=await Cv(e,t);return l===((a=c.offset)==null?void 0:a.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+v.x,y:s+v.y,data:{...v,placement:l}}}}},Tv=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:a,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x:C,y:z}=w;return{x:C,y:z}}},...v}=Hr(t,e),f={x:a,y:r},p=await qo(e,v),y=Fn(sa(i)),b=jo(y);let m=f[b],A=f[y];if(s){const w=b==="y"?"top":"left",C=b==="y"?"bottom":"right",z=m+p[w],R=m-p[C];m=Ns(z,m,R)}if(l){const w=y==="y"?"top":"left",C=y==="y"?"bottom":"right",z=A+p[w],R=A-p[C];A=Ns(z,A,R)}const k=c.fn({...e,[b]:m,[y]:A});return{...k,data:{x:k.x-a,y:k.y-r,enabled:{[b]:s,[y]:l}}}}}};function Wr(){return typeof window<"u"}function Da(t){return Ko(t)?(t.nodeName||"").toLowerCase():"#document"}function Bt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pn(t){var e;return(e=(Ko(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ko(t){return Wr()?t instanceof Node||t instanceof Bt(t).Node:!1}function $t(t){return Wr()?t instanceof Element||t instanceof Bt(t).Element:!1}function fn(t){return Wr()?t instanceof HTMLElement||t instanceof Bt(t).HTMLElement:!1}function Fs(t){return!Wr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Bt(t).ShadowRoot}const Sv=new Set(["inline","contents"]);function ir(t){const{overflow:e,overflowX:a,overflowY:r,display:i}=en(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!Sv.has(i)}const Av=new Set(["table","td","th"]);function Lv(t){return Av.has(Da(t))}const Pv=[":popover-open",":modal"];function Ur(t){return Pv.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ev=["transform","translate","scale","rotate","perspective"],zv=["transform","translate","scale","rotate","perspective","filter"],Ov=["paint","layout","strict","content"];function Qi(t){const e=$i(),a=$t(t)?en(t):t;return Ev.some(r=>a[r]?a[r]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!e&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!e&&(a.filter?a.filter!=="none":!1)||zv.some(r=>(a.willChange||"").includes(r))||Ov.some(r=>(a.contain||"").includes(r))}function Dv(t){let e=Zn(t);for(;fn(e)&&!Ea(e);){if(Qi(e))return e;if(Ur(e))return null;e=Zn(e)}return null}function $i(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Nv=new Set(["html","body","#document"]);function Ea(t){return Nv.has(Da(t))}function en(t){return Bt(t).getComputedStyle(t)}function qr(t){return $t(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Zn(t){if(Da(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fs(t)&&t.host||pn(t);return Fs(e)?e.host:e}function Zo(t){const e=Zn(t);return Ea(e)?t.ownerDocument?t.ownerDocument.body:t.body:fn(e)&&ir(e)?e:Zo(e)}function er(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);const i=Zo(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),l=Bt(i);if(s){const c=Ii(l);return e.concat(l,l.visualViewport||[],ir(i)?i:[],c&&a?er(c):[])}return e.concat(i,er(i,[],a))}function Ii(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Yo(t){const e=en(t);let a=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=fn(t),s=i?t.offsetWidth:a,l=i?t.offsetHeight:r,c=zr(a)!==s||zr(r)!==l;return c&&(a=s,r=l),{width:a,height:r,$:c}}function es(t){return $t(t)?t:t.contextElement}function Ta(t){const e=es(t);if(!fn(e))return vn(1);const a=e.getBoundingClientRect(),{width:r,height:i,$:s}=Yo(e);let l=(s?zr(a.width):a.width)/r,c=(s?zr(a.height):a.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Rv=vn(0);function Xo(t){const e=Bt(t);return!$i()||!e.visualViewport?Rv:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Bv(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Bt(t)?!1:e}function oa(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);const i=t.getBoundingClientRect(),s=es(t);let l=vn(1);e&&(r?$t(r)&&(l=Ta(r)):l=Ta(t));const c=Bv(s,a,r)?Xo(s):vn(0);let v=(i.left+c.x)/l.x,f=(i.top+c.y)/l.y,p=i.width/l.x,y=i.height/l.y;if(s){const b=Bt(s),m=r&&$t(r)?Bt(r):r;let A=b,k=Ii(A);for(;k&&r&&m!==A;){const w=Ta(k),C=k.getBoundingClientRect(),z=en(k),R=C.left+(k.clientLeft+parseFloat(z.paddingLeft))*w.x,x=C.top+(k.clientTop+parseFloat(z.paddingTop))*w.y;v*=w.x,f*=w.y,p*=w.x,y*=w.y,v+=R,f+=x,A=Bt(k),k=Ii(A)}}return Dr({width:p,height:y,x:v,y:f})}function Kr(t,e){const a=qr(t).scrollLeft;return e?e.left+a:oa(pn(t)).left+a}function Go(t,e){const a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Kr(t,a),i=a.top+e.scrollTop;return{x:r,y:i}}function Iv(t){let{elements:e,rect:a,offsetParent:r,strategy:i}=t;const s=i==="fixed",l=pn(r),c=e?Ur(e.floating):!1;if(r===l||c&&s)return a;let v={scrollLeft:0,scrollTop:0},f=vn(1);const p=vn(0),y=fn(r);if((y||!y&&!s)&&((Da(r)!=="body"||ir(l))&&(v=qr(r)),fn(r))){const m=oa(r);f=Ta(r),p.x=m.x+r.clientLeft,p.y=m.y+r.clientTop}const b=l&&!y&&!s?Go(l,v):vn(0);return{width:a.width*f.x,height:a.height*f.y,x:a.x*f.x-v.scrollLeft*f.x+p.x+b.x,y:a.y*f.y-v.scrollTop*f.y+p.y+b.y}}function Fv(t){return Array.from(t.getClientRects())}function Vv(t){const e=pn(t),a=qr(t),r=t.ownerDocument.body,i=aa(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=aa(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-a.scrollLeft+Kr(t);const c=-a.scrollTop;return en(r).direction==="rtl"&&(l+=aa(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:l,y:c}}const Vs=25;function Hv(t,e){const a=Bt(t),r=pn(t),i=a.visualViewport;let s=r.clientWidth,l=r.clientHeight,c=0,v=0;if(i){s=i.width,l=i.height;const p=$i();(!p||p&&e==="fixed")&&(c=i.offsetLeft,v=i.offsetTop)}const f=Kr(r);if(f<=0){const p=r.ownerDocument,y=p.body,b=getComputedStyle(y),m=p.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,A=Math.abs(r.clientWidth-y.clientWidth-m);A<=Vs&&(s-=A)}else f<=Vs&&(s+=f);return{width:s,height:l,x:c,y:v}}const jv=new Set(["absolute","fixed"]);function Wv(t,e){const a=oa(t,!0,e==="fixed"),r=a.top+t.clientTop,i=a.left+t.clientLeft,s=fn(t)?Ta(t):vn(1),l=t.clientWidth*s.x,c=t.clientHeight*s.y,v=i*s.x,f=r*s.y;return{width:l,height:c,x:v,y:f}}function Hs(t,e,a){let r;if(e==="viewport")r=Hv(t,a);else if(e==="document")r=Vv(pn(t));else if($t(e))r=Wv(e,a);else{const i=Xo(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Dr(r)}function Jo(t,e){const a=Zn(t);return a===e||!$t(a)||Ea(a)?!1:en(a).position==="fixed"||Jo(a,e)}function Uv(t,e){const a=e.get(t);if(a)return a;let r=er(t,[],!1).filter(c=>$t(c)&&Da(c)!=="body"),i=null;const s=en(t).position==="fixed";let l=s?Zn(t):t;for(;$t(l)&&!Ea(l);){const c=en(l),v=Qi(l);!v&&c.position==="fixed"&&(i=null),(s?!v&&!i:!v&&c.position==="static"&&!!i&&jv.has(i.position)||ir(l)&&!v&&Jo(t,l))?r=r.filter(p=>p!==l):i=c,l=Zn(l)}return e.set(t,r),r}function qv(t){let{element:e,boundary:a,rootBoundary:r,strategy:i}=t;const l=[...a==="clippingAncestors"?Ur(e)?[]:Uv(e,this._c):[].concat(a),r],c=l[0],v=l.reduce((f,p)=>{const y=Hs(e,p,i);return f.top=aa(y.top,f.top),f.right=Er(y.right,f.right),f.bottom=Er(y.bottom,f.bottom),f.left=aa(y.left,f.left),f},Hs(e,c,i));return{width:v.right-v.left,height:v.bottom-v.top,x:v.left,y:v.top}}function Kv(t){const{width:e,height:a}=Yo(t);return{width:e,height:a}}function Zv(t,e,a){const r=fn(e),i=pn(e),s=a==="fixed",l=oa(t,!0,s,e);let c={scrollLeft:0,scrollTop:0};const v=vn(0);function f(){v.x=Kr(i)}if(r||!r&&!s)if((Da(e)!=="body"||ir(i))&&(c=qr(e)),r){const m=oa(e,!0,s,e);v.x=m.x+e.clientLeft,v.y=m.y+e.clientTop}else i&&f();s&&!r&&i&&f();const p=i&&!r&&!s?Go(i,c):vn(0),y=l.left+c.scrollLeft-v.x-p.x,b=l.top+c.scrollTop-v.y-p.y;return{x:y,y:b,width:l.width,height:l.height}}function xi(t){return en(t).position==="static"}function js(t,e){if(!fn(t)||en(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return pn(t)===a&&(a=a.ownerDocument.body),a}function Qo(t,e){const a=Bt(t);if(Ur(t))return a;if(!fn(t)){let i=Zn(t);for(;i&&!Ea(i);){if($t(i)&&!xi(i))return i;i=Zn(i)}return a}let r=js(t,e);for(;r&&Lv(r)&&xi(r);)r=js(r,e);return r&&Ea(r)&&xi(r)&&!Qi(r)?a:r||Dv(t)||a}const Yv=async function(t){const e=this.getOffsetParent||Qo,a=this.getDimensions,r=await a(t.floating);return{reference:Zv(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Xv(t){return en(t).direction==="rtl"}const Gv={convertOffsetParentRelativeRectToViewportRelativeRect:Iv,getDocumentElement:pn,getClippingRect:qv,getOffsetParent:Qo,getElementRects:Yv,getClientRects:Fv,getDimensions:Kv,getScale:Ta,isElement:$t,isRTL:Xv};function $o(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Jv(t,e){let a=null,r;const i=pn(t);function s(){var c;clearTimeout(r),(c=a)==null||c.disconnect(),a=null}function l(c,v){c===void 0&&(c=!1),v===void 0&&(v=1),s();const f=t.getBoundingClientRect(),{left:p,top:y,width:b,height:m}=f;if(c||e(),!b||!m)return;const A=kr(y),k=kr(i.clientWidth-(p+b)),w=kr(i.clientHeight-(y+m)),C=kr(p),R={rootMargin:-A+"px "+-k+"px "+-w+"px "+-C+"px",threshold:aa(0,Er(1,v))||1};let x=!0;function M(S){const N=S[0].intersectionRatio;if(N!==v){if(!x)return l();N?l(!1,N):r=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!$o(f,t.getBoundingClientRect())&&l(),x=!1}try{a=new IntersectionObserver(M,{...R,root:i.ownerDocument})}catch{a=new IntersectionObserver(M,R)}a.observe(t)}return l(!0),s}function el(t,e,a,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:v=!1}=r,f=es(t),p=i||s?[...f?er(f):[],...er(e)]:[];p.forEach(C=>{i&&C.addEventListener("scroll",a,{passive:!0}),s&&C.addEventListener("resize",a)});const y=f&&c?Jv(f,a):null;let b=-1,m=null;l&&(m=new ResizeObserver(C=>{let[z]=C;z&&z.target===f&&m&&(m.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=m)==null||R.observe(e)})),a()}),f&&!v&&m.observe(f),m.observe(e));let A,k=v?oa(t):null;v&&w();function w(){const C=oa(t);k&&!$o(k,C)&&a(),k=C,A=requestAnimationFrame(w)}return a(),()=>{var C;p.forEach(z=>{i&&z.removeEventListener("scroll",a),s&&z.removeEventListener("resize",a)}),y?.(),(C=m)==null||C.disconnect(),m=null,v&&cancelAnimationFrame(A)}}const tl=Mv,nl=Tv,al=xv,rl=(t,e,a)=>{const r=new Map,i={platform:Gv,...a},s={...i.platform,_c:r};return wv(t,e,{...i,platform:s})};var Qv=U("<span> </span>"),$v=U('<button type="button"> </button>'),ed=U('<div class="date-picker"><div class="date-picker-header"><button type="button" aria-label="Previous month"><svg viewBox="0 0 10 10" aria-hidden="true"><path d="M6.7 1.1 2.8 5l3.9 3.9-.9.9L1 5 5.8.2l.9.9Z"></path></svg></button> <span> </span> <button type="button" aria-label="Next month"><svg viewBox="0 0 10 10" aria-hidden="true"><path d="m3.3 1.1.9-.9L9 5 4.2 9.8l-.9-.9L7.2 5 3.3 1.1Z"></path></svg></button></div> <div class="date-picker-weekdays"></div> <div class="date-picker-grid"></div></div>');function td(t,e){Xe(e,!0);let a=T(_e(new Date().getFullYear())),r=T(_e(new Date().getMonth()));const i=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),s=["Mo","Tu","We","Th","Fr","Sa","Su"];function l(x){const M=x.getFullYear(),S=String(x.getMonth()+1).padStart(2,"0"),N=String(x.getDate()).padStart(2,"0");return`${M}-${S}-${N}`}function c(x){return new Date(`${x}T00:00:00`)}const v=H(()=>c(e.min).getTime()),f=H(()=>i.format(new Date(n(a),n(r),1))),p=H(()=>{const x=new Date(n(a),n(r),1),M=new Date(x),S=(x.getDay()+6)%7;return M.setDate(x.getDate()-S),Array.from({length:42},(N,K)=>{const D=new Date(M);D.setDate(M.getDate()+K);const L=l(D);return{key:L,value:L,label:D.getDate(),inMonth:D.getMonth()===n(r),selected:L===e.value,disabled:D.getTime()<n(v)}})});xt(()=>{if(!e.value)return;const x=c(e.value);_(a,x.getFullYear(),!0),_(r,x.getMonth(),!0)});function y(x){const M=new Date(n(a),n(r)+x,1);_(a,M.getFullYear(),!0),_(r,M.getMonth(),!0)}var b=ed(),m=o(b),A=o(m);A.__click=()=>y(-1);var k=u(A,2),w=o(k),C=u(k,2);C.__click=()=>y(1);var z=u(m,2);ot(z,21,()=>s,Et,(x,M)=>{var S=Qv(),N=o(S);$(()=>g(N,n(M))),E(x,S)});var R=u(z,2);ot(R,21,()=>n(p),x=>x.key,(x,M)=>{var S=$v();S.__click=()=>e.onChange(n(M).value);let N;var K=o(S);$(()=>{S.disabled=n(M).disabled,N=Ne(S,1,"",null,N,{muted:!n(M).inMonth,selected:n(M).selected}),g(K,n(M).label)}),E(x,S)}),$(()=>g(w,n(f))),E(t,b),Ge()}ht(["click"]);var nd=U('<label class="confirm-field"><span class="confirm-label"> </span> <!></label>'),ad=U('<button type="button" tabindex="-1"> </button>'),rd=U('<label class="confirm-field"><span class="confirm-label"> </span> <div class="confirm-dropdown lg-dropdown" role="presentation"><button type="button" tabindex="-1" class="confirm-dropdown-trigger"><span> </span> <svg viewBox="0 0 11 10"><path d="M3.30202 1C4.07182 -0.333333 5.99632 -0.333333 6.76612 1L9.79721 6.25C10.567 7.58333 9.60476 9.25 8.06516 9.25H2.00298C0.463381 9.25 -0.498867 7.58333 0.270933 6.25L3.30202 1Z" fill="currentColor"></path></svg></button> <div tabindex="-1"></div></div></label>'),id=U('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text"/></label>'),sd=U('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text"/></label>'),od=U('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text"/></label> <label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text"/></label>',1),ld=U('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text" placeholder="police"/></label> <label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="number" min="0"/></label>',1),cd=U('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="number" min="0"/></label>'),ud=U('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="number"/></label>'),vd=U('<button type="button" tabindex="-1"> </button>'),dd=U('<label class="confirm-field"><span class="confirm-label"> </span> <div class="confirm-duration-row"><input class="confirm-input duration-input" type="number" min="0"/> <div class="confirm-dropdown" role="presentation"><button type="button" tabindex="-1" class="confirm-dropdown-trigger"><span> </span> <svg viewBox="0 0 11 10" xmlns="http://www.w3.org/2000/svg"><path d="M3.30202 1C4.07182 -0.333333 5.99632 -0.333333 6.76612 1L9.79721 6.25C10.567 7.58333 9.60476 9.25 8.06516 9.25H2.00298C0.463381 9.25 -0.498867 7.58333 0.270933 6.25L3.30202 1Z" fill="currentColor"></path></svg></button> <div tabindex="-1"></div></div></div> <div class="confirm-hint"> </div></label>'),fd=U('<div class="confirm-modal-backdrop"><div class="confirm-modal" role="dialog" aria-modal="true" tabindex="-1"><div class="confirm-modal-header"><div class="confirm-modal-title"> </div></div> <div class="confirm-modal-body"><!> <!> <!> <!> <!> <!> <!> <!> <!></div> <div class="confirm-actions"><button class="confirm-btn cancel" type="button" tabindex="-1"> </button> <button class="confirm-btn confirm" type="button" tabindex="-1"> </button></div></div></div>');function hd(t,e){Xe(e,!0);let a=T(!1),r=T(null);const i=H(()=>Object.keys(V.impounds??{}));let s=T(null);xt(()=>{e.open?_(s,Date.now(),!0):_(s,null)});let l=T(""),c=T(""),v=T(""),f=T(""),p=T(null),y=T(null),b=T("days"),m=T(!1);const A={minutes:1,hours:60,days:1440,months:43200,years:525600},k=["minutes","hours","days","months","years"],w=new Set(["delete_vehicle","revoke","clean_inventory","delete_character","kill_player","revive_player","freeze_player","unfreeze_player","open_clothing","give_all_weapons","troll_burn","troll_explode","troll_sky","troll_random","troll_nausea"]),C=new Set(["set_model","ace_add","ace_remove"]),z=new Set(["set_bucket","set_radio","set_thirst","set_hunger"]);function R(){if(e.confirmType&&w.has(e.confirmType)){e.onConfirm({}),M();return}if(e.confirmType==="impound_vehicle"){if(!n(r))return;e.onConfirm({impoundName:n(r)}),M();return}if(e.confirmType==="revoke"){e.onConfirm({}),M();return}if(e.confirmType==="change_expiry"){if(!n(l))return;const q=new Date(n(l)+"T00:00:00").getTime();e.onConfirm({newDate:q}),M();return}if(e.confirmType==="notify"&&n(c).trim()==="")return;if(e.confirmType==="give_money"||e.confirmType==="take_money"){if(n(p)===null||n(p)<=0)return;e.onConfirm({amount:n(p)}),M();return}if(e.confirmType==="set_health"||e.confirmType==="set_armor"){if(n(p)===null||n(p)<0)return;e.onConfirm({amount:n(p)}),M();return}if(e.confirmType==="set_name"){if(n(v).trim()===""||n(f).trim()==="")return;e.onConfirm({text:n(v).trim(),secondaryText:n(f).trim()}),M();return}if(e.confirmType==="set_job"){if(n(v).trim()==="")return;e.onConfirm({text:n(v).trim(),amount:n(p)??0}),M();return}if(e.confirmType&&C.has(e.confirmType)){if(n(v).trim()==="")return;e.onConfirm({text:n(v).trim()}),M();return}if(e.confirmType&&z.has(e.confirmType)){if(n(p)===null||n(p)<0)return;e.onConfirm({amount:n(p)}),M();return}let j=null;e.confirmType==="ban"&&n(y)!==null&&(j=n(y)*A[n(b)]),e.onConfirm({reason:n(c),duration:j}),M()}function x(){e.onCancel(),M()}function M(){_(l,""),_(c,""),_(v,""),_(f,""),_(p,null),_(y,null),_(b,"days"),_(m,!1),_(r,null),_(a,!1)}function S(){_(m,!n(m))}function N(j){_(b,j,!0),_(m,!1)}function K(){_(a,!n(a))}function D(j){_(r,j,!0),_(a,!1)}function L(j){j.stopPropagation()}var I=Se();Kn("click",Un,()=>{!e.open||n(s)===null||Date.now()-n(s)<1e3||x()}),Kn("keydown",Un,j=>{j.key==="Escape"&&(!e.open||n(s)===null||Date.now()-n(s)<1e3||x())});var ae=oe(I);{var Q=j=>{var q=fd(),Y=o(q);Y.__click=L,Y.__keydown=L;var Z=o(Y),X=o(Z),re=o(X),se=u(Z,2),ue=o(se);{var le=d=>{var P=nd(),O=o(P),te=o(O),G=u(O,2);{let J=H(()=>new Date().toISOString().split("T")[0]);td(G,{get value(){return n(l)},get min(){return n(J)},onChange:ge=>_(l,ge,!0)})}$(J=>g(te,J),[()=>h("new_expiry_date")]),E(d,P)};ee(ue,d=>{e.confirmType==="change_expiry"&&d(le)})}var Ce=u(ue,2);{var Te=d=>{var P=rd(),O=o(P),te=o(O),G=u(O,2);G.__click=L,G.__keydown=L;var J=o(G);J.__click=K;var ge=o(J),ke=o(ge),Ue=u(ge,2);let et;var Oe=u(J,2);let rt;ot(Oe,21,()=>n(i),Et,(Be,Pe)=>{var qe=ad();let tt;qe.__click=De=>{De.preventDefault(),D(n(Pe))};var Ve=o(qe);$(()=>{tt=Ne(qe,1,"confirm-dropdown-item",null,tt,{selected:n(Pe)===n(r)}),g(Ve,n(Pe))}),E(Be,qe)}),$((Be,Pe)=>{g(te,Be),Ke(J,"aria-expanded",n(a)),g(ke,Pe),et=Ne(Ue,0,"confirm-dropdown-arrow",null,et,{open:n(a)}),rt=Ne(Oe,1,"confirm-dropdown-menu",null,rt,{open:n(a)})},[()=>h("select_impound"),()=>n(r)??h("select_impound")]),E(d,P)};ee(Ce,d=>{e.confirmType==="impound_vehicle"&&d(Te)})}var ye=u(Ce,2);{var ie=d=>{var P=id(),O=o(P),te=o(O),G=u(O,2);$((J,ge)=>{g(te,J),Ke(G,"placeholder",ge)},[()=>e.confirmType==="notify"?h("notification_message"):h("reason"),()=>e.confirmType==="notify"?h("notification_message"):h("ban_reason_placeholder")]),st(G,()=>n(c),J=>_(c,J)),E(d,P)};ee(ye,d=>{(e.confirmType==="ban"||e.confirmType==="kick"||e.confirmType==="notify")&&d(ie)})}var he=u(ye,2);{var me=d=>{var P=sd(),O=o(P),te=o(O),G=u(O,2);$(J=>{g(te,J),Ke(G,"placeholder",e.confirmType==="set_model"?"mp_m_freemode_01":"admin")},[()=>e.confirmType==="set_model"?h("model_name"):h("ace_group")]),st(G,()=>n(v),J=>_(v,J)),E(d,P)};ee(he,d=>{(e.confirmType==="set_model"||e.confirmType==="ace_add"||e.confirmType==="ace_remove")&&d(me)})}var Ae=u(he,2);{var Fe=d=>{var P=od(),O=oe(P),te=o(O),G=o(te),J=u(te,2),ge=u(O,2),ke=o(ge),Ue=o(ke),et=u(ke,2);$((Oe,rt)=>{g(G,Oe),g(Ue,rt)},[()=>h("first_name"),()=>h("last_name")]),st(J,()=>n(v),Oe=>_(v,Oe)),st(et,()=>n(f),Oe=>_(f,Oe)),E(d,P)};ee(Ae,d=>{e.confirmType==="set_name"&&d(Fe)})}var We=u(Ae,2);{var ze=d=>{var P=ld(),O=oe(P),te=o(O),G=o(te),J=u(te,2),ge=u(O,2),ke=o(ge),Ue=o(ke),et=u(ke,2);$((Oe,rt)=>{g(G,Oe),g(Ue,rt)},[()=>h("job"),()=>h("job_grade")]),st(J,()=>n(v),Oe=>_(v,Oe)),st(et,()=>n(p),Oe=>_(p,Oe)),E(d,P)};ee(We,d=>{e.confirmType==="set_job"&&d(ze)})}var Je=u(We,2);{var $e=d=>{var P=cd(),O=o(P),te=o(O),G=u(O,2);$(J=>{g(te,J),Ke(G,"max",e.confirmType==="set_thirst"||e.confirmType==="set_hunger"?100:void 0)},[()=>e.confirmType==="set_bucket"?h("routing_bucket"):e.confirmType==="set_radio"?h("radio_channel"):e.confirmType==="set_thirst"?h("thirst"):h("hunger")]),st(G,()=>n(p),J=>_(p,J)),E(d,P)};ee(Je,d=>{(e.confirmType==="set_bucket"||e.confirmType==="set_radio"||e.confirmType==="set_thirst"||e.confirmType==="set_hunger")&&d($e)})}var at=u(Je,2);{var B=d=>{var P=ud(),O=o(P),te=o(O),G=u(O,2);$(J=>{g(te,J),Ke(G,"min",e.confirmType==="set_health"||e.confirmType==="set_armor"?0:1),Ke(G,"max",e.confirmType==="set_health"||e.confirmType==="set_armor"?100:void 0)},[()=>e.confirmType==="set_health"?h("health"):e.confirmType==="set_armor"?h("armor"):h("money")]),st(G,()=>n(p),J=>_(p,J)),E(d,P)};ee(at,d=>{(e.confirmType==="give_money"||e.confirmType==="take_money"||e.confirmType==="set_health"||e.confirmType==="set_armor")&&d(B)})}var F=u(at,2);{var ne=d=>{var P=dd(),O=o(P),te=o(O),G=u(O,2),J=o(G),ge=u(J,2);ge.__click=L,ge.__keydown=L;var ke=o(ge);ke.__click=S;var Ue=o(ke),et=o(Ue),Oe=u(Ue,2);let rt;var Be=u(ke,2);let Pe;ot(Be,21,()=>k,Et,(Ve,De)=>{var pe=vd();let Ye;pe.__click=()=>N(n(De));var Ze=o(pe);$(it=>{Ye=Ne(pe,1,"confirm-dropdown-item",null,Ye,{selected:n(De)===n(b)}),g(Ze,it)},[()=>h(n(De))]),E(Ve,pe)});var qe=u(G,2),tt=o(qe);$((Ve,De,pe,Ye)=>{g(te,Ve),Ke(J,"placeholder",De),Ke(ke,"aria-expanded",n(m)),g(et,pe),rt=Ne(Oe,0,"confirm-dropdown-arrow",null,rt,{open:n(m)}),Pe=Ne(Be,1,"confirm-dropdown-menu",null,Pe,{open:n(m)}),g(tt,Ye)},[()=>h("duration"),()=>h("permanent"),()=>h(n(b)),()=>h("duration_desc")]),st(J,()=>n(y),Ve=>_(y,Ve)),E(d,P)};ee(F,d=>{e.confirmType==="ban"&&d(ne)})}var ve=u(se,2),ce=o(ve);ce.__click=x;var Le=o(ce),be=u(ce,2);be.__click=R;var we=o(be);$((d,P)=>{Ke(Y,"aria-label",e.title),g(re,e.title),g(Le,d),g(we,P)},[()=>h("cancel"),()=>h("confirm")]),E(j,q)};ee(ae,j=>{e.open&&j(Q)})}E(t,I),Ge()}ht(["click","keydown"]);var _d=U('<div class="context-submenu"><div class="context-title"> </div> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button></div>'),pd=U('<div class="context-submenu"><div class="context-title"> </div> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button></div>'),md=U('<button class="menu-item"><svg viewBox="0 0 10 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.4375 0C7.92114 0 7.5 0.421143 7.5 0.9375V7.46704C7.49268 7.229 7.3938 7.00195 7.22534 6.83716L1.60034 1.21216C1.23413 0.845948 0.640869 0.845948 0.274658 1.21216C0.0988772 1.38794 0 1.62598 0 1.875C0 2.12402 0.0988772 2.36206 0.274658 2.53784L5.23682 7.5L0.274658 12.4622C0.0988772 12.6379 0 12.876 0 13.125C0 13.374 0.0988772 13.6121 0.274658 13.7878C0.640869 14.1541 1.23413 14.1541 1.60034 13.7878L7.22534 8.16284C7.3938 7.99439 7.49268 7.771 7.5 7.53662V14.0625C7.5 14.5789 7.92114 15 8.4375 15C8.95386 15 9.375 14.5789 9.375 14.0625V0.9375C9.375 0.421143 8.95386 0 8.4375 0Z"></path></svg> </button> <button class="menu-item"><svg viewBox="0 0 13 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3.73707 9.50836L2.88567 10.3598L7.52583 15L12.166 10.3598L11.3146 9.50836L8.1279 12.6951V0H0V1.20413H6.92377V12.6951L3.73707 9.50836Z"></path></svg> </button> <button class="menu-item"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.89533 1.04651C10.2257 1.04651 11.1708 1.04762 11.8878 1.14402C12.5897 1.23839 12.9941 1.41537 13.2893 1.71063C13.6292 2.05049 13.7772 2.31395 13.8591 2.78361C13.9514 3.31298 13.9535 4.06808 13.9535 5.40698C13.9535 5.69597 14.1877 5.93023 14.4767 5.93023C14.7657 5.93023 15 5.69597 15 5.40698V5.33978C15 4.08454 15 3.23422 14.89 2.60371C14.7677 1.90231 14.5069 1.44815 14.0294 0.970633C13.5072 0.448521 12.8452 0.21681 12.0272 0.106842C11.2324 -2.06572e-05 10.2169 -1.36373e-05 8.93468 3.16188e-07H8.89533C8.60635 3.16188e-07 8.37207 0.234272 8.37207 0.523256C8.37207 0.81224 8.60635 1.04651 8.89533 1.04651Z"></path><path d="M0.523264 9.06976C0.812248 9.06976 1.04652 9.30404 1.04652 9.59302C1.04652 10.9319 1.04853 11.687 1.1409 12.2164C1.22285 12.686 1.37077 12.9495 1.71064 13.2894C2.0059 13.5846 2.4103 13.7616 3.11222 13.8559C3.8292 13.9524 4.77431 13.9535 6.10465 13.9535C6.39363 13.9535 6.62791 14.1878 6.62791 14.4767C6.62791 14.7657 6.39363 15 6.10465 15H6.0653C4.78314 15 3.76758 15 2.97278 14.8932C2.15481 14.7832 1.49275 14.5515 0.970641 14.0294C0.493124 13.5518 0.232355 13.0976 0.109969 12.3963C-5.46214e-05 11.7658 -3.36546e-05 10.9155 1.2291e-06 9.66027L8.21532e-06 9.59302C8.21532e-06 9.30404 0.234273 9.06976 0.523264 9.06976Z"></path><path d="M14.4767 9.06976C14.7657 9.06976 15 9.30404 15 9.59302V9.66021C15 10.9155 15 11.7658 14.89 12.3963C14.7677 13.0976 14.5069 13.5518 14.0294 14.0294C13.5072 14.5515 12.8452 14.7832 12.0272 14.8932C11.2324 15 10.2169 15 8.93468 15H8.89533C8.60635 15 8.37207 14.7657 8.37207 14.4767C8.37207 14.1878 8.60635 13.9535 8.89533 13.9535C10.2257 13.9535 11.1708 13.9524 11.8878 13.8559C12.5897 13.7616 12.9941 13.5846 13.2893 13.2894C13.6292 12.9495 13.7772 12.686 13.8591 12.2164C13.9514 11.687 13.9535 10.9319 13.9535 9.59302C13.9535 9.30404 14.1877 9.06976 14.4767 9.06976Z"></path><path d="M6.0653 3.16188e-07H6.10465C6.39363 3.16188e-07 6.62791 0.234272 6.62791 0.523256C6.62791 0.81224 6.39363 1.04651 6.10465 1.04651C4.77432 1.04651 3.8292 1.04762 3.11222 1.14402C2.4103 1.23839 2.0059 1.41537 1.71064 1.71063C1.37077 2.05049 1.22285 2.31395 1.1409 2.78361C1.04853 3.31298 1.04652 4.06808 1.04652 5.40698C1.04652 5.69597 0.812248 5.93023 0.523264 5.93023C0.234273 5.93023 8.21532e-06 5.69597 8.21532e-06 5.40698L1.2291e-06 5.33978C-3.36546e-05 4.08456 -5.46214e-05 3.23421 0.109969 2.60371C0.232355 1.90231 0.493124 1.44815 0.970641 0.970633C1.49275 0.448521 2.15481 0.21681 2.97278 0.106842C3.76758 -2.06572e-05 4.78315 -1.36373e-05 6.0653 3.16188e-07Z"></path><path d="M7.50002 6.6279C7.01835 6.6279 6.62793 7.01832 6.62793 7.49999C6.62793 7.98167 7.01835 8.37209 7.50002 8.37209C7.9817 8.37209 8.37212 7.98167 8.37212 7.49999C8.37212 7.01832 7.9817 6.6279 7.50002 6.6279Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M3.23889 8.93707C2.82381 8.4556 2.61627 8.21484 2.61627 7.5C2.61627 6.78516 2.82381 6.54439 3.23889 6.06294C4.06769 5.10156 5.45768 4.01163 7.49999 4.01163C9.54229 4.01163 10.9323 5.10155 11.7611 6.06294C12.1761 6.54439 12.3837 6.78516 12.3837 7.5C12.3837 8.21484 12.1761 8.4556 11.7611 8.93707C10.9323 9.89846 9.54229 10.9884 7.49999 10.9884C5.45768 10.9884 4.06769 9.89846 3.23889 8.93707ZM5.58139 7.5C5.58139 6.44037 6.44036 5.58139 7.49999 5.58139C8.55961 5.58139 9.41859 6.44037 9.41859 7.5C9.41859 8.55963 8.55961 9.4186 7.49999 9.4186C6.44036 9.4186 5.58139 8.55963 5.58139 7.5Z"></path></svg> </button> <button class="menu-item"><svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 3.5A1.5 1.5 0 0 1 3.5 2h8A1.5 1.5 0 0 1 13 3.5v5A1.5 1.5 0 0 1 11.5 10H8.2L5 12.5V10H3.5A1.5 1.5 0 0 1 2 8.5v-5Z" fill="currentColor"></path></svg> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button class="menu-item"> </button> <button><span> </span> <svg viewBox="0 0 12 12" aria-hidden="true"><path d="M4 2L8 6L4 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <!> <button><span> </span> <svg viewBox="0 0 12 12" aria-hidden="true"><path d="M4 2L8 6L4 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <!>',1),bd=U('<button class="menu-item danger"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M12.85 2.15L2.15 12.85"></path><path d="M2.15 2.15L12.85 12.85"></path></svg> </button>'),gd=U('<button class="menu-item danger"><svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.49991 0.877075C3.84222 0.877075 0.877075 3.84222 0.877075 7.49991C0.877075 11.1576 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1576 14.1227 7.49991C14.1227 3.84222 11.1576 0.877075 7.49991 0.877075ZM3.85768 3.15057C4.84311 2.32448 6.11342 1.82708 7.49991 1.82708C10.6329 1.82708 13.1727 4.36689 13.1727 7.49991C13.1727 8.88638 12.6753 10.1567 11.8492 11.1421L3.85768 3.15057ZM3.15057 3.85768C2.32448 4.84311 1.82708 6.11342 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C8.88638 13.1727 10.1567 12.6753 11.1421 11.8492L3.15057 3.85768Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg> </button>'),yd=U('<button class="menu-item danger"> </button>'),wd=U('<button class="menu-item danger"> </button>'),xd=U('<div class="context-title"> </div> <button class="menu-item"><svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.56297 0C8.30358 0 9.97289 0.691454 11.2037 1.92225C12.4345 3.15304 13.1259 4.82236 13.1259 6.56297C13.1259 8.30358 12.4345 9.97289 11.2037 11.2037C9.97289 12.4345 8.30358 13.1259 6.56297 13.1259C4.82236 13.1259 3.15304 12.4345 1.92225 11.2037C0.691453 9.97289 0 8.30358 0 6.56297C0 4.82236 0.691453 3.15304 1.92225 1.92225C3.15304 0.691454 4.82236 0 6.56297 0ZM7.54734 4.02938C8.03484 4.02938 8.43047 3.69094 8.43047 3.18937C8.43047 2.68781 8.03391 2.34938 7.54734 2.34938C7.05984 2.34938 6.66609 2.68781 6.66609 3.18937C6.66609 3.69094 7.05984 4.02938 7.54734 4.02938ZM7.71891 9.30469C7.71891 9.20438 7.75359 8.94375 7.73391 8.79562L6.96328 9.6825C6.80391 9.85031 6.60422 9.96656 6.51047 9.93563C6.46794 9.91997 6.43239 9.88965 6.41022 9.85012C6.38805 9.8106 6.38071 9.76445 6.38953 9.72L7.67391 5.6625C7.77891 5.14781 7.49016 4.67812 6.87797 4.61812C6.23203 4.61812 5.28141 5.27344 4.70297 6.105C4.70297 6.20438 4.68422 6.45187 4.70391 6.6L5.47359 5.71219C5.63297 5.54625 5.81859 5.42906 5.91234 5.46094C5.95853 5.47752 5.99638 5.51154 6.01776 5.55571C6.03915 5.59988 6.04236 5.65067 6.02672 5.69719L4.75359 9.735C4.60641 10.2075 4.88484 10.6706 5.55984 10.7756C6.55359 10.7756 7.14047 10.1363 7.71984 9.30469H7.71891Z"></path></svg> </button> <!> <!> <!> <!> <!>',1),kd=U('<div class="context-title context-title-stacked"><span> </span> <small> </small></div> <button class="menu-item"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M12.85 2.15L2.15 12.85"></path><path d="M2.15 2.15L12.85 12.85"></path></svg> </button> <button class="menu-item danger"><svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.49991 0.877075C3.84222 0.877075 0.877075 3.84222 0.877075 7.49991C0.877075 11.1576 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1576 14.1227 7.49991C14.1227 3.84222 11.1576 0.877075 7.49991 0.877075ZM3.85768 3.15057C4.84311 2.32448 6.11342 1.82708 7.49991 1.82708C10.6329 1.82708 13.1727 4.36689 13.1727 7.49991C13.1727 8.88638 12.6753 10.1567 11.8492 11.1421L3.85768 3.15057ZM3.15057 3.85768C2.32448 4.84311 1.82708 6.11342 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C8.88638 13.1727 10.1567 12.6753 11.1421 11.8492L3.15057 3.85768Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg> </button>',1),Cd=U('<div class="context-title"> </div> <button class="menu-item"><svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m6 19v2c0 .621.52 1 1 1h2v-1.5h-1.5v-1.5zm7.5 3h-3.5v-1.5h3.5zm4.5 0h-3.5v-1.5h3.5zm4-3h-1.5v1.5h-1.5v1.5h2c.478 0 1-.379 1-1zm-1.5-1v-3.363h1.5v3.363zm0-4.363v-3.637h1.5v3.637zm-13-3.637v3.637h-1.5v-3.637zm11.5-4v1.5h1.5v1.5h1.5v-2c0-.478-.379-1-1-1zm-10 0h-2c-.62 0-1 .519-1 1v2h1.5v-1.5h1.5zm4.5 1.5h-3.5v-1.5h3.5zm3-1.5v-2.5h-13v13h2.5v-1.863h1.5v3.363h-4.5c-.48 0-1-.379-1-1v-14c0-.481.38-1 1-1h14c.621 0 1 .522 1 1v4.5h-3.5v-1.5z" fill-rule="nonzero"></path></svg> </button> <button class="menu-item"><svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m6 19v2c0 .621.52 1 1 1h2v-1.5h-1.5v-1.5zm7.5 3h-3.5v-1.5h3.5zm4.5 0h-3.5v-1.5h3.5zm4-3h-1.5v1.5h-1.5v1.5h2c.478 0 1-.379 1-1zm-1.5-1v-3.363h1.5v3.363zm0-4.363v-3.637h1.5v3.637zm-13-3.637v3.637h-1.5v-3.637zm11.5-4v1.5h1.5v1.5h1.5v-2c0-.478-.379-1-1-1zm-10 0h-2c-.62 0-1 .519-1 1v2h1.5v-1.5h1.5zm4.5 1.5h-3.5v-1.5h3.5zm3-1.5v-2.5h-13v13h2.5v-1.863h1.5v3.363h-4.5c-.48 0-1-.379-1-1v-14c0-.481.38-1 1-1h14c.621 0 1 .522 1 1v4.5h-3.5v-1.5z" fill-rule="nonzero"></path></svg> </button> <button class="menu-item"><svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M12.85 2.15L2.15 12.85"></path><path d="M2.15 2.15L12.85 12.85"></path></svg> </button> <button class="menu-item danger"><svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.49991 0.877075C3.84222 0.877075 0.877075 3.84222 0.877075 7.49991C0.877075 11.1576 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1576 14.1227 7.49991C14.1227 3.84222 11.1576 0.877075 7.49991 0.877075ZM3.85768 3.15057C4.84311 2.32448 6.11342 1.82708 7.49991 1.82708C10.6329 1.82708 13.1727 4.36689 13.1727 7.49991C13.1727 8.88638 12.6753 10.1567 11.8492 11.1421L3.85768 3.15057ZM3.15057 3.85768C2.32448 4.84311 1.82708 6.11342 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C8.88638 13.1727 10.1567 12.6753 11.1421 11.8492L3.15057 3.85768Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd"></path></svg> </button>',1),Md=U('<div class="context-menu" role="menu" tabindex="-1"><!></div>'),Td=U("<!> <!>",1);function ts(t,e){Xe(e,!0);function a(M){M&&Gi(M)}async function r(M){if(M.impounded){await Yu(M.plate);return}b("impound_vehicle")}let i=T(null),s=T(null),l=T(null);const c={getBoundingClientRect(){return new DOMRect(e.x,e.y,0,0)}};async function v(){if(!n(i)||!e.open)return;const{x:M,y:S}=await rl(c,n(i),{placement:"right-start",middleware:[tl(0),al(),nl({padding:8})]});Object.assign(n(i).style,{left:`${M}px`,top:`${S}px`})}let f=null;xt(()=>{if(!e.open||!n(i)){f?.(),f=null,_(l,null);return}return v(),f=el(c,n(i),v),()=>{f?.(),f=null}});let p=T(!1),y=T(null);function b(M){_(y,M,!0),_(p,!0),_(s,e.value??null,!0)}function m(M){_(l,null),b(M),e.onClose()}function A(M){_(l,n(l)===M?null:M,!0)}function k(){_(p,!1),_(y,null),_(s,null)}function w(){if(!n(s)||!n(y))return"";if(n(y)==="change_expiry")return`${h("change_expiry")} | ${n(s).identifier}`;if(n(y)==="revoke")return`${h("revoke")} ${h("ban")} | ${n(s).identifier}`;if(n(y)==="delete_vehicle")return`${h("delete_vehicle")} | ${n(s).plate}`;if(n(y)==="impound_vehicle")return`${h("impound")} | ${n(s).plate}`;const M=n(s),N={kick:h("kick"),ban:h("ban"),notify:h("notify_player"),give_money:h("give_money"),take_money:h("take_money"),set_health:h("set_health"),set_armor:h("set_armor"),clean_inventory:h("clean_inventory"),kill_player:h("kill_player"),revive_player:h("revive_player"),freeze_player:h("freeze_player"),unfreeze_player:h("unfreeze_player"),set_model:h("set_model"),open_clothing:h("open_clothing"),give_all_weapons:h("give_all_weapons"),set_bucket:h("set_bucket"),set_radio:h("set_radio"),set_job:h("set_job"),set_name:h("set_name"),set_thirst:h("set_thirst"),set_hunger:h("set_hunger"),ace_add:h("ace_add"),ace_remove:h("ace_remove"),delete_character:h("delete_character"),troll_burn:h("troll_burn"),troll_explode:h("troll_explode"),troll_sky:h("troll_sky"),troll_random:h("troll_random"),troll_nausea:h("troll_nausea")}[n(y)]??"",K=M.identifier??M.char_identifier??h("identifier"),D=M.status==="online"?`(#${M.id}) ${M.name}`:`${M.name} (${K})`;return`${N} | ${D}`}var C=Td();Kn("click",Un,function(...M){e.onClose?.apply(this,M)});var z=oe(C);{var R=M=>{var S=Md();S.__click=L=>L.stopPropagation(),S.__keydown=L=>L.stopPropagation();var N=o(S);{var K=L=>{var I=xd(),ae=oe(I),Q=o(ae),j=u(ae,2);j.__click=ie=>{e.toggleInformation?.(ie.clientX,ie.clientY,e.value,!0),e.onClose()};var q=u(o(j)),Y=u(j,2);{var Z=ie=>{var he=md(),me=oe(he);me.__click=()=>{Fu(Number(e.value.id)),e.onClose()};var Ae=u(o(me)),Fe=u(me,2);Fe.__click=()=>{Iu(Number(e.value.id)),e.onClose()};var We=u(o(Fe)),ze=u(Fe,2);ze.__click=()=>{Vu(Number(e.value.id)),e.onClose()};var Je=u(o(ze)),$e=u(ze,2);$e.__click=()=>{b("notify"),e.onClose()};var at=u(o($e)),B=u($e,2);B.__click=()=>{b("give_money"),e.onClose()};var F=o(B),ne=u(B,2);ne.__click=()=>{b("take_money"),e.onClose()};var ve=o(ne),ce=u(ne,2);ce.__click=()=>{b("set_health"),e.onClose()};var Le=o(ce),be=u(ce,2);be.__click=()=>{b("set_armor"),e.onClose()};var we=o(be),d=u(be,2);let P;d.__click=()=>A("tools");var O=o(d),te=o(O),G=u(d,2);{var J=Be=>{var Pe=_d(),qe=o(Pe),tt=o(qe),Ve=u(qe,2);Ve.__click=()=>m("revive_player");var De=o(Ve),pe=u(Ve,2);pe.__click=()=>m("kill_player");var Ye=o(pe),Ze=u(pe,2);Ze.__click=()=>m("freeze_player");var it=o(Ze),bt=u(Ze,2);bt.__click=()=>m("unfreeze_player");var Zt=o(bt),It=u(bt,2);It.__click=()=>m("set_model");var Ct=o(It),ct=u(It,2);ct.__click=()=>m("open_clothing");var tn=o(ct),zt=u(ct,2);zt.__click=()=>m("give_all_weapons");var nn=o(zt),_t=u(zt,2);_t.__click=()=>m("set_bucket");var Ot=o(_t),Ft=u(_t,2);Ft.__click=()=>m("set_radio");var an=o(Ft),Yt=u(Ft,2);Yt.__click=()=>m("set_job");var Mt=o(Yt),Tt=u(Yt,2);Tt.__click=()=>m("set_name");var mn=o(Tt),rn=u(Tt,2);rn.__click=()=>m("set_thirst");var Ln=o(rn),St=u(rn,2);St.__click=()=>m("set_hunger");var Vt=o(St),Dt=u(St,2);Dt.__click=()=>m("ace_add");var Xt=o(Dt),sn=u(Dt,2);sn.__click=()=>m("ace_remove");var Pn=o(sn);$((En,zn,On,ua,Yn,va,Na,Ra,Ba,Dn,da,fa,ha,_a,pa,Ia)=>{g(tt,En),g(De,zn),g(Ye,On),g(it,ua),g(Zt,Yn),g(Ct,va),g(tn,Na),g(nn,Ra),g(Ot,Ba),g(an,Dn),g(Mt,da),g(mn,fa),g(Ln,ha),g(Vt,_a),g(Xt,pa),g(Pn,Ia)},[()=>h("player_tools"),()=>h("revive_player"),()=>h("kill_player"),()=>h("freeze_player"),()=>h("unfreeze_player"),()=>h("set_model"),()=>h("open_clothing"),()=>h("give_all_weapons"),()=>h("set_bucket"),()=>h("set_radio"),()=>h("set_job"),()=>h("set_name"),()=>h("set_thirst"),()=>h("set_hunger"),()=>h("ace_add"),()=>h("ace_remove")]),E(Be,Pe)};ee(G,Be=>{n(l)==="tools"&&Be(J)})}var ge=u(G,2);let ke;ge.__click=()=>A("troll");var Ue=o(ge),et=o(Ue),Oe=u(ge,2);{var rt=Be=>{var Pe=pd(),qe=o(Pe),tt=o(qe),Ve=u(qe,2);Ve.__click=()=>m("troll_burn");var De=o(Ve),pe=u(Ve,2);pe.__click=()=>m("troll_explode");var Ye=o(pe),Ze=u(pe,2);Ze.__click=()=>m("troll_sky");var it=o(Ze),bt=u(Ze,2);bt.__click=()=>m("troll_random");var Zt=o(bt),It=u(bt,2);It.__click=()=>m("troll_nausea");var Ct=o(It);$((ct,tn,zt,nn,_t,Ot)=>{g(tt,ct),g(De,tn),g(Ye,zt),g(it,nn),g(Zt,_t),g(Ct,Ot)},[()=>h("troll_options"),()=>h("troll_burn"),()=>h("troll_explode"),()=>h("troll_sky"),()=>h("troll_random"),()=>h("troll_nausea")]),E(Be,Pe)};ee(Oe,Be=>{n(l)==="troll"&&Be(rt)})}$((Be,Pe,qe,tt,Ve,De,pe,Ye,Ze,it)=>{g(Ae,` ${Be??""}`),g(We,` ${Pe??""}`),g(Je,` ${qe??""}`),g(at,` ${tt??""}`),g(F,Ve),g(ve,De),g(Le,pe),g(we,Ye),P=Ne(d,1,"menu-item has-submenu",null,P,{active:n(l)==="tools"}),Ke(d,"aria-expanded",n(l)==="tools"),g(te,Ze),ke=Ne(ge,1,"menu-item has-submenu",null,ke,{active:n(l)==="troll"}),Ke(ge,"aria-expanded",n(l)==="troll"),g(et,it)},[()=>h("teleport"),()=>h("bring"),()=>h("spectate"),()=>h("notify_player"),()=>h("give_money"),()=>h("take_money"),()=>h("set_health"),()=>h("set_armor"),()=>h("player_tools"),()=>h("troll_options")]),E(ie,he)};ee(Y,ie=>{e.value.status=="online"&&ie(Z)})}var X=u(Y,2);{var re=ie=>{var he=bd();he.__click=()=>{b("kick"),e.onClose()};var me=u(o(he));$(Ae=>g(me,` ${Ae??""}`),[()=>h("kick")]),E(ie,he)};ee(X,ie=>{e.value.status==="online"&&ie(re)})}var se=u(X,2);{var ue=ie=>{var he=gd();he.__click=()=>{b("ban"),e.onClose()};var me=u(o(he));$(Ae=>g(me,` ${Ae??""}`),[()=>h("ban")]),E(ie,he)};ee(se,ie=>{(e.value.status==="online"||e.value.identifier)&&ie(ue)})}var le=u(se,2);{var Ce=ie=>{var he=yd();he.__click=()=>{b("clean_inventory"),e.onClose()};var me=o(he);$(Ae=>g(me,Ae),[()=>h("clean_inventory")]),E(ie,he)};ee(le,ie=>{e.value.status==="online"&&ie(Ce)})}var Te=u(le,2);{var ye=ie=>{var he=wd();he.__click=()=>{b("delete_character"),e.onClose()};var me=o(he);$(Ae=>g(me,Ae),[()=>h("delete_character")]),E(ie,he)};ee(Te,ie=>{e.value.char_identifier&&ie(ye)})}$(ie=>{g(Q,e.value.status==="online"?`#${e.value.id} - ${e.value.name}`:`OFFLINE - ${e.value.name}`),g(q,` ${ie??""}`)},[()=>h("information")]),E(L,I)},D=L=>{var I=Se(),ae=oe(I);{var Q=q=>{var Y=kd(),Z=oe(Y),X=o(Z),re=o(X),se=u(X,2),ue=o(se),le=u(Z,2);le.__click=()=>{b("change_expiry"),e.onClose()};var Ce=u(o(le)),Te=u(le,2);Te.__click=()=>{b("revoke"),e.onClose()};var ye=u(o(Te));$((ie,he,me)=>{g(re,ie),g(ue,e.value.identifier),g(Ce,` ${he??""}`),g(ye,` ${me??""}`)},[()=>h("target"),()=>h("change_expiry"),()=>h("revoke")]),E(q,Y)},j=q=>{var Y=Se(),Z=oe(Y);{var X=re=>{var se=Cd(),ue=oe(se),le=o(ue),Ce=u(ue,2);Ce.__click=async()=>{a(e.value.plate),e.onClose()};var Te=u(o(Ce)),ye=u(Ce,2);ye.__click=async()=>{a(e.value.owner??""),e.onClose()};var ie=u(o(ye)),he=u(ye,2);he.__click=async()=>{await r(e.value),e.onClose()};var me=u(o(he)),Ae=u(he,2);Ae.__click=async()=>{b("delete_vehicle"),e.onClose()};var Fe=u(o(Ae));$((We,ze,Je,$e)=>{g(le,`${e.value.plate??""} - ${e.value.name??""}`),g(Te,` ${We??""}`),g(ie,` ${ze??""}`),g(me,` ${Je??""}`),g(Fe,` ${$e??""}`)},[()=>h("copy_plate"),()=>h("copy_owner"),()=>e.value.impounded?h("unimpound"):h("impound"),()=>h("delete_vehicle")]),E(re,se)};ee(Z,re=>{e.type==="vehicle"&&re(X)},!0)}E(q,Y)};ee(ae,q=>{e.type==="ban"?q(Q):q(j,!1)},!0)}E(L,I)};ee(N,L=>{e.type==="player"?L(K):L(D,!1)})}na(S,L=>_(i,L),()=>n(i)),E(M,S)};ee(z,M=>{e.open&&e.value&&M(R)})}var x=u(z,2);{let M=H(w);hd(x,{get open(){return n(p)},get confirmType(){return n(y)},get title(){return n(M)},onCancel:k,onConfirm:async S=>{if(!(!n(y)||!n(s)))try{switch(n(y)){case"kick":await ju(Number(n(s).id),S.reason);break;case"ban":if(n(s).status==="online")await Wu(Number(n(s).id),S.reason,S.duration??void 0);else{const N=n(s).identifier;N&&await Uu(N,S.reason??"",S.duration??void 0)}break;case"notify":await Gu(Number(n(s).id),S.reason??"");break;case"give_money":await He(n(s).id,"giveMoney",{amount:S.amount,account:"money"});break;case"take_money":await He(n(s).id,"takeMoney",{amount:S.amount,account:"money"});break;case"set_health":await He(n(s).id,"setHealth",{amount:S.amount});break;case"set_armor":await He(n(s).id,"setArmor",{amount:S.amount});break;case"clean_inventory":await He(n(s).id,"cleanInventory");break;case"kill_player":await He(n(s).id,"killPlayer");break;case"revive_player":await He(n(s).id,"revivePlayer");break;case"freeze_player":await He(n(s).id,"freezePlayer",{enabled:!0});break;case"unfreeze_player":await He(n(s).id,"freezePlayer",{enabled:!1});break;case"set_model":await He(n(s).id,"setModel",{model:S.text});break;case"open_clothing":await He(n(s).id,"openClothing");break;case"give_all_weapons":await He(n(s).id,"giveAllWeapons");break;case"set_bucket":await He(n(s).id,"setRoutingBucket",{bucket:S.amount});break;case"set_radio":await He(n(s).id,"setRadio",{channel:S.amount});break;case"set_job":await He(n(s).id,"setJob",{job:S.text,grade:S.amount??0});break;case"set_name":await He(n(s).id,"setName",{firstName:S.text,lastName:S.secondaryText});break;case"set_thirst":await He(n(s).id,"setThirst",{amount:S.amount});break;case"set_hunger":await He(n(s).id,"setHunger",{amount:S.amount});break;case"ace_add":await He(n(s).id,"aceAdd",{group:S.text});break;case"ace_remove":await He(n(s).id,"aceRemove",{group:S.text});break;case"delete_character":n(s).char_identifier&&await He(n(s).id,"deleteCharacter",{identifier:n(s).char_identifier});break;case"troll_burn":await He(n(s).id,"troll",{trollAction:"burn"});break;case"troll_explode":await He(n(s).id,"troll",{trollAction:"explode"});break;case"troll_sky":await He(n(s).id,"troll",{trollAction:"sky"});break;case"troll_random":await He(n(s).id,"troll",{trollAction:"randomTeleport"});break;case"troll_nausea":await He(n(s).id,"troll",{trollAction:"nausea"});break;case"change_expiry":await qu(n(s).identifier,S.newDate);break;case"revoke":await Ku(n(s).identifier);break;case"delete_vehicle":await Xu(n(s).plate);break;case"impound_vehicle":if(!S.impoundName)return;await Zu(n(s).plate,S.impoundName);break}}catch(N){console.error("Confirm action failed",N)}finally{k()}}})}E(t,C),Ge()}ht(["click","keydown"]);const Sd=new Intl.NumberFormat("de-DE"),nt=(t=0)=>Sd.format(t);function Ad(t,e){return t?new Date(t).toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):e??"Never"}function Ld(t){return`${t.days}d ${t.hours}h ${t.minutes}m`}function Pd(t){return t?`X: ${t.x.toFixed(2)} Y: ${t.y.toFixed(2)} Z: ${t.z.toFixed(2)}`:"Unknown"}function il(t,e=24){return t.length<=e?t:t.slice(0,e-3)+"..."}function ns(t){if(t==null||t==="")return null;if(typeof t=="number")return t<=0?null:t<1e12?t*1e3:t;const e=t.trim();if(e===""||e.startsWith("0000-00-00"))return null;const a=Number(e);if(Number.isFinite(a))return ns(a);const r=Date.parse(e.includes("T")?e:e.replace(" ","T"));return Number.isFinite(r)&&r>0?r:null}function Ws(t,e=h("permanent")){const a=ns(t);if(a===null)return e;const r=new Date(a),i=String(r.getDate()).padStart(2,"0"),s=String(r.getMonth()+1).padStart(2,"0"),l=r.getFullYear();return`${i}/${s}/${l}`}var Ed=U('<div class="info-row" role="button" tabindex="0"><span class="info-label"> </span> <span class="info-value"> </span></div>'),zd=U('<span class="online-badge"><span class="online-dot"></span> <span> </span></span>'),Od=U('<span class="offline-badge"><span class="offline-dot"></span> <span> </span></span>'),Dd=U("<!> <!>",1),Nd=U("<!> <!> <!>",1),Rd=U('<div class="info-section-title"> </div> <!>',1),Bd=U('<div class="clipboard-feedback"><svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m6 19v2c0 .621.52 1 1 1h2v-1.5h-1.5v-1.5zm7.5 3h-3.5v-1.5h3.5zm4.5 0h-3.5v-1.5h3.5zm4-3h-1.5v1.5h-1.5v1.5h2c.478 0 1-.379 1-1zm-1.5-1v-3.363h1.5v3.363zm0-4.363v-3.637h1.5v3.637zm-13-3.637v3.637h-1.5v-3.637zm11.5-4v1.5h1.5v1.5h1.5v-2c0-.478-.379-1-1-1zm-10 0h-2c-.62 0-1 .519-1 1v2h1.5v-1.5h1.5zm4.5 1.5h-3.5v-1.5h3.5zm3-1.5v-2.5h-13v13h2.5v-1.863h1.5v3.363h-4.5c-.48 0-1-.379-1-1v-14c0-.481.38-1 1-1h14c.621 0 1 .522 1 1v4.5h-3.5v-1.5z" fill-rule="nonzero"></path></svg> </div>'),Id=U('<div class="info-panel" role="dialog" tabindex="-1"><div class="info-header" role="menubar" tabindex="-1"><!> <span> </span> <button class="info-close" aria-label="close"><svg viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><path d="M12.85 2.15L2.15 12.85"></path><path d="M2.15 2.15L12.85 12.85"></path></svg></button></div> <div class="info-content"><!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!></div></div>');function Fd(t,e){Xe(e,!0);const a=(D,L)=>{let I=()=>L?.().label,ae=()=>L?.().value;const Q=H(()=>ae()??"-");var j=Ed();j.__click=()=>ae()!=null&&M(String(ae())),j.__keydown=re=>re.key==="Enter"&&ae()!=null&&M(String(ae()));var q=o(j),Y=o(q),Z=u(q,2),X=o(Z);$(()=>{g(Y,I()),g(X,n(Q))}),E(D,j)};let r=T(null),i=T(0),s=T(0),l=!1,c=!1,v=0,f=0;const p={getBoundingClientRect(){return new DOMRect(e.mouseX,e.mouseY,0,0)}};async function y(){if(!n(r)||c)return;const{x:D,y:L}=await rl(p,n(r),{placement:"right-start",middleware:[tl(),al(),nl()]});_(i,D,!0),_(s,L,!0)}function b(D){l=!0,c=!0,z?.(),z=null,v=D.clientX-n(i),f=D.clientY-n(s),window.addEventListener("mousemove",w),window.addEventListener("mouseup",C)}let m=null,A=0,k=0;function w(D){l&&(A=D.clientX-v,k=D.clientY-f,m===null&&(m=requestAnimationFrame(()=>{_(i,A,!0),_(s,k,!0),m=null})))}function C(){m!==null&&(cancelAnimationFrame(m),m=null),l=!1,window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",C)}let z=null;xt(()=>{if(!e.open||!n(r)||c){z?.(),z=null;return}return y(),z=el(p,n(r),y),window.addEventListener("resize",y),()=>{z?.(),z=null,window.removeEventListener("resize",y)}}),xt(()=>{e.open||(c=!1)});let R=T(null),x=null;async function M(D){Gi(D),await new Promise(L=>setTimeout(L,0)),_(R,h("copied_to_clipboard","Copied to clipboard"),!0),x&&clearTimeout(x),x=window.setTimeout(()=>{_(R,null)},1e3)}var S=Se(),N=oe(S);{var K=D=>{var L=Id();L.__click=d=>d.stopPropagation(),L.__keydown=d=>d.stopPropagation();var I=o(L);I.__mousedown=b;var ae=o(I);{var Q=d=>{var P=zd(),O=u(o(P),2),te=o(O);$(G=>g(te,G),[()=>h("online")]),E(d,P)},j=d=>{var P=Od(),O=u(o(P),2),te=o(O);$(G=>g(te,G),[()=>h("offline")]),E(d,P)};ee(ae,d=>{e.player.status==="online"?d(Q):d(j,!1)})}var q=u(ae,2),Y=o(q),Z=u(q,2);Z.__click=function(...d){e.onClose?.apply(this,d)};var X=u(I,2),re=o(X);{var se=d=>{{let P=H(()=>({label:h("id"),value:e.player.id}));a(d,()=>n(P))}};ee(re,d=>{e.player.status==="online"&&d(se)})}var ue=u(re,2);{var le=d=>{{let P=H(()=>({label:h("identifier"),value:e.player.identifier}));a(d,()=>n(P))}};ee(ue,d=>{e.player.identifier&&d(le)})}var Ce=u(ue,2);{var Te=d=>{{let P=H(()=>({label:h("ip_address"),value:e.player.ip}));a(d,()=>n(P))}};ee(Ce,d=>{e.player.ip&&d(Te)})}var ye=u(Ce,2);{var ie=d=>{var P=Dd(),O=oe(P);{let G=H(()=>({label:h("routing_bucket"),value:e.player.routing_bucket??0}));a(O,()=>n(G))}var te=u(O,2);{let G=H(()=>({label:h("radio_channel"),value:e.player.radio_channel??0}));a(te,()=>n(G))}E(d,P)};ee(ye,d=>{e.player.status==="online"&&d(ie)})}var he=u(ye,2);{var me=d=>{{let P=H(()=>({label:h("char_identifier"),value:e.player.char_identifier}));a(d,()=>n(P))}};ee(he,d=>{e.player.char_identifier&&d(me)})}var Ae=u(he,2);{let d=H(()=>({label:h("name"),value:il(e.player.name)}));a(Ae,()=>n(d))}var Fe=u(Ae,2);{let d=H(()=>({label:h("gender"),value:e.player.gender==="m"?h("male"):h("female")}));a(Fe,()=>n(d))}var We=u(Fe,2);{let d=H(()=>({label:h("job"),value:e.player.job??"Unknown"}));a(We,()=>n(d))}var ze=u(We,2);{let d=H(()=>({label:h("job_grade"),value:e.player.job_grade??"Unknown"}));a(ze,()=>n(d))}var Je=u(ze,2);{let d=H(()=>({label:h("money"),value:`$${nt(e.player.cash)}`}));a(Je,()=>n(d))}var $e=u(Je,2);{let d=H(()=>({label:h("bank_money"),value:`$${nt(e.player.bank)}`}));a($e,()=>n(d))}var at=u($e,2);{let d=H(()=>({label:h("black_money"),value:`$${nt(e.player.alt_money)}`}));a(at,()=>n(d))}var B=u(at,2);{var F=d=>{var P=Nd(),O=oe(P);{let J=H(()=>({label:h("position"),value:Pd(e.player.position)}));a(O,()=>n(J))}var te=u(O,2);{let J=H(()=>({label:h("health"),value:e.player.health}));a(te,()=>n(J))}var G=u(te,2);{let J=H(()=>({label:h("armor"),value:e.player.armor}));a(G,()=>n(J))}E(d,P)};ee(B,d=>{e.player.status==="online"&&d(F)})}var ne=u(B,2);{let d=H(()=>({label:h("play_time"),value:Ld(e.player.play_time)}));a(ne,()=>n(d))}var ve=u(ne,2);{let d=H(()=>({label:h("last_visited"),value:Ad(e.player.last_join)}));a(ve,()=>n(d))}var ce=u(ve,2);{var Le=d=>{var P=Rd(),O=oe(P),te=o(O),G=u(O,2);ot(G,17,()=>Object.entries(e.player.identifiers),Et,(J,ge)=>{var ke=H(()=>Hl(n(ge),2));let Ue=()=>n(ke)[0],et=()=>n(ke)[1];{let Oe=H(()=>({label:Ue(),value:String(et())}));a(J,()=>n(Oe))}}),$(J=>g(te,J),[()=>h("identifiers")]),E(d,P)};ee(ce,d=>{e.player.identifiers&&Object.keys(e.player.identifiers).length>0&&d(Le)})}var be=u(ce,2);{var we=d=>{var P=Bd(),O=u(o(P));$(()=>g(O,` ${n(R)??""}`)),E(d,P)};ee(be,d=>{n(R)&&d(we)})}na(L,d=>_(r,d),()=>n(r)),$((d,P)=>{yn(L,`left: ${n(i)??""}px; top: ${n(s)??""}px`),Ke(L,"aria-label",d),g(Y,P)},[()=>h("player_information"),()=>h("player_information")]),E(D,L)};ee(N,D=>{e.open&&e.player&&D(K)})}E(t,S),Ge()}ht(["click","keydown","mousedown"]);var Vd=U('<div role="button" tabindex="-1" class="player-row svelte-f3myba"><span class="svelte-f3myba"><span class="id-badge svelte-f3myba"> </span></span> <span class="svelte-f3myba"> </span> <span class="svelte-f3myba"> </span> <span class="svelte-f3myba"> </span> <span class="svelte-f3myba"> </span> <span class="svelte-f3myba"> </span> <span class="svelte-f3myba"> </span> <span class="svelte-f3myba"> </span></div>'),Hd=U("<!> <!> <!>",1);function as(t,e){Xe(e,!0);const a=dt(e,"filteredPlayers",19,()=>[]);let r=T(!1),i=T(null),s=T(_e({x:0,y:0}));const l=x=>{if(!x)return"-";const M=Number(x),S=M<1e12?M*1e3:M,N=new Date(S),K=String(N.getDate()).padStart(2,"0"),D=String(N.getMonth()+1).padStart(2,"0"),L=N.getFullYear();return`${K}/${D}/${L}`};let c=T(!1),v=T(null),f=T(0),p=T(0);function y(x,M){x.preventDefault(),_(c,!1),queueMicrotask(()=>{_(f,x.clientX,!0),_(p,x.clientY,!0),_(v,M,!0),_(c,!0)})}function b(){_(c,!1),_(v,null)}function m(x,M,S,N=!1){_(i,S,!0),(!n(r)||!N)&&_(s,{x,y:M},!0),_(r,!0)}function A(x,M){if(x.key!=="Enter"&&x.key!==" ")return;x.preventDefault();const S=x.currentTarget.getBoundingClientRect();m(S.left,S.top,M,n(r))}xt(()=>{const x=V.focusPlayerId;if(x===null)return;const M=a().find(S=>Number(S.id)===x);M&&(_(i,M,!0),_(r,!0),_(s,{x:window.innerWidth/2,y:window.innerHeight/2},!0),V.clearFocusPlayer())});var k=Hd();Kn("click",Un,()=>{_(r,!1)});var w=oe(k);{var C=x=>{Ji(x,{get items(){return a()},style:"height:100%;width:100%;overflow:auto;",vl_slot:(S,N)=>{const D=H(()=>N?.().item);var L=Vd();L.__click=me=>{me.stopPropagation(),m(me.clientX,me.clientY,n(D),n(r))},L.__keydown=me=>A(me,n(D)),L.__contextmenu=me=>y(me,n(D));var I=o(L),ae=o(I),Q=o(ae),j=u(I,2),q=o(j),Y=u(j,2),Z=o(Y),X=u(Y,2),re=o(X),se=u(X,2),ue=o(se),le=u(se,2),Ce=o(le),Te=u(le,2),ye=o(Te),ie=u(Te,2),he=o(ie);$((me,Ae,Fe,We,ze)=>{g(Q,`#${n(D).id??""}`),g(q,me),g(Z,Ae),g(re,Fe),g(ue,We),g(Ce,n(D).health),g(ye,n(D).armor),g(he,ze)},[()=>il(n(D).name),()=>nt(n(D).cash),()=>nt(n(D).bank),()=>nt(n(D).alt_money),()=>l(n(D).last_join)]),E(S,L)},$$slots:{vl_slot:!0}})};ee(w,x=>{a().length>0&&x(C)})}var z=u(w,2);ts(z,{get open(){return n(c)},type:"player",get value(){return n(v)},get x(){return n(f)},get y(){return n(p)},onClose:b,toggleInformation:(x,M,S,N)=>{N?m(x,M,S,n(r)):_(r,!1)}});var R=u(z,2);{let x=H(()=>n(i)??null);Fd(R,{get player(){return n(x)},get open(){return n(r)},get mouseX(){return n(s).x},get mouseY(){return n(s).y},onClose:()=>_(r,!1)})}E(t,k),Ge()}ht(["click","keydown","contextmenu"]);var jd=U('<div class="top-bar"><span class="players-title" tabindex="-1"> </span> <div class="player-search-bar-container" tabindex="-1"><svg class="player-search-icon" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8746 10.852L14 14M12.5556 6.77778C12.5556 9.96877 9.96877 12.5556 6.77778 12.5556C3.5868 12.5556 1 9.96877 1 6.77778C1 3.5868 3.5868 1 6.77778 1C9.96877 1 12.5556 3.5868 12.5556 6.77778Z" stroke="#F2F2F2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> <input type="text" tabindex="-1" class="player-search-bar"/></div></div> <div class="ply-table-header"><button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <span> </span> <span> </span> <button type="button" tabindex="-1"> </button></div> <div class="list-wrapper"><!></div>',1);function Us(t,e){Xe(e,!0);let a=T(""),r=T("id"),i=T(!0);function s(Y){n(r)===Y?_(i,!n(i)):(_(r,Y,!0),_(i,!0))}const l=H(()=>{const Y=n(a).trim().toLowerCase();return V.players?V.players.filter(Z=>Z.status==="online").filter(Z=>Y===""?!0:Z.name.toLowerCase().includes(Y)||String(Z.id).includes(Y)).slice().sort((Z,X)=>{const re=Z[n(r)],se=X[n(r)];return typeof re=="string"&&typeof se=="string"?n(i)?re.localeCompare(se):se.localeCompare(re):n(i)?(Number(re)||0)-(Number(se)||0):(Number(se)||0)-(Number(re)||0)}):[]});var c=jd(),v=oe(c),f=o(v),p=o(f),y=u(f,2),b=u(o(y),2),m=u(v,2),A=o(m);A.__click=()=>s("id");var k=o(A),w=u(A,2);w.__click=()=>s("name");var C=o(w),z=u(w,2);z.__click=()=>s("cash");var R=o(z),x=u(z,2);x.__click=()=>s("bank");var M=o(x),S=u(x,2);S.__click=()=>s("alt_money");var N=o(S),K=u(S,2),D=o(K),L=u(K,2),I=o(L),ae=u(L,2);ae.__click=()=>s("last_join");var Q=o(ae),j=u(m,2),q=o(j);as(q,{get filteredPlayers(){return n(l)}}),$((Y,Z,X,re,se,ue,le,Ce,Te,ye)=>{g(p,Y),Ke(b,"placeholder",Z),g(k,X),g(C,re),g(R,se),g(M,ue),g(N,le),g(D,Ce),g(I,Te),g(Q,ye)},[()=>h("players_list"),()=>h("search_player"),()=>h("id"),()=>h("name"),()=>h("money"),()=>h("bank_money"),()=>h("black_money"),()=>h("health"),()=>h("armor"),()=>h("last_visited")]),st(b,()=>n(a),Y=>_(a,Y)),E(t,c),Ge()}ht(["click"]);var Wd=U('<div role="button" tabindex="-1" class="ban-row svelte-c1nruu"><span class="svelte-c1nruu"><span class="id-badge svelte-c1nruu"> </span></span> <span class="svelte-c1nruu"> </span> <span class="svelte-c1nruu"> </span> <span class="svelte-c1nruu"> </span> <span class="svelte-c1nruu"> </span> <span class="svelte-c1nruu"> </span></div>'),Ud=U('<div class="ban-loading svelte-c1nruu">Loading bans...</div>'),qd=U("<!> <!>",1),Kd=U("<!> <!>",1);function Zd(t,e){Xe(e,!0);const a=dt(e,"filteredBans",19,()=>[]),r=dt(e,"hasMore",3,!1),i=dt(e,"loading",3,!1);let s=T(!1),l=T(null),c=T(0),v=T(0),f=T(0);function p(C,z){C.preventDefault(),_(s,!1),queueMicrotask(()=>{_(c,C.clientX,!0),_(v,C.clientY,!0),_(l,z,!0),_(s,!0)})}function y(){_(s,!1),_(l,null)}function b(C){!r()||i()||!e.onNeedMore||a().length===0||n(f)===a().length||Number(C.end)<a().length-15||(_(f,a().length,!0),e.onNeedMore())}var m=Kd(),A=oe(m);{var k=C=>{var z=qd(),R=oe(z);Ji(R,{get items(){return a()},style:"height:100%;width:100%;overflow:auto;",onVisibleRangeUpdate:b,vl_slot:(N,K)=>{const L=H(()=>K?.().item);var I=Wd();I.__contextmenu=ye=>p(ye,n(L));var ae=o(I),Q=o(ae),j=o(Q),q=u(ae,2),Y=o(q),Z=u(q,2),X=o(Z),re=u(Z,2),se=o(re),ue=u(re,2),le=o(ue),Ce=u(ue,2),Te=o(Ce);$((ye,ie)=>{g(j,`#${n(L).id??""}`),g(Y,n(L).identifier),g(X,n(L).reason),g(se,n(L).banned_by??"-"),g(le,ye),g(Te,ie)},[()=>Ws(n(L).banned_at,"-"),()=>Ws(n(L).expires_at)]),E(N,I)},$$slots:{vl_slot:!0}});var x=u(R,2);{var M=S=>{var N=Ud();E(S,N)};ee(x,S=>{i()&&S(M)})}E(C,z)};ee(A,C=>{a().length>0&&C(k)})}var w=u(A,2);ts(w,{get open(){return n(s)},type:"ban",get value(){return n(l)},get x(){return n(c)},get y(){return n(v)},onClose:y}),E(t,m),Ge()}ht(["contextmenu"]);var Yd=U('<div class="top-bar"><span class="players-title" tabindex="-1"> </span> <div class="player-search-bar-container" tabindex="-1"><svg class="player-search-icon" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8746 10.852L14 14M12.5556 6.77778C12.5556 9.96877 9.96877 12.5556 6.77778 12.5556C3.5868 12.5556 1 9.96877 1 6.77778C1 3.5868 3.5868 1 6.77778 1C9.96877 1 12.5556 3.5868 12.5556 6.77778Z" stroke="#F2F2F2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> <input type="text" tabindex="-1" class="player-search-bar"/></div></div> <div class="table-header svelte-1p3p8yw"><button type="button" tabindex="-1" class="svelte-1p3p8yw"> </button> <button type="button" tabindex="-1" class="svelte-1p3p8yw"> </button> <button type="button" tabindex="-1" class="svelte-1p3p8yw"> </button> <button type="button" tabindex="-1" class="svelte-1p3p8yw"> </button> <button type="button" tabindex="-1" class="svelte-1p3p8yw"> </button> <button type="button" tabindex="-1" class="svelte-1p3p8yw"> </button></div> <div class="list-wrapper"><!></div>',1);function Xd(t,e){Xe(e,!0);let a=T(""),r=T("id"),i=T(!0);function s(j){n(r)===j?_(i,!n(i)):(_(r,j,!0),_(i,!0))}function l(j,q){return q==="banned_at"||q==="expires_at"?ns(j[q])??0:j[q]}const c=H(()=>{const j=n(a).trim().toLowerCase();return V.bans?V.bans.filter(q=>j===""?!0:q.identifier.toLowerCase().includes(j)||q.reason.toLowerCase().includes(j)||String(q.id).includes(j)).slice().sort((q,Y)=>{const Z=l(q,n(r)),X=l(Y,n(r));return typeof Z=="string"&&typeof X=="string"?n(i)?Z.localeCompare(X):X.localeCompare(Z):n(i)?(Number(Z)||0)-(Number(X)||0):(Number(X)||0)-(Number(Z)||0)}):[]});async function v(){n(a).trim()===""&&await Ho()}var f=Yd(),p=oe(f),y=o(p),b=o(y),m=u(y,2),A=u(o(m),2),k=u(p,2),w=o(k);w.__click=()=>s("id");var C=o(w),z=u(w,2);z.__click=()=>s("identifier");var R=o(z),x=u(z,2);x.__click=()=>s("reason");var M=o(x),S=u(x,2);S.__click=()=>s("banned_by");var N=o(S),K=u(S,2);K.__click=()=>s("banned_at");var D=o(K),L=u(K,2);L.__click=()=>s("expires_at");var I=o(L),ae=u(k,2),Q=o(ae);{let j=H(()=>V.banHasMore&&n(a).trim()==="");Zd(Q,{get filteredBans(){return n(c)},get loading(){return V.banLoading},get hasMore(){return n(j)},onNeedMore:v})}$((j,q,Y,Z,X,re,se,ue)=>{g(b,j),Ke(A,"placeholder",q),g(C,Y),g(R,Z),g(M,X),g(N,re),g(D,se),g(I,ue)},[()=>h("bans_list"),()=>h("search_banned_identifier"),()=>`${h("ban")} ${h("id")}`,()=>h("identifier"),()=>h("reason"),()=>h("banned_by"),()=>h("banned_at"),()=>h("expires_at")]),st(A,()=>n(a),j=>_(a,j)),E(t,f),Ge()}ht(["click"]);var Gd=U('<div role="button" tabindex="-1" class="vehicle-row svelte-cbe8ml"><span class="svelte-cbe8ml"><span class="plate-badge svelte-cbe8ml"> </span></span> <span class="svelte-cbe8ml"> </span> <span class="svelte-cbe8ml"> </span> <span class="svelte-cbe8ml"> </span> <span class="svelte-cbe8ml"> </span> <span> </span></div>'),Jd=U('<div class="vehicle-loading svelte-cbe8ml">Loading vehicles...</div>'),Qd=U("<!> <!>",1),$d=U("<!> <!>",1);function ef(t,e){Xe(e,!0);const a=dt(e,"filteredVehicles",19,()=>[]),r=dt(e,"hasMore",3,!1),i=dt(e,"loading",3,!1);let s=T(!1),l=T(null),c=T(0),v=T(0),f=T(0);function p(C,z){C.preventDefault(),_(s,!1),queueMicrotask(()=>{_(c,C.clientX,!0),_(v,C.clientY,!0),_(l,z,!0),_(s,!0)})}function y(){_(s,!1),_(l,null)}function b(C){!r()||i()||!e.onNeedMore||a().length===0||n(f)===a().length||Number(C.end)<a().length-15||(_(f,a().length,!0),e.onNeedMore())}var m=$d(),A=oe(m);{var k=C=>{var z=Qd(),R=oe(z);Ji(R,{get items(){return a()},style:"height:100%;width:100%;overflow:auto;",onVisibleRangeUpdate:b,vl_slot:(N,K)=>{const L=H(()=>K?.().item);var I=Gd();I.__contextmenu=ie=>p(ie,n(L));var ae=o(I),Q=o(ae),j=o(Q),q=u(ae,2),Y=o(q),Z=u(q,2),X=o(Z),re=u(Z,2),se=o(re),ue=u(re,2),le=o(ue),Ce=u(ue,2);let Te;var ye=o(Ce);$(()=>{g(j,n(L).plate),g(Y,n(L).owner??"-"),g(X,n(L).name),g(se,n(L).type),g(le,n(L).mileage??"-"),Te=Ne(Ce,1,"svelte-cbe8ml",null,Te,{"item-impounded":n(L).impounded}),g(ye,n(L).impounded?"Yes":"No")}),E(N,I)},$$slots:{vl_slot:!0}});var x=u(R,2);{var M=S=>{var N=Jd();E(S,N)};ee(x,S=>{i()&&S(M)})}E(C,z)};ee(A,C=>{a().length>0&&C(k)})}var w=u(A,2);ts(w,{get open(){return n(s)},type:"vehicle",get value(){return n(l)},get x(){return n(c)},get y(){return n(v)},onClose:y}),E(t,m),Ge()}ht(["contextmenu"]);var tf=U('<div class="top-bar"><span class="players-title" tabindex="-1"> </span> <div class="player-search-bar-container" tabindex="-1"><svg class="player-search-icon" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8746 10.852L14 14M12.5556 6.77778C12.5556 9.96877 9.96877 12.5556 6.77778 12.5556C3.5868 12.5556 1 9.96877 1 6.77778C1 3.5868 3.5868 1 6.77778 1C9.96877 1 12.5556 3.5868 12.5556 6.77778Z" stroke="#F2F2F2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> <input type="text" tabindex="-1" class="player-search-bar"/></div></div> <div class="table-header svelte-ad34dh"><button type="button" tabindex="-1" class="svelte-ad34dh"> </button> <button type="button" tabindex="-1" class="svelte-ad34dh"> </button> <button type="button" tabindex="-1" class="svelte-ad34dh"> </button> <button type="button" tabindex="-1" class="svelte-ad34dh"> </button> <button type="button" tabindex="-1" class="svelte-ad34dh"> </button> <button type="button" tabindex="-1" class="svelte-ad34dh"> </button></div> <div class="list-wrapper"><!></div>',1);function nf(t,e){Xe(e,!0);let a=T(""),r=T("plate"),i=T(!0);function s(Q){n(r)===Q?_(i,!n(i)):(_(r,Q,!0),_(i,!0))}const l=H(()=>{const Q=n(a).trim().toLowerCase(),j=V.vehicles;return j?j.filter(q=>Q===""?!0:q.plate.toLowerCase().includes(Q)||q.name.toLowerCase().includes(Q)||q.type.toLowerCase().includes(Q)||(q.owner?.toLowerCase().includes(Q)??!1)).slice().sort((q,Y)=>{const Z=q[n(r)],X=Y[n(r)];if(typeof Z=="string"&&typeof X=="string")return n(i)?Z.localeCompare(X):X.localeCompare(Z);if(typeof Z=="boolean"&&typeof X=="boolean")return n(i)?Number(Z)-Number(X):Number(X)-Number(Z);const re=Number(Z??0),se=Number(X??0);return n(i)?re-se:se-re}):[]});async function c(){await Ni({search:n(a).trim()})}xt(()=>{const Q=n(a).trim(),j=window.setTimeout(()=>{Ni({reset:!0,search:Q})},250);return()=>{window.clearTimeout(j)}});var v=tf(),f=oe(v),p=o(f),y=o(p),b=u(p,2),m=u(o(b),2),A=u(f,2),k=o(A);k.__click=()=>s("plate");var w=o(k),C=u(k,2);C.__click=()=>s("owner");var z=o(C),R=u(C,2);R.__click=()=>s("name");var x=o(R),M=u(R,2);M.__click=()=>s("type");var S=o(M),N=u(M,2);N.__click=()=>s("mileage");var K=o(N),D=u(N,2);D.__click=()=>s("impounded");var L=o(D),I=u(A,2),ae=o(I);ef(ae,{get filteredVehicles(){return n(l)},get loading(){return V.vehicleLoading},get hasMore(){return V.vehicleHasMore},onNeedMore:c}),$((Q,j,q,Y,Z,X,re,se)=>{g(y,Q),Ke(m,"placeholder",j),g(w,q),g(z,Y),g(x,Z),g(S,X),g(K,re),g(L,se)},[()=>h("vehicles_list"),()=>h("search_vehicle"),()=>h("plate"),()=>h("owner"),()=>h("vehicle_name"),()=>h("vehicle_type"),()=>h("mileage"),()=>h("impounded")]),st(m,()=>n(a),Q=>_(a,Q)),E(t,v),Ge()}ht(["click"]);var af=U('<div class="spinner-wrapper"><div class="spinner"></div></div>'),rf=U('<div class="ply-table-header"><button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <button type="button" tabindex="-1"> </button> <span> </span> <span> </span> <button type="button" tabindex="-1"> </button></div> <div class="list-wrapper"><!></div>',1),sf=U('<div class="no-results"> </div>'),of=U('<div class="top-bar"><span class="players-title"> </span> <div class="player-search-bar-container" tabindex="-1"><svg class="player-search-icon" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8746 10.852L14 14M12.5556 6.77778C12.5556 9.96877 9.96877 12.5556 6.77778 12.5556C3.5868 12.5556 1 9.96877 1 6.77778C1 3.5868 3.5868 1 6.77778 1C9.96877 1 12.5556 3.5868 12.5556 6.77778Z" stroke="#F2F2F2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> <input tabindex="-1" class="player-search-bar"/></div></div> <!>',1);function lf(t,e){Xe(e,!0);let a=T(""),r=T(_e([])),i=T(!1),s=T(!1),l=T("id"),c=T(!0);function v(x){n(l)===x?_(c,!n(c)):(_(l,x,!0),_(c,!0))}async function f(){const x=n(a).trim().toLowerCase();if(!x)return;_(s,!0),_(i,!0);const M=/^char\d+:/i.test(x),S=/^license:/i.test(x);let N=[];const K=(V.players??[]).filter(L=>M?L.char_identifier?.toLowerCase().includes(x):S?L.identifier?.toLowerCase().includes(x):L.name?.toLowerCase().includes(x)||String(L.id??"").includes(x));K.length>0&&(N=[...K]);const D=await je("player:searchOffline",{identifier:x});if(D?.success)for(const L of D.players??[])N.some(ae=>ae.char_identifier&&L.char_identifier&&ae.char_identifier===L.char_identifier)||N.push({...L,status:"offline",id:"OFF",_key:L.char_identifier??L.identifier??L.name});_(r,N,!0),_(i,!1)}const p=H(()=>n(r).slice().sort((x,M)=>{const S=x[n(l)],N=M[n(l)];return typeof S=="string"&&typeof N=="string"?n(c)?S.localeCompare(N):N.localeCompare(S):n(c)?(Number(S)||0)-(Number(N)||0):(Number(N)||0)-(Number(S)||0)}));var y=of(),b=oe(y),m=o(b),A=o(m),k=u(m,2),w=u(o(k),2);w.__keydown=x=>x.key==="Enter"&&f();var C=u(b,2);{var z=x=>{var M=af();E(x,M)},R=x=>{var M=Se(),S=oe(M);{var N=D=>{var L=rf(),I=oe(L),ae=o(I);ae.__click=()=>v("id");var Q=o(ae),j=u(ae,2);j.__click=()=>v("name");var q=o(j),Y=u(j,2);Y.__click=()=>v("cash");var Z=o(Y),X=u(Y,2);X.__click=()=>v("bank");var re=o(X),se=u(X,2);se.__click=()=>v("alt_money");var ue=o(se),le=u(se,2),Ce=o(le),Te=u(le,2),ye=o(Te),ie=u(Te,2);ie.__click=()=>v("last_join");var he=o(ie),me=u(I,2),Ae=o(me);as(Ae,{get filteredPlayers(){return n(p)}}),$((Fe,We,ze,Je,$e,at,B,F)=>{g(Q,Fe),g(q,We),g(Z,ze),g(re,Je),g(ue,$e),g(Ce,at),g(ye,B),g(he,F)},[()=>h("id"),()=>h("name"),()=>h("money"),()=>h("bank_money"),()=>h("black_money"),()=>h("health"),()=>h("armor"),()=>h("last_visited")]),E(D,L)},K=D=>{var L=Se(),I=oe(L);{var ae=Q=>{var j=sf(),q=o(j);$(Y=>g(q,Y),[()=>h("no_players_found")]),E(Q,j)};ee(I,Q=>{n(s)&&Q(ae)},!0)}E(D,L)};ee(S,D=>{n(p).length>0?D(N):D(K,!1)},!0)}E(x,M)};ee(C,x=>{n(i)?x(z):x(R,!1)})}$((x,M)=>{g(A,x),Ke(w,"placeholder",M)},[()=>h("search_player"),()=>h("search_player")]),st(w,()=>n(a),x=>_(a,x)),E(t,y),Ge()}ht(["keydown","click"]);var cf=U('<div class="top-bar"><span class="players-title" tabindex="-1"> </span> <div class="player-search-bar-container" tabindex="-1"><svg class="player-search-icon" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.8746 10.852L14 14M12.5556 6.77778C12.5556 9.96877 9.96877 12.5556 6.77778 12.5556C3.5868 12.5556 1 9.96877 1 6.77778C1 3.5868 3.5868 1 6.77778 1C9.96877 1 12.5556 3.5868 12.5556 6.77778Z" stroke="#F2F2F2" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> <input type="text" tabindex="-1" class="player-search-bar"/></div></div> <div class="ply-table-header"><span> </span> <span> </span> <span> </span> <span> </span> <span> </span> <span> </span> <span> </span> <span> </span></div> <div class="list-wrapper"><!></div>',1);function uf(t,e){Xe(e,!0);let a=T("");const r=H(()=>{const Q=n(a).trim().toLowerCase();return(V.recentPlayers??[]).filter(q=>Q===""?!0:q.name.toLowerCase().includes(Q)||(q.identifier??"").toLowerCase().includes(Q)||(q.char_identifier??"").toLowerCase().includes(Q))});var i=cf(),s=oe(i),l=o(s),c=o(l),v=u(l,2),f=u(o(v),2),p=u(s,2),y=o(p),b=o(y),m=u(y,2),A=o(m),k=u(m,2),w=o(k),C=u(k,2),z=o(C),R=u(C,2),x=o(R),M=u(R,2),S=o(M),N=u(M,2),K=o(N),D=u(N,2),L=o(D),I=u(p,2),ae=o(I);as(ae,{get filteredPlayers(){return n(r)}}),$((Q,j,q,Y,Z,X,re,se,ue,le)=>{g(c,Q),Ke(f,"placeholder",j),g(b,q),g(A,Y),g(w,Z),g(z,X),g(x,re),g(S,se),g(K,ue),g(L,le)},[()=>h("recent_players"),()=>h("search_player"),()=>h("id"),()=>h("name"),()=>h("money"),()=>h("bank_money"),()=>h("black_money"),()=>h("health"),()=>h("armor"),()=>h("last_visited")]),st(f,()=>n(a),Q=>_(a,Q)),E(t,i),Ge()}var vf=U('<div class="bar-row svelte-12ytsmo"><span class="svelte-12ytsmo"> </span> <div class="bar-track svelte-12ytsmo"><i class="svelte-12ytsmo"></i></div> <strong class="svelte-12ytsmo"> </strong></div>'),df=U('<div class="bar-list svelte-12ytsmo"></div>'),ff=U('<span class="svelte-12ytsmo"></span>'),hf=U('<div class="dashboard-home svelte-12ytsmo"><header class="dashboard-header svelte-12ytsmo"><div><div class="dashboard-title-row svelte-12ytsmo"><h2 class="svelte-12ytsmo"> </h2> <span class="staff-badge svelte-12ytsmo"> </span></div> <span class="svelte-12ytsmo"> </span></div></header> <section class="metrics-grid svelte-12ytsmo"><div class="metric-panel svelte-12ytsmo"><span class="svelte-12ytsmo"> </span> <strong class="svelte-12ytsmo"> </strong> <div class="metric-track svelte-12ytsmo"><span class="svelte-12ytsmo"></span></div></div> <div class="metric-panel svelte-12ytsmo"><span class="svelte-12ytsmo"> </span> <strong class="svelte-12ytsmo"> </strong></div> <div class="metric-panel svelte-12ytsmo"><span class="svelte-12ytsmo"> </span> <strong class="svelte-12ytsmo"> </strong></div> <div class="metric-panel svelte-12ytsmo"><span class="svelte-12ytsmo"> </span> <strong class="svelte-12ytsmo"> </strong></div> <div class="metric-panel svelte-12ytsmo"><span class="svelte-12ytsmo"> </span> <strong class="svelte-12ytsmo"> </strong></div></section> <section class="dashboard-grid svelte-12ytsmo"><div class="chart-panel wide svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <div class="stacked-meter svelte-12ytsmo"><span class="meter-online svelte-12ytsmo"></span> <span class="meter-empty svelte-12ytsmo"></span></div> <!></div> <div class="chart-panel wide svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <div class="stacked-meter svelte-12ytsmo"></div> <!></div> <div class="chart-panel svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <!></div> <div class="chart-panel svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <!></div> <div class="chart-panel svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <!></div> <div class="chart-panel svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <!></div> <div class="chart-panel svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <!></div> <div class="chart-panel svelte-12ytsmo"><div class="chart-title svelte-12ytsmo"><h3 class="svelte-12ytsmo"> </h3> <span class="svelte-12ytsmo"> </span></div> <!></div></section></div>');function _f(t,e){Xe(e,!0);const a=(de,xe=cn)=>{var Qe=df();ot(Qe,21,xe,Et,(Gt,Ht)=>{var ma=vf(),ba=o(ma),ga=o(ba),Xn=u(ba,2),ya=o(Xn),ja=u(Xn,2),Wa=o(ja);$(wa=>{g(ga,n(Ht).label),yn(ya,wa),g(Wa,n(Ht).display)},[()=>s(n(Ht).percent,n(Ht).color)]),E(Gt,ma)}),E(de,Qe)};function r(de){return(Number(de.cash)||0)+(Number(de.bank)||0)+(Number(de.alt_money)||0)}function i(de){return Number.isFinite(de)?Math.max(0,Math.min(100,de)):0}function s(de,xe="#FB9B04"){return`--bar-width: ${i(de).toFixed(2)}%; --bar-color: ${xe};`}function l(de,xe){return`width: ${i(de).toFixed(2)}%; background: ${xe};`}const c=H(()=>V.players??[]),v=H(()=>Ie.currentPlayers??n(c).length),f=H(()=>Ie.maxPlayers??0),p=H(()=>Math.max(0,n(f)-n(v))),y=H(()=>n(f)>0?Math.min(100,n(v)/n(f)*100):0),b=H(()=>n(c).reduce((de,xe)=>de+(Number(xe.cash)||0),0)),m=H(()=>n(c).reduce((de,xe)=>de+(Number(xe.bank)||0),0)),A=H(()=>n(c).reduce((de,xe)=>de+(Number(xe.alt_money)||0),0)),k=H(()=>n(b)+n(m)+n(A)),w=H(()=>n(c).length>0?Math.round(n(k)/n(c).length):0),C=H(()=>n(c).length>0?Math.round(n(b)/n(c).length):0),z=H(()=>n(c).length>0?Math.round(n(m)/n(c).length):0),R=H(()=>n(c).length>0?Math.round(n(A)/n(c).length):0),x=H(()=>n(c).filter(de=>de.is_staff).length),M=H(()=>Math.max(0,n(c).length-n(x))),S=H(()=>n(c).length>0?n(x)/n(c).length*100:0),N=H(()=>n(c).length>0?Math.round(n(c).reduce((de,xe)=>de+(Number(xe.health)||0),0)/n(c).length):0),K=H(()=>n(c).length>0?Math.round(n(c).reduce((de,xe)=>de+(Number(xe.armor)||0),0)/n(c).length):0),D=H(()=>n(c).map(r).sort((de,xe)=>de-xe)),L=H(()=>{if(n(D).length===0)return 0;const de=Math.floor(n(D).length/2);return n(D).length%2===0?Math.round((n(D)[de-1]+n(D)[de])/2):n(D)[de]}),I=H(()=>n(D).at(-1)??0),ae=H(()=>n(c).reduce((de,xe)=>!de||r(xe)>r(de)?xe:de,null)),Q=H(()=>[{label:h("money"),value:n(b),display:`$${nt(n(b))}`,percent:n(k)>0?n(b)/n(k)*100:0,color:"#FB9B04"},{label:h("bank_money"),value:n(m),display:`$${nt(n(m))}`,percent:n(k)>0?n(m)/n(k)*100:0,color:"#4ADE80"},{label:h("black_money"),value:n(A),display:`$${nt(n(A))}`,percent:n(k)>0?n(A)/n(k)*100:0,color:"#F23F3F"}]),j=H(()=>[{label:h("money"),value:n(C),display:`$${nt(n(C))}`,percent:n(w)>0?n(C)/n(w)*100:0,color:"#FB9B04"},{label:h("bank_money"),value:n(z),display:`$${nt(n(z))}`,percent:n(w)>0?n(z)/n(w)*100:0,color:"#4ADE80"},{label:h("black_money"),value:n(R),display:`$${nt(n(R))}`,percent:n(w)>0?n(R)/n(w)*100:0,color:"#F23F3F"}]),q=H(()=>[{label:h("players"),value:n(v),display:`${n(v)}/${n(f)}`,percent:n(y),color:"#FB9B04"},{label:h("available_slots"),value:n(p),display:String(n(p)),percent:n(f)>0?n(p)/n(f)*100:0,color:"#8B8B8B"}]),Y=H(()=>[{label:h("avg_health"),value:n(N),display:`${n(N)}/100`,percent:n(N),color:"#4ADE80"},{label:h("avg_armor"),value:n(K),display:`${n(K)}/100`,percent:n(K),color:"#60A5FA"}]),Z=H(()=>[{label:h("active_staff"),value:n(x),display:String(n(x)),percent:n(S),color:"#60A5FA"},{label:h("non_staff"),value:n(M),display:String(n(M)),percent:n(c).length>0?n(M)/n(c).length*100:0,color:"#8B8B8B"}]),X=H(()=>[{label:h("avg_money_per_player"),value:n(w),display:`$${nt(n(w))}`,percent:n(I)>0?n(w)/n(I)*100:0,color:"#FB9B04"},{label:h("median_money"),value:n(L),display:`$${nt(n(L))}`,percent:n(I)>0?n(L)/n(I)*100:0,color:"#4ADE80"},{label:h("richest_player"),value:n(I),display:n(ae)?`${n(ae).name} ($${nt(n(I))})`:"-",percent:n(I)>0?100:0,color:"#F23F3F"}]),re=H(()=>{const de=new Map;for(const xe of n(c)){const Qe=xe.job||"unknown";de.set(Qe,(de.get(Qe)??0)+1)}return[...de.entries()].sort((xe,Qe)=>Qe[1]-xe[1]).slice(0,5).map(([xe,Qe])=>({label:xe,value:Qe,display:String(Qe),percent:n(c).length>0?Qe/n(c).length*100:0,color:"#FB9B04"}))}),se=H(()=>[{label:"< $10k",min:0,max:1e4},{label:"$10k-$100k",min:1e4,max:1e5},{label:"$100k-$1m",min:1e5,max:1e6},{label:"$1m+",min:1e6,max:Number.POSITIVE_INFINITY}].map(xe=>{const Qe=n(c).filter(Gt=>{const Ht=(Number(Gt.cash)||0)+(Number(Gt.bank)||0)+(Number(Gt.alt_money)||0);return Ht>=xe.min&&Ht<xe.max}).length;return{label:xe.label,value:Qe,display:String(Qe),percent:n(c).length>0?Qe/n(c).length*100:0,color:"#FB9B04"}}));var ue=hf(),le=o(ue),Ce=o(le),Te=o(Ce),ye=o(Te),ie=o(ye),he=u(ye,2),me=o(he),Ae=u(Te,2),Fe=o(Ae),We=u(le,2),ze=o(We),Je=o(ze),$e=o(Je),at=u(Je,2),B=o(at),F=u(at,2),ne=o(F),ve=u(ze,2),ce=o(ve),Le=o(ce),be=u(ce,2),we=o(be),d=u(ve,2),P=o(d),O=o(P),te=u(P,2),G=o(te),J=u(d,2),ge=o(J),ke=o(ge),Ue=u(ge,2),et=o(Ue),Oe=u(J,2),rt=o(Oe),Be=o(rt),Pe=u(rt,2),qe=o(Pe),tt=u(We,2),Ve=o(tt),De=o(Ve),pe=o(De),Ye=o(pe),Ze=u(pe,2),it=o(Ze),bt=u(De,2),Zt=o(bt),It=u(Zt,2),Ct=u(bt,2);a(Ct,()=>n(q));var ct=u(Ve,2),tn=o(ct),zt=o(tn),nn=o(zt),_t=u(zt,2),Ot=o(_t),Ft=u(tn,2);ot(Ft,21,()=>n(Q),Et,(de,xe)=>{var Qe=ff();$(Gt=>yn(Qe,Gt),[()=>l(n(xe).percent,n(xe).color??"#FB9B04")]),E(de,Qe)});var an=u(Ft,2);a(an,()=>n(Q));var Yt=u(ct,2),Mt=o(Yt),Tt=o(Mt),mn=o(Tt),rn=u(Tt,2),Ln=o(rn),St=u(Mt,2);a(St,()=>n(X));var Vt=u(Yt,2),Dt=o(Vt),Xt=o(Dt),sn=o(Xt),Pn=u(Xt,2),En=o(Pn),zn=u(Dt,2);a(zn,()=>n(j));var On=u(Vt,2),ua=o(On),Yn=o(ua),va=o(Yn),Na=u(Yn,2),Ra=o(Na),Ba=u(ua,2);a(Ba,()=>n(Y));var Dn=u(On,2),da=o(Dn),fa=o(da),ha=o(fa),_a=u(fa,2),pa=o(_a),Ia=u(da,2);a(Ia,()=>n(Z));var sr=u(Dn,2),Fa=o(sr),Va=o(Fa),Zr=o(Va),Yr=u(Va,2),or=o(Yr),lr=u(Fa,2);a(lr,()=>n(re));var Xr=u(sr,2),cr=o(Xr),Ha=o(cr),ur=o(Ha),Gr=u(Ha,2),Jr=o(Gr),vr=u(cr,2);a(vr,()=>n(se)),$((de,xe,Qe,Gt,Ht,ma,ba,ga,Xn,ya,ja,Wa,wa,dr,Qr,$r,fr,hr,ei,ti,ni,_r,ai,ri)=>{g(ie,de),g(me,`${xe??""}: ${n(x)??""}`),g(Fe,Qe),g($e,Gt),g(B,`${n(v)??""}/${n(f)??""}`),yn(ne,Ht),g(Le,ma),g(we,`$${ba??""}`),g(O,ga),g(G,`$${Xn??""}`),g(ke,ya),g(et,`${n(N)??""}/100`),g(Be,ja),g(qe,`${n(K)??""}/100`),g(Ye,Wa),g(it,`${n(v)??""} online`),yn(Zt,wa),yn(It,dr),g(nn,Qr),g(Ot,`$${$r??""}`),g(mn,fr),g(Ln,`${n(c).length??""} players`),g(sn,hr),g(En,`$${ei??""}`),g(va,ti),g(Ra,`${n(c).length??""} sampled`),g(ha,ni),g(pa,`${_r??""}%`),g(Zr,ai),g(or,`${n(c).length??""} players`),g(ur,ri),g(Jr,`${n(c).length??""} players`)},[()=>h("dashboard_home"),()=>h("active_staff"),()=>h("dashboard_snapshot"),()=>h("players"),()=>s(n(y)),()=>h("total_money"),()=>nt(n(k)),()=>h("avg_money_per_player"),()=>nt(n(w)),()=>h("avg_health"),()=>h("avg_armor"),()=>h("player_counts"),()=>l(n(y),"#FB9B04"),()=>l(100-n(y),"rgba(242, 242, 242, 0.16)"),()=>h("money_distribution"),()=>nt(n(k)),()=>h("economy_summary"),()=>h("avg_money_breakdown"),()=>nt(n(w)),()=>h("player_condition"),()=>h("staff_overview"),()=>Math.round(n(S)),()=>h("active_player_job_distribution"),()=>h("wealth_bands")]),E(t,ue),Ge()}var pf=U('<button type="button" role="option"> </button>'),mf=U('<div class="dropdown-menu svelte-12xtqit" role="listbox" tabindex="-1"></div>'),bf=U('<div class="dropdown svelte-12xtqit"><button type="button" aria-haspopup="listbox"><span class="svelte-12xtqit"> </span> <svg viewBox="0 0 10 6" aria-hidden="true"><path d="M1 1L5 5L9 1" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"></path></svg></button> <!></div>');function ut(t,e){Xe(e,!0);const a=dt(e,"disabled",3,!1);let r=T(!1);const i=H(()=>e.options.find(k=>k.value===e.value)??e.options[0]);function s(k){e.onChange(k),_(r,!1)}var l=bf();Kn("click",Un,()=>_(r,!1));var c=o(l);let v;c.__click=k=>{k.stopPropagation(),_(r,!n(r))};var f=o(c),p=o(f),y=u(f,2);let b;var m=u(c,2);{var A=k=>{var w=mf();w.__click=C=>C.stopPropagation(),w.__keydown=C=>C.stopPropagation(),ot(w,21,()=>e.options,Et,(C,z)=>{var R=pf();let x;R.__click=()=>s(n(z).value);var M=o(R);$(()=>{x=Ne(R,1,"dropdown-item svelte-12xtqit",null,x,{selected:n(z).value===e.value}),Ke(R,"aria-selected",n(z).value===e.value),g(M,n(z).label)}),E(C,R)}),E(k,w)};ee(m,k=>{n(r)&&k(A)})}$(()=>{v=Ne(c,1,"dropdown-trigger svelte-12xtqit",null,v,{open:n(r)}),c.disabled=a(),Ke(c,"aria-expanded",n(r)),g(p,n(i)?.label??""),b=Ne(y,0,"svelte-12xtqit",null,b,{open:n(r)})}),E(t,l),Ge()}ht(["click","keydown"]);var gf=U('<span class="svelte-z3kuo0">No players found in this channel.</span>'),yf=U('<div class="radio-player svelte-z3kuo0"><strong class="svelte-z3kuo0"> </strong> <span class="svelte-z3kuo0"> </span> <small class="svelte-z3kuo0"> </small></div>'),wf=U('<div class="server-management svelte-z3kuo0"><header class="management-header svelte-z3kuo0"><div><h2 class="svelte-z3kuo0">Server Management</h2> <span class="svelte-z3kuo0">Environment, player-wide actions, broadcasts, and cleanup.</span></div> <div class="status-pills svelte-z3kuo0"><span> </span> <span> </span></div></header> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0">Environment</h3> <span class="svelte-z3kuo0">Weather, time, blackout, and PvP.</span></div> <div class="control-row svelte-z3kuo0"><label class="field svelte-z3kuo0"><span>Weather</span> <!></label> <button type="button" class="svelte-z3kuo0">Apply Weather</button> <label class="field compact svelte-z3kuo0"><span>Hour</span> <!></label> <label class="field compact svelte-z3kuo0"><span>Minute</span> <!></label> <button type="button" class="svelte-z3kuo0">Apply Time</button> <button type="button">Toggle Blackout</button> <button type="button">Toggle PvP</button></div></section> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0"> </h3> <span class="svelte-z3kuo0">Spawn a vehicle with the selected model and paint.</span></div> <div class="vehicle-spawner-grid svelte-z3kuo0"><label class="field vehicle-model-field svelte-z3kuo0"><span> </span> <input type="text" class="svelte-z3kuo0"/></label> <label class="field svelte-z3kuo0"><span> </span> <!></label> <label class="field svelte-z3kuo0"><span> </span> <!></label> <button type="button" class="primary-action svelte-z3kuo0"> </button></div></section> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0"> </h3> <span class="svelte-z3kuo0">Apply performance, paint, lights, and tire options to the vehicle you are in.</span></div> <div class="vehicle-customizer svelte-z3kuo0"><div class="customizer-grid svelte-z3kuo0"><label class="field compact svelte-z3kuo0"><span> </span> <!></label> <label class="field compact svelte-z3kuo0"><span> </span> <!></label> <label class="field compact svelte-z3kuo0"><span> </span> <!></label> <label class="field compact svelte-z3kuo0"><span> </span> <!></label> <label class="field compact svelte-z3kuo0"><span> </span> <!></label> <label class="check-field svelte-z3kuo0"><input type="checkbox" class="svelte-z3kuo0"/> <span> </span></label></div> <div class="customizer-grid svelte-z3kuo0"><label class="field svelte-z3kuo0"><span> </span> <!></label> <label class="field svelte-z3kuo0"><span> </span> <!></label> <label class="field svelte-z3kuo0"><span> </span> <!></label> <label class="field svelte-z3kuo0"><span> </span> <!></label> <label class="field svelte-z3kuo0"><span> </span> <!></label> <label class="field svelte-z3kuo0"><span> </span> <!></label></div> <div class="customizer-toggles svelte-z3kuo0"><label class="check-field svelte-z3kuo0"><input type="checkbox" class="svelte-z3kuo0"/> <span> </span></label> <label class="check-field svelte-z3kuo0"><input type="checkbox" class="svelte-z3kuo0"/> <span> </span></label> <label class="check-field svelte-z3kuo0"><input type="checkbox" class="svelte-z3kuo0"/> <span> </span></label> <label class="check-field svelte-z3kuo0"><input type="checkbox" class="svelte-z3kuo0"/> <span> </span></label></div> <div class="customizer-actions svelte-z3kuo0"><button type="button" class="primary-action svelte-z3kuo0"> </button></div></div></section> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0">Players</h3> <span class="svelte-z3kuo0">Server-wide emergency actions.</span></div> <div class="action-grid svelte-z3kuo0"><button type="button" class="svelte-z3kuo0">Freeze All</button> <button type="button" class="svelte-z3kuo0">Unfreeze All</button> <button type="button" class="svelte-z3kuo0">Bring All</button> <button type="button" class="svelte-z3kuo0">Revive All</button> <button type="button" class="danger svelte-z3kuo0">Kick All</button> <button type="button" class="danger svelte-z3kuo0">Kill All</button></div></section> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0">Radio</h3> <span class="svelte-z3kuo0">See character names in a specific channel.</span></div> <div class="radio-panel svelte-z3kuo0"><div class="control-row radio-row svelte-z3kuo0"><label class="field compact svelte-z3kuo0"><span>Channel</span> <input type="number" min="1" class="svelte-z3kuo0"/></label> <button type="button" class="svelte-z3kuo0"> </button></div> <div class="radio-results svelte-z3kuo0"><!></div></div></section> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0">Cleanup</h3> <span class="svelte-z3kuo0">Remove world entities for everyone.</span></div> <div class="action-grid svelte-z3kuo0"><button type="button" class="svelte-z3kuo0">Delete Vehicles</button> <button type="button" class="svelte-z3kuo0">Delete Peds</button> <button type="button" class="svelte-z3kuo0">Delete Objects</button></div></section> <section class="management-section svelte-z3kuo0"><div class="section-title svelte-z3kuo0"><h3 class="svelte-z3kuo0">Broadcasts</h3> <span class="svelte-z3kuo0">Notify players or give everyone money.</span></div> <div class="control-row broadcast-row svelte-z3kuo0"><label class="field message-field svelte-z3kuo0"><span>Notification</span> <input type="text" class="svelte-z3kuo0"/></label> <button type="button" class="svelte-z3kuo0">Send</button> <label class="field svelte-z3kuo0"><span>Account</span> <!></label> <label class="field compact svelte-z3kuo0"><span>Amount</span> <input type="number" min="0" class="svelte-z3kuo0"/></label> <button type="button" class="svelte-z3kuo0">Give Money</button></div></section></div>');function xf(t,e){Xe(e,!0);let a=T(""),r=T(0),i=T("money"),s=T(_e(V.vehicleConfig.defaultModel)),l=T(_e(V.vehicleConfig.defaultColor)),c=T(_e(V.vehicleConfig.defaultColor)),v=T(_e(V.vehicleConfig.defaultColor)),f=T(_e(V.vehicleConfig.defaultColor)),p=T(5),y=T(5),b=T(5),m=T(5),A=T(5),k=T(!1),w=T(!0),C=T(!1),z=T(!1),R=T(_e(V.vehicleConfig.neonPresets[0]?.id??"white")),x=T(_e(V.vehicleConfig.windowTints[0]?.id??0)),M=T(_e(V.vehicleConfig.wheelCategories[0]?.id??"sport")),S=T(_e(V.vehicleConfig.wheelDesigns[0]?.id??-1)),N=T(!1),K=T(1),D=T(_e([])),L=T(!1),I=T(null);const ae=["CLEAR","EXTRASUNNY","CLOUDS","OVERCAST","RAIN","THUNDER","FOGGY","XMAS"].map(W=>({value:W,label:W})),Q=Array.from({length:24},(W,pt)=>({value:pt,label:String(pt).padStart(2,"0")})),j=Array.from({length:60},(W,pt)=>({value:pt,label:String(pt).padStart(2,"0")})),q=[{value:"money",label:"Cash"},{value:"bank",label:"Bank"},{value:"black_money",label:"Black Money"}],Y=[1,2,3,4,5].map(W=>({value:W,label:`${W}/5`})),Z=H(()=>V.vehicleConfig.colorPresets.map(W=>({value:W.id,label:W.label}))),X=H(()=>V.vehicleConfig.neonPresets.map(W=>({value:W.id,label:W.label}))),re=H(()=>V.vehicleConfig.windowTints.map(W=>({value:W.id,label:W.label}))),se=H(()=>V.vehicleConfig.wheelCategories.map(W=>({value:W.id,label:W.label}))),ue=H(()=>V.vehicleConfig.wheelDesigns.map(W=>({value:W.id,label:W.label})));async function le(W,pt={}){if(n(I))return;_(I,W,!0);const Nn=await Ju(W,pt);Nn?.success&&(Nn.serverData&&Ie.set(Nn.serverData),Wn.success("Action completed.")),_(I,null)}function Ce(){le("blackout",{enabled:!Ie.blackout})}function Te(){le("pvp",{enabled:!Ie.pvp})}async function ye(){n(L)||n(K)<=0||(_(L,!0),_(D,await $u(n(K)),!0),_(L,!1))}async function ie(W,pt){if(n(I))return;_(I,W,!0),(await Qu(W,pt))?.success&&Wn.success("Vehicle action completed."),_(I,null)}function he(){ie("spawnVehicle",{model:n(s),color:n(l),primaryColor:n(l),secondaryColor:n(c),deleteCurrent:!0})}function me(W){_(k,W,!0),W&&(_(p,5),_(y,5),_(b,5),_(m,5),_(A,5),_(w,!0))}function Ae(){ie("setVehiclePerformance",{engineLevel:n(p),brakeLevel:n(y),transmissionLevel:n(b),suspensionLevel:n(m),armorLevel:n(A),turbo:n(w),xenon:n(C),neon:n(z),neonColor:n(R),color:n(v),primaryColor:n(v),secondaryColor:n(f),windowTint:n(x),wheelCategory:n(M),wheelDesign:n(S),bulletproofTires:n(N),maxPerformance:n(k)})}var Fe=wf(),We=o(Fe),ze=u(o(We),2),Je=o(ze);let $e;var at=o(Je),B=u(Je,2);let F;var ne=o(B),ve=u(We,2),ce=u(o(ve),2),Le=o(ce),be=u(o(Le),2);ut(be,{get value(){return Ie.weather},get options(){return ae},onChange:W=>Ie.weather=String(W)});var we=u(Le,2);we.__click=()=>le("weather",{weather:Ie.weather});var d=u(we,2),P=u(o(d),2);ut(P,{get value(){return Ie.hour},get options(){return Q},onChange:W=>Ie.hour=Number(W)});var O=u(d,2),te=u(o(O),2);ut(te,{get value(){return Ie.minute},get options(){return j},onChange:W=>Ie.minute=Number(W)});var G=u(O,2);G.__click=()=>le("time",{hour:Ie.hour,minute:Ie.minute});var J=u(G,2);J.__click=Ce;let ge;var ke=u(J,2);ke.__click=Te;let Ue;var et=u(ve,2),Oe=o(et),rt=o(Oe),Be=o(rt),Pe=u(Oe,2),qe=o(Pe),tt=o(qe),Ve=o(tt),De=u(tt,2),pe=u(qe,2),Ye=o(pe),Ze=o(Ye),it=u(Ye,2);ut(it,{get value(){return n(l)},get options(){return n(Z)},onChange:W=>_(l,String(W),!0)});var bt=u(pe,2),Zt=o(bt),It=o(Zt),Ct=u(Zt,2);ut(Ct,{get value(){return n(c)},get options(){return n(Z)},onChange:W=>_(c,String(W),!0)});var ct=u(bt,2);ct.__click=he;var tn=o(ct),zt=u(et,2),nn=o(zt),_t=o(nn),Ot=o(_t),Ft=u(nn,2),an=o(Ft),Yt=o(an),Mt=o(Yt),Tt=o(Mt),mn=u(Mt,2);ut(mn,{get value(){return n(p)},get options(){return Y},onChange:W=>{_(p,Number(W),!0),_(k,!1)}});var rn=u(Yt,2),Ln=o(rn),St=o(Ln),Vt=u(Ln,2);ut(Vt,{get value(){return n(y)},get options(){return Y},onChange:W=>{_(y,Number(W),!0),_(k,!1)}});var Dt=u(rn,2),Xt=o(Dt),sn=o(Xt),Pn=u(Xt,2);ut(Pn,{get value(){return n(b)},get options(){return Y},onChange:W=>{_(b,Number(W),!0),_(k,!1)}});var En=u(Dt,2),zn=o(En),On=o(zn),ua=u(zn,2);ut(ua,{get value(){return n(m)},get options(){return Y},onChange:W=>{_(m,Number(W),!0),_(k,!1)}});var Yn=u(En,2),va=o(Yn),Na=o(va),Ra=u(va,2);ut(Ra,{get value(){return n(A)},get options(){return Y},onChange:W=>{_(A,Number(W),!0),_(k,!1)}});var Ba=u(Yn,2),Dn=o(Ba);Dn.__change=W=>me(W.currentTarget.checked);var da=u(Dn,2),fa=o(da),ha=u(an,2),_a=o(ha),pa=o(_a),Ia=o(pa),sr=u(pa,2);ut(sr,{get value(){return n(v)},get options(){return n(Z)},onChange:W=>_(v,String(W),!0)});var Fa=u(_a,2),Va=o(Fa),Zr=o(Va),Yr=u(Va,2);ut(Yr,{get value(){return n(f)},get options(){return n(Z)},onChange:W=>_(f,String(W),!0)});var or=u(Fa,2),lr=o(or),Xr=o(lr),cr=u(lr,2);ut(cr,{get value(){return n(R)},get options(){return n(X)},onChange:W=>_(R,String(W),!0)});var Ha=u(or,2),ur=o(Ha),Gr=o(ur),Jr=u(ur,2);ut(Jr,{get value(){return n(x)},get options(){return n(re)},onChange:W=>_(x,Number(W),!0)});var vr=u(Ha,2),de=o(vr),xe=o(de),Qe=u(de,2);ut(Qe,{get value(){return n(M)},get options(){return n(se)},onChange:W=>_(M,String(W),!0)});var Gt=u(vr,2),Ht=o(Gt),ma=o(Ht),ba=u(Ht,2);ut(ba,{get value(){return n(S)},get options(){return n(ue)},onChange:W=>_(S,Number(W),!0)});var ga=u(ha,2),Xn=o(ga),ya=o(Xn),ja=u(ya,2),Wa=o(ja),wa=u(Xn,2),dr=o(wa),Qr=u(dr,2),$r=o(Qr),fr=u(wa,2),hr=o(fr),ei=u(hr,2),ti=o(ei),ni=u(fr,2),_r=o(ni),ai=u(_r,2),ri=o(ai),sl=u(ga,2),ii=o(sl);ii.__click=Ae;var ol=o(ii),rs=u(zt,2),ll=u(o(rs),2),si=o(ll);si.__click=()=>le("freezeAll");var oi=u(si,2);oi.__click=()=>le("unfreezeAll");var li=u(oi,2);li.__click=()=>le("bringAll");var ci=u(li,2);ci.__click=()=>le("reviveAll");var ui=u(ci,2);ui.__click=()=>le("kickAll");var is=u(ui,2);is.__click=()=>le("killAll");var ss=u(rs,2),cl=u(o(ss),2),os=o(cl),ls=o(os),ul=u(o(ls),2),vi=u(ls,2);vi.__click=ye;var vl=o(vi),dl=u(os,2),fl=o(dl);{var hl=W=>{var pt=gf();E(W,pt)},_l=W=>{var pt=Se(),Nn=oe(pt);ot(Nn,17,()=>n(D),Et,(_i,Ua)=>{var pr=yf(),mr=o(pr),pi=o(mr),br=u(mr,2),mi=o(br),bi=u(br,2),gi=o(bi);$(()=>{g(pi,`#${n(Ua).id??""}`),g(mi,n(Ua).name),g(gi,n(Ua).char_identifier??"")}),E(_i,pr)}),E(W,pt)};ee(fl,W=>{n(D).length===0?W(hl):W(_l,!1)})}var cs=u(ss,2),pl=u(o(cs),2),di=o(pl);di.__click=()=>le("deleteVehicles");var fi=u(di,2);fi.__click=()=>le("deletePeds");var us=u(fi,2);us.__click=()=>le("deleteObjects");var ml=u(cs,2),bl=u(o(ml),2),vs=o(bl),gl=u(o(vs),2),hi=u(vs,2);hi.__click=()=>le("notifyAll",{message:n(a)});var ds=u(hi,2),yl=u(o(ds),2);ut(yl,{get value(){return n(i)},get options(){return q},onChange:W=>_(i,String(W),!0)});var fs=u(ds,2),wl=u(o(fs),2),hs=u(fs,2);hs.__click=()=>le("giveMoneyAll",{account:n(i),amount:n(r)}),$((W,pt,Nn,_i,Ua,pr,mr,pi,br,mi,bi,gi,xl,kl,Cl,Ml,Tl,Sl,Al,Ll,Pl,El,zl,Ol,Dl)=>{$e=Ne(Je,1,"svelte-z3kuo0",null,$e,{enabled:Ie.blackout}),g(at,`Blackout ${Ie.blackout?"On":"Off"}`),F=Ne(B,1,"svelte-z3kuo0",null,F,{enabled:Ie.pvp}),g(ne,`PvP ${Ie.pvp?"On":"Off"}`),we.disabled=n(I)!==null,G.disabled=n(I)!==null,J.disabled=n(I)!==null,ge=Ne(J,1,"svelte-z3kuo0",null,ge,{active:Ie.blackout}),ke.disabled=n(I)!==null,Ue=Ne(ke,1,"svelte-z3kuo0",null,Ue,{active:Ie.pvp}),g(Be,W),g(Ve,pt),Ke(De,"placeholder",V.vehicleConfig.defaultModel),g(Ze,Nn),g(It,_i),ct.disabled=Ua,g(tn,pr),g(Ot,mr),g(Tt,pi),g(St,br),g(sn,mi),g(On,bi),g(Na,gi),cu(Dn,n(k)),g(fa,xl),g(Ia,kl),g(Zr,Cl),g(Xr,Ml),g(Gr,Tl),g(xe,Sl),g(ma,Al),g(Wa,Ll),g($r,Pl),g(ti,El),g(ri,zl),ii.disabled=n(I)!==null,g(ol,Ol),si.disabled=n(I)!==null,oi.disabled=n(I)!==null,li.disabled=n(I)!==null,ci.disabled=n(I)!==null,ui.disabled=n(I)!==null,is.disabled=n(I)!==null,vi.disabled=n(L)||n(K)<=0,g(vl,n(L)?"Checking...":"Lookup Channel"),di.disabled=n(I)!==null,fi.disabled=n(I)!==null,us.disabled=n(I)!==null,hi.disabled=Dl,hs.disabled=n(I)!==null||n(r)<=0},[()=>h("vehicle_spawner","Vehicle Spawner"),()=>h("vehicle_model","Vehicle Model"),()=>h("primary_color","Primary Color"),()=>h("secondary_color","Secondary Color"),()=>n(I)!==null||n(s).trim()==="",()=>h("spawn_vehicle","Spawn Vehicle"),()=>h("customize_vehicle","Customize Vehicle"),()=>h("engine_level","Engine"),()=>h("brake_level","Brakes"),()=>h("transmission_level","Transmission"),()=>h("suspension_level","Suspension"),()=>h("vehicle_armor","Vehicle Armor"),()=>h("max_performance","Max Performance"),()=>h("primary_color","Primary Color"),()=>h("secondary_color","Secondary Color"),()=>h("neon_color","Neon Color"),()=>h("window_tint","Window Tint"),()=>h("wheel_category","Wheel Category"),()=>h("wheel_design","Disc Design"),()=>h("turbo","Turbo"),()=>h("xenon_lights","Xenon"),()=>h("neon_lights","Neon"),()=>h("bulletproof_tires","Bulletproof Tires"),()=>h("apply_customization","Apply Customization"),()=>n(I)!==null||n(a).trim()===""]),st(De,()=>n(s),W=>_(s,W)),wr(ya,()=>n(w),W=>_(w,W)),wr(dr,()=>n(C),W=>_(C,W)),wr(hr,()=>n(z),W=>_(z,W)),wr(_r,()=>n(N),W=>_(N,W)),st(ul,()=>n(K),W=>_(K,W)),st(gl,()=>n(a),W=>_(a,W)),st(wl,()=>n(r),W=>_(r,W)),E(t,Fe),Ge()}ht(["click","change"]);var kf=U("<p>Page not found</p>"),Cf=U('<div class="tab-container"><div class="tab-wrapper"><!></div></div>');function Mf(t,e){Xe(e,!0);var a=Cf();Kn("keydown",Un,c=>{c.key==="Tab"&&c.preventDefault()});var r=o(a),i=o(r);{var s=c=>{_f(c,{})},l=c=>{var v=Se(),f=oe(v);{var p=b=>{Us(b,{})},y=b=>{var m=Se(),A=oe(m);{var k=C=>{Us(C,{})},w=C=>{var z=Se(),R=oe(z);{var x=S=>{Xd(S,{})},M=S=>{var N=Se(),K=oe(N);{var D=I=>{nf(I,{})},L=I=>{var ae=Se(),Q=oe(ae);{var j=Y=>{lf(Y,{})},q=Y=>{var Z=Se(),X=oe(Z);{var re=ue=>{uf(ue,{})},se=ue=>{var le=Se(),Ce=oe(le);{var Te=ie=>{xf(ie,{})},ye=ie=>{var he=kf();E(ie,he)};ee(Ce,ie=>{wt.value==="srv_management"?ie(Te):ie(ye,!1)},!0)}E(ue,le)};ee(X,ue=>{wt.value==="ply_recent"?ue(re):ue(se,!1)},!0)}E(Y,Z)};ee(Q,Y=>{wt.value==="ply_data"?Y(j):Y(q,!1)},!0)}E(I,ae)};ee(K,I=>{wt.value==="ply_vehicles"?I(D):I(L,!1)},!0)}E(S,N)};ee(R,S=>{wt.value==="ply_bans"?S(x):S(M,!1)},!0)}E(C,z)};ee(A,C=>{wt.value==="ply_online"?C(k):C(w,!1)},!0)}E(b,m)};ee(f,b=>{wt.value==="ply_management"?b(p):b(y,!1)},!0)}E(c,v)};ee(i,c=>{wt.value==="dashboard_home"?c(s):c(l,!1)})}E(t,a),Ge()}var Tf=U('<div><span> </span> <button type="button" aria-label="Dismiss notification"><svg viewBox="0 0 15 15" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 13.6187L13.6187 15L7.5 8.8716L1.38132 15L0 13.6187L6.1284 7.5L0 1.38132L1.38132 0L7.5 6.1284L13.6187 0L15 1.38132L8.8716 7.5L15 13.6187Z"></path></svg></button></div>'),Sf=U('<div class="notifications" aria-live="polite" aria-atomic="true"></div>');function Af(t,e){Xe(e,!0);var a=Se(),r=oe(a);{var i=s=>{var l=Sf();ot(l,21,()=>Wn.items,c=>c.id,(c,v)=>{var f=Tf();let p;var y=o(f),b=o(y),m=u(y,2);m.__click=()=>Wn.dismiss(n(v).id),$(()=>{p=Ne(f,1,"notification",null,p,{error:n(v).type==="error",success:n(v).type==="success",info:n(v).type==="info"}),g(b,n(v).message)}),E(c,f)}),E(s,l)};ee(r,s=>{Wn.items.length>0&&s(i)})}E(t,a),Ge()}ht(["click"]);const ln=[{id:"self",labelKey:"admin_menu_self",page:"self"},{id:"vehicle",labelKey:"admin_menu_vehicle",page:"vehicle"},{id:"utility",labelKey:"admin_menu_utility",page:"utility"}],ki=ln[0]?.page??"self",qa=[1,2,3,4,5].map(t=>({value:t,label:`${t}/5`})),fe={section(t,e){return{type:"section",id:t,labelKey:e}},back(t){return{type:"back",id:"back",labelKey:"back",page:t}},page(t,e,a){return{type:"page",id:t,labelKey:e,page:a}},action(t,e,a,r={}){return{type:"action",id:t,labelKey:e,event:a,...r}},input(t,e,a,r={}){return{type:"input",id:t,labelKey:e,valueKey:a,...r}},option(t,e,a,r,i,s){return{type:"option",id:t,labelKey:e,valueKey:a,options:r,event:i,payload:s}},toggle(t,e,a,r,i){return{type:"toggle",id:t,labelKey:e,valueKey:a,event:r,payload:i}}};function gt(t){return t.customizationPayload()}function Lf(t){const e=t.colorPresets.map(l=>({value:l.id,label:l.label})),a=t.neonPresets.map(l=>({value:l.id,label:l.label})),r=t.windowTints.map(l=>({value:l.id,label:l.label})),i=t.wheelCategories.map(l=>({value:l.id,label:l.label})),s=t.wheelDesigns.map(l=>({value:l.id,label:l.label}));return{root:{id:"root",titleKey:"admin_menu_self",subtitleKey:"quick_actions",categoryId:"self",items:[fe.action("noclip","noclip","adminMenu:noclip",{badge:"toggle"}),fe.action("names","show_names","adminMenu:names",{badge:"toggle"}),fe.action("blips","show_blips","adminMenu:blips",{badge:"toggle"}),fe.action("godmode","godmode","adminMenu:godmode",{badge:"toggle"}),fe.action("invisible","invisible","adminMenu:invisible",{badge:"toggle"}),fe.action("infiniteAmmo","infinite_ammo","adminMenu:infiniteAmmo",{badge:"toggle"}),fe.action("revive","revive","adminMenu:revive"),fe.action("heal","heal","adminMenu:heal"),fe.action("armor","armor","adminMenu:armor"),fe.action("waypoint","teleport_waypoint","adminMenu:waypoint")]},self:{id:"self",titleKey:"admin_menu_self",subtitleKey:"quick_actions",categoryId:"self",items:[fe.action("noclip","noclip","adminMenu:noclip",{badge:"toggle"}),fe.action("names","show_names","adminMenu:names",{badge:"toggle"}),fe.action("blips","show_blips","adminMenu:blips",{badge:"toggle"}),fe.action("godmode","godmode","adminMenu:godmode",{badge:"toggle"}),fe.action("invisible","invisible","adminMenu:invisible",{badge:"toggle"}),fe.action("infiniteAmmo","infinite_ammo","adminMenu:infiniteAmmo",{badge:"toggle"}),fe.action("revive","revive","adminMenu:revive"),fe.action("heal","heal","adminMenu:heal"),fe.action("armor","armor","adminMenu:armor"),fe.action("waypoint","teleport_waypoint","adminMenu:waypoint")]},vehicle:{id:"vehicle",titleKey:"admin_menu_vehicle",subtitleKey:"quick_actions",categoryId:"vehicle",items:[fe.page("spawnVehiclePage","spawn_vehicle","spawn"),fe.page("customizeVehiclePage","customize_vehicle","customize"),fe.action("repair","repair_vehicle","adminMenu:repairVehicle"),fe.action("clean","clean_vehicle","adminMenu:cleanVehicle"),fe.action("flip","flip_vehicle","adminMenu:flipVehicle"),fe.action("delete","delete_current_vehicle","adminMenu:deleteVehicle")]},utility:{id:"utility",titleKey:"admin_menu_utility",subtitleKey:"quick_actions",categoryId:"utility",items:[fe.action("copyCoords","copy_coords","adminMenu:copyCoords")]},spawn:{id:"spawn",titleKey:"spawn_vehicle",subtitleKey:"vehicle_model",categoryId:"vehicle",parentPage:"vehicle",items:[fe.input("spawnModel","vehicle_model","spawnModel",{placeholder:t.defaultModel,event:"adminMenu:spawnVehicle",payload:l=>l.spawnPayload()}),fe.option("spawnColor","vehicle_color","spawnColor",e),fe.toggle("spawnMaxPerformance","spawn_tuned","spawnMaxPerformance")]},customize:{id:"customize",titleKey:"customize_vehicle",subtitleKey:"customize_vehicle_hint",categoryId:"vehicle",parentPage:"vehicle",items:[fe.option("engineLevel","engine_level","engineLevel",qa,"adminMenu:customizeVehicle",gt),fe.option("brakeLevel","brake_level","brakeLevel",qa,"adminMenu:customizeVehicle",gt),fe.option("transmissionLevel","transmission_level","transmissionLevel",qa,"adminMenu:customizeVehicle",gt),fe.option("suspensionLevel","suspension_level","suspensionLevel",qa,"adminMenu:customizeVehicle",gt),fe.option("armorLevel","vehicle_armor","armorLevel",qa,"adminMenu:customizeVehicle",gt),fe.toggle("turbo","turbo","turbo","adminMenu:customizeVehicle",gt),fe.toggle("xenon","xenon_lights","xenon","adminMenu:customizeVehicle",gt),fe.toggle("neon","neon_lights","neon","adminMenu:customizeVehicle",gt),fe.option("neonColor","neon_color","neonColor",a,"adminMenu:customizeVehicle",gt),fe.option("vehicleColor","primary_color","vehicleColor",e,"adminMenu:customizeVehicle",gt),fe.option("secondaryColor","secondary_color","secondaryColor",e,"adminMenu:customizeVehicle",gt),fe.option("windowTint","window_tint","windowTint",r,"adminMenu:customizeVehicle",gt),fe.option("wheelCategory","wheel_category","wheelCategory",i,"adminMenu:customizeVehicle",gt),fe.option("wheelDesign","wheel_design","wheelDesign",s,"adminMenu:customizeVehicle",gt),fe.toggle("bulletproofTires","bulletproof_tires","bulletproofTires","adminMenu:customizeVehicle",gt),fe.action("maxPerformance","max_performance","adminMenu:maxVehiclePerformance",{badge:"value"})]}}}class Pf{#e;get spawnModel(){return n(this.#e)}set spawnModel(e){_(this.#e,e,!0)}#n;get spawnColor(){return n(this.#n)}set spawnColor(e){_(this.#n,e,!0)}#t;get spawnMaxPerformance(){return n(this.#t)}set spawnMaxPerformance(e){_(this.#t,e,!0)}#r;get engineLevel(){return n(this.#r)}set engineLevel(e){_(this.#r,e,!0)}#s;get brakeLevel(){return n(this.#s)}set brakeLevel(e){_(this.#s,e,!0)}#i;get transmissionLevel(){return n(this.#i)}set transmissionLevel(e){_(this.#i,e,!0)}#a;get suspensionLevel(){return n(this.#a)}set suspensionLevel(e){_(this.#a,e,!0)}#o;get armorLevel(){return n(this.#o)}set armorLevel(e){_(this.#o,e,!0)}#l;get turbo(){return n(this.#l)}set turbo(e){_(this.#l,e,!0)}#c;get xenon(){return n(this.#c)}set xenon(e){_(this.#c,e,!0)}#u;get neon(){return n(this.#u)}set neon(e){_(this.#u,e,!0)}#v;get neonColor(){return n(this.#v)}set neonColor(e){_(this.#v,e,!0)}#f;get vehicleColor(){return n(this.#f)}set vehicleColor(e){_(this.#f,e,!0)}#h;get secondaryColor(){return n(this.#h)}set secondaryColor(e){_(this.#h,e,!0)}#_;get windowTint(){return n(this.#_)}set windowTint(e){_(this.#_,e,!0)}#d;get wheelCategory(){return n(this.#d)}set wheelCategory(e){_(this.#d,e,!0)}#p;get wheelDesign(){return n(this.#p)}set wheelDesign(e){_(this.#p,e,!0)}#m;get bulletproofTires(){return n(this.#m)}set bulletproofTires(e){_(this.#m,e,!0)}constructor(e){this.#e=T(""),this.#n=T(""),this.#t=T(!1),this.#r=T(1),this.#s=T(1),this.#i=T(1),this.#a=T(1),this.#o=T(1),this.#l=T(!1),this.#c=T(!1),this.#u=T(!1),this.#v=T(""),this.#f=T(""),this.#h=T(""),this.#_=T(0),this.#d=T(""),this.#p=T(-1),this.#m=T(!1),this.reset(e)}reset(e){this.spawnModel=e.defaultModel,this.spawnColor=e.defaultColor,this.spawnMaxPerformance=!1,this.engineLevel=1,this.brakeLevel=1,this.transmissionLevel=1,this.suspensionLevel=1,this.armorLevel=1,this.turbo=!1,this.xenon=!1,this.neon=!1,this.neonColor=e.neonPresets[0]?.id??"white",this.vehicleColor=e.defaultColor,this.secondaryColor=e.defaultColor,this.windowTint=e.windowTints[0]?.id??0,this.wheelCategory=e.wheelCategories[0]?.id??"sport",this.wheelDesign=e.wheelDesigns[0]?.id??-1,this.bulletproofTires=!1}get(e){return this[e]}set(e,a){this[e]=a}applyMaxPerformance(){this.engineLevel=5,this.brakeLevel=5,this.transmissionLevel=5,this.suspensionLevel=5,this.armorLevel=5,this.turbo=!0}spawnPayload(){return{model:this.spawnModel,color:this.spawnColor,primaryColor:this.spawnColor,secondaryColor:this.spawnColor,maxPerformance:this.spawnMaxPerformance,deleteCurrent:!0}}customizationPayload(){return{engineLevel:this.engineLevel,brakeLevel:this.brakeLevel,transmissionLevel:this.transmissionLevel,suspensionLevel:this.suspensionLevel,armorLevel:this.armorLevel,turbo:this.turbo,xenon:this.xenon,neon:this.neon,neonColor:this.neonColor,color:this.vehicleColor,primaryColor:this.vehicleColor,secondaryColor:this.secondaryColor,windowTint:this.windowTint,wheelCategory:this.wheelCategory,wheelDesign:this.wheelDesign,bulletproofTires:this.bulletproofTires}}}var Ef=U('<button type="button"> </button>'),zf=U('<div class="admin-menu-section-label"> </div>'),Of=U("<label><span> </span> <input/></label>"),Df=U('<small class="value-badge page-badge"><</small>'),Nf=U('<small class="value-badge page-badge">></small>'),Rf=U("<small> </small>"),Bf=U('<small class="value-badge"> </small>'),If=U("<small> </small>"),Ff=U('<small class="value-badge selector-badge"><span class="selector-arrow"><</span> <span> </span> <span class="selector-arrow">></span></small>'),Vf=U('<button type="button"><span> </span> <!></button>'),Hf=U('<aside class="admin-menu-panel"><div class="admin-menu-header"><div class="admin-menu-heading"><span class="admin-menu-title"> </span> <span class="admin-menu-subtitle"> </span></div> <div class="admin-menu-controls"><button type="button"><svg viewBox="0 0 20 20" aria-hidden="true"><path d="M3 4.5A1.5 1.5 0 0 1 4.5 3h3A1.5 1.5 0 0 1 9 4.5v3A1.5 1.5 0 0 1 7.5 9h-3A1.5 1.5 0 0 1 3 7.5v-3Zm8 0A1.5 1.5 0 0 1 12.5 3h3A1.5 1.5 0 0 1 17 4.5v3A1.5 1.5 0 0 1 15.5 9h-3A1.5 1.5 0 0 1 11 7.5v-3Zm-8 8A1.5 1.5 0 0 1 4.5 11h3A1.5 1.5 0 0 1 9 12.5v3A1.5 1.5 0 0 1 7.5 17h-3A1.5 1.5 0 0 1 3 15.5v-3Zm8 0a1.5 1.5 0 0 1 1.5-1.5h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3a1.5 1.5 0 0 1-1.5-1.5v-3Z"></path></svg></button> <button type="button" aria-label="Close admin menu"><svg viewBox="0 0 15 15" aria-hidden="true"><path fill-rule="evenodd" clip-rule="evenodd" d="M15 13.6187L13.6187 15L7.5 8.8716L1.38132 15L0 13.6187L6.1284 7.5L0 1.38132L1.38132 0L7.5 6.1284L13.6187 0L15 1.38132L8.8716 7.5L15 13.6187Z"></path></svg></button></div></div> <div class="admin-menu-categories" aria-label="Admin menu categories"></div> <div class="admin-menu-actions"></div> <div class="admin-menu-footer"> </div></aside>');function jf(t,e){Xe(e,!0);let a=T(null),r=T(_e(ki)),i=T("items"),s=T(0),l=T(0),c=T(0),v=T(null),f=T(null),p=new Pf(V.vehicleConfig),y=V.vehicleConfig,b=new Map,m=!1;const A=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Backspace","Tab"]),k=H(()=>Lf(V.vehicleConfig)),w=H(()=>n(k)[n(r)]??n(k)[ki]??n(k).root),C=H(()=>n(w).parentPage?[{type:"back",id:"back",labelKey:"back",page:n(w).parentPage},...n(w).items]:n(w).items),z=H(()=>n(w).categoryId??ln.find(d=>d.page===n(w).id)?.id??ln[0]?.id??""),R=H(()=>Math.max(0,ln.findIndex(d=>d.id===n(z)))),x=H(()=>n(C).filter(d=>d.type!=="section")),M=H(()=>{let d=-1;return n(C).map(P=>(P.type!=="section"&&(d+=1),{item:P,selectableIndex:P.type==="section"?-1:d}))});function S(d,P){return b.set(P,d),{destroy(){b.delete(P)}}}function N(d){if(d.type!=="option"&&d.type!=="toggle"&&d.type!=="input")return"";const P=p.get(d.valueKey);return d.type==="toggle"?h(P?"on":"off"):d.type==="option"?d.options?.find(O=>O.value===P)?.label??String(P):String(P??"")}function K(){_(c,Math.max(0,Math.min(n(c),Math.max(0,n(x).length-1))),!0)}function D(){_(l,Math.max(0,Math.min(n(l),Math.max(0,ln.length-1))),!0)}function L(d,P="items",O=!0){_(r,n(k)[d]?d:ki,!0),_(i,P,!0),_(c,0);const te=n(k)[n(r)],G=te?.items.findIndex(ge=>ge.type==="input")??-1,J=G>=0?te?.items[G]:null;O&&J?.type==="input"&&(_(c,G+(te?.parentPage?1:0)),Ca().then(()=>j(J.id)))}async function I(d,P="items",O=!0){await Z(),L(d,P,O)}async function ae(d,P="categories"){if(ln.length===0)return;_(l,(n(l)+d+ln.length)%ln.length),D();const O=ln[n(l)];O&&await I(O.page,P,P!=="categories")}async function Q(d){m!==d&&(m=d,await je("adminMenu:setInputFocus",{enabled:d}))}async function j(d){const P=b.get(d);P&&(await Q(!0),P.focus(),P.select())}async function q(d){d?.currentTarget?.blur(),await Q(!1)}function Y(){const d=document.activeElement;if(!(d instanceof HTMLInputElement))return null;for(const P of b.values())if(P===d)return P;return null}async function Z(){const d=Y();return d?(d.blur(),await Q(!1),!0):!1}function X(d,P){p.set(d,P)}function re(d){return d instanceof HTMLElement?d.isContentEditable||d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement:!1}async function se(d){if(!("event"in d)||!d.event||n(a))return null;_(a,d.id,!0);const P=d.payload?.(p)??{},O=await je(d.event,P);return O?.success&&(d.id==="maxPerformance"&&p.applyMaxPerformance(),"badge"in d&&d.badge==="toggle"&&V.setAdminMenuState(d.id,O.active??!1),"badge"in d&&d.badge==="value"&&O.value&&V.setAdminMenuBadge(d.id,O.value),d.type==="action"&&(!("badge"in d)||!d.badge)&&Wn.success(h(d.labelKey))),_(a,null),O}async function ue(d,P){if(d.type==="action"&&d.badge==="toggle"){await se(d);return}if(d.type==="option"){const O=d.options??[];if(O.length===0)return;const G=(O.findIndex(J=>J.value===p.get(d.valueKey))+P+O.length)%O.length;X(d.valueKey,O[G].value),d.event&&(await Ca(),await se(d))}d.type==="toggle"&&(X(d.valueKey,!p.get(d.valueKey)),d.event&&(await Ca(),await se(d)))}async function le(d){if(d.type==="page"||d.type==="back"){await I(d.page);return}if(d.type==="input"){await j(d.id);return}if(d.type!=="option"){if(d.type==="toggle"){await ue(d,1);return}d.type==="action"&&await se(d)}}async function Ce(){if(n(s)===0){await ye();return}await ie()}async function Te(d,P){await q(P),d.event&&await se(d)}async function ye(){if(n(a))return;_(a,"dashboard");const d=await je("openDashboard");(d===null||d.success)&&V.openDashboard(V.players??[]),_(a,null)}async function ie(){const d=await je("releaseFocus",{release:!0});(d===null||d.success)&&V.close()}async function he(d,P=!1){if(!V.visible||V.mode!=="menu")return;if(Y())if(d==="Tab")await Z();else if(d==="ArrowUp"||d==="ArrowDown")await Z();else if(d==="Enter"||d==="Escape"){await Z();return}else return;if(d==="Tab")_(l,n(i)==="categories"?n(l):n(R),!0),_(i,"categories"),await ae(P?-1:1,"categories");else if(n(i)==="controls")d==="ArrowLeft"||d==="ArrowRight"?_(s,n(s)===0?1:0,!0):d==="ArrowDown"?(_(i,"items"),_(c,0),K()):d==="Enter"?await Ce():d==="Backspace"&&await ie();else if(n(i)==="categories")d==="ArrowLeft"||d==="ArrowRight"?await ae(d==="ArrowLeft"?-1:1,"categories"):d==="ArrowDown"?(_(i,"items"),_(c,0),K()):d==="ArrowUp"?(_(i,"items"),_(c,n(x).length-1),K()):d==="Enter"?await ae(0,"items"):d==="Backspace"&&(n(w).parentPage?await I(n(w).parentPage):(_(i,"controls"),_(s,0)));else if(d==="ArrowUp")n(c)<=0?(_(i,"categories"),_(l,n(R),!0)):(_(c,n(c)-1),K());else if(d==="ArrowDown")_(c,n(c)>=n(x).length-1?0:n(c)+1,!0),K();else if(d==="ArrowLeft"||d==="ArrowRight"){const te=n(x)[n(c)];te&&await ue(te,d==="ArrowLeft"?-1:1)}else if(d==="Enter"){const te=n(x)[n(c)];te&&await le(te)}else d==="Backspace"&&(n(w).parentPage?await I(n(w).parentPage):(_(i,"controls"),_(s,0)));await Ca(),(n(i)==="categories"?n(v)?.querySelector("button.selected"):n(f)?.querySelector("button.selected, .admin-menu-input-row.selected"))?.scrollIntoView({block:"nearest"})}xt(()=>{V.vehicleConfig!==y&&(y=V.vehicleConfig,p.reset(V.vehicleConfig))}),xt(()=>{n(i)!=="categories"&&_(l,n(R),!0)}),xt(()=>{const d=P=>{!V.visible||V.mode!=="menu"||A.has(P.key)&&(P.key!=="Tab"&&re(P.target)||(P.preventDefault(),he(P.key,P.shiftKey)))};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}});var me=Hf(),Ae=o(me),Fe=o(Ae),We=o(Fe),ze=o(We),Je=u(We,2),$e=o(Je),at=u(Fe,2),B=o(at);let F;B.__click=()=>{_(i,"controls"),_(s,0),ye()};var ne=u(B,2);let ve;ne.__click=()=>{_(i,"controls"),_(s,1),ie()};var ce=u(Ae,2);ot(ce,21,()=>ln,Et,(d,P,O)=>{var te=Ef();te.__click=()=>{_(l,O,!0),I(n(P).page)};let G;var J=o(te);$(ge=>{G=Ne(te,1,"",null,G,{active:n(z)===n(P).id,selected:n(i)==="categories"&&n(l)===O}),g(J,ge)},[()=>h(n(P).labelKey)]),E(d,te)}),na(ce,d=>_(v,d),()=>n(v));var Le=u(ce,2);ot(Le,21,()=>n(M),Et,(d,P)=>{const O=H(()=>n(P).item);var te=Se(),G=oe(te);{var J=ke=>{var Ue=zf(),et=o(Ue);$(Oe=>g(et,Oe),[()=>h(n(O).labelKey)]),E(ke,Ue)},ge=ke=>{var Ue=Se(),et=oe(Ue);{var Oe=Be=>{var Pe=Of();let qe;var tt=o(Pe),Ve=o(tt),De=u(tt,2);De.__input=pe=>X(n(O).valueKey,pe.currentTarget.value),De.__keydown=pe=>{if(pe.key==="Enter"||pe.key==="Escape")pe.preventDefault(),pe.stopPropagation(),pe.key==="Enter"?Te(n(O),pe):q(pe);else if(pe.key==="ArrowUp"||pe.key==="ArrowDown"){const Ye=pe.key;pe.preventDefault(),pe.stopPropagation(),(async()=>(await q(pe),await he(Ye)))()}},nu(De,(pe,Ye)=>S?.(pe,Ye),()=>n(O).id),$((pe,Ye)=>{qe=Ne(Pe,1,"admin-menu-input-row",null,qe,{selected:n(i)==="items"&&n(P).selectableIndex===n(c)}),g(Ve,pe),lu(De,Ye),Ke(De,"placeholder",n(O).placeholder)},[()=>h(n(O).labelKey),()=>String(p.get(n(O).valueKey)??"")]),Kn("focus",De,()=>Q(!0)),Kn("blur",De,q),E(Be,Pe)},rt=Be=>{var Pe=Vf();Pe.__click=()=>{_(c,n(P).selectableIndex,!0),le(n(O))};let qe;var tt=o(Pe),Ve=o(tt),De=u(tt,2);{var pe=Ze=>{var it=Df();E(Ze,it)},Ye=Ze=>{var it=Se(),bt=oe(it);{var Zt=Ct=>{var ct=Nf();E(Ct,ct)},It=Ct=>{var ct=Se(),tn=oe(ct);{var zt=_t=>{var Ot=Rf(),Ft=o(Ot);$(an=>g(Ft,an),[()=>V.adminMenuStates[n(O).id]?h("on"):h("off")]),E(_t,Ot)},nn=_t=>{var Ot=Se(),Ft=oe(Ot);{var an=Mt=>{var Tt=Bf(),mn=o(Tt);$(()=>g(mn,V.adminMenuBadges[n(O).id])),E(Mt,Tt)},Yt=Mt=>{var Tt=Se(),mn=oe(Tt);{var rn=St=>{var Vt=If(),Dt=o(Vt);$(Xt=>g(Dt,Xt),[()=>N(n(O))]),E(St,Vt)},Ln=St=>{var Vt=Se(),Dt=oe(Vt);{var Xt=sn=>{var Pn=Ff(),En=u(o(Pn),2),zn=o(En);$(On=>g(zn,On),[()=>N(n(O))]),E(sn,Pn)};ee(Dt,sn=>{n(O).type==="option"&&sn(Xt)},!0)}E(St,Vt)};ee(mn,St=>{n(O).type==="toggle"?St(rn):St(Ln,!1)},!0)}E(Mt,Tt)};ee(Ft,Mt=>{n(O).type==="action"&&n(O).badge==="value"&&V.adminMenuBadges[n(O).id]?Mt(an):Mt(Yt,!1)},!0)}E(_t,Ot)};ee(tn,_t=>{n(O).type==="action"&&n(O).badge==="toggle"?_t(zt):_t(nn,!1)},!0)}E(Ct,ct)};ee(bt,Ct=>{n(O).type==="page"?Ct(Zt):Ct(It,!1)},!0)}E(Ze,it)};ee(De,Ze=>{n(O).type==="back"?Ze(pe):Ze(Ye,!1)})}$((Ze,it)=>{Pe.disabled=n(a)!==null,qe=Ne(Pe,1,"",null,qe,Ze),g(Ve,it)},[()=>({selected:n(i)==="items"&&n(P).selectableIndex===n(c),"admin-menu-back":n(O).type==="back",active:n(O).type==="action"&&n(O).badge==="toggle"&&V.adminMenuStates[n(O).id]===!0||n(O).type==="toggle"&&p.get(n(O).valueKey)===!0}),()=>h(n(O).labelKey)]),E(Be,Pe)};ee(et,Be=>{n(O).type==="input"?Be(Oe):Be(rt,!1)},!0)}E(ke,Ue)};ee(G,ke=>{n(O).type==="section"?ke(J):ke(ge,!1)})}E(d,te)}),na(Le,d=>_(f,d),()=>n(f));var be=u(Le,2),we=o(be);$((d,P,O,te,G)=>{Ke(me,"aria-label",d),g(ze,P),g($e,O),F=Ne(B,1,"admin-menu-dashboard",null,F,{selected:n(i)==="controls"&&n(s)===0}),Ke(B,"aria-label",te),ve=Ne(ne,1,"admin-menu-close",null,ve,{selected:n(i)==="controls"&&n(s)===1}),g(we,G)},[()=>h("quick_admin_menu"),()=>h(n(w).titleKey),()=>h(n(w).subtitleKey),()=>h("open_admin_dashboard"),()=>n(w).parentPage?h("quick_menu_edit_hint"):h("quick_menu_hint")]),E(t,me),Ge()}ht(["click","input","keydown"]);var Wf=U('<div class="esx-adminmenu-container"><!> <div class="menu-content"><!> <!></div></div>'),Uf=U('<div class="spectate-tooltip-container"><div class="spectate-tooltip"> </div></div>'),qf=U("<!> <!> <!>",1);function Kf(t,e){Xe(e,!0);async function a(){await je("releaseFocus",{release:!0})!==null&&(wt.set("dashboard_home"),V.close())}async function r(){const b=await je("openAdminMenu");(b===null||b.success)&&V.openMenu()}function i(b){b.key==="Escape"&&V.visible&&a()}xt(()=>(window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}));var s=qf(),l=oe(s);{var c=b=>{var m=Wf(),A=o(m);Su(A,{onEscape:a,onOpenAdminMenu:r});var k=u(A,2),w=o(k);iv(w,{});var C=u(w,2);Mf(C,{}),E(b,m)},v=b=>{var m=Se(),A=oe(m);{var k=w=>{jf(w,{})};ee(A,w=>{V.visible&&V.mode==="menu"&&w(k)},!0)}E(b,m)};ee(l,b=>{V.visible&&V.mode==="dashboard"?b(c):b(v,!1)})}var f=u(l,2);Af(f,{});var p=u(f,2);{var y=b=>{var m=Uf(),A=o(m),k=o(A);$(w=>g(k,w),[()=>h("escape_spectate")]),E(b,m)};ee(p,b=>{V.spectating&&b(y)})}E(t,s),Ge()}function Zf(t){const e=a=>{a.data?.action&&t(a.data)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}Zf(t=>{switch(t.action){case"initResource":if(!t.data)return;Ie.set(t.data.serverData),t.data.translations&&Object.keys(t.data.translations).length>0&&Vo.set(t.data.translations),V.setImpounds(t.data.impounds??{}),V.setVehicleConfig(t.data.vehicleConfig);break;case"openAdmin":if(!t.data)return null;V.openDashboard(t.data);break;case"openAdminDashboard":if(!t.data)return null;t.data.serverData&&Ie.set(t.data.serverData),V.openDashboard(t.data.players??[],t.data.selectedPlayerId??null),t.data.selectedPlayerId!==void 0&&wt.set("ply_management");break;case"openAdminMenu":t.data?.serverData&&Ie.set(t.data.serverData),V.openMenu();break;case"updateServerData":if(!t.data)return null;Ie.set(t.data);break;case"adminMenuState":if(!t.data)return null;V.setAdminMenuState(t.data.action,t.data.active),V.setAdminMenuBadge(t.data.action,t.data.value);break;case"updatePlayers":if(!t.data)return null;V.setPlayers(t.data);break;case"stopSpectate":if(!t.data)return null;Hu(t.data);break;case"closeAdmin":V.close();break;case"copyToClipboard":if(!t.data)return null;Gi(t.data);break}});const Yf=""+new URL("testbg-DszbURmB.png",import.meta.url).href,Ka=document.getElementById("app");!jt()&&Ka&&(Ka.style.backgroundImage=`url(${Yf})`,Ka.style.backgroundSize="cover",Ka.style.backgroundRepeat="no-repeat",Ka.style.backgroundPosition="center");qc(Kf,{target:document.getElementById("app")}); diff --git a/[esx_addons]/esx_adminmenu/web/dist/assets/testbg-DszbURmB.png b/[esx_addons]/esx_adminmenu/web/dist/assets/testbg-DszbURmB.png new file mode 100644 index 00000000..02f62693 Binary files /dev/null and b/[esx_addons]/esx_adminmenu/web/dist/assets/testbg-DszbURmB.png differ diff --git a/[esx_addons]/esx_adminmenu/web/dist/index.html b/[esx_addons]/esx_adminmenu/web/dist/index.html new file mode 100644 index 00000000..6010ad20 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/dist/index.html @@ -0,0 +1,13 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>esx-adminmenu + + + + +
+ + diff --git a/[esx_addons]/esx_adminmenu/web/index.html b/[esx_addons]/esx_adminmenu/web/index.html new file mode 100644 index 00000000..57ee1e86 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/index.html @@ -0,0 +1,12 @@ + + + + + + esx-adminmenu + + +
+ + + diff --git a/[esx_addons]/esx_adminmenu/web/package-lock.json b/[esx_addons]/esx_adminmenu/web/package-lock.json new file mode 100644 index 00000000..867f523f --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/package-lock.json @@ -0,0 +1,1527 @@ +{ + "name": "esx-adminmenu", + "version": "3.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "esx-adminmenu", + "version": "3.0.0", + "dependencies": { + "@floating-ui/dom": "^1.7.4", + "svelte-virtuallists": "^1.4.2" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.2.1", + "@tsconfig/svelte": "^5.0.6", + "@types/node": "^24.10.1", + "svelte": "^5.43.8", + "svelte-check": "^4.3.4", + "typescript": "~5.9.3", + "vite": "^7.2.4" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.2.tgz", + "integrity": "sha512-GZMB+a0mOMZs4MpDbj8RJp4cw+w1WV5NYD6xzgvzUJ5Ek2jerwfO2eADyI6ExDSUED+1X8aMbegahsJi+8mgpw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.2.tgz", + "integrity": "sha512-DVNI8jlPa7Ujbr1yjU2PfUSRtAUZPG9I1RwW4F4xFB1Imiu2on0ADiI/c3td+KmDtVKNbi+nffGDQMfcIMkwIA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.2.tgz", + "integrity": "sha512-pvz8ZZ7ot/RBphf8fv60ljmaoydPU12VuXHImtAs0XhLLw+EXBi2BLe3OYSBslR4rryHvweW5gmkKFwTiFy6KA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.2.tgz", + "integrity": "sha512-z8Ank4Byh4TJJOh4wpz8g2vDy75zFL0TlZlkUkEwYXuPSgX8yzep596n6mT7905kA9uHZsf/o2OJZubl2l3M7A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.2.tgz", + "integrity": "sha512-davCD2Zc80nzDVRwXTcQP/28fiJbcOwvdolL0sOiOsbwBa72kegmVU0Wrh1MYrbuCL98Omp5dVhQFWRKR2ZAlg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.2.tgz", + "integrity": "sha512-ZxtijOmlQCBWGwbVmwOF/UCzuGIbUkqB1faQRf5akQmxRJ1ujusWsb3CVfk/9iZKr2L5SMU5wPBi1UWbvL+VQA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.2.tgz", + "integrity": "sha512-lS/9CN+rgqQ9czogxlMcBMGd+l8Q3Nj1MFQwBZJyoEKI50XGxwuzznYdwcav6lpOGv5BqaZXqvBSiB/kJ5op+g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.2.tgz", + "integrity": "sha512-tAfqtNYb4YgPnJlEFu4c212HYjQWSO/w/h/lQaBK7RbwGIkBOuNKQI9tqWzx7Wtp7bTPaGC6MJvWI608P3wXYA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.2.tgz", + "integrity": "sha512-vWfq4GaIMP9AIe4yj1ZUW18RDhx6EPQKjwe7n8BbIecFtCQG4CfHGaHuh7fdfq+y3LIA2vGS/o9ZBGVxIDi9hw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.2.tgz", + "integrity": "sha512-hYxN8pr66NsCCiRFkHUAsxylNOcAQaxSSkHMMjcpx0si13t1LHFphxJZUiGwojB1a/Hd5OiPIqDdXONia6bhTw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.2.tgz", + "integrity": "sha512-MJt5BRRSScPDwG2hLelYhAAKh9imjHK5+NE/tvnRLbIqUWa+0E9N4WNMjmp/kXXPHZGqPLxggwVhz7QP8CTR8w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.2.tgz", + "integrity": "sha512-lugyF1atnAT463aO6KPshVCJK5NgRnU4yb3FUumyVz+cGvZbontBgzeGFO1nF+dPueHD367a2ZXe1NtUkAjOtg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.2.tgz", + "integrity": "sha512-nlP2I6ArEBewvJ2gjrrkESEZkB5mIoaTswuqNFRv/WYd+ATtUpe9Y09RnJvgvdag7he0OWgEZWhviS1OTOKixw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.2.tgz", + "integrity": "sha512-C92gnpey7tUQONqg1n6dKVbx3vphKtTHJaNG2Ok9lGwbZil6DrfyecMsp9CrmXGQJmZ7iiVXvvZH6Ml5hL6XdQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.2.tgz", + "integrity": "sha512-B5BOmojNtUyN8AXlK0QJyvjEZkWwy/FKvakkTDCziX95AowLZKR6aCDhG7LeF7uMCXEJqwa8Bejz5LTPYm8AvA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.2.tgz", + "integrity": "sha512-p4bm9+wsPwup5Z8f4EpfN63qNagQ47Ua2znaqGH6bqLlmJ4bx97Y9JdqxgGZ6Y8xVTixUnEkoKSHcpRlDnNr5w==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.2.tgz", + "integrity": "sha512-uwp2Tip5aPmH+NRUwTcfLb+W32WXjpFejTIOWZFw/v7/KnpCDKG66u4DLcurQpiYTiYwQ9B7KOeMJvLCu/OvbA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.2.tgz", + "integrity": "sha512-Kj6DiBlwXrPsCRDeRvGAUb/LNrBASrfqAIok+xB0LxK8CHqxZ037viF13ugfsIpePH93mX7xfJp97cyDuTZ3cw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.2.tgz", + "integrity": "sha512-HwGDZ0VLVBY3Y+Nw0JexZy9o/nUAWq9MlV7cahpaXKW6TOzfVno3y3/M8Ga8u8Yr7GldLOov27xiCnqRZf0tCA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.2.tgz", + "integrity": "sha512-DNIHH2BPQ5551A7oSHD0CKbwIA/Ox7+78/AWkbS5QoRzaqlev2uFayfSxq68EkonB+IKjiuxBFoV8ESJy8bOHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.2.tgz", + "integrity": "sha512-/it7w9Nb7+0KFIzjalNJVR5bOzA9Vay+yIPLVHfIQYG/j+j9VTH84aNB8ExGKPU4AzfaEvN9/V4HV+F+vo8OEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.2.tgz", + "integrity": "sha512-LRBbCmiU51IXfeXk59csuX/aSaToeG7w48nMwA6049Y4J4+VbWALAuXcs+qcD04rHDuSCSRKdmY63sruDS5qag==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.2.tgz", + "integrity": "sha512-kMtx1yqJHTmqaqHPAzKCAkDaKsffmXkPHThSfRwZGyuqyIeBvf08KSsYXl+abf5HDAPMJIPnbBfXvP2ZC2TfHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.2.tgz", + "integrity": "sha512-Yaf78O/B3Kkh+nKABUF++bvJv5Ijoy9AN1ww904rOXZFLWVc5OLOfL56W+C8F9xn5JQZa3UX6m+IktJnIb1Jjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.2.tgz", + "integrity": "sha512-Iuws0kxo4yusk7sw70Xa2E2imZU5HoixzxfGCdxwBdhiDgt9vX9VUCBhqcwY7/uh//78A1hMkkROMJq9l27oLQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.2.tgz", + "integrity": "sha512-sRdU18mcKf7F+YgheI/zGf5alZatMUTKj/jNS6l744f9u3WFu4v7twcUI9vu4mknF4Y9aDlblIie0IM+5xxaqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint/js": { + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", + "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", + "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.7.3", + "@floating-ui/utils": "^0.2.10" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz", + "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", + "license": "MIT" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", + "integrity": "sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.55.1.tgz", + "integrity": "sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.55.1.tgz", + "integrity": "sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.55.1.tgz", + "integrity": "sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.55.1.tgz", + "integrity": "sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.55.1.tgz", + "integrity": "sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.55.1.tgz", + "integrity": "sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.55.1.tgz", + "integrity": "sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.55.1.tgz", + "integrity": "sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.55.1.tgz", + "integrity": "sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.55.1.tgz", + "integrity": "sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.55.1.tgz", + "integrity": "sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.55.1.tgz", + "integrity": "sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.55.1.tgz", + "integrity": "sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.55.1.tgz", + "integrity": "sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.55.1.tgz", + "integrity": "sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.55.1.tgz", + "integrity": "sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.55.1.tgz", + "integrity": "sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.55.1.tgz", + "integrity": "sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.55.1.tgz", + "integrity": "sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.55.1.tgz", + "integrity": "sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.55.1.tgz", + "integrity": "sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.55.1.tgz", + "integrity": "sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.55.1.tgz", + "integrity": "sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.55.1.tgz", + "integrity": "sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.8.tgz", + "integrity": "sha512-esgN+54+q0NjB0Y/4BomT9samII7jGwNy/2a3wNZbT2A2RpmXsXwUt24LvLhx6jUq2gVk4cWEvcRO6MFQbOfNA==", + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-6.2.4.tgz", + "integrity": "sha512-ou/d51QSdTyN26D7h6dSpusAKaZkAiGM55/AKYi+9AGZw7q85hElbjK3kEyzXHhLSnRISHOYzVge6x0jRZ7DXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0", + "deepmerge": "^4.3.1", + "magic-string": "^0.30.21", + "obug": "^2.1.0", + "vitefu": "^1.1.1" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite": "^6.3.0 || ^7.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte-inspector": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-5.0.2.tgz", + "integrity": "sha512-TZzRTcEtZffICSAoZGkPSl6Etsj2torOVrx6Uw0KpXxrec9Gg6jFWQ60Q3+LmNGfZSxHRCZL7vXVZIWmuV50Ig==", + "dev": true, + "license": "MIT", + "dependencies": { + "obug": "^2.1.0" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.0.0-next.0", + "svelte": "^5.0.0", + "vite": "^6.3.0 || ^7.0.0" + } + }, + "node_modules/@tsconfig/svelte": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@tsconfig/svelte/-/svelte-5.0.6.tgz", + "integrity": "sha512-yGxYL0I9eETH1/DR9qVJey4DAsCdeau4a9wYPKuXfEhm8lFO8wg+LLYJjIpAm6Fw7HSlhepPhYPDop75485yWQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.10.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.7.tgz", + "integrity": "sha512-+054pVMzVTmRQV8BhpGv3UyfZ2Llgl8rdpDTon+cUH9+na0ncBVXj3wTUKh14+Kiz18ziM3b4ikpP5/Pc0rQEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/devalue": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.2.tgz", + "integrity": "sha512-nPRkjWzzDQlsejL1WVifk5rvcFi/y1onBRxjaFMjZeR9mFpqu2gmAZ9xUB9/IEanEP/vBtGeGganC/GO1fmufg==", + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.2.tgz", + "integrity": "sha512-HyNQImnsOC7X9PMNaCIeAm4ISCQXs5a5YasTXVliKv4uuBo1dKrG0A+uQS8M5eXjVMnLg3WgXaKvprHlFJQffw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.2", + "@esbuild/android-arm": "0.27.2", + "@esbuild/android-arm64": "0.27.2", + "@esbuild/android-x64": "0.27.2", + "@esbuild/darwin-arm64": "0.27.2", + "@esbuild/darwin-x64": "0.27.2", + "@esbuild/freebsd-arm64": "0.27.2", + "@esbuild/freebsd-x64": "0.27.2", + "@esbuild/linux-arm": "0.27.2", + "@esbuild/linux-arm64": "0.27.2", + "@esbuild/linux-ia32": "0.27.2", + "@esbuild/linux-loong64": "0.27.2", + "@esbuild/linux-mips64el": "0.27.2", + "@esbuild/linux-ppc64": "0.27.2", + "@esbuild/linux-riscv64": "0.27.2", + "@esbuild/linux-s390x": "0.27.2", + "@esbuild/linux-x64": "0.27.2", + "@esbuild/netbsd-arm64": "0.27.2", + "@esbuild/netbsd-x64": "0.27.2", + "@esbuild/openbsd-arm64": "0.27.2", + "@esbuild/openbsd-x64": "0.27.2", + "@esbuild/openharmony-arm64": "0.27.2", + "@esbuild/sunos-x64": "0.27.2", + "@esbuild/win32-arm64": "0.27.2", + "@esbuild/win32-ia32": "0.27.2", + "@esbuild/win32-x64": "0.27.2" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "license": "MIT" + }, + "node_modules/esrap": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.1.tgz", + "integrity": "sha512-GiYWG34AN/4CUyaWAgunGt0Rxvr1PTMlGC0vvEov/uOQYWne2bpN03Um+k8jT+q3op33mKouP2zeJ6OlM+qeUg==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rollup": { + "version": "4.55.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", + "integrity": "sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.55.1", + "@rollup/rollup-android-arm64": "4.55.1", + "@rollup/rollup-darwin-arm64": "4.55.1", + "@rollup/rollup-darwin-x64": "4.55.1", + "@rollup/rollup-freebsd-arm64": "4.55.1", + "@rollup/rollup-freebsd-x64": "4.55.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.55.1", + "@rollup/rollup-linux-arm-musleabihf": "4.55.1", + "@rollup/rollup-linux-arm64-gnu": "4.55.1", + "@rollup/rollup-linux-arm64-musl": "4.55.1", + "@rollup/rollup-linux-loong64-gnu": "4.55.1", + "@rollup/rollup-linux-loong64-musl": "4.55.1", + "@rollup/rollup-linux-ppc64-gnu": "4.55.1", + "@rollup/rollup-linux-ppc64-musl": "4.55.1", + "@rollup/rollup-linux-riscv64-gnu": "4.55.1", + "@rollup/rollup-linux-riscv64-musl": "4.55.1", + "@rollup/rollup-linux-s390x-gnu": "4.55.1", + "@rollup/rollup-linux-x64-gnu": "4.55.1", + "@rollup/rollup-linux-x64-musl": "4.55.1", + "@rollup/rollup-openbsd-x64": "4.55.1", + "@rollup/rollup-openharmony-arm64": "4.55.1", + "@rollup/rollup-win32-arm64-msvc": "4.55.1", + "@rollup/rollup-win32-ia32-msvc": "4.55.1", + "@rollup/rollup-win32-x64-gnu": "4.55.1", + "@rollup/rollup-win32-x64-msvc": "4.55.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svelte": { + "version": "5.46.4", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.46.4.tgz", + "integrity": "sha512-VJwdXrmv9L8L7ZasJeWcCjoIuMRVbhuxbss0fpVnR8yorMmjNDwcjIH08vS6wmSzzzgAG5CADQ1JuXPS2nwt9w==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/estree": "^1.0.5", + "acorn": "^8.12.1", + "aria-query": "^5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "devalue": "^5.6.2", + "esm-env": "^1.2.1", + "esrap": "^2.2.1", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/svelte-check": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.3.5.tgz", + "integrity": "sha512-e4VWZETyXaKGhpkxOXP+B/d0Fp/zKViZoJmneZWe/05Y2aqSKj3YN2nLfYPJBQ87WEiY4BQCQ9hWGu9mPT1a1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": ">=5.0.0" + } + }, + "node_modules/svelte-virtuallists": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/svelte-virtuallists/-/svelte-virtuallists-1.4.2.tgz", + "integrity": "sha512-ZvBU1BMmt2uY/spjuZn+XOtHVxOpU/Cfiy+dajxrOXe6KysjAY2O0R1cLonEGl+/AMy0or6/dO+KA3/C6R3l2A==", + "license": "MIT", + "dependencies": { + "@eslint/js": "^9.21.0" + }, + "peerDependencies": { + "svelte": "^5.20.5" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.15", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", + "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.1.tgz", + "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitefu": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.1.tgz", + "integrity": "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/zimmerframe": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", + "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "license": "MIT" + } + } +} diff --git a/[esx_addons]/esx_adminmenu/web/package.json b/[esx_addons]/esx_adminmenu/web/package.json new file mode 100644 index 00000000..f40136d7 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/package.json @@ -0,0 +1,25 @@ +{ + "name": "esx-adminmenu", + "private": true, + "version": "3.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.2.1", + "@tsconfig/svelte": "^5.0.6", + "@types/node": "^24.10.1", + "svelte": "^5.43.8", + "svelte-check": "^4.3.4", + "typescript": "~5.9.3", + "vite": "^7.2.4" + }, + "dependencies": { + "@floating-ui/dom": "^1.7.4", + "svelte-virtuallists": "^1.4.2" + } +} diff --git a/[esx_addons]/esx_adminmenu/web/src/App.svelte b/[esx_addons]/esx_adminmenu/web/src/App.svelte new file mode 100644 index 00000000..24439462 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/App.svelte @@ -0,0 +1,65 @@ + + +{#if uiState.visible && uiState.mode === "dashboard"} +
+ + +
+{:else if uiState.visible && uiState.mode === "menu"} + +{/if} + +{#if uiState.spectating} +
+
+ {t("escape_spectate")} +
+
+{/if} diff --git a/[esx_addons]/esx_adminmenu/web/src/app.css b/[esx_addons]/esx_adminmenu/web/src/app.css new file mode 100644 index 00000000..3244e7bb --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/app.css @@ -0,0 +1,620 @@ +@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); + +:root { + font-family: "Poppins", sans-serif; + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +body { + margin: 0; + width: 100vw; + height: 100vh; + overflow: hidden; +} + +#app { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + overflow: hidden; + margin: 0; +} + +/* Optional Scrollbar CSS */ +*::-webkit-scrollbar { + display: none; + width: 0.55vh; + height: 0.55vh; +} + +*::-webkit-scrollbar-track { + background: rgba(242, 242, 242, 0.04); + border-radius: 0.3vh; +} + +*::-webkit-scrollbar-thumb { + background: rgba(242, 242, 242, 0.18); + border-radius: 0.3vh; +} + +*::-webkit-scrollbar-thumb:hover { + background: rgba(251, 155, 4, 0.65); +} +/* Optional Scrollbar CSS */ + +input[type="number"]::-webkit-outer-spin-button, +input[type="number"]::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.esx-adminmenu-container { + background-color: #161616; + aspect-ratio: 7/4; + height: 74vh; + border-radius: 1vh; + display: flex; + flex-direction: column; + gap: 1.9vh; + box-sizing: border-box; + padding: 1.6vh 2vh; + color: #F2F2F2; + animation: slideUp 0.5s ease-in-out forwards; +} + +.menu-content { + width: 100%; + height: 100%; + display: flex; + flex-direction: row; + gap: 1.8vh; + animation: fadeIn 2s ease-in-out forwards; + overflow: hidden; +} + +.tab-container { + box-sizing: border-box; + width: 100%; + height: 100%; + max-height: 100%; + min-height: 0; + background: rgba(37, 37, 37, 0.3); + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + user-select: none; + font-size: 1.3vh; + color: #F2F2F2; + padding: 1.4vh 2.3vh; + overflow: hidden; +} + +.tab-wrapper { + width: 100%; + height: 100%; + max-height: 100%; + min-height: 0; + box-sizing: border-box; + overflow: hidden; +} + +.spectate-tooltip-container { + position: absolute; + width: 100%; + bottom: 0; + height: auto; + display: flex; + justify-content: center; + align-items: center; +} + +.spectate-tooltip { + width: auto; + height: auto; + padding: 0.7vh 1.5vh; + color: #F2F2F2; + margin-bottom: 2vh; + background: #161616; + border-radius: 0.5vh; + font-size: 1.5vh; +} + +.notifications { + position: absolute; + right: 2vh; + top: 2vh; + display: flex; + flex-direction: column; + gap: 0.8vh; + width: min(38vh, calc(100vw - 4vh)); + z-index: 50; + pointer-events: none; +} + +.notification { + display: grid; + grid-template-columns: minmax(0, 1fr) 2.2vh; + align-items: center; + gap: 1vh; + box-sizing: border-box; + min-height: 4.4vh; + padding: 1vh 1.1vh; + border: 0.1vh solid rgba(242, 242, 242, 0.16); + border-left: 0.35vh solid #f2f2f2; + border-radius: 0.5vh; + background: #161616; + box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.35); + color: #f2f2f2; + font-family: "Poppins", sans-serif; + font-size: 1.25vh; + pointer-events: auto; + animation: slideDown 0.18s ease-out; +} + +.notification.error { + border-left-color: #f23f3f; +} + +.notification.success { + border-left-color: #4ade80; +} + +.notification.info { + border-left-color: #fb9b04; +} + +.notification span { + min-width: 0; + overflow-wrap: anywhere; +} + +.notification button { + display: flex; + align-items: center; + justify-content: center; + width: 2.2vh; + height: 2.2vh; + border: 0; + border-radius: 0.4vh; + background: rgba(242, 242, 242, 0.08); + color: #f2f2f2; + cursor: pointer; +} + +.notification button:hover { + background: rgba(242, 242, 242, 0.16); +} + +.notification svg { + width: 1vh; + height: 1vh; + fill: currentColor; +} + +.admin-menu-panel { + position: absolute; + right: 1.6vh; + top: 50%; + transform: translateY(-50%); + display: flex; + flex-direction: column; + gap: 0.8vh; + width: 30.5vh; + max-height: min(82vh, calc(100vh - 3.2vh)); + box-sizing: border-box; + padding: 1vh; + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + background: linear-gradient(180deg, rgba(36, 36, 36, 0.98), rgba(22, 22, 22, 0.98)); + color: #F2F2F2; + font-family: "Poppins", sans-serif; + box-shadow: 0 2vh 5vh rgba(0, 0, 0, 0.45); + animation: fadeIn 0.16s ease-out; +} + +.admin-menu-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 1vh; +} + +.admin-menu-heading { + display: flex; + flex: 1; + min-width: 0; + flex-direction: column; +} + +.admin-menu-controls { + display: flex; + flex: 0 0 auto !important; + flex-direction: row !important; + align-items: center; + gap: 0.45vh; + flex-shrink: 0; + margin-left: auto; +} + +.admin-menu-title { + font-size: 1.55vh; + font-weight: 500; + line-height: 1.15; +} + +.admin-menu-subtitle { + font-size: 1.08vh; + line-height: 1.2; + color: rgba(242, 242, 242, 0.55); +} + +.admin-menu-close, +.admin-menu-dashboard { + display: flex; + align-items: center; + justify-content: center; + width: 2.55vh; + height: 2.55vh; + border: 0; + border-radius: 0.5vh; + background: rgba(242, 242, 242, 0.08); + color: #F2F2F2; + cursor: pointer; +} + +.admin-menu-dashboard { + border: 0.1vh solid #2E2E2C; +} + +.admin-menu-panel button:focus, +.admin-menu-panel button:focus-visible { + outline: none; + box-shadow: none; +} + +.admin-menu-dashboard:hover, +.admin-menu-close:hover { + background: rgba(242, 242, 242, 0.14); +} + +.admin-menu-dashboard.selected, +.admin-menu-close.selected { + background: rgba(251, 155, 4, 0.16); + color: #FB9B04; + box-shadow: inset 0 0 0 0.1vh rgba(251, 155, 4, 0.62); +} + +.admin-menu-close svg, +.admin-menu-dashboard svg { + width: 1.2vh; + height: 1.2vh; + fill: currentColor; +} + +.admin-menu-categories { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(7.6vh, 1fr)); + gap: 0.45vh; +} + +.admin-menu-categories button { + min-width: 0; + min-height: 2.8vh; + box-sizing: border-box; + padding: 0 0.6vh; + border: 0.1vh solid #2E2E2C; + border-radius: 0.28vh; + background: rgba(37, 37, 37, 0.58); + color: rgba(242, 242, 242, 0.72); + font-family: "Poppins", sans-serif; + font-size: 1.02vh; + font-weight: 600; + line-height: 1; + text-align: center; + text-transform: uppercase; + cursor: pointer; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.admin-menu-categories button:hover, +.admin-menu-categories button.active, +.admin-menu-categories button.selected { + border-color: rgba(251, 155, 4, 0.72); + background: rgba(251, 155, 4, 0.16); + color: #FB9B04; +} + +.admin-menu-categories button.selected { + box-shadow: inset 0 0 0 0.1vh rgba(251, 155, 4, 0.35); +} + +.admin-menu-categories button:active { + background: rgba(251, 155, 4, 0.24); + color: #F2F2F2; +} + +.admin-menu-actions { + display: flex; + flex-direction: column; + gap: 0.45vh; + max-height: min(59vh, calc(100vh - 15vh)); + overflow-y: auto; + padding: 0.1vh 0.25vh 0.1vh 0; +} + +.admin-menu-actions button, +.admin-menu-input-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.8vh; + min-width: 0; + width: 100%; + min-height: 3.55vh; + box-sizing: border-box; + padding: 0.68vh 0.9vh 0.68vh 1vh; + border: 0.1vh solid #2E2E2C; + border-radius: 0.32vh; + background: rgba(37, 37, 37, 0.6); + color: #F2F2F2; + font-family: "Poppins", sans-serif; + font-size: 1.16vh; + line-height: 1.15; + text-align: left; + cursor: pointer; +} + +.admin-menu-input-row { + align-items: stretch; + flex-direction: column; + justify-content: flex-start; + gap: 0.45vh; + min-height: auto; + padding: 0.75vh 0.9vh; + cursor: text; +} + +.admin-menu-actions button:hover, +.admin-menu-actions button.selected, +.admin-menu-input-row:hover, +.admin-menu-input-row.selected { + border-color: rgba(251, 155, 4, 0.65); + background: rgba(251, 155, 4, 0.12); +} + +.admin-menu-actions button.active { + border-color: #FB9B04; + background: rgba(251, 155, 4, 0.16); +} + +.admin-menu-actions button:disabled { + cursor: default; + opacity: 0.55; +} + +.admin-menu-actions button > span, +.admin-menu-input-row > span { + display: block; + flex: 1; + min-width: 0; + text-align: left; + overflow-wrap: anywhere; +} + +.admin-menu-input-row > span { + flex: none; + width: 100%; + color: rgba(242, 242, 242, 0.78); +} + +.admin-menu-input-row input { + min-width: 0; + width: 100%; + height: 2.9vh; + box-sizing: border-box; + border: 0.1vh solid rgba(242, 242, 242, 0.14); + border-radius: 0.22vh; + background: rgba(0, 0, 0, 0.22); + color: #F2F2F2; + font-family: "Poppins", sans-serif; + font-size: 1.08vh; + text-align: left; + outline: none; + padding: 0 0.65vh; +} + +.admin-menu-input-row input:focus { + border-color: #FB9B04; + background: rgba(0, 0, 0, 0.34); +} + +.admin-menu-actions button small { + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + min-width: 3.8vh; + min-height: 1.8vh; + padding: 0 0.6vh; + border: 0.1vh solid rgba(242, 242, 242, 0.12); + border-radius: 0.18vh; + background: rgba(242, 242, 242, 0.09); + color: rgba(242, 242, 242, 0.58); + font-size: 0.98vh; + font-weight: 600; + line-height: 1; + text-transform: uppercase; +} + +.admin-menu-actions button.active small { + border-color: #FB9B04; + background: #FB9B04; + color: #161616; +} + +.admin-menu-actions button .value-badge { + min-width: 5.2vh; + max-width: 12vh; + overflow: hidden; + text-overflow: ellipsis; + text-transform: none; +} + +.admin-menu-actions button .selector-badge { + justify-content: space-between; + gap: 0.45vh; + min-width: 7.6vh; +} + +.admin-menu-actions button .page-badge { + min-width: 2.4vh; + max-width: 2.4vh; + border-color: rgba(251, 155, 4, 0.72); + background: rgba(251, 155, 4, 0.16); + color: #FB9B04; + font-size: 1.2vh; +} + +.admin-menu-actions button:hover .page-badge, +.admin-menu-actions button.selected .page-badge { + background: #FB9B04; + color: #161616; +} + +.admin-menu-actions button .selector-badge span { + display: inline; + flex: 0 1 auto; + min-width: 0; + overflow: hidden; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; +} + +.admin-menu-actions button .selector-badge .selector-arrow { + flex: 0 0 auto; + color: rgba(242, 242, 242, 0.42); +} + +.admin-menu-back { + border-style: dashed !important; + color: rgba(242, 242, 242, 0.72) !important; +} + +.admin-menu-footer { + color: rgba(242, 242, 242, 0.45); + font-size: 1vh; + line-height: 1.25; + user-select: none; +} + +.admin-menu-section-label { + margin: 0.35vh 0 0.05vh; + color: rgba(242, 242, 242, 0.36); + font-size: 0.9vh; + font-weight: 600; + line-height: 1; + text-align: left; + text-transform: uppercase; +} + +.admin-menu-section-label:first-child { + margin-top: 0; +} + +/* SPINNER */ +.spinner-wrapper { + display: flex; + justify-content: center; + align-items: center; + height: 40vh; +} + +.spinner { + width: 4vh; + height: 4vh; + border: 0.4vh solid rgba(242, 242, 242, 0.2); + border-top: 0.4vh solid #fb9b04; + border-radius: 50%; + animation: spin 0.8s linear infinite; +} + +@keyframes spin { + to { + transform: rotate(360deg); + } +} + +@keyframes slideUp { + 0% { + opacity: 0; + transform: translateY(50%); + } + 100% { + opacity: 1; + transform: translateY(0%); + } +} + +@keyframes slideDown { + 0% { + opacity: 0; + transform: translateY(-50%); + } + 100% { + opacity: 1; + transform: translateY(0); + } +} + + +@keyframes fadeIn { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes sway { + 0% { + transform: translateY(0vh); + } + 50% { + transform: translateY(-0.2vh); + } + 100% { + transform: translateY(0vh); + } +} + +@keyframes fadeInSway { + 0% { opacity: 0; transform: translateY(0.2vh); } + 10% { opacity: 1; transform: translateY(0); } + 90% { opacity: 1; } + 100% { opacity: 1; transform: translateY(0.2vh); } +} + +@keyframes pulse { + 0% { + transform: scale(1); + opacity: 0.8; + } + 70% { + transform: scale(2.8); + opacity: 0; + } + 100% { + opacity: 0; + } +} diff --git a/[esx_addons]/esx_adminmenu/web/src/assets/testbg.png b/[esx_addons]/esx_adminmenu/web/src/assets/testbg.png new file mode 100644 index 00000000..02f62693 Binary files /dev/null and b/[esx_addons]/esx_adminmenu/web/src/assets/testbg.png differ diff --git a/[esx_addons]/esx_adminmenu/web/src/fivem.d.ts b/[esx_addons]/esx_adminmenu/web/src/fivem.d.ts new file mode 100644 index 00000000..36cc4525 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/fivem.d.ts @@ -0,0 +1 @@ +declare function GetParentResourceName(): string | undefined | null; \ No newline at end of file diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/DataComponent.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/DataComponent.svelte new file mode 100644 index 00000000..707506bb --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/DataComponent.svelte @@ -0,0 +1,13 @@ + + +
+ {#if icon} + {@const Icon = icon} + + {/if} + {content} +
diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Dropdown.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Dropdown.svelte new file mode 100644 index 00000000..dc1a4c1b --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Dropdown.svelte @@ -0,0 +1,154 @@ + + + (open = false)} /> + + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Notifications.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Notifications.svelte new file mode 100644 index 00000000..c741c67f --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Notifications.svelte @@ -0,0 +1,22 @@ + + +{#if notifications.items.length > 0} +
+ {#each notifications.items as item (item.id)} +
+ {item.message} + +
+ {/each} +
+{/if} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Sidebar.css b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Sidebar.css new file mode 100644 index 00000000..6fdbb8d9 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Sidebar.css @@ -0,0 +1,94 @@ +.sidebar { + width: 24vh; + display: flex; + flex-direction: column; + font-family: 'Poppins'; + font-style: normal; + font-weight: 600; + user-select: none; +} + +.sidebar button, +.sidebar input, +.sidebar select, +.sidebar textarea { + font-family: inherit; + font-weight: inherit; +} + +.accordion { + display: flex; + flex-direction: column; +} + +.header { + width: 100%; + height: 3.4vh; + padding: 1vh 1.5vh; + box-sizing: border-box; + display: flex; + align-items: center; + gap: 1vh; + background: transparent; + border: none; + cursor: pointer; + text-align: left; + border-radius: 0.4vh; + font-size: 1.3vh; + color: rgba(242, 242, 242, 0.5); + transition: background-color 50ms ease-in-out, color 50ms ease-in-out; +} + +.header.active { + color: #161616; + background: #FB9B04; +} + +.details { + display: flex; + flex-direction: column; + padding-left: 1vh; + height: auto; + border-left: solid #FB9B04 0.1vw; + margin-top: 1.2vh; +} + +.sub-button { + width: 100%; + height: 3.2vh; + display: flex; + align-items: center; + gap: 1vh; + padding: 1vh; + background: transparent; + border: none; + color: rgba(242, 242, 242, 0.5); + cursor: pointer; + text-align: left; + border-radius: 0.4vh; + font-size: 1.1vh; + transition: background-color 50ms ease-in-out, color 50ms ease-in-out; +} + +.sub-button.active { + background: rgba(255, 255, 255, 0.08); + color: #FB9B04; + background: rgba(252, 154, 3, 0.1); +} + +.sidebar-divider { + width: 100%; + height: 0.1vh; + background: rgba(242, 242, 242, 0.1); + margin-top: 0.9vh; + margin-bottom: 1vh; +} + +.sub-icon { + height: 1vh; + transition: fill 0.1s ease-in-out, stroke 0.1s ease-in-out; +} + +.sub-button.active .sub-icon { + fill: #FB9B04; +} \ No newline at end of file diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Sidebar.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Sidebar.svelte new file mode 100644 index 00000000..455a2291 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/Sidebar.svelte @@ -0,0 +1,86 @@ + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/TabContent.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/TabContent.svelte new file mode 100644 index 00000000..f59aea42 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/TabContent.svelte @@ -0,0 +1,41 @@ + + + { + if (e.key === "Tab") e.preventDefault(); + }} +/> + +
+
+ {#if currentPage.value === "dashboard_home"} + + {:else if currentPage.value === "ply_management"} + + {:else if currentPage.value === "ply_online"} + + {:else if currentPage.value === "ply_bans"} + + {:else if currentPage.value === "ply_vehicles"} + + {:else if currentPage.value === "ply_data"} + + {:else if currentPage.value === "ply_recent"} + + {:else if currentPage.value === "srv_management"} + + {:else} +

Page not found

+ {/if} +
+
diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/UpperDisplay.css b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/UpperDisplay.css new file mode 100644 index 00000000..040fe9b4 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/UpperDisplay.css @@ -0,0 +1,181 @@ +.upper-display-container { + display: flex; + align-items: center; + height: 3.8vh; + gap: 1vh; +} + +.menu-icon { + aspect-ratio: 1/1; + height: 100%; + animation: sway 1s ease-in-out infinite; +} + +.menu-titles { + display: flex; + flex-direction: column; + justify-content: center; + align-items: start; + user-select: none; +} + +.menu-title { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-size: 1.8vh; +} + +.menu-subtitle { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-size: 1.3vh; + line-height: 1.2vh; + color: rgba(242, 242, 242, 0.5); +} + +.data-components { + display: flex; + flex-direction: row; + align-items: center; + width: auto; + height: 3.9vh; + margin-left: auto; + gap: 0.8vh; +} + +.main-search-bar-container { + display: flex; + align-items: center; + gap: 1.5vh; + box-sizing: border-box; + padding: 0 1.6vh; + background: rgba(37, 37, 37, 0.3); + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + width: 37vh; + height: 100%; + color: #F2F2F2; + overflow: hidden; + user-select: none; +} + +.main-search-icon { + aspect-ratio: 1/1; + height: 1.3vh; +} + +.main-search-icon path { + stroke-opacity: 0.5; + transition: stroke-opacity 0.1s ease-in-out; +} + +.main-search-bar { + width: 100%; + max-height: 50%; + font-size: 1.3vh; + color: #F2F2F2; + font-family: 'Poppins'; + background: none; + border: none; + outline: none; + user-select: none; +} + +.main-search-bar::placeholder { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-size: 1.3vh; + color: rgba(242, 242, 242, 0.5); + transition: color 0.1s ease-in-out; + user-select: none; +} + +.main-search-bar-container:hover .main-search-bar::placeholder { + color: rgba(242, 242, 242, 0.7); +} + +.main-search-bar-container:focus .main-search-bar::placeholder { + color: rgba(242, 242, 242, 0.7); +} + +.main-search-bar-container:hover svg path { + stroke-opacity: 0.7; +} + +.data-component { + display: flex; + align-items: center; + justify-content: center; + padding: 0 1.4vh; + width: auto; + height: 100%; + background: rgba(37, 37, 37, 0.3); + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-size: 1.25vh; + gap: 1.5vh; + transition: padding 0.1s ease-in-out; + user-select: none; +} + +.data-component-icon { + height: 1.2vh; + width: auto; +} + +.data-component:hover { + padding: 0 1.8vh; +} + +.close-button { + display: flex; + align-items: center; + justify-content: center; + aspect-ratio: 1/1; + height: 100%; + border-radius: 0.5vh; + background: radial-gradient(50% 50% at 50% 50%, #C33535 0%, #F23F3F 100%); + transition: transform 50ms ease-in-out; + outline: none; + border: none; +} + +.switch-button { + display: flex; + align-items: center; + justify-content: center; + aspect-ratio: 1/1; + height: 100%; + border-radius: 0.5vh; + background: rgba(37, 37, 37, 0.3); + border: 0.1vh solid #2E2E2C; + color: #F2F2F2; + cursor: pointer; + transition: border 0.1s ease-in-out, background 0.1s ease-in-out; +} + +.switch-button:hover { + border-color: rgba(242, 242, 242, 0.4); + background: rgba(242, 242, 242, 0.08); +} + +.switch-button svg { + width: 1.7vh; + height: 1.7vh; + fill: currentColor; +} + +.close-icon { + aspect-ratio: 1/1; + height: 1.4vh; +} + +.close-button:active { + transform: translateY(0.1vh); +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/UpperDisplay.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/UpperDisplay.svelte new file mode 100644 index 00000000..22b2d7ba --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/UpperDisplay.svelte @@ -0,0 +1,59 @@ + + +
+ + + + + +
+ + + + + +
+
diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/CarIcon.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/CarIcon.svelte new file mode 100644 index 00000000..3ad7eb65 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/CarIcon.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/PlayersIcon.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/PlayersIcon.svelte new file mode 100644 index 00000000..361a64f3 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/PlayersIcon.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/ServerIcon.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/ServerIcon.svelte new file mode 100644 index 00000000..34fbb29e --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/ServerIcon.svelte @@ -0,0 +1,7 @@ + + + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/config/sidebar.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/config/sidebar.ts new file mode 100644 index 00000000..844e4d7c --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/config/sidebar.ts @@ -0,0 +1,29 @@ +import PlayersIcon from "../components/icons/PlayersIcon.svelte"; +import ServerIcon from "../components/icons/ServerIcon.svelte"; +import CarIcon from "../components/icons/CarIcon.svelte"; +import type { SidebarOption } from "../types/sidebar"; + +export const sidebarOptions: SidebarOption[] = [ + { + label: "Dashboard Home", + value: "dashboard_home", + icon: ServerIcon, + }, + { + label: "Player Management", + value: "ply_management", + icon: PlayersIcon, + subOptions: [ + { label: "Bans", value: "ply_bans", icon: PlayersIcon }, + { label: "Vehicles", value: "ply_vehicles", icon: CarIcon }, + { label: "Player Search", value: "ply_data", icon: PlayersIcon }, + { label: "Recent Players", value: "ply_recent", icon: PlayersIcon }, + ], + }, + { + label: "Server Management", + value: "srv_management", + icon: ServerIcon, + }, +]; + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/admin.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/admin.ts new file mode 100644 index 00000000..7732df1b --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/admin.ts @@ -0,0 +1,214 @@ +import { fetchNui } from "./fetchNUI"; +import { uiState } from "../stores/user.svelte"; +import type { Vehicle } from "../../tabs/players/types/vehicle"; +import type { Ban } from "../../tabs/players/types/ban"; +import type { ServerState } from "../types/server"; + +// Callback response type +export type NuiSuccess = { + success: boolean; + playerOnline?: boolean; + err?: string; + message?: string; + serverData?: ServerState; +}; + +type VehiclePageResponse = NuiSuccess & { + vehicles?: Vehicle[]; + hasMore?: boolean; + nextOffset?: number; +}; + +type BanPageResponse = NuiSuccess & { + bans?: Ban[]; + hasMore?: boolean; + nextOffset?: number; +}; + +export type RadioPlayer = { + id: number; + name: string; + char_identifier?: string | null; +}; + +type RadioPlayersResponse = NuiSuccess & { + players?: RadioPlayer[]; +}; + +const VEHICLE_PAGE_SIZE = 100; +const BAN_PAGE_SIZE = 100; + +// Admin Actions +export const bringPlayer = (playerId: number) => fetchNui("bring", { id: playerId }); + +export const gotoPlayer = (playerId: number) => fetchNui("goto", { id: playerId }); + +export const spectatePlayer = async (playerId: number) => { + const res = await fetchNui("spectate", { id: playerId }); + + if (res?.success) { + uiState.spectate(); + } +}; + +export const stopSpectate = (bool: boolean) => { + if (bool) { + uiState.stopSpectate(); + } +}; + +export const kickPlayer = async (playerId: number, reason?: string) => { + const res = await fetchNui("kick", { id: playerId, reason }); + + if (res && !res.playerOnline) { + uiState.removePlayer(playerId); + } +}; + +export const banPlayer = async (playerId: number, reason?: string, duration?: number) => { + const res = await fetchNui("ban", { id: playerId, reason, duration }); + + if (res && !res.playerOnline) { + uiState.removePlayer(playerId); + } +}; + +export const banOfflinePlayer = async (identifier: string, reason: string, duration?: number) => { + const res = await fetchNui("ban:offline", { identifier, reason, duration }); + + return res?.success ?? false; +}; + +export const changeBanExpiry = async (identifier: string, newDate?: number | null) => { + const res = await fetchNui("ban:changeExpiry", { identifier, newDate }); + + if (res?.success) { + uiState.updateBanExpiry(identifier, newDate); + } +}; + +export const revokeBan = async (identifier: string) => { + const res = await fetchNui("ban:revoke", { identifier }); + + if (res?.success) { + uiState.removeBan(identifier); + } +}; + +export const impoundVehicle = async (plate: string, impoundName: string) => { + const res = await fetchNui("vehicle:impound", { plate, impoundName }); + + if (res?.success) { + uiState.updateVehicleImpoundState(plate, true); + } +}; + +export const unimpoundVehicle = async (plate: string) => { + const res = await fetchNui("vehicle:unimpound", { plate }); + + if (res?.success) { + uiState.updateVehicleImpoundState(plate, false); + } +}; + +export const deleteVehicle = async (plate: string) => { + const res = await fetchNui("vehicle:delete", { plate }); + + if (res?.success) { + uiState.removeVehicle(plate); + } +}; + +export const notifyPlayer = (playerId: number, message: string) => { + return fetchNui("player:notify", { + id: playerId, + notificationContent: message, + notificationType: "info", + }); +}; + +export const runPlayerAction = (playerId: number | string | undefined, action: string, payload: Record = {}) => { + return fetchNui("player:action", { + id: playerId, + action, + payload, + }); +}; + +export const fetchVehiclePage = async (options: { reset?: boolean; search?: string } = {}) => { + if (uiState.vehicleLoading) return false; + if (!options.reset && !uiState.vehicleHasMore) return false; + + uiState.vehicleLoading = true; + + try { + const res = await fetchNui("getVehicles", { + offset: options.reset ? 0 : uiState.vehicleNextOffset, + limit: VEHICLE_PAGE_SIZE, + search: options.search ?? "", + }); + + if (!res?.success) return false; + + const vehicles = res.vehicles ?? []; + const hasMore = res.hasMore ?? false; + const nextOffset = res.nextOffset ?? (options.reset ? vehicles.length : uiState.vehicleNextOffset + vehicles.length); + + if (options.reset) { + uiState.setVehiclePage(vehicles, hasMore, nextOffset); + } else { + uiState.appendVehiclePage(vehicles, hasMore, nextOffset); + } + + return true; + } finally { + uiState.vehicleLoading = false; + } +}; + +export const fetchBanPage = async (options: { reset?: boolean } = {}) => { + if (uiState.banLoading) return false; + if (!options.reset && !uiState.banHasMore) return false; + + uiState.banLoading = true; + + try { + const res = await fetchNui("getBans", { + offset: options.reset ? 0 : uiState.banNextOffset, + limit: BAN_PAGE_SIZE, + }); + + if (!res?.success) return false; + + const bans = res.bans ?? []; + const hasMore = res.hasMore ?? false; + const nextOffset = res.nextOffset ?? (options.reset ? bans.length : uiState.banNextOffset + bans.length); + + if (options.reset) { + uiState.setBanPage(bans, hasMore, nextOffset); + } else { + uiState.appendBanPage(bans, hasMore, nextOffset); + } + + return true; + } finally { + uiState.banLoading = false; + } +}; + +export const runServerAction = (action: string, payload: Record = {}) => { + return fetchNui("server:action", { action, payload }); +}; + +export const runAdminMenuAction = (action: string, payload: Record = {}) => { + return fetchNui(`adminMenu:${action}`, payload); +}; + +export const getRadioChannelPlayers = async (channel: number) => { + const res = await fetchNui("server:radioPlayers", { channel }); + + return res?.success ? (res.players ?? []) : []; +}; + +// For requesting players (Don't think it is needed but will keep it here) +// export const requestPlayers = () => fetchNui("requestPlayers"); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/fetchNUI.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/fetchNUI.ts new file mode 100644 index 00000000..9cb4f780 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/fetchNUI.ts @@ -0,0 +1,43 @@ +import { isChromium } from "../util/util"; +import { notifications } from "../stores/notifications.svelte"; + +type NuiErrorResponse = { + success?: boolean; + err?: string; + error?: string; + message?: string; +}; + +function getErrorMessage(payload: NuiErrorResponse) { + return payload.err ?? payload.error ?? payload.message ?? "Action failed."; +} + +export async function fetchNui(event: string, data: unknown = {}): Promise { + try { + if (!isChromium()) return null; + + const res = await fetch(`https://${GetParentResourceName()}/${event}`, { + method: "POST", + headers: { + "Content-Type": "application/json; charset=UTF-8", + }, + body: JSON.stringify(data), + }); + + if (!res.ok) { + throw new Error(`[esx-adminmenu:NUI:${event}] Fetch failed: ${res.status}`); + } + + const payload = (await res.json()) as T; + + if (payload && typeof payload === "object" && "success" in payload && (payload as NuiErrorResponse).success === false) { + notifications.error(getErrorMessage(payload as NuiErrorResponse)); + } + + return payload; + } catch (err) { + console.error(`[esx-adminmenu:NUI:${event}]`, err); + notifications.error("The admin UI could not reach the client callback."); + return null; + } +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/handlers.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/handlers.ts new file mode 100644 index 00000000..230a7f52 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/handlers.ts @@ -0,0 +1,93 @@ +import { listenNui } from "./receiveNUI"; +import type { ServerState } from "../types/server"; +import { server } from "../stores/server.svelte"; +import type { Translations } from "../stores/translations.svelte"; +import { translations } from "../stores/translations.svelte"; +import { uiState } from "../stores/user.svelte"; +import type { VehicleSpawnerConfig } from "../stores/user.svelte"; +import { currentPage } from "../stores/navigation.svelte"; +import { stopSpectate } from "./admin"; +import { copyToClipboardChromium } from "../util/util"; +import type { Player } from "../../tabs/players/types/player"; +import type { Impound } from "../types/impounds"; + +type NuiMessage = + | { action: "initResource"; data: { translations: Translations; serverData: ServerState; impounds: Record; vehicleConfig?: VehicleSpawnerConfig } } + | { action: "openAdmin"; data: Player[] } + | { action: "openAdminDashboard"; data: { players: Player[]; serverData?: ServerState; selectedPlayerId?: number } } + | { action: "openAdminMenu"; data?: { serverData?: ServerState } } + | { action: "updateServerData"; data: ServerState } + | { action: "adminMenuState"; data: { action: string; active: boolean; value?: string } } + | { action: "updatePlayers"; data: Player[] } + | { action: "stopSpectate"; data: boolean } + | { action: "closeAdmin" } + | { action: "copyToClipboard"; data: string }; + +listenNui((msg) => { + switch (msg.action) { + case "initResource": + if (!msg.data) return; + + server.set(msg.data.serverData); + + if (msg.data.translations && Object.keys(msg.data.translations).length > 0) { + translations.set(msg.data.translations); + } + + uiState.setImpounds(msg.data.impounds ?? {}); + uiState.setVehicleConfig(msg.data.vehicleConfig); + break; + + case "openAdmin": + if (!msg.data) return null; + uiState.openDashboard(msg.data); + break; + + case "openAdminDashboard": + if (!msg.data) return null; + if (msg.data.serverData) { + server.set(msg.data.serverData); + } + uiState.openDashboard(msg.data.players ?? [], msg.data.selectedPlayerId ?? null); + if (msg.data.selectedPlayerId !== undefined) { + currentPage.set("ply_management"); + } + break; + + case "openAdminMenu": + if (msg.data?.serverData) { + server.set(msg.data.serverData); + } + uiState.openMenu(); + break; + + case "updateServerData": + if (!msg.data) return null; + server.set(msg.data); + break; + + case "adminMenuState": + if (!msg.data) return null; + uiState.setAdminMenuState(msg.data.action, msg.data.active); + uiState.setAdminMenuBadge(msg.data.action, msg.data.value); + break; + + case "updatePlayers": + if (!msg.data) return null; + uiState.setPlayers(msg.data); + break; + case "stopSpectate": + if (!msg.data) return null; + stopSpectate(msg.data); + break; + + case "closeAdmin": + uiState.close(); + break; + + case "copyToClipboard": + if (!msg.data) return null; + copyToClipboardChromium(msg.data); + break; + } +}); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/receiveNUI.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/receiveNUI.ts new file mode 100644 index 00000000..9dc5338f --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/receiveNUI.ts @@ -0,0 +1,32 @@ +import type { ServerState } from "../types/server"; +import type { Translations } from "../stores/translations.svelte"; +import type { Player } from "../../tabs/players/types/player"; +import type { VehicleSpawnerConfig } from "../stores/user.svelte"; + +type InitResourceData = { + translations: Translations; + serverData: ServerState; + vehicleConfig?: VehicleSpawnerConfig; +}; + +export type NuiMessage = + | { action: "initResource"; data: InitResourceData } + | { action: "openAdmin"; data: Player[] } + | { action: "openAdminDashboard"; data: { players: Player[]; serverData?: ServerState; selectedPlayerId?: number } } + | { action: "openAdminMenu"; data?: { serverData?: ServerState } } + | { action: "updateServerData"; data: ServerState } + | { action: "updatePlayers"; data: Player[] } + | { action: "closeAdmin"; data?: undefined }; + +export function listenNui( + handler: (message: T) => void +) { + const listener = (event: MessageEvent) => { + if (!event.data?.action) return; + handler(event.data); + }; + + window.addEventListener("message", listener); + + return () => window.removeEventListener("message", listener); +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/navigation.svelte.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/navigation.svelte.ts new file mode 100644 index 00000000..edf2f128 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/navigation.svelte.ts @@ -0,0 +1,9 @@ +export class CurrentPageStore { + value = $state("dashboard_home"); + + set(value: string) { + this.value = value; + } +} + +export const currentPage = new CurrentPageStore(); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/notifications.svelte.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/notifications.svelte.ts new file mode 100644 index 00000000..82e6241e --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/notifications.svelte.ts @@ -0,0 +1,46 @@ +export type NotificationType = "error" | "success" | "info"; + +export type NotificationItem = { + id: number; + type: NotificationType; + message: string; +}; + +const DEFAULT_TTL = 4500; + +export class NotificationStore { + items = $state([]); + #nextId = 1; + + push(message: string, type: NotificationType = "error", ttl = DEFAULT_TTL) { + const item = { + id: this.#nextId++, + type, + message, + }; + + this.items = [...this.items, item]; + + if (ttl > 0) { + window.setTimeout(() => this.dismiss(item.id), ttl); + } + } + + error(message: string) { + this.push(message, "error"); + } + + success(message: string) { + this.push(message, "success"); + } + + info(message: string) { + this.push(message, "info"); + } + + dismiss(id: number) { + this.items = this.items.filter((item) => item.id !== id); + } +} + +export const notifications = new NotificationStore(); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/server.svelte.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/server.svelte.ts new file mode 100644 index 00000000..929cb50d --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/server.svelte.ts @@ -0,0 +1,47 @@ +import type { ServerEnvironmentState, ServerState } from "../types/server"; + +const initialState: ServerState = { + currentPlayers: 0, + maxPlayers: 0, + uptimeSeconds: 0, + uptimeFormatted: "00:00:00", + environment: { + weather: "CLEAR", + hour: 12, + minute: 0, + blackout: false, + pvp: true, + }, +}; + +export class ServerStore { + currentPlayers = $state(initialState.currentPlayers); + maxPlayers = $state(initialState.maxPlayers); + uptimeSeconds = $state(initialState.uptimeSeconds); + uptimeFormatted = $state(initialState.uptimeFormatted); + weather = $state(initialState.environment?.weather ?? "CLEAR"); + hour = $state(initialState.environment?.hour ?? 12); + minute = $state(initialState.environment?.minute ?? 0); + blackout = $state(initialState.environment?.blackout ?? false); + pvp = $state(initialState.environment?.pvp ?? true); + + set(state: ServerState) { + this.currentPlayers = state.currentPlayers; + this.maxPlayers = state.maxPlayers; + this.uptimeSeconds = state.uptimeSeconds ?? 0; + this.uptimeFormatted = state.uptimeFormatted ?? initialState.uptimeFormatted; + this.setEnvironment(state.environment); + } + + setEnvironment(environment?: Partial | null) { + if (!environment) return; + + this.weather = environment.weather ?? this.weather; + this.hour = environment.hour ?? this.hour; + this.minute = environment.minute ?? this.minute; + this.blackout = environment.blackout ?? this.blackout; + this.pvp = environment.pvp ?? this.pvp; + } +} + +export const server = new ServerStore(); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/translations.svelte.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/translations.svelte.ts new file mode 100644 index 00000000..1c8f125b --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/translations.svelte.ts @@ -0,0 +1,208 @@ +export type Translations = Record; + +const defaultTranslations: Translations = { + admin_menu: "Admin Menu", + admin_dashboard: "Admin Dashboard", + dashboard_home: "Dashboard Home", + dashboard_snapshot: "Current server snapshot and player economy overview.", + admin_menu_desc: "Manage everything in your server", + quick_admin_menu: "Quick Admin Menu", + quick_actions: "Quick Actions", + open_admin_dashboard: "Open Admin Dashboard", + open_admin_menu: "Open Admin Menu", + admin_menu_self: "Self", + admin_menu_vehicle: "Vehicle", + admin_menu_utility: "Utility", + search_anything: "Search anything...", + server_online: "Server Online", + server_uptime: "Uptime", + players: "Players", + target: "Target", + search_player: "Search player...", + search_vehicle: "Search vehicle...", + search_banned_identifier: "Search banned identifier or ban reason...", + player_management: "Player Management", + players_list: "Players List", + vehicles_list: "Vehicles List", + player_search: "Player Search", + recent_players: "Recent Players", + no_players_found: "No players found...", + bans_list: "Bans List", + id: "ID", + name: "Name", + money: "Cash", + total_money: "Total Money", + avg_money: "Avg Money", + avg_money_per_player: "Avg Money / Player", + active_staff: "Active Staff", + non_staff: "Non Staff", + available_slots: "Available Slots", + money_distribution: "Money Distribution", + economy_summary: "Economy Summary", + median_money: "Median Money", + richest_player: "Richest Player", + avg_money_breakdown: "Avg Money Breakdown", + health_distribution: "Health Distribution", + avg_health: "Avg Health", + avg_armor: "Avg Armor", + player_counts: "Player Counts", + player_condition: "Player Condition", + staff_overview: "Staff Overview", + active_player_job_distribution: "Active Player Job Distribution", + top_jobs: "Top Jobs", + wealth_bands: "Wealth Bands", + bank_money: "Bank Money", + black_money: "Black Money", + health: "Health", + armor: "Armor", + last_visited: "Last visited", + gender: "Gender", + male: "Male", + female: "Female", + job: "Job", + job_grade: "Job Grade", + identifier: "Identifier", + ip_address: "IP Address", + char_identifier: "Character Identifier", + play_time: "Play Time", + position: "Position", + identifiers: "Identifiers", + routing_bucket: "Routing Bucket", + radio_channel: "Radio Channel", + thirst: "Thirst", + hunger: "Hunger", + player_information: "Player Information", + information: "Information", + teleport: "Teleport", + bring: "Bring", + spectate: "Spectate", + notify_player: "Notify Player", + notification_message: "Message", + give_money: "Give Cash", + take_money: "Take Cash", + set_health: "Set Health", + set_armor: "Set Armor", + clean_inventory: "Clean Inventory", + player_tools: "Player Tools", + kill_player: "Kill Player", + revive_player: "Revive Player", + freeze_player: "Freeze Player", + unfreeze_player: "Unfreeze Player", + set_model: "Set Model", + open_clothing: "Open Clothing", + give_all_weapons: "Give All Weapons", + set_bucket: "Set Bucket", + set_radio: "Set Radio", + set_job: "Set Job", + set_name: "Set Name", + set_thirst: "Set Thirst", + set_hunger: "Set Hunger", + ace_add: "Add ACE Group", + ace_remove: "Remove ACE Group", + model_name: "Model Name", + ace_group: "ACE Group", + first_name: "First Name", + last_name: "Last Name", + delete_character: "Delete Character", + troll_options: "Troll Options", + troll_burn: "Burn", + troll_explode: "Explode", + troll_sky: "Teleport to Sky", + troll_random: "Random Teleport", + troll_nausea: "Nausea", + noclip: "NoClip", + show_names: "Show Names", + show_blips: "Show Blips", + godmode: "Godmode", + invisible: "Invisible", + infinite_ammo: "Infinite Ammo", + revive: "Revive", + heal: "Heal", + spawn_vehicle: "Spawn Vehicle", + vehicle_spawner: "Vehicle Spawner", + vehicle_model: "Vehicle Model", + vehicle_color: "Vehicle Color", + primary_color: "Primary Color", + secondary_color: "Secondary Color", + customize_vehicle: "Customize Vehicle", + customize_vehicle_hint: "Use left and right arrows to change vehicle stages.", + spawn_tuned: "Spawn Tuned", + engine_level: "Engine", + brake_level: "Brakes", + transmission_level: "Transmission", + suspension_level: "Suspension", + vehicle_armor: "Vehicle Armor", + turbo: "Turbo", + xenon_lights: "Xenon", + neon_lights: "Neon", + neon_color: "Neon Color", + window_tint: "Window Tint", + wheel_category: "Wheel Category", + wheel_design: "Disc Design", + bulletproof_tires: "Bulletproof Tires", + apply_performance: "Apply Performance", + apply_customization: "Apply Customization", + max_performance: "Max Performance", + repair_vehicle: "Repair Vehicle", + clean_vehicle: "Clean Vehicle", + flip_vehicle: "Flip Vehicle", + teleport_waypoint: "Teleport Waypoint", + copy_coords: "Copy Coords", + delete_current_vehicle: "Delete Vehicle", + quick_menu_hint: "Arrow keys move, Tab changes tabs, Enter runs, Backspace closes.", + quick_menu_edit_hint: "Tab changes tabs, left/right change values, Enter selects.", + back: "Back", + kick: "Kick", + ban: "Ban", + never: "Never", + copied_to_clipboard: "Copied to clipboard", + online: "Online", + offline: "Offline", + on: "On", + off: "Off", + player: "Player:", + reason: "Reason", + kick_reason_placeholder: "Enter kick reason.", + ban_reason_placeholder: "Enter ban reason", + duration: "Duration", + minutes: "Minutes", + hours: "Hours", + days: "Days", + months: "Months", + years: "Years", + permanent: "Permanent", + duration_desc: "Not entering a duration bans the user permanently.", + cancel: "Cancel", + confirm: "Confirm", + escape_spectate: "Press [ESC] to stop spectating", + default_ban: "You are banned from this server!", + finalizing_connection: "Finalizing connection...", + banned_by: "Banned By", + banned_at: "Banned At", + expires_at: "Expires At", + change_expiry: "Change Expiry", + revoke: "Revoke", + new_expiry_date: "New Expiry Date", + plate: "Plate", + owner: "Owner", + vehicle_name: "Vehicle Name", + vehicle_type: "Vehicle Type", + mileage: "Mileage", + impounded: "Impounded", + copy_plate: "Copy Plate", + copy_owner: "Copy Owner", + impound: "Impound", + unimpound: "Unimpound", + delete_vehicle: "Delete Vehicle", + select_impound: "Select Impound", +}; + +export class TranslationState { + values = $state(defaultTranslations); + + set(translations: Translations) { + this.values = translations; + } +} + +export const translations = new TranslationState(); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/user.svelte.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/user.svelte.ts new file mode 100644 index 00000000..f361d56c --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/user.svelte.ts @@ -0,0 +1,268 @@ +import type { Player } from "../../tabs/players/types/player"; +import type { Ban } from "../../tabs/players/types/ban"; +import { generateDummyPlayers, generateDummyBans, generateDummyVehicles } from "../util/generateDummyData"; +import type { Vehicle } from "../../tabs/players/types/vehicle"; +import { isChromium } from "../util/util"; +import type { Impound } from "../types/impounds"; + +export type VehicleColorPreset = { + id: string; + label: string; + primary: number; + secondary?: number; +}; + +export type VehicleSpawnerConfig = { + defaultModel: string; + defaultColor: string; + colorPresets: VehicleColorPreset[]; + neonPresets: Array<{ id: string; label: string; r: number; g: number; b: number }>; + windowTints: Array<{ id: number; label: string }>; + wheelCategories: Array<{ id: string; label: string; type: number }>; + wheelDesigns: Array<{ id: number; label: string }>; +}; + +export const dummyImpounds: Record = { + city_impound: { + getOutPoint: { x: 408.9, y: -1625.2, z: 29.3 }, + spawnPoint: { x: 401.2, y: -1631.5, z: 29.3, heading: 228.5 }, + sprite: 357, + scale: 0.8, + colour: 3, + cost: 3000, + }, + + sandy_impound: { + getOutPoint: { x: 1738.5, y: 3710.1, z: 34.1 }, + spawnPoint: { x: 1729.9, y: 3707.4, z: 34.2, heading: 21.2 }, + sprite: 357, + scale: 0.8, + colour: 5, + cost: 2500, + }, + + paleto_impound: { + getOutPoint: { x: -234.5, y: 6198.2, z: 31.5 }, + spawnPoint: { x: -230.1, y: 6205.6, z: 31.5, heading: 135.0 }, + sprite: 357, + scale: 0.8, + colour: 2, + cost: 2000, + }, +}; + +export const dummyVehicleConfig: VehicleSpawnerConfig = { + defaultModel: "sultan", + defaultColor: "black", + colorPresets: [ + { id: "black", label: "Black", primary: 0, secondary: 0 }, + { id: "white", label: "White", primary: 111, secondary: 111 }, + { id: "red", label: "Red", primary: 27, secondary: 27 }, + { id: "orange", label: "Orange", primary: 38, secondary: 38 }, + { id: "blue", label: "Blue", primary: 64, secondary: 64 }, + ], + neonPresets: [ + { id: "white", label: "White", r: 255, g: 255, b: 255 }, + { id: "orange", label: "Orange", r: 251, g: 155, b: 4 }, + { id: "red", label: "Red", r: 255, g: 32, b: 32 }, + { id: "blue", label: "Blue", r: 32, g: 128, b: 255 }, + ], + windowTints: [ + { id: 0, label: "None" }, + { id: 1, label: "Pure Black" }, + { id: 2, label: "Dark Smoke" }, + { id: 3, label: "Light Smoke" }, + { id: 4, label: "Stock" }, + { id: 5, label: "Limo" }, + ], + wheelCategories: [ + { id: "sport", label: "Sport", type: 0 }, + { id: "muscle", label: "Muscle", type: 1 }, + { id: "lowrider", label: "Lowrider", type: 2 }, + { id: "suv", label: "SUV", type: 3 }, + { id: "offroad", label: "Offroad", type: 4 }, + { id: "tuner", label: "Tuner", type: 5 }, + { id: "bike", label: "Bike", type: 6 }, + { id: "highend", label: "High End", type: 7 }, + { id: "street", label: "Street", type: 11 }, + { id: "track", label: "Track", type: 12 }, + ], + wheelDesigns: [ + { id: -1, label: "Stock" }, + ...Array.from({ length: 20 }, (_, index) => ({ id: index, label: String(index + 1) })), + ], +}; + +export class UIState { + visible = $state(!isChromium()); + mode = $state<"dashboard" | "menu">("dashboard"); + adminMenuStates = $state>({}); + adminMenuBadges = $state>({}); + spectating = $state(false); + players = $state(isChromium() ? null : generateDummyPlayers(200)); + recentPlayers = $state(isChromium() ? null : generateDummyPlayers(20)); + focusPlayerId = $state(null); + bans = $state(isChromium() ? null : generateDummyBans(200)); + banNextOffset = $state(isChromium() ? 0 : 200); + banHasMore = $state(isChromium()); + banLoading = $state(false); + vehicles = $state(isChromium() ? null : generateDummyVehicles(200)); + vehicleNextOffset = $state(isChromium() ? 0 : 200); + vehicleHasMore = $state(isChromium()); + vehicleLoading = $state(false); + impounds = $state | null>(isChromium() ? null : dummyImpounds); + vehicleConfig = $state(dummyVehicleConfig); + + openDashboard(players: Player[], focusPlayerId?: number | null) { + this.visible = true; + this.mode = "dashboard"; + this.spectating = false; + this.players = players; + this.focusPlayerId = focusPlayerId ?? null; + this.bans = null; + this.resetBans(); + this.resetVehicles(); + } + + open(players: Player[]) { + this.openDashboard(players); + } + + openMenu() { + this.visible = true; + this.mode = "menu"; + this.spectating = false; + } + + setAdminMenuState(action: string, active: boolean) { + this.adminMenuStates = { ...this.adminMenuStates, [action]: active }; + } + + setAdminMenuBadge(action: string, value?: string | null) { + if (!value) return; + this.adminMenuBadges = { ...this.adminMenuBadges, [action]: value }; + } + + close() { + this.visible = false; + } + + spectate() { + this.spectating = true; + this.visible = false; + } + + stopSpectate() { + this.spectating = false; + this.visible = true; + this.mode = "dashboard"; + } + + setPlayers(players: Player[]) { + this.players = players; + } + + setRecentPlayers(players: Player[]) { + this.recentPlayers = players; + } + + clearFocusPlayer() { + this.focusPlayerId = null; + } + + setVehicles(vehicles: Vehicle[]) { + this.vehicles = vehicles; + } + + setVehiclePage(vehicles: Vehicle[], hasMore: boolean, nextOffset: number) { + this.vehicles = vehicles; + this.vehicleHasMore = hasMore; + this.vehicleNextOffset = nextOffset; + } + + appendVehiclePage(vehicles: Vehicle[], hasMore: boolean, nextOffset: number) { + this.vehicles = [...(this.vehicles ?? []), ...vehicles]; + this.vehicleHasMore = hasMore; + this.vehicleNextOffset = nextOffset; + } + + resetVehicles() { + this.vehicles = null; + this.vehicleNextOffset = 0; + this.vehicleHasMore = true; + this.vehicleLoading = false; + } + + setBans(bans: Ban[]) { + this.bans = bans; + } + + setBanPage(bans: Ban[], hasMore: boolean, nextOffset: number) { + this.bans = bans; + this.banHasMore = hasMore; + this.banNextOffset = nextOffset; + } + + appendBanPage(bans: Ban[], hasMore: boolean, nextOffset: number) { + this.bans = [...(this.bans ?? []), ...bans]; + this.banHasMore = hasMore; + this.banNextOffset = nextOffset; + } + + resetBans() { + this.bans = null; + this.banNextOffset = 0; + this.banHasMore = true; + this.banLoading = false; + } + + setImpounds(impounds: Record) { + this.impounds = impounds; + } + + setVehicleConfig(config?: Partial | null) { + if (!config) return; + + this.vehicleConfig = { + defaultModel: config.defaultModel ?? dummyVehicleConfig.defaultModel, + defaultColor: config.defaultColor ?? dummyVehicleConfig.defaultColor, + colorPresets: config.colorPresets?.length ? config.colorPresets : dummyVehicleConfig.colorPresets, + neonPresets: config.neonPresets?.length ? config.neonPresets : dummyVehicleConfig.neonPresets, + windowTints: config.windowTints?.length ? config.windowTints : dummyVehicleConfig.windowTints, + wheelCategories: config.wheelCategories?.length ? config.wheelCategories : dummyVehicleConfig.wheelCategories, + wheelDesigns: config.wheelDesigns?.length ? config.wheelDesigns : dummyVehicleConfig.wheelDesigns, + }; + } + + removePlayer(playerId: number) { + if (!this.players) return; + + this.players = this.players.filter((p) => p.id !== playerId); + } + + updateBanExpiry(identifier: string, newDate?: number | null) { + if (!this.bans) return; + + this.bans = this.bans.map((b) => (b.identifier === identifier ? { ...b, expires_at: newDate } : b)); + } + + removeBan(identifier: string) { + if (!this.bans) return; + + this.bans = this.bans.filter((b) => b.identifier !== identifier); + } + + updateVehicleImpoundState(plate: string, state: boolean) { + if (!this.vehicles) return; + + this.vehicles = this.vehicles.map((v) => (v.plate === plate ? { ...v, impounded: state } : v)); + } + + removeVehicle(plate: string) { + if (!this.vehicles) return; + + this.vehicles = this.vehicles.filter((v) => v.plate !== plate); + } +} + +export const uiState = new UIState(); diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/impounds.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/impounds.ts new file mode 100644 index 00000000..c3f867d4 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/impounds.ts @@ -0,0 +1,18 @@ +export interface Vector3 { + x: number; + y: number; + z: number; +} + +export interface SpawnPoint extends Vector3 { + heading: number; +} + +export interface Impound { + getOutPoint: Vector3; + spawnPoint: SpawnPoint; + sprite?: number; + scale?: number; + colour?: number; + cost?: number; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/server.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/server.ts new file mode 100644 index 00000000..7fb2462e --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/server.ts @@ -0,0 +1,15 @@ +export interface ServerEnvironmentState { + weather: string; + hour: number; + minute: number; + blackout: boolean; + pvp: boolean; +} + +export interface ServerState { + currentPlayers: number; + maxPlayers: number; + uptimeSeconds: number; + uptimeFormatted: string; + environment?: Partial; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/sidebar.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/sidebar.ts new file mode 100644 index 00000000..59303936 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/types/sidebar.ts @@ -0,0 +1,8 @@ +import type { Component } from "svelte"; + +export type SidebarOption = { + label: string; + value: string; + icon?: Component | undefined | null; + subOptions?: SidebarOption[]; +}; \ No newline at end of file diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/formatter.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/formatter.ts new file mode 100644 index 00000000..87fa3a09 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/formatter.ts @@ -0,0 +1,79 @@ +import { t } from "$lib/shared/util/util"; +import type { Vector3 } from "../../tabs/players/types/player"; +import type { PlayTime } from "../../tabs/players/types/player"; + +const nf = new Intl.NumberFormat("de-DE"); +export const formatMoney = (n: number = 0) => nf.format(n); + +export function formatLastVisited(timestamp?: number | null, neverText?: string | null) { + if (!timestamp) return neverText ?? "Never"; + + const date = new Date(timestamp); + + return date.toLocaleString(undefined, { + year: "numeric", + month: "short", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + }); +} + +export function formatPlayTime(pt: PlayTime) { + return `${pt.days}d ${pt.hours}h ${pt.minutes}m`; +} + +export function formatDuration(totalSeconds: number) { + const seconds = Math.max(0, Math.floor(totalSeconds)); + const days = Math.floor(seconds / 86400); + const hours = Math.floor((seconds % 86400) / 3600); + const minutes = Math.floor((seconds % 3600) / 60); + + if (days > 0) return `${days}d ${hours}h ${minutes}m`; + if (hours > 0) return `${hours}h ${minutes}m`; + if (minutes > 0) return `${minutes}m`; + + return "<1m"; +} + +export function formatPosition(position?: Vector3) { + if (!position) return "Unknown"; + + return `X: ${position.x.toFixed(2)} Y: ${position.y.toFixed(2)} Z: ${position.z.toFixed(2)}`; +} + +export function formatName(name: string, max = 24) { + if (name.length <= max) return name; + return name.slice(0, max - 3) + "..."; +} + +export function getTimestampMs(timestamp?: number | string | null) { + if (timestamp === null || timestamp === undefined || timestamp === "") return null; + + if (typeof timestamp === "number") { + if (timestamp <= 0) return null; + return timestamp < 1_000_000_000_000 ? timestamp * 1000 : timestamp; + } + + const trimmed = timestamp.trim(); + if (trimmed === "" || trimmed.startsWith("0000-00-00")) return null; + + const numeric = Number(trimmed); + if (Number.isFinite(numeric)) return getTimestampMs(numeric); + + const parsed = Date.parse(trimmed.includes("T") ? trimmed : trimmed.replace(" ", "T")); + return Number.isFinite(parsed) && parsed > 0 ? parsed : null; +} + +export function formatDate(timestamp?: number | string | null, emptyText = t("permanent")) { + const timestampMs = getTimestampMs(timestamp); + if (timestampMs === null) return emptyText; + + const d = new Date(timestampMs); + + const day = String(d.getDate()).padStart(2, "0"); + const month = String(d.getMonth() + 1).padStart(2, "0"); + const year = d.getFullYear(); + + return `${day}/${month}/${year}`; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/generateDummyData.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/generateDummyData.ts new file mode 100644 index 00000000..9215d3ec --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/generateDummyData.ts @@ -0,0 +1,126 @@ +import type { Ban } from "../../tabs/players/types/ban"; +import type { Player } from "../../tabs/players/types/player"; +import type { Vehicle } from "../../tabs/players/types/vehicle"; + +const names = ["John Doe", "Jane Doe", "Ryan Reynolds", "John Wick", "Michael Scott", "Walter White", "Tony Stark", "Bruce Wayne", "Arthur Morgan", "Geralt of Rivia", "Tom Shelby", "Joel Miller"]; + +const banReasons = ["Cheating", "Exploiting", "RDM", "VDM", "Toxic behavior", "Mass rule violation", "Ban evasion", "Unauthorized modifications", "Abuse of bugs"]; + +const adminNames = ["Orbit", "System", "Console", "AntiCheat", "Moderator01", "SeniorAdmin"]; + +const vehicleNames = [ + { name: "Sultan RS", type: "sports" }, + { name: "Elegy Retro", type: "sports" }, + { name: "Baller", type: "suv" }, + { name: "Granger", type: "suv" }, + { name: "Buffalo STX", type: "muscle" }, + { name: "Dominator", type: "muscle" }, + { name: "Futo GTX", type: "compact" }, + { name: "T20", type: "super" }, + { name: "Kuruma", type: "sedan" }, + { name: "Sandking XL", type: "offroad" }, +]; + +function generatePlate(): string { + const letters = () => String.fromCharCode(65 + Math.floor(Math.random() * 26)); + const numbers = () => Math.floor(Math.random() * 10); + + return `${letters()}${letters()}${letters()}-${numbers()}${numbers()}${numbers()}`; +} + +export function generateDummyPlayers(count: number): Player[] { + return Array.from({ length: count }, (_, i) => { + const name = names[i % names.length]; + const status: Player["status"] = Math.random() > 0.5 ? "online" : "offline"; + + const basePlayer = { + name, + status, + + cash: Math.floor(Math.random() * 10_000), + bank: Math.floor(Math.random() * 1_000_000), + alt_money: Math.floor(Math.random() * 500_000), + + last_join: Date.now() - Math.floor(Math.random() * 1000 * 60 * 60 * 24 * 30), + + char_identifier: `char1:${Math.random().toString(16).slice(2)}`, + identifier: `license:${Math.random().toString(16).slice(2)}`, + + job: "Unemployed", + job_grade: "Unknown", + gender: Math.random() > 0.5 ? "m" : "f", + + play_time: { + days: Math.floor(Math.random() * 30), + hours: Math.floor(Math.random() * 24), + minutes: Math.floor(Math.random() * 60), + }, + + position: { + x: Math.random() * 4000 - 2000, + y: Math.random() * 4000 - 2000, + z: Math.random() * 100, + }, + }; + + if (status === "offline") { + return basePlayer as Player; + } + + // online-only fields + return { + ...basePlayer, + id: i + 1, + health: Math.floor(Math.random() * 100), + armor: Math.floor(Math.random() * 100), + } as Player; + }); +} + +export function generateDummyBans(count: number): Ban[] { + return Array.from({ length: count }, (_, i) => { + const now = Date.now(); + + const permanent = Math.random() > 0.7; + const durationDays = Math.floor(Math.random() * 30) + 1; + + const bannedAt = Math.max(1, now - Math.floor(Math.random() * 1000 * 60 * 60 * 24 * 60)); + + return { + id: i + 1, + + identifier: `license:${Math.random().toString(16).slice(2)}`, + + reason: banReasons[Math.floor(Math.random() * banReasons.length)], + + banned_by: adminNames[Math.floor(Math.random() * adminNames.length)], + + banned_at: bannedAt, + + expires_at: permanent ? null : bannedAt + durationDays * 24 * 60 * 60 * 1000, + + permanent, + }; + }); +} + +export function generateDummyVehicles(count: number): Vehicle[] { + return Array.from({ length: count }, () => { + const vehicle = vehicleNames[Math.floor(Math.random() * vehicleNames.length)]; + + const hasOwner = Math.random() > 0.2; + const impounded = Math.random() > 0.8; + + return { + owner: hasOwner ? `license:${Math.random().toString(16).slice(2)}` : undefined, + + plate: generatePlate(), + + type: vehicle.type, + name: vehicle.name, + + mileage: Math.random() > 0.1 ? Math.floor(Math.random() * 200_000) : null, + impounded, + }; + }); +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/util.ts b/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/util.ts new file mode 100644 index 00000000..25dc3ecf --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/util/util.ts @@ -0,0 +1,43 @@ +import { translations } from "$lib/shared/stores/translations.svelte"; + +type NuiWindow = Window & { + invokeNative?: unknown; +}; + +export const isChromium = (): boolean => typeof (window as NuiWindow).invokeNative === "function"; + +export const t = (key: string | null | undefined, fallback?: string): string => { + if (!key) return fallback ?? ""; + + return translations.values[key] ?? fallback ?? key; +}; + +export const copyToClipboardChromium = (text: string, timeout = 50): void => { + if (!document.body) return; + + const textarea = document.createElement("textarea"); + textarea.value = text; + + textarea.style.position = "fixed"; + textarea.style.top = "-9999px"; + textarea.style.left = "-9999px"; + textarea.setAttribute("readonly", ""); + + document.body.appendChild(textarea); + + textarea.focus(); + textarea.select(); + textarea.setSelectionRange(0, textarea.value.length); + + try { + document.execCommand("copy"); + } catch (err) { + console.error("Clipboard fallback failed:", err); + } + + setTimeout(() => { + if (textarea.parentNode) { + textarea.parentNode.removeChild(textarea); + } + }, timeout); +}; diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/AdminMenu.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/AdminMenu.svelte new file mode 100644 index 00000000..e74066e2 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/AdminMenu.svelte @@ -0,0 +1,679 @@ + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/adminMenuConfig.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/adminMenuConfig.ts new file mode 100644 index 00000000..455347b3 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/adminMenuConfig.ts @@ -0,0 +1,199 @@ +import type { VehicleSpawnerConfig } from "$lib/shared/stores/user.svelte"; +import type { AdminMenuValueKey, AdminMenuValuesState } from "./adminMenuValues.svelte"; + +export type AdminMenuValues = AdminMenuValuesState; + +export type AdminMenuOption = { + value: string | number | boolean; + label: string; +}; + +export type AdminMenuCategory = { + id: string; + labelKey: string; + page: string; +}; + +export type AdminMenuItem = + | { type: "section"; id: string; labelKey: string } + | { type: "back"; id: string; labelKey: string; page: string } + | { type: "page"; id: string; labelKey: string; page: string } + | { type: "action"; id: string; labelKey: string; event: string; badge?: "toggle" | "value"; payload?: (values: AdminMenuValues) => Record } + | { type: "input"; id: string; labelKey: string; valueKey: AdminMenuValueKey; placeholder?: string; event?: string; payload?: (values: AdminMenuValues) => Record } + | { + type: "option" | "toggle"; + id: string; + labelKey: string; + valueKey: AdminMenuValueKey; + options?: AdminMenuOption[]; + event?: string; + payload?: (values: AdminMenuValues) => Record; + }; + +export type AdminMenuPage = { + id: string; + titleKey: string; + subtitleKey: string; + categoryId?: string; + parentPage?: string; + items: AdminMenuItem[]; +}; + +export const adminMenuCategories: AdminMenuCategory[] = [ + { id: "self", labelKey: "admin_menu_self", page: "self" }, + { id: "vehicle", labelKey: "admin_menu_vehicle", page: "vehicle" }, + { id: "utility", labelKey: "admin_menu_utility", page: "utility" }, +]; + +export const defaultAdminMenuPage = adminMenuCategories[0]?.page ?? "self"; + +const levelOptions: AdminMenuOption[] = [1, 2, 3, 4, 5].map((value) => ({ + value, + label: `${value}/5`, +})); + +const item = { + section(id: string, labelKey: string): AdminMenuItem { + return { type: "section", id, labelKey }; + }, + back(page: string): AdminMenuItem { + return { type: "back", id: "back", labelKey: "back", page }; + }, + page(id: string, labelKey: string, page: string): AdminMenuItem { + return { type: "page", id, labelKey, page }; + }, + action(id: string, labelKey: string, event: string, options: Pick, "badge" | "payload"> = {}): AdminMenuItem { + return { type: "action", id, labelKey, event, ...options }; + }, + input(id: string, labelKey: string, valueKey: AdminMenuValueKey, options: Pick, "placeholder" | "event" | "payload"> = {}): AdminMenuItem { + return { type: "input", id, labelKey, valueKey, ...options }; + }, + option( + id: string, + labelKey: string, + valueKey: AdminMenuValueKey, + choices: AdminMenuOption[], + event?: string, + payload?: (values: AdminMenuValues) => Record + ): AdminMenuItem { + return { type: "option", id, labelKey, valueKey, options: choices, event, payload }; + }, + toggle(id: string, labelKey: string, valueKey: AdminMenuValueKey, event?: string, payload?: (values: AdminMenuValues) => Record): AdminMenuItem { + return { type: "toggle", id, labelKey, valueKey, event, payload }; + }, +}; + +function customizationPayload(values: AdminMenuValues) { + return values.customizationPayload(); +} + +export function createAdminMenuPages(config: VehicleSpawnerConfig): Record { + const colorOptions = config.colorPresets.map((preset) => ({ value: preset.id, label: preset.label })); + const neonOptions = config.neonPresets.map((preset) => ({ value: preset.id, label: preset.label })); + const tintOptions = config.windowTints.map((tint) => ({ value: tint.id, label: tint.label })); + const wheelCategoryOptions = config.wheelCategories.map((category) => ({ value: category.id, label: category.label })); + const wheelDesignOptions = config.wheelDesigns.map((design) => ({ value: design.id, label: design.label })); + + return { + root: { + id: "root", + titleKey: "admin_menu_self", + subtitleKey: "quick_actions", + categoryId: "self", + items: [ + item.action("noclip", "noclip", "adminMenu:noclip", { badge: "toggle" }), + item.action("names", "show_names", "adminMenu:names", { badge: "toggle" }), + item.action("blips", "show_blips", "adminMenu:blips", { badge: "toggle" }), + item.action("godmode", "godmode", "adminMenu:godmode", { badge: "toggle" }), + item.action("invisible", "invisible", "adminMenu:invisible", { badge: "toggle" }), + item.action("infiniteAmmo", "infinite_ammo", "adminMenu:infiniteAmmo", { badge: "toggle" }), + item.action("revive", "revive", "adminMenu:revive"), + item.action("heal", "heal", "adminMenu:heal"), + item.action("armor", "armor", "adminMenu:armor"), + item.action("waypoint", "teleport_waypoint", "adminMenu:waypoint"), + ], + }, + self: { + id: "self", + titleKey: "admin_menu_self", + subtitleKey: "quick_actions", + categoryId: "self", + items: [ + item.action("noclip", "noclip", "adminMenu:noclip", { badge: "toggle" }), + item.action("names", "show_names", "adminMenu:names", { badge: "toggle" }), + item.action("blips", "show_blips", "adminMenu:blips", { badge: "toggle" }), + item.action("godmode", "godmode", "adminMenu:godmode", { badge: "toggle" }), + item.action("invisible", "invisible", "adminMenu:invisible", { badge: "toggle" }), + item.action("infiniteAmmo", "infinite_ammo", "adminMenu:infiniteAmmo", { badge: "toggle" }), + item.action("revive", "revive", "adminMenu:revive"), + item.action("heal", "heal", "adminMenu:heal"), + item.action("armor", "armor", "adminMenu:armor"), + item.action("waypoint", "teleport_waypoint", "adminMenu:waypoint"), + ], + }, + vehicle: { + id: "vehicle", + titleKey: "admin_menu_vehicle", + subtitleKey: "quick_actions", + categoryId: "vehicle", + items: [ + item.page("spawnVehiclePage", "spawn_vehicle", "spawn"), + item.page("customizeVehiclePage", "customize_vehicle", "customize"), + item.action("repair", "repair_vehicle", "adminMenu:repairVehicle"), + item.action("clean", "clean_vehicle", "adminMenu:cleanVehicle"), + item.action("flip", "flip_vehicle", "adminMenu:flipVehicle"), + item.action("delete", "delete_current_vehicle", "adminMenu:deleteVehicle"), + ], + }, + utility: { + id: "utility", + titleKey: "admin_menu_utility", + subtitleKey: "quick_actions", + categoryId: "utility", + items: [ + item.action("copyCoords", "copy_coords", "adminMenu:copyCoords"), + ], + }, + spawn: { + id: "spawn", + titleKey: "spawn_vehicle", + subtitleKey: "vehicle_model", + categoryId: "vehicle", + parentPage: "vehicle", + items: [ + item.input("spawnModel", "vehicle_model", "spawnModel", { + placeholder: config.defaultModel, + event: "adminMenu:spawnVehicle", + payload: (values) => values.spawnPayload(), + }), + item.option("spawnColor", "vehicle_color", "spawnColor", colorOptions), + item.toggle("spawnMaxPerformance", "spawn_tuned", "spawnMaxPerformance"), + ], + }, + customize: { + id: "customize", + titleKey: "customize_vehicle", + subtitleKey: "customize_vehicle_hint", + categoryId: "vehicle", + parentPage: "vehicle", + items: [ + item.option("engineLevel", "engine_level", "engineLevel", levelOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("brakeLevel", "brake_level", "brakeLevel", levelOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("transmissionLevel", "transmission_level", "transmissionLevel", levelOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("suspensionLevel", "suspension_level", "suspensionLevel", levelOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("armorLevel", "vehicle_armor", "armorLevel", levelOptions, "adminMenu:customizeVehicle", customizationPayload), + item.toggle("turbo", "turbo", "turbo", "adminMenu:customizeVehicle", customizationPayload), + item.toggle("xenon", "xenon_lights", "xenon", "adminMenu:customizeVehicle", customizationPayload), + item.toggle("neon", "neon_lights", "neon", "adminMenu:customizeVehicle", customizationPayload), + item.option("neonColor", "neon_color", "neonColor", neonOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("vehicleColor", "primary_color", "vehicleColor", colorOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("secondaryColor", "secondary_color", "secondaryColor", colorOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("windowTint", "window_tint", "windowTint", tintOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("wheelCategory", "wheel_category", "wheelCategory", wheelCategoryOptions, "adminMenu:customizeVehicle", customizationPayload), + item.option("wheelDesign", "wheel_design", "wheelDesign", wheelDesignOptions, "adminMenu:customizeVehicle", customizationPayload), + item.toggle("bulletproofTires", "bulletproof_tires", "bulletproofTires", "adminMenu:customizeVehicle", customizationPayload), + item.action("maxPerformance", "max_performance", "adminMenu:maxVehiclePerformance", { badge: "value" }), + ], + }, + }; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/adminMenuValues.svelte.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/adminMenuValues.svelte.ts new file mode 100644 index 00000000..65a07017 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-menu/adminMenuValues.svelte.ts @@ -0,0 +1,116 @@ +import type { VehicleSpawnerConfig } from "$lib/shared/stores/user.svelte"; + +export type AdminMenuValueKey = + | "spawnModel" + | "spawnColor" + | "spawnMaxPerformance" + | "engineLevel" + | "brakeLevel" + | "transmissionLevel" + | "suspensionLevel" + | "armorLevel" + | "turbo" + | "xenon" + | "neon" + | "neonColor" + | "vehicleColor" + | "secondaryColor" + | "windowTint" + | "wheelCategory" + | "wheelDesign" + | "bulletproofTires"; + +export class AdminMenuValuesState { + spawnModel = $state(""); + spawnColor = $state(""); + spawnMaxPerformance = $state(false); + engineLevel = $state(1); + brakeLevel = $state(1); + transmissionLevel = $state(1); + suspensionLevel = $state(1); + armorLevel = $state(1); + turbo = $state(false); + xenon = $state(false); + neon = $state(false); + neonColor = $state(""); + vehicleColor = $state(""); + secondaryColor = $state(""); + windowTint = $state(0); + wheelCategory = $state(""); + wheelDesign = $state(-1); + bulletproofTires = $state(false); + + constructor(config: VehicleSpawnerConfig) { + this.reset(config); + } + + reset(config: VehicleSpawnerConfig) { + this.spawnModel = config.defaultModel; + this.spawnColor = config.defaultColor; + this.spawnMaxPerformance = false; + this.engineLevel = 1; + this.brakeLevel = 1; + this.transmissionLevel = 1; + this.suspensionLevel = 1; + this.armorLevel = 1; + this.turbo = false; + this.xenon = false; + this.neon = false; + this.neonColor = config.neonPresets[0]?.id ?? "white"; + this.vehicleColor = config.defaultColor; + this.secondaryColor = config.defaultColor; + this.windowTint = config.windowTints[0]?.id ?? 0; + this.wheelCategory = config.wheelCategories[0]?.id ?? "sport"; + this.wheelDesign = config.wheelDesigns[0]?.id ?? -1; + this.bulletproofTires = false; + } + + get(key: AdminMenuValueKey) { + return this[key]; + } + + set(key: AdminMenuValueKey, value: string | number | boolean) { + (this[key] as string | number | boolean) = value; + } + + applyMaxPerformance() { + this.engineLevel = 5; + this.brakeLevel = 5; + this.transmissionLevel = 5; + this.suspensionLevel = 5; + this.armorLevel = 5; + this.turbo = true; + } + + spawnPayload() { + return { + model: this.spawnModel, + color: this.spawnColor, + primaryColor: this.spawnColor, + secondaryColor: this.spawnColor, + maxPerformance: this.spawnMaxPerformance, + deleteCurrent: true, + }; + } + + customizationPayload() { + return { + engineLevel: this.engineLevel, + brakeLevel: this.brakeLevel, + transmissionLevel: this.transmissionLevel, + suspensionLevel: this.suspensionLevel, + armorLevel: this.armorLevel, + turbo: this.turbo, + xenon: this.xenon, + neon: this.neon, + neonColor: this.neonColor, + color: this.vehicleColor, + primaryColor: this.vehicleColor, + secondaryColor: this.secondaryColor, + windowTint: this.windowTint, + wheelCategory: this.wheelCategory, + wheelDesign: this.wheelDesign, + bulletproofTires: this.bulletproofTires, + }; + } +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/dashboard/DashboardHome.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/dashboard/DashboardHome.svelte new file mode 100644 index 00000000..b7defb75 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/dashboard/DashboardHome.svelte @@ -0,0 +1,552 @@ + + +
+
+
+
+

{t("dashboard_home")}

+ {t("active_staff")}: {activeStaff} +
+ {t("dashboard_snapshot")} +
+
+ +
+
+ {t("players")} + {onlineCount}/{maxPlayers} +
+
+
+ {t("total_money")} + ${formatMoney(totalMoney)} +
+
+ {t("avg_money_per_player")} + ${formatMoney(averageMoney)} +
+
+ {t("avg_health")} + {averageHealth}/100 +
+
+ {t("avg_armor")} + {averageArmor}/100 +
+
+ +
+
+
+

{t("player_counts")}

+ {onlineCount} online +
+
+ + +
+ {@render BarList(playerRows)} +
+ +
+
+

{t("money_distribution")}

+ ${formatMoney(totalMoney)} +
+
+ {#each moneyBuckets as bucket} + + {/each} +
+ {@render BarList(moneyBuckets)} +
+ +
+
+

{t("economy_summary")}

+ {players.length} players +
+ {@render BarList(economyRows)} +
+ +
+
+

{t("avg_money_breakdown")}

+ ${formatMoney(averageMoney)} +
+ {@render BarList(averageMoneyRows)} +
+ +
+
+

{t("player_condition")}

+ {players.length} sampled +
+ {@render BarList(healthRows)} +
+ +
+
+

{t("staff_overview")}

+ {Math.round(staffPercent)}% +
+ {@render BarList(staffRows)} +
+ +
+
+

{t("active_player_job_distribution")}

+ {players.length} players +
+ {@render BarList(jobRows)} +
+ +
+
+

{t("wealth_bands")}

+ {players.length} players +
+ {@render BarList(wealthRows)} +
+
+
+ +{#snippet BarList(rows: ChartRow[])} +
+ {#each rows as row} +
+ {row.label} +
+ {row.display} +
+ {/each} +
+{/snippet} + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/OnlinePlayers.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/OnlinePlayers.svelte new file mode 100644 index 00000000..4ff5041e --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/OnlinePlayers.svelte @@ -0,0 +1,85 @@ + + +
+ {t("players_list")} +
+ + + + +
+
+
+ + + + + + {t("health")} + {t("armor")} + +
+
+ +
diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerBans.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerBans.svelte new file mode 100644 index 00000000..820d89f4 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerBans.svelte @@ -0,0 +1,136 @@ + + +
+ {t("bans_list")} +
+ + + + +
+
+ +
+ + + + + + +
+ +
+ +
+ + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerManagement.css b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerManagement.css new file mode 100644 index 00000000..8f2dd0cf --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerManagement.css @@ -0,0 +1,128 @@ +.top-bar { + display: flex; + justify-content: space-between; + align-items: center; + gap: 1.2vh; + flex-wrap: wrap; + font-size: 2vh; + height: auto; + margin-bottom: 1.6vh; +} + +.players-title { + font-family: 'Poppins'; + font-style: normal; + font-weight: 500; + font-size: 2.2vh; +} + +.player-search-bar-container { + display: flex; + align-items: center; + gap: 1.5vh; + box-sizing: border-box; + padding: 0 1.6vh; + background: rgba(37, 37, 37, 0.3); + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + width: min(37vh, 100%); + min-width: 22vh; + height: 3.8vh; + color: #F2F2F2; + overflow: hidden; + user-select: none; +} + +.player-search-icon { + aspect-ratio: 1/1; + height: 1.3vh; +} + +.player-search-icon path { + stroke-opacity: 0.5; + transition: stroke-opacity 0.1s ease-in-out; +} + +.player-search-bar { + width: 100%; + max-height: 50%; + font-size: 1.3vh; + color: #F2F2F2; + font-family: 'Poppins'; + background: none; + border: none; + outline: none; + user-select: none; +} + +.player-search-bar::placeholder { + font-family: 'Poppins'; + font-style: normal; + font-weight: 400; + font-size: 1.3vh; + color: rgba(242, 242, 242, 0.5); + transition: color 0.1s ease-in-out; + user-select: none; +} + +.player-search-bar-container:hover .player-search-bar::placeholder { + color: rgba(242, 242, 242, 0.7); +} + +.player-search-bar-container:focus .player-search-bar::placeholder { + color: rgba(242, 242, 242, 0.7); +} + +.player-search-bar-container:hover svg path { + stroke-opacity: 0.7; +} + +.ply-table-header { + display: grid; + grid-template-columns: 7vh 1.4fr repeat(6, 1fr); + padding: 0.8vh 1.3vh 0.9vh; + font-family: 'Poppins'; + font-size: 1.3vh; + font-weight: 500; + color: rgba(242, 242, 242, 0.72); +} + +.ply-table-header span { + user-select: none; + min-width: 0; + max-width: 90%; + word-break: break-word; + white-space: normal; +} + +.ply-table-header button { + all: unset; + display: flex; + align-items: center; + justify-content: start; + background: none; + border: none; + outline: none; + padding: 0; + margin: 0; + font-family: 'Poppins'; + font-size: 1.3vh; + font-weight: 500; + color: #F2F2F2; + cursor: pointer; + user-select: none; + min-width: 0; + max-width: 90%; + word-break: break-word; + white-space: normal; +} + +.ply-table-header button:hover { + color: #FB9B04; +} + +.list-wrapper { + height: calc(100% - 9.4vh); + min-height: 0; + overflow: hidden; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerSearch.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerSearch.svelte new file mode 100644 index 00000000..3ea9c839 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerSearch.svelte @@ -0,0 +1,130 @@ + + +
+ + {t("search_player")} + + +
+ + + + + e.key === "Enter" && searchPlayer()} tabindex="-1" class="player-search-bar" /> +
+
+ +{#if loading} +
+
+
+{:else if filteredResults.length > 0} +
+ + + + + + {t("health")} + {t("armor")} + +
+
+ +
+{:else if hasSearched} +
{t("no_players_found")}
+{/if} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerVehicles.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerVehicles.svelte new file mode 100644 index 00000000..cd83bdab --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/PlayerVehicles.svelte @@ -0,0 +1,152 @@ + + +
+ + {t("vehicles_list")} + + +
+ + + + + +
+
+ +
+ + + + + + + + + + + +
+ +
+ +
+ + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/RecentPlayers.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/RecentPlayers.svelte new file mode 100644 index 00000000..f803d5cf --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/RecentPlayers.svelte @@ -0,0 +1,51 @@ + + +
+ {t("recent_players")} +
+ + + + +
+
+ +
+ {t("id")} + {t("name")} + {t("money")} + {t("bank_money")} + {t("black_money")} + {t("health")} + {t("armor")} + {t("last_visited")} +
+ +
+ +
diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/Actions.css b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/Actions.css new file mode 100644 index 00000000..185ae8cc --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/Actions.css @@ -0,0 +1,654 @@ +/* Context Menu CSS */ +.context-menu { + position: absolute; + background: linear-gradient( + 180deg, + rgba(36, 36, 36, 0.98), + rgba(26, 26, 26, 0.98) + ); + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + min-width: 20vh; + max-width: 28vh; + padding: 0.5vh; + z-index: 999; + width: auto; + height: auto; + overflow: visible; + box-sizing: border-box; + animation: fadeIn 0.1s ease-in-out forwards; + box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.45); +} + +.context-title { + font-weight: 600; + padding: 0.6vh; + border-bottom: 1px solid #333; + margin-bottom: 4px; + max-width: 100%; + overflow-wrap: anywhere; + word-break: break-word; + box-sizing: border-box; + line-height: 1.25; +} + +.context-title-stacked { + display: flex; + flex-direction: column; + gap: 0.25vh; +} + +.context-title-stacked small { + color: rgba(242, 242, 242, 0.72); + font-size: 1.05vh; + font-weight: 500; + line-height: 1.25; + overflow-wrap: anywhere; +} + +.menu-item { + all: unset; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-start; + gap: 1vh; + padding: 0.6vh; + width: 100%; + background: none; + border: none; + text-align: left; + cursor: pointer; + border-radius: 0.5vh; + color: #F2F2F2; + line-height: 1.2; +} + +.menu-item:hover { + color: #161616; + background: #FB9B04; +} + +.menu-item.has-submenu { + justify-content: space-between; +} + +.menu-item.has-submenu.active { + color: #fb9b04; + background: rgba(251, 155, 4, 0.12); +} + +.menu-item.has-submenu svg { + width: 1vh; + height: 1vh; +} + +.context-submenu { + position: absolute; + left: calc(100% + 0.7vh); + top: -0.1vh; + display: flex; + flex-direction: column; + gap: 0.2vh; + min-width: 20vh; + max-width: 28vh; + max-height: min(70vh, calc(100vh - 2vh)); + overflow-y: auto; + padding: 0.5vh; + border: 0.1vh solid #2E2E2C; + border-radius: 0.5vh; + background: linear-gradient( + 180deg, + rgba(36, 36, 36, 0.98), + rgba(26, 26, 26, 0.98) + ); + box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.45); + box-sizing: border-box; + animation: fadeIn 0.1s ease-in-out forwards; +} + +.menu-item svg { + aspect-ratio: 1/1; + width: auto; + height: 1.4vh; + fill: currentColor; +} + +.menu-item.danger { + color: #ff6b6b; +} + +.menu-item.danger:hover { + background: #ff6b6b; +} + +.menu-item.danger:hover { + color: #161616; +} + +/* Information Tab CSS */ +.info-panel { + position: absolute; + min-width: 35vh; + width: auto; + max-width: min(64vh, calc(100vw - 4vh)); + max-height: min(78vh, calc(100vh - 4vh)); + background: linear-gradient( + 180deg, + rgba(36, 36, 36, 0.99), + rgba(26, 26, 26, 0.99) + ); + border: 0.1vh solid #2e2e2c; + border-radius: 0.7vh; + z-index: 100; + box-shadow: 0 1vh 2vh rgba(0, 0, 0, 0.45); + animation: fadeIn 0.1s ease-in-out; + padding: 0.5vh; + box-sizing: border-box; + overflow: hidden; +} + +.info-header { + cursor: grab; + padding: 1vh; + font-weight: 600; + display: flex; + gap: 1vh; + align-items: center; + border-bottom: 0.1vh solid #333; + user-select: none; + border-radius: 0.5vh; +} + +.info-header:hover { + background: rgba(255, 255, 255, 0.1); +} + +.info-header:active { + cursor: grabbing; +} + +.info-close { + all: unset; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + opacity: 0.6; + height: 2vh; + aspect-ratio: 1/1; + border-radius: 0.4vh; + padding: 0.1vh; + margin-left: auto; +} + +.info-close svg { + height: 75%; + aspect-ratio: 1/1; +} + +.info-close:hover { + opacity: 1; + background: #F23F3F; +} + +.info-content { + padding: 0.5vh; + display: grid; + gap: 0.5vh; + font-size: 0.92em; + max-height: calc(min(78vh, 100vh - 4vh) - 5.5vh); + overflow-y: auto; +} + +.info-row { + display: flex; + justify-content: space-between; + padding: 0.5vh 1vh; + border-radius: 0.4vh; + transition: background-color 0.1s ease-in-out; + box-sizing: border-box; + width: auto; + height: auto; +} + +.info-row:hover { + background: rgba(255, 255, 255, 0.1); +} + +.info-section-title { + margin: 0.5vh 0 0.2vh; + padding: 0 1vh; + color: rgba(242, 242, 242, 0.42); + font-size: 0.9vh; + font-weight: 600; + text-transform: uppercase; +} + +.info-label { + width: auto; + min-width: fit-content; + color: #9a9a9a; + margin-right: 5vh; +} + +.info-value { + color: #f2f2f2; + font-weight: 500; + width: auto; + max-width: 40vh; + line-break: anywhere; + height: auto; +} + +.clipboard-feedback { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 1vh; + width: 100%; + text-align: center; + bottom: 0.6vh; + right: 0.6vh; + color: #F2F2F2; + font-size: 1vh; + padding: 0.4vh 0.6vh; + border-radius: 0.4vh; + pointer-events: none; + animation: fadeInSway 1s ease-in-out forwards; +} + +.clipboard-feedback svg { + aspect-ratio: 1/1; + width: auto; + height: 1.4vh; + fill: currentColor; +} + +.online-badge { + display: inline-flex; + align-items: center; + gap: 0.7vh; + padding: 0.2vh 1vh; + font-size: 1vh; + width: auto; + border-radius: 0.5vh; + color: #ffffff; + border: solid 0.1vh rgba(0, 255, 89, 0.25); +} + +.online-dot { + position: relative; + width: 0.6vh; + height: 0.59vh; + border-radius: 100%; + background: #00ff59; + flex-shrink: 0; +} + +.online-dot::after { + content: ""; + position: absolute; + inset: 0; + border-radius: 100%; + background: rgba(0, 255, 89, 0.8); + animation: pulse 1.5s ease-out infinite; +} + +.offline-badge { + display: inline-flex; + align-items: center; + gap: 0.5vh; + padding: 0.2vh 0.8vh; + font-size: 1vh; + width: auto; + border-radius: 0.5vh; + color: #ffffff; + border: solid 0.1vh rgba(255, 0, 21, 0.25); +} + +.offline-dot { + position: relative; + width: 0.6vh; + aspect-ratio: 1/1; + height: auto; + border-radius: 100%; + background: #ff0000; + flex-shrink: 0; +} + +.offline-dot::after { + content: ""; + position: absolute; + inset: 0; + border-radius: 100%; + background: rgb(255, 0, 21, 0.8); + animation: pulse 1.5s ease-out infinite; +} + +/* Confirm Action CSS */ + +.confirm-modal-backdrop { + position: fixed; + inset: 0; + background: rgba(0, 0, 0, 0.6); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +} + +.confirm-modal { + min-width: 35vh; + width: min(44vh, calc(100vw - 4vh)); + max-height: min(78vh, calc(100vh - 4vh)); + padding: 1.5vh; + background-color: #161616; + border: 0.2vh solid #2f2f2f; + border-radius: 0.8vh; + box-shadow: 0 1vh 3vh rgba(0, 0, 0, 0.5); + color: #f1f1f1; + font-size: 1.2vh; + animation: slideUp 0.25s ease-in-out forwards; + overflow: hidden; +} + +.confirm-modal-header { + margin-bottom: 1.1vh; +} + +.confirm-modal-title { + font-size: 1.6vh; + font-weight: 600; + line-height: 1.25; + overflow-wrap: anywhere; + word-break: break-word; +} + +.confirm-modal-subtitle { + margin-top: 0.25vh; + font-size: 1.1vh; + opacity: 0.65; +} + +.confirm-modal-body { + margin-bottom: 2vh; + max-height: 54vh; + overflow-y: auto; + padding-right: 0.2vh; +} + +.confirm-field { + display: flex; + flex-direction: column; + margin-bottom: 1vh; +} + +.confirm-label { + margin-bottom: 0.4vh; + font-size: 1.2vh; + opacity: 0.85; +} + +.confirm-input { + background: #151515; + border: 0.1vh solid #333; + border-radius: 0.5vh; + padding: 0vh 0.6vh; + height: 3vh; + color: #fff; + font-size: 1.2vh; + font-family: 'Poppins'; + font-weight: 500; +} + +.confirm-input:focus { + outline: solid 0.1vh #fb9b04; + outline-offset: -0.2vh; +} + +.confirm-input::placeholder { + font-size: 1.1vh; + opacity: 0.5; +} + +.duration-input { + flex: 1; +} + +.confirm-duration-row { + display: flex; + justify-content: space-between; + gap: 1vh; +} + +.confirm-hint { + margin-top: 0.5vh; + font-size: 1.1vh; + opacity: 0.5; +} + +.confirm-dropdown { + position: relative; + width: 10.5vh; +} + +.lg-dropdown { + width: 100%; + height: 3vh; +} + +.confirm-dropdown-trigger { + width: 100%; + background: #151515; + border: 0.1vh solid #333; + border-radius: 0.5vh; + padding: 0vh 0.6vh; + height: 100%; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 1.2vh; + color: #fff; + cursor: pointer; + font-family: 'Poppins'; +} + +.confirm-dropdown-trigger:focus { + outline: solid 0.1vh #fb9b04; + outline-offset: -0.2vh; +} + +.confirm-dropdown-arrow { + width: 0.7vh; + height: auto; + aspect-ratio: 1/1; + flex-shrink: 0; + transition: transform 0.25s ease, fill 0.25s ease; + color: #F2F2F2; +} + +.confirm-dropdown-arrow.open { + transform: rotate(180deg); + color: #fb9b04; +} + +.confirm-dropdown-menu { + position: absolute; + margin-top: 0.5vh; + left: 0; + right: 0; + background: #1a1a1a; + border: 0.1vh solid #333; + border-radius: 0.6vh; + overflow: hidden; + max-height: 0; + opacity: 0; + transform: translateY(0vh); + transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.25s ease; + z-index: 10; +} + +.confirm-dropdown-menu.open { + max-height: 30vh; + opacity: 1; + transform: translateY(0); +} + +.confirm-dropdown-item { + all: unset; + box-sizing: border-box; + display: block; + width: 100%; + padding: 0.6vh; + font-size: 1.2vh; + cursor: pointer; + font-family: 'Poppins'; +} + +.confirm-dropdown-item:hover { + background: #242424; +} + +.confirm-dropdown-item.selected { + background: rgba(251, 155, 4, 0.15); + color: #fb9b04; +} + +.date-picker { + display: flex; + flex-direction: column; + gap: 0.7vh; + width: 100%; +} + +.date-picker-header { + display: grid; + grid-template-columns: 3vh minmax(0, 1fr) 3vh; + align-items: center; + gap: 0.6vh; +} + +.date-picker-header span { + text-align: center; + color: #F2F2F2; + font-size: 1.25vh; + font-weight: 500; +} + +.date-picker-header button, +.date-picker-grid button { + display: flex; + align-items: center; + justify-content: center; + border: 0.1vh solid #2E2E2C; + border-radius: 0.45vh; + background: rgba(37, 37, 37, 0.6); + color: #F2F2F2; + font-family: "Poppins", sans-serif; + cursor: pointer; +} + +.date-picker-header button { + width: 3vh; + height: 3vh; +} + +.date-picker-header svg { + width: 1.2vh; + height: 1.2vh; + fill: currentColor; +} + +.date-picker-weekdays, +.date-picker-grid { + display: grid; + grid-template-columns: repeat(7, minmax(0, 1fr)); + gap: 0.45vh; +} + +.date-picker-weekdays span { + text-align: center; + color: rgba(242, 242, 242, 0.45); + font-size: 1vh; +} + +.date-picker-grid button { + aspect-ratio: 1/1; + min-width: 0; + font-size: 1.05vh; +} + +.date-picker-grid button:hover:not(:disabled), +.date-picker-header button:hover { + border-color: rgba(251, 155, 4, 0.65); +} + +.date-picker-grid button.muted { + color: rgba(242, 242, 242, 0.35); +} + +.date-picker-grid button.selected { + border-color: #FB9B04; + background: rgba(251, 155, 4, 0.16); + color: #FB9B04; +} + +.date-picker-grid button:disabled { + cursor: default; + opacity: 0.35; +} + +.confirm-actions { + display: flex; + gap: 1vh; +} + +.confirm-btn { + flex: 1; + padding: 0.6vh 1.4vh; + border-radius: 0.4vh; + border: none; + font-size: 1.2vh; + cursor: pointer; + font-family: 'Poppins'; + font-weight: 600; + transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease; +} + +.confirm-btn.cancel { + background: rgba(255, 255, 255, 0.25); + color: #F2F2F2; +} + +.confirm-btn.confirm { + background: #fb9b04; + color: #161616; +} + +.confirm-btn:hover { + transform: translateY(-0.12vh); + box-shadow: 0 0.6vh 1.2vh rgba(0, 0, 0, 0.35); +} + +.confirm-btn:active { + transform: translateY(0); + filter: brightness(0.9); +} + +.confirm-input::placeholder::selection { + background: #FB9B04; + color: #161616; +} + +.confirm-input::selection { + background: #FB9B04; + color: #161616; +} + +.confirm-input[type="date"]::-moz-selection { + background: #FB9B04; + color: #161616; +} + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/BansList.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/BansList.svelte new file mode 100644 index 00000000..1fa80424 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/BansList.svelte @@ -0,0 +1,119 @@ + + +{#if filteredBans.length > 0} + + {#snippet vl_slot({ item })} + {@const ban = item as Ban} +
openMenu(e, ban)}> + #{ban.id} + {ban.identifier} + {ban.reason} + {ban.banned_by ?? "-"} + {formatDate(ban.banned_at, "-")} + {formatDate(ban.expires_at)} +
+ {/snippet} +
+ {#if loading} +
Loading bans...
+ {/if} +{/if} + + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/ConfirmAction.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/ConfirmAction.svelte new file mode 100644 index 00000000..edb31ed3 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/ConfirmAction.svelte @@ -0,0 +1,386 @@ + + + { + if (!open || openedAt === null) return; + if (Date.now() - openedAt < 1000) return; + + cancel(); + }} + onkeydown={(e) => { + if (e.key !== "Escape") return; + if (!open || openedAt === null) return; + if (Date.now() - openedAt < 1000) return; + + cancel(); + }} +/> + +{#if open} +
+ +
+{/if} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/ContextMenu.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/ContextMenu.svelte new file mode 100644 index 00000000..568499bd --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/ContextMenu.svelte @@ -0,0 +1,675 @@ + + + + +{#if open && value} + +{/if} + + { + if (!confirmType || !tempValue) return; + + try { + switch (confirmType) { + case "kick": + await kickPlayer(Number((tempValue as Player).id), data.reason); + break; + + case "ban": + if ((tempValue as Player).status === "online") { + await banPlayer(Number((tempValue as Player).id), data.reason, data.duration ?? undefined); + } else { + const identifier = (tempValue as Player).identifier; + if (identifier) { + await banOfflinePlayer(identifier, data.reason ?? "", data.duration ?? undefined); + } + } + break; + + case "notify": + await notifyPlayer(Number((tempValue as Player).id), data.reason ?? ""); + break; + + case "give_money": + await runPlayerAction((tempValue as Player).id, "giveMoney", { amount: data.amount, account: "money" }); + break; + + case "take_money": + await runPlayerAction((tempValue as Player).id, "takeMoney", { amount: data.amount, account: "money" }); + break; + + case "set_health": + await runPlayerAction((tempValue as Player).id, "setHealth", { amount: data.amount }); + break; + + case "set_armor": + await runPlayerAction((tempValue as Player).id, "setArmor", { amount: data.amount }); + break; + + case "clean_inventory": + await runPlayerAction((tempValue as Player).id, "cleanInventory"); + break; + + case "kill_player": + await runPlayerAction((tempValue as Player).id, "killPlayer"); + break; + + case "revive_player": + await runPlayerAction((tempValue as Player).id, "revivePlayer"); + break; + + case "freeze_player": + await runPlayerAction((tempValue as Player).id, "freezePlayer", { enabled: true }); + break; + + case "unfreeze_player": + await runPlayerAction((tempValue as Player).id, "freezePlayer", { enabled: false }); + break; + + case "set_model": + await runPlayerAction((tempValue as Player).id, "setModel", { model: data.text }); + break; + + case "open_clothing": + await runPlayerAction((tempValue as Player).id, "openClothing"); + break; + + case "give_all_weapons": + await runPlayerAction((tempValue as Player).id, "giveAllWeapons"); + break; + + case "set_bucket": + await runPlayerAction((tempValue as Player).id, "setRoutingBucket", { bucket: data.amount }); + break; + + case "set_radio": + await runPlayerAction((tempValue as Player).id, "setRadio", { channel: data.amount }); + break; + + case "set_job": + await runPlayerAction((tempValue as Player).id, "setJob", { job: data.text, grade: data.amount ?? 0 }); + break; + + case "set_name": + await runPlayerAction((tempValue as Player).id, "setName", { firstName: data.text, lastName: data.secondaryText }); + break; + + case "set_thirst": + await runPlayerAction((tempValue as Player).id, "setThirst", { amount: data.amount }); + break; + + case "set_hunger": + await runPlayerAction((tempValue as Player).id, "setHunger", { amount: data.amount }); + break; + + case "ace_add": + await runPlayerAction((tempValue as Player).id, "aceAdd", { group: data.text }); + break; + + case "ace_remove": + await runPlayerAction((tempValue as Player).id, "aceRemove", { group: data.text }); + break; + + case "delete_character": + if ((tempValue as Player).char_identifier) { + await runPlayerAction((tempValue as Player).id, "deleteCharacter", { identifier: (tempValue as Player).char_identifier }); + } + break; + + case "troll_burn": + await runPlayerAction((tempValue as Player).id, "troll", { trollAction: "burn" }); + break; + + case "troll_explode": + await runPlayerAction((tempValue as Player).id, "troll", { trollAction: "explode" }); + break; + + case "troll_sky": + await runPlayerAction((tempValue as Player).id, "troll", { trollAction: "sky" }); + break; + + case "troll_random": + await runPlayerAction((tempValue as Player).id, "troll", { trollAction: "randomTeleport" }); + break; + + case "troll_nausea": + await runPlayerAction((tempValue as Player).id, "troll", { trollAction: "nausea" }); + break; + + case "change_expiry": + await changeBanExpiry((tempValue as Ban).identifier, data.newDate); + break; + + case "revoke": + await revokeBan((tempValue as Ban).identifier); + break; + + case "delete_vehicle": + await deleteVehicle((tempValue as Vehicle).plate); + break; + + case "impound_vehicle": + if (!data.impoundName) return; + await impoundVehicle((tempValue as Vehicle).plate, data.impoundName); + break; + } + } catch (e) { + console.error("Confirm action failed", e); + } finally { + closeConfirm(); + } + }} +/> diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/DatePicker.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/DatePicker.svelte new file mode 100644 index 00000000..c92f800a --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/DatePicker.svelte @@ -0,0 +1,105 @@ + + +
+
+ + {monthLabel} + +
+ +
+ {#each weekdays as day} + {day} + {/each} +
+ +
+ {#each days as day (day.key)} + + {/each} +
+
diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/PlayerInformation.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/PlayerInformation.svelte new file mode 100644 index 00000000..f7d20f2d --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/PlayerInformation.svelte @@ -0,0 +1,222 @@ + + +{#if open && player} +
e.stopPropagation()} onkeydown={(e) => e.stopPropagation()} role="dialog" aria-label={t("player_information")} tabindex="-1"> + +
+ {#if player.status === "online"} + {@render InfoRow({ label: t("id"), value: player.id })} + {/if} + {#if player.identifier} + {@render InfoRow({ label: t("identifier"), value: player.identifier })} + {/if} + {#if player.ip} + {@render InfoRow({ label: t("ip_address"), value: player.ip })} + {/if} + {#if player.status === "online"} + {@render InfoRow({ label: t("routing_bucket"), value: player.routing_bucket ?? 0 })} + {@render InfoRow({ label: t("radio_channel"), value: player.radio_channel ?? 0 })} + {/if} + {#if player.char_identifier} + {@render InfoRow({ label: t("char_identifier"), value: player.char_identifier })} + {/if} + {@render InfoRow({ label: t("name"), value: formatName(player.name) })} + {@render InfoRow({ + label: t("gender"), + value: player.gender === "m" ? t("male") : t("female"), + })} + + {@render InfoRow({ label: t("job"), value: player.job ?? "Unknown" })} + {@render InfoRow({ label: t("job_grade"), value: player.job_grade ?? "Unknown" })} + + {@render InfoRow({ label: t("money"), value: `$${formatMoney(player.cash)}` })} + {@render InfoRow({ label: t("bank_money"), value: `$${formatMoney(player.bank)}` })} + {@render InfoRow({ label: t("black_money"), value: `$${formatMoney(player.alt_money)}` })} + + {#if player.status === "online"} + {@render InfoRow({ label: t("position"), value: formatPosition(player.position) })} + {@render InfoRow({ label: t("health"), value: player.health })} + {@render InfoRow({ label: t("armor"), value: player.armor })} + {/if} + + {@render InfoRow({ label: t("play_time"), value: formatPlayTime(player.play_time) })} + {@render InfoRow({ label: t("last_visited"), value: formatLastVisited(player.last_join) })} + + {#if player.identifiers && Object.keys(player.identifiers).length > 0} +
{t("identifiers")}
+ {#each Object.entries(player.identifiers) as [key, identifier]} + {@render InfoRow({ label: key, value: String(identifier) })} + {/each} + {/if} + + {#if copiedText} +
+ + + + {copiedText} +
+ {/if} +
+
+{/if} + +{#snippet InfoRow({ label, value }: { label: string; value: string | number | null | undefined })} + {@const displayValue = value ?? "-"} +
value != null && copyToClipboard(String(value))} onkeydown={(e) => e.key === "Enter" && value != null && copyToClipboard(String(value))}> + {label} + {displayValue} +
+{/snippet} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/PlayersList.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/PlayersList.svelte new file mode 100644 index 00000000..2f065950 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/PlayersList.svelte @@ -0,0 +1,177 @@ + + + { + infoOpen = false; + }} +/> + +{#if filteredPlayers.length > 0} + + {#snippet vl_slot({ item })} + {@const player = item as Player} +
{ + e.stopPropagation(); + openInformation(e.clientX, e.clientY, player, infoOpen); + }} + onkeydown={(e) => handlePlayerKeydown(e, player)} + oncontextmenu={(e) => openMenu(e, player)} + > + #{player.id} + {formatName(player.name)} + {formatMoney(player.cash)} + {formatMoney(player.bank)} + {formatMoney(player.alt_money)} + {player.health} + {player.armor} + {lastVisited(player.last_join)} +
+ {/snippet} +
+{/if} + + { + if (bool) { + openInformation(mouseX, mouseY, player, infoOpen); + } else { + infoOpen = false; + } + }} +/> + + (infoOpen = false)} /> + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/VehiclesList.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/VehiclesList.svelte new file mode 100644 index 00000000..87774da9 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/components/VehiclesList.svelte @@ -0,0 +1,124 @@ + + +{#if filteredVehicles.length > 0} + + {#snippet vl_slot({ item })} + {@const vehicle = item as Vehicle} +
openMenu(e, vehicle)}> + {vehicle.plate} + {vehicle.owner ?? "-"} + {vehicle.name} + {vehicle.type} + {vehicle.mileage ?? "-"} + + {vehicle.impounded ? "Yes" : "No"} + +
+ {/snippet} +
+ {#if loading} +
Loading vehicles...
+ {/if} +{/if} + + + + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/ban.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/ban.ts new file mode 100644 index 00000000..e5ae2768 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/ban.ts @@ -0,0 +1,11 @@ +export interface Ban { + id?: number; + identifier: string; + reason: string; + banned_by?: string; + + banned_at?: number | string | null; + expires_at?: number | string | null; + remaining_seconds?: number | null; + remaining_formatted?: string | null; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/player.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/player.ts new file mode 100644 index 00000000..2d2831e9 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/player.ts @@ -0,0 +1,43 @@ +export interface Vector3 { + x: number; + y: number; + z: number; +} + +export interface PlayTime { + days: number; + hours: number; + minutes: number; +} + +type Status = "online" | "offline"; +export interface Player { + status: Status; // 'online' | 'offline' + id?: number | string; // server ID, or "OFF" for offline search results + _key?: string; + name: string; + is_staff?: boolean; + group?: string; + + cash: number; + bank: number; + alt_money: number; // Black Money / Illegal Money + + health?: number; + armor?: number; + + last_join?: number | null; // timestamp + + char_identifier?: string | null; + identifier?: string | null; + ip?: string; + identifiers?: Record; + routing_bucket?: number; + radio_channel?: number; + job?: string; + job_grade?: string; + gender: "m" | "f" | string; + + play_time?: PlayTime; + position?: Vector3; +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/vehicle.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/vehicle.ts new file mode 100644 index 00000000..94a2b65e --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/players/types/vehicle.ts @@ -0,0 +1,11 @@ +export interface Vehicle { + owner?: string; // Veh Owner + plate: string; // Vehicle plate + model?: number; // GTA model hash + type: string; // Vehicle type (for ex. sports, suv etc...) + name: string; // Vehicle Name + mileage?: number | null; // Vehicle Mileage + impounded: boolean; // Whether the vehicle is impounded or not + impoundName?: string | null; // Current impound identifier + stored?: boolean; // Whether the vehicle is stored in a garage +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/server/ServerManagement.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/server/ServerManagement.svelte new file mode 100644 index 00000000..30bfb439 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/server/ServerManagement.svelte @@ -0,0 +1,659 @@ + + +
+
+
+

Server Management

+ Environment, player-wide actions, broadcasts, and cleanup. +
+
+ Blackout {server.blackout ? "On" : "Off"} + PvP {server.pvp ? "On" : "Off"} +
+
+ +
+
+

Environment

+ Weather, time, blackout, and PvP. +
+
+ + + + + + + +
+
+ +
+
+

{t("vehicle_spawner", "Vehicle Spawner")}

+ Spawn a vehicle with the selected model and paint. +
+
+ + + + +
+
+ +
+
+

{t("customize_vehicle", "Customize Vehicle")}

+ Apply performance, paint, lights, and tire options to the vehicle you are in. +
+
+
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + +
+
+ +
+
+
+ +
+
+

Players

+ Server-wide emergency actions. +
+
+ + + + + + +
+
+ +
+
+

Radio

+ See character names in a specific channel. +
+
+
+ + +
+
+ {#if radioPlayers.length === 0} + No players found in this channel. + {:else} + {#each radioPlayers as player} +
+ #{player.id} + {player.name} + {player.char_identifier ?? ""} +
+ {/each} + {/if} +
+
+
+ +
+
+

Cleanup

+ Remove world entities for everyone. +
+
+ + + +
+
+ +
+
+

Broadcasts

+ Notify players or give everyone money. +
+
+ + + + + +
+
+
+ + diff --git a/[esx_addons]/esx_adminmenu/web/src/main.ts b/[esx_addons]/esx_adminmenu/web/src/main.ts new file mode 100644 index 00000000..7223aaed --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/main.ts @@ -0,0 +1,21 @@ +import { mount } from 'svelte'; +import './app.css'; +import App from './App.svelte'; +import "./lib/shared/nui/handlers"; +import { isChromium } from './lib/shared/util/util'; +import testBackground from './assets/testbg.png'; + +const root = document.getElementById('app'); + +if (!isChromium() && root) { + root.style.backgroundImage = `url(${testBackground})`; + root.style.backgroundSize = 'cover'; + root.style.backgroundRepeat = 'no-repeat'; + root.style.backgroundPosition = 'center'; +} + +const app = mount(App, { + target: document.getElementById('app')!, +}) + +export default app diff --git a/[esx_addons]/esx_adminmenu/web/svelte.config.js b/[esx_addons]/esx_adminmenu/web/svelte.config.js new file mode 100644 index 00000000..19e11a65 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/svelte.config.js @@ -0,0 +1,11 @@ +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' + +/** @type {import("@sveltejs/vite-plugin-svelte").SvelteConfig} */ +export default { + // Consult https://svelte.dev/docs#compile-time-svelte-preprocess + // for more information about preprocessors + preprocess: vitePreprocess(), + compilerOptions: { + runes: true + }, +} diff --git a/[esx_addons]/esx_adminmenu/web/tsconfig.app.json b/[esx_addons]/esx_adminmenu/web/tsconfig.app.json new file mode 100644 index 00000000..6daf0b73 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/tsconfig.app.json @@ -0,0 +1,25 @@ +{ + "extends": "@tsconfig/svelte/tsconfig.json", + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2022", + "useDefineForClassFields": true, + "module": "ESNext", + "types": ["svelte", "vite/client"], + "paths": { + "$lib/*": ["./src/lib/*"] + }, + "noEmit": false, + /** + * Typecheck JS in `.svelte` and `.js` files by default. + * Disable checkJs if you'd like to use dynamic types in JS. + * Note that setting allowJs false does not prevent the use + * of JS in `.svelte` files. + */ + "allowJs": true, + "checkJs": true, + "moduleDetection": "force" + }, + "include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/[esx_addons]/esx_adminmenu/web/tsconfig.json b/[esx_addons]/esx_adminmenu/web/tsconfig.json new file mode 100644 index 00000000..816de215 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/tsconfig.json @@ -0,0 +1,8 @@ +{ + "include": ["src"], + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/[esx_addons]/esx_adminmenu/web/tsconfig.node.json b/[esx_addons]/esx_adminmenu/web/tsconfig.node.json new file mode 100644 index 00000000..70d2bcdb --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/tsconfig.node.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "composite": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2023", + "lib": ["ES2023"], + "module": "ESNext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": false, + "emitDeclarationOnly": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/[esx_addons]/esx_adminmenu/web/vite.config.ts b/[esx_addons]/esx_adminmenu/web/vite.config.ts new file mode 100644 index 00000000..3148d7f6 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/vite.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'vite' +import { svelte } from '@sveltejs/vite-plugin-svelte' +import path from 'path' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [svelte()], + base: './', + resolve: { + alias: { + $lib: path.resolve('./src/lib') + } + } +})