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..b1c7d31c --- /dev/null +++ b/[esx_addons]/esx_adminmenu/README.md @@ -0,0 +1,199 @@ +# 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. + +### Feature permission catalog + +`Config.FeaturePermissions` maps each feature key to the ESX groups allowed to use it. Every key holds a `{ group = true }` table, so you can build a granular "moderator" group by only enabling the features you want it to reach and leaving the sensitive ones to `admin`. + +The action-to-feature maps (`Config.AdminMenu.ActionPermissions`, `Config.PlayerActions.ActionPermissions`, `Config.ServerManagement.ActionPermissions`) decide which feature key each concrete action is checked against. If an action's feature key has no entry in `Config.FeaturePermissions`, the code falls back to the base `Config.AllowedGroups` check. + +Self and utility: + +- `selfTools` - self noclip, godmode, invisible, revive, heal, armor, waypoint teleport. +- `playerVisibility` - show player names and blips. +- `infiniteAmmo` - infinite ammo toggle. +- `helperCommands` - coordinate/model/plate helper commands and copy coords. + +Player information: + +- `sensitiveInfo` - identifiers, IP addresses, owner fields, and other sensitive columns in player, recent-player, and vehicle data. +- `playerData` - read/write player data such as radio, job, name, thirst, and hunger. +- `playerTeleport` - goto and bring a player. +- `spectate` - spectate a player. +- `playerNotify` - notify a single player. + +Player moderation: + +- `playerModeration` - set health/armor, kill, revive, freeze players. +- `destructive` - clean inventory and delete character. +- `troll` - burn, explode, sky/random teleport, nausea troll actions. +- `banManagement` - view, edit expiry, and revoke bans. +- `money` - give/take money from a player. +- `weapons` - give all weapons. +- `routingBucket` - change a player's routing bucket. +- `setModel` - change a player's ped model. +- `openClothing` - open the clothing menu on a player. +- `acePermissions` - add and remove ACE groups. + +Vehicles: + +- `vehicleSpawner` - spawn a vehicle. +- `vehicleTools` - repair, clean, flip a vehicle. +- `vehiclePerformance` - performance levels, turbo, xenon, neon, colors, tint, wheels, discs, tires, customization presets. +- `vehicleManagement` - impound and unimpound owned vehicles. +- `vehicleDestructive` - delete a vehicle. +- `vehicleOwnership` - see and act on vehicle ownership data. + +Server management: + +- `serverManagement` - general server management access. +- `serverEnvironment` - weather, time, blackout, and PvP toggles. +- `serverPlayerModeration` - freeze/unfreeze all, bring all, revive all. +- `serverPlayerDestructive` - kick all and kill all. +- `serverCleanup` - delete world vehicles, peds, and objects. +- `serverBroadcast` - broadcast a notification to all players. +- `serverEconomy` - give money to all players. + +Integrations: + +- `radioLookup` - look up a player's radio channel (pma-voice). + +## 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..ed490546 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/actions.lua @@ -0,0 +1,1331 @@ +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 vehicleLevels = { engine = 1, brake = 1, transmission = 1, suspension = 1, armor = 1 } +local vehicleColorIndex = 1 +local neonColorIndex = 1 +local runningLoops = {} + +local MOD = { + engine = 11, + brakes = 12, + transmission = 13, + suspension = 15, + armor = 16, + turbo = 18, + xenon = 22, + wheelFront = 23, + wheelRear = 24, +} + +local CONTROL = { + sprint = 21, + slow = 36, + moveLeftRight = 30, + moveUpDown = 31, + moveForward = 32, + moveBackward = 33, + moveLeft = 34, + moveRight = 35, + up = 22, + down = 44, + exitVehicle = 75, +} + +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 trimString(value) + return Helpers.trim(value) +end + +local function requestModel(model, options) + return Helpers.loadModel(model, options) +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, MOD.wheelFront) + if frontCount > 0 then + local frontIndex = math.max(-1, math.min(wheelDesign, frontCount - 1)) + SetVehicleMod(vehicle, MOD.wheelFront, frontIndex, false) + end + + local rearCount = GetNumVehicleMods(vehicle, MOD.wheelRear) + if rearCount > 0 then + local rearIndex = math.max(-1, math.min(wheelDesign, rearCount - 1)) + SetVehicleMod(vehicle, MOD.wheelRear, 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, MOD.engine, useMaxPerformance and 5 or data.engineLevel or vehicleLevels.engine) + local brakeLevel = applyVehicleModLevel(vehicle, MOD.brakes, useMaxPerformance and 5 or data.brakeLevel or vehicleLevels.brake) + local transmissionLevel = applyVehicleModLevel(vehicle, MOD.transmission, useMaxPerformance and 5 or data.transmissionLevel or vehicleLevels.transmission) + local suspensionLevel = applyVehicleModLevel(vehicle, MOD.suspension, useMaxPerformance and 5 or data.suspensionLevel or vehicleLevels.suspension) + local armorLevel = applyVehicleModLevel(vehicle, MOD.armor, useMaxPerformance and 5 or data.armorLevel or vehicleLevels.armor) + + vehicleLevels.engine = engineLevel + vehicleLevels.brake = brakeLevel + vehicleLevels.transmission = transmissionLevel + vehicleLevels.suspension = suspensionLevel + vehicleLevels.armor = armorLevel + + if useMaxPerformance then + ToggleVehicleMod(vehicle, MOD.turbo, true) + end + + if data.turbo ~= nil then + ToggleVehicleMod(vehicle, MOD.turbo, data.turbo == true) + end + + if data.xenon ~= nil then + ToggleVehicleMod(vehicle, MOD.xenon, 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 vehicleLevels.transmission, + suspensionLevel = maxPerformance and 5 or vehicleLevels.suspension, + armorLevel = maxPerformance and 5 or vehicleLevels.armor, + 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 + +-- Per-flag ped-state restore helpers. Reused by the normal toggle-off paths and +-- by the onResourceStop teardown so the local player is always cleaned up. +local function restoreVisibility(ped) + ped = ped or PlayerPedId() + SetEntityVisible(ped, true, false) + NetworkSetEntityInvisibleToNetwork(ped, false) +end + +local function restoreInvincibility(ped) + ped = ped or PlayerPedId() + SetPlayerInvincible(PlayerId(), false) + SetEntityInvincible(ped, false) +end + +local function restoreNoClip(entity) + setNoClipEntityState(entity, false) +end + +local function restoreInfiniteAmmo(ped) + ped = ped or PlayerPedId() + SetPedInfiniteAmmoClip(ped, false) +end + +local function clearPlayerBlips() + for serverId, blip in pairs(playerBlips) do + if DoesBlipExist(blip) then + RemoveBlip(blip) + end + playerBlips[serverId] = nil + end +end + +local function restoreSpectatePed() + local ped = PlayerPedId() + + FreezeEntityPosition(ped, false) + SetEntityCollision(ped, true, true) + restoreVisibility(ped) + SetPlayerInvincible(PlayerId(), false) + + if lastCoords then + SetEntityCoords(ped, lastCoords) + end +end + +-- Shared toggle-loop runner: refuses to start a second loop of the same name, +-- ticks while isActiveFn() is true, then runs onStop once and clears the flag. +local function startToggleLoop(name, isActiveFn, interval, onTick, onStop) + if runningLoops[name] then + return + end + + runningLoops[name] = true + + CreateThread(function() + while isActiveFn() do + onTick() + Wait(interval) + end + + if onStop then + onStop() + end + + runningLoops[name] = nil + end) +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() + startToggleLoop("godmodeVehicle", function() + return godmodeActive + end, 500, function() + applyGodmodeVehicle(GetVehiclePedIsIn(PlayerPedId(), false)) + end, function() + applyGodmodeVehicle(0) + end) +end + +local function watchInvisibleVehicle() + startToggleLoop("invisibleVehicle", function() + return invisibleActive + end, 500, function() + applyInvisibleVehicle(GetVehiclePedIsIn(PlayerPedId(), false)) + end, function() + 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() + local entity, ped = getControlledEntity() + noClipEntity = entity + setNoClipEntityState(entity, true) + + startToggleLoop("noclip", function() + return noClipActive + end, 0, function() + 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, CONTROL.sprint) then + speed = speed * 3.0 + elseif IsDisabledControlPressed(0, CONTROL.slow) then + speed = speed * 0.35 + end + + DisableControlAction(0, CONTROL.moveLeftRight, true) + DisableControlAction(0, CONTROL.moveUpDown, true) + DisableControlAction(0, CONTROL.moveForward, true) + DisableControlAction(0, CONTROL.moveBackward, true) + DisableControlAction(0, CONTROL.moveLeft, true) + DisableControlAction(0, CONTROL.moveRight, true) + DisableControlAction(0, CONTROL.up, true) + DisableControlAction(0, CONTROL.down, true) + DisableControlAction(0, CONTROL.exitVehicle, true) + + if IsDisabledControlPressed(0, CONTROL.moveForward) then + coords = coords + forward * speed + end + if IsDisabledControlPressed(0, CONTROL.moveBackward) then + coords = coords - forward * speed + end + if IsDisabledControlPressed(0, CONTROL.moveLeft) then + coords = coords - right * speed + end + if IsDisabledControlPressed(0, CONTROL.moveRight) then + coords = coords + right * speed + end + if IsDisabledControlPressed(0, CONTROL.up) then + coords = coords + vector3(0.0, 0.0, speed) + end + if IsDisabledControlPressed(0, CONTROL.down) 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, function() + 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 + startToggleLoop("infiniteAmmo", function() + return infiniteAmmoActive + end, 500, function() + SetPedInfiniteAmmoClip(PlayerPedId(), true) + end, function() + restoreInfiniteAmmo() + end) + end + + return infiniteAmmoActive +end + +function ClientActions.ToggleNames() + namesActive = not namesActive + + if namesActive then + startToggleLoop("names", function() + return namesActive + end, 0, function() + 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 + + return namesActive +end + +function ClientActions.ToggleBlips() + blipsActive = not blipsActive + + if not blipsActive then + clearPlayerBlips() + + return false + end + + startToggleLoop("blips", function() + return blipsActive + end, 1500, function() + local blipConfig = (Config.AdminMenu and Config.AdminMenu.Blip) or {} + 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, blipConfig.sprite or 1) + SetBlipScale(blip, blipConfig.scale or 0.85) + SetBlipColour(blip, blipConfig.colour or 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 + 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, { requireVehicle = true }) + if not modelHash then + return false, err or "Invalid vehicle model." + 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 + +local function makeCycle(key, applyFn) + return function() + local vehicle, err = getCurrentVehicle() + if not vehicle then + return false, err + end + + vehicleLevels[key] = vehicleLevels[key] % 5 + 1 + applyFn(vehicle) + + return true, nil, { active = true, value = ("%s/5"):format(vehicleLevels[key]) } + end +end + +ClientActions.CycleVehicleEngine = makeCycle("engine", function(vehicle) + applyVehiclePerformance(vehicle, vehicleLevels.engine, vehicleLevels.brake, false) +end) + +ClientActions.CycleVehicleBrakes = makeCycle("brake", function(vehicle) + applyVehiclePerformance(vehicle, vehicleLevels.engine, vehicleLevels.brake, false) +end) + +ClientActions.CycleVehicleTransmission = makeCycle("transmission", function(vehicle) + applyVehicleCustomizations(vehicle, { transmissionLevel = vehicleLevels.transmission }) +end) + +ClientActions.CycleVehicleSuspension = makeCycle("suspension", function(vehicle) + applyVehicleCustomizations(vehicle, { suspensionLevel = vehicleLevels.suspension }) +end) + +ClientActions.CycleVehicleArmor = makeCycle("armor", function(vehicle) + applyVehicleCustomizations(vehicle, { armorLevel = vehicleLevels.armor }) +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 + + local scan = (Config.AdminMenu and Config.AdminMenu.WaypointScan) or {} + local maxHeight = scan.max or 1000 + local step = scan.step or 25 + + for height = 0, maxHeight, step 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) + +local TROLL = { + burn = function(ped, coords) + StartEntityFire(ped) + end, + explode = function(ped, coords) + AddExplosion(coords.x, coords.y, coords.z, 2, 1.0, true, false, 1.0) + end, + sky = function(ped, coords) + local skyHeight = (Config.AdminMenu and Config.AdminMenu.Troll and Config.AdminMenu.Troll.skyHeight) or 120.0 + SetEntityCoordsNoOffset(ped, coords.x, coords.y, coords.z + skyHeight, false, false, false) + end, + randomTeleport = function(ped, coords) + local troll = (Config.AdminMenu and Config.AdminMenu.Troll) or {} + local range = troll.randomRange or 500 + local height = troll.randomHeight or 40.0 + local xOffset = math.random(-range, range) + 0.0 + local yOffset = math.random(-range, range) + 0.0 + SetEntityCoordsNoOffset(ped, coords.x + xOffset, coords.y + yOffset, coords.z + height, false, false, false) + end, + nausea = function(ped, coords) + local duration = (Config.AdminMenu and Config.AdminMenu.Troll and Config.AdminMenu.Troll.nauseaDuration) or 5000 + ShakeGameplayCam("DRUNK_SHAKE", 1.0) + AnimpostfxPlay("DrugsMichaelAliensFight", duration, false) + end, +} + +RegisterNetEvent("esx-adminmenu:client:troll", function(action) + local handler = TROLL[action] + if not handler then + return + end + + local ped = PlayerPedId() + local coords = GetEntityCoords(ped) + + handler(ped, coords) +end) + +-- Reapply active self-toggles after the ped handle changes on respawn. +RegisterNetEvent("esx:onPlayerSpawn", function() + local ped = PlayerPedId() + + if godmodeActive then + SetEntityInvincible(ped, true) + end + + if invisibleActive then + SetEntityVisible(ped, false, false) + NetworkSetEntityInvisibleToNetwork(ped, true) + end + + if infiniteAmmoActive then + SetPedInfiniteAmmoClip(ped, true) + end +end) + +local function StopSpectate() + ToggleNUIFocus(true) + if not spectating then + return + end + + local ped = PlayerPedId() + + NetworkSetInSpectatorMode(false, ped) + + restoreSpectatePed() + + spectating = false + + SendNUIMessage({ + action = "stopSpectate", + data = true, + }) +end + +function Spectate(targetId, targetCoords) + ToggleNUIFocus(false) + + local spectateConfig = (Config.AdminMenu and Config.AdminMenu.Spectate) or {} + local spectateHeight = spectateConfig.height or 15.0 + local escCooldown = spectateConfig.escCooldown or 5000 + local streamWait = spectateConfig.streamWait or 500 + + 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 + spectateHeight, false, false, false) + + Wait(streamWait) + local targetPlayer = GetPlayerFromServerId(targetId) + + if targetPlayer == -1 then + print("Spectate failed: player not streamed") + restoreSpectatePed() + return + end + + local targetPed = GetPlayerPed(targetPlayer) + + if not DoesEntityExist(targetPed) then + print("Spectate failed: ped missing") + restoreSpectatePed() + return + end + + spectating = true + NetworkSetInSpectatorMode(true, targetPed) + + CreateThread(function() + while spectating do + Wait(0) + + local currentTarget = GetPlayerFromServerId(targetId) + if currentTarget == -1 or not DoesEntityExist(GetPlayerPed(currentTarget)) then + StopSpectate() + break + end + + DisableFrontendThisFrame() + + if IsDisabledControlJustPressed(0, 322) and GetGameTimer() >= escCooldownUntil then + escCooldownUntil = GetGameTimer() + escCooldown + + 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 + +AddEventHandler("onResourceStop", function(resource) + if resource ~= GetCurrentResourceName() then + return + end + + local ped = PlayerPedId() + + if spectating then + StopSpectate() + end + + restoreVisibility(ped) + restoreInvincibility(ped) + restoreNoClip(ped) + restoreInfiniteAmmo(ped) + clearPlayerBlips() + SetNuiFocus(false, false) + SetNuiFocusKeepInput(false) +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..1a3a4281 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/helpers.lua @@ -0,0 +1,99 @@ +Helpers = {} + +function Helpers.trim(value) + if type(value) ~= "string" then + return "" + end + + return value:match("^%s*(.-)%s*$") +end + +-- Consolidated RequestModel + poll helper. +-- opts = { timeout = <ms>, requireVehicle = <bool> } +-- Returns (hash) on success or (nil, errString) on failure. +function Helpers.loadModel(model, opts) + opts = opts or {} + + local hash = model + if type(model) == "string" then + hash = joaat(model) + end + + if not IsModelInCdimage(hash) or not IsModelValid(hash) then + return nil, "invalid_model" + end + + if opts.requireVehicle and not IsModelAVehicle(hash) then + return nil, "invalid_model" + end + + local timeout = tonumber(opts.timeout) or (Config.AdminMenu and Config.AdminMenu.ModelLoadTimeout) or 5000 + + RequestModel(hash) + local deadline = GetGameTimer() + timeout + while not HasModelLoaded(hash) do + Wait(0) + if GetGameTimer() > deadline then + return nil, "model_load_timeout" + end + end + + return hash +end + +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: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 = Helpers.loadModel(data.model, { requireVehicle = true }) + if not model then + cb(nil) + return + 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/init.lua b/[esx_addons]/esx_adminmenu/client/init.lua new file mode 100644 index 00000000..0321b709 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/init.lua @@ -0,0 +1,24 @@ +-- Translations are already shipped with the resource, so resolve them here +-- instead of paying for them in the init payload. The NUI keeps a full English +-- set and merges these over it, so any missing key falls back on its own. +local function activeTranslations() + local locale = Locales[Config.Locale] + if type(locale) ~= 'table' then + locale = Locales['en'] + end + return locale or {} +end + +ESX.TriggerServerCallback('esx-adminmenu:server:getInitData', function(data) + if not data or data.err then + if data.err and Config.Debug then + print(data.err) + end + return + end + data.translations = activeTranslations() + 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..860dca80 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/client/nui.lua @@ -0,0 +1,626 @@ +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 + +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) + +-- D2: quick-action / toggle registry ---------------------------------------- +-- Simple toggles share one envelope: flip state, mirror it to the web via +-- sendQuickMenuState and return the { active } extra. Entries flagged with +-- command = true also expose the same permission-gated command path. +local toggleActions = { + { action = "noclip", toggle = ClientActions.ToggleNoClip, command = true, mirrorInvisible = true }, + { action = "names", toggle = ClientActions.ToggleNames, command = true }, + { action = "blips", toggle = ClientActions.ToggleBlips, command = true }, + { action = "godmode", toggle = ClientActions.ToggleGodmode }, + { action = "invisible", toggle = ClientActions.ToggleInvisible }, + { action = "infiniteAmmo", toggle = ClientActions.ToggleInfiniteAmmo }, +} + +for _, entry in ipairs(toggleActions) do + RegisterNUICallback("adminMenu:" .. entry.action, function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:" .. entry.action .. "]", function() + local active = entry.toggle() + sendQuickMenuState(entry.action, active) + if entry.mirrorInvisible and ClientActions.IsInvisibleActive then + sendQuickMenuState("invisible", ClientActions.IsInvisibleActive()) + end + return true, nil, { active = active } + end, entry.action) + end) + + if entry.command then + RegisterCommand(entry.action, function() + runAdminCommandAction(entry.action, entry.toggle) + end, false) + end +end + +-- Direct actions just run a ClientActions function under a permission gate. +-- run receives the raw NUI data; functions that ignore arguments are safe to +-- reference bare. +local directActions = { + { name = "heal", permission = "heal", run = ClientActions.Heal }, + { name = "armor", permission = "armor", run = function() return ClientActions.SetArmor(100) end }, + { name = "repairVehicle", permission = "repairVehicle", run = ClientActions.RepairVehicle }, + { name = "cleanVehicle", permission = "cleanVehicle", run = ClientActions.CleanVehicle }, + { name = "deleteVehicle", permission = "deleteVehicle", run = ClientActions.DeleteVehicle }, + { name = "waypoint", permission = "waypoint", run = ClientActions.TeleportToWaypoint }, + { name = "spawnVehicle", permission = "spawnVehicle", run = function(data) return ClientActions.SpawnVehicle(data or {}) end }, + { name = "flipVehicle", permission = "flipVehicle", run = ClientActions.FlipVehicle }, + { name = "customizeVehicle", permission = "customizeVehicle", run = function(data) return ClientActions.CustomizeVehicle(data or {}) end }, + { name = "copyCoords", permission = "copyCoords", run = ClientActions.CopyCoords }, + { name = "cycleVehicleTransmission", permission = "transmissionLevel", run = ClientActions.CycleVehicleTransmission }, + { name = "cycleVehicleSuspension", permission = "suspensionLevel", run = ClientActions.CycleVehicleSuspension }, + { name = "cycleVehicleArmor", permission = "armorLevel", run = ClientActions.CycleVehicleArmor }, + { name = "cycleVehicleNeonColor", permission = "neonColorCycle", run = ClientActions.CycleVehicleNeonColor }, +} + +for _, entry in ipairs(directActions) do + RegisterNUICallback("adminMenu:" .. entry.name, function(data, cb) + runProtectedClientAction(cb, "[esx-adminmenu:" .. entry.name .. "]", function() + return entry.run(data) + end, entry.permission) + end) +end + +-- Bespoke closures: quick actions that emit extra menu state on success. +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: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: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: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: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) + +-- D1: server-callback bridge factory ---------------------------------------- +-- The proxy callbacks all share one shape: trigger a server callback, on error +-- report + respond, on success forward a fixed subset of fields to the web. +-- Soft entries return an empty collection (with optional paging) instead of a +-- hard failure, and special cases hook in via onSuccess / mapItem. +local function registerServerBridge(spec) + RegisterNUICallback(spec.name, function(data, cb) + local function handler(res) + if not res or res.err then + if spec.soft then + print(spec.label, res and res.err) + local out = { success = false, err = getCallbackError(res, spec.softError) } + out[spec.collection] = {} + cb(out) + else + respondFailure(cb, spec.label, res) + end + return + end + + if spec.onSuccess then + spec.onSuccess(res, cb, data) + return + end + + if spec.soft then + local coll = res[spec.collection] or {} + if spec.mapItem then + for i = 1, #coll do + spec.mapItem(coll[i]) + end + end + + local out = { success = true } + out[spec.collection] = coll + if spec.paging then + out.hasMore = res.hasMore == true + out.nextOffset = res.nextOffset or #coll + out.limit = res.limit + end + cb(out) + return + end + + local out = { success = spec.successTrue and true or res.success } + if spec.forward then + for _, field in ipairs(spec.forward) do + if type(field) == "table" then + local val = res[field.key] + if val == nil then + val = field.default + end + out[field.key] = val + else + out[field] = res[field] + end + end + end + cb(out) + end + + if spec.passData == false then + ESX.TriggerServerCallback(spec.event, handler) + else + ESX.TriggerServerCallback(spec.event, handler, data) + end + end) +end + +local serverBridges = { + { + name = "server:action", + event = "esx-adminmenu:server:serverAction", + label = "[esx-adminmenu:serverAction]", + forward = { "serverData" }, + }, + { + name = "server:radioPlayers", + event = "esx-adminmenu:server:getRadioChannelPlayers", + label = "[esx-adminmenu:radioPlayers]", + successTrue = true, + forward = { { key = "players", default = {} } }, + }, + { + name = "player:action", + event = "esx-adminmenu:server:playerAction", + label = "[esx-adminmenu:playerAction]", + forward = { "playerOnline" }, + }, + { + name = "goto", + event = "esx-adminmenu:server:goto", + label = "[esx-adminmenu:goto]", + forward = { "playerOnline" }, + }, + { + name = "bring", + event = "esx-adminmenu:server:bring", + label = "[esx-adminmenu:bring]", + forward = { "playerOnline" }, + }, + { + name = "spectate", + event = "esx-adminmenu:server:spectate", + label = "[esx-adminmenu:spectate]", + onSuccess = function(res, cb, data) + 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, + }, + { + name = "kick", + event = "esx-adminmenu:server:kick", + label = "[esx-adminmenu:kick]", + forward = { "playerOnline" }, + }, + { + name = "ban", + event = "esx-adminmenu:server:ban", + label = "[esx-adminmenu:ban]", + forward = { "playerOnline" }, + }, + { + name = "ban:offline", + event = "esx-adminmenu:server:ban:offline", + label = "[esx-adminmenu:banOffline]", + }, + { + name = "ban:changeExpiry", + event = "esx-adminmenu:server:ban:changeExpiry", + label = "[esx-adminmenu:changeExpiry]", + }, + { + name = "ban:revoke", + event = "esx-adminmenu:server:ban:revoke", + label = "[esx-adminmenu:revokeBan]", + }, + { + name = "player:notify", + event = "esx-adminmenu:server:notify", + label = "[esx-adminmenu:notifyPlayer]", + forward = { "playerOnline" }, + }, + { + name = "vehicle:impound", + event = "esx-adminmenu:server:vehicleImpound", + label = "[esx-adminmenu:vehicleImpound]", + }, + { + name = "vehicle:unimpound", + event = "esx-adminmenu:server:vehicleUnimpound", + label = "[esx-adminmenu:vehicleUnimpound]", + }, + { + name = "vehicle:delete", + event = "esx-adminmenu:server:vehicleDelete", + label = "[esx-adminmenu:vehicleDelete]", + }, + { + name = "getBans", + event = "esx-adminmenu:server:getBans", + label = "[esx-adminmenu:getBans]", + soft = true, + collection = "bans", + softError = "Failed to fetch bans.", + paging = true, + }, + { + name = "getVehicles", + event = "esx-adminmenu:server:getVehicles", + label = "[esx-adminmenu:getVehicles]", + soft = true, + collection = "vehicles", + softError = "Failed to fetch vehicles.", + paging = true, + mapItem = function(v) + v.name = Helpers.resolveVehicleName(v.model) + end, + }, + { + name = "getRecentPlayers", + event = "esx-adminmenu:server:getRecentPlayers", + label = "[esx-adminmenu:getRecentPlayers]", + soft = true, + collection = "players", + softError = "Failed to fetch recent players.", + passData = false, + }, + { + name = "player:searchOffline", + event = "esx-adminmenu:server:searchOfflinePlayer", + label = "[esx-adminmenu:searchOffline]", + soft = true, + collection = "players", + softError = "Failed to search offline players.", + }, + { + name = "getAdminLogs", + event = "esx-adminmenu:server:getAdminLogs", + label = "[esx-adminmenu:getAdminLogs]", + soft = true, + collection = "logs", + softError = "Failed to fetch admin logs.", + paging = true, + }, +} + +for _, spec in ipairs(serverBridges) do + registerServerBridge(spec) +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) + +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() + local interval = (Config.AdminMenu and Config.AdminMenu.ServerDataInterval) or 60000 + while true do + Wait(interval) + 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..0c6f568f --- /dev/null +++ b/[esx_addons]/esx_adminmenu/fxmanifest.lua @@ -0,0 +1,46 @@ +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/helpers.lua", + "client/actions.lua", + "client/nui.lua", + "client/init.lua", +}) + +server_scripts({ + "@oxmysql/lib/MySQL.lua", + "server/helpers.lua", + "server/ban_cache.lua", + -- Before actions.lua: the action dispatchers record through Logs. + "server/logs.lua", + "server/database.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..6c41c05c --- /dev/null +++ b/[esx_addons]/esx_adminmenu/locales/en.lua @@ -0,0 +1,237 @@ +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", + + -- Admin action log + ["admin_logs"] = "Admin Logs", + ["all_categories"] = "All categories", + ["player_actions"] = "Player actions", + ["server_management"] = "Server management", + ["moderation"] = "Moderation", + ["last_24h"] = "Last 24h", + ["last_7_days"] = "Last 7 days", + ["last_30_days"] = "Last 30 days", + ["search_logs"] = "Search logs...", + ["date"] = "Date", + ["admin"] = "Admin", + ["action"] = "Action", + ["target"] = "Target", + ["result"] = "Result", + ["details"] = "Details", + ["success"] = "Success", + ["failed"] = "Failed", + ["loading"] = "Loading...", + ["load_more"] = "Load more", + ["more_info"] = "More info", + ["hide_details"] = "Hide details", + ["no_logs_found"] = "Nothing to show", + + -- Server-facing error strings + ["insufficient_permissions"] = "Insufficient Permissions.", + ["player_not_online"] = "Player Not Online", + ["invalid_action"] = "Invalid admin action.", + ["amount_must_be_positive"] = "Amount must be greater than 0.", + ["must_be_in_vehicle"] = "You must be in a vehicle.", + ["no_permission_command"] = "You do not have permission to use this command.", + ["database_unavailable"] = "Database unavailable.", +} diff --git a/[esx_addons]/esx_adminmenu/server/actions.lua b/[esx_addons]/esx_adminmenu/server/actions.lua new file mode 100644 index 00000000..b9446f2a --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/actions.lua @@ -0,0 +1,1249 @@ +Actions = Actions or {} + +---@class AdminActionResult +---@field success boolean +---@field err string? +---@field playerOnline boolean? +---@field isAdmin boolean? + +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 trimString = Helpers.trim + +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, identifiers) + identifier = Helpers.normalizeLicenseIdentifier(identifier) + if not identifier then + return nil + end + + local identifiersJson = (type(identifiers) == "table" and #identifiers > 0) and json.encode(identifiers) or nil + + if expiresAt then + return MySQL.insert.await( + "INSERT INTO bans (identifier, identifiers, reason, banned_by, expires_at, banned_at) VALUES (?, ?, ?, ?, FROM_UNIXTIME(?), FROM_UNIXTIME(?))", + { identifier, identifiersJson, reason, bannedBy, expiresAt, bannedAt } + ) + end + + return MySQL.insert.await( + "INSERT INTO bans (identifier, identifiers, reason, banned_by, expires_at, banned_at) VALUES (?, ?, ?, ?, NULL, FROM_UNIXTIME(?))", + { identifier, identifiersJson, 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) + 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) + + 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) + return Helpers.getActionPermission("serverManagement", action) or "serverManagement" +end + +local function withServerData(data) + data = data or {} + data.serverData = Helpers.getServerData() + return data +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.GetPlayerFromId(src) + local target = ESX.GetPlayerFromId(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 + +Helpers.registerCallback("esx-adminmenu:server:goto", function(source, data) + return 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.GetPlayerFromId(src) + local target = ESX.GetPlayerFromId(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 + +Helpers.registerCallback("esx-adminmenu:server:bring", function(source, data) + return 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 + +Helpers.registerCallback("esx-adminmenu:server:spectate", function(source, data) + return Actions.Spectate(source, data) +end) + +function Actions.StopSpectate(src) + if not Helpers.hasFeaturePermission(src, "spectate") then + return { success = false, err = "Insufficient Permissions" } + end + + Helpers.stopSpectate(src) + return { success = true } +end + +Helpers.registerCallback("esx-adminmenu:server:spectate:stop", function(source) + return 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 + + local reason = limitString(data.reason, getLimits().MaxReasonLength, "Kicked by admin") + + -- Queued, not written inline: the drop must not wait on the database. + -- Recorded before DropPlayer so the target is still resolvable. + Logs.record({ + namespace = "moderation", + action = "kick", + actor = src, + target = targetId, + payload = { reason = reason }, + }) + + DropPlayer(targetId, reason) + + return { success = true, playerOnline = true, isAdmin = true } +end + +Helpers.registerCallback("esx-adminmenu:server:kick", function(source, data) + return 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 + + -- Capture every enabled identifier so the ban matches on reconnect even if + -- the player changes their license. + local banIdentifiers = Helpers.getBanIdentifiers(targetId) + + 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 ok, banId = pcall(insertBan, identifier, reason, adminName, seconds, bannedAt, banIdentifiers) + if not ok or not banId then + print(("[esx-adminmenu] Failed to persist ban for %s: %s"):format(tostring(identifier), tostring(banId))) + return { success = false, err = "Failed to persist ban.", playerOnline = true, isAdmin = true } + end + + BanCache.add({ + id = banId, + identifier = identifier, + identifiers = banIdentifiers, + reason = reason, + banned_by = adminName, + banned_at = bannedAt, + expires_at = seconds, + }) + + Logs.record({ + namespace = "moderation", + action = "ban", + actor = src, + target = identifier, + targetName = GetPlayerName(targetId), + payload = { reason = reason, duration_minutes = duration, identifiers = #banIdentifiers }, + }) + + DropPlayer(targetId, reason) + return { success = true, playerOnline = true, isAdmin = true } +end + +Helpers.registerCallback("esx-adminmenu:server:ban", function(source, data) + return Actions.Ban(source, data) +end) + +-- OFFLINE BAN + +Helpers.registerCallback("esx-adminmenu:server:ban:offline", function(source, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + return { success = false, err = "Insufficient Permissions", isAdmin = false } + end + + data = data or {} + + local normalizedIdentifier = Helpers.normalizeLicenseIdentifier(data.identifier) + if not normalizedIdentifier then + return { success = false, err = "Invalid Identifier", isAdmin = true } + end + + local duration = normalizeBanDuration(data.duration) + local seconds = duration and (os.time() + duration * 60) or nil + local bannedAt = os.time() + local adminName = GetPlayerName(source) + local reason = limitString(data.reason, getLimits().MaxReasonLength, "Banned by admin") + + -- Offline bans are single-identifier by design: the player is not connected, + -- so their other identifiers (discord, steam, ...) cannot be read, and ESX + -- does not persist them. Only online bans carry the full identifier set. + local ok, banId = pcall(insertBan, normalizedIdentifier, reason, adminName, seconds, bannedAt) + if not ok or not banId then + print(("[esx-adminmenu] Failed to persist offline ban for %s: %s"):format(tostring(normalizedIdentifier), tostring(banId))) + return { success = false, err = "Failed to persist ban.", isAdmin = true } + end + + BanCache.add({ + id = banId, + identifier = normalizedIdentifier, + reason = reason, + banned_by = adminName, + banned_at = bannedAt, + expires_at = seconds, + }) + + Logs.record({ + namespace = "moderation", + action = "banOffline", + actor = source, + target = normalizedIdentifier, + payload = { reason = reason, duration_minutes = duration }, + }) + + return { success = true, isAdmin = true } +end) + +-- CHANGE EXPIRY + +Helpers.registerCallback("esx-adminmenu:server:ban:changeExpiry", function(source, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + return { success = false, err = "Insufficient Permissions", isAdmin = false } + end + + data = data or {} + + local normalizedIdentifier = Helpers.normalizeLicenseIdentifier(data.identifier) + if not normalizedIdentifier then + return { success = false, err = "Invalid Identifier", isAdmin = true } + end + + local seconds = nil + if data.newDate ~= nil then + local newDate = tonumber(data.newDate) + if not newDate then + return { success = false, err = "Invalid expiry date.", isAdmin = true } + 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 + + local ok = pcall(function() + updateBanExpiry(normalizedIdentifier, seconds) + BanCache.updateExpiry(normalizedIdentifier, seconds) + end) + + if not ok then + return { success = false, err = "Failed to update ban expiry.", isAdmin = true } + end + + Logs.record({ + namespace = "moderation", + action = "banChangeExpiry", + actor = source, + target = normalizedIdentifier, + payload = { expires_at = seconds }, + }) + + return { success = true, isAdmin = true } +end) + +-- REVOKE + +Helpers.registerCallback("esx-adminmenu:server:ban:revoke", function(source, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + return { success = false, err = "Insufficient Permissions", isAdmin = false } + end + + data = data or {} + + local normalizedIdentifier = Helpers.normalizeLicenseIdentifier(data.identifier) + if not normalizedIdentifier then + return { success = false, err = "Invalid Identifier", isAdmin = true } + end + + local ok = pcall(function() + expireBan(normalizedIdentifier) + BanCache.remove(normalizedIdentifier) + end) + + if not ok then + return { success = false, err = "Failed to revoke ban.", isAdmin = true } + end + + Logs.record({ + namespace = "moderation", + action = "unban", + actor = source, + target = normalizedIdentifier, + }) + + return { success = true, isAdmin = true } +end) + +-- VEHICLES + +local function vehicleUpdate(source, data, query, params, feature) + if not Helpers.hasFeaturePermission(source, feature or "vehicleManagement") then + return { success = false, err = "Insufficient Permissions" } + end + + data = data or {} + params = params or {} + local plate = normalizePlate(data.plate) + + if not plate then + return { success = false, err = "Missing plate" } + end + + params[#params + 1] = plate + + async(function() + Helpers.safeUpdate(query, params) + end) + + return { success = true } +end + +Helpers.registerCallback("esx-adminmenu:server:vehicleImpound", function(source, data) + data = data or {} + local impoundName = trimString(data.impoundName) + local impounds = Helpers.getImpounds() or {} + + if impoundName == "" or not impounds[impoundName] then + return { success = false, err = "Invalid impound." } + end + + return vehicleUpdate( + source, + data, + "UPDATE owned_vehicles SET pound = ? WHERE plate = ?", + { impoundName }, + "vehicleManagement" + ) +end) + +Helpers.registerCallback("esx-adminmenu:server:vehicleUnimpound", function(source, data) + return vehicleUpdate(source, data or {}, "UPDATE owned_vehicles SET pound = NULL WHERE plate = ?", {}, "vehicleManagement") +end) + +Helpers.registerCallback("esx-adminmenu:server:vehicleDelete", function(source, data) + return vehicleUpdate(source, data or {}, "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 + +Helpers.registerCallback("esx-adminmenu:server:notify", function(source, data) + return 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 feature = Helpers.getActionPermission("adminMenu", 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 + +Helpers.registerCallback("esx-adminmenu:server:selfAction", function(source, data) + return Actions.SelfAction(source, data) +end) + +-- SERVER MANAGEMENT + +-- action -> handler(src, payload) -> AdminActionResult. The dispatcher enforces +-- the base serverManagement gate plus getServerActionPermission(action) uniformly. +local ServerHandlers = {} + +local function regServer(action, handler) + ServerHandlers[action] = handler +end + +local function deletePool(pool) + TriggerClientEvent("esx-adminmenu:client:deletePool", -1, pool) + return { success = true } +end + +regServer("weather", function(_, payload) + 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) + +regServer("time", function(_, payload) + 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) + +regServer("blackout", function(_, payload) + local enabled = getBoolean(payload.enabled) + Helpers.setServerEnvironment({ blackout = enabled }) + TriggerClientEvent("esx-adminmenu:client:setBlackout", -1, enabled) + return withServerData({ success = true }) +end) + +regServer("pvp", function(_, payload) + local enabled = getBoolean(payload.enabled) + Helpers.setServerEnvironment({ pvp = enabled }) + TriggerClientEvent("esx-adminmenu:client:setPvp", -1, enabled) + return withServerData({ success = true }) +end) + +regServer("freezeAll", function() + TriggerClientEvent("esx-adminmenu:client:setFrozen", -1, true) + return { success = true } +end) + +regServer("unfreezeAll", function() + TriggerClientEvent("esx-adminmenu:client:setFrozen", -1, false) + return { success = true } +end) + +regServer("bringAll", function(src) + local admin = ESX.GetPlayerFromId(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) + +regServer("killAll", function() + TriggerClientEvent("esx-adminmenu:client:kill", -1) + return { success = true } +end) + +regServer("reviveAll", function() + revivePlayer(-1) + return { success = true } +end) + +regServer("kickAll", function(src, payload) + 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) + +regServer("deleteVehicles", function() return deletePool("CVehicle") end) +regServer("deletePeds", function() return deletePool("CPed") end) +regServer("deleteObjects", function() return deletePool("CObject") end) + +regServer("notifyAll", function(_, payload) + 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) + +regServer("giveMoneyAll", function(_, payload) + 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) + +---@param src number +---@param data table +---@return AdminActionResult +function Actions.ServerManagement(src, data) + data = data or {} + + local action = type(data.action) == "string" and data.action or "unknown" + + -- Any client can invoke a server callback, so a denial here is a genuine + -- abuse signal and is worth recording. + if not Helpers.hasFeaturePermission(src, "serverManagement") then + Logs.record({ namespace = "serverManagement", action = action, actor = src, + success = false, err = "Insufficient Permissions" }) + return { success = false, err = "Insufficient Permissions" } + end + + local handler = ServerHandlers[action] + if not handler then + return { success = false, err = "Unknown server action." } + end + + if not Helpers.hasFeaturePermission(src, getServerActionPermission(action)) then + Logs.record({ namespace = "serverManagement", action = action, actor = src, + success = false, err = "Insufficient Permissions" }) + return { success = false, err = "Insufficient Permissions" } + end + + local result = handler(src, data.payload or {}) + + Logs.record({ + namespace = "serverManagement", + action = action, + actor = src, + success = type(result) ~= "table" or result.success ~= false, + err = type(result) == "table" and result.err or nil, + payload = data.payload, + }) + + return result +end + +Helpers.registerCallback("esx-adminmenu:server:serverAction", function(source, data) + return Actions.ServerManagement(source, data) +end) + +-- PLAYER MANAGEMENT + +-- action -> { offline = boolean?, handler = function(ctx) -> AdminActionResult }. +-- ctx = { src, targetId, target, payload }. Permission is sourced once from +-- Config.PlayerActions.ActionPermissions by the dispatcher, so a handler never +-- re-checks it and a new action cannot silently ship without a gate. +local PlayerHandlers = {} + +local function regPlayer(action, spec) + PlayerHandlers[action] = spec +end + +local function moneyHandler(ctx, isGive) + local amount = normalizeMoneyAmount(ctx.payload.amount) + local account = normalizeMoneyAccount(ctx.payload.account) + + if amount <= 0 then + return { success = false, err = "Amount must be greater than 0.", playerOnline = true } + end + + local method + if isGive then + method = account == "money" and "addMoney" or "addAccountMoney" + else + method = account == "money" and "removeMoney" or "removeAccountMoney" + end + + -- Callable, not type()=="function": xPlayer methods reach us as function + -- references across the es_extended resource boundary. + if not Helpers.isCallable(ctx.target[method]) then + return { success = false, err = "This ESX version does not expose " .. method .. ".", playerOnline = true } + end + + local ok = pcall(function() + if account == "money" then + ctx.target[method](amount, "Admin menu") + else + ctx.target[method](account, amount, "Admin menu") + end + end) + + if not ok then + return { success = false, err = "Failed to update balance.", playerOnline = true } + end + + return { success = true, playerOnline = true } +end + +regPlayer("deleteCharacter", { offline = true, handler = function(ctx) + local identifier = trimString(ctx.payload.identifier) + + if not isValidCharacterIdentifier(identifier) then + return { success = false, err = "Missing character identifier." } + end + + if ctx.target then + local targetIdentifier = getOnlineCharacterIdentifier(ctx.target, ctx.targetId) + + if targetIdentifier ~= identifier then + return { success = false, err = "Character identifier does not match the selected player.", playerOnline = true } + end + end + + async(function() + Helpers.safeUpdate("DELETE FROM users WHERE identifier = ?", { identifier }) + Helpers.safeUpdate("DELETE FROM owned_vehicles WHERE owner = ?", { identifier }) + end) + + if ctx.targetId and Helpers.isOnline(ctx.targetId) then + DropPlayer(ctx.targetId, "Character deleted by an admin.") + end + + return { success = true, playerOnline = ctx.targetId and Helpers.isOnline(ctx.targetId) or false } +end }) + +regPlayer("giveMoney", { handler = function(ctx) return moneyHandler(ctx, true) end }) +regPlayer("takeMoney", { handler = function(ctx) return moneyHandler(ctx, false) end }) + +regPlayer("setHealth", { handler = function(ctx) + TriggerClientEvent("esx-adminmenu:client:setPlayerStats", ctx.targetId, clampNumber(ctx.payload.amount, 0, 100, 100), nil) + return { success = true, playerOnline = true } +end }) + +regPlayer("setArmor", { handler = function(ctx) + TriggerClientEvent("esx-adminmenu:client:setPlayerStats", ctx.targetId, nil, clampNumber(ctx.payload.amount, 0, 100, 100)) + return { success = true, playerOnline = true } +end }) + +regPlayer("cleanInventory", { handler = function(ctx) + if not Helpers.isCallable(ctx.target.getInventory) then + return { success = false, err = "This ESX version does not expose getInventory.", playerOnline = true } + end + + local inventory = ctx.target.getInventory() + if type(inventory) ~= "table" then + return { success = false, err = "Failed to read inventory.", playerOnline = true } + end + + for i = 1, #inventory do + local item = inventory[i] + if item.count and item.count > 0 then + pcall(function() + ctx.target.removeInventoryItem(item.name, item.count) + end) + end + end + + return { success = true, playerOnline = true } +end }) + +regPlayer("killPlayer", { handler = function(ctx) + TriggerClientEvent("esx-adminmenu:client:kill", ctx.targetId) + return { success = true, playerOnline = true } +end }) + +regPlayer("revivePlayer", { handler = function(ctx) + revivePlayer(ctx.targetId) + return { success = true, playerOnline = true } +end }) + +regPlayer("freezePlayer", { handler = function(ctx) + TriggerClientEvent("esx-adminmenu:client:setFrozen", ctx.targetId, ctx.payload.enabled == true) + return { success = true, playerOnline = true } +end }) + +regPlayer("setModel", { handler = function(ctx) + local model = limitString(ctx.payload.model, 64) + if model == "" then + return { success = false, err = "Missing model.", playerOnline = true } + end + + TriggerClientEvent("esx-adminmenu:client:setModel", ctx.targetId, model) + return { success = true, playerOnline = true } +end }) + +regPlayer("openClothing", { handler = function(ctx) + TriggerClientEvent("esx-adminmenu:client:openClothing", ctx.targetId) + return { success = true, playerOnline = true } +end }) + +regPlayer("giveAllWeapons", { handler = function(ctx) + local weapons = Config.AdminWeapons or {} + + for i = 1, #weapons do + local weapon = weapons[i] + local name = weapon.name + + if name and name ~= "" then + if ctx.target.hasWeapon and ctx.target.hasWeapon(name) and ctx.target.addWeaponAmmo then + pcall(function() + ctx.target.addWeaponAmmo(name, tonumber(weapon.ammo) or 250) + end) + elseif ctx.target.addWeapon then + pcall(function() + ctx.target.addWeapon(name, tonumber(weapon.ammo) or 250) + end) + end + end + end + + return { success = true, playerOnline = true } +end }) + +regPlayer("setRoutingBucket", { handler = function(ctx) + local bucket = math.floor(clampNumber(ctx.payload.bucket, 0, getLimits().MaxRoutingBucket or 2147483647, 0)) + SetPlayerRoutingBucket(ctx.targetId, bucket) + return { success = true, playerOnline = true } +end }) + +regPlayer("setRadio", { handler = function(ctx) + local channel = math.floor(clampNumber(ctx.payload.channel, 0, getLimits().MaxRadioChannel or 10000, 0)) + TriggerClientEvent("esx-adminmenu:client:setRadioChannel", ctx.targetId, channel) + return { success = true, playerOnline = true } +end }) + +regPlayer("setJob", { handler = function(ctx) + local job = limitString(ctx.payload.job, 48) + local grade = math.floor(clampNumber(ctx.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 ctx.target.setJob then + return { success = false, err = "This ESX version does not expose setJob.", playerOnline = true } + end + + local ok, err = pcall(function() + ctx.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 }) + +regPlayer("setName", { handler = function(ctx) + local firstName = limitString(trimString(ctx.payload.firstName), 32) + local lastName = limitString(trimString(ctx.payload.lastName), 32) + + if firstName == "" or lastName == "" then + return { success = false, err = "Missing first or last name.", playerOnline = true } + end + + local identifier = getPlayerIdentifier(ctx.target) + if not identifier then + return { success = false, err = "Missing character identifier.", playerOnline = true } + end + + Helpers.safeUpdate("UPDATE users SET firstname = ?, lastname = ? WHERE identifier = ?", { + firstName, + lastName, + identifier, + }) + + if ctx.target.setName then + pcall(function() + ctx.target.setName(firstName .. " " .. lastName) + end) + end + + return { success = true, playerOnline = true } +end }) + +local function statusHandler(ctx, statusName) + setStatusMeta(ctx.target, ctx.targetId, statusName, ctx.payload.amount) + return { success = true, playerOnline = true } +end + +regPlayer("setThirst", { handler = function(ctx) return statusHandler(ctx, "thirst") end }) +regPlayer("setHunger", { handler = function(ctx) return statusHandler(ctx, "hunger") end }) + +local function aceHandler(ctx, isAdd) + local group = normalizeAceGroup(ctx.payload.group or ctx.payload.permission) + if not group then + return { success = false, err = "Invalid ACE group.", playerOnline = true } + end + + local identifier = Helpers.getPlayerLicenseIdentifier(ctx.targetId) + if not isValidIdentifier(identifier) then + return { success = false, err = "Missing player identifier.", playerOnline = true } + end + + local command = isAdd and "add_principal" or "remove_principal" + ExecuteCommand(("%s identifier.%s group.%s"):format(command, identifier, group)) + + return { success = true, playerOnline = true } +end + +regPlayer("aceAdd", { handler = function(ctx) return aceHandler(ctx, true) end }) +regPlayer("aceRemove", { handler = function(ctx) return aceHandler(ctx, false) end }) + +regPlayer("troll", { handler = function(ctx) + local trollAction = trimString(ctx.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", ctx.targetId, trollAction) + return { success = true, playerOnline = true } +end }) + +---@param src number +---@param data table +---@return AdminActionResult +function Actions.PlayerAction(src, data) + data = data or {} + + local action = type(data.action) == "string" and data.action or "unknown" + + if not Helpers.hasPermission(src) then + Logs.record({ namespace = "playerActions", action = action, actor = src, + success = false, err = "Insufficient Permissions" }) + return { success = false, err = "Insufficient Permissions" } + end + + local spec = PlayerHandlers[data.action] + if not spec then + return { success = false, err = "Unknown player action.", playerOnline = true } + end + + local targetId = getTargetId(data) + local target = targetId and ESX.GetPlayerFromId(targetId) or nil + + local permission = Helpers.getActionPermission("playerActions", data.action) + if permission and not Helpers.hasFeaturePermission(src, permission) then + Logs.record({ namespace = "playerActions", action = action, actor = src, target = targetId, + success = false, err = "Insufficient Permissions" }) + return { success = false, err = "Insufficient Permissions", playerOnline = target ~= nil } + end + + if not spec.offline and not target then + return { success = false, err = "Player Not Online", playerOnline = false } + end + + -- Resolved before the handler runs: deleteCharacter and friends drop the + -- player, after which the target can no longer be identified. + local targetIdentifier = targetId and Helpers.getPlayerLicenseIdentifier(targetId) or nil + local targetName = targetId and GetPlayerName(targetId) or nil + + local result = spec.handler({ src = src, targetId = targetId, target = target, payload = data.payload or {} }) + + -- Acting on someone makes them "recent" straight away, so admins can find + -- them again without waiting for a disconnect. Snapshotted after the handler + -- so the entry reflects the post-action state (money, health, job...). + if target and targetId and type(result) == "table" and result.success then + Helpers.addRecentPlayer(targetId, "online") + end + + Logs.record({ + namespace = "playerActions", + action = action, + actor = src, + target = targetIdentifier, + targetName = targetName, + success = type(result) ~= "table" or result.success ~= false, + err = type(result) == "table" and result.err or nil, + payload = data.payload, + }) + + return result +end + +Helpers.registerCallback("esx-adminmenu:server:playerAction", function(source, data) + return 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..a9881eb9 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/ban_cache.lua @@ -0,0 +1,212 @@ +BanCache = {} + +-- Flat list of ban records (each may carry an `identifiers` array of raw +-- identifier strings), plus an index mapping every identifier -> ban refs so a +-- connecting player is matched on ANY of their identifiers, not just license. +local banList = {} +local index = {} +local generation = 0 + +-- Bumped on every mutation so read-side caches (e.g. the sorted ban page) can +-- detect staleness without re-sorting on every request. +local function bump() + generation = generation + 1 +end + +function BanCache.getGeneration() + return generation +end + +local function normalizeTimestamp(value) + return Helpers.normalizeTimestamp(value) +end + +-- Single expiry predicate shared by the reader and the maintenance prune. +local function isExpired(ban, now) + local expires = normalizeTimestamp(ban.expires_at) + return expires ~= nil and now >= expires +end + +-- Every identifier a ban should be matchable by: the primary plus its array, deduped. +local function banIdentifiers(ban) + local seen = {} + local out = {} + + local function push(id) + if type(id) == "string" and id ~= "" and not seen[id] then + seen[id] = true + out[#out + 1] = id + end + end + + push(ban.identifier) + if type(ban.identifiers) == "table" then + for i = 1, #ban.identifiers do + push(ban.identifiers[i]) + end + end + + return out +end + +local function addToIndex(ban) + for _, id in ipairs(banIdentifiers(ban)) do + if not index[id] then + index[id] = {} + end + index[id][#index[id] + 1] = ban + end +end + +local function rebuildIndex() + index = {} + for i = 1, #banList do + addToIndex(banList[i]) + end +end + +-- Maintenance: owns all expiry-driven cache mutation so readers stay side-effect free. +function BanCache.prune() + local now = os.time() + local changed = false + + for i = #banList, 1, -1 do + if isExpired(banList[i], now) then + table.remove(banList, i) + changed = true + end + end + + if changed then + rebuildIndex() + bump() + end +end + +function BanCache.load() + banList = {} + index = {} + + local rows = Helpers.safeQuery("SELECT * FROM bans ORDER BY id ASC") + if rows then + for i = 1, #rows do + local ban = rows[i] + + if type(ban.identifiers) == "string" and ban.identifiers ~= "" then + local ok, decoded = pcall(json.decode, ban.identifiers) + ban.identifiers = (ok and type(decoded) == "table") and decoded or nil + end + + banList[#banList + 1] = ban + addToIndex(ban) + end + end + + bump() +end + +-- Read-only: most recent still-active ban matching this identifier, or nil. +-- Expired entries are left for BanCache.prune, never removed on read. +function BanCache.get(identifier) + if type(identifier) ~= "string" or identifier == "" then + return nil + end + + local list = index[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 not (expires and now >= expires) then + 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 + + return nil +end + +function BanCache.add(ban) + if not ban.banned_at then + ban.banned_at = os.time() + end + + if type(ban.identifier) ~= "string" or ban.identifier == "" then + return + end + + banList[#banList + 1] = ban + addToIndex(ban) + bump() +end + +-- Bans are keyed for update/remove by their primary identifier (license). +function BanCache.updateExpiry(identifier, newExpiry) + if type(identifier) ~= "string" then + return + end + + local changed = false + + for i = 1, #banList do + if banList[i].identifier == identifier then + banList[i].expires_at = newExpiry + changed = true + end + end + + if changed then + -- Drop any that just became expired and refresh the index/generation. + BanCache.prune() + bump() + end +end + +function BanCache.remove(identifier) + if type(identifier) ~= "string" then + return + end + + local changed = false + + for i = #banList, 1, -1 do + if banList[i].identifier == identifier then + table.remove(banList, i) + changed = true + end + end + + if changed then + rebuildIndex() + bump() + end +end + +-- Flat ban list, consumed by the active-ban pagination in Helpers. +function BanCache.getAll() + return banList +end + +-- Low-frequency maintenance so expired entries never accumulate unbounded. +CreateThread(function() + while true do + Wait(60000) + BanCache.prune() + end +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..638e220e --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/commands.lua @@ -0,0 +1,374 @@ +-- 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 + +-- Helper commands that copy a computed string to the clipboard all share the +-- same player/permission/ped guards; only the computed text differs. +local function registerCopyCommand(names, help, computeText) + ESX.RegisterCommand(names, 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 text, err = computeText(xPlayer, ped) + if not text then + showError(err or "Action failed.") + return + end + + TriggerClientEvent("esx-adminmenu:client:copyToClipboard", xPlayer.source, text) + end, false, { help = help }) +end + +registerCopyCommand("vec2", "Copy your current position as vec2(x, y)", function(_, ped) + local coords = GetEntityCoords(ped) + return string.format("vec2(%.2f, %.2f)", coords.x, coords.y) +end) + +registerCopyCommand("vec3", "Copy your current position as vec3(x, y, z)", function(_, ped) + local coords = GetEntityCoords(ped) + return string.format("vec3(%.2f, %.2f, %.2f)", coords.x, coords.y, coords.z) +end) + +registerCopyCommand("vec4", "Copy your current position as vec4(x, y, z, heading)", function(_, ped) + local coords = GetEntityCoords(ped) + return string.format("vec4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, GetEntityHeading(ped)) +end) + +registerCopyCommand("heading", "Copy your current heading.", function(_, ped) + return string.format("%.2f", GetEntityHeading(ped)) +end) + +registerCopyCommand({ "coords", "copycoords" }, "Copy your current coordinates and heading as fields.", function(_, ped) + local coords = GetEntityCoords(ped) + local heading = GetEntityHeading(ped) + return string.format("x = %.2f, y = %.2f, z = %.2f, heading = %.2f", coords.x, coords.y, coords.z, heading) +end) + +registerCopyCommand({ "rot", "rotation" }, "Copy your current rotation as vec3(x, y, z).", function(_, ped) + local rotation = GetEntityRotation(ped, 2) + return string.format("vec3(%.2f, %.2f, %.2f)", rotation.x, rotation.y, rotation.z) +end) + +registerCopyCommand({ "model", "entitymodel" }, "Copy your current ped or vehicle model hash.", function(_, ped) + local vehicle = GetVehiclePedIsIn(ped, false) + local entity = vehicle ~= 0 and vehicle or ped + return tostring(GetEntityModel(entity)) +end) + +registerCopyCommand({ "vehplate", "copyplate" }, "Copy the current vehicle plate.", function(_, ped) + local vehicle = GetVehiclePedIsIn(ped, false) + if vehicle == 0 then + return nil, "You must be in a vehicle." + end + return ESX.Math.Trim(GetVehicleNumberPlateText(vehicle)) +end) + +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 or type(props) ~= "table" 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 + + local maxBytes = tonumber(Config.AdminLimits and Config.AdminLimits.MaxVehiclePropsBytes) or 16384 + local encoded = json.encode(props) + if type(encoded) ~= "string" or #encoded > maxBytes then + showError("Vehicle properties are too large.") + return + end + + MySQL.insert("INSERT INTO owned_vehicles (owner, plate, vehicle) VALUES (?, ?, ?)", { + xPlayer.getIdentifier(), + plate, + encoded, + }, function() + 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..6dbe5590 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/database.lua @@ -0,0 +1,94 @@ +-- Initiate the database if it already doesn't exist. +local function initDB() + -- BANS TABLE + Helpers.safeQuery([[ + CREATE TABLE IF NOT EXISTS bans ( + id INT AUTO_INCREMENT PRIMARY KEY, + identifier VARCHAR(64) NOT NULL, + identifiers TEXT 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; + ]]) + + -- ADMIN ACTION LOG + -- Replaces the former `kicks` table, which was written to but never read + -- back by anything. Any existing `kicks` table is deliberately left in + -- place: a resource dropping tables on start is a footgun. + Helpers.safeQuery([[ + CREATE TABLE IF NOT EXISTS admin_logs ( + id INT AUTO_INCREMENT PRIMARY KEY, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + actor_identifier VARCHAR(64) NOT NULL, + actor_name VARCHAR(64) NULL, + namespace VARCHAR(32) NOT NULL, + action VARCHAR(64) NOT NULL, + target_identifier VARCHAR(64) NULL, + target_name VARCHAR(64) NULL, + success TINYINT(1) NOT NULL DEFAULT 1, + error VARCHAR(191) NULL, + payload TEXT NULL, + + INDEX idx_admin_logs_actor (actor_identifier), + INDEX idx_admin_logs_target (target_identifier), + INDEX idx_admin_logs_action (namespace, action), + INDEX idx_admin_logs_created (created_at) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + ]]) + + local hasBannedAt = Helpers.safeScalar( + [[SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = 'bans' + AND COLUMN_NAME = 'banned_at']] + ) + + if tonumber(hasBannedAt) == 0 then + Helpers.safeQuery("ALTER TABLE bans ADD COLUMN banned_at TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP") + end + + local hasIdentifiers = Helpers.safeScalar( + [[SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = 'bans' + AND COLUMN_NAME = 'identifiers']] + ) + + if tonumber(hasIdentifiers) == 0 then + Helpers.safeQuery("ALTER TABLE bans ADD COLUMN identifiers TEXT NULL") + end + + Helpers.safeUpdate([[ + 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' + ]]) + + Helpers.safeUpdate([[ + 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 + -- Isolate schema setup from cache warmup: a failed migration must not + -- prevent ban enforcement from loading (and vice versa). + pcall(initDB) + pcall(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..5fac7b27 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/events.lua @@ -0,0 +1,47 @@ +AddEventHandler("playerConnecting", function(name, _, deferrals) + deferrals.defer() + + local src = source + Wait(0) + deferrals.update(Helpers.getTranslation("finalizing_connection")) + + local ok, ban = pcall(function() + -- Match on ANY of the connecting player's identifiers, not just license. + local identifiers = GetPlayerIdentifiers(src) or {} + for i = 1, #identifiers do + local hit = Helpers.isBanned(identifiers[i]) + if hit then + return hit + end + end + return nil + end) + + if not ok then + -- Fail-open: a ban-cache/DB hiccup must resolve the deferral, never hang the join. + print(("[esx-adminmenu] Ban check failed for %s: %s"):format(tostring(GetPlayerName(src) or src), tostring(ban))) + deferrals.done() + return + end + + 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.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..e5304325 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/helpers.lua @@ -0,0 +1,915 @@ +Helpers = {} + +-- No-op logging stub, replaced by server/logs.lua when it loads. +-- helpers.lua is the first server script, so this guarantees the dispatchers in +-- actions.lua always have something to call. Recording an admin action must +-- never be able to break the action itself: without this, a logs.lua that fails +-- to load takes every moderation command down with it. +Logs = Logs or { + record = function() end, + flush = function() end, + purge = function() return 0 end, + query = function() return { logs = {}, hasMore = false, nextOffset = 0, limit = 0 } end, +} + +local translations = nil +local allowedGroups = {} +local Spectators = {} +local impounds = nil +local ADMIN_LIMITS = Config.AdminLimits or {} +local MAX_VEHICLE_PAGE_SIZE = tonumber(ADMIN_LIMITS.VehiclePageSize) or 100 +local MAX_BAN_PAGE_SIZE = tonumber(ADMIN_LIMITS.BanPageSize) or 100 +local recentPlayers = {} +local MAX_RECENT_PLAYERS = tonumber(ADMIN_LIMITS.RecentPlayersCap) or 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 + +Helpers.trim = trim + +-- ============================================= +-- Safe DB wrappers: an await that raises must never abort a callback mid-flight. +-- ============================================= +function Helpers.safeQuery(query, params) + local ok, result = pcall(MySQL.query.await, query, params) + if not ok then + print(("[esx-adminmenu] DB query failed: %s"):format(tostring(result))) + return nil + end + return result +end + +function Helpers.safeScalar(query, params) + local ok, result = pcall(MySQL.scalar.await, query, params) + if not ok then + print(("[esx-adminmenu] DB scalar failed: %s"):format(tostring(result))) + return nil + end + return result +end + +function Helpers.safeUpdate(query, params) + local ok, result = pcall(MySQL.update.await, query, params) + if not ok then + print(("[esx-adminmenu] DB update failed: %s"):format(tostring(result))) + return nil + end + return result +end + +-- Wraps a server callback so a raised error still answers the client exactly once. +-- The handler receives (source, ...) and RETURNS its response table. +--- True when `value` can be called. +--- ESX arrives through exports["es_extended"]:getSharedObject(), so every +--- xPlayer method crosses a resource boundary and reaches us as a *function +--- reference*: a table carrying a __call metamethod, not a real function. +--- `type(x) == "function"` is therefore always false for xPlayer methods and +--- must never be used to probe them. +--- es_extended exposes ESX.IsFunctionReference for this, but it is reimplemented +--- here so the resource keeps working on builds that predate it. +--- @param value any +--- @return boolean +function Helpers.isCallable(value) + if type(value) == "function" then + return true + end + + if type(value) ~= "table" then + return false + end + + local meta = getmetatable(value) + return type(meta) == "table" and type(meta.__call) == "function" +end + +function Helpers.registerCallback(name, handler) + ESX.RegisterServerCallback(name, function(source, cb, ...) + local ok, result = pcall(handler, source, ...) + if not ok then + print(("[esx-adminmenu] Callback %s errored: %s"):format(name, tostring(result))) + cb({ success = false, err = "Internal error." }) + return + end + cb(result) + end) +end + +-- Single accessor for the three action -> feature permission maps. +local ACTION_PERMISSION_MAPS = { + adminMenu = function() return Config.AdminMenu and Config.AdminMenu.ActionPermissions or {} end, + playerActions = function() return Config.PlayerActions and Config.PlayerActions.ActionPermissions or {} end, + serverManagement = function() return Config.ServerManagement and Config.ServerManagement.ActionPermissions or {} end, +} + +function Helpers.getActionPermission(namespace, action) + local getter = ACTION_PERMISSION_MAPS[namespace] + if not getter then + return nil + end + return getter()[action] +end + +function Helpers.getFormattedPlayTime(playtime) + playtime = tonumber(playtime) or 0 + if playtime <= 0 then + return { days = 0, hours = 0, minutes = 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 + +--- Human-readable server uptime. +--- The previous "%02d:%02d:%02d" of days:hours:minutes read as a HH:MM:SS clock, +--- so 8 minutes of uptime displayed as "00:00:08" and looked like 8 seconds. +--- Units are now explicit, which removes the ambiguity entirely. +function Helpers.formatServerUptime(seconds) + local total = math.max(0, math.floor(tonumber(seconds) or 0)) + local days = math.floor(total / 86400) + local hours = math.floor((total % 86400) / 3600) + local minutes = math.floor((total % 3600) / 60) + + if days > 0 then + return ("%dd %02dh"):format(days, hours) + end + + if hours > 0 then + return ("%dh %02dm"):format(hours, minutes) + end + + if minutes > 0 then + return ("%dm"):format(minutes) + end + + return ("%ds"):format(total % 60) +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 + +-- Collects the identifier strings a ban should capture and be matched by, +-- filtered to the types enabled in Config.Ban.Identifiers. +function Helpers.getBanIdentifiers(source) + local wanted = (Config.Ban and Config.Ban.Identifiers) or {} + local result = {} + local seen = {} + local identifiers = GetPlayerIdentifiers(source) or {} + + for i = 1, #identifiers do + local id = identifiers[i] + local prefix = type(id) == "string" and id:match("^([^:]+):") or nil + + if prefix and wanted[prefix] and not seen[id] then + seen[id] = true + result[#result + 1] = id + end + end + + return result +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 + +local function loadLastSeenFor(identifiers) + if #identifiers == 0 then + return {} + end + + local placeholders = {} + for i = 1, #identifiers do + placeholders[i] = "?" + end + + local rows = Helpers.safeQuery( + ("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 + +--- Snapshots a player into the Recent Players list. +--- @param source number +--- @param status? string "online" when the player is still connected (an admin +--- just acted on them), anything else records them as gone. Defaults to +--- "offline" so the playerDropped path keeps its original behaviour. +function Helpers.addRecentPlayer(source, status) + 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 + local isOnline = status == "online" + + upsertRecentPlayer({ + -- A still-connected player keeps their server id so the UI can act on + -- them live; playerDropped later upserts the same identifier as offline. + status = isOnline and "online" or "offline", + id = isOnline and source or 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 + +-- Derives the key set directly from the active locale table so en.lua stays the +-- single source of truth (no hand-maintained key mirror to drift out of sync). +function Helpers.getTranslations() + if not translations then + translations = {} + + -- Resolve against the full English key set so a partial community + -- translation can never drop keys. es_extended's Translate has no + -- per-key English fallback: a key missing from the active locale + -- returns a "Translation [xx][key] does not exist" placeholder, so we + -- fall back to the English string here. + local english = Locales and Locales["en"] or {} + for key in pairs(english) do + local value = Translate(key) + if type(value) ~= "string" or value:sub(1, 13) == "Translation [" then + value = english[key] + end + translations[key] = value + 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 + +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, canSeeSensitive) + local vehicleProps = decodeVehicleProps(row.vehicle) + local vehicleHash = tonumber(vehicleProps.model) + + if not vehicleHash then + return nil + end + + return { + plate = row.plate, + owner = canSeeSensitive and row.owner or nil, + 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, canSeeSensitive) + 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 + -- Prefix (anchored) match so the plate/owner/type indexes can be used + -- instead of forcing a full table scan with a leading wildcard. + local pattern = search .. "%" + + -- Only expose owner as a searchable/returned field to sensitive-tier admins. + if canSeeSensitive then + where = " WHERE plate LIKE ? OR owner LIKE ? OR type LIKE ?" + params[#params + 1] = pattern + params[#params + 1] = pattern + params[#params + 1] = pattern + else + where = " WHERE plate LIKE ? OR type LIKE ?" + params[#params + 1] = pattern + params[#params + 1] = pattern + end + end + + params[#params + 1] = limit + 1 + params[#params + 1] = offset + + local rows = Helpers.safeQuery( + ("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], canSeeSensitive) + + 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 + + -- The raw identifier set stays server-side; it is not sent to the ban list UI. + normalized.identifiers = nil + + 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 + +-- Caches the SORTED set of active raw ban records, rebuilt only when the ban +-- cache changes (via the generation counter). Only the requested page is +-- normalized, per request, so the remaining-time countdown stays fresh while +-- the O(n log n) sort is amortized across pages. +local sortedActiveCache = nil +local sortedActiveGen = -1 + +local function getSortedActiveBanRecords() + local gen = BanCache.getGeneration and BanCache.getGeneration() or 0 + if sortedActiveCache and sortedActiveGen == gen then + return sortedActiveCache + end + + local all = BanCache.getAll() or {} + local now = os.time() + local active = {} + + for i = 1, #all do + local expires = normalizeTimestamp(all[i].expires_at) + if not (expires and now >= expires) then + active[#active + 1] = all[i] + end + end + + table.sort(active, function(a, b) + return (tonumber(a.id) or 0) > (tonumber(b.id) or 0) + end) + + sortedActiveCache = active + sortedActiveGen = gen + return active +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 records = getSortedActiveBanRecords() + local now = os.time() + + local result = {} + local lastIndex = math.min(#records, offset + limit) + + for i = offset + 1, lastIndex do + result[#result + 1] = (normalizeBanRecord(records[i], now)) + end + + return { + bans = result, + hasMore = lastIndex < #records, + 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 randomFrom(charset, length) + local parts = {} + for i = 1, math.max(0, length) do + parts[i] = charset[math.random(#charset)] + end + return table.concat(parts) +end + +function Helpers.isPlateTaken(plate) + return Helpers.safeScalar("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 " " + local attempts = tonumber(ADMIN_LIMITS.PlateGenAttempts) or 50 + + for _ = 1, attempts do + local generatedPlate = string.upper(randomFrom(Charset, letters) .. separator .. randomFrom(NumberCharset, numbers)) + + if #generatedPlate > 8 then + generatedPlate = generatedPlate:sub(1, 8) + end + + if not Helpers.isPlateTaken(generatedPlate) then + return generatedPlate + end + end + + return string.upper(randomFrom(Charset, letters) .. separator .. randomFrom(NumberCharset, numbers)):sub(1, 8) +end + +-- Only memoize a successful, non-empty result so a start-order race with +-- esx_garage self-heals instead of caching an empty list forever. +function Helpers.getImpounds() + if impounds and next(impounds) then + return impounds + end + + local ok, result = pcall(function() + return exports["esx_garage"]:getImpounds() + end) + + if ok and type(result) == "table" and next(result) then + impounds = result + return impounds + end + + return {} +end + +return Helpers diff --git a/[esx_addons]/esx_adminmenu/server/logs.lua b/[esx_addons]/esx_adminmenu/server/logs.lua new file mode 100644 index 00000000..a7612616 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/logs.lua @@ -0,0 +1,483 @@ +-- Admin action log. +-- +-- Recording must never slow down or break an admin action, so entries are +-- queued in memory and flushed to the database in batches by a background +-- thread. Every database call goes through Helpers.safeQuery, so a dead +-- database degrades into lost log lines, never into a failed moderation. + +Logs = {} + +-- Queue held as an explicit head/tail window instead of table.remove(t, 1), +-- which is O(n) and would get expensive at the cap. +local queue = {} +local head, tail = 1, 0 +local dropped = 0 +local flushing = false + +local INSERT_COLUMNS = +"INSERT INTO admin_logs (created_at, actor_identifier, actor_name, namespace, action, target_identifier, target_name, success, error, payload) VALUES " +local COLUMN_COUNT = 10 + +--- Column values in INSERT order. Holes are expected: target_name, error and +--- payload are frequently nil. +local function rowValues(row) + return { + row.at, + row.actor_identifier, + row.actor_name, + row.namespace, + row.action, + row.target_identifier, + row.target_name, + row.success, + row.error, + row.payload, + } +end + +--- Appends one row's placeholders and parameters. +--- A nil is written as a literal NULL in the statement instead of being bound, +--- because `params[#params + 1] = nil` appends nothing in Lua: the value is +--- silently dropped and every following parameter shifts one column left. +local function appendRow(row, placeholders, params) + local values = rowValues(row) + local parts = {} + + for i = 1, COLUMN_COUNT do + local value = values[i] + + if value == nil then + parts[i] = "NULL" + elseif i == 1 then + parts[i] = "FROM_UNIXTIME(?)" + params[#params + 1] = value + else + parts[i] = "?" + params[#params + 1] = value + end + end + + placeholders[#placeholders + 1] = "(" .. table.concat(parts, ",") .. ")" +end + +-- Never persisted: these either leak network identity or duplicate a column. +local REDACTED_KEYS = { + ip = true, + identifiers = true, + license = true, + token = true, + password = true, + pincode = true, +} + +local function config() + return Config.Logs or {} +end + +local function isEnabled() + return config().Enabled ~= false +end + +local function queueCount() + return tail - head + 1 +end + +--- Builds a compact, safe JSON payload. +--- Nested tables are collapsed rather than serialised: a vehicle props blob is +--- several kilobytes and has no forensic value in a log line. +local function encodePayload(payload) + if type(payload) ~= "table" then + return nil + end + + local clean = {} + local empty = true + + for key, value in pairs(payload) do + if not REDACTED_KEYS[key] then + local valueType = type(value) + + if valueType == "string" or valueType == "number" or valueType == "boolean" then + clean[key] = value + empty = false + elseif valueType == "table" then + clean[key] = "<table>" + empty = false + end + end + end + + if empty then + return nil + end + + local ok, encoded = pcall(json.encode, clean) + if not ok or type(encoded) ~= "string" then + return nil + end + + local maxBytes = tonumber(config().MaxPayloadBytes) or 2048 + if #encoded > maxBytes then + -- Cutting the string mid-token would store invalid JSON, so replace it + -- with a marker that still parses. + return ('{"_truncated":true,"bytes":%d}'):format(#encoded) + end + + return encoded +end + +local function shouldRecord(action) + local ignore = config().Ignore + return not (ignore and ignore[action]) +end + +-- Per-source sliding window. Server callbacks are reachable by any client, so +-- without this a non-admin could spam denied attempts until the bounded queue +-- evicted every real entry. +local rateWindow = 0 +local rateCounts = {} +local rateMuted = {} + +local function withinRate(actor) + local limit = tonumber(config().MaxPerMinutePerActor) or 120 + if limit <= 0 then + return true + end + + local key = tostring(actor or "unknown") + local window = math.floor(os.time() / 60) + + if window ~= rateWindow then + rateWindow = window + rateCounts = {} + rateMuted = {} + end + + local count = (rateCounts[key] or 0) + 1 + rateCounts[key] = count + + if count > limit then + -- Announce the mute once per window rather than on every dropped entry. + if not rateMuted[key] then + rateMuted[key] = true + print(("[esx-adminmenu] Log rate limit hit for %s, muted for this minute"):format(key)) + end + return false + end + + return true +end + +--- Resolves a player source (or a raw identifier string) into identifier + name. +local function resolveActor(value) + if type(value) == "string" then + return value, nil + end + + local src = tonumber(value) + if not src or src <= 0 then + return nil, nil + end + + local identifier = Helpers.getPlayerLicenseIdentifier and Helpers.getPlayerLicenseIdentifier(src) or nil + local name = GetPlayerName(src) + + return identifier, name +end + +--- Queues one admin action. Cheap, allocation-light, and never raises. +--- @param entry table namespace, action, actor, target, targetName, success, err, payload +function Logs.record(entry) + if not isEnabled() or type(entry) ~= "table" then + return + end + + local action = entry.action + if type(action) ~= "string" or action == "" or not shouldRecord(action) then + return + end + + if not withinRate(entry.actor) then + return + end + + local ok, row = pcall(function() + local actorIdentifier, actorName = resolveActor(entry.actor) + local targetIdentifier, targetName = resolveActor(entry.target) + + return { + at = os.time(), + actor_identifier = actorIdentifier or "unknown", + actor_name = actorName or entry.actorName, + namespace = tostring(entry.namespace or "unknown"), + action = action, + target_identifier = targetIdentifier, + target_name = targetName or entry.targetName, + success = entry.success ~= false and 1 or 0, + error = entry.err and tostring(entry.err):sub(1, 190) or nil, + payload = encodePayload(entry.payload), + } + end) + + if not ok or not row then + return + end + + -- Bounded: if the database is unreachable we shed the oldest entries rather + -- than grow until the server runs out of memory. + local maxQueue = tonumber(config().MaxQueue) or 500 + while queueCount() >= maxQueue do + queue[head] = nil + head = head + 1 + dropped = dropped + 1 + end + + tail = tail + 1 + queue[tail] = row +end + +local function buildWebhookEmbeds(rows) + local allowed = config().Webhook and config().Webhook.Actions + if not allowed then + return nil + end + + local embeds = {} + + for i = 1, #rows do + -- Discord rejects payloads with more than 10 embeds. + if #embeds >= 10 then + break + end + + local row = rows[i] + if allowed[row.action] then + local lines = { + ("**Admin:** %s (`%s`)"):format(row.actor_name or "?", row.actor_identifier or "?"), + } + + if row.target_identifier then + lines[#lines + 1] = ("**Target:** %s (`%s`)"):format(row.target_name or "?", row.target_identifier) + end + + if not row.success then + lines[#lines + 1] = ("**Failed:** %s"):format(row.error or "unknown") + end + + if row.payload then + lines[#lines + 1] = ("```json\n%s\n```"):format(row.payload:sub(1, 900)) + end + + embeds[#embeds + 1] = { + title = ("%s / %s"):format(row.namespace, row.action), + description = table.concat(lines, "\n"), + color = row.success == 1 and 3066993 or 15158332, + } + end + end + + return #embeds > 0 and embeds or nil +end + +local function postWebhook(rows) + local webhook = config().Webhook + local url = webhook and webhook.Url + + -- Only https, so a misconfigured value cannot be used to probe the local + -- network from the server process. + if type(url) ~= "string" or not url:match("^https://") then + return + end + + local embeds = buildWebhookEmbeds(rows) + if not embeds then + return + end + + pcall(PerformHttpRequest, url, function() end, "POST", + json.encode({ username = "ESX Admin Menu", embeds = embeds }), + { ["Content-Type"] = "application/json" }) +end + +--- Writes every queued entry. Safe to call at any time; concurrent calls are +--- ignored so two flushes can never insert the same batch twice. +function Logs.flush() + if flushing or queueCount() <= 0 then + return + end + + flushing = true + + -- Detach the queue first: entries recorded during the write land in the + -- next batch instead of being lost. + local batch = {} + for i = head, tail do + batch[#batch + 1] = queue[i] + queue[i] = nil + end + head, tail = 1, 0 + + if dropped > 0 then + print(("[esx-adminmenu] Log queue overflow, dropped %d entries"):format(dropped)) + dropped = 0 + end + + local batchSize = tonumber(config().BatchSize) or 100 + + for start = 1, #batch, batchSize do + local placeholders = {} + local params = {} + local chunk = {} + + for i = start, math.min(start + batchSize - 1, #batch) do + local row = batch[i] + chunk[#chunk + 1] = row + appendRow(row, placeholders, params) + end + + Helpers.safeQuery(INSERT_COLUMNS .. table.concat(placeholders, ","), params) + postWebhook(chunk) + end + + flushing = false +end + +--- Escapes LIKE metacharacters so a search of "%" cannot match every row. +local function escapeLike(value) + return (value:gsub("([%%_\\])", "\\%1")) +end + +--- Paginated read. Filters are optional and combine with AND. +function Logs.query(filters) + filters = filters or {} + + local where = {} + local params = {} + + -- Free-text search across the columns an admin would actually type into. + -- Infix LIKE cannot use an index, so it is bounded by the LIMIT below and + -- by the retention window: admin_logs never grows past RetentionDays. + local search = type(filters.search) == "string" and filters.search:match("^%s*(.-)%s*$") or "" + if #search >= 2 and #search <= 100 then + local infix = "%" .. escapeLike(search) .. "%" + + where[#where + 1] = + "(actor_name LIKE ? OR actor_identifier LIKE ? OR target_name LIKE ? OR target_identifier LIKE ? OR action LIKE ?)" + + for _ = 1, 5 do + params[#params + 1] = infix + end + end + + if type(filters.actor) == "string" and filters.actor ~= "" then + where[#where + 1] = "actor_identifier = ?" + params[#params + 1] = filters.actor + end + + if type(filters.target) == "string" and filters.target ~= "" then + where[#where + 1] = "target_identifier = ?" + params[#params + 1] = filters.target + end + + if type(filters.action) == "string" and filters.action ~= "" then + where[#where + 1] = "action = ?" + params[#params + 1] = filters.action + end + + if type(filters.namespace) == "string" and filters.namespace ~= "" then + where[#where + 1] = "namespace = ?" + params[#params + 1] = filters.namespace + end + + local days = tonumber(filters.days) + if days and days > 0 then + where[#where + 1] = "created_at >= DATE_SUB(NOW(), INTERVAL ? DAY)" + params[#params + 1] = math.floor(days) + end + + local limit = math.max(1, math.min(tonumber(filters.limit) or 50, 200)) + local offset = math.max(0, tonumber(filters.offset) or 0) + + local sql = [[SELECT id, created_at, actor_identifier, actor_name, namespace, action, + target_identifier, target_name, success, error, payload + FROM admin_logs]] + + if #where > 0 then + sql = sql .. " WHERE " .. table.concat(where, " AND ") + end + + -- id desc rather than created_at desc: id is the primary key, so the sort + -- is served by the index and stays cheap as the table grows. + sql = sql .. " ORDER BY id DESC LIMIT ? OFFSET ?" + params[#params + 1] = limit + 1 + params[#params + 1] = offset + + local rows = Helpers.safeQuery(sql, params) or {} + local hasMore = #rows > limit + + if hasMore then + rows[#rows] = nil + end + + return { logs = rows, hasMore = hasMore, nextOffset = offset + #rows, limit = limit } +end + +--- Deletes expired rows in bounded chunks so the table is never locked long. +function Logs.purge() + local days = tonumber(config().RetentionDays) or 30 + if days <= 0 then + return 0 + end + + local removed = 0 + + for _ = 1, 20 do + local affected = Helpers.safeUpdate( + "DELETE FROM admin_logs WHERE created_at < DATE_SUB(NOW(), INTERVAL ? DAY) LIMIT 1000", + { math.floor(days) }) + + affected = tonumber(affected) or 0 + removed = removed + affected + + if affected < 1000 then + break + end + + Wait(0) + end + + return removed +end + +CreateThread(function() + local interval = tonumber(config().FlushInterval) or 5000 + + while true do + Wait(interval) + pcall(Logs.flush) + end +end) + +CreateThread(function() + while true do + Wait(3600000) + pcall(Logs.purge) + end +end) + +-- Last chance to persist: a restart would otherwise discard the current window. +AddEventHandler("onResourceStop", function(resource) + if resource == GetCurrentResourceName() then + pcall(Logs.flush) + end +end) + +exports("logAdminAction", function(entry) + Logs.record(entry) +end) + +exports("getAdminLogs", function(filters) + return Logs.query(filters) +end) + +return Logs diff --git a/[esx_addons]/esx_adminmenu/server/main.lua b/[esx_addons]/esx_adminmenu/server/main.lua new file mode 100644 index 00000000..5fd9c541 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/server/main.lua @@ -0,0 +1,318 @@ +Helpers.registerCallback("esx-adminmenu:server:getInitData", function(source) + if not Helpers.hasPermission(source) then + return { err = "Insufficient Permissions." } + end + + local impounds = Helpers.getImpounds() + local vehicleConfig = Config.VehicleSpawner or {} + + return { + 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) + +Helpers.registerCallback("esx-adminmenu:server:canOpen", function(source) + if not Helpers.hasPermission(source) then + return { success = false, err = "Insufficient Permissions." } + end + + return { + success = true, + serverData = Helpers.getServerData(), + } +end) + +Helpers.registerCallback("esx-adminmenu:server:canUseAdminAction", function(source, data) + if not Helpers.hasPermission(source) then + return { success = false, err = "Insufficient Permissions." } + end + + local action = type(data) == "table" and data.action or data + if type(action) ~= "string" or action == "" then + return { success = false, err = "Invalid admin action." } + end + + local feature = Helpers.getActionPermission("adminMenu", action) + if not feature then + return { success = false, err = "Invalid admin action." } + end + + if not Helpers.hasFeaturePermission(source, feature) then + return { success = false, err = "Insufficient Permissions." } + end + + return { + success = true, + serverData = Helpers.getServerData(), + } +end) + +Helpers.registerCallback("esx-adminmenu:server:openDashboard", function(source) + if not Helpers.hasPermission(source) then + return { success = false, err = "Insufficient Permissions." } + end + + return { + success = true, + players = Helpers.getPlayerList(source) or {}, + serverData = Helpers.getServerData(), + } +end) + +Helpers.registerCallback("esx-adminmenu:server:getVehicles", function(source, data) + if not Helpers.hasPermission(source) then + return { success = false, err = "Insufficient Permissions." } + end + + local canSeeSensitive = Helpers.hasFeaturePermission(source, "sensitiveInfo") + local result = Helpers.getVehiclesPage(data, canSeeSensitive) + result.success = true + + return result +end) + +Helpers.registerCallback("esx-adminmenu:server:getBans", function(source, data) + if not Helpers.hasFeaturePermission(source, "banManagement") then + return { success = false, err = "Insufficient Permissions." } + end + + local result = Helpers.getActiveBansPage(data) + result.success = true + + return result +end) + +Helpers.registerCallback("esx-adminmenu:server:getRecentPlayers", function(source) + if not Helpers.hasPermission(source) then + return { success = false, err = "Insufficient Permissions." } + end + + return { + success = true, + players = Helpers.getRecentPlayers(source), + } +end) + +Helpers.registerCallback("esx-adminmenu:server:getRadioChannelPlayers", function(source, data) + if not Helpers.hasFeaturePermission(source, "radioLookup") then + return { success = false, err = "Insufficient Permissions." } + end + + local channel = tonumber(data and data.channel) or 0 + if channel <= 0 then + return { success = false, err = "Enter a valid radio channel." } + 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 + + return { success = true, players = players } +end) + +-- Reading the log is gated on its own feature: it exposes who moderated whom, +-- which is more sensitive than most actions it records. +Helpers.registerCallback("esx-adminmenu:server:getAdminLogs", function(source, data) + if not Helpers.hasFeaturePermission(source, "logViewer") then + return { success = false, err = "Insufficient Permissions", logs = {} } + end + + local result = Logs.query(data) + result.success = true + + return result +end) + +local MAX_RESULTS = tonumber(Config.AdminLimits and Config.AdminLimits.OfflineSearchResults) or 25 +local MIN_QUERY_LENGTH = 2 + +local SEARCH_COLUMNS = [[SELECT identifier, firstname, lastname, sex, job, job_grade, accounts, metadata, + last_seen, created_at, phone_number, `group`, disabled + FROM users]] + +--- Escapes LIKE metacharacters. Without this a query of "%" or "_" would match +--- every row in the table and leak the whole user base in one request. +local function escapeLike(value) + return (value:gsub("([%%_\\])", "\\%1")) +end + +local function decodeJson(raw) + if not raw then + return {} + end + + local ok, decoded = pcall(json.decode, raw) + return (ok and type(decoded) == "table") and decoded or {} +end + +--- The bare id shared by a player's char/license identifiers. +local function getBase(identifier) + if type(identifier) ~= "string" then + return nil + end + + local base = identifier:match("^[^:]+:(.+)$") + if not base or base == "" or #base < 5 or #base > 80 then + return nil + end + + return base +end + +local function buildOfflineEntry(row, canSeeSensitive) + local accounts = decodeJson(row.accounts) + local metadata = decodeJson(row.metadata) + local base = getBase(row.identifier) + + return { + status = "offline", + id = nil, + name = ((row.firstname or "") .. " " .. (row.lastname or "")):match("^%s*(.-)%s*$"), + + cash = tonumber(accounts.money) or 0, + bank = tonumber(accounts.bank) or 0, + alt_money = tonumber(accounts.black_money) or 0, + + health = metadata.health and metadata.health - 100 or 0, + armor = metadata.armor or 0, + + char_identifier = canSeeSensitive and row.identifier or nil, + identifier = canSeeSensitive and (base and ("license:" .. base) or row.identifier) or nil, + phone_number = canSeeSensitive and row.phone_number or nil, + + play_time = Helpers.getFormattedPlayTime(metadata.lastPlaytime or 0), + gender = row.sex == "f" and "f" or "m", + job = row.job, + job_grade = row.job_grade, + group = row.group, + disabled = row.disabled == 1 or row.disabled == true, + last_join = row.last_seen, + first_join = row.created_at, + } +end + +--- Online players matching the query, taken from the same source as the Online +--- Players tab so both views stay consistent in shape and sensitive-data gating. +local function findOnlineMatches(src, query) + local matches = {} + local list = Helpers.getPlayerList(src) or {} + + for i = 1, #list do + local player = list[i] + local haystack = { + tostring(player.name or ""), + tostring(player.id or ""), + tostring(player.char_identifier or ""), + tostring(player.identifier or ""), + } + + for j = 1, #haystack do + if haystack[j]:lower():find(query, 1, true) then + matches[#matches + 1] = player + break + end + end + end + + return matches +end + +Helpers.registerCallback("esx-adminmenu:server:searchOfflinePlayer", function(source, data) + local src = source + + if not Helpers.hasPermission(src) then + return { success = false, err = "Insufficient Permissions", players = {} } + end + + local canSeeSensitive = Helpers.hasFeaturePermission(src, "sensitiveInfo") + + local raw = type(data) == "table" and data.identifier or data + if type(raw) ~= "string" then + return { success = true, players = {} } + end + + local query = raw:match("^%s*(.-)%s*$") + if #query < MIN_QUERY_LENGTH or #query > 100 then + return { success = true, players = {} } + end + + local lowered = query:lower() + local players = findOnlineMatches(src, lowered) + + -- Track who is already listed as online so a player is never shown twice. + local seen = {} + for i = 1, #players do + local key = players[i].char_identifier or players[i].identifier + if key then + seen[key] = true + end + end + + local rows + local fullIdentifier = query:match("^license:[%w%-_]+$") or query:match("^char%d+:[%w%-_]+$") + + if fullIdentifier then + -- Fast path: a complete identifier is matched against the PRIMARY key, + -- so this stays sargable instead of degrading into a full scan. + local base = getBase(query) + local candidates = base and { query, "license:" .. base, "license2:" .. base } or { query } + + rows = Helpers.safeQuery( + SEARCH_COLUMNS .. " WHERE identifier IN (?, ?, ?) LIMIT ?", + { candidates[1], candidates[2] or candidates[1], candidates[3] or candidates[1], MAX_RESULTS + 1 } + ) + else + -- Fuzzy path: name and partial identifier. firstname/lastname carry no + -- index, so this scans; MIN_QUERY_LENGTH and LIMIT keep it bounded. + local infix = "%" .. escapeLike(query) .. "%" + + rows = Helpers.safeQuery( + SEARCH_COLUMNS .. [[ WHERE identifier LIKE ? + OR firstname LIKE ? + OR lastname LIKE ? + OR CONCAT(firstname, ' ', lastname) LIKE ? + OR phone_number LIKE ? + LIMIT ?]], + { infix, infix, infix, infix, infix, MAX_RESULTS + 1 } + ) + end + + if rows then + for i = 1, #rows do + if #players >= MAX_RESULTS then + break + end + + local row = rows[i] + if not seen[row.identifier] then + seen[row.identifier] = true + players[#players + 1] = buildOfflineEntry(row, canSeeSensitive) + end + end + end + + return { success = true, 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..511f7bad --- /dev/null +++ b/[esx_addons]/esx_adminmenu/shared/config.lua @@ -0,0 +1,444 @@ +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, + }, + -- Reading the admin action log is itself sensitive: it exposes who moderated + -- whom. Gate it separately so it can be granted without full admin rights. + logViewer = { + admin = true, + }, +} + +Config.Locale = "en" + +Config.Keybinds = { + AdminMenu = "F9", + AdminDashboard = "F10", +} + +Config.AdminMenu = { + NoClipSpeed = 1.5, + NamesDistance = 75.0, + ModelLoadTimeout = 5000, + ServerDataInterval = 60000, + Blip = { sprite = 1, scale = 0.85, colour = 5 }, + Spectate = { height = 15.0, escCooldown = 5000, streamWait = 500 }, + Troll = { skyHeight = 120.0, randomRange = 500, randomHeight = 40.0, nauseaDuration = 5000 }, + WaypointScan = { max = 1000, step = 25 }, + 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 = "destructive", + 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, + MaxVehiclePropsBytes = 16384, + OfflineSearchResults = 25, + VehiclePageSize = 100, + BanPageSize = 100, + RecentPlayersCap = 100, + PlateGenAttempts = 50, + AllowedMoneyAccounts = { + money = true, + bank = true, + black_money = true, + }, + AllowedNotificationTypes = { + info = true, + success = true, + error = true, + }, +} + +Config.Ban = { + -- Identifier types captured at ban time and matched on connect. A banned + -- player is blocked if ANY connecting identifier matches ANY of these. + -- ip is off by default (shared IPs / CGNAT cause false positives). + Identifiers = { + license = true, + license2 = true, + discord = true, + steam = true, + xbl = true, + live = true, + fivem = true, + ip = false, + }, +} + +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, +} + +-- Admin action log. Only actions are recorded, never reads: the menu polls +-- vehicle and player lists constantly and would otherwise drown the log. +Config.Logs = { + Enabled = true, + + -- Rows older than this are deleted by the hourly maintenance pass. + -- Set to 0 to keep everything (the table then grows without bound). + RetentionDays = 30, + + -- Entries are queued in memory and written in batches, so an admin action + -- never waits on the database. + FlushInterval = 5000, + -- Hard cap on the in-memory queue. If the database is unreachable the + -- oldest entries are dropped rather than growing until the server dies. + MaxQueue = 500, + -- Rows per INSERT. Keeps the statement (and its lock) short. + BatchSize = 100, + + -- Payloads above this are replaced by a truncation marker. Vehicle props + -- alone can be several kilobytes. + MaxPayloadBytes = 2048, + + -- Any client can invoke a server callback, so a non-admin can spam denied + -- attempts. Beyond this many entries per minute a source is muted for the + -- rest of the window, which keeps a flood from evicting real entries. + MaxPerMinutePerActor = 120, + + -- Spammy toggles: recorded actions that carry no moderation value. + Ignore = { + noclip = true, + godmode = true, + invisible = true, + names = true, + blips = true, + copyCoords = true, + }, + + Webhook = { + -- Discord webhook URL. Leave empty to disable. + -- WARNING: do not commit a real URL, anyone who reads it can post to + -- your channel. Fill this in on your own server only. + Url = "", + + -- Only these actions are forwarded. Sending everything gets the + -- webhook rate-limited by Discord almost immediately. + Actions = { + ban = true, + unban = true, + kick = true, + deleteCharacter = true, + cleanInventory = true, + giveMoney = true, + takeMoney = true, + giveMoneyAll = true, + kickAll = true, + killAll = true, + aceAdd = true, + aceRemove = 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-DiZxYMFi.js b/[esx_addons]/esx_adminmenu/web/dist/assets/index-DiZxYMFi.js new file mode 100644 index 00000000..c8970cfd --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/dist/assets/index-DiZxYMFi.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 Ni=!1;var Gi=Array.isArray,Xl=Array.prototype.indexOf,Hr=Array.from,Gl=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,oo=Object.getOwnPropertyDescriptors,Jl=Object.prototype,Ql=Array.prototype,Ji=Object.getPrototypeOf,As=Object.isExtensible;function $l(t){return typeof t=="function"}const dn=()=>{};function ec(t){for(var e=0;e<t.length;e++)t[e]()}function lo(){var t,e,a=new Promise((r,i)=>{t=r,e=i});return{promise:a,resolve:t,reject:e}}function tc(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 bt=2,zr=4,jr=8,co=1<<24,mn=16,Pn=32,ua=64,Qi=128,en=512,Ct=1024,Pt=2048,En=4096,qt=8192,Cn=16384,Wr=32768,Tn=65536,Ls=1<<17,uo=1<<18,Na=1<<19,nc=1<<20,kn=1<<25,sa=32768,Di=1<<21,$i=1<<22,Un=1<<23,Mn=Symbol("$state"),ac=Symbol("legacy props"),rc=Symbol(""),Ma=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function vo(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function ic(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function sc(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function oc(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function lc(t){throw new Error("https://svelte.dev/e/effect_orphan")}function cc(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function uc(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function vc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function dc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function fc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function hc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const _c=1,pc=2,fo=4,mc=8,bc=16,gc=1,yc=4,wc=8,xc=16,kc=4,Cc=1,Mc=2,pt=Symbol(),Sc="http://www.w3.org/1999/xhtml";function Tc(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ac(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function ho(t){return t===this.v}function _o(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function po(t){return!_o(t,this.v)}let Lc=!1,Vt=null;function La(t){Vt=t}function et(t,e=!1,a){Vt={p:Vt,i:!1,c:null,e:null,s:t,x:null,l:null}}function tt(t){var e=Vt,a=e.e;if(a!==null){e.e=null;for(var r of a)No(r)}return e.i=!0,Vt=e.p,{}}function mo(){return!0}let ea=[];function bo(){var t=ea;ea=[],ec(t)}function va(t){if(ea.length===0&&!$a){var e=ea;queueMicrotask(()=>{e===ea&&bo()})}ea.push(t)}function Pc(){for(;ea.length>0;)bo()}function go(t){var e=je;if(e===null)return Ee.f|=Un,t;if((e.f&Wr)===0){if((e.f&Qi)===0)throw t;e.b.error(t)}else Pa(t,e)}function Pa(t,e){for(;e!==null;){if((e.f&Qi)!==0)try{e.b.error(t);return}catch(a){t=a}e=e.parent}throw t}const Ec=-7169;function dt(t,e){t.f=t.f&Ec|e}function es(t){(t.f&en)!==0||t.deps===null?dt(t,Ct):dt(t,En)}function yo(t){if(t!==null)for(const e of t)(e.f&bt)===0||(e.f&sa)===0||(e.f^=sa,yo(e.deps))}function wo(t,e,a){(t.f&Pt)!==0?e.add(t):(t.f&En)!==0&&a.add(t),yo(t.deps),dt(t,Ct)}const Cr=new Set;let Ie=null,Qa=null,an=null,Qt=[],Ur=null,Ri=!1,$a=!1;class fn{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){Qt=[],Qa=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)):(Qa=this,Ie=null,Ps(r),Ps(a),Qa=null,this.#s?.resolve()),an=null}#o(e,a,r){e.f^=Ct;for(var i=e.first,s=null;i!==null;){var l=i.f,u=(l&(Pn|ua))!==0,v=u&&(l&Ct)!==0,h=v||(l&qt)!==0||this.skipped_effects.has(i);if(!h&&i.fn!==null){u?i.f^=Ct:s!==null&&(l&(zr|jr|co))!==0?s.b.defer_effect(i):(l&zr)!==0?a.push(i):cr(i)&&((l&mn)!==0&&this.#i.add(i),ar(i));var b=i.first;if(b!==null){i=b;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)wo(e[a],this.#i,this.#a)}capture(e,a){a!==pt&&!this.previous.has(e)&&this.previous.set(e,a),(e.f&Un)===0&&(this.current.set(e,e.v),an?.set(e,e.v))}activate(){Ie=this,this.apply()}deactivate(){Ie===this&&(Ie=null,an=null)}flush(){if(this.activate(),Qt.length>0){if(xo(),Ie!==null&&Ie!==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(Cr.size>1){this.previous.clear();var e=an,a=!0;for(const i of Cr){if(i===this){a=!1;continue}const s=[];for(const[u,v]of this.current){if(i.current.has(u))if(a&&v!==i.current.get(u))i.current.set(u,v);else continue;s.push(u)}if(s.length===0)continue;const l=[...i.current.keys()].filter(u=>!this.current.has(u));if(l.length>0){var r=Qt;Qt=[];const u=new Set,v=new Map;for(const h of s)ko(h,l,u,v);if(Qt.length>0){Ie=i,i.apply();for(const h of Qt)i.#o(h,[],[]);i.deactivate()}Qt=r}}Ie=null,an=e}this.committed=!0,Cr.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),dt(e,Pt),An(e);for(const e of this.#a)dt(e,En),An(e);this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#n.add(e)}settled(){return(this.#s??=lo()).promise}static ensure(){if(Ie===null){const e=Ie=new fn;Cr.add(Ie),$a||fn.enqueue(()=>{Ie===e&&e.flush()})}return Ie}static enqueue(e){va(e)}apply(){}}function zc(t){var e=$a;$a=!0;try{for(var a;;){if(Pc(),Qt.length===0&&(Ie?.flush(),Qt.length===0))return Ur=null,a;xo()}}finally{$a=e}}function xo(){var t=na;Ri=!0;var e=null;try{var a=0;for(Nr(!0);Qt.length>0;){var r=fn.ensure();if(a++>1e3){var i,s;Oc()}r.process(Qt),qn.clear()}}finally{Ri=!1,Nr(t),Ur=null}}function Oc(){try{cc()}catch(t){Pa(t,Ur)}}let yn=null;function Ps(t){var e=t.length;if(e!==0){for(var a=0;a<e;){var r=t[a++];if((r.f&(Cn|qt))===0&&cr(r)&&(yn=new Set,ar(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?Bo(r):r.fn=null),yn?.size>0)){qn.clear();for(const i of yn){if((i.f&(Cn|qt))!==0)continue;const s=[i];let l=i.parent;for(;l!==null;)yn.has(l)&&(yn.delete(l),s.push(l)),l=l.parent;for(let u=s.length-1;u>=0;u--){const v=s[u];(v.f&(Cn|qt))===0&&ar(v)}}yn.clear()}}yn=null}}function ko(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&bt)!==0?ko(i,e,a,r):(s&($i|mn))!==0&&(s&Pt)===0&&Co(i,e,r)&&(dt(i,Pt),An(i))}}function Co(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&bt)!==0&&Co(i,e,a))return a.set(i,!0),!0}return a.set(t,!1),!1}function An(t){for(var e=Ur=t;e.parent!==null;){e=e.parent;var a=e.f;if(Ri&&e===je&&(a&mn)!==0&&(a&uo)===0)return;if((a&(ua|Pn))!==0){if((a&Ct)===0)return;e.f^=Ct}}Qt.push(e)}function Nc(t){let e=0,a=oa(0),r;return()=>{as()&&(n(a),or(()=>(e===0&&(r=bn(()=>t(()=>er(a)))),e+=1,()=>{va(()=>{e-=1,e===0&&(r?.(),r=void 0,er(a))})})))}}var Dc=Tn|Na|Qi;function Rc(t,e,a){new Bc(t,e,a)}class Bc{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=Nc(()=>(this.#d=oa(this.#u),()=>{this.#d=null}));constructor(e,a,r){this.#e=e,this.#t=a,this.#r=r,this.parent=je.b,this.is_pending=!!this.#t.pending,this.#s=lr(()=>{je.b=this;{var i=this.#y();try{this.#i=$t(()=>r(i))}catch(s){this.error(s)}this.#v>0?this.#g():this.is_pending=!1}return()=>{this.#c?.remove()}},Dc)}#m(){try{this.#i=$t(()=>this.#r(this.#e))}catch(e){this.error(e)}}#x(){const e=this.#t.pending;e&&(this.#a=$t(()=>e(this.#e)),fn.enqueue(()=>{var a=this.#y();this.#i=this.#b(()=>(fn.ensure(),$t(()=>this.#r(a)))),this.#v>0?this.#g():(ta(this.#a,()=>{this.#a=null}),this.is_pending=!1)}))}#y(){var e=this.#e;return this.is_pending&&(this.#c=Zn(),this.#e.before(this.#c),e=this.#c),e}defer_effect(e){wo(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=je,r=Ee,i=Vt;_n(this.#s),It(this.#s),La(this.#s.ctx);try{return e()}catch(s){return go(s),null}finally{_n(a),It(r),La(i)}}#g(){const e=this.#t.pending;this.#i!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),Vo(this.#i,this.#l)),this.#a===null&&(this.#a=$t(()=>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)dt(a,Pt),An(a);for(const a of this.#_)dt(a,En),An(a);this.#h.clear(),this.#_.clear(),this.#a&&ta(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&&Ea(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&&(Ft(this.#i),this.#i=null),this.#a&&(Ft(this.#a),this.#a=null),this.#o&&(Ft(this.#o),this.#o=null);var i=!1,s=!1;const l=()=>{if(i){Ac();return}i=!0,s&&hc(),fn.ensure(),this.#u=0,this.#o!==null&&ta(this.#o,()=>{this.#o=null}),this.is_pending=this.has_pending_snippet(),this.#i=this.#b(()=>(this.#f=!1,$t(()=>this.#r(this.#e)))),this.#v>0?this.#g():this.is_pending=!1};var u=Ee;try{It(null),s=!0,a?.(e,l),s=!1}catch(v){Pa(v,this.#s&&this.#s.parent)}finally{It(u)}r&&va(()=>{this.#o=this.#b(()=>{fn.ensure(),this.#f=!0;try{return $t(()=>{r(this.#e,()=>e,()=>l)})}catch(v){return Pa(v,this.#s.parent),null}finally{this.#f=!1}})})}}function Ic(t,e,a,r){const i=qr;if(a.length===0&&t.length===0){r(e.map(i));return}var s=Ie,l=je,u=Fc();function v(){Promise.all(a.map(h=>Vc(h))).then(h=>{u();try{r([...e.map(i),...h])}catch(b){(l.f&Cn)===0&&Pa(b,l)}s?.deactivate(),Or()}).catch(h=>{Pa(h,l)})}t.length>0?Promise.all(t).then(()=>{u();try{return v()}finally{s?.deactivate(),Or()}}):v()}function Fc(){var t=je,e=Ee,a=Vt,r=Ie;return function(s=!0){_n(t),It(e),La(a),s&&r?.activate()}}function Or(){_n(null),It(null),La(null)}function qr(t){var e=bt|Pt,a=Ee!==null&&(Ee.f&bt)!==0?Ee:null;return je!==null&&(je.f|=Na),{ctx:Vt,deps:null,effects:null,equals:ho,f:e,fn:t,reactions:null,rv:0,v:pt,wv:0,parent:a??je,ac:null}}function Vc(t,e,a){let r=je;r===null&&ic();var i=r.b,s=void 0,l=oa(pt),u=!Ee,v=new Map;return Jc(()=>{var h=lo();s=h.promise;try{Promise.resolve(t()).then(h.resolve,h.reject).then(()=>{b===Ie&&b.committed&&b.deactivate(),Or()})}catch(p){h.reject(p),Or()}var b=Ie;if(u){var y=i.is_rendered();i.update_pending_count(1),b.increment(y),v.get(b)?.reject(Ma),v.delete(b),v.set(b,h)}const g=(p,A=void 0)=>{if(b.activate(),A)A!==Ma&&(l.f|=Un,Ea(l,A));else{(l.f&Un)!==0&&(l.f^=Un),Ea(l,p);for(const[k,w]of v){if(v.delete(k),k===b)break;w.reject(Ma)}}u&&(i.update_pending_count(-1),b.decrement(y))};h.promise.then(g,p=>g(null,p||"unknown"))}),rs(()=>{for(const h of v.values())h.reject(Ma)}),new Promise(h=>{function b(y){function g(){y===s?h(l):b(s)}y.then(g,g)}b(s)})}function W(t){const e=qr(t);return Ho(e),e}function Mo(t){const e=qr(t);return e.equals=po,e}function So(t){var e=t.effects;if(e!==null){t.effects=null;for(var a=0;a<e.length;a+=1)Ft(e[a])}}function Hc(t){for(var e=t.parent;e!==null;){if((e.f&bt)===0)return(e.f&Cn)===0?e:null;e=e.parent}return null}function ts(t){var e,a=je;_n(Hc(t));try{t.f&=~sa,So(t),e=qo(t)}finally{_n(a)}return e}function To(t){var e=ts(t);if(!t.equals(e)&&(t.wv=Wo(),(!Ie?.is_fork||t.deps===null)&&(t.v=e,t.deps===null))){dt(t,Ct);return}Xn||(an!==null?(as()||Ie?.is_fork)&&an.set(t,e):es(t))}let Bi=new Set;const qn=new Map;let Ao=!1;function oa(t,e){var a={f:0,v:t,reactions:null,equals:ho,rv:0,wv:0};return a}function M(t,e){const a=oa(t);return Ho(a),a}function jc(t,e=!1,a=!0){const r=oa(t);return e||(r.equals=po),r}function _(t,e,a=!1){Ee!==null&&(!rn||(Ee.f&Ls)!==0)&&mo()&&(Ee.f&(bt|mn|$i|Ls))!==0&&!Sn?.includes(t)&&fc();let r=a?pe(e):e;return Ea(t,r)}function Ea(t,e){if(!t.equals(e)){var a=t.v;Xn?qn.set(t,e):qn.set(t,a),t.v=e;var r=fn.ensure();if(r.capture(t,a),(t.f&bt)!==0){const i=t;(t.f&Pt)!==0&&ts(i),es(i)}t.wv=Wo(),Lo(t,Pt),je!==null&&(je.f&Ct)!==0&&(je.f&(Pn|ua))===0&&(Jt===null?eu([t]):Jt.push(t)),!r.is_fork&&Bi.size>0&&!Ao&&Wc()}return e}function Wc(){Ao=!1;var t=na;Nr(!0);const e=Array.from(Bi);try{for(const a of e)(a.f&Ct)!==0&&dt(a,En),cr(a)&&ar(a)}finally{Nr(t)}Bi.clear()}function er(t){_(t,t.v+1)}function Lo(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,u=(l&Pt)===0;if(u&&dt(s,e),(l&bt)!==0){var v=s;an?.delete(v),(l&sa)===0&&(l&en&&(s.f|=sa),Lo(v,En))}else u&&((l&mn)!==0&&yn!==null&&yn.add(s),An(s))}}function pe(t){if(typeof t!="object"||t===null||Mn in t)return t;const e=Ji(t);if(e!==Jl&&e!==Ql)return t;var a=new Map,r=Gi(t),i=M(0),s=aa,l=u=>{if(aa===s)return u();var v=Ee,h=aa;It(null),Ns(s);var b=u();return It(v),Ns(h),b};return r&&a.set("length",M(t.length)),new Proxy(t,{defineProperty(u,v,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&vc();var b=a.get(v);return b===void 0?b=l(()=>{var y=M(h.value);return a.set(v,y),y}):_(b,h.value,!0),!0},deleteProperty(u,v){var h=a.get(v);if(h===void 0){if(v in u){const b=l(()=>M(pt));a.set(v,b),er(i)}}else _(h,pt),er(i);return!0},get(u,v,h){if(v===Mn)return t;var b=a.get(v),y=v in u;if(b===void 0&&(!y||Ta(u,v)?.writable)&&(b=l(()=>{var p=pe(y?u[v]:pt),A=M(p);return A}),a.set(v,b)),b!==void 0){var g=n(b);return g===pt?void 0:g}return Reflect.get(u,v,h)},getOwnPropertyDescriptor(u,v){var h=Reflect.getOwnPropertyDescriptor(u,v);if(h&&"value"in h){var b=a.get(v);b&&(h.value=n(b))}else if(h===void 0){var y=a.get(v),g=y?.v;if(y!==void 0&&g!==pt)return{enumerable:!0,configurable:!0,value:g,writable:!0}}return h},has(u,v){if(v===Mn)return!0;var h=a.get(v),b=h!==void 0&&h.v!==pt||Reflect.has(u,v);if(h!==void 0||je!==null&&(!b||Ta(u,v)?.writable)){h===void 0&&(h=l(()=>{var g=b?pe(u[v]):pt,p=M(g);return p}),a.set(v,h));var y=n(h);if(y===pt)return!1}return b},set(u,v,h,b){var y=a.get(v),g=v in u;if(r&&v==="length")for(var p=h;p<y.v;p+=1){var A=a.get(p+"");A!==void 0?_(A,pt):p in u&&(A=l(()=>M(pt)),a.set(p+"",A))}if(y===void 0)(!g||Ta(u,v)?.writable)&&(y=l(()=>M(void 0)),_(y,pe(h)),a.set(v,y));else{g=y.v!==pt;var k=l(()=>pe(h));_(y,k)}var w=Reflect.getOwnPropertyDescriptor(u,v);if(w?.set&&w.set.call(b,h),!g){if(r&&typeof v=="string"){var C=a.get("length"),z=Number(v);Number.isInteger(z)&&z>=C.v&&_(C,z+1)}er(i)}return!0},ownKeys(u){n(i);var v=Reflect.ownKeys(u).filter(y=>{var g=a.get(y);return g===void 0||g.v!==pt});for(var[h,b]of a)b.v!==pt&&!(h in u)&&v.push(h);return v},setPrototypeOf(){dc()}})}function Es(t){try{if(t!==null&&typeof t=="object"&&Mn in t)return t[Mn]}catch{}return t}function Uc(t,e){return Object.is(Es(t),Es(e))}var Yn,Po,Eo,zo;function qc(){if(Yn===void 0){Yn=window,Po=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,a=Text.prototype;Eo=Ta(e,"firstChild").get,zo=Ta(e,"nextSibling").get,As(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),As(a)&&(a.__t=void 0)}}function Zn(t=""){return document.createTextNode(t)}function za(t){return Eo.call(t)}function ir(t){return zo.call(t)}function o(t,e){return za(t)}function ue(t,e=!1){{var a=za(t);return a instanceof Comment&&a.data===""?ir(a):a}}function c(t,e=1,a=!1){let r=t;for(;e--;)r=ir(r);return r}function Zc(t){t.textContent=""}function Oo(){return!1}let zs=!1;function Kc(){zs||(zs=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(const e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function Da(t){var e=Ee,a=je;It(null),_n(null);try{return t()}finally{It(e),_n(a)}}function ns(t,e,a,r=a){t.addEventListener(e,()=>Da(a));const i=t.__on_r;i?t.__on_r=()=>{i(),r(!0)}:t.__on_r=()=>r(!0),Kc()}function Yc(t){je===null&&(Ee===null&&lc(),oc()),Xn&&sc()}function Xc(t,e){var a=e.last;a===null?e.last=e.first=t:(a.next=t,t.prev=a,e.last=t)}function zn(t,e,a){var r=je;r!==null&&(r.f&qt)!==0&&(t|=qt);var i={ctx:Vt,deps:null,nodes:null,f:t|Pt|en,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{ar(i),i.f|=Wr}catch(u){throw Ft(i),u}else e!==null&&An(i);var s=i;if(a&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Na)===0&&(s=s.first,(t&mn)!==0&&(t&Tn)!==0&&s!==null&&(s.f|=Tn)),s!==null&&(s.parent=r,r!==null&&Xc(s,r),Ee!==null&&(Ee.f&bt)!==0&&(t&ua)===0)){var l=Ee;(l.effects??=[]).push(s)}return i}function as(){return Ee!==null&&!rn}function rs(t){const e=zn(jr,null,!1);return dt(e,Ct),e.teardown=t,e}function Lt(t){Yc();var e=je.f,a=!Ee&&(e&Pn)!==0&&(e&Wr)===0;if(a){var r=Vt;(r.e??=[]).push(t)}else return No(t)}function No(t){return zn(zr|nc,t,!1)}function Gc(t){fn.ensure();const e=zn(ua|Na,t,!0);return(a={})=>new Promise(r=>{a.outro?ta(e,()=>{Ft(e),r(void 0)}):(Ft(e),r(void 0))})}function sr(t){return zn(zr,t,!1)}function Jc(t){return zn($i|Na,t,!0)}function or(t,e=0){return zn(jr|e,t,!0)}function Q(t,e=[],a=[],r=[]){Ic(r,e,a,i=>{zn(jr,()=>t(...i.map(n)),!0)})}function lr(t,e=0){var a=zn(mn|e,t,!0);return a}function $t(t){return zn(Pn|Na,t,!0)}function Do(t){var e=t.teardown;if(e!==null){const a=Xn,r=Ee;Os(!0),It(null);try{e.call(null)}finally{Os(a),It(r)}}}function Ro(t,e=!1){var a=t.first;for(t.first=t.last=null;a!==null;){const i=a.ac;i!==null&&Da(()=>{i.abort(Ma)});var r=a.next;(a.f&ua)!==0?a.parent=null:Ft(a,e),a=r}}function Qc(t){for(var e=t.first;e!==null;){var a=e.next;(e.f&Pn)===0&&Ft(e),e=a}}function Ft(t,e=!0){var a=!1;(e||(t.f&uo)!==0)&&t.nodes!==null&&t.nodes.end!==null&&($c(t.nodes.start,t.nodes.end),a=!0),Ro(t,e&&!a),Dr(t,0),dt(t,Cn);var r=t.nodes&&t.nodes.t;if(r!==null)for(const s of r)s.stop();Do(t);var i=t.parent;i!==null&&i.first!==null&&Bo(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function $c(t,e){for(;t!==null;){var a=t===e?null:ir(t);t.remove(),t=a}}function Bo(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 ta(t,e,a=!0){var r=[];Io(t,r,!0);var i=()=>{a&&Ft(t),e&&e()},s=r.length;if(s>0){var l=()=>--s||i();for(var u of r)u.out(l)}else i()}function Io(t,e,a){if((t.f&qt)===0){t.f^=qt;var r=t.nodes&&t.nodes.t;if(r!==null)for(const u of r)(u.is_global||a)&&e.push(u);for(var i=t.first;i!==null;){var s=i.next,l=(i.f&Tn)!==0||(i.f&Pn)!==0&&(t.f&mn)!==0;Io(i,e,l?a:!1),i=s}}}function is(t){Fo(t,!0)}function Fo(t,e){if((t.f&qt)!==0){t.f^=qt,(t.f&Ct)===0&&(dt(t,Pt),An(t));for(var a=t.first;a!==null;){var r=a.next,i=(a.f&Tn)!==0||(a.f&Pn)!==0;Fo(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 Vo(t,e){if(t.nodes)for(var a=t.nodes.start,r=t.nodes.end;a!==null;){var i=a===r?null:ir(a);e.append(a),a=i}}let na=!1;function Nr(t){na=t}let Xn=!1;function Os(t){Xn=t}let Ee=null,rn=!1;function It(t){Ee=t}let je=null;function _n(t){je=t}let Sn=null;function Ho(t){Ee!==null&&(Sn===null?Sn=[t]:Sn.push(t))}let At=null,Ut=0,Jt=null;function eu(t){Jt=t}let jo=1,nr=0,aa=nr;function Ns(t){aa=t}function Wo(){return++jo}function cr(t){var e=t.f;if((e&Pt)!==0)return!0;if(e&bt&&(t.f&=~sa),(e&En)!==0){for(var a=t.deps,r=a.length,i=0;i<r;i++){var s=a[i];if(cr(s)&&To(s),s.wv>t.wv)return!0}(e&en)!==0&&an===null&&dt(t,Ct)}return!1}function Uo(t,e,a=!0){var r=t.reactions;if(r!==null&&!Sn?.includes(t))for(var i=0;i<r.length;i++){var s=r[i];(s.f&bt)!==0?Uo(s,e,!1):e===s&&(a?dt(s,Pt):(s.f&Ct)!==0&&dt(s,En),An(s))}}function qo(t){var e=At,a=Ut,r=Jt,i=Ee,s=Sn,l=Vt,u=rn,v=aa,h=t.f;At=null,Ut=0,Jt=null,Ee=(h&(Pn|ua))===0?t:null,Sn=null,La(t.ctx),rn=!1,aa=++nr,t.ac!==null&&(Da(()=>{t.ac.abort(Ma)}),t.ac=null);try{t.f|=Di;var b=t.fn,y=b(),g=t.deps;if(At!==null){var p;if(Dr(t,Ut),g!==null&&Ut>0)for(g.length=Ut+At.length,p=0;p<At.length;p++)g[Ut+p]=At[p];else t.deps=g=At;if(as()&&(t.f&en)!==0)for(p=Ut;p<g.length;p++)(g[p].reactions??=[]).push(t)}else g!==null&&Ut<g.length&&(Dr(t,Ut),g.length=Ut);if(mo()&&Jt!==null&&!rn&&g!==null&&(t.f&(bt|En|Pt))===0)for(p=0;p<Jt.length;p++)Uo(Jt[p],t);return i!==null&&i!==t&&(nr++,Jt!==null&&(r===null?r=Jt:r.push(...Jt))),(t.f&Un)!==0&&(t.f^=Un),y}catch(A){return go(A)}finally{t.f^=Di,At=e,Ut=a,Jt=r,Ee=i,Sn=s,La(l),rn=u,aa=v}}function tu(t,e){let a=e.reactions;if(a!==null){var r=Xl.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&bt)!==0&&(At===null||!At.includes(e))){var s=e;(s.f&en)!==0&&(s.f^=en,s.f&=~sa),es(s),So(s),Dr(s,0)}}function Dr(t,e){var a=t.deps;if(a!==null)for(var r=e;r<a.length;r++)tu(t,a[r])}function ar(t){var e=t.f;if((e&Cn)===0){dt(t,Ct);var a=je,r=na;je=t,na=!0;try{(e&(mn|co))!==0?Qc(t):Ro(t),Do(t);var i=qo(t);t.teardown=typeof i=="function"?i:null,t.wv=jo;var s;Ni&&Lc&&(t.f&Pt)!==0&&t.deps}finally{na=r,je=a}}}async function Sa(){await Promise.resolve(),zc()}function n(t){var e=t.f,a=(e&bt)!==0;if(Ee!==null&&!rn){var r=je!==null&&(je.f&Cn)!==0;if(!r&&!Sn?.includes(t)){var i=Ee.deps;if((Ee.f&Di)!==0)t.rv<nr&&(t.rv=nr,At===null&&i!==null&&i[Ut]===t?Ut++:At===null?At=[t]:At.includes(t)||At.push(t));else{(Ee.deps??=[]).push(t);var s=t.reactions;s===null?t.reactions=[Ee]:s.includes(Ee)||s.push(Ee)}}}if(Xn&&qn.has(t))return qn.get(t);if(a){var l=t;if(Xn){var u=l.v;return((l.f&Ct)===0&&l.reactions!==null||Ko(l))&&(u=ts(l)),qn.set(l,u),u}var v=(l.f&en)===0&&!rn&&Ee!==null&&(na||(Ee.f&en)!==0),h=l.deps===null;cr(l)&&(v&&(l.f|=en),To(l)),v&&!h&&Zo(l)}if(an?.has(t))return an.get(t);if((t.f&Un)!==0)throw t.v;return t.v}function Zo(t){if(t.deps!==null){t.f|=en;for(const e of t.deps)(e.reactions??=[]).push(t),(e.f&bt)!==0&&(e.f&en)===0&&Zo(e)}}function Ko(t){if(t.v===pt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(qn.has(e)||(e.f&bt)!==0&&Ko(e))return!0;return!1}function bn(t){var e=rn;try{return rn=!0,t()}finally{rn=e}}function nu(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Mn in t)Ii(t);else if(!Array.isArray(t))for(let e in t){const a=t[e];typeof a=="object"&&a&&Mn in a&&Ii(a)}}}function Ii(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{Ii(t[r],e)}catch{}const a=Ji(t);if(a!==Object.prototype&&a!==Array.prototype&&a!==Map.prototype&&a!==Set.prototype&&a!==Date.prototype){const r=oo(a);for(let i in r){const s=r[i].get;if(s)try{s.call(t)}catch{}}}}}const au=["touchstart","touchmove"];function ru(t){return au.includes(t)}const Yo=new Set,Fi=new Set;function iu(t,e,a,r={}){function i(s){if(r.capture||Xa.call(e,s),!s.cancelBubble)return Da(()=>a?.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?va(()=>{e.addEventListener(t,i,r)}):e.addEventListener(t,i,r),i}function Ln(t,e,a,r,i){var s={capture:r,passive:i},l=iu(t,e,a,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&rs(()=>{e.removeEventListener(t,l,s)})}function ft(t){for(var e=0;e<t.length;e++)Yo.add(t[e]);for(var a of Fi)a(t)}let Ds=null;function Xa(t){var e=this,a=e.ownerDocument,r=t.type,i=t.composedPath?.()||[],s=i[0]||t.target;Ds=t;var l=0,u=Ds===t&&t.__root;if(u){var v=i.indexOf(u);if(v!==-1&&(e===document||e===window)){t.__root=e;return}var h=i.indexOf(e);if(h===-1)return;v<=h&&(l=v)}if(s=i[l]||t.target,s!==e){Gl(t,"currentTarget",{configurable:!0,get(){return s||a}});var b=Ee,y=je;It(null),_n(null);try{for(var g,p=[];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){g?p.push(w):g=w}if(t.cancelBubble||A===e||A===null)break;s=A}if(g){for(let w of p)queueMicrotask(()=>{throw w});throw g}}finally{t.__root=e,delete t.currentTarget,It(b),_n(y)}}}function Xo(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Rr(t,e){var a=je;a.nodes===null&&(a.nodes={start:t,end:e,a:null,t:null})}function B(t,e){var a=(e&Cc)!==0,r=(e&Mc)!==0,i,s=!t.startsWith("<!>");return()=>{i===void 0&&(i=Xo(s?t:"<!>"+t),a||(i=za(i)));var l=r||Po?document.importNode(i,!0):i.cloneNode(!0);if(a){var u=za(l),v=l.lastChild;Rr(u,v)}else Rr(l,l);return l}}function su(t,e,a="svg"){var r=!t.startsWith("<!>"),i=`<${a}>${r?t:"<!>"+t}</${a}>`,s;return()=>{if(!s){var l=Xo(i),u=za(l);s=za(u)}var v=s.cloneNode(!0);return Rr(v,v),v}}function Zr(t,e){return su(t,e,"svg")}function Le(){var t=document.createDocumentFragment(),e=document.createComment(""),a=Zn();return t.append(e,a),Rr(e,a),t}function P(t,e){t!==null&&t.before(e)}let Vi=!0;function m(t,e){var a=e==null?"":typeof e=="object"?e+"":e;a!==(t.__t??=t.nodeValue)&&(t.__t=a,t.nodeValue=a+"")}function ou(t,e){return lu(t,e)}const Ca=new Map;function lu(t,{target:e,anchor:a,props:r={},events:i,context:s,intro:l=!0}){qc();var u=new Set,v=y=>{for(var g=0;g<y.length;g++){var p=y[g];if(!u.has(p)){u.add(p);var A=ru(p);e.addEventListener(p,Xa,{passive:A});var k=Ca.get(p);k===void 0?(document.addEventListener(p,Xa,{passive:A}),Ca.set(p,1)):Ca.set(p,k+1)}}};v(Hr(Yo)),Fi.add(v);var h=void 0,b=Gc(()=>{var y=a??e.appendChild(Zn());return Rc(y,{pending:()=>{}},g=>{if(s){et({});var p=Vt;p.c=s}i&&(r.$$events=i),Vi=l,h=t(g,r)||{},Vi=!0,s&&tt()}),()=>{for(var g of u){e.removeEventListener(g,Xa);var p=Ca.get(g);--p===0?(document.removeEventListener(g,Xa),Ca.delete(g)):Ca.set(g,p)}Fi.delete(v),y!==a&&y.parentNode?.removeChild(y)}});return cu.set(h,b),h}let cu=new WeakMap;class ss{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=Ie;if(this.#e.has(e)){var a=this.#e.get(e),r=this.#n.get(a);if(r)is(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 u=this.#t.get(l);u&&(Ft(u.effect),this.#t.delete(l))}for(const[s,l]of this.#n){if(s===a||this.#r.has(s))continue;const u=()=>{if(Array.from(this.#e.values()).includes(s)){var h=document.createDocumentFragment();Vo(l,h),h.append(Zn()),this.#t.set(s,{effect:l,fragment:h})}else Ft(l);this.#r.delete(s),this.#n.delete(s)};this.#s||!r?(this.#r.add(s),ta(l,u,!1)):u()}}};#a=e=>{this.#e.delete(e);const a=Array.from(this.#e.values());for(const[r,i]of this.#t)a.includes(r)||(Ft(i.effect),this.#t.delete(r))};ensure(e,a){var r=Ie,i=Oo();if(a&&!this.#n.has(e)&&!this.#t.has(e))if(i){var s=document.createDocumentFragment(),l=Zn();s.append(l),this.#t.set(e,{effect:$t(()=>a(l)),fragment:s})}else this.#n.set(e,$t(()=>a(this.anchor)));if(this.#e.set(r,e),i){for(const[u,v]of this.#n)u===e?r.skipped_effects.delete(v):r.skipped_effects.add(v);for(const[u,v]of this.#t)u===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 $(t,e,a=!1){var r=new ss(t),i=a?Tn:0;function s(l,u){r.ensure(l,u)}lr(()=>{var l=!1;e((u,v=!0)=>{l=!0,s(v,u)}),l||s(!1,null)},i)}function Et(t,e){return e}function uu(t,e,a){for(var r=[],i=e.length,s,l=e.length,u=0;u<i;u++){let y=e[u];ta(y,()=>{if(s){if(s.pending.delete(y),s.done.add(y),s.pending.size===0){var g=t.outrogroups;Hi(Hr(s.done)),g.delete(s),g.size===0&&(t.outrogroups=null)}}else l-=1},!1)}if(l===0){var v=r.length===0&&a!==null;if(v){var h=a,b=h.parentNode;Zc(b),b.append(h),t.items.clear()}Hi(e,!v)}else s={pending:new Set(e),done:new Set},(t.outrogroups??=new Set).add(s)}function Hi(t,e=!0){for(var a=0;a<t.length;a++)Ft(t[a],e)}var Rs;function st(t,e,a,r,i,s=null){var l=t,u=new Map,v=(e&fo)!==0;if(v){var h=t;l=h.appendChild(Zn())}var b=null,y=Mo(()=>{var C=a();return Gi(C)?C:C==null?[]:Hr(C)}),g,p=!0;function A(){w.fallback=b,vu(w,g,l,e,r),b!==null&&(g.length===0?(b.f&kn)===0?is(b):(b.f^=kn,Ga(b,null,l)):ta(b,()=>{b=null}))}var k=lr(()=>{g=n(y);for(var C=g.length,z=new Set,R=Ie,x=Oo(),S=0;S<C;S+=1){var T=g[S],D=r(T,S),K=p?null:u.get(D);K?(K.v&&Ea(K.v,T),K.i&&Ea(K.i,S),x&&R.skipped_effects.delete(K.e)):(K=du(u,p?l:Rs??=Zn(),T,D,S,i,e,a),p||(K.e.f|=kn),u.set(D,K)),z.add(D)}if(C===0&&s&&!b&&(p?b=$t(()=>s(l)):(b=$t(()=>s(Rs??=Zn())),b.f|=kn)),!p)if(x){for(const[N,L]of u)z.has(N)||R.skipped_effects.add(L.e);R.oncommit(A),R.ondiscard(()=>{})}else A();n(y)}),w={effect:k,items:u,outrogroups:null,fallback:b};p=!1}function vu(t,e,a,r,i){var s=(r&mc)!==0,l=e.length,u=t.items,v=t.effect.first,h,b=null,y,g=[],p=[],A,k,w,C;if(s)for(C=0;C<l;C+=1)A=e[C],k=i(A,C),w=u.get(k).e,(w.f&kn)===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=u.get(k).e,t.outrogroups!==null)for(const L of t.outrogroups)L.pending.delete(w),L.done.delete(w);if((w.f&kn)!==0)if(w.f^=kn,w===v)Ga(w,null,a);else{var z=b?b.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),Fn(t,b,w),Fn(t,w,z),Ga(w,z,a),b=w,g=[],p=[],v=b.next;continue}if((w.f&qt)!==0&&(is(w),s&&(w.nodes?.a?.unfix(),(y??=new Set).delete(w))),w!==v){if(h!==void 0&&h.has(w)){if(g.length<p.length){var R=p[0],x;b=R.prev;var S=g[0],T=g[g.length-1];for(x=0;x<g.length;x+=1)Ga(g[x],R,a);for(x=0;x<p.length;x+=1)h.delete(p[x]);Fn(t,S.prev,T.next),Fn(t,b,S),Fn(t,T,R),v=R,b=T,C-=1,g=[],p=[]}else h.delete(w),Ga(w,v,a),Fn(t,w.prev,w.next),Fn(t,w,b===null?t.effect.first:b.next),Fn(t,b,w),b=w;continue}for(g=[],p=[];v!==null&&v!==w;)(h??=new Set).add(v),p.push(v),v=v.next;if(v===null)continue}(w.f&kn)===0&&g.push(w),b=w,v=w.next}if(t.outrogroups!==null){for(const L of t.outrogroups)L.pending.size===0&&(Hi(Hr(L.done)),t.outrogroups?.delete(L));t.outrogroups.size===0&&(t.outrogroups=null)}if(v!==null||h!==void 0){var D=[];if(h!==void 0)for(w of h)(w.f&qt)===0&&D.push(w);for(;v!==null;)(v.f&qt)===0&&v!==t.fallback&&D.push(v),v=v.next;var K=D.length;if(K>0){var N=(r&fo)!==0&&l===0?a:null;if(s){for(C=0;C<K;C+=1)D[C].nodes?.a?.measure();for(C=0;C<K;C+=1)D[C].nodes?.a?.fix()}uu(t,D,N)}}s&&va(()=>{if(y!==void 0)for(w of y)w.nodes?.a?.apply()})}function du(t,e,a,r,i,s,l,u){var v=(l&_c)!==0?(l&bc)===0?jc(a,!1,!1):oa(a):null,h=(l&pc)!==0?oa(i):null;return{v,i:h,e:$t(()=>(s(e,v??a,h??i,u),()=>{t.delete(r)}))}}function Ga(t,e,a){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end,s=e&&(e.f&kn)===0?e.nodes.start:a;r!==null;){var l=ir(r);if(s.before(r),r===i)return;r=l}}function Fn(t,e,a){e===null?t.effect.first=a:e.next=a,a===null?t.effect.last=e:a.prev=e}function Vn(t,e,...a){var r=new ss(t);lr(()=>{const i=e()??null;r.ensure(i,i&&(s=>i(s,...a)))},Tn)}function ji(t,e,a){var r=new ss(t);lr(()=>{var i=e()??null;r.ensure(i,i&&(s=>a(s,i)))},Tn)}const fu=()=>performance.now(),wn={tick:t=>requestAnimationFrame(t),now:()=>fu(),tasks:new Set};function Go(){const t=wn.now();wn.tasks.forEach(e=>{e.c(t)||(wn.tasks.delete(e),e.f())}),wn.tasks.size!==0&&wn.tick(Go)}function hu(t){let e;return wn.tasks.size===0&&wn.tick(Go),{promise:new Promise(a=>{wn.tasks.add(e={c:t,f:a})}),abort(){wn.tasks.delete(e)}}}function Mr(t,e){Da(()=>{t.dispatchEvent(new CustomEvent(e))})}function _u(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 Bs(t){const e={},a=t.split(";");for(const r of a){const[i,s]=r.split(":");if(!i||s===void 0)break;const l=_u(i.trim());e[l]=s.trim()}return e}const pu=t=>t;function mu(t,e,a,r){var i=(t&kc)!==0,s="both",l,u=e.inert,v=e.style.overflow,h,b;function y(){return Da(()=>l??=a()(e,r?.()??{},{direction:s}))}var g={is_global:i,in(){e.inert=u,Mr(e,"introstart"),h=Wi(e,y(),b,1,()=>{Mr(e,"introend"),h?.abort(),h=l=void 0,e.style.overflow=v})},out(w){e.inert=!0,Mr(e,"outrostart"),b=Wi(e,y(),h,0,()=>{Mr(e,"outroend"),w?.()})},stop:()=>{h?.abort(),b?.abort()}},p=je;if((p.nodes.t??=[]).push(g),Vi){var A=i;if(!A){for(var k=p.parent;k&&(k.f&Tn)!==0;)for(;(k=k.parent)&&(k.f&mn)===0;);A=!k||(k.f&Wr)!==0}A&&sr(()=>{bn(()=>g.in())})}}function Wi(t,e,a,r,i){var s=r===1;if($l(e)){var l,u=!1;return va(()=>{if(!u){var w=e({direction:s?"in":"out"});l=Wi(t,w,a,r,i)}}),{abort:()=>{u=!0,l?.abort()},deactivate:()=>l.deactivate(),reset:()=>l.reset(),t:()=>l.t()}}if(a?.deactivate(),!e?.duration)return i(),{abort:dn,deactivate:dn,reset:dn,t:()=>r};const{delay:v=0,css:h,tick:b,easing:y=pu}=e;var g=[];if(s&&a===void 0&&(b&&b(0,1),h)){var p=Bs(h(0,1));g.push(p,p)}var A=()=>1-r,k=t.animate(g,{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(h)for(var S=Math.ceil(z/16.666666666666668),T=0;T<=S;T+=1){var D=w+C*y(T/S),K=Bs(h(D,1-D));R.push(K),x||=K.overflow==="hidden"}x&&(t.style.overflow="hidden"),A=()=>{var N=k.currentTime;return w+C*y(N/z)},b&&hu(()=>{if(k.playState!=="running")return!1;var N=A();return b(N,1-N),!0})}k=t.animate(R,{duration:z,fill:"forwards"}),k.onfinish=()=>{A=()=>r,b?.(r,1-r),i()}},{abort:()=>{k&&(k.cancel(),k.effect=null,k.onfinish=dn)},deactivate:()=>{i=dn},reset:()=>{r===0&&b?.(1,0)},t:()=>A()}}function bu(t,e,a){sr(()=>{var r=bn(()=>e(t,a?.())||{});if(a&&r?.update){var i=!1,s={};or(()=>{var l=a();nu(l),i&&_o(s,l)&&(s=l,r.update(l))}),i=!0}if(r?.destroy)return()=>r.destroy()})}function Jo(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=Jo(t[e]))&&(r&&(r+=" "),r+=a)}else for(a in t)t[a]&&(r&&(r+=" "),r+=a);return r}function Pr(){for(var t,e,a=0,r="",i=arguments.length;a<i;a++)(t=arguments[a])&&(e=Jo(t))&&(r&&(r+=" "),r+=e);return r}function gu(t){return typeof t=="object"?Pr(t):t??""}const Is=[...` +\r\f \v\uFEFF`];function yu(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 u=l+s;(l===0||Is.includes(r[l-1]))&&(u===r.length||Is.includes(r[u]))?r=(l===0?"":r.substring(0,l))+r.substring(u+1):l=u}}return r===""?null:r}function wu(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 u=yu(a,r,s);u==null?t.removeAttribute("class"):e?t.className=u:t.setAttribute("class",u),t.__className=a}else if(s&&i!==s)for(var v in s){var h=!!s[v];(i==null||h!==!!i[v])&&t.classList.toggle(v,h)}return s}function xn(t,e,a,r){var i=t.__style;if(i!==e){var s=wu(e);s==null?t.removeAttribute("style"):t.style.cssText=s,t.__style=e}return r}function Qo(t,e,a=!1){if(t.multiple){if(e==null)return;if(!Gi(e))return Tc();for(var r of t.options)r.selected=e.includes(tr(r));return}for(r of t.options){var i=tr(r);if(Uc(i,e)){r.selected=!0;return}}(!a||e!==void 0)&&(t.selectedIndex=-1)}function xu(t){var e=new MutationObserver(()=>{Qo(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),rs(()=>{e.disconnect()})}function Fs(t,e,a=e){var r=new WeakSet,i=!0;ns(t,"change",s=>{var l=s?"[selected]":":checked",u;if(t.multiple)u=[].map.call(t.querySelectorAll(l),tr);else{var v=t.querySelector(l)??t.querySelector("option:not([disabled])");u=v&&tr(v)}a(u),Ie!==null&&r.add(Ie)}),sr(()=>{var s=e();if(t===document.activeElement){var l=Qa??Ie;if(r.has(l))return}if(Qo(t,s,i),i&&s===void 0){var u=t.querySelector(":checked");u!==null&&(s=tr(u),a(s))}t.__value=s,i=!1}),xu(t)}function tr(t){return"__value"in t?t.__value:t.value}const ku=Symbol("is custom element"),Cu=Symbol("is html");function Mu(t,e){var a=os(t);a.value===(a.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function Su(t,e){var a=os(t);a.checked!==(a.checked=e??void 0)&&(t.checked=e)}function Ke(t,e,a,r){var i=os(t);i[e]!==(i[e]=a)&&(e==="loading"&&(t[rc]=a),a==null?t.removeAttribute(e):typeof a!="string"&&Tu(t).includes(e)?t[e]=a:t.setAttribute(e,a))}function os(t){return t.__attributes??={[ku]:t.nodeName.includes("-"),[Cu]:t.namespaceURI===Sc}}var Vs=new Map;function Tu(t){var e=t.getAttribute("is")||t.nodeName,a=Vs.get(e);if(a)return a;Vs.set(e,a=[]);for(var r,i=t,s=Element.prototype;s!==i;){r=oo(i);for(var l in r)r[l].set&&a.push(l);i=Ji(i)}return a}function lt(t,e,a=e){var r=new WeakSet;ns(t,"input",async i=>{var s=i?t.defaultValue:t.value;if(s=Ti(t)?Ai(s):s,a(s),Ie!==null&&r.add(Ie),await Sa(),s!==(s=e())){var l=t.selectionStart,u=t.selectionEnd,v=t.value.length;if(t.value=s??"",u!==null){var h=t.value.length;l===u&&u===v&&h>v?(t.selectionStart=h,t.selectionEnd=h):(t.selectionStart=l,t.selectionEnd=Math.min(u,h))}}}),bn(e)==null&&t.value&&(a(Ti(t)?Ai(t.value):t.value),Ie!==null&&r.add(Ie)),or(()=>{var i=e();if(t===document.activeElement){var s=Qa??Ie;if(r.has(s))return}Ti(t)&&i===Ai(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Sr(t,e,a=e){ns(t,"change",r=>{var i=r?t.defaultChecked:t.checked;a(i)}),bn(e)==null&&a(t.checked),or(()=>{var r=e();t.checked=!!r})}function Ti(t){var e=t.type;return e==="number"||e==="range"}function Ai(t){return t===""?null:+t}class ls{#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){ls.entries.set(a.target,a);for(var r of this.#e.get(a.target)||[])r(a)}}))}}var Au=new ls({box:"border-box"});function Hs(t,e,a){var r=Au.observe(t,()=>a(t[e]));sr(()=>(bn(()=>a(t[e])),r))}function js(t,e){return t===e||t?.[Mn]===e}function ra(t={},e,a,r){return sr(()=>{var i,s;return or(()=>{i=s,s=[],bn(()=>{t!==a(...s)&&(e(t,...s),i&&js(a(...i),t)&&e(null,...i))})}),()=>{va(()=>{s&&js(a(...s),t)&&e(null,...s)})}}),t}let Tr=!1;function Lu(t){var e=Tr;try{return Tr=!1,[t(),Tr]}finally{Tr=e}}function mt(t,e,a,r){var i=(a&wc)!==0,s=(a&xc)!==0,l=r,u=!0,v=()=>(u&&(u=!1,l=s?bn(r):r),l),h;if(i){var b=Mn in t||ac in t;h=Ta(t,e)?.set??(b&&e in t?z=>t[e]=z:void 0)}var y,g=!1;i?[y,g]=Lu(()=>t[e]):y=t[e],y===void 0&&r!==void 0&&(y=v(),h&&(uc(),h(y)));var p;if(p=()=>{var z=t[e];return z===void 0?v():(u=!0,z)},(a&yc)===0)return p;if(h){var A=t.$$legacy;return(function(z,R){return arguments.length>0?((!R||A||g)&&h(R?p():z),z):p()})}var k=!1,w=((a&gc)!==0?qr:Mo)(()=>(k=!1,p()));i&&n(w);var C=je;return(function(z,R){if(arguments.length>0){const x=R?n(w):i?pe(z):z;return _(w,x),k=!0,l!==void 0&&(l=x),z}return Xn&&k||(C.f&Cn)!==0?w.v:n(w)})}function cs(t){Vt===null&&vo(),Lt(()=>{const e=bn(t);if(typeof e=="function")return e})}function Pu(t){Vt===null&&vo(),cs(()=>()=>bn(t))}const Eu="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Eu);const Ws={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 zu{#e;get values(){return n(this.#e)}set values(e){_(this.#e,e,!0)}constructor(){this.#e=M(pe(Ws))}set(e){this.values={...Ws,...e}}}const $o=new zu,Gt=()=>typeof window.invokeNative=="function",f=(t,e)=>t?$o.values[t]??e??t:e??"",us=(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)},Us=["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"],qs=["Cheating","Exploiting","RDM","VDM","Toxic behavior","Mass rule violation","Ban evasion","Unauthorized modifications","Abuse of bugs"],Zs=["Orbit","System","Console","AntiCheat","Moderator01","SeniorAdmin"],Ks=[{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 Ou(){const t=()=>String.fromCharCode(65+Math.floor(Math.random()*26)),e=()=>Math.floor(Math.random()*10);return`${t()}${t()}${t()}-${e()}${e()}${e()}`}function Ys(t){return Array.from({length:t},(e,a)=>{const r=Us[a%Us.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 Nu(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:qs[Math.floor(Math.random()*qs.length)],banned_by:Zs[Math.floor(Math.random()*Zs.length)],banned_at:l,expires_at:i?null:l+s*24*60*60*1e3,permanent:i}})}function Du(t){return Array.from({length:t},()=>{const e=Ks[Math.floor(Math.random()*Ks.length)],a=Math.random()>.2,r=Math.random()>.8;return{owner:a?`license:${Math.random().toString(16).slice(2)}`:void 0,plate:Ou(),type:e.type,name:e.name,mileage:Math.random()>.1?Math.floor(Math.random()*2e5):null,impounded:r}})}const Ru={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}},Hn={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 Bu{#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=M(!Gt()),this.#n=M("dashboard"),this.#t=M(pe({})),this.#r=M(pe({})),this.#s=M(!1),this.#i=M(pe(Gt()?null:Ys(200))),this.#a=M(pe(Gt()?null:Ys(20))),this.#o=M(null),this.#l=M(pe(Gt()?null:Nu(200))),this.#c=M(pe(Gt()?0:200)),this.#u=M(pe(Gt())),this.#v=M(!1),this.#f=M(pe(Gt()?null:Du(200))),this.#h=M(pe(Gt()?0:200)),this.#_=M(pe(Gt())),this.#d=M(!1),this.#p=M(pe(Gt()?null:Ru)),this.#m=M(pe(Hn))}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??Hn.defaultModel,defaultColor:e.defaultColor??Hn.defaultColor,colorPresets:e.colorPresets?.length?e.colorPresets:Hn.colorPresets,neonPresets:e.neonPresets?.length?e.neonPresets:Hn.neonPresets,windowTints:e.windowTints?.length?e.windowTints:Hn.windowTints,wheelCategories:e.wheelCategories?.length?e.wheelCategories:Hn.wheelCategories,wheelDesigns:e.wheelDesigns?.length?e.wheelDesigns:Hn.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 U=new Bu;var Iu=B('<div class="data-component"><!> <span> </span></div>');function Xs(t,e){var a=Iu(),r=o(a);{var i=u=>{const v=W(()=>e.icon);var h=Le(),b=ue(h);ji(b,()=>n(v),(y,g)=>{g(y,{class:"data-component-icon"})}),P(u,h)};$(r,u=>{e.icon&&u(i)})}var s=c(r,2),l=o(s);Q(()=>m(l,e.content)),P(t,a)}var Fu=Zr('<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 Ui(t,e){var a=Fu();Q(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),P(t,a)}var Vu=Zr('<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 Ja(t,e){var a=Vu();Q(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),P(t,a)}const un={currentPlayers:0,maxPlayers:0,uptimeSeconds:0,uptimeFormatted:"00:00:00",environment:{weather:"CLEAR",hour:12,minute:0,blackout:!1,pvp:!0}};class Hu{#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=M(pe(un.currentPlayers)),this.#n=M(pe(un.maxPlayers)),this.#t=M(pe(un.uptimeSeconds)),this.#r=M(pe(un.uptimeFormatted)),this.#s=M(pe(un.environment?.weather)),this.#i=M(pe(un.environment?.hour)),this.#a=M(pe(un.environment?.minute)),this.#o=M(pe(un.environment?.blackout)),this.#l=M(pe(un.environment?.pvp))}set(e){this.currentPlayers=e.currentPlayers,this.maxPlayers=e.maxPlayers,this.uptimeSeconds=e.uptimeSeconds??0,this.uptimeFormatted=e.uptimeFormatted??un.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 Ze=new Hu;var ju=B('<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 Wu(t,e){et(e,!0);const a=W(()=>`${f("players")} ${Ze.currentPlayers}/${Ze.maxPlayers}`),r=W(()=>`${f("server_uptime")}: ${Ze.uptimeFormatted}`);var i=ju(),s=c(o(i),2),l=o(s),u=o(l),v=c(l,2),h=o(v),b=c(s,2),y=o(b);Xs(y,{get content(){return n(r)},get icon(){return Ui}});var g=c(y,2);Xs(g,{get content(){return n(a)},get icon(){return Ja}});var p=c(g,2);p.__click=function(...k){e.onOpenAdminMenu?.apply(this,k)};var A=c(p,2);A.__click=function(...k){e.onEscape?.apply(this,k)},Q((k,w,C)=>{m(u,k),m(h,w),Ke(p,"aria-label",C)},[()=>f("admin_menu"),()=>f("admin_menu_desc"),()=>f("open_admin_menu")]),P(t,i),tt()}ft(["click"]);class Uu{#e;get value(){return n(this.#e)}set value(e){_(this.#e,e,!0)}constructor(){this.#e=M("dashboard_home")}set(e){this.value=e}}const kt=new Uu;var qu=Zr('<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 Zu(t,e){var a=qu();Q(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),P(t,a)}var Ku=Zr('<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 1.5H10L13 4.5V14.5H3V1.5Z" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.5 1.5V5H13" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"></path><path d="M5.5 8H10.5M5.5 11H10.5" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"></path></svg>');function Yu(t,e){var a=Ku();Q(()=>Ne(a,0,`data-component-icon ${e.class??""}`)),P(t,a)}const Gs=[{label:"Dashboard Home",value:"dashboard_home",icon:Ui},{label:"Player Management",value:"ply_management",icon:Ja,subOptions:[{label:"Bans",value:"ply_bans",icon:Ja},{label:"Vehicles",value:"ply_vehicles",icon:Zu},{label:"Player Search",value:"ply_data",icon:Ja},{label:"Recent Players",value:"ply_recent",icon:Ja}]},{label:"Server Management",value:"srv_management",icon:Ui},{label:"Admin Logs",value:"admin_logs",icon:Yu}];function Xu(t){const e=t-1;return e*e*e+1}function Gu(t,{delay:e=0,duration:a=400,easing:r=Xu,axis:i="y"}={}){const s=getComputedStyle(t),l=+s.opacity,u=i==="y"?"height":"width",v=parseFloat(s[u]),h=i==="y"?["top","bottom"]:["left","right"],b=h.map(C=>`${C[0].toUpperCase()}${C.slice(1)}`),y=parseFloat(s[`padding${b[0]}`]),g=parseFloat(s[`padding${b[1]}`]),p=parseFloat(s[`margin${b[0]}`]),A=parseFloat(s[`margin${b[1]}`]),k=parseFloat(s[`border${b[0]}Width`]),w=parseFloat(s[`border${b[1]}Width`]);return{delay:e,duration:a,easing:r,css:C=>`overflow: hidden;opacity: ${Math.min(C*20,1)*l};${u}: ${C*v}px;padding-${h[0]}: ${C*y}px;padding-${h[1]}: ${C*g}px;margin-${h[0]}: ${C*p}px;margin-${h[1]}: ${C*A}px;border-${h[0]}-width: ${C*k}px;border-${h[1]}-width: ${C*w}px;min-${u}: 0`}}const Ju=4500;class Qu{#e;get items(){return n(this.#e)}set items(e){_(this.#e,e,!0)}constructor(){this.#e=M(pe([])),this.#n=1}#n;push(e,a="error",r=Ju){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 Kn=new Qu;function $u(t){return t.err??t.error??t.message??"Action failed."}async function Ye(t,e={}){try{if(!Gt())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&&Kn.error($u(r)),r}catch(a){return console.error(`[esx-adminmenu:NUI:${t}]`,a),Kn.error("The admin UI could not reach the client callback."),null}}const ev=100,tv=100,nv=t=>Ye("bring",{id:t}),av=t=>Ye("goto",{id:t}),rv=async t=>{(await Ye("spectate",{id:t}))?.success&&U.spectate()},iv=t=>{t&&U.stopSpectate()},sv=async(t,e)=>{const a=await Ye("kick",{id:t,reason:e});a&&!a.playerOnline&&U.removePlayer(t)},ov=async(t,e,a)=>{const r=await Ye("ban",{id:t,reason:e,duration:a});r&&!r.playerOnline&&U.removePlayer(t)},lv=async(t,e,a)=>(await Ye("ban:offline",{identifier:t,reason:e,duration:a}))?.success??!1,cv=async(t,e)=>{(await Ye("ban:changeExpiry",{identifier:t,newDate:e}))?.success&&U.updateBanExpiry(t,e)},uv=async t=>{(await Ye("ban:revoke",{identifier:t}))?.success&&U.removeBan(t)},vv=async(t,e)=>{(await Ye("vehicle:impound",{plate:t,impoundName:e}))?.success&&U.updateVehicleImpoundState(t,!0)},dv=async t=>{(await Ye("vehicle:unimpound",{plate:t}))?.success&&U.updateVehicleImpoundState(t,!1)},fv=async t=>{(await Ye("vehicle:delete",{plate:t}))?.success&&U.removeVehicle(t)},hv=(t,e)=>Ye("player:notify",{id:t,notificationContent:e,notificationType:"info"}),Ge=(t,e,a={})=>Ye("player:action",{id:t,action:e,payload:a}),qi=async(t={})=>{if(U.vehicleLoading||!t.reset&&!U.vehicleHasMore)return!1;U.vehicleLoading=!0;try{const e=await Ye("getVehicles",{offset:t.reset?0:U.vehicleNextOffset,limit:ev,search:t.search??""});if(!e?.success)return!1;const a=e.vehicles??[],r=e.hasMore??!1,i=e.nextOffset??(t.reset?a.length:U.vehicleNextOffset+a.length);return t.reset?U.setVehiclePage(a,r,i):U.appendVehiclePage(a,r,i),!0}finally{U.vehicleLoading=!1}},el=async(t={})=>{if(U.banLoading||!t.reset&&!U.banHasMore)return!1;U.banLoading=!0;try{const e=await Ye("getBans",{offset:t.reset?0:U.banNextOffset,limit:tv});if(!e?.success)return!1;const a=e.bans??[],r=e.hasMore??!1,i=e.nextOffset??(t.reset?a.length:U.banNextOffset+a.length);return t.reset?U.setBanPage(a,r,i):U.appendBanPage(a,r,i),!0}finally{U.banLoading=!1}},_v=(t,e={})=>Ye("server:action",{action:t,payload:e}),pv=(t,e={})=>Ye(`adminMenu:${t}`,e),mv=async t=>{const e=await Ye("server:radioPlayers",{channel:t});return e?.success?e.players??[]:[]},bv=async(t={})=>{const e=await Ye("getAdminLogs",t);return{logs:e?.success?e.logs??[]:[],hasMore:e?.hasMore===!0,nextOffset:e?.nextOffset??0,ok:e?.success===!0}};var gv=B("<button><!> <span> </span></button>"),yv=B('<div class="details"></div>'),wv=B('<div class="sidebar-divider"></div>'),xv=B('<div class="accordion"><button><!> <span class="label"> </span></button> <!> <!></div>'),kv=B('<nav class="sidebar"></nav>');function Cv(t,e){et(e,!0);function a(l,u){return l.subOptions?u===l.value?!0:l.subOptions.some(v=>v.value===u):!1}function r(l){kt.set(l.value)}async function i(l){switch(kt.set(l.value),l.value){case"ply_bans":U.bans||await el({reset:!0});break;case"ply_vehicles":U.vehicles||await qi({reset:!0});break;case"ply_recent":if(!U.recentPlayers){const u=await Ye("getRecentPlayers");u?.success&&U.setRecentPlayers(u.players??[])}break}}var s=kv();st(s,21,()=>Gs,Et,(l,u,v)=>{const h=W(()=>n(u).icon),b=W(()=>a(n(u),kt.value));var y=xv(),g=o(y);let p;g.__click=()=>r(n(u));var A=o(g);{var k=T=>{var D=Le(),K=ue(D);ji(K,()=>n(h),(N,L)=>{L(N,{class:"accordion-icon"})}),P(T,D)};$(A,T=>{n(h)&&T(k)})}var w=c(A,2),C=o(w),z=c(g,2);{var R=T=>{var D=yv();st(D,21,()=>n(u).subOptions,Et,(K,N)=>{const L=W(()=>n(N).icon);var F=gv();let ie;F.__click=()=>i(n(N));var ae=o(F);{var q=X=>{var G=Le(),se=ue(G);ji(se,()=>n(L),(le,fe)=>{fe(le,{class:"sub-icon"})}),P(X,G)};$(ae,X=>{n(L)&&X(q)})}var j=c(ae,2),Y=o(j);Q(()=>{ie=Ne(F,1,"sub-button",null,ie,{active:kt.value===n(N).value}),m(Y,n(N).label)}),P(K,F)}),mu(3,D,()=>Gu),P(T,D)};$(z,T=>{n(u).subOptions&&n(b)&&T(R)})}var x=c(z,2);{var S=T=>{var D=wv();P(T,D)};$(x,T=>{v<Gs.length-1&&T(S)})}Q(()=>{p=Ne(g,1,"header",null,p,{active:kt.value===n(u).value}),Ke(g,"aria-expanded",n(b)),m(C,n(u).label)}),P(l,y)}),P(t,s),tt()}ft(["click"]);const Mv=(()=>{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 Sv=B('<table class="vtlist-inner"><!><tbody><!></tbody></table> <!>',1),Tv=B('<div class="vtlist-inner"><!> <!> <!></div>'),Av=B("<div><!></div>");function vs(t,e){et(e,!0);var a;(function(I){I[I.OBSERVED=0]="OBSERVED",I[I.REQUESTED=1]="REQUESTED"})(a||(a={}));const r=mt(e,"items",19,()=>[]),i=mt(e,"isDisabled",3,!1),s=mt(e,"isHorizontal",3,!1),l=mt(e,"isTable",3,!1),u=mt(e,"preRenderCount",3,6),v=mt(e,"scrollToAlignment",19,()=>$n.AUTO),h=mt(e,"scrollToBehaviour",19,()=>Zi.INSTANT),b=mt(e,"class",3,""),y=mt(e,"style",3,""),g=3;let p=!1,A=-1,k,w=M(void 0),C=M(0),z=M(0),R=M(0),x=M(u()-1),S=M(0),T=M(pe({offset:e.scrollToOffset||0,scrollChangeReason:a.REQUESTED})),D;const K=W(()=>new Array(r().length)),N=W(()=>r().map((V,re)=>{let H=e.sizingCalculator?.(re,V);return H!==void 0||(H=n(K)[re],H!==void 0)?H:n(S)})),L=W(()=>{const I=[];return n(N).reduce((V,re)=>(I.push(V),V+re),0),I}),F=W(()=>{if(!r()||i())return[];const I=[];for(let V=n(R);V<=n(x);V++){const re=r()[V];re&&I.push({item:re,index:V,size:n(N)[V]})}return I}),ie=()=>n(L).length>0?n(L)[n(L).length-1]+n(N)[n(N).length-1]:0,ae=W(()=>Pr(!i()&&"overflow:auto;",y())),q=W(()=>{const I=n(L)[n(R)]?n(L)[n(R)]:0,V=n(x)>0?ie()-(n(L)[Math.min(n(x),n(L).length-1)]+n(N)[Math.min(n(x),n(N).length-1)]):0;return Pr(!l()&&"display:flex;",!l()&&(!s()&&"flex-direction:column;"||"flex-direction:row;"),!i()&&(!s()&&`margin-top:${I}px;margin-bottom:${V}px`||`margin-left:${I}px;margin-right:${V}px;width:${n(L)[Math.min(n(x),n(L).length-1)]+n(N)[Math.min(n(x),n(N).length-1)]-I}px`))});cs(()=>{k.addEventListener("scroll",G,Mv),ye(),e.scrollToOffset!==void 0?Fe(e.scrollToOffset):e.scrollToIndex!==void 0&&Fe(se(e.scrollToIndex)),p=!0}),Pu(()=>{p&&k.removeEventListener("scroll",G)}),Lt(()=>{e.scrollToIndex,v(),e.scrollToOffset,r().length,e.sizingCalculator,Y()}),Lt(()=>{n(R),n(x),Y()}),Lt(()=>{n(T).scrollChangeReason===a.REQUESTED?Fe(n(T).offset):ye()});let j={};async function Y(){if(!p)return;e.scrollToIndex&&e.scrollToOffset&&console.error("VirtualList: scrollToIndex and scrollToOffset MUST NOT be used together.");const I=j?.scrollToIndex!==e.scrollToIndex||j?.scrollToAlignment!==v(),V=j?.modelCount!==r().length||j?.sizingCalculator!==e.sizingCalculator||j?.avgSizeInPx!==n(S)||j?.clientHeight!==n(C)||j?.clientWidth!==n(z);if(V&&await X(),j?.scrollToOffset!==e.scrollToOffset?_(T,{offset:e.scrollToOffset||0,scrollChangeReason:a.REQUESTED},!0):typeof e.scrollToIndex=="number"&&(I||V)&&_(T,{offset:se(e.scrollToIndex),scrollChangeReason:a.REQUESTED},!0),e.onVisibleRangeUpdate&&(j?.startIdx!==n(R)||j?.endIdx!==n(x))){const H=me(s()?n(z):n(C),n(T).offset);e.onVisibleRangeUpdate(H)}j={scrollToIndex:e.scrollToIndex,scrollToAlignment:v(),scrollToOffset:e.scrollToOffset,modelCount:r().length,sizingCalculator:e.sizingCalculator,avgSizeInPx:n(S),clientHeight:n(C),clientWidth:n(z),startIdx:n(R),endIdx:n(x)}}async function X(I=0){A=Math.min(A,I-1),await ye()}function G(I){const V=s()?k.scrollLeft:k.scrollTop;I.target!==k||V<0||n(T).offset===V||D?.offset!==V&&(_(T,{offset:V,scrollChangeReason:a.OBSERVED},!0),e.onAfterScroll?.({offset:V,event:I}))}function se(I,V=v(),re=r().length){return I<0?I=0:I>=re&&(I=re-1),le(V,s()?n(z):n(C),n(T).offset,I)}function le(I=$n.START,V,re,H){if(V<=0)return 0;const ee=n(N)[H],Me=n(L)[H],he=Me-V+ee;let xe;switch(I){case $n.END:xe=he;break;case $n.CENTER:xe=Me-(V-ee)/2;break;case $n.START:xe=Me;break;default:xe=Math.max(he,Math.min(Me,re))}return Math.max(0,Math.min(ie()-V,xe))}function fe(I){if(isNaN(I))throw Error(`Invalid offset ${I} specified`);I=Math.max(0,I);const V=ve(),re=Math.max(0,A);return V.offset>=I?Se(0,re,I):ke(re,I)}function ve(){return A>=0?{offset:n(L)[A],size:n(N)[A]}:{offset:0,size:0}}function Se(I,V,re){for(;I<=V;){const H=I+(V-I>>>1),ee=n(L)[H];if(ee===re)return H;ee<re?I=H+1:V=H-1}return Math.max(0,I-1)}function ke(I,V){let re=1;for(;I<r().length&&n(L)[I]<V;)I+=re,re*=2;return Se(Math.floor(I/2),Math.min(I,r().length-1),V)}async function ye(){n(S)||_(S,ce(),!0);const I=me(s()?n(z):n(C),n(T).offset,g);_(R,I.start,!0),_(x,I.end,!0),await Sa();let V=0;const re=new Map,H=he=>(re.has(he)||re.set(he,getComputedStyle(he)),re.get(he)),ee={},Me=ze();for(let he=0;he<Me.length;he++){const xe=Me[he],d=H(xe),E=d.position;if(E&&["absolute","fixed"].includes(E))continue;const O=d.display!=="none"?Ce(xe):0,ne=n(R)+V;ee[ne]=(ee[ne]||0)+O,V++}for(const he of Object.keys(ee)){const xe=parseInt(he);n(K)[xe]!==ee[xe]&&(n(K)[xe]=ee[xe])}}function ce(){const V=[],re=ze();for(let H=0;H<re.length;H++){const ee=re[H],Me=getComputedStyle(ee);if(["absolute","fixed"].includes(Me.position))continue;const he=Ce(ee);if(V.push(he),V.length>=10)break}return V.length===0?0:V.reduce((H,ee)=>H+ee,0)/V.length}function de(I){const V=getComputedStyle(I);let re=parseFloat(s()?V.width:V.height);return V.boxSizing==="border-box"&&(s()?re-=parseFloat(V.borderLeftWidth)-parseFloat(V.borderRightWidth):re-=parseFloat(V.borderTopWidth)-parseFloat(V.borderBottomWidth)),re}function me(I=0,V,re=0){if(ie()===0)return{start:0,end:0};const H=V+I;let ee=fe(V);if(ee===void 0)throw Error(`Invalid offset ${V} specified`);let Me=n(L)[ee]+n(N)[ee],he=ee;for(;Me<H&&he<r().length-1;)he++,Me+=n(N)[he];return re>0&&(ee=Math.max(0,ee-re),he=Math.min(he+re,r().length-1)),{start:ee,end:he}}function Ce(I){const V=getComputedStyle(I);let re=de(I);return s()?re+=parseFloat(V.borderLeftWidth)+parseFloat(V.borderRightWidth)+parseFloat(V.marginLeft)+parseFloat(V.marginRight):re+=parseFloat(V.borderTopWidth)+parseFloat(V.borderBottomWidth)+parseFloat(V.marginTop)+parseFloat(V.marginBottom),Number.isNaN(re)?0:re}function Fe(I){if("scroll"in k){const V={behavior:h()};V[s()?"left":"top"]=I,k.scroll(V)}else k[s()?"scrollLeft":"scrollTop"]=I}function ze(){return l()?n(w).querySelector("tbody").children:n(w).children}var Te=Av(),Qe=o(Te);{var nt=I=>{var V=Sv(),re=ue(V),H=o(re);Vn(H,()=>e.header??dn);var ee=c(H),Me=o(ee);{var he=E=>{var O=Le(),ne=ue(O);st(ne,17,r,Et,(te,J,oe)=>{var we=Le(),Re=ue(we);Vn(Re,()=>e.vl_slot,()=>({index:oe,item:n(J)})),P(te,we)}),P(E,O)},xe=E=>{var O=Le(),ne=ue(O);st(ne,17,()=>n(F),te=>te.index,(te,J)=>{var oe=Le(),we=ue(oe);Vn(we,()=>e.vl_slot,()=>n(J)),P(te,oe)}),P(E,O)};$(Me,E=>{i()?E(he):E(xe,!1)})}ra(re,E=>_(w,E),()=>n(w));var d=c(re,2);Vn(d,()=>e.footer??dn),Q(()=>xn(re,n(q))),P(I,V)},rt=I=>{var V=Tv(),re=o(V);Vn(re,()=>e.header??dn);var H=c(re,2);{var ee=xe=>{var d=Le(),E=ue(d);st(E,17,r,Et,(O,ne,te)=>{var J=Le(),oe=ue(J);Vn(oe,()=>e.vl_slot,()=>({index:te,item:n(ne)})),P(O,J)}),P(xe,d)},Me=xe=>{var d=Le(),E=ue(d);st(E,16,()=>n(F),O=>O,(O,ne)=>{var te=Le(),J=ue(te);Vn(J,()=>e.vl_slot,()=>ne),P(O,te)}),P(xe,d)};$(H,xe=>{i()?xe(ee):xe(Me,!1)})}var he=c(H,2);Vn(he,()=>e.footer??dn),ra(V,xe=>_(w,xe),()=>n(w)),Q(()=>xn(V,n(q))),P(I,V)};$(Qe,I=>{l()?I(nt):I(rt,!1)})}ra(Te,I=>k=I,()=>k),Q(I=>{Ne(Te,1,I),xn(Te,n(ae))},[()=>gu(Pr("vtlist",b()))]),Hs(Te,"clientHeight",I=>_(C,I)),Hs(Te,"clientWidth",I=>_(z,I)),P(t,Te),tt()}var Zi;(function(t){t.AUTO="auto",t.SMOOTH="smooth",t.INSTANT="instant"})(Zi||(Zi={}));var $n;(function(t){t.AUTO="auto",t.START="start",t.CENTER="center",t.END="end"})($n||($n={}));const Br=Math.min,ia=Math.max,Ir=Math.round,Ar=Math.floor,hn=t=>({x:t,y:t}),Lv={left:"right",right:"left",bottom:"top",top:"bottom"},Pv={start:"end",end:"start"};function Js(t,e,a){return ia(t,Br(e,a))}function Kr(t,e){return typeof t=="function"?t(e):t}function la(t){return t.split("-")[0]}function Yr(t){return t.split("-")[1]}function tl(t){return t==="x"?"y":"x"}function nl(t){return t==="y"?"height":"width"}const Ev=new Set(["top","bottom"]);function Wn(t){return Ev.has(la(t))?"y":"x"}function al(t){return tl(Wn(t))}function zv(t,e,a){a===void 0&&(a=!1);const r=Yr(t),i=al(t),s=nl(i);let l=i==="x"?r===(a?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=Fr(l)),[l,Fr(l)]}function Ov(t){const e=Fr(t);return[Ki(t),e,Ki(e)]}function Ki(t){return t.replace(/start|end/g,e=>Pv[e])}const Qs=["left","right"],$s=["right","left"],Nv=["top","bottom"],Dv=["bottom","top"];function Rv(t,e,a){switch(t){case"top":case"bottom":return a?e?$s:Qs:e?Qs:$s;case"left":case"right":return e?Nv:Dv;default:return[]}}function Bv(t,e,a,r){const i=Yr(t);let s=Rv(la(t),a==="start",r);return i&&(s=s.map(l=>l+"-"+i),e&&(s=s.concat(s.map(Ki)))),s}function Fr(t){return t.replace(/left|right|bottom|top/g,e=>Lv[e])}function Iv(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fv(t){return typeof t!="number"?Iv(t):{top:t,right:t,bottom:t,left:t}}function Vr(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 eo(t,e,a){let{reference:r,floating:i}=t;const s=Wn(e),l=al(e),u=nl(l),v=la(e),h=s==="y",b=r.x+r.width/2-i.width/2,y=r.y+r.height/2-i.height/2,g=r[u]/2-i[u]/2;let p;switch(v){case"top":p={x:b,y:r.y-i.height};break;case"bottom":p={x:b,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y};break;case"left":p={x:r.x-i.width,y};break;default:p={x:r.x,y:r.y}}switch(Yr(e)){case"start":p[l]-=g*(a&&h?-1:1);break;case"end":p[l]+=g*(a&&h?-1:1);break}return p}const Vv=async(t,e,a)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:l}=a,u=s.filter(Boolean),v=await(l.isRTL==null?void 0:l.isRTL(e));let h=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:b,y}=eo(h,r,v),g=r,p={},A=0;for(let k=0;k<u.length;k++){const{name:w,fn:C}=u[k],{x:z,y:R,data:x,reset:S}=await C({x:b,y,initialPlacement:r,placement:g,strategy:i,middlewareData:p,rects:h,platform:l,elements:{reference:t,floating:e}});b=z??b,y=R??y,p={...p,[w]:{...p[w],...x}},S&&A<=50&&(A++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(h=S.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:b,y}=eo(h,g,v)),k=-1)}return{x:b,y,placement:g,strategy:i,middlewareData:p}};async function rl(t,e){var a;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:l,elements:u,strategy:v}=t,{boundary:h="clippingAncestors",rootBoundary:b="viewport",elementContext:y="floating",altBoundary:g=!1,padding:p=0}=Kr(e,t),A=Fv(p),w=u[g?y==="floating"?"reference":"floating":y],C=Vr(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(u.floating)),boundary:h,rootBoundary:b,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(u.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},S=Vr(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:z,offsetParent:R,strategy:v}):z);return{top:(C.top-S.top+A.top)/x.y,bottom:(S.bottom-C.bottom+A.bottom)/x.y,left:(C.left-S.left+A.left)/x.x,right:(S.right-C.right+A.right)/x.x}}const Hv=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:u,platform:v,elements:h}=e,{mainAxis:b=!0,crossAxis:y=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:k=!0,...w}=Kr(t,e);if((a=s.arrow)!=null&&a.alignmentOffset)return{};const C=la(i),z=Wn(u),R=la(u)===u,x=await(v.isRTL==null?void 0:v.isRTL(h.floating)),S=g||(R||!k?[Fr(u)]:Ov(u)),T=A!=="none";!g&&T&&S.push(...Bv(u,k,A,x));const D=[u,...S],K=await rl(e,w),N=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(b&&N.push(K[C]),y){const q=zv(i,l,x);N.push(K[q[0]],K[q[1]])}if(L=[...L,{placement:i,overflows:N}],!N.every(q=>q<=0)){var F,ie;const q=(((F=s.flip)==null?void 0:F.index)||0)+1,j=D[q];if(j&&(!(y==="alignment"?z!==Wn(j):!1)||L.every(G=>Wn(G.placement)===z?G.overflows[0]>0:!0)))return{data:{index:q,overflows:L},reset:{placement:j}};let Y=(ie=L.filter(X=>X.overflows[0]<=0).sort((X,G)=>X.overflows[1]-G.overflows[1])[0])==null?void 0:ie.placement;if(!Y)switch(p){case"bestFit":{var ae;const X=(ae=L.filter(G=>{if(T){const se=Wn(G.placement);return se===z||se==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(se=>se>0).reduce((se,le)=>se+le,0)]).sort((G,se)=>G[1]-se[1])[0])==null?void 0:ae[0];X&&(Y=X);break}case"initialPlacement":Y=u;break}if(i!==Y)return{reset:{placement:Y}}}return{}}}},jv=new Set(["left","top"]);async function Wv(t,e){const{placement:a,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=la(a),u=Yr(a),v=Wn(a)==="y",h=jv.has(l)?-1:1,b=s&&v?-1:1,y=Kr(e,t);let{mainAxis:g,crossAxis:p,alignmentAxis:A}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return u&&typeof A=="number"&&(p=u==="end"?A*-1:A),v?{x:p*b,y:g*h}:{x:g*h,y:p*b}}const Uv=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:u}=e,v=await Wv(e,t);return l===((a=u.offset)==null?void 0:a.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+v.x,y:s+v.y,data:{...v,placement:l}}}}},qv=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:u={fn:w=>{let{x:C,y:z}=w;return{x:C,y:z}}},...v}=Kr(t,e),h={x:a,y:r},b=await rl(e,v),y=Wn(la(i)),g=tl(y);let p=h[g],A=h[y];if(s){const w=g==="y"?"top":"left",C=g==="y"?"bottom":"right",z=p+b[w],R=p-b[C];p=Js(z,p,R)}if(l){const w=y==="y"?"top":"left",C=y==="y"?"bottom":"right",z=A+b[w],R=A-b[C];A=Js(z,A,R)}const k=u.fn({...e,[g]:p,[y]:A});return{...k,data:{x:k.x-a,y:k.y-r,enabled:{[g]:s,[y]:l}}}}}};function Xr(){return typeof window<"u"}function Ra(t){return il(t)?(t.nodeName||"").toLowerCase():"#document"}function Zt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function gn(t){var e;return(e=(il(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function il(t){return Xr()?t instanceof Node||t instanceof Zt(t).Node:!1}function sn(t){return Xr()?t instanceof Element||t instanceof Zt(t).Element:!1}function pn(t){return Xr()?t instanceof HTMLElement||t instanceof Zt(t).HTMLElement:!1}function to(t){return!Xr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zt(t).ShadowRoot}const Zv=new Set(["inline","contents"]);function ur(t){const{overflow:e,overflowX:a,overflowY:r,display:i}=on(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+a)&&!Zv.has(i)}const Kv=new Set(["table","td","th"]);function Yv(t){return Kv.has(Ra(t))}const Xv=[":popover-open",":modal"];function Gr(t){return Xv.some(e=>{try{return t.matches(e)}catch{return!1}})}const Gv=["transform","translate","scale","rotate","perspective"],Jv=["transform","translate","scale","rotate","perspective","filter"],Qv=["paint","layout","strict","content"];function ds(t){const e=fs(),a=sn(t)?on(t):t;return Gv.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)||Jv.some(r=>(a.willChange||"").includes(r))||Qv.some(r=>(a.contain||"").includes(r))}function $v(t){let e=Gn(t);for(;pn(e)&&!Oa(e);){if(ds(e))return e;if(Gr(e))return null;e=Gn(e)}return null}function fs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ed=new Set(["html","body","#document"]);function Oa(t){return ed.has(Ra(t))}function on(t){return Zt(t).getComputedStyle(t)}function Jr(t){return sn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Gn(t){if(Ra(t)==="html")return t;const e=t.assignedSlot||t.parentNode||to(t)&&t.host||gn(t);return to(e)?e.host:e}function sl(t){const e=Gn(t);return Oa(e)?t.ownerDocument?t.ownerDocument.body:t.body:pn(e)&&ur(e)?e:sl(e)}function rr(t,e,a){var r;e===void 0&&(e=[]),a===void 0&&(a=!0);const i=sl(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),l=Zt(i);if(s){const u=Yi(l);return e.concat(l,l.visualViewport||[],ur(i)?i:[],u&&a?rr(u):[])}return e.concat(i,rr(i,[],a))}function Yi(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ol(t){const e=on(t);let a=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=pn(t),s=i?t.offsetWidth:a,l=i?t.offsetHeight:r,u=Ir(a)!==s||Ir(r)!==l;return u&&(a=s,r=l),{width:a,height:r,$:u}}function hs(t){return sn(t)?t:t.contextElement}function Aa(t){const e=hs(t);if(!pn(e))return hn(1);const a=e.getBoundingClientRect(),{width:r,height:i,$:s}=ol(e);let l=(s?Ir(a.width):a.width)/r,u=(s?Ir(a.height):a.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const td=hn(0);function ll(t){const e=Zt(t);return!fs()||!e.visualViewport?td:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function nd(t,e,a){return e===void 0&&(e=!1),!a||e&&a!==Zt(t)?!1:e}function ca(t,e,a,r){e===void 0&&(e=!1),a===void 0&&(a=!1);const i=t.getBoundingClientRect(),s=hs(t);let l=hn(1);e&&(r?sn(r)&&(l=Aa(r)):l=Aa(t));const u=nd(s,a,r)?ll(s):hn(0);let v=(i.left+u.x)/l.x,h=(i.top+u.y)/l.y,b=i.width/l.x,y=i.height/l.y;if(s){const g=Zt(s),p=r&&sn(r)?Zt(r):r;let A=g,k=Yi(A);for(;k&&r&&p!==A;){const w=Aa(k),C=k.getBoundingClientRect(),z=on(k),R=C.left+(k.clientLeft+parseFloat(z.paddingLeft))*w.x,x=C.top+(k.clientTop+parseFloat(z.paddingTop))*w.y;v*=w.x,h*=w.y,b*=w.x,y*=w.y,v+=R,h+=x,A=Zt(k),k=Yi(A)}}return Vr({width:b,height:y,x:v,y:h})}function Qr(t,e){const a=Jr(t).scrollLeft;return e?e.left+a:ca(gn(t)).left+a}function cl(t,e){const a=t.getBoundingClientRect(),r=a.left+e.scrollLeft-Qr(t,a),i=a.top+e.scrollTop;return{x:r,y:i}}function ad(t){let{elements:e,rect:a,offsetParent:r,strategy:i}=t;const s=i==="fixed",l=gn(r),u=e?Gr(e.floating):!1;if(r===l||u&&s)return a;let v={scrollLeft:0,scrollTop:0},h=hn(1);const b=hn(0),y=pn(r);if((y||!y&&!s)&&((Ra(r)!=="body"||ur(l))&&(v=Jr(r)),pn(r))){const p=ca(r);h=Aa(r),b.x=p.x+r.clientLeft,b.y=p.y+r.clientTop}const g=l&&!y&&!s?cl(l,v):hn(0);return{width:a.width*h.x,height:a.height*h.y,x:a.x*h.x-v.scrollLeft*h.x+b.x+g.x,y:a.y*h.y-v.scrollTop*h.y+b.y+g.y}}function rd(t){return Array.from(t.getClientRects())}function id(t){const e=gn(t),a=Jr(t),r=t.ownerDocument.body,i=ia(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=ia(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-a.scrollLeft+Qr(t);const u=-a.scrollTop;return on(r).direction==="rtl"&&(l+=ia(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:l,y:u}}const no=25;function sd(t,e){const a=Zt(t),r=gn(t),i=a.visualViewport;let s=r.clientWidth,l=r.clientHeight,u=0,v=0;if(i){s=i.width,l=i.height;const b=fs();(!b||b&&e==="fixed")&&(u=i.offsetLeft,v=i.offsetTop)}const h=Qr(r);if(h<=0){const b=r.ownerDocument,y=b.body,g=getComputedStyle(y),p=b.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,A=Math.abs(r.clientWidth-y.clientWidth-p);A<=no&&(s-=A)}else h<=no&&(s+=h);return{width:s,height:l,x:u,y:v}}const od=new Set(["absolute","fixed"]);function ld(t,e){const a=ca(t,!0,e==="fixed"),r=a.top+t.clientTop,i=a.left+t.clientLeft,s=pn(t)?Aa(t):hn(1),l=t.clientWidth*s.x,u=t.clientHeight*s.y,v=i*s.x,h=r*s.y;return{width:l,height:u,x:v,y:h}}function ao(t,e,a){let r;if(e==="viewport")r=sd(t,a);else if(e==="document")r=id(gn(t));else if(sn(e))r=ld(e,a);else{const i=ll(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Vr(r)}function ul(t,e){const a=Gn(t);return a===e||!sn(a)||Oa(a)?!1:on(a).position==="fixed"||ul(a,e)}function cd(t,e){const a=e.get(t);if(a)return a;let r=rr(t,[],!1).filter(u=>sn(u)&&Ra(u)!=="body"),i=null;const s=on(t).position==="fixed";let l=s?Gn(t):t;for(;sn(l)&&!Oa(l);){const u=on(l),v=ds(l);!v&&u.position==="fixed"&&(i=null),(s?!v&&!i:!v&&u.position==="static"&&!!i&&od.has(i.position)||ur(l)&&!v&&ul(t,l))?r=r.filter(b=>b!==l):i=u,l=Gn(l)}return e.set(t,r),r}function ud(t){let{element:e,boundary:a,rootBoundary:r,strategy:i}=t;const l=[...a==="clippingAncestors"?Gr(e)?[]:cd(e,this._c):[].concat(a),r],u=l[0],v=l.reduce((h,b)=>{const y=ao(e,b,i);return h.top=ia(y.top,h.top),h.right=Br(y.right,h.right),h.bottom=Br(y.bottom,h.bottom),h.left=ia(y.left,h.left),h},ao(e,u,i));return{width:v.right-v.left,height:v.bottom-v.top,x:v.left,y:v.top}}function vd(t){const{width:e,height:a}=ol(t);return{width:e,height:a}}function dd(t,e,a){const r=pn(e),i=gn(e),s=a==="fixed",l=ca(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const v=hn(0);function h(){v.x=Qr(i)}if(r||!r&&!s)if((Ra(e)!=="body"||ur(i))&&(u=Jr(e)),r){const p=ca(e,!0,s,e);v.x=p.x+e.clientLeft,v.y=p.y+e.clientTop}else i&&h();s&&!r&&i&&h();const b=i&&!r&&!s?cl(i,u):hn(0),y=l.left+u.scrollLeft-v.x-b.x,g=l.top+u.scrollTop-v.y-b.y;return{x:y,y:g,width:l.width,height:l.height}}function Li(t){return on(t).position==="static"}function ro(t,e){if(!pn(t)||on(t).position==="fixed")return null;if(e)return e(t);let a=t.offsetParent;return gn(t)===a&&(a=a.ownerDocument.body),a}function vl(t,e){const a=Zt(t);if(Gr(t))return a;if(!pn(t)){let i=Gn(t);for(;i&&!Oa(i);){if(sn(i)&&!Li(i))return i;i=Gn(i)}return a}let r=ro(t,e);for(;r&&Yv(r)&&Li(r);)r=ro(r,e);return r&&Oa(r)&&Li(r)&&!ds(r)?a:r||$v(t)||a}const fd=async function(t){const e=this.getOffsetParent||vl,a=this.getDimensions,r=await a(t.floating);return{reference:dd(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hd(t){return on(t).direction==="rtl"}const _d={convertOffsetParentRelativeRectToViewportRelativeRect:ad,getDocumentElement:gn,getClippingRect:ud,getOffsetParent:vl,getElementRects:fd,getClientRects:rd,getDimensions:vd,getScale:Aa,isElement:sn,isRTL:hd};function dl(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function pd(t,e){let a=null,r;const i=gn(t);function s(){var u;clearTimeout(r),(u=a)==null||u.disconnect(),a=null}function l(u,v){u===void 0&&(u=!1),v===void 0&&(v=1),s();const h=t.getBoundingClientRect(),{left:b,top:y,width:g,height:p}=h;if(u||e(),!g||!p)return;const A=Ar(y),k=Ar(i.clientWidth-(b+g)),w=Ar(i.clientHeight-(y+p)),C=Ar(b),R={rootMargin:-A+"px "+-k+"px "+-w+"px "+-C+"px",threshold:ia(0,Br(1,v))||1};let x=!0;function S(T){const D=T[0].intersectionRatio;if(D!==v){if(!x)return l();D?l(!1,D):r=setTimeout(()=>{l(!1,1e-7)},1e3)}D===1&&!dl(h,t.getBoundingClientRect())&&l(),x=!1}try{a=new IntersectionObserver(S,{...R,root:i.ownerDocument})}catch{a=new IntersectionObserver(S,R)}a.observe(t)}return l(!0),s}function fl(t,e,a,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:v=!1}=r,h=hs(t),b=i||s?[...h?rr(h):[],...rr(e)]:[];b.forEach(C=>{i&&C.addEventListener("scroll",a,{passive:!0}),s&&C.addEventListener("resize",a)});const y=h&&u?pd(h,a):null;let g=-1,p=null;l&&(p=new ResizeObserver(C=>{let[z]=C;z&&z.target===h&&p&&(p.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=p)==null||R.observe(e)})),a()}),h&&!v&&p.observe(h),p.observe(e));let A,k=v?ca(t):null;v&&w();function w(){const C=ca(t);k&&!dl(k,C)&&a(),k=C,A=requestAnimationFrame(w)}return a(),()=>{var C;b.forEach(z=>{i&&z.removeEventListener("scroll",a),s&&z.removeEventListener("resize",a)}),y?.(),(C=p)==null||C.disconnect(),p=null,v&&cancelAnimationFrame(A)}}const hl=Uv,_l=qv,pl=Hv,ml=(t,e,a)=>{const r=new Map,i={platform:_d,...a},s={...i.platform,_c:r};return Vv(t,e,{...i,platform:s})};var md=B("<span> </span>"),bd=B('<button type="button"> </button>'),gd=B('<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 yd(t,e){et(e,!0);let a=M(pe(new Date().getFullYear())),r=M(pe(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 S=x.getFullYear(),T=String(x.getMonth()+1).padStart(2,"0"),D=String(x.getDate()).padStart(2,"0");return`${S}-${T}-${D}`}function u(x){return new Date(`${x}T00:00:00`)}const v=W(()=>u(e.min).getTime()),h=W(()=>i.format(new Date(n(a),n(r),1))),b=W(()=>{const x=new Date(n(a),n(r),1),S=new Date(x),T=(x.getDay()+6)%7;return S.setDate(x.getDate()-T),Array.from({length:42},(D,K)=>{const N=new Date(S);N.setDate(S.getDate()+K);const L=l(N);return{key:L,value:L,label:N.getDate(),inMonth:N.getMonth()===n(r),selected:L===e.value,disabled:N.getTime()<n(v)}})});Lt(()=>{if(!e.value)return;const x=u(e.value);_(a,x.getFullYear(),!0),_(r,x.getMonth(),!0)});function y(x){const S=new Date(n(a),n(r)+x,1);_(a,S.getFullYear(),!0),_(r,S.getMonth(),!0)}var g=gd(),p=o(g),A=o(p);A.__click=()=>y(-1);var k=c(A,2),w=o(k),C=c(k,2);C.__click=()=>y(1);var z=c(p,2);st(z,21,()=>s,Et,(x,S)=>{var T=md(),D=o(T);Q(()=>m(D,n(S))),P(x,T)});var R=c(z,2);st(R,21,()=>n(b),x=>x.key,(x,S)=>{var T=bd();T.__click=()=>e.onChange(n(S).value);let D;var K=o(T);Q(()=>{T.disabled=n(S).disabled,D=Ne(T,1,"",null,D,{muted:!n(S).inMonth,selected:n(S).selected}),m(K,n(S).label)}),P(x,T)}),Q(()=>m(w,n(h))),P(t,g),tt()}ft(["click"]);var wd=B('<label class="confirm-field"><span class="confirm-label"> </span> <!></label>'),xd=B('<button type="button" tabindex="-1"> </button>'),kd=B('<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>'),Cd=B('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text"/></label>'),Md=B('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="text"/></label>'),Sd=B('<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),Td=B('<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),Ad=B('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="number" min="0"/></label>'),Ld=B('<label class="confirm-field"><span class="confirm-label"> </span> <input class="confirm-input" type="number"/></label>'),Pd=B('<button type="button" tabindex="-1"> </button>'),Ed=B('<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>'),zd=B('<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 Od(t,e){et(e,!0);let a=M(!1),r=M(null);const i=W(()=>Object.keys(U.impounds??{}));let s=M(null);Lt(()=>{e.open?_(s,Date.now(),!0):_(s,null)});let l=M(""),u=M(""),v=M(""),h=M(""),b=M(null),y=M(null),g=M("days"),p=M(!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({}),S();return}if(e.confirmType==="impound_vehicle"){if(!n(r))return;e.onConfirm({impoundName:n(r)}),S();return}if(e.confirmType==="revoke"){e.onConfirm({}),S();return}if(e.confirmType==="change_expiry"){if(!n(l))return;const j=new Date(n(l)+"T00:00:00").getTime();e.onConfirm({newDate:j}),S();return}if(e.confirmType==="notify"&&n(u).trim()==="")return;if(e.confirmType==="give_money"||e.confirmType==="take_money"){if(n(b)===null||n(b)<=0)return;e.onConfirm({amount:n(b)}),S();return}if(e.confirmType==="set_health"||e.confirmType==="set_armor"){if(n(b)===null||n(b)<0)return;e.onConfirm({amount:n(b)}),S();return}if(e.confirmType==="set_name"){if(n(v).trim()===""||n(h).trim()==="")return;e.onConfirm({text:n(v).trim(),secondaryText:n(h).trim()}),S();return}if(e.confirmType==="set_job"){if(n(v).trim()==="")return;e.onConfirm({text:n(v).trim(),amount:n(b)??0}),S();return}if(e.confirmType&&C.has(e.confirmType)){if(n(v).trim()==="")return;e.onConfirm({text:n(v).trim()}),S();return}if(e.confirmType&&z.has(e.confirmType)){if(n(b)===null||n(b)<0)return;e.onConfirm({amount:n(b)}),S();return}let q=null;e.confirmType==="ban"&&n(y)!==null&&(q=n(y)*A[n(g)]),e.onConfirm({reason:n(u),duration:q}),S()}function x(){e.onCancel(),S()}function S(){_(l,""),_(u,""),_(v,""),_(h,""),_(b,null),_(y,null),_(g,"days"),_(p,!1),_(r,null),_(a,!1)}function T(){_(p,!n(p))}function D(q){_(g,q,!0),_(p,!1)}function K(){_(a,!n(a))}function N(q){_(r,q,!0),_(a,!1)}function L(q){q.stopPropagation()}var F=Le();Ln("click",Yn,()=>{!e.open||n(s)===null||Date.now()-n(s)<1e3||x()}),Ln("keydown",Yn,q=>{q.key==="Escape"&&(!e.open||n(s)===null||Date.now()-n(s)<1e3||x())});var ie=ue(F);{var ae=q=>{var j=zd(),Y=o(j);Y.__click=L,Y.__keydown=L;var X=o(Y),G=o(X),se=o(G),le=c(X,2),fe=o(le);{var ve=d=>{var E=wd(),O=o(E),ne=o(O),te=c(O,2);{let J=W(()=>new Date().toISOString().split("T")[0]);yd(te,{get value(){return n(l)},get min(){return n(J)},onChange:oe=>_(l,oe,!0)})}Q(J=>m(ne,J),[()=>f("new_expiry_date")]),P(d,E)};$(fe,d=>{e.confirmType==="change_expiry"&&d(ve)})}var Se=c(fe,2);{var ke=d=>{var E=kd(),O=o(E),ne=o(O),te=c(O,2);te.__click=L,te.__keydown=L;var J=o(te);J.__click=K;var oe=o(J),we=o(oe),Re=c(oe,2);let Xe;var De=c(J,2);let Ve;st(De,21,()=>n(i),Et,(Pe,Oe)=>{var We=xd();let $e;We.__click=Be=>{Be.preventDefault(),N(n(Oe))};var He=o(We);Q(()=>{$e=Ne(We,1,"confirm-dropdown-item",null,$e,{selected:n(Oe)===n(r)}),m(He,n(Oe))}),P(Pe,We)}),Q((Pe,Oe)=>{m(ne,Pe),Ke(J,"aria-expanded",n(a)),m(we,Oe),Xe=Ne(Re,0,"confirm-dropdown-arrow",null,Xe,{open:n(a)}),Ve=Ne(De,1,"confirm-dropdown-menu",null,Ve,{open:n(a)})},[()=>f("select_impound"),()=>n(r)??f("select_impound")]),P(d,E)};$(Se,d=>{e.confirmType==="impound_vehicle"&&d(ke)})}var ye=c(Se,2);{var ce=d=>{var E=Cd(),O=o(E),ne=o(O),te=c(O,2);Q((J,oe)=>{m(ne,J),Ke(te,"placeholder",oe)},[()=>e.confirmType==="notify"?f("notification_message"):f("reason"),()=>e.confirmType==="notify"?f("notification_message"):f("ban_reason_placeholder")]),lt(te,()=>n(u),J=>_(u,J)),P(d,E)};$(ye,d=>{(e.confirmType==="ban"||e.confirmType==="kick"||e.confirmType==="notify")&&d(ce)})}var de=c(ye,2);{var me=d=>{var E=Md(),O=o(E),ne=o(O),te=c(O,2);Q(J=>{m(ne,J),Ke(te,"placeholder",e.confirmType==="set_model"?"mp_m_freemode_01":"admin")},[()=>e.confirmType==="set_model"?f("model_name"):f("ace_group")]),lt(te,()=>n(v),J=>_(v,J)),P(d,E)};$(de,d=>{(e.confirmType==="set_model"||e.confirmType==="ace_add"||e.confirmType==="ace_remove")&&d(me)})}var Ce=c(de,2);{var Fe=d=>{var E=Sd(),O=ue(E),ne=o(O),te=o(ne),J=c(ne,2),oe=c(O,2),we=o(oe),Re=o(we),Xe=c(we,2);Q((De,Ve)=>{m(te,De),m(Re,Ve)},[()=>f("first_name"),()=>f("last_name")]),lt(J,()=>n(v),De=>_(v,De)),lt(Xe,()=>n(h),De=>_(h,De)),P(d,E)};$(Ce,d=>{e.confirmType==="set_name"&&d(Fe)})}var ze=c(Ce,2);{var Te=d=>{var E=Td(),O=ue(E),ne=o(O),te=o(ne),J=c(ne,2),oe=c(O,2),we=o(oe),Re=o(we),Xe=c(we,2);Q((De,Ve)=>{m(te,De),m(Re,Ve)},[()=>f("job"),()=>f("job_grade")]),lt(J,()=>n(v),De=>_(v,De)),lt(Xe,()=>n(b),De=>_(b,De)),P(d,E)};$(ze,d=>{e.confirmType==="set_job"&&d(Te)})}var Qe=c(ze,2);{var nt=d=>{var E=Ad(),O=o(E),ne=o(O),te=c(O,2);Q(J=>{m(ne,J),Ke(te,"max",e.confirmType==="set_thirst"||e.confirmType==="set_hunger"?100:void 0)},[()=>e.confirmType==="set_bucket"?f("routing_bucket"):e.confirmType==="set_radio"?f("radio_channel"):e.confirmType==="set_thirst"?f("thirst"):f("hunger")]),lt(te,()=>n(b),J=>_(b,J)),P(d,E)};$(Qe,d=>{(e.confirmType==="set_bucket"||e.confirmType==="set_radio"||e.confirmType==="set_thirst"||e.confirmType==="set_hunger")&&d(nt)})}var rt=c(Qe,2);{var I=d=>{var E=Ld(),O=o(E),ne=o(O),te=c(O,2);Q(J=>{m(ne,J),Ke(te,"min",e.confirmType==="set_health"||e.confirmType==="set_armor"?0:1),Ke(te,"max",e.confirmType==="set_health"||e.confirmType==="set_armor"?100:void 0)},[()=>e.confirmType==="set_health"?f("health"):e.confirmType==="set_armor"?f("armor"):f("money")]),lt(te,()=>n(b),J=>_(b,J)),P(d,E)};$(rt,d=>{(e.confirmType==="give_money"||e.confirmType==="take_money"||e.confirmType==="set_health"||e.confirmType==="set_armor")&&d(I)})}var V=c(rt,2);{var re=d=>{var E=Ed(),O=o(E),ne=o(O),te=c(O,2),J=o(te),oe=c(J,2);oe.__click=L,oe.__keydown=L;var we=o(oe);we.__click=T;var Re=o(we),Xe=o(Re),De=c(Re,2);let Ve;var Pe=c(we,2);let Oe;st(Pe,21,()=>k,Et,(He,Be)=>{var _e=Pd();let Je;_e.__click=()=>D(n(Be));var Ue=o(_e);Q(it=>{Je=Ne(_e,1,"confirm-dropdown-item",null,Je,{selected:n(Be)===n(g)}),m(Ue,it)},[()=>f(n(Be))]),P(He,_e)});var We=c(te,2),$e=o(We);Q((He,Be,_e,Je)=>{m(ne,He),Ke(J,"placeholder",Be),Ke(we,"aria-expanded",n(p)),m(Xe,_e),Ve=Ne(De,0,"confirm-dropdown-arrow",null,Ve,{open:n(p)}),Oe=Ne(Pe,1,"confirm-dropdown-menu",null,Oe,{open:n(p)}),m($e,Je)},[()=>f("duration"),()=>f("permanent"),()=>f(n(g)),()=>f("duration_desc")]),lt(J,()=>n(y),He=>_(y,He)),P(d,E)};$(V,d=>{e.confirmType==="ban"&&d(re)})}var H=c(le,2),ee=o(H);ee.__click=x;var Me=o(ee),he=c(ee,2);he.__click=R;var xe=o(he);Q((d,E)=>{Ke(Y,"aria-label",e.title),m(se,e.title),m(Me,d),m(xe,E)},[()=>f("cancel"),()=>f("confirm")]),P(q,j)};$(ie,q=>{e.open&&q(ae)})}P(t,F),tt()}ft(["click","keydown"]);var Nd=B('<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>'),Dd=B('<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>'),Rd=B('<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=B('<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>'),Id=B('<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>'),Fd=B('<button class="menu-item danger"> </button>'),Vd=B('<button class="menu-item danger"> </button>'),Hd=B('<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),jd=B('<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),Wd=B('<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),Ud=B('<div class="context-menu" role="menu" tabindex="-1"><!></div>'),qd=B("<!> <!>",1);function _s(t,e){et(e,!0);function a(S){S&&us(S)}async function r(S){if(S.impounded){await dv(S.plate);return}g("impound_vehicle")}let i=M(null),s=M(null),l=M(null);const u={getBoundingClientRect(){return new DOMRect(e.x,e.y,0,0)}};async function v(){if(!n(i)||!e.open)return;const{x:S,y:T}=await ml(u,n(i),{placement:"right-start",middleware:[hl(0),pl(),_l({padding:8})]});Object.assign(n(i).style,{left:`${S}px`,top:`${T}px`})}let h=null;Lt(()=>{if(!e.open||!n(i)){h?.(),h=null,_(l,null);return}return v(),h=fl(u,n(i),v),()=>{h?.(),h=null}});let b=M(!1),y=M(null);function g(S){_(y,S,!0),_(b,!0),_(s,e.value??null,!0)}function p(S){_(l,null),g(S),e.onClose()}function A(S){_(l,n(l)===S?null:S,!0)}function k(){_(b,!1),_(y,null),_(s,null)}function w(){if(!n(s)||!n(y))return"";if(n(y)==="change_expiry")return`${f("change_expiry")} | ${n(s).identifier}`;if(n(y)==="revoke")return`${f("revoke")} ${f("ban")} | ${n(s).identifier}`;if(n(y)==="delete_vehicle")return`${f("delete_vehicle")} | ${n(s).plate}`;if(n(y)==="impound_vehicle")return`${f("impound")} | ${n(s).plate}`;const S=n(s),D={kick:f("kick"),ban:f("ban"),notify:f("notify_player"),give_money:f("give_money"),take_money:f("take_money"),set_health:f("set_health"),set_armor:f("set_armor"),clean_inventory:f("clean_inventory"),kill_player:f("kill_player"),revive_player:f("revive_player"),freeze_player:f("freeze_player"),unfreeze_player:f("unfreeze_player"),set_model:f("set_model"),open_clothing:f("open_clothing"),give_all_weapons:f("give_all_weapons"),set_bucket:f("set_bucket"),set_radio:f("set_radio"),set_job:f("set_job"),set_name:f("set_name"),set_thirst:f("set_thirst"),set_hunger:f("set_hunger"),ace_add:f("ace_add"),ace_remove:f("ace_remove"),delete_character:f("delete_character"),troll_burn:f("troll_burn"),troll_explode:f("troll_explode"),troll_sky:f("troll_sky"),troll_random:f("troll_random"),troll_nausea:f("troll_nausea")}[n(y)]??"",K=S.identifier??S.char_identifier??f("identifier"),N=S.status==="online"?`(#${S.id}) ${S.name}`:`${S.name} (${K})`;return`${D} | ${N}`}var C=qd();Ln("click",Yn,function(...S){e.onClose?.apply(this,S)});var z=ue(C);{var R=S=>{var T=Ud();T.__click=L=>L.stopPropagation(),T.__keydown=L=>L.stopPropagation();var D=o(T);{var K=L=>{var F=Hd(),ie=ue(F),ae=o(ie),q=c(ie,2);q.__click=ce=>{e.toggleInformation?.(ce.clientX,ce.clientY,e.value,!0),e.onClose()};var j=c(o(q)),Y=c(q,2);{var X=ce=>{var de=Rd(),me=ue(de);me.__click=()=>{av(Number(e.value.id)),e.onClose()};var Ce=c(o(me)),Fe=c(me,2);Fe.__click=()=>{nv(Number(e.value.id)),e.onClose()};var ze=c(o(Fe)),Te=c(Fe,2);Te.__click=()=>{rv(Number(e.value.id)),e.onClose()};var Qe=c(o(Te)),nt=c(Te,2);nt.__click=()=>{g("notify"),e.onClose()};var rt=c(o(nt)),I=c(nt,2);I.__click=()=>{g("give_money"),e.onClose()};var V=o(I),re=c(I,2);re.__click=()=>{g("take_money"),e.onClose()};var H=o(re),ee=c(re,2);ee.__click=()=>{g("set_health"),e.onClose()};var Me=o(ee),he=c(ee,2);he.__click=()=>{g("set_armor"),e.onClose()};var xe=o(he),d=c(he,2);let E;d.__click=()=>A("tools");var O=o(d),ne=o(O),te=c(d,2);{var J=Pe=>{var Oe=Nd(),We=o(Oe),$e=o(We),He=c(We,2);He.__click=()=>p("revive_player");var Be=o(He),_e=c(He,2);_e.__click=()=>p("kill_player");var Je=o(_e),Ue=c(_e,2);Ue.__click=()=>p("freeze_player");var it=o(Ue),ct=c(Ue,2);ct.__click=()=>p("unfreeze_player");var Ht=o(ct),zt=c(ct,2);zt.__click=()=>p("set_model");var gt=o(zt),qe=c(zt,2);qe.__click=()=>p("open_clothing");var yt=o(qe),ut=c(qe,2);ut.__click=()=>p("give_all_weapons");var Ot=o(ut),vt=c(ut,2);vt.__click=()=>p("set_bucket");var Mt=o(vt),Nt=c(vt,2);Nt.__click=()=>p("set_radio");var Dt=o(Nt),Rt=c(Nt,2);Rt.__click=()=>p("set_job");var ht=o(Rt),wt=c(Rt,2);wt.__click=()=>p("set_name");var Kt=o(wt),jt=c(wt,2);jt.__click=()=>p("set_thirst");var ln=o(jt),Bt=c(jt,2);Bt.__click=()=>p("set_hunger");var Yt=o(Bt),Wt=c(Bt,2);Wt.__click=()=>p("ace_add");var tn=o(Wt),cn=c(Wt,2);cn.__click=()=>p("ace_remove");var On=o(cn);Q((Nn,Dn,Rn,da,Jn,fa,Ba,Ia,Fa,Bn,ha,_a,pa,ma,ba,Va)=>{m($e,Nn),m(Be,Dn),m(Je,Rn),m(it,da),m(Ht,Jn),m(gt,fa),m(yt,Ba),m(Ot,Ia),m(Mt,Fa),m(Dt,Bn),m(ht,ha),m(Kt,_a),m(ln,pa),m(Yt,ma),m(tn,ba),m(On,Va)},[()=>f("player_tools"),()=>f("revive_player"),()=>f("kill_player"),()=>f("freeze_player"),()=>f("unfreeze_player"),()=>f("set_model"),()=>f("open_clothing"),()=>f("give_all_weapons"),()=>f("set_bucket"),()=>f("set_radio"),()=>f("set_job"),()=>f("set_name"),()=>f("set_thirst"),()=>f("set_hunger"),()=>f("ace_add"),()=>f("ace_remove")]),P(Pe,Oe)};$(te,Pe=>{n(l)==="tools"&&Pe(J)})}var oe=c(te,2);let we;oe.__click=()=>A("troll");var Re=o(oe),Xe=o(Re),De=c(oe,2);{var Ve=Pe=>{var Oe=Dd(),We=o(Oe),$e=o(We),He=c(We,2);He.__click=()=>p("troll_burn");var Be=o(He),_e=c(He,2);_e.__click=()=>p("troll_explode");var Je=o(_e),Ue=c(_e,2);Ue.__click=()=>p("troll_sky");var it=o(Ue),ct=c(Ue,2);ct.__click=()=>p("troll_random");var Ht=o(ct),zt=c(ct,2);zt.__click=()=>p("troll_nausea");var gt=o(zt);Q((qe,yt,ut,Ot,vt,Mt)=>{m($e,qe),m(Be,yt),m(Je,ut),m(it,Ot),m(Ht,vt),m(gt,Mt)},[()=>f("troll_options"),()=>f("troll_burn"),()=>f("troll_explode"),()=>f("troll_sky"),()=>f("troll_random"),()=>f("troll_nausea")]),P(Pe,Oe)};$(De,Pe=>{n(l)==="troll"&&Pe(Ve)})}Q((Pe,Oe,We,$e,He,Be,_e,Je,Ue,it)=>{m(Ce,` ${Pe??""}`),m(ze,` ${Oe??""}`),m(Qe,` ${We??""}`),m(rt,` ${$e??""}`),m(V,He),m(H,Be),m(Me,_e),m(xe,Je),E=Ne(d,1,"menu-item has-submenu",null,E,{active:n(l)==="tools"}),Ke(d,"aria-expanded",n(l)==="tools"),m(ne,Ue),we=Ne(oe,1,"menu-item has-submenu",null,we,{active:n(l)==="troll"}),Ke(oe,"aria-expanded",n(l)==="troll"),m(Xe,it)},[()=>f("teleport"),()=>f("bring"),()=>f("spectate"),()=>f("notify_player"),()=>f("give_money"),()=>f("take_money"),()=>f("set_health"),()=>f("set_armor"),()=>f("player_tools"),()=>f("troll_options")]),P(ce,de)};$(Y,ce=>{e.value.status=="online"&&ce(X)})}var G=c(Y,2);{var se=ce=>{var de=Bd();de.__click=()=>{g("kick"),e.onClose()};var me=c(o(de));Q(Ce=>m(me,` ${Ce??""}`),[()=>f("kick")]),P(ce,de)};$(G,ce=>{e.value.status==="online"&&ce(se)})}var le=c(G,2);{var fe=ce=>{var de=Id();de.__click=()=>{g("ban"),e.onClose()};var me=c(o(de));Q(Ce=>m(me,` ${Ce??""}`),[()=>f("ban")]),P(ce,de)};$(le,ce=>{(e.value.status==="online"||e.value.identifier)&&ce(fe)})}var ve=c(le,2);{var Se=ce=>{var de=Fd();de.__click=()=>{g("clean_inventory"),e.onClose()};var me=o(de);Q(Ce=>m(me,Ce),[()=>f("clean_inventory")]),P(ce,de)};$(ve,ce=>{e.value.status==="online"&&ce(Se)})}var ke=c(ve,2);{var ye=ce=>{var de=Vd();de.__click=()=>{g("delete_character"),e.onClose()};var me=o(de);Q(Ce=>m(me,Ce),[()=>f("delete_character")]),P(ce,de)};$(ke,ce=>{e.value.char_identifier&&ce(ye)})}Q(ce=>{m(ae,e.value.status==="online"?`#${e.value.id} - ${e.value.name}`:`OFFLINE - ${e.value.name}`),m(j,` ${ce??""}`)},[()=>f("information")]),P(L,F)},N=L=>{var F=Le(),ie=ue(F);{var ae=j=>{var Y=jd(),X=ue(Y),G=o(X),se=o(G),le=c(G,2),fe=o(le),ve=c(X,2);ve.__click=()=>{g("change_expiry"),e.onClose()};var Se=c(o(ve)),ke=c(ve,2);ke.__click=()=>{g("revoke"),e.onClose()};var ye=c(o(ke));Q((ce,de,me)=>{m(se,ce),m(fe,e.value.identifier),m(Se,` ${de??""}`),m(ye,` ${me??""}`)},[()=>f("target"),()=>f("change_expiry"),()=>f("revoke")]),P(j,Y)},q=j=>{var Y=Le(),X=ue(Y);{var G=se=>{var le=Wd(),fe=ue(le),ve=o(fe),Se=c(fe,2);Se.__click=async()=>{a(e.value.plate),e.onClose()};var ke=c(o(Se)),ye=c(Se,2);ye.__click=async()=>{a(e.value.owner??""),e.onClose()};var ce=c(o(ye)),de=c(ye,2);de.__click=async()=>{await r(e.value),e.onClose()};var me=c(o(de)),Ce=c(de,2);Ce.__click=async()=>{g("delete_vehicle"),e.onClose()};var Fe=c(o(Ce));Q((ze,Te,Qe,nt)=>{m(ve,`${e.value.plate??""} - ${e.value.name??""}`),m(ke,` ${ze??""}`),m(ce,` ${Te??""}`),m(me,` ${Qe??""}`),m(Fe,` ${nt??""}`)},[()=>f("copy_plate"),()=>f("copy_owner"),()=>e.value.impounded?f("unimpound"):f("impound"),()=>f("delete_vehicle")]),P(se,le)};$(X,se=>{e.type==="vehicle"&&se(G)},!0)}P(j,Y)};$(ie,j=>{e.type==="ban"?j(ae):j(q,!1)},!0)}P(L,F)};$(D,L=>{e.type==="player"?L(K):L(N,!1)})}ra(T,L=>_(i,L),()=>n(i)),P(S,T)};$(z,S=>{e.open&&e.value&&S(R)})}var x=c(z,2);{let S=W(w);Od(x,{get open(){return n(b)},get confirmType(){return n(y)},get title(){return n(S)},onCancel:k,onConfirm:async T=>{if(!(!n(y)||!n(s)))try{switch(n(y)){case"kick":await sv(Number(n(s).id),T.reason);break;case"ban":if(n(s).status==="online")await ov(Number(n(s).id),T.reason,T.duration??void 0);else{const D=n(s).identifier;D&&await lv(D,T.reason??"",T.duration??void 0)}break;case"notify":await hv(Number(n(s).id),T.reason??"");break;case"give_money":await Ge(n(s).id,"giveMoney",{amount:T.amount,account:"money"});break;case"take_money":await Ge(n(s).id,"takeMoney",{amount:T.amount,account:"money"});break;case"set_health":await Ge(n(s).id,"setHealth",{amount:T.amount});break;case"set_armor":await Ge(n(s).id,"setArmor",{amount:T.amount});break;case"clean_inventory":await Ge(n(s).id,"cleanInventory");break;case"kill_player":await Ge(n(s).id,"killPlayer");break;case"revive_player":await Ge(n(s).id,"revivePlayer");break;case"freeze_player":await Ge(n(s).id,"freezePlayer",{enabled:!0});break;case"unfreeze_player":await Ge(n(s).id,"freezePlayer",{enabled:!1});break;case"set_model":await Ge(n(s).id,"setModel",{model:T.text});break;case"open_clothing":await Ge(n(s).id,"openClothing");break;case"give_all_weapons":await Ge(n(s).id,"giveAllWeapons");break;case"set_bucket":await Ge(n(s).id,"setRoutingBucket",{bucket:T.amount});break;case"set_radio":await Ge(n(s).id,"setRadio",{channel:T.amount});break;case"set_job":await Ge(n(s).id,"setJob",{job:T.text,grade:T.amount??0});break;case"set_name":await Ge(n(s).id,"setName",{firstName:T.text,lastName:T.secondaryText});break;case"set_thirst":await Ge(n(s).id,"setThirst",{amount:T.amount});break;case"set_hunger":await Ge(n(s).id,"setHunger",{amount:T.amount});break;case"ace_add":await Ge(n(s).id,"aceAdd",{group:T.text});break;case"ace_remove":await Ge(n(s).id,"aceRemove",{group:T.text});break;case"delete_character":n(s).char_identifier&&await Ge(n(s).id,"deleteCharacter",{identifier:n(s).char_identifier});break;case"troll_burn":await Ge(n(s).id,"troll",{trollAction:"burn"});break;case"troll_explode":await Ge(n(s).id,"troll",{trollAction:"explode"});break;case"troll_sky":await Ge(n(s).id,"troll",{trollAction:"sky"});break;case"troll_random":await Ge(n(s).id,"troll",{trollAction:"randomTeleport"});break;case"troll_nausea":await Ge(n(s).id,"troll",{trollAction:"nausea"});break;case"change_expiry":await cv(n(s).identifier,T.newDate);break;case"revoke":await uv(n(s).identifier);break;case"delete_vehicle":await fv(n(s).plate);break;case"impound_vehicle":if(!T.impoundName)return;await vv(n(s).plate,T.impoundName);break}}catch(D){console.error("Confirm action failed",D)}finally{k()}}})}P(t,C),tt()}ft(["click","keydown"]);const Zd=new Intl.NumberFormat("de-DE"),ot=(t=0)=>Zd.format(t);function Kd(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 Yd(t){return`${t.days}d ${t.hours}h ${t.minutes}m`}function Xd(t){return t?`X: ${t.x.toFixed(2)} Y: ${t.y.toFixed(2)} Z: ${t.z.toFixed(2)}`:"Unknown"}function bl(t,e=24){return t.length<=e?t:t.slice(0,e-3)+"..."}function $r(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 $r(a);const r=Date.parse(e.includes("T")?e:e.replace(" ","T"));return Number.isFinite(r)&&r>0?r:null}function io(t,e=f("permanent")){const a=$r(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 Gd=B('<div class="info-row" role="button" tabindex="0"><span class="info-label"> </span> <span class="info-value"> </span></div>'),Jd=B('<span class="online-badge"><span class="online-dot"></span> <span> </span></span>'),Qd=B('<span class="offline-badge"><span class="offline-dot"></span> <span> </span></span>'),$d=B("<!> <!>",1),ef=B("<!> <!> <!>",1),tf=B('<div class="info-section-title"> </div> <!>',1),nf=B('<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>'),af=B('<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 rf(t,e){et(e,!0);const a=(N,L)=>{let F=()=>L?.().label,ie=()=>L?.().value;const ae=W(()=>ie()??"-");var q=Gd();q.__click=()=>ie()!=null&&S(String(ie())),q.__keydown=se=>se.key==="Enter"&&ie()!=null&&S(String(ie()));var j=o(q),Y=o(j),X=c(j,2),G=o(X);Q(()=>{m(Y,F()),m(G,n(ae))}),P(N,q)};let r=M(null),i=M(0),s=M(0),l=!1,u=!1,v=0,h=0;const b={getBoundingClientRect(){return new DOMRect(e.mouseX,e.mouseY,0,0)}};async function y(){if(!n(r)||u)return;const{x:N,y:L}=await ml(b,n(r),{placement:"right-start",middleware:[hl(),pl(),_l()]});_(i,N,!0),_(s,L,!0)}function g(N){l=!0,u=!0,z?.(),z=null,v=N.clientX-n(i),h=N.clientY-n(s),window.addEventListener("mousemove",w),window.addEventListener("mouseup",C)}let p=null,A=0,k=0;function w(N){l&&(A=N.clientX-v,k=N.clientY-h,p===null&&(p=requestAnimationFrame(()=>{_(i,A,!0),_(s,k,!0),p=null})))}function C(){p!==null&&(cancelAnimationFrame(p),p=null),l=!1,window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",C)}let z=null;Lt(()=>{if(!e.open||!n(r)||u){z?.(),z=null;return}return y(),z=fl(b,n(r),y),window.addEventListener("resize",y),()=>{z?.(),z=null,window.removeEventListener("resize",y)}}),Lt(()=>{e.open||(u=!1)});let R=M(null),x=null;async function S(N){us(N),await new Promise(L=>setTimeout(L,0)),_(R,f("copied_to_clipboard","Copied to clipboard"),!0),x&&clearTimeout(x),x=window.setTimeout(()=>{_(R,null)},1e3)}var T=Le(),D=ue(T);{var K=N=>{var L=af();L.__click=d=>d.stopPropagation(),L.__keydown=d=>d.stopPropagation();var F=o(L);F.__mousedown=g;var ie=o(F);{var ae=d=>{var E=Jd(),O=c(o(E),2),ne=o(O);Q(te=>m(ne,te),[()=>f("online")]),P(d,E)},q=d=>{var E=Qd(),O=c(o(E),2),ne=o(O);Q(te=>m(ne,te),[()=>f("offline")]),P(d,E)};$(ie,d=>{e.player.status==="online"?d(ae):d(q,!1)})}var j=c(ie,2),Y=o(j),X=c(j,2);X.__click=function(...d){e.onClose?.apply(this,d)};var G=c(F,2),se=o(G);{var le=d=>{{let E=W(()=>({label:f("id"),value:e.player.id}));a(d,()=>n(E))}};$(se,d=>{e.player.status==="online"&&d(le)})}var fe=c(se,2);{var ve=d=>{{let E=W(()=>({label:f("identifier"),value:e.player.identifier}));a(d,()=>n(E))}};$(fe,d=>{e.player.identifier&&d(ve)})}var Se=c(fe,2);{var ke=d=>{{let E=W(()=>({label:f("ip_address"),value:e.player.ip}));a(d,()=>n(E))}};$(Se,d=>{e.player.ip&&d(ke)})}var ye=c(Se,2);{var ce=d=>{var E=$d(),O=ue(E);{let te=W(()=>({label:f("routing_bucket"),value:e.player.routing_bucket??0}));a(O,()=>n(te))}var ne=c(O,2);{let te=W(()=>({label:f("radio_channel"),value:e.player.radio_channel??0}));a(ne,()=>n(te))}P(d,E)};$(ye,d=>{e.player.status==="online"&&d(ce)})}var de=c(ye,2);{var me=d=>{{let E=W(()=>({label:f("char_identifier"),value:e.player.char_identifier}));a(d,()=>n(E))}};$(de,d=>{e.player.char_identifier&&d(me)})}var Ce=c(de,2);{let d=W(()=>({label:f("name"),value:bl(e.player.name)}));a(Ce,()=>n(d))}var Fe=c(Ce,2);{let d=W(()=>({label:f("gender"),value:e.player.gender==="m"?f("male"):f("female")}));a(Fe,()=>n(d))}var ze=c(Fe,2);{let d=W(()=>({label:f("job"),value:e.player.job??"Unknown"}));a(ze,()=>n(d))}var Te=c(ze,2);{let d=W(()=>({label:f("job_grade"),value:e.player.job_grade??"Unknown"}));a(Te,()=>n(d))}var Qe=c(Te,2);{let d=W(()=>({label:f("money"),value:`$${ot(e.player.cash)}`}));a(Qe,()=>n(d))}var nt=c(Qe,2);{let d=W(()=>({label:f("bank_money"),value:`$${ot(e.player.bank)}`}));a(nt,()=>n(d))}var rt=c(nt,2);{let d=W(()=>({label:f("black_money"),value:`$${ot(e.player.alt_money)}`}));a(rt,()=>n(d))}var I=c(rt,2);{var V=d=>{var E=ef(),O=ue(E);{let J=W(()=>({label:f("position"),value:Xd(e.player.position)}));a(O,()=>n(J))}var ne=c(O,2);{let J=W(()=>({label:f("health"),value:e.player.health}));a(ne,()=>n(J))}var te=c(ne,2);{let J=W(()=>({label:f("armor"),value:e.player.armor}));a(te,()=>n(J))}P(d,E)};$(I,d=>{e.player.status==="online"&&d(V)})}var re=c(I,2);{let d=W(()=>({label:f("play_time"),value:Yd(e.player.play_time)}));a(re,()=>n(d))}var H=c(re,2);{let d=W(()=>({label:f("last_visited"),value:Kd(e.player.last_join)}));a(H,()=>n(d))}var ee=c(H,2);{var Me=d=>{var E=tf(),O=ue(E),ne=o(O),te=c(O,2);st(te,17,()=>Object.entries(e.player.identifiers),Et,(J,oe)=>{var we=W(()=>tc(n(oe),2));let Re=()=>n(we)[0],Xe=()=>n(we)[1];{let De=W(()=>({label:Re(),value:String(Xe())}));a(J,()=>n(De))}}),Q(J=>m(ne,J),[()=>f("identifiers")]),P(d,E)};$(ee,d=>{e.player.identifiers&&Object.keys(e.player.identifiers).length>0&&d(Me)})}var he=c(ee,2);{var xe=d=>{var E=nf(),O=c(o(E));Q(()=>m(O,` ${n(R)??""}`)),P(d,E)};$(he,d=>{n(R)&&d(xe)})}ra(L,d=>_(r,d),()=>n(r)),Q((d,E)=>{xn(L,`left: ${n(i)??""}px; top: ${n(s)??""}px`),Ke(L,"aria-label",d),m(Y,E)},[()=>f("player_information"),()=>f("player_information")]),P(N,L)};$(D,N=>{e.open&&e.player&&N(K)})}P(t,T),tt()}ft(["click","keydown","mousedown"]);var sf=B('<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>'),of=B("<!> <!> <!>",1);function ps(t,e){et(e,!0);const a=mt(e,"filteredPlayers",19,()=>[]);let r=M(!1),i=M(null),s=M(pe({x:0,y:0}));const l=x=>{if(!x)return"-";const S=Number(x),T=S<1e12?S*1e3:S,D=new Date(T),K=String(D.getDate()).padStart(2,"0"),N=String(D.getMonth()+1).padStart(2,"0"),L=D.getFullYear();return`${K}/${N}/${L}`};let u=M(!1),v=M(null),h=M(0),b=M(0);function y(x,S){x.preventDefault(),_(u,!1),queueMicrotask(()=>{_(h,x.clientX,!0),_(b,x.clientY,!0),_(v,S,!0),_(u,!0)})}function g(){_(u,!1),_(v,null)}function p(x,S,T,D=!1){_(i,T,!0),(!n(r)||!D)&&_(s,{x,y:S},!0),_(r,!0)}function A(x,S){if(x.key!=="Enter"&&x.key!==" ")return;x.preventDefault();const T=x.currentTarget.getBoundingClientRect();p(T.left,T.top,S,n(r))}Lt(()=>{const x=U.focusPlayerId;if(x===null)return;const S=a().find(T=>Number(T.id)===x);S&&(_(i,S,!0),_(r,!0),_(s,{x:window.innerWidth/2,y:window.innerHeight/2},!0),U.clearFocusPlayer())});var k=of();Ln("click",Yn,()=>{_(r,!1)});var w=ue(k);{var C=x=>{vs(x,{get items(){return a()},style:"height:100%;width:100%;overflow:auto;",vl_slot:(T,D)=>{const N=W(()=>D?.().item);var L=sf();L.__click=me=>{me.stopPropagation(),p(me.clientX,me.clientY,n(N),n(r))},L.__keydown=me=>A(me,n(N)),L.__contextmenu=me=>y(me,n(N));var F=o(L),ie=o(F),ae=o(ie),q=c(F,2),j=o(q),Y=c(q,2),X=o(Y),G=c(Y,2),se=o(G),le=c(G,2),fe=o(le),ve=c(le,2),Se=o(ve),ke=c(ve,2),ye=o(ke),ce=c(ke,2),de=o(ce);Q((me,Ce,Fe,ze,Te)=>{m(ae,`#${n(N).id??""}`),m(j,me),m(X,Ce),m(se,Fe),m(fe,ze),m(Se,n(N).health),m(ye,n(N).armor),m(de,Te)},[()=>bl(n(N).name),()=>ot(n(N).cash),()=>ot(n(N).bank),()=>ot(n(N).alt_money),()=>l(n(N).last_join)]),P(T,L)},$$slots:{vl_slot:!0}})};$(w,x=>{a().length>0&&x(C)})}var z=c(w,2);_s(z,{get open(){return n(u)},type:"player",get value(){return n(v)},get x(){return n(h)},get y(){return n(b)},onClose:g,toggleInformation:(x,S,T,D)=>{D?p(x,S,T,n(r)):_(r,!1)}});var R=c(z,2);{let x=W(()=>n(i)??null);rf(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)})}P(t,k),tt()}ft(["click","keydown","contextmenu"]);var lf=B('<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 so(t,e){et(e,!0);let a=M(""),r=M("id"),i=M(!0);function s(Y){n(r)===Y?_(i,!n(i)):(_(r,Y,!0),_(i,!0))}const l=W(()=>{const Y=n(a).trim().toLowerCase();return U.players?U.players.filter(X=>X.status==="online").filter(X=>Y===""?!0:X.name.toLowerCase().includes(Y)||String(X.id).includes(Y)).slice().sort((X,G)=>{const se=X[n(r)],le=G[n(r)];return typeof se=="string"&&typeof le=="string"?n(i)?se.localeCompare(le):le.localeCompare(se):n(i)?(Number(se)||0)-(Number(le)||0):(Number(le)||0)-(Number(se)||0)}):[]});var u=lf(),v=ue(u),h=o(v),b=o(h),y=c(h,2),g=c(o(y),2),p=c(v,2),A=o(p);A.__click=()=>s("id");var k=o(A),w=c(A,2);w.__click=()=>s("name");var C=o(w),z=c(w,2);z.__click=()=>s("cash");var R=o(z),x=c(z,2);x.__click=()=>s("bank");var S=o(x),T=c(x,2);T.__click=()=>s("alt_money");var D=o(T),K=c(T,2),N=o(K),L=c(K,2),F=o(L),ie=c(L,2);ie.__click=()=>s("last_join");var ae=o(ie),q=c(p,2),j=o(q);ps(j,{get filteredPlayers(){return n(l)}}),Q((Y,X,G,se,le,fe,ve,Se,ke,ye)=>{m(b,Y),Ke(g,"placeholder",X),m(k,G),m(C,se),m(R,le),m(S,fe),m(D,ve),m(N,Se),m(F,ke),m(ae,ye)},[()=>f("players_list"),()=>f("search_player"),()=>f("id"),()=>f("name"),()=>f("money"),()=>f("bank_money"),()=>f("black_money"),()=>f("health"),()=>f("armor"),()=>f("last_visited")]),lt(g,()=>n(a),Y=>_(a,Y)),P(t,u),tt()}ft(["click"]);var cf=B('<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>'),uf=B('<div class="ban-loading svelte-c1nruu">Loading bans...</div>'),vf=B("<!> <!>",1),df=B("<!> <!>",1);function ff(t,e){et(e,!0);const a=mt(e,"filteredBans",19,()=>[]),r=mt(e,"hasMore",3,!1),i=mt(e,"loading",3,!1);let s=M(!1),l=M(null),u=M(0),v=M(0),h=M(0);function b(C,z){C.preventDefault(),_(s,!1),queueMicrotask(()=>{_(u,C.clientX,!0),_(v,C.clientY,!0),_(l,z,!0),_(s,!0)})}function y(){_(s,!1),_(l,null)}function g(C){!r()||i()||!e.onNeedMore||a().length===0||n(h)===a().length||Number(C.end)<a().length-15||(_(h,a().length,!0),e.onNeedMore())}var p=df(),A=ue(p);{var k=C=>{var z=vf(),R=ue(z);vs(R,{get items(){return a()},style:"height:100%;width:100%;overflow:auto;",onVisibleRangeUpdate:g,vl_slot:(D,K)=>{const L=W(()=>K?.().item);var F=cf();F.__contextmenu=ye=>b(ye,n(L));var ie=o(F),ae=o(ie),q=o(ae),j=c(ie,2),Y=o(j),X=c(j,2),G=o(X),se=c(X,2),le=o(se),fe=c(se,2),ve=o(fe),Se=c(fe,2),ke=o(Se);Q((ye,ce)=>{m(q,`#${n(L).id??""}`),m(Y,n(L).identifier),m(G,n(L).reason),m(le,n(L).banned_by??"-"),m(ve,ye),m(ke,ce)},[()=>io(n(L).banned_at,"-"),()=>io(n(L).expires_at)]),P(D,F)},$$slots:{vl_slot:!0}});var x=c(R,2);{var S=T=>{var D=uf();P(T,D)};$(x,T=>{i()&&T(S)})}P(C,z)};$(A,C=>{a().length>0&&C(k)})}var w=c(A,2);_s(w,{get open(){return n(s)},type:"ban",get value(){return n(l)},get x(){return n(u)},get y(){return n(v)},onClose:y}),P(t,p),tt()}ft(["contextmenu"]);var hf=B('<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 _f(t,e){et(e,!0);let a=M(""),r=M("id"),i=M(!0);function s(q){n(r)===q?_(i,!n(i)):(_(r,q,!0),_(i,!0))}function l(q,j){return j==="banned_at"||j==="expires_at"?$r(q[j])??0:q[j]}const u=W(()=>{const q=n(a).trim().toLowerCase();return U.bans?U.bans.filter(j=>q===""?!0:j.identifier.toLowerCase().includes(q)||j.reason.toLowerCase().includes(q)||String(j.id).includes(q)).slice().sort((j,Y)=>{const X=l(j,n(r)),G=l(Y,n(r));return typeof X=="string"&&typeof G=="string"?n(i)?X.localeCompare(G):G.localeCompare(X):n(i)?(Number(X)||0)-(Number(G)||0):(Number(G)||0)-(Number(X)||0)}):[]});async function v(){n(a).trim()===""&&await el()}var h=hf(),b=ue(h),y=o(b),g=o(y),p=c(y,2),A=c(o(p),2),k=c(b,2),w=o(k);w.__click=()=>s("id");var C=o(w),z=c(w,2);z.__click=()=>s("identifier");var R=o(z),x=c(z,2);x.__click=()=>s("reason");var S=o(x),T=c(x,2);T.__click=()=>s("banned_by");var D=o(T),K=c(T,2);K.__click=()=>s("banned_at");var N=o(K),L=c(K,2);L.__click=()=>s("expires_at");var F=o(L),ie=c(k,2),ae=o(ie);{let q=W(()=>U.banHasMore&&n(a).trim()==="");ff(ae,{get filteredBans(){return n(u)},get loading(){return U.banLoading},get hasMore(){return n(q)},onNeedMore:v})}Q((q,j,Y,X,G,se,le,fe)=>{m(g,q),Ke(A,"placeholder",j),m(C,Y),m(R,X),m(S,G),m(D,se),m(N,le),m(F,fe)},[()=>f("bans_list"),()=>f("search_banned_identifier"),()=>`${f("ban")} ${f("id")}`,()=>f("identifier"),()=>f("reason"),()=>f("banned_by"),()=>f("banned_at"),()=>f("expires_at")]),lt(A,()=>n(a),q=>_(a,q)),P(t,h),tt()}ft(["click"]);var pf=B('<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>'),mf=B('<div class="vehicle-loading svelte-cbe8ml">Loading vehicles...</div>'),bf=B("<!> <!>",1),gf=B("<!> <!>",1);function yf(t,e){et(e,!0);const a=mt(e,"filteredVehicles",19,()=>[]),r=mt(e,"hasMore",3,!1),i=mt(e,"loading",3,!1);let s=M(!1),l=M(null),u=M(0),v=M(0),h=M(0);function b(C,z){C.preventDefault(),_(s,!1),queueMicrotask(()=>{_(u,C.clientX,!0),_(v,C.clientY,!0),_(l,z,!0),_(s,!0)})}function y(){_(s,!1),_(l,null)}function g(C){!r()||i()||!e.onNeedMore||a().length===0||n(h)===a().length||Number(C.end)<a().length-15||(_(h,a().length,!0),e.onNeedMore())}var p=gf(),A=ue(p);{var k=C=>{var z=bf(),R=ue(z);vs(R,{get items(){return a()},style:"height:100%;width:100%;overflow:auto;",onVisibleRangeUpdate:g,vl_slot:(D,K)=>{const L=W(()=>K?.().item);var F=pf();F.__contextmenu=ce=>b(ce,n(L));var ie=o(F),ae=o(ie),q=o(ae),j=c(ie,2),Y=o(j),X=c(j,2),G=o(X),se=c(X,2),le=o(se),fe=c(se,2),ve=o(fe),Se=c(fe,2);let ke;var ye=o(Se);Q(()=>{m(q,n(L).plate),m(Y,n(L).owner??"-"),m(G,n(L).name),m(le,n(L).type),m(ve,n(L).mileage??"-"),ke=Ne(Se,1,"svelte-cbe8ml",null,ke,{"item-impounded":n(L).impounded}),m(ye,n(L).impounded?"Yes":"No")}),P(D,F)},$$slots:{vl_slot:!0}});var x=c(R,2);{var S=T=>{var D=mf();P(T,D)};$(x,T=>{i()&&T(S)})}P(C,z)};$(A,C=>{a().length>0&&C(k)})}var w=c(A,2);_s(w,{get open(){return n(s)},type:"vehicle",get value(){return n(l)},get x(){return n(u)},get y(){return n(v)},onClose:y}),P(t,p),tt()}ft(["contextmenu"]);var wf=B('<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 xf(t,e){et(e,!0);let a=M(""),r=M("plate"),i=M(!0);function s(ae){n(r)===ae?_(i,!n(i)):(_(r,ae,!0),_(i,!0))}const l=W(()=>{const ae=n(a).trim().toLowerCase(),q=U.vehicles;return q?q.filter(j=>ae===""?!0:j.plate.toLowerCase().includes(ae)||j.name.toLowerCase().includes(ae)||j.type.toLowerCase().includes(ae)||(j.owner?.toLowerCase().includes(ae)??!1)).slice().sort((j,Y)=>{const X=j[n(r)],G=Y[n(r)];if(typeof X=="string"&&typeof G=="string")return n(i)?X.localeCompare(G):G.localeCompare(X);if(typeof X=="boolean"&&typeof G=="boolean")return n(i)?Number(X)-Number(G):Number(G)-Number(X);const se=Number(X??0),le=Number(G??0);return n(i)?se-le:le-se}):[]});async function u(){await qi({search:n(a).trim()})}Lt(()=>{const ae=n(a).trim(),q=window.setTimeout(()=>{qi({reset:!0,search:ae})},250);return()=>{window.clearTimeout(q)}});var v=wf(),h=ue(v),b=o(h),y=o(b),g=c(b,2),p=c(o(g),2),A=c(h,2),k=o(A);k.__click=()=>s("plate");var w=o(k),C=c(k,2);C.__click=()=>s("owner");var z=o(C),R=c(C,2);R.__click=()=>s("name");var x=o(R),S=c(R,2);S.__click=()=>s("type");var T=o(S),D=c(S,2);D.__click=()=>s("mileage");var K=o(D),N=c(D,2);N.__click=()=>s("impounded");var L=o(N),F=c(A,2),ie=o(F);yf(ie,{get filteredVehicles(){return n(l)},get loading(){return U.vehicleLoading},get hasMore(){return U.vehicleHasMore},onNeedMore:u}),Q((ae,q,j,Y,X,G,se,le)=>{m(y,ae),Ke(p,"placeholder",q),m(w,j),m(z,Y),m(x,X),m(T,G),m(K,se),m(L,le)},[()=>f("vehicles_list"),()=>f("search_vehicle"),()=>f("plate"),()=>f("owner"),()=>f("vehicle_name"),()=>f("vehicle_type"),()=>f("mileage"),()=>f("impounded")]),lt(p,()=>n(a),ae=>_(a,ae)),P(t,v),tt()}ft(["click"]);var kf=B('<div class="spinner-wrapper"><div class="spinner"></div></div>'),Cf=B('<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),Mf=B('<div class="no-results"> </div>'),Sf=B('<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 Tf(t,e){et(e,!0);let a=M(""),r=M(pe([])),i=M(!1),s=M(!1),l=M("id"),u=M(!0);function v(x){n(l)===x?_(u,!n(u)):(_(l,x,!0),_(u,!0))}async function h(){const x=n(a).trim().toLowerCase();if(!x)return;_(s,!0),_(i,!0);const S=/^char\d+:/i.test(x),T=/^license:/i.test(x);let D=[];const K=(U.players??[]).filter(L=>S?L.char_identifier?.toLowerCase().includes(x):T?L.identifier?.toLowerCase().includes(x):L.name?.toLowerCase().includes(x)||String(L.id??"").includes(x));K.length>0&&(D=[...K]);const N=await Ye("player:searchOffline",{identifier:x});if(N?.success)for(const L of N.players??[])D.some(ie=>ie.char_identifier&&L.char_identifier&&ie.char_identifier===L.char_identifier)||D.push({...L,status:"offline",id:"OFF",_key:L.char_identifier??L.identifier??L.name});_(r,D,!0),_(i,!1)}const b=W(()=>n(r).slice().sort((x,S)=>{const T=x[n(l)],D=S[n(l)];return typeof T=="string"&&typeof D=="string"?n(u)?T.localeCompare(D):D.localeCompare(T):n(u)?(Number(T)||0)-(Number(D)||0):(Number(D)||0)-(Number(T)||0)}));var y=Sf(),g=ue(y),p=o(g),A=o(p),k=c(p,2),w=c(o(k),2);w.__keydown=x=>x.key==="Enter"&&h();var C=c(g,2);{var z=x=>{var S=kf();P(x,S)},R=x=>{var S=Le(),T=ue(S);{var D=N=>{var L=Cf(),F=ue(L),ie=o(F);ie.__click=()=>v("id");var ae=o(ie),q=c(ie,2);q.__click=()=>v("name");var j=o(q),Y=c(q,2);Y.__click=()=>v("cash");var X=o(Y),G=c(Y,2);G.__click=()=>v("bank");var se=o(G),le=c(G,2);le.__click=()=>v("alt_money");var fe=o(le),ve=c(le,2),Se=o(ve),ke=c(ve,2),ye=o(ke),ce=c(ke,2);ce.__click=()=>v("last_join");var de=o(ce),me=c(F,2),Ce=o(me);ps(Ce,{get filteredPlayers(){return n(b)}}),Q((Fe,ze,Te,Qe,nt,rt,I,V)=>{m(ae,Fe),m(j,ze),m(X,Te),m(se,Qe),m(fe,nt),m(Se,rt),m(ye,I),m(de,V)},[()=>f("id"),()=>f("name"),()=>f("money"),()=>f("bank_money"),()=>f("black_money"),()=>f("health"),()=>f("armor"),()=>f("last_visited")]),P(N,L)},K=N=>{var L=Le(),F=ue(L);{var ie=ae=>{var q=Mf(),j=o(q);Q(Y=>m(j,Y),[()=>f("no_players_found")]),P(ae,q)};$(F,ae=>{n(s)&&ae(ie)},!0)}P(N,L)};$(T,N=>{n(b).length>0?N(D):N(K,!1)},!0)}P(x,S)};$(C,x=>{n(i)?x(z):x(R,!1)})}Q((x,S)=>{m(A,x),Ke(w,"placeholder",S)},[()=>f("search_player"),()=>f("search_player")]),lt(w,()=>n(a),x=>_(a,x)),P(t,y),tt()}ft(["keydown","click"]);var Af=B('<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 Lf(t,e){et(e,!0);let a=M("");const r=W(()=>{const ae=n(a).trim().toLowerCase();return(U.recentPlayers??[]).filter(j=>ae===""?!0:j.name.toLowerCase().includes(ae)||(j.identifier??"").toLowerCase().includes(ae)||(j.char_identifier??"").toLowerCase().includes(ae))});var i=Af(),s=ue(i),l=o(s),u=o(l),v=c(l,2),h=c(o(v),2),b=c(s,2),y=o(b),g=o(y),p=c(y,2),A=o(p),k=c(p,2),w=o(k),C=c(k,2),z=o(C),R=c(C,2),x=o(R),S=c(R,2),T=o(S),D=c(S,2),K=o(D),N=c(D,2),L=o(N),F=c(b,2),ie=o(F);ps(ie,{get filteredPlayers(){return n(r)}}),Q((ae,q,j,Y,X,G,se,le,fe,ve)=>{m(u,ae),Ke(h,"placeholder",q),m(g,j),m(A,Y),m(w,X),m(z,G),m(x,se),m(T,le),m(K,fe),m(L,ve)},[()=>f("recent_players"),()=>f("search_player"),()=>f("id"),()=>f("name"),()=>f("money"),()=>f("bank_money"),()=>f("black_money"),()=>f("health"),()=>f("armor"),()=>f("last_visited")]),lt(h,()=>n(a),ae=>_(a,ae)),P(t,i),tt()}var Pf=B('<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>'),Ef=B('<div class="bar-list svelte-12ytsmo"></div>'),zf=B('<span class="svelte-12ytsmo"></span>'),Of=B('<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 Nf(t,e){et(e,!0);const a=(be,Ae=dn)=>{var at=Ef();st(at,21,Ae,Et,(nn,Xt)=>{var ga=Pf(),ya=o(ga),wa=o(ya),Qn=c(ya,2),xa=o(Qn),Ua=c(Qn,2),qa=o(Ua);Q(ka=>{m(wa,n(Xt).label),xn(xa,ka),m(qa,n(Xt).display)},[()=>s(n(Xt).percent,n(Xt).color)]),P(nn,ga)}),P(be,at)};function r(be){return(Number(be.cash)||0)+(Number(be.bank)||0)+(Number(be.alt_money)||0)}function i(be){return Number.isFinite(be)?Math.max(0,Math.min(100,be)):0}function s(be,Ae="#FB9B04"){return`--bar-width: ${i(be).toFixed(2)}%; --bar-color: ${Ae};`}function l(be,Ae){return`width: ${i(be).toFixed(2)}%; background: ${Ae};`}const u=W(()=>U.players??[]),v=W(()=>Ze.currentPlayers??n(u).length),h=W(()=>Ze.maxPlayers??0),b=W(()=>Math.max(0,n(h)-n(v))),y=W(()=>n(h)>0?Math.min(100,n(v)/n(h)*100):0),g=W(()=>n(u).reduce((be,Ae)=>be+(Number(Ae.cash)||0),0)),p=W(()=>n(u).reduce((be,Ae)=>be+(Number(Ae.bank)||0),0)),A=W(()=>n(u).reduce((be,Ae)=>be+(Number(Ae.alt_money)||0),0)),k=W(()=>n(g)+n(p)+n(A)),w=W(()=>n(u).length>0?Math.round(n(k)/n(u).length):0),C=W(()=>n(u).length>0?Math.round(n(g)/n(u).length):0),z=W(()=>n(u).length>0?Math.round(n(p)/n(u).length):0),R=W(()=>n(u).length>0?Math.round(n(A)/n(u).length):0),x=W(()=>n(u).filter(be=>be.is_staff).length),S=W(()=>Math.max(0,n(u).length-n(x))),T=W(()=>n(u).length>0?n(x)/n(u).length*100:0),D=W(()=>n(u).length>0?Math.round(n(u).reduce((be,Ae)=>be+(Number(Ae.health)||0),0)/n(u).length):0),K=W(()=>n(u).length>0?Math.round(n(u).reduce((be,Ae)=>be+(Number(Ae.armor)||0),0)/n(u).length):0),N=W(()=>n(u).map(r).sort((be,Ae)=>be-Ae)),L=W(()=>{if(n(N).length===0)return 0;const be=Math.floor(n(N).length/2);return n(N).length%2===0?Math.round((n(N)[be-1]+n(N)[be])/2):n(N)[be]}),F=W(()=>n(N).at(-1)??0),ie=W(()=>n(u).reduce((be,Ae)=>!be||r(Ae)>r(be)?Ae:be,null)),ae=W(()=>[{label:f("money"),value:n(g),display:`$${ot(n(g))}`,percent:n(k)>0?n(g)/n(k)*100:0,color:"#FB9B04"},{label:f("bank_money"),value:n(p),display:`$${ot(n(p))}`,percent:n(k)>0?n(p)/n(k)*100:0,color:"#4ADE80"},{label:f("black_money"),value:n(A),display:`$${ot(n(A))}`,percent:n(k)>0?n(A)/n(k)*100:0,color:"#F23F3F"}]),q=W(()=>[{label:f("money"),value:n(C),display:`$${ot(n(C))}`,percent:n(w)>0?n(C)/n(w)*100:0,color:"#FB9B04"},{label:f("bank_money"),value:n(z),display:`$${ot(n(z))}`,percent:n(w)>0?n(z)/n(w)*100:0,color:"#4ADE80"},{label:f("black_money"),value:n(R),display:`$${ot(n(R))}`,percent:n(w)>0?n(R)/n(w)*100:0,color:"#F23F3F"}]),j=W(()=>[{label:f("players"),value:n(v),display:`${n(v)}/${n(h)}`,percent:n(y),color:"#FB9B04"},{label:f("available_slots"),value:n(b),display:String(n(b)),percent:n(h)>0?n(b)/n(h)*100:0,color:"#8B8B8B"}]),Y=W(()=>[{label:f("avg_health"),value:n(D),display:`${n(D)}/100`,percent:n(D),color:"#4ADE80"},{label:f("avg_armor"),value:n(K),display:`${n(K)}/100`,percent:n(K),color:"#60A5FA"}]),X=W(()=>[{label:f("active_staff"),value:n(x),display:String(n(x)),percent:n(T),color:"#60A5FA"},{label:f("non_staff"),value:n(S),display:String(n(S)),percent:n(u).length>0?n(S)/n(u).length*100:0,color:"#8B8B8B"}]),G=W(()=>[{label:f("avg_money_per_player"),value:n(w),display:`$${ot(n(w))}`,percent:n(F)>0?n(w)/n(F)*100:0,color:"#FB9B04"},{label:f("median_money"),value:n(L),display:`$${ot(n(L))}`,percent:n(F)>0?n(L)/n(F)*100:0,color:"#4ADE80"},{label:f("richest_player"),value:n(F),display:n(ie)?`${n(ie).name} ($${ot(n(F))})`:"-",percent:n(F)>0?100:0,color:"#F23F3F"}]),se=W(()=>{const be=new Map;for(const Ae of n(u)){const at=Ae.job||"unknown";be.set(at,(be.get(at)??0)+1)}return[...be.entries()].sort((Ae,at)=>at[1]-Ae[1]).slice(0,5).map(([Ae,at])=>({label:Ae,value:at,display:String(at),percent:n(u).length>0?at/n(u).length*100:0,color:"#FB9B04"}))}),le=W(()=>[{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(Ae=>{const at=n(u).filter(nn=>{const Xt=(Number(nn.cash)||0)+(Number(nn.bank)||0)+(Number(nn.alt_money)||0);return Xt>=Ae.min&&Xt<Ae.max}).length;return{label:Ae.label,value:at,display:String(at),percent:n(u).length>0?at/n(u).length*100:0,color:"#FB9B04"}}));var fe=Of(),ve=o(fe),Se=o(ve),ke=o(Se),ye=o(ke),ce=o(ye),de=c(ye,2),me=o(de),Ce=c(ke,2),Fe=o(Ce),ze=c(ve,2),Te=o(ze),Qe=o(Te),nt=o(Qe),rt=c(Qe,2),I=o(rt),V=c(rt,2),re=o(V),H=c(Te,2),ee=o(H),Me=o(ee),he=c(ee,2),xe=o(he),d=c(H,2),E=o(d),O=o(E),ne=c(E,2),te=o(ne),J=c(d,2),oe=o(J),we=o(oe),Re=c(oe,2),Xe=o(Re),De=c(J,2),Ve=o(De),Pe=o(Ve),Oe=c(Ve,2),We=o(Oe),$e=c(ze,2),He=o($e),Be=o(He),_e=o(Be),Je=o(_e),Ue=c(_e,2),it=o(Ue),ct=c(Be,2),Ht=o(ct),zt=c(Ht,2),gt=c(ct,2);a(gt,()=>n(j));var qe=c(He,2),yt=o(qe),ut=o(yt),Ot=o(ut),vt=c(ut,2),Mt=o(vt),Nt=c(yt,2);st(Nt,21,()=>n(ae),Et,(be,Ae)=>{var at=zf();Q(nn=>xn(at,nn),[()=>l(n(Ae).percent,n(Ae).color??"#FB9B04")]),P(be,at)});var Dt=c(Nt,2);a(Dt,()=>n(ae));var Rt=c(qe,2),ht=o(Rt),wt=o(ht),Kt=o(wt),jt=c(wt,2),ln=o(jt),Bt=c(ht,2);a(Bt,()=>n(G));var Yt=c(Rt,2),Wt=o(Yt),tn=o(Wt),cn=o(tn),On=c(tn,2),Nn=o(On),Dn=c(Wt,2);a(Dn,()=>n(q));var Rn=c(Yt,2),da=o(Rn),Jn=o(da),fa=o(Jn),Ba=c(Jn,2),Ia=o(Ba),Fa=c(da,2);a(Fa,()=>n(Y));var Bn=c(Rn,2),ha=o(Bn),_a=o(ha),pa=o(_a),ma=c(_a,2),ba=o(ma),Va=c(ha,2);a(Va,()=>n(X));var vr=c(Bn,2),Ha=o(vr),ja=o(Ha),ei=o(ja),ti=c(ja,2),dr=o(ti),fr=c(Ha,2);a(fr,()=>n(se));var ni=c(vr,2),hr=o(ni),Wa=o(hr),_r=o(Wa),ai=c(Wa,2),ri=o(ai),pr=c(hr,2);a(pr,()=>n(le)),Q((be,Ae,at,nn,Xt,ga,ya,wa,Qn,xa,Ua,qa,ka,mr,ii,si,br,gr,oi,li,ci,yr,ui,vi)=>{m(ce,be),m(me,`${Ae??""}: ${n(x)??""}`),m(Fe,at),m(nt,nn),m(I,`${n(v)??""}/${n(h)??""}`),xn(re,Xt),m(Me,ga),m(xe,`$${ya??""}`),m(O,wa),m(te,`$${Qn??""}`),m(we,xa),m(Xe,`${n(D)??""}/100`),m(Pe,Ua),m(We,`${n(K)??""}/100`),m(Je,qa),m(it,`${n(v)??""} online`),xn(Ht,ka),xn(zt,mr),m(Ot,ii),m(Mt,`$${si??""}`),m(Kt,br),m(ln,`${n(u).length??""} players`),m(cn,gr),m(Nn,`$${oi??""}`),m(fa,li),m(Ia,`${n(u).length??""} sampled`),m(pa,ci),m(ba,`${yr??""}%`),m(ei,ui),m(dr,`${n(u).length??""} players`),m(_r,vi),m(ri,`${n(u).length??""} players`)},[()=>f("dashboard_home"),()=>f("active_staff"),()=>f("dashboard_snapshot"),()=>f("players"),()=>s(n(y)),()=>f("total_money"),()=>ot(n(k)),()=>f("avg_money_per_player"),()=>ot(n(w)),()=>f("avg_health"),()=>f("avg_armor"),()=>f("player_counts"),()=>l(n(y),"#FB9B04"),()=>l(100-n(y),"rgba(242, 242, 242, 0.16)"),()=>f("money_distribution"),()=>ot(n(k)),()=>f("economy_summary"),()=>f("avg_money_breakdown"),()=>ot(n(w)),()=>f("player_condition"),()=>f("staff_overview"),()=>Math.round(n(T)),()=>f("active_player_job_distribution"),()=>f("wealth_bands")]),P(t,fe),tt()}var Df=B('<button type="button" role="option"> </button>'),Rf=B('<div class="dropdown-menu svelte-12xtqit" role="listbox" tabindex="-1"></div>'),Bf=B('<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 _t(t,e){et(e,!0);const a=mt(e,"disabled",3,!1);let r=M(!1);const i=W(()=>e.options.find(k=>k.value===e.value)??e.options[0]);function s(k){e.onChange(k),_(r,!1)}var l=Bf();Ln("click",Yn,()=>_(r,!1));var u=o(l);let v;u.__click=k=>{k.stopPropagation(),_(r,!n(r))};var h=o(u),b=o(h),y=c(h,2);let g;var p=c(u,2);{var A=k=>{var w=Rf();w.__click=C=>C.stopPropagation(),w.__keydown=C=>C.stopPropagation(),st(w,21,()=>e.options,Et,(C,z)=>{var R=Df();let x;R.__click=()=>s(n(z).value);var S=o(R);Q(()=>{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),m(S,n(z).label)}),P(C,R)}),P(k,w)};$(p,k=>{n(r)&&k(A)})}Q(()=>{v=Ne(u,1,"dropdown-trigger svelte-12xtqit",null,v,{open:n(r)}),u.disabled=a(),Ke(u,"aria-expanded",n(r)),m(b,n(i)?.label??""),g=Ne(y,0,"svelte-12xtqit",null,g,{open:n(r)})}),P(t,l),tt()}ft(["click","keydown"]);var If=B('<span class="svelte-z3kuo0">No players found in this channel.</span>'),Ff=B('<div class="radio-player svelte-z3kuo0"><strong class="svelte-z3kuo0"> </strong> <span class="svelte-z3kuo0"> </span> <small class="svelte-z3kuo0"> </small></div>'),Vf=B('<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 Hf(t,e){et(e,!0);let a=M(""),r=M(0),i=M("money"),s=M(pe(U.vehicleConfig.defaultModel)),l=M(pe(U.vehicleConfig.defaultColor)),u=M(pe(U.vehicleConfig.defaultColor)),v=M(pe(U.vehicleConfig.defaultColor)),h=M(pe(U.vehicleConfig.defaultColor)),b=M(5),y=M(5),g=M(5),p=M(5),A=M(5),k=M(!1),w=M(!0),C=M(!1),z=M(!1),R=M(pe(U.vehicleConfig.neonPresets[0]?.id??"white")),x=M(pe(U.vehicleConfig.windowTints[0]?.id??0)),S=M(pe(U.vehicleConfig.wheelCategories[0]?.id??"sport")),T=M(pe(U.vehicleConfig.wheelDesigns[0]?.id??-1)),D=M(!1),K=M(1),N=M(pe([])),L=M(!1),F=M(null);const ie=["CLEAR","EXTRASUNNY","CLOUDS","OVERCAST","RAIN","THUNDER","FOGGY","XMAS"].map(Z=>({value:Z,label:Z})),ae=Array.from({length:24},(Z,xt)=>({value:xt,label:String(xt).padStart(2,"0")})),q=Array.from({length:60},(Z,xt)=>({value:xt,label:String(xt).padStart(2,"0")})),j=[{value:"money",label:"Cash"},{value:"bank",label:"Bank"},{value:"black_money",label:"Black Money"}],Y=[1,2,3,4,5].map(Z=>({value:Z,label:`${Z}/5`})),X=W(()=>U.vehicleConfig.colorPresets.map(Z=>({value:Z.id,label:Z.label}))),G=W(()=>U.vehicleConfig.neonPresets.map(Z=>({value:Z.id,label:Z.label}))),se=W(()=>U.vehicleConfig.windowTints.map(Z=>({value:Z.id,label:Z.label}))),le=W(()=>U.vehicleConfig.wheelCategories.map(Z=>({value:Z.id,label:Z.label}))),fe=W(()=>U.vehicleConfig.wheelDesigns.map(Z=>({value:Z.id,label:Z.label})));async function ve(Z,xt={}){if(n(F))return;_(F,Z,!0);const In=await _v(Z,xt);In?.success&&(In.serverData&&Ze.set(In.serverData),Kn.success("Action completed.")),_(F,null)}function Se(){ve("blackout",{enabled:!Ze.blackout})}function ke(){ve("pvp",{enabled:!Ze.pvp})}async function ye(){n(L)||n(K)<=0||(_(L,!0),_(N,await mv(n(K)),!0),_(L,!1))}async function ce(Z,xt){if(n(F))return;_(F,Z,!0),(await pv(Z,xt))?.success&&Kn.success("Vehicle action completed."),_(F,null)}function de(){ce("spawnVehicle",{model:n(s),color:n(l),primaryColor:n(l),secondaryColor:n(u),deleteCurrent:!0})}function me(Z){_(k,Z,!0),Z&&(_(b,5),_(y,5),_(g,5),_(p,5),_(A,5),_(w,!0))}function Ce(){ce("setVehiclePerformance",{engineLevel:n(b),brakeLevel:n(y),transmissionLevel:n(g),suspensionLevel:n(p),armorLevel:n(A),turbo:n(w),xenon:n(C),neon:n(z),neonColor:n(R),color:n(v),primaryColor:n(v),secondaryColor:n(h),windowTint:n(x),wheelCategory:n(S),wheelDesign:n(T),bulletproofTires:n(D),maxPerformance:n(k)})}var Fe=Vf(),ze=o(Fe),Te=c(o(ze),2),Qe=o(Te);let nt;var rt=o(Qe),I=c(Qe,2);let V;var re=o(I),H=c(ze,2),ee=c(o(H),2),Me=o(ee),he=c(o(Me),2);_t(he,{get value(){return Ze.weather},get options(){return ie},onChange:Z=>Ze.weather=String(Z)});var xe=c(Me,2);xe.__click=()=>ve("weather",{weather:Ze.weather});var d=c(xe,2),E=c(o(d),2);_t(E,{get value(){return Ze.hour},get options(){return ae},onChange:Z=>Ze.hour=Number(Z)});var O=c(d,2),ne=c(o(O),2);_t(ne,{get value(){return Ze.minute},get options(){return q},onChange:Z=>Ze.minute=Number(Z)});var te=c(O,2);te.__click=()=>ve("time",{hour:Ze.hour,minute:Ze.minute});var J=c(te,2);J.__click=Se;let oe;var we=c(J,2);we.__click=ke;let Re;var Xe=c(H,2),De=o(Xe),Ve=o(De),Pe=o(Ve),Oe=c(De,2),We=o(Oe),$e=o(We),He=o($e),Be=c($e,2),_e=c(We,2),Je=o(_e),Ue=o(Je),it=c(Je,2);_t(it,{get value(){return n(l)},get options(){return n(X)},onChange:Z=>_(l,String(Z),!0)});var ct=c(_e,2),Ht=o(ct),zt=o(Ht),gt=c(Ht,2);_t(gt,{get value(){return n(u)},get options(){return n(X)},onChange:Z=>_(u,String(Z),!0)});var qe=c(ct,2);qe.__click=de;var yt=o(qe),ut=c(Xe,2),Ot=o(ut),vt=o(Ot),Mt=o(vt),Nt=c(Ot,2),Dt=o(Nt),Rt=o(Dt),ht=o(Rt),wt=o(ht),Kt=c(ht,2);_t(Kt,{get value(){return n(b)},get options(){return Y},onChange:Z=>{_(b,Number(Z),!0),_(k,!1)}});var jt=c(Rt,2),ln=o(jt),Bt=o(ln),Yt=c(ln,2);_t(Yt,{get value(){return n(y)},get options(){return Y},onChange:Z=>{_(y,Number(Z),!0),_(k,!1)}});var Wt=c(jt,2),tn=o(Wt),cn=o(tn),On=c(tn,2);_t(On,{get value(){return n(g)},get options(){return Y},onChange:Z=>{_(g,Number(Z),!0),_(k,!1)}});var Nn=c(Wt,2),Dn=o(Nn),Rn=o(Dn),da=c(Dn,2);_t(da,{get value(){return n(p)},get options(){return Y},onChange:Z=>{_(p,Number(Z),!0),_(k,!1)}});var Jn=c(Nn,2),fa=o(Jn),Ba=o(fa),Ia=c(fa,2);_t(Ia,{get value(){return n(A)},get options(){return Y},onChange:Z=>{_(A,Number(Z),!0),_(k,!1)}});var Fa=c(Jn,2),Bn=o(Fa);Bn.__change=Z=>me(Z.currentTarget.checked);var ha=c(Bn,2),_a=o(ha),pa=c(Dt,2),ma=o(pa),ba=o(ma),Va=o(ba),vr=c(ba,2);_t(vr,{get value(){return n(v)},get options(){return n(X)},onChange:Z=>_(v,String(Z),!0)});var Ha=c(ma,2),ja=o(Ha),ei=o(ja),ti=c(ja,2);_t(ti,{get value(){return n(h)},get options(){return n(X)},onChange:Z=>_(h,String(Z),!0)});var dr=c(Ha,2),fr=o(dr),ni=o(fr),hr=c(fr,2);_t(hr,{get value(){return n(R)},get options(){return n(G)},onChange:Z=>_(R,String(Z),!0)});var Wa=c(dr,2),_r=o(Wa),ai=o(_r),ri=c(_r,2);_t(ri,{get value(){return n(x)},get options(){return n(se)},onChange:Z=>_(x,Number(Z),!0)});var pr=c(Wa,2),be=o(pr),Ae=o(be),at=c(be,2);_t(at,{get value(){return n(S)},get options(){return n(le)},onChange:Z=>_(S,String(Z),!0)});var nn=c(pr,2),Xt=o(nn),ga=o(Xt),ya=c(Xt,2);_t(ya,{get value(){return n(T)},get options(){return n(fe)},onChange:Z=>_(T,Number(Z),!0)});var wa=c(pa,2),Qn=o(wa),xa=o(Qn),Ua=c(xa,2),qa=o(Ua),ka=c(Qn,2),mr=o(ka),ii=c(mr,2),si=o(ii),br=c(ka,2),gr=o(br),oi=c(gr,2),li=o(oi),ci=c(br,2),yr=o(ci),ui=c(yr,2),vi=o(ui),yl=c(wa,2),di=o(yl);di.__click=Ce;var wl=o(di),ms=c(ut,2),xl=c(o(ms),2),fi=o(xl);fi.__click=()=>ve("freezeAll");var hi=c(fi,2);hi.__click=()=>ve("unfreezeAll");var _i=c(hi,2);_i.__click=()=>ve("bringAll");var pi=c(_i,2);pi.__click=()=>ve("reviveAll");var mi=c(pi,2);mi.__click=()=>ve("kickAll");var bs=c(mi,2);bs.__click=()=>ve("killAll");var gs=c(ms,2),kl=c(o(gs),2),ys=o(kl),ws=o(ys),Cl=c(o(ws),2),bi=c(ws,2);bi.__click=ye;var Ml=o(bi),Sl=c(ys,2),Tl=o(Sl);{var Al=Z=>{var xt=If();P(Z,xt)},Ll=Z=>{var xt=Le(),In=ue(xt);st(In,17,()=>n(N),Et,(xi,Za)=>{var wr=Ff(),xr=o(wr),ki=o(xr),kr=c(xr,2),Ci=o(kr),Mi=c(kr,2),Si=o(Mi);Q(()=>{m(ki,`#${n(Za).id??""}`),m(Ci,n(Za).name),m(Si,n(Za).char_identifier??"")}),P(xi,wr)}),P(Z,xt)};$(Tl,Z=>{n(N).length===0?Z(Al):Z(Ll,!1)})}var xs=c(gs,2),Pl=c(o(xs),2),gi=o(Pl);gi.__click=()=>ve("deleteVehicles");var yi=c(gi,2);yi.__click=()=>ve("deletePeds");var ks=c(yi,2);ks.__click=()=>ve("deleteObjects");var El=c(xs,2),zl=c(o(El),2),Cs=o(zl),Ol=c(o(Cs),2),wi=c(Cs,2);wi.__click=()=>ve("notifyAll",{message:n(a)});var Ms=c(wi,2),Nl=c(o(Ms),2);_t(Nl,{get value(){return n(i)},get options(){return j},onChange:Z=>_(i,String(Z),!0)});var Ss=c(Ms,2),Dl=c(o(Ss),2),Ts=c(Ss,2);Ts.__click=()=>ve("giveMoneyAll",{account:n(i),amount:n(r)}),Q((Z,xt,In,xi,Za,wr,xr,ki,kr,Ci,Mi,Si,Rl,Bl,Il,Fl,Vl,Hl,jl,Wl,Ul,ql,Zl,Kl,Yl)=>{nt=Ne(Qe,1,"svelte-z3kuo0",null,nt,{enabled:Ze.blackout}),m(rt,`Blackout ${Ze.blackout?"On":"Off"}`),V=Ne(I,1,"svelte-z3kuo0",null,V,{enabled:Ze.pvp}),m(re,`PvP ${Ze.pvp?"On":"Off"}`),xe.disabled=n(F)!==null,te.disabled=n(F)!==null,J.disabled=n(F)!==null,oe=Ne(J,1,"svelte-z3kuo0",null,oe,{active:Ze.blackout}),we.disabled=n(F)!==null,Re=Ne(we,1,"svelte-z3kuo0",null,Re,{active:Ze.pvp}),m(Pe,Z),m(He,xt),Ke(Be,"placeholder",U.vehicleConfig.defaultModel),m(Ue,In),m(zt,xi),qe.disabled=Za,m(yt,wr),m(Mt,xr),m(wt,ki),m(Bt,kr),m(cn,Ci),m(Rn,Mi),m(Ba,Si),Su(Bn,n(k)),m(_a,Rl),m(Va,Bl),m(ei,Il),m(ni,Fl),m(ai,Vl),m(Ae,Hl),m(ga,jl),m(qa,Wl),m(si,Ul),m(li,ql),m(vi,Zl),di.disabled=n(F)!==null,m(wl,Kl),fi.disabled=n(F)!==null,hi.disabled=n(F)!==null,_i.disabled=n(F)!==null,pi.disabled=n(F)!==null,mi.disabled=n(F)!==null,bs.disabled=n(F)!==null,bi.disabled=n(L)||n(K)<=0,m(Ml,n(L)?"Checking...":"Lookup Channel"),gi.disabled=n(F)!==null,yi.disabled=n(F)!==null,ks.disabled=n(F)!==null,wi.disabled=Yl,Ts.disabled=n(F)!==null||n(r)<=0},[()=>f("vehicle_spawner","Vehicle Spawner"),()=>f("vehicle_model","Vehicle Model"),()=>f("primary_color","Primary Color"),()=>f("secondary_color","Secondary Color"),()=>n(F)!==null||n(s).trim()==="",()=>f("spawn_vehicle","Spawn Vehicle"),()=>f("customize_vehicle","Customize Vehicle"),()=>f("engine_level","Engine"),()=>f("brake_level","Brakes"),()=>f("transmission_level","Transmission"),()=>f("suspension_level","Suspension"),()=>f("vehicle_armor","Vehicle Armor"),()=>f("max_performance","Max Performance"),()=>f("primary_color","Primary Color"),()=>f("secondary_color","Secondary Color"),()=>f("neon_color","Neon Color"),()=>f("window_tint","Window Tint"),()=>f("wheel_category","Wheel Category"),()=>f("wheel_design","Disc Design"),()=>f("turbo","Turbo"),()=>f("xenon_lights","Xenon"),()=>f("neon_lights","Neon"),()=>f("bulletproof_tires","Bulletproof Tires"),()=>f("apply_customization","Apply Customization"),()=>n(F)!==null||n(a).trim()===""]),lt(Be,()=>n(s),Z=>_(s,Z)),Sr(xa,()=>n(w),Z=>_(w,Z)),Sr(mr,()=>n(C),Z=>_(C,Z)),Sr(gr,()=>n(z),Z=>_(z,Z)),Sr(yr,()=>n(D),Z=>_(D,Z)),lt(Cl,()=>n(K),Z=>_(K,Z)),lt(Ol,()=>n(a),Z=>_(a,Z)),lt(Dl,()=>n(r),Z=>_(r,Z)),P(t,Fe),tt()}ft(["click","change"]);const jf={moderation:"Moderation",economy:"Economy",player:"Player",server:"Server",other:"Other"},Wf=new Intl.NumberFormat("de-DE"),Pi=t=>`$${Wf.format(Number(t)||0)}`,jn=t=>String(Math.round(Number(t)||0)),Tt=(t,e="")=>{const a=typeof t=="string"?t.trim():"";return a===""?e:a},Ei=t=>t===!0||t==="true"||t===1||t==="1",zi=t=>{const e=Tt(t,"money");return e==="bank"?"bank":e==="black_money"?"dirty money":"cash"};function Xi(t){const e=Number(t)||0;return e<=0?"permanently":e<60?`for ${e} min`:e<1440?`for ${Math.round(e/60)} h`:`for ${Math.round(e/1440)} days`}const Lr=t=>{const e=Tt(t.reason);return e===""?"":` — ${e}`},Uf={ban:{category:"moderation",build:(t,e)=>`banned ${e} ${Xi(t.duration_minutes)}${Lr(t)}`},banOffline:{category:"moderation",build:(t,e)=>`banned ${e} while they were offline, ${Xi(t.duration_minutes)}${Lr(t)}`},unban:{category:"moderation",build:(t,e)=>`lifted the ban on ${e}`},banChangeExpiry:{category:"moderation",build:(t,e)=>`changed how long ${e} stays banned`},kick:{category:"moderation",build:(t,e)=>`kicked ${e}${Lr(t)}`},killPlayer:{category:"moderation",build:(t,e)=>`killed ${e}`},revivePlayer:{category:"moderation",build:(t,e)=>`revived ${e}`},freezePlayer:{category:"moderation",build:(t,e)=>Ei(t.enabled)?`froze ${e}`:`unfroze ${e}`},cleanInventory:{category:"moderation",build:(t,e)=>`wiped the inventory of ${e}`},deleteCharacter:{category:"moderation",build:(t,e)=>`deleted the character of ${e==="a player"?Tt(t.identifier,e):e}`},aceAdd:{category:"moderation",build:(t,e)=>`granted the "${Tt(t.group,Tt(t.permission,"unknown"))}" ACE group to ${e}`},aceRemove:{category:"moderation",build:(t,e)=>`revoked the "${Tt(t.group,Tt(t.permission,"unknown"))}" ACE group from ${e}`},giveMoney:{category:"economy",build:(t,e)=>`gave ${Pi(t.amount)} to ${e} (${zi(t.account)})`},takeMoney:{category:"economy",build:(t,e)=>`took ${Pi(t.amount)} from ${e} (${zi(t.account)})`},giveMoneyAll:{category:"economy",build:t=>`gave ${Pi(t.amount)} to every player (${zi(t.account)})`},setHealth:{category:"player",build:(t,e)=>`set the health of ${e} to ${jn(t.amount)}%`},setArmor:{category:"player",build:(t,e)=>`set the armor of ${e} to ${jn(t.amount)}%`},setThirst:{category:"player",build:(t,e)=>`set the thirst of ${e} to ${jn(t.amount)}%`},setHunger:{category:"player",build:(t,e)=>`set the hunger of ${e} to ${jn(t.amount)}%`},setModel:{category:"player",build:(t,e)=>`changed ${e} into "${Tt(t.model,"another model")}"`},setJob:{category:"player",build:(t,e)=>`made ${e} ${Tt(t.job,"unemployed")} (grade ${jn(t.grade)})`},setName:{category:"player",build:(t,e)=>{const a=`${Tt(t.firstName)} ${Tt(t.lastName)}`.trim();return a===""?`renamed ${e}`:`renamed ${e} to ${a}`}},setRadio:{category:"player",build:(t,e)=>{const a=Number(t.channel)||0;return a<=0?`took ${e} off the radio`:`put ${e} on radio channel ${a}`}},setRoutingBucket:{category:"player",build:(t,e)=>`moved ${e} to routing bucket ${jn(t.bucket)}`},openClothing:{category:"player",build:(t,e)=>`opened the clothing menu of ${e}`},giveAllWeapons:{category:"player",build:(t,e)=>`gave every weapon to ${e}`},troll:{category:"player",build:(t,e)=>`used the "${Tt(t.trollAction,"unknown")}" troll on ${e}`},weather:{category:"server",build:t=>`set the weather to ${Tt(t.weather,"default")}`},time:{category:"server",build:t=>`set the time to ${jn(t.hour).padStart(2,"0")}:${jn(t.minute).padStart(2,"0")}`},blackout:{category:"server",build:t=>Ei(t.enabled)?"turned the blackout on":"turned the blackout off"},pvp:{category:"server",build:t=>Ei(t.enabled)?"enabled PvP":"disabled PvP"},freezeAll:{category:"server",build:()=>"froze every player"},unfreezeAll:{category:"server",build:()=>"unfroze every player"},bringAll:{category:"server",build:()=>"teleported every player to them"},reviveAll:{category:"server",build:()=>"revived every player"},killAll:{category:"server",build:()=>"killed every player"},kickAll:{category:"server",build:t=>`kicked every player${Lr(t)}`},deleteVehicles:{category:"server",build:()=>"deleted every vehicle on the map"},deletePeds:{category:"server",build:()=>"deleted every ped on the map"},deleteObjects:{category:"server",build:()=>"deleted every object on the map"},notifyAll:{category:"server",build:t=>`broadcast a notification: "${Tt(t.message,Tt(t.title,"no content"))}"`}};function Er(t){const e=t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ");return e.charAt(0).toLowerCase()+e.slice(1)}function qf(t){return t==="moderation"?"moderation":t==="serverManagement"?"server":t==="playerActions"?"player":"other"}function gl(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function Zf(t){const e=gl(t.payload),a=t.target_name||t.target_identifier||"a player",r=Uf[t.action];if(!r)return{message:!!(t.target_identifier||t.target_name)?`${Er(t.action)} on ${a}`:Er(t.action),category:qf(t.namespace)};let i;try{i=r.build(e,a)}catch{i=Er(t.action)}return e._truncated&&(i+=" (details were too large to store)"),{message:i,category:r.category}}const Kf={amount:"Amount",account:"Account",reason:"Reason",duration_minutes:"Duration",identifiers:"Identifiers captured",enabled:"Enabled",model:"Model",job:"Job",grade:"Grade",firstName:"First name",lastName:"Last name",channel:"Radio channel",bucket:"Routing bucket",group:"ACE group",permission:"Permission",trollAction:"Troll action",weather:"Weather",hour:"Hour",minute:"Minute",message:"Message",title:"Title",notificationType:"Type",duration:"Duration (ms)",identifier:"Identifier",expires_at:"Expires at"};function Yf(t){const e=[];e.push({label:"Action",value:`${t.namespace} / ${t.action}`,mono:!0}),e.push({label:"Admin",value:t.actor_identifier||"unknown",mono:!0}),t.target_identifier&&e.push({label:"Target",value:t.target_identifier,mono:!0});const a=gl(t.payload);for(const[r,i]of Object.entries(a)){if(r==="_truncated"||i===null||i===void 0||i==="")continue;let s;r==="duration_minutes"?s=Xi(i).replace(/^for /,""):typeof i=="boolean"?s=i?"yes":"no":typeof i=="object"?s=JSON.stringify(i):s=String(i),e.push({label:Kf[r]??Er(r),value:s})}return a._truncated&&e.push({label:"Payload",value:"Too large to store, it was dropped"}),e}function Xf(t){if(t===null)return"";const e=Date.now()-t;if(e<6e4)return"just now";const a=Math.floor(e/6e4);if(a<60)return`${a} min ago`;const r=Math.floor(a/60);if(r<24)return`${r} h ago`;const i=Math.floor(r/24);return i<7?`${i} d ago`:new Date(t).toLocaleDateString(void 0,{day:"2-digit",month:"short"})}function Gf(t){return t===null?"unknown":new Date(t).toLocaleString(void 0,{year:"numeric",month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}var Jf=B('<button type="button" class="search-clear svelte-mb30d6" tabindex="-1" aria-label="Clear search">×</button>'),Qf=B('<div class="spinner-wrapper"><div class="spinner"></div></div>'),$f=B('<span class="chip denied-chip svelte-mb30d6"> </span>'),e1=B('<div class="detail svelte-mb30d6"><span class="detail-label svelte-mb30d6"> </span> <span> </span></div>'),t1=B('<div class="details svelte-mb30d6"><div class="detail svelte-mb30d6"><span class="detail-label svelte-mb30d6">When</span> <span class="detail-value svelte-mb30d6"> </span></div> <!></div>'),n1=B('<div><span></span> <div class="body svelte-mb30d6"><p class="sentence svelte-mb30d6"><span class="actor svelte-mb30d6"> </span> </p> <div class="meta svelte-mb30d6"><span> </span> <span class="when svelte-mb30d6"> </span> <!> <button type="button" class="details-btn svelte-mb30d6" tabindex="-1"> </button></div> <!></div></div>'),a1=B('<button type="button" class="load-more svelte-mb30d6" tabindex="-1"> </button>'),r1=B('<div class="scroller svelte-mb30d6"><div class="feed svelte-mb30d6"></div> <!></div>'),i1=B('<p class="empty-hint svelte-mb30d6"> </p>'),s1=B('<p class="empty-hint svelte-mb30d6">No admin action was recorded for this period.</p>'),o1=B('<div class="empty svelte-mb30d6"><p class="empty-title svelte-mb30d6"> </p> <!></div>'),l1=B('<div class="top-bar"><div class="heading svelte-mb30d6"><span class="players-title" tabindex="-1"> </span> <span class="summary svelte-mb30d6"> </span></div> <div class="logs-filters svelte-mb30d6"><select tabindex="-1" class="logs-select svelte-mb30d6"><option> </option><option> </option><option> </option><option> </option></select> <select tabindex="-1" class="logs-select svelte-mb30d6"><option> </option><option> </option><option> </option></select> <div class="search-box svelte-mb30d6" tabindex="-1"><svg class="search-icon svelte-mb30d6" 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="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> <input type="text" tabindex="-1" class="search-input svelte-mb30d6"/> <!></div></div></div> <div class="list-wrapper"><!></div>',1);function c1(t,e){et(e,!0);const a=50;let r=M(pe(new Set));function i(H){const ee=new Set(n(r));ee.has(H)?ee.delete(H):ee.add(H),_(r,ee,!0)}let s=M(pe([])),l=M(!1),u=M(!1),v=M(0),h=M(!1),b=M(""),y=M(7),g=M(""),p=M(""),A;const k=2;function w(){const H=n(g).trim();return H.length>=k?H:""}function C(){clearTimeout(A),A=setTimeout(()=>{const H=w();H!==n(p)&&(_(p,H,!0),R(!0))},300)}function z(){clearTimeout(A),_(g,""),_(p,""),R(!0)}async function R(H=!0){if(n(l))return;_(l,!0);const ee=await bv({search:n(p)||void 0,namespace:n(b)||void 0,days:n(y)>0?n(y):void 0,limit:a,offset:H?0:n(v)});_(s,H?ee.logs:[...n(s),...ee.logs],!0),_(u,ee.hasMore,!0),_(v,ee.nextOffset,!0),_(l,!1),_(h,!0)}cs(()=>{R(!0)});function x(H){const ee=H.currentTarget;ee.scrollHeight-ee.scrollTop-ee.clientHeight<150&&n(u)&&!n(l)&&R(!1)}const S=W(()=>n(s).map(H=>{const{message:ee,category:Me}=Zf(H),he=$r(H.created_at);return{log:H,message:ee,category:Me,actor:H.actor_name||H.actor_identifier||"Unknown",when:Xf(he),exactWhen:Gf(he),details:Yf(H),ok:H.success===1||H.success===!0}})),T=W(()=>{const H=n(s).length,ee=n(u)?"+":"";return n(p)!==""?`${H}${ee} result${H===1?"":"s"} for "${n(p)}"`:`${H}${ee} action${H===1?"":"s"}`});var D=l1(),K=ue(D),N=o(K),L=o(N),F=o(L),ie=c(L,2),ae=o(ie),q=c(N,2),j=o(q);j.__change=()=>R(!0);var Y=o(j),X=o(Y);Y.value=Y.__value="";var G=c(Y),se=o(G);G.value=G.__value="playerActions";var le=c(G),fe=o(le);le.value=le.__value="serverManagement";var ve=c(le),Se=o(ve);ve.value=ve.__value="moderation";var ke=c(j,2);ke.__change=()=>R(!0);var ye=o(ke),ce=o(ye);ye.value=ye.__value=1;var de=c(ye),me=o(de);de.value=de.__value=7;var Ce=c(de),Fe=o(Ce);Ce.value=Ce.__value=30;var ze=c(ke,2),Te=c(o(ze),2);Te.__input=C,Te.__keydown=H=>H.key==="Escape"&&z();var Qe=c(Te,2);{var nt=H=>{var ee=Jf();ee.__click=z,P(H,ee)};$(Qe,H=>{n(g)!==""&&H(nt)})}var rt=c(K,2),I=o(rt);{var V=H=>{var ee=Qf();P(H,ee)},re=H=>{var ee=Le(),Me=ue(ee);{var he=d=>{var E=r1(),O=o(E);st(O,21,()=>n(S),J=>J.log.id,(J,oe)=>{var we=n1();let Re;var Xe=o(we),De=c(Xe,2),Ve=o(De),Pe=o(Ve),Oe=o(Pe),We=c(Pe),$e=c(Ve,2),He=o($e),Be=o(He),_e=c(He,2),Je=o(_e),Ue=c(_e,2);{var it=qe=>{var yt=$f(),ut=o(yt);Q(Ot=>m(ut,Ot),[()=>n(oe).log.error||f("failed","Denied")]),P(qe,yt)};$(Ue,qe=>{n(oe).ok||qe(it)})}var ct=c(Ue,2);ct.__click=()=>i(n(oe).log.id);var Ht=o(ct),zt=c($e,2);{var gt=qe=>{var yt=t1(),ut=o(yt),Ot=c(o(ut),2),vt=o(Ot),Mt=c(ut,2);st(Mt,17,()=>n(oe).details,Et,(Nt,Dt)=>{var Rt=e1(),ht=o(Rt),wt=o(ht),Kt=c(ht,2);let jt;var ln=o(Kt);Q(()=>{m(wt,n(Dt).label),jt=Ne(Kt,1,"detail-value svelte-mb30d6",null,jt,{mono:n(Dt).mono}),m(ln,n(Dt).value)}),P(Nt,Rt)}),Q(()=>m(vt,n(oe).exactWhen)),P(qe,yt)};$(zt,qe=>{n(r).has(n(oe).log.id)&&qe(gt)})}Q(qe=>{Re=Ne(we,1,"entry svelte-mb30d6",null,Re,{denied:!n(oe).ok}),Ne(Xe,1,`marker ${n(oe).category??""}`,"svelte-mb30d6"),m(Oe,n(oe).actor),m(We,` ${n(oe).message??""}`),Ne(He,1,`chip ${n(oe).category??""}`,"svelte-mb30d6"),m(Be,jf[n(oe).category]),Ke(_e,"title",n(oe).exactWhen),m(Je,n(oe).when),m(Ht,qe)},[()=>n(r).has(n(oe).log.id)?f("hide_details","Hide details"):f("more_info","More info")]),P(J,we)});var ne=c(O,2);{var te=J=>{var oe=a1();oe.__click=()=>R(!1);var we=o(oe);Q(Re=>{oe.disabled=n(l),m(we,Re)},[()=>n(l)?f("loading","Loading..."):f("load_more","Load more")]),P(J,oe)};$(ne,J=>{n(u)&&J(te)})}Ln("scroll",E,x),P(d,E)},xe=d=>{var E=Le(),O=ue(E);{var ne=te=>{var J=o1(),oe=o(J),we=o(oe),Re=c(oe,2);{var Xe=Ve=>{var Pe=i1(),Oe=o(Pe);Q(()=>m(Oe,`No admin action matches "${n(p)??""}" over this period.`)),P(Ve,Pe)},De=Ve=>{var Pe=s1();P(Ve,Pe)};$(Re,Ve=>{n(p)!==""?Ve(Xe):Ve(De,!1)})}Q(Ve=>m(we,Ve),[()=>f("no_logs_found","Nothing to show")]),P(te,J)};$(O,te=>{n(h)&&te(ne)},!0)}P(d,E)};$(Me,d=>{n(S).length>0?d(he):d(xe,!1)},!0)}P(H,ee)};$(I,H=>{n(l)&&n(s).length===0?H(V):H(re,!1)})}Q((H,ee,Me,he,xe,d,E,O,ne)=>{m(F,H),m(ae,n(T)),m(X,ee),m(se,Me),m(fe,he),m(Se,xe),m(ce,d),m(me,E),m(Fe,O),Ke(Te,"placeholder",ne)},[()=>f("admin_logs","Admin Logs"),()=>f("all_categories","All categories"),()=>f("player_actions","Player actions"),()=>f("server_management","Server management"),()=>f("moderation","Moderation"),()=>f("last_24h","Last 24h"),()=>f("last_7_days","Last 7 days"),()=>f("last_30_days","Last 30 days"),()=>f("search_logs","Search admin, player or action...")]),Fs(j,()=>n(b),H=>_(b,H)),Fs(ke,()=>n(y),H=>_(y,H)),lt(Te,()=>n(g),H=>_(g,H)),P(t,D),tt()}ft(["change","input","keydown","click"]);var u1=B("<p>Page not found</p>"),v1=B('<div class="tab-container"><div class="tab-wrapper"><!></div></div>');function d1(t,e){et(e,!0);var a=v1();Ln("keydown",Yn,u=>{u.key==="Tab"&&u.preventDefault()});var r=o(a),i=o(r);{var s=u=>{Nf(u,{})},l=u=>{var v=Le(),h=ue(v);{var b=g=>{so(g,{})},y=g=>{var p=Le(),A=ue(p);{var k=C=>{so(C,{})},w=C=>{var z=Le(),R=ue(z);{var x=T=>{_f(T,{})},S=T=>{var D=Le(),K=ue(D);{var N=F=>{xf(F,{})},L=F=>{var ie=Le(),ae=ue(ie);{var q=Y=>{Tf(Y,{})},j=Y=>{var X=Le(),G=ue(X);{var se=fe=>{Lf(fe,{})},le=fe=>{var ve=Le(),Se=ue(ve);{var ke=ce=>{Hf(ce,{})},ye=ce=>{var de=Le(),me=ue(de);{var Ce=ze=>{c1(ze,{})},Fe=ze=>{var Te=u1();P(ze,Te)};$(me,ze=>{kt.value==="admin_logs"?ze(Ce):ze(Fe,!1)},!0)}P(ce,de)};$(Se,ce=>{kt.value==="srv_management"?ce(ke):ce(ye,!1)},!0)}P(fe,ve)};$(G,fe=>{kt.value==="ply_recent"?fe(se):fe(le,!1)},!0)}P(Y,X)};$(ae,Y=>{kt.value==="ply_data"?Y(q):Y(j,!1)},!0)}P(F,ie)};$(K,F=>{kt.value==="ply_vehicles"?F(N):F(L,!1)},!0)}P(T,D)};$(R,T=>{kt.value==="ply_bans"?T(x):T(S,!1)},!0)}P(C,z)};$(A,C=>{kt.value==="ply_online"?C(k):C(w,!1)},!0)}P(g,p)};$(h,g=>{kt.value==="ply_management"?g(b):g(y,!1)},!0)}P(u,v)};$(i,u=>{kt.value==="dashboard_home"?u(s):u(l,!1)})}P(t,a),tt()}var f1=B('<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>'),h1=B('<div class="notifications" aria-live="polite" aria-atomic="true"></div>');function _1(t,e){et(e,!0);var a=Le(),r=ue(a);{var i=s=>{var l=h1();st(l,21,()=>Kn.items,u=>u.id,(u,v)=>{var h=f1();let b;var y=o(h),g=o(y),p=c(y,2);p.__click=()=>Kn.dismiss(n(v).id),Q(()=>{b=Ne(h,1,"notification",null,b,{error:n(v).type==="error",success:n(v).type==="success",info:n(v).type==="info"}),m(g,n(v).message)}),P(u,h)}),P(s,l)};$(r,s=>{Kn.items.length>0&&s(i)})}P(t,a),tt()}ft(["click"]);const vn=[{id:"self",labelKey:"admin_menu_self",page:"self"},{id:"vehicle",labelKey:"admin_menu_vehicle",page:"vehicle"},{id:"utility",labelKey:"admin_menu_utility",page:"utility"}],Oi=vn[0]?.page??"self",Ka=[1,2,3,4,5].map(t=>({value:t,label:`${t}/5`})),ge={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 St(t){return t.customizationPayload()}function p1(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:[ge.action("noclip","noclip","adminMenu:noclip",{badge:"toggle"}),ge.action("names","show_names","adminMenu:names",{badge:"toggle"}),ge.action("blips","show_blips","adminMenu:blips",{badge:"toggle"}),ge.action("godmode","godmode","adminMenu:godmode",{badge:"toggle"}),ge.action("invisible","invisible","adminMenu:invisible",{badge:"toggle"}),ge.action("infiniteAmmo","infinite_ammo","adminMenu:infiniteAmmo",{badge:"toggle"}),ge.action("revive","revive","adminMenu:revive"),ge.action("heal","heal","adminMenu:heal"),ge.action("armor","armor","adminMenu:armor"),ge.action("waypoint","teleport_waypoint","adminMenu:waypoint")]},self:{id:"self",titleKey:"admin_menu_self",subtitleKey:"quick_actions",categoryId:"self",items:[ge.action("noclip","noclip","adminMenu:noclip",{badge:"toggle"}),ge.action("names","show_names","adminMenu:names",{badge:"toggle"}),ge.action("blips","show_blips","adminMenu:blips",{badge:"toggle"}),ge.action("godmode","godmode","adminMenu:godmode",{badge:"toggle"}),ge.action("invisible","invisible","adminMenu:invisible",{badge:"toggle"}),ge.action("infiniteAmmo","infinite_ammo","adminMenu:infiniteAmmo",{badge:"toggle"}),ge.action("revive","revive","adminMenu:revive"),ge.action("heal","heal","adminMenu:heal"),ge.action("armor","armor","adminMenu:armor"),ge.action("waypoint","teleport_waypoint","adminMenu:waypoint")]},vehicle:{id:"vehicle",titleKey:"admin_menu_vehicle",subtitleKey:"quick_actions",categoryId:"vehicle",items:[ge.page("spawnVehiclePage","spawn_vehicle","spawn"),ge.page("customizeVehiclePage","customize_vehicle","customize"),ge.action("repair","repair_vehicle","adminMenu:repairVehicle"),ge.action("clean","clean_vehicle","adminMenu:cleanVehicle"),ge.action("flip","flip_vehicle","adminMenu:flipVehicle"),ge.action("delete","delete_current_vehicle","adminMenu:deleteVehicle")]},utility:{id:"utility",titleKey:"admin_menu_utility",subtitleKey:"quick_actions",categoryId:"utility",items:[ge.action("copyCoords","copy_coords","adminMenu:copyCoords")]},spawn:{id:"spawn",titleKey:"spawn_vehicle",subtitleKey:"vehicle_model",categoryId:"vehicle",parentPage:"vehicle",items:[ge.input("spawnModel","vehicle_model","spawnModel",{placeholder:t.defaultModel,event:"adminMenu:spawnVehicle",payload:l=>l.spawnPayload()}),ge.option("spawnColor","vehicle_color","spawnColor",e),ge.toggle("spawnMaxPerformance","spawn_tuned","spawnMaxPerformance")]},customize:{id:"customize",titleKey:"customize_vehicle",subtitleKey:"customize_vehicle_hint",categoryId:"vehicle",parentPage:"vehicle",items:[ge.option("engineLevel","engine_level","engineLevel",Ka,"adminMenu:customizeVehicle",St),ge.option("brakeLevel","brake_level","brakeLevel",Ka,"adminMenu:customizeVehicle",St),ge.option("transmissionLevel","transmission_level","transmissionLevel",Ka,"adminMenu:customizeVehicle",St),ge.option("suspensionLevel","suspension_level","suspensionLevel",Ka,"adminMenu:customizeVehicle",St),ge.option("armorLevel","vehicle_armor","armorLevel",Ka,"adminMenu:customizeVehicle",St),ge.toggle("turbo","turbo","turbo","adminMenu:customizeVehicle",St),ge.toggle("xenon","xenon_lights","xenon","adminMenu:customizeVehicle",St),ge.toggle("neon","neon_lights","neon","adminMenu:customizeVehicle",St),ge.option("neonColor","neon_color","neonColor",a,"adminMenu:customizeVehicle",St),ge.option("vehicleColor","primary_color","vehicleColor",e,"adminMenu:customizeVehicle",St),ge.option("secondaryColor","secondary_color","secondaryColor",e,"adminMenu:customizeVehicle",St),ge.option("windowTint","window_tint","windowTint",r,"adminMenu:customizeVehicle",St),ge.option("wheelCategory","wheel_category","wheelCategory",i,"adminMenu:customizeVehicle",St),ge.option("wheelDesign","wheel_design","wheelDesign",s,"adminMenu:customizeVehicle",St),ge.toggle("bulletproofTires","bulletproof_tires","bulletproofTires","adminMenu:customizeVehicle",St),ge.action("maxPerformance","max_performance","adminMenu:maxVehiclePerformance",{badge:"value"})]}}}class m1{#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=M(""),this.#n=M(""),this.#t=M(!1),this.#r=M(1),this.#s=M(1),this.#i=M(1),this.#a=M(1),this.#o=M(1),this.#l=M(!1),this.#c=M(!1),this.#u=M(!1),this.#v=M(""),this.#f=M(""),this.#h=M(""),this.#_=M(0),this.#d=M(""),this.#p=M(-1),this.#m=M(!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 b1=B('<button type="button"> </button>'),g1=B('<div class="admin-menu-section-label"> </div>'),y1=B("<label><span> </span> <input/></label>"),w1=B('<small class="value-badge page-badge"><</small>'),x1=B('<small class="value-badge page-badge">></small>'),k1=B("<small> </small>"),C1=B('<small class="value-badge"> </small>'),M1=B("<small> </small>"),S1=B('<small class="value-badge selector-badge"><span class="selector-arrow"><</span> <span> </span> <span class="selector-arrow">></span></small>'),T1=B('<button type="button"><span> </span> <!></button>'),A1=B('<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 L1(t,e){et(e,!0);let a=M(null),r=M(pe(Oi)),i=M("items"),s=M(0),l=M(0),u=M(0),v=M(null),h=M(null),b=new m1(U.vehicleConfig),y=U.vehicleConfig,g=new Map,p=!1;const A=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter","Backspace","Tab"]),k=W(()=>p1(U.vehicleConfig)),w=W(()=>n(k)[n(r)]??n(k)[Oi]??n(k).root),C=W(()=>n(w).parentPage?[{type:"back",id:"back",labelKey:"back",page:n(w).parentPage},...n(w).items]:n(w).items),z=W(()=>n(w).categoryId??vn.find(d=>d.page===n(w).id)?.id??vn[0]?.id??""),R=W(()=>Math.max(0,vn.findIndex(d=>d.id===n(z)))),x=W(()=>n(C).filter(d=>d.type!=="section")),S=W(()=>{let d=-1;return n(C).map(E=>(E.type!=="section"&&(d+=1),{item:E,selectableIndex:E.type==="section"?-1:d}))});function T(d,E){return g.set(E,d),{destroy(){g.delete(E)}}}function D(d){if(d.type!=="option"&&d.type!=="toggle"&&d.type!=="input")return"";const E=b.get(d.valueKey);return d.type==="toggle"?f(E?"on":"off"):d.type==="option"?d.options?.find(O=>O.value===E)?.label??String(E):String(E??"")}function K(){_(u,Math.max(0,Math.min(n(u),Math.max(0,n(x).length-1))),!0)}function N(){_(l,Math.max(0,Math.min(n(l),Math.max(0,vn.length-1))),!0)}function L(d,E="items",O=!0){_(r,n(k)[d]?d:Oi,!0),_(i,E,!0),_(u,0);const ne=n(k)[n(r)],te=ne?.items.findIndex(oe=>oe.type==="input")??-1,J=te>=0?ne?.items[te]:null;O&&J?.type==="input"&&(_(u,te+(ne?.parentPage?1:0)),Sa().then(()=>q(J.id)))}async function F(d,E="items",O=!0){await X(),L(d,E,O)}async function ie(d,E="categories"){if(vn.length===0)return;_(l,(n(l)+d+vn.length)%vn.length),N();const O=vn[n(l)];O&&await F(O.page,E,E!=="categories")}async function ae(d){p!==d&&(p=d,await Ye("adminMenu:setInputFocus",{enabled:d}))}async function q(d){const E=g.get(d);E&&(await ae(!0),E.focus(),E.select())}async function j(d){d?.currentTarget?.blur(),await ae(!1)}function Y(){const d=document.activeElement;if(!(d instanceof HTMLInputElement))return null;for(const E of g.values())if(E===d)return E;return null}async function X(){const d=Y();return d?(d.blur(),await ae(!1),!0):!1}function G(d,E){b.set(d,E)}function se(d){return d instanceof HTMLElement?d.isContentEditable||d instanceof HTMLInputElement||d instanceof HTMLTextAreaElement||d instanceof HTMLSelectElement:!1}async function le(d){if(!("event"in d)||!d.event||n(a))return null;_(a,d.id,!0);const E=d.payload?.(b)??{},O=await Ye(d.event,E);return O?.success&&(d.id==="maxPerformance"&&b.applyMaxPerformance(),"badge"in d&&d.badge==="toggle"&&U.setAdminMenuState(d.id,O.active??!1),"badge"in d&&d.badge==="value"&&O.value&&U.setAdminMenuBadge(d.id,O.value),d.type==="action"&&(!("badge"in d)||!d.badge)&&Kn.success(f(d.labelKey))),_(a,null),O}async function fe(d,E){if(d.type==="action"&&d.badge==="toggle"){await le(d);return}if(d.type==="option"){const O=d.options??[];if(O.length===0)return;const te=(O.findIndex(J=>J.value===b.get(d.valueKey))+E+O.length)%O.length;G(d.valueKey,O[te].value),d.event&&(await Sa(),await le(d))}d.type==="toggle"&&(G(d.valueKey,!b.get(d.valueKey)),d.event&&(await Sa(),await le(d)))}async function ve(d){if(d.type==="page"||d.type==="back"){await F(d.page);return}if(d.type==="input"){await q(d.id);return}if(d.type!=="option"){if(d.type==="toggle"){await fe(d,1);return}d.type==="action"&&await le(d)}}async function Se(){if(n(s)===0){await ye();return}await ce()}async function ke(d,E){await j(E),d.event&&await le(d)}async function ye(){if(n(a))return;_(a,"dashboard");const d=await Ye("openDashboard");(d===null||d.success)&&U.openDashboard(U.players??[]),_(a,null)}async function ce(){const d=await Ye("releaseFocus",{release:!0});(d===null||d.success)&&U.close()}async function de(d,E=!1){if(!U.visible||U.mode!=="menu")return;if(Y())if(d==="Tab")await X();else if(d==="ArrowUp"||d==="ArrowDown")await X();else if(d==="Enter"||d==="Escape"){await X();return}else return;if(d==="Tab")_(l,n(i)==="categories"?n(l):n(R),!0),_(i,"categories"),await ie(E?-1:1,"categories");else if(n(i)==="controls")d==="ArrowLeft"||d==="ArrowRight"?_(s,n(s)===0?1:0,!0):d==="ArrowDown"?(_(i,"items"),_(u,0),K()):d==="Enter"?await Se():d==="Backspace"&&await ce();else if(n(i)==="categories")d==="ArrowLeft"||d==="ArrowRight"?await ie(d==="ArrowLeft"?-1:1,"categories"):d==="ArrowDown"?(_(i,"items"),_(u,0),K()):d==="ArrowUp"?(_(i,"items"),_(u,n(x).length-1),K()):d==="Enter"?await ie(0,"items"):d==="Backspace"&&(n(w).parentPage?await F(n(w).parentPage):(_(i,"controls"),_(s,0)));else if(d==="ArrowUp")n(u)<=0?(_(i,"categories"),_(l,n(R),!0)):(_(u,n(u)-1),K());else if(d==="ArrowDown")_(u,n(u)>=n(x).length-1?0:n(u)+1,!0),K();else if(d==="ArrowLeft"||d==="ArrowRight"){const ne=n(x)[n(u)];ne&&await fe(ne,d==="ArrowLeft"?-1:1)}else if(d==="Enter"){const ne=n(x)[n(u)];ne&&await ve(ne)}else d==="Backspace"&&(n(w).parentPage?await F(n(w).parentPage):(_(i,"controls"),_(s,0)));await Sa(),(n(i)==="categories"?n(v)?.querySelector("button.selected"):n(h)?.querySelector("button.selected, .admin-menu-input-row.selected"))?.scrollIntoView({block:"nearest"})}Lt(()=>{U.vehicleConfig!==y&&(y=U.vehicleConfig,b.reset(U.vehicleConfig))}),Lt(()=>{n(i)!=="categories"&&_(l,n(R),!0)}),Lt(()=>{const d=E=>{!U.visible||U.mode!=="menu"||A.has(E.key)&&(E.key!=="Tab"&&se(E.target)||(E.preventDefault(),de(E.key,E.shiftKey)))};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}});var me=A1(),Ce=o(me),Fe=o(Ce),ze=o(Fe),Te=o(ze),Qe=c(ze,2),nt=o(Qe),rt=c(Fe,2),I=o(rt);let V;I.__click=()=>{_(i,"controls"),_(s,0),ye()};var re=c(I,2);let H;re.__click=()=>{_(i,"controls"),_(s,1),ce()};var ee=c(Ce,2);st(ee,21,()=>vn,Et,(d,E,O)=>{var ne=b1();ne.__click=()=>{_(l,O,!0),F(n(E).page)};let te;var J=o(ne);Q(oe=>{te=Ne(ne,1,"",null,te,{active:n(z)===n(E).id,selected:n(i)==="categories"&&n(l)===O}),m(J,oe)},[()=>f(n(E).labelKey)]),P(d,ne)}),ra(ee,d=>_(v,d),()=>n(v));var Me=c(ee,2);st(Me,21,()=>n(S),Et,(d,E)=>{const O=W(()=>n(E).item);var ne=Le(),te=ue(ne);{var J=we=>{var Re=g1(),Xe=o(Re);Q(De=>m(Xe,De),[()=>f(n(O).labelKey)]),P(we,Re)},oe=we=>{var Re=Le(),Xe=ue(Re);{var De=Pe=>{var Oe=y1();let We;var $e=o(Oe),He=o($e),Be=c($e,2);Be.__input=_e=>G(n(O).valueKey,_e.currentTarget.value),Be.__keydown=_e=>{if(_e.key==="Enter"||_e.key==="Escape")_e.preventDefault(),_e.stopPropagation(),_e.key==="Enter"?ke(n(O),_e):j(_e);else if(_e.key==="ArrowUp"||_e.key==="ArrowDown"){const Je=_e.key;_e.preventDefault(),_e.stopPropagation(),(async()=>(await j(_e),await de(Je)))()}},bu(Be,(_e,Je)=>T?.(_e,Je),()=>n(O).id),Q((_e,Je)=>{We=Ne(Oe,1,"admin-menu-input-row",null,We,{selected:n(i)==="items"&&n(E).selectableIndex===n(u)}),m(He,_e),Mu(Be,Je),Ke(Be,"placeholder",n(O).placeholder)},[()=>f(n(O).labelKey),()=>String(b.get(n(O).valueKey)??"")]),Ln("focus",Be,()=>ae(!0)),Ln("blur",Be,j),P(Pe,Oe)},Ve=Pe=>{var Oe=T1();Oe.__click=()=>{_(u,n(E).selectableIndex,!0),ve(n(O))};let We;var $e=o(Oe),He=o($e),Be=c($e,2);{var _e=Ue=>{var it=w1();P(Ue,it)},Je=Ue=>{var it=Le(),ct=ue(it);{var Ht=gt=>{var qe=x1();P(gt,qe)},zt=gt=>{var qe=Le(),yt=ue(qe);{var ut=vt=>{var Mt=k1(),Nt=o(Mt);Q(Dt=>m(Nt,Dt),[()=>U.adminMenuStates[n(O).id]?f("on"):f("off")]),P(vt,Mt)},Ot=vt=>{var Mt=Le(),Nt=ue(Mt);{var Dt=ht=>{var wt=C1(),Kt=o(wt);Q(()=>m(Kt,U.adminMenuBadges[n(O).id])),P(ht,wt)},Rt=ht=>{var wt=Le(),Kt=ue(wt);{var jt=Bt=>{var Yt=M1(),Wt=o(Yt);Q(tn=>m(Wt,tn),[()=>D(n(O))]),P(Bt,Yt)},ln=Bt=>{var Yt=Le(),Wt=ue(Yt);{var tn=cn=>{var On=S1(),Nn=c(o(On),2),Dn=o(Nn);Q(Rn=>m(Dn,Rn),[()=>D(n(O))]),P(cn,On)};$(Wt,cn=>{n(O).type==="option"&&cn(tn)},!0)}P(Bt,Yt)};$(Kt,Bt=>{n(O).type==="toggle"?Bt(jt):Bt(ln,!1)},!0)}P(ht,wt)};$(Nt,ht=>{n(O).type==="action"&&n(O).badge==="value"&&U.adminMenuBadges[n(O).id]?ht(Dt):ht(Rt,!1)},!0)}P(vt,Mt)};$(yt,vt=>{n(O).type==="action"&&n(O).badge==="toggle"?vt(ut):vt(Ot,!1)},!0)}P(gt,qe)};$(ct,gt=>{n(O).type==="page"?gt(Ht):gt(zt,!1)},!0)}P(Ue,it)};$(Be,Ue=>{n(O).type==="back"?Ue(_e):Ue(Je,!1)})}Q((Ue,it)=>{Oe.disabled=n(a)!==null,We=Ne(Oe,1,"",null,We,Ue),m(He,it)},[()=>({selected:n(i)==="items"&&n(E).selectableIndex===n(u),"admin-menu-back":n(O).type==="back",active:n(O).type==="action"&&n(O).badge==="toggle"&&U.adminMenuStates[n(O).id]===!0||n(O).type==="toggle"&&b.get(n(O).valueKey)===!0}),()=>f(n(O).labelKey)]),P(Pe,Oe)};$(Xe,Pe=>{n(O).type==="input"?Pe(De):Pe(Ve,!1)},!0)}P(we,Re)};$(te,we=>{n(O).type==="section"?we(J):we(oe,!1)})}P(d,ne)}),ra(Me,d=>_(h,d),()=>n(h));var he=c(Me,2),xe=o(he);Q((d,E,O,ne,te)=>{Ke(me,"aria-label",d),m(Te,E),m(nt,O),V=Ne(I,1,"admin-menu-dashboard",null,V,{selected:n(i)==="controls"&&n(s)===0}),Ke(I,"aria-label",ne),H=Ne(re,1,"admin-menu-close",null,H,{selected:n(i)==="controls"&&n(s)===1}),m(xe,te)},[()=>f("quick_admin_menu"),()=>f(n(w).titleKey),()=>f(n(w).subtitleKey),()=>f("open_admin_dashboard"),()=>n(w).parentPage?f("quick_menu_edit_hint"):f("quick_menu_hint")]),P(t,me),tt()}ft(["click","input","keydown"]);var P1=B('<div class="esx-adminmenu-container"><!> <div class="menu-content"><!> <!></div></div>'),E1=B('<div class="spectate-tooltip-container"><div class="spectate-tooltip"> </div></div>'),z1=B("<!> <!> <!>",1);function O1(t,e){et(e,!0);async function a(){await Ye("releaseFocus",{release:!0})!==null&&(kt.set("dashboard_home"),U.close())}async function r(){const g=await Ye("openAdminMenu");(g===null||g.success)&&U.openMenu()}function i(g){g.key==="Escape"&&U.visible&&a()}Lt(()=>(window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}));var s=z1(),l=ue(s);{var u=g=>{var p=P1(),A=o(p);Wu(A,{onEscape:a,onOpenAdminMenu:r});var k=c(A,2),w=o(k);Cv(w,{});var C=c(w,2);d1(C,{}),P(g,p)},v=g=>{var p=Le(),A=ue(p);{var k=w=>{L1(w,{})};$(A,w=>{U.visible&&U.mode==="menu"&&w(k)},!0)}P(g,p)};$(l,g=>{U.visible&&U.mode==="dashboard"?g(u):g(v,!1)})}var h=c(l,2);_1(h,{});var b=c(h,2);{var y=g=>{var p=E1(),A=o(p),k=o(A);Q(w=>m(k,w),[()=>f("escape_spectate")]),P(g,p)};$(b,g=>{U.spectating&&g(y)})}P(t,s),tt()}function N1(t){const e=a=>{a.data?.action&&t(a.data)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)}N1(t=>{switch(t.action){case"initResource":if(!t.data)return;Ze.set(t.data.serverData),t.data.translations&&Object.keys(t.data.translations).length>0&&$o.set(t.data.translations),U.setImpounds(t.data.impounds??{}),U.setVehicleConfig(t.data.vehicleConfig);break;case"openAdmin":if(!t.data)return null;U.openDashboard(t.data);break;case"openAdminDashboard":if(!t.data)return null;t.data.serverData&&Ze.set(t.data.serverData),U.openDashboard(t.data.players??[],t.data.selectedPlayerId??null),t.data.selectedPlayerId!==void 0&&kt.set("ply_management");break;case"openAdminMenu":t.data?.serverData&&Ze.set(t.data.serverData),U.openMenu();break;case"updateServerData":if(!t.data)return null;Ze.set(t.data);break;case"adminMenuState":if(!t.data)return null;U.setAdminMenuState(t.data.action,t.data.active),U.setAdminMenuBadge(t.data.action,t.data.value);break;case"updatePlayers":if(!t.data)return null;U.setPlayers(t.data);break;case"stopSpectate":if(!t.data)return null;iv(t.data);break;case"closeAdmin":U.close();break;case"copyToClipboard":if(!t.data)return null;us(t.data);break}});const D1=""+new URL("testbg-DszbURmB.png",import.meta.url).href,Ya=document.getElementById("app");!Gt()&&Ya&&(Ya.style.backgroundImage=`url(${D1})`,Ya.style.backgroundSize="cover",Ya.style.backgroundRepeat="no-repeat",Ya.style.backgroundPosition="center");ou(O1,{target:document.getElementById("app")}); diff --git a/[esx_addons]/esx_adminmenu/web/dist/assets/index-mlYIvnS4.css b/[esx_addons]/esx_adminmenu/web/dist/assets/index-mlYIvnS4.css new file mode 100644 index 00000000..35de329a --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/dist/assets/index-mlYIvnS4.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%}}.heading.svelte-mb30d6{display:flex;flex-direction:column;gap:.1vh}.summary.svelte-mb30d6{font-family:Poppins;font-size:1.15vh;color:#7d7d7d}.logs-filters.svelte-mb30d6{display:flex;align-items:center;gap:1vh}.search-box.svelte-mb30d6{display:flex;align-items:center;gap:.7vh;background:#171717;border:.1vh solid #2b2b2b;border-radius:.6vh;padding:.65vh .9vh;color:#7d7d7d;transition:border-color .15s ease}.search-box.svelte-mb30d6:focus-within{border-color:#fb9b04;color:#fb9b04}.search-icon.svelte-mb30d6{width:1.3vh;height:1.3vh;flex-shrink:0}.search-input.svelte-mb30d6{all:unset;width:18vh;font-family:Poppins;font-size:1.3vh;color:#f2f2f2}.search-input.svelte-mb30d6::placeholder{color:#6a6a6a}.search-clear.svelte-mb30d6{all:unset;cursor:pointer;font-size:1.7vh;line-height:1;color:#7d7d7d;padding:0 .2vh}.search-clear.svelte-mb30d6:hover{color:#fb9b04}.logs-select.svelte-mb30d6{background:#171717;color:#f2f2f2;border:.1vh solid #2b2b2b;border-radius:.6vh;padding:.7vh .9vh;font-family:Poppins;font-size:1.3vh;outline:none;cursor:pointer}.logs-select.svelte-mb30d6:hover{border-color:#fb9b04}.scroller.svelte-mb30d6{height:100%;overflow-y:auto;overflow-x:hidden;padding-right:.6vh;scrollbar-width:thin;scrollbar-color:#333 transparent}.scroller.svelte-mb30d6::-webkit-scrollbar{width:.6vh}.scroller.svelte-mb30d6::-webkit-scrollbar-track{background:transparent}.scroller.svelte-mb30d6::-webkit-scrollbar-thumb{background:#333;border-radius:1vh}.scroller.svelte-mb30d6::-webkit-scrollbar-thumb:hover{background:#fb9b04}.feed.svelte-mb30d6{display:flex;flex-direction:column;gap:.5vh;padding:.5vh 0}.entry.svelte-mb30d6{display:flex;align-items:flex-start;gap:1.1vh;padding:1.1vh 1.4vh;background:#141414;border-radius:.7vh;border-left:.3vh solid transparent}.entry.svelte-mb30d6:hover{background:#191919}.entry.denied.svelte-mb30d6{border-left-color:#e04f4f}.marker.svelte-mb30d6{width:.8vh;height:.8vh;border-radius:50%;margin-top:.55vh;flex-shrink:0}.marker.moderation.svelte-mb30d6{background:#e04f4f}.marker.economy.svelte-mb30d6{background:#3fbf5f}.marker.player.svelte-mb30d6{background:#fb9b04}.marker.server.svelte-mb30d6{background:#4f9be0}.marker.other.svelte-mb30d6{background:#8f8f8f}.body.svelte-mb30d6{display:flex;flex-direction:column;gap:.4vh;min-width:0;flex:1}.sentence.svelte-mb30d6{margin:0;font-family:Poppins;font-size:1.4vh;font-weight:400;color:#dcdcdc;line-height:1.5;word-break:break-word}.actor.svelte-mb30d6{font-weight:600;color:#f2f2f2}.meta.svelte-mb30d6{display:flex;align-items:center;gap:.8vh;flex-wrap:wrap}.chip.svelte-mb30d6{font-family:Poppins;font-size:1.05vh;font-weight:500;padding:.25vh .7vh;border-radius:1vh;background:#232323;color:#b8b8b8}.chip.moderation.svelte-mb30d6{color:#e88585}.chip.economy.svelte-mb30d6{color:#7ed69a}.chip.player.svelte-mb30d6{color:#fbc164}.chip.server.svelte-mb30d6{color:#8ec2ef}.denied-chip.svelte-mb30d6{background:#2a1616;color:#e88585}.when.svelte-mb30d6{font-family:Poppins;font-size:1.15vh;color:#7d7d7d}.details-btn.svelte-mb30d6{all:unset;font-family:Poppins;font-size:1.1vh;font-weight:500;color:#7d7d7d;cursor:pointer;text-decoration:underline;text-underline-offset:.25vh}.details-btn.svelte-mb30d6:hover{color:#fb9b04}.details.svelte-mb30d6{display:grid;grid-template-columns:repeat(auto-fill,minmax(22vh,1fr));gap:.5vh 1.4vh;margin-top:.7vh;padding:.9vh 1.1vh;background:#101010;border-radius:.6vh}.detail.svelte-mb30d6{display:flex;flex-direction:column;gap:.1vh;min-width:0}.detail-label.svelte-mb30d6{font-family:Poppins;font-size:1.05vh;color:#6f6f6f}.detail-value.svelte-mb30d6{font-family:Poppins;font-size:1.2vh;color:#d0d0d0;word-break:break-word}.detail-value.mono.svelte-mb30d6{font-family:monospace;font-size:1.15vh;color:#b0b0b0}.load-more.svelte-mb30d6{all:unset;display:block;margin:1.4vh auto;padding:.8vh 2.2vh;border-radius:.6vh;background:#1c1c1c;color:#e2e2e2;font-family:Poppins;font-size:1.3vh;cursor:pointer;text-align:center}.load-more.svelte-mb30d6:hover{background:#fb9b04;color:#101010}.empty.svelte-mb30d6{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5vh;padding:6vh 0}.empty-title.svelte-mb30d6{margin:0;font-family:Poppins;font-size:1.6vh;font-weight:500;color:#d0d0d0}.empty-hint.svelte-mb30d6{margin:0;font-family:Poppins;font-size:1.3vh;color:#7d7d7d} 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..e91f2236 --- /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..721eab88 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/TabContent.svelte @@ -0,0 +1,44 @@ + + + { + 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 if currentPage.value === "admin_logs"} + + {: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/LogsIcon.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/LogsIcon.svelte new file mode 100644 index 00000000..ab693c68 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/components/icons/LogsIcon.svelte @@ -0,0 +1,9 @@ + + + + + + + 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..06524eab --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/config/sidebar.ts @@ -0,0 +1,35 @@ +import PlayersIcon from "../components/icons/PlayersIcon.svelte"; +import ServerIcon from "../components/icons/ServerIcon.svelte"; +import CarIcon from "../components/icons/CarIcon.svelte"; +import LogsIcon from "../components/icons/LogsIcon.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, + }, + { + label: "Admin Logs", + value: "admin_logs", + icon: LogsIcon, + }, +]; + 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..37ce5df8 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/nui/admin.ts @@ -0,0 +1,234 @@ +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"; +import type { AdminLog, AdminLogFilters } from "../../tabs/admin-logs/types/log"; + +// 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 ?? []) : []; +}; + +type AdminLogPageResponse = NuiSuccess & { + logs?: AdminLog[]; + hasMore?: boolean; + nextOffset?: number; +}; + +// The log page owns its own state instead of a shared store: it is read-only +// and only ever rendered by a single tab. +export const fetchAdminLogs = async (filters: AdminLogFilters = {}) => { + const res = await fetchNui("getAdminLogs", filters); + + return { + logs: res?.success ? (res.logs ?? []) : [], + hasMore: res?.hasMore === true, + nextOffset: res?.nextOffset ?? 0, + ok: res?.success === true, + }; +}; + +// 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..c5299df3 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/shared/stores/translations.svelte.ts @@ -0,0 +1,209 @@ +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) { + // Merge over the English defaults so a partial locale keeps every key. + this.values = { ...defaultTranslations, ...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-logs/AdminLogs.svelte b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/AdminLogs.svelte new file mode 100644 index 00000000..81962f0c --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/AdminLogs.svelte @@ -0,0 +1,565 @@ + + +
+
+ {t("admin_logs", "Admin Logs")} + {summary} +
+ +
+ + + + + +
+
+ +
+ {#if loading && logs.length === 0} +
+
+
+ {:else if decorated.length > 0} +
+
+ {#each decorated as row (row.log.id)} +
+ + +
+

+ {row.actor} + {row.message} +

+ +
+ {CATEGORY_LABELS[row.category]} + {row.when} + {#if !row.ok} + {row.log.error || t("failed", "Denied")} + {/if} + + +
+ + {#if expanded.has(row.log.id)} +
+
+ When + {row.exactWhen} +
+ {#each row.details as detail} +
+ {detail.label} + {detail.value} +
+ {/each} +
+ {/if} +
+
+ {/each} +
+ + {#if hasMore} + + {/if} +
+ {:else if loaded} +
+

{t("no_logs_found", "Nothing to show")}

+ {#if appliedSearch !== ""} +

No admin action matches "{appliedSearch}" over this period.

+ {:else} +

No admin action was recorded for this period.

+ {/if} +
+ {/if} +
+ + diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/logLabels.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/logLabels.ts new file mode 100644 index 00000000..6c82a8f6 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/logLabels.ts @@ -0,0 +1,299 @@ +// Turns a raw log row into a sentence a head admin can skim. +// Every logged action has its own phrasing, built from the exact payload keys +// the server handlers actually read, instead of dumping JSON on screen. + +import type { AdminLog } from "./types/log"; + +export type LogCategory = "moderation" | "economy" | "player" | "server" | "other"; + +export const CATEGORY_LABELS: Record = { + moderation: "Moderation", + economy: "Economy", + player: "Player", + server: "Server", + other: "Other", +}; + +type Payload = Record; +type Builder = (payload: Payload, target: string) => string; + +const nf = new Intl.NumberFormat("de-DE"); + +const money = (value: unknown) => `$${nf.format(Number(value) || 0)}`; +const num = (value: unknown) => String(Math.round(Number(value) || 0)); + +const text = (value: unknown, fallback = "") => { + const str = typeof value === "string" ? value.trim() : ""; + return str === "" ? fallback : str; +}; + +/** Payloads arrive from the NUI, so a boolean may be a real bool, "true" or 1. */ +const bool = (value: unknown) => value === true || value === "true" || value === 1 || value === "1"; + +const account = (value: unknown) => { + const name = text(value, "money"); + if (name === "bank") return "bank"; + if (name === "black_money") return "dirty money"; + return "cash"; +}; + +function duration(minutes: unknown) { + const value = Number(minutes) || 0; + if (value <= 0) return "permanently"; + if (value < 60) return `for ${value} min`; + if (value < 1440) return `for ${Math.round(value / 60)} h`; + return `for ${Math.round(value / 1440)} days`; +} + +/** Appended only when a reason was actually given. */ +const because = (p: Payload) => { + const reason = text(p.reason); + return reason === "" ? "" : ` — ${reason}`; +}; + +const ACTIONS: Record = { + // ------------------------------------------------------------ moderation + ban: { + category: "moderation", + build: (p, t) => `banned ${t} ${duration(p.duration_minutes)}${because(p)}`, + }, + banOffline: { + category: "moderation", + build: (p, t) => `banned ${t} while they were offline, ${duration(p.duration_minutes)}${because(p)}`, + }, + unban: { category: "moderation", build: (_p, t) => `lifted the ban on ${t}` }, + banChangeExpiry: { category: "moderation", build: (_p, t) => `changed how long ${t} stays banned` }, + kick: { category: "moderation", build: (p, t) => `kicked ${t}${because(p)}` }, + + killPlayer: { category: "moderation", build: (_p, t) => `killed ${t}` }, + revivePlayer: { category: "moderation", build: (_p, t) => `revived ${t}` }, + // One toggle action for both directions, so the verb comes from the payload. + freezePlayer: { + category: "moderation", + build: (p, t) => (bool(p.enabled) ? `froze ${t}` : `unfroze ${t}`), + }, + cleanInventory: { category: "moderation", build: (_p, t) => `wiped the inventory of ${t}` }, + deleteCharacter: { + category: "moderation", + build: (p, t) => `deleted the character of ${t === "a player" ? text(p.identifier, t) : t}`, + }, + // The server reads payload.group and falls back to payload.permission. + aceAdd: { + category: "moderation", + build: (p, t) => `granted the "${text(p.group, text(p.permission, "unknown"))}" ACE group to ${t}`, + }, + aceRemove: { + category: "moderation", + build: (p, t) => `revoked the "${text(p.group, text(p.permission, "unknown"))}" ACE group from ${t}`, + }, + + // --------------------------------------------------------------- economy + giveMoney: { category: "economy", build: (p, t) => `gave ${money(p.amount)} to ${t} (${account(p.account)})` }, + takeMoney: { category: "economy", build: (p, t) => `took ${money(p.amount)} from ${t} (${account(p.account)})` }, + giveMoneyAll: { category: "economy", build: (p) => `gave ${money(p.amount)} to every player (${account(p.account)})` }, + + // ---------------------------------------------------------------- player + setHealth: { category: "player", build: (p, t) => `set the health of ${t} to ${num(p.amount)}%` }, + setArmor: { category: "player", build: (p, t) => `set the armor of ${t} to ${num(p.amount)}%` }, + setThirst: { category: "player", build: (p, t) => `set the thirst of ${t} to ${num(p.amount)}%` }, + setHunger: { category: "player", build: (p, t) => `set the hunger of ${t} to ${num(p.amount)}%` }, + setModel: { category: "player", build: (p, t) => `changed ${t} into "${text(p.model, "another model")}"` }, + setJob: { category: "player", build: (p, t) => `made ${t} ${text(p.job, "unemployed")} (grade ${num(p.grade)})` }, + setName: { + category: "player", + build: (p, t) => { + const full = `${text(p.firstName)} ${text(p.lastName)}`.trim(); + return full === "" ? `renamed ${t}` : `renamed ${t} to ${full}`; + }, + }, + setRadio: { + category: "player", + build: (p, t) => { + const channel = Number(p.channel) || 0; + return channel <= 0 ? `took ${t} off the radio` : `put ${t} on radio channel ${channel}`; + }, + }, + setRoutingBucket: { category: "player", build: (p, t) => `moved ${t} to routing bucket ${num(p.bucket)}` }, + openClothing: { category: "player", build: (_p, t) => `opened the clothing menu of ${t}` }, + giveAllWeapons: { category: "player", build: (_p, t) => `gave every weapon to ${t}` }, + troll: { category: "player", build: (p, t) => `used the "${text(p.trollAction, "unknown")}" troll on ${t}` }, + + // ---------------------------------------------------------------- server + weather: { category: "server", build: (p) => `set the weather to ${text(p.weather, "default")}` }, + time: { + category: "server", + build: (p) => `set the time to ${num(p.hour).padStart(2, "0")}:${num(p.minute).padStart(2, "0")}`, + }, + blackout: { category: "server", build: (p) => (bool(p.enabled) ? "turned the blackout on" : "turned the blackout off") }, + pvp: { category: "server", build: (p) => (bool(p.enabled) ? "enabled PvP" : "disabled PvP") }, + freezeAll: { category: "server", build: () => "froze every player" }, + unfreezeAll: { category: "server", build: () => "unfroze every player" }, + bringAll: { category: "server", build: () => "teleported every player to them" }, + reviveAll: { category: "server", build: () => "revived every player" }, + killAll: { category: "server", build: () => "killed every player" }, + kickAll: { category: "server", build: (p) => `kicked every player${because(p)}` }, + deleteVehicles: { category: "server", build: () => "deleted every vehicle on the map" }, + deletePeds: { category: "server", build: () => "deleted every ped on the map" }, + deleteObjects: { category: "server", build: () => "deleted every object on the map" }, + notifyAll: { + category: "server", + build: (p) => `broadcast a notification: "${text(p.message, text(p.title, "no content"))}"`, + }, +}; + +/** "giveMoney" -> "give money", so an action added later still reads acceptably. */ +function humanize(key: string) { + const spaced = key.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " "); + return spaced.charAt(0).toLowerCase() + spaced.slice(1); +} + +function fallbackCategory(namespace: string): LogCategory { + if (namespace === "moderation") return "moderation"; + if (namespace === "serverManagement") return "server"; + if (namespace === "playerActions") return "player"; + return "other"; +} + +function parsePayload(raw?: string | null): Payload { + if (!raw) return {}; + + try { + const parsed = JSON.parse(raw) as unknown; + return parsed && typeof parsed === "object" ? (parsed as Payload) : {}; + } catch { + return {}; + } +} + +export function describeLog(log: AdminLog): { message: string; category: LogCategory } { + const payload = parsePayload(log.payload); + const target = log.target_name || log.target_identifier || "a player"; + const known = ACTIONS[log.action]; + + if (!known) { + const hasTarget = Boolean(log.target_identifier || log.target_name); + return { + message: hasTarget ? `${humanize(log.action)} on ${target}` : humanize(log.action), + category: fallbackCategory(log.namespace), + }; + } + + let message: string; + try { + message = known.build(payload, target); + } catch { + message = humanize(log.action); + } + + // The server swaps oversized payloads for a marker, so say so plainly rather + // than letting the sentence silently lose its details. + if (payload._truncated) { + message += " (details were too large to store)"; + } + + return { message, category: known.category }; +} + +export type LogDetail = { label: string; value: string; mono?: boolean }; + +const DETAIL_LABELS: Record = { + amount: "Amount", + account: "Account", + reason: "Reason", + duration_minutes: "Duration", + identifiers: "Identifiers captured", + enabled: "Enabled", + model: "Model", + job: "Job", + grade: "Grade", + firstName: "First name", + lastName: "Last name", + channel: "Radio channel", + bucket: "Routing bucket", + group: "ACE group", + permission: "Permission", + trollAction: "Troll action", + weather: "Weather", + hour: "Hour", + minute: "Minute", + message: "Message", + title: "Title", + notificationType: "Type", + duration: "Duration (ms)", + identifier: "Identifier", + expires_at: "Expires at", +}; + +/** Everything the row hides, shown on demand behind the details button. */ +export function buildDetails(log: AdminLog): LogDetail[] { + const details: LogDetail[] = []; + + details.push({ label: "Action", value: `${log.namespace} / ${log.action}`, mono: true }); + details.push({ label: "Admin", value: log.actor_identifier || "unknown", mono: true }); + + if (log.target_identifier) { + details.push({ label: "Target", value: log.target_identifier, mono: true }); + } + + // The error is deliberately not repeated here: it already appears in full on + // the row itself, in the red chip next to the timestamp. + + const payload = parsePayload(log.payload); + + for (const [key, value] of Object.entries(payload)) { + if (key === "_truncated" || value === null || value === undefined || value === "") continue; + + let shown: string; + + if (key === "duration_minutes") { + shown = duration(value).replace(/^for /, ""); + } else if (typeof value === "boolean") { + shown = value ? "yes" : "no"; + } else if (typeof value === "object") { + shown = JSON.stringify(value); + } else { + shown = String(value); + } + + details.push({ label: DETAIL_LABELS[key] ?? humanize(key), value: shown }); + } + + if (payload._truncated) { + details.push({ label: "Payload", value: "Too large to store, it was dropped" }); + } + + return details; +} + +/** "3 min ago" reads better than a timestamp for recent activity. */ +export function relativeTime(ms: number | null): string { + if (ms === null) return ""; + + const diff = Date.now() - ms; + if (diff < 60_000) return "just now"; + + const minutes = Math.floor(diff / 60_000); + if (minutes < 60) return `${minutes} min ago`; + + const hours = Math.floor(minutes / 60); + if (hours < 24) return `${hours} h ago`; + + const days = Math.floor(hours / 24); + if (days < 7) return `${days} d ago`; + + return new Date(ms).toLocaleDateString(undefined, { day: "2-digit", month: "short" }); +} + +/** Full timestamp, shown in the details panel where precision matters. */ +export function absoluteTime(ms: number | null): string { + if (ms === null) return "unknown"; + + return new Date(ms).toLocaleString(undefined, { + year: "numeric", + month: "short", + day: "2-digit", + hour: "2-digit", + minute: "2-digit", + second: "2-digit", + }); +} diff --git a/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/types/log.ts b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/types/log.ts new file mode 100644 index 00000000..7dee3d59 --- /dev/null +++ b/[esx_addons]/esx_adminmenu/web/src/lib/tabs/admin-logs/types/log.ts @@ -0,0 +1,32 @@ +export interface AdminLog { + id: number; + created_at: string | number | null; + + actor_identifier: string; + actor_name?: string | null; + + namespace: string; + action: string; + + target_identifier?: string | null; + target_name?: string | null; + + // Stored as TINYINT server-side, so it arrives as 0 or 1. + success: number | boolean; + error?: string | null; + + // JSON string, already redacted and size-capped by the server. + payload?: string | null; +} + +export interface AdminLogFilters { + /** Free text, matched server-side against admin, target and action. */ + search?: string; + actor?: string; + target?: string; + action?: string; + namespace?: string; + days?: number; + limit?: number; + offset?: number; +} 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') + } + } +})