diff --git a/dist/CHANGELOG.md b/dist/CHANGELOG.md deleted file mode 100644 index 3cf849b..0000000 --- a/dist/CHANGELOG.md +++ /dev/null @@ -1,35 +0,0 @@ -# Changelog - -## Version 2.0.0 - -* Plugin updated for React. -* Internet connectivity not required. -* Compatible with Grafana 9.* and 10.*. - -## Version 1.0.4 - -* Added "Load SVG from local file" config option. -* Better auto resize handling. -* Internet connectivity required. -* Compatible also with Grafana 6.7, 7 and 8. -* For Grafana 7.* and 8.*, use this version and apply the "Prepare Time Series" / "Multi-frame time series" transform operation to the data source. - -## Version 1.0.3 - -* Added "Auto Resize" config option. -* Supported Grafana Templating Variables. -* More efficient data update and display rendering. -* Generic tagging (@1, @2, @3, ...) compatible with the Power BI plugin. -* Better responsiveness to configuration changes. - -## Version 1.0.2 - -* Better README.md. - -## Version 1.0.1 - -* Revised version. Watermark removed. - -## Version 1.0.0 - -* Initial version. diff --git a/dist/LICENSE b/dist/LICENSE deleted file mode 100644 index f288702..0000000 --- a/dist/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - 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. - - - Copyright (C) - - 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: - - Copyright (C) - 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. But first, please read -. diff --git a/dist/MANIFEST.txt b/dist/MANIFEST.txt deleted file mode 100644 index 85941d8..0000000 --- a/dist/MANIFEST.txt +++ /dev/null @@ -1,57 +0,0 @@ - ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 - -{ - "manifestVersion": "2.0.0", - "signatureType": "community", - "signedByOrg": "scadavis", - "signedByOrgName": "scadavis", - "plugin": "scadavis-synoptic-panel", - "version": "2.0.0", - "time": 1701268893088, - "keyId": "7e4d0c6a708866e7", - "files": { - "CHANGELOG.md": "d4dd3947b08f8153ed779ab34d1c7d3fbb3096ed7f20d76fc357e8084974f01f", - "img/scadavis-donuts-radar.png": "dd9d9a92d44e0c43b6f5afe3f73ae9d96f367b8376abbdbe75a0a24e366efe7c", - "img/scadavis-large.png": "fe13d3634daa2ef415de3a9c530dd05f9b8c9b9fd7fe07f745d36d395bdeb2f0", - "img/scadavis-options.png": "299f804da97176c4c338ad5efddb48b09a3dfeced1dbbad9cb3ae11bc8b47930", - "img/scadavis-power.png": "3a554bbed4143f6139307437f32f1b578e6055fec34359ac2ecd3eee457b66b1", - "img/scadavis-small.png": "b270b4ed5bdd37a65a0fd6961058b9624e9af2b1a5486593b68283b5d10ae073", - "img/scadavis-speedometer.png": "0f6b33b475767852de20aa63859893f65f32c6b7473f1e23edb80fef8f6b099f", - "LICENSE": "3972dc9744f6499f0f9b2dbf76696f2ae7ad8af9b23dde66d6af86c9dfb36986", - "module.js": "b78f6e556d6f254110d63d2a6c3ba7f3eec4b5de0b1466e57351e08b48d04835", - "module.js.map": "76edb6d8a5052d3ffaa2e7c1d72d1a223769dfd5e57142d84d1b69a13416ac7e", - "plugin.json": "be67e55d6d0d25ef7fc7807ba7ece216b1370ede93a63d4bd6745da8ca0cec9b", - "README.md": "50a46493f6ede4e9d97d478171ea86d64297b94eeea59f8a24e623d98c1cd72a", - "synoptic/cdn/chroma.min.js": "b886a36b0727ff20c7ee27cae930604a94021c65cc402e0efedd3e27fb6a2301", - "synoptic/cdn/chroma.min.js.LICENSE.txt": "d8923c44c3015ba9b9f0f1c8fb1b77e1c0857b6bd0015383c906a8c10877b4f3", - "synoptic/cdn/d3.v7.min.js": "b3b27a546f09a2aabcaec01554ee42f9f690f44c21c89011a2e7f186c3d73a6d", - "synoptic/cdn/jquery-3.6.1.min.js": "cdb85e11146fa8b6d810f156abded3176cc87646e65074c7c5074080c92d3243", - "synoptic/cdn/jquery-3.6.1.min.js.LICENSE.txt": "44ea2c125c5ab20d5835d86d2e4a8a005105ad5031d7e5daefd8b15cddc2fd00", - "synoptic/cdn/snap.svg-min.js": "6fbce655671d5cd0e786f208342dd98d6cb985376079689a3189de5eb89591b5", - "synoptic/cdn/vega-lite.min-5.5.0.js": "e1883227e996ce672097b45eb42a9de1874132257545fbcfa82ef2439cdb61da", - "synoptic/cdn/vega.min-5.22.1.js": "dfa719f8e447a2c0e373a6ac9ddcbbb21e14c371c9b1fa9c3c14d5a1b516c0bf", - "synoptic/config_viewers_default.js": "a41f14dcb0506c97a26019c584a8d6c8de62b70792ce5ea80cc0c61db42155f3", - "synoptic/getjsondata.js": "bf833ad8c8fc7fb88198c5d16914ef681d1818823a7e56b8242eb7d1c92d6e1f", - "synoptic/images/move.svg": "1af8cfbacdc74f7c2cb266f45d29434725f2341dd5197e7eb2a90e069aa2c3ce", - "synoptic/images/scadavis.svg": "bb77c113d62eff9df65c2da88bb5b616bd5e0a8ab97a70d86c09332ffb291946", - "synoptic/images/zoom-in.svg": "f48ac21d434a18f3ca08dc6efa6c22b72b0b6c9e1bd66bc3986013b26ee84d64", - "synoptic/images/zoom-out.svg": "1e29ef2ea2711c80ca439b35c6ad769e2993819a958b11194c9ad9a9161e19af", - "synoptic/legacy_options.js": "1dd9059f91b79050c9c7a5c5ac0a7395a07f5a9cbf8d448c347a2c4faaf3fccd", - "synoptic/synoptic.html": "3c8e8c57c415f00dfc77d040d6af87dabf4b9f4257269a977efe105ac48d44e8", - "synoptic/vega_websage.js": "88e0ca815a879b6f5c92afc50f2272da07804db4e8a2eea31bc93692ae848816", - "synoptic/websage.js": "2a8816383ee91cab9061d9eed72d23e02d62f06ec283f37efc9101e00f664105" - } -} ------BEGIN PGP SIGNATURE----- -Version: OpenPGP.js v4.10.10 -Comment: https://openpgpjs.org - -wrkEARMKAAYFAmVnTZ0AIQkQfk0ManCIZucWIQTzOyW2kQdOhGNlcPN+TQxq -cIhm5w6wAgkB9AJau4IoLJoMqza1668Z5+WkQJu591aGCFpLSwxrEQ1RjRV+ -ZWsTCXwr1QVftcCbebuLOZ/VgZgYFEJvWWtPZnwCCQF5tcjUOcx5zVNjKLut -iMWBzia0HF4amsDUJx4YImIyR8JOfXa4dEd2aTbInvb4rSPzU9uhgxkF7KRP -e7aDZdSBig== -=7wCQ ------END PGP SIGNATURE----- diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index 7eb8bac..0000000 --- a/dist/README.md +++ /dev/null @@ -1,109 +0,0 @@ -## Powerful SCADA-like synoptic graphics panel for Grafana - -This panel plugin allows unleashing the power of SCADA-like graphics in Grafana. - -The SCADAvis.io online service provides an incredibly powerful SVG Editor that can be used to create free-form graphics animated with Grafana data. - -Learn how to obtain and use the SCADAvis.io editor [here](https://scadavis.io). - -In the SVG file, graphical objects should be marked with tags that match metrics or aliases names from Grafana data queries. - -Step-by-step example: -* Create a new SVG file using the SCADAvis.io Synoptic Editor. -* Put a text object the top left position. -* Change the text to %f (use printf convention to format numbers). -* Select the text object and click the right mouse button, choose "Object Properties". -* Go to the "Get" tab and type in the "Tag" field some tag name such as "TAG1". Tags like "@1", "@2", etc. will link to 1st, 2nd, etc. data series available at runtime. -* Save the SVG file (do not change the default format). -* Edit the Grafana panel with the SCADAvis.io plugin. -* In the "Panel Options" tab, click the "Upload SVG file" button and choose your SVG file. -* In the "Query" panel choose a Data Source and use the tag name that is inside the SVG file (e.g. "TAG1") as the metric name. Example query: "SELECT as value, "TAG1" as metric FROM ...". Example data sources like "Random Walk" and "Live Measurements" will also work. -* Save the panel and it will display the value obtained from the query in the panel as a float value. -* There are many animations possible such as fill/stroke color, position, opacity, etc. (see "Learn" section on https://scadavis.io site). - -This plugin uses IFrames, so it may be necessary to enable the "allow_embedding" Grafana config option. - - In grafana.ini: - [security] - allow_embedding = true - - Or with an environment variable: - GF_SECURITY_ALLOW_EMBEDDING=true - -![Power](https://raw.githubusercontent.com/riclolsen/displayfiles/master/scadavis-power.png?raw=true) -![Options](https://raw.githubusercontent.com/riclolsen/displayfiles/master/scadavis-options.png?raw=true) -![Speedometer](https://raw.githubusercontent.com/riclolsen/displayfiles/master/scadavis-speedometer.png?raw=true) -![Donuts](https://raw.githubusercontent.com/riclolsen/displayfiles/master/scadavis-donuts-radar.png?raw=true) - -## Installation - -Use the new grafana-cli tool to install scadavis-synoptic-panel from the command line: - -``` -grafana-cli plugins install scadavis-synoptic-panel -``` - -The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins if you installed the grafana package. - -More instructions on the cli tool can be found [here](https://grafana.com/docs/grafana/latest/cli/). - -## Alternative installation method - -It is also possible to clone this repo directly into your plugins directory. - -Afterwards restart grafana-server and the plugin should be automatically detected and used. - -``` -git clone https://github.com/riclolsen/scadavis-synoptic-panel.git -sudo service grafana-server restart -``` - -## Clone into a directory of your choice - -If the plugin is cloned to a directory that is not the default plugins directory then you need to edit your grafana.ini config file (Default location is at /etc/grafana/grafana.ini) and add this: - -```ini -[plugin.scadavis-synoptic-panel] -path = /home/your/clone/dir/scadavis-synoptic-panel -``` - -Notice that if you clone it into the grafana plugins directory you do not need to add the above config option. That is only -if you want to place the plugin in a directory outside the standard plugins directory. Be aware that grafana-server -needs read access to the directory. - -# Changelog - -## Version 2.0.0 - -* Plugin updated for React. -* Internet connectivity not required. -* Compatible with Grafana 9.* and 10.*. - -## Version 1.0.4 - -* Added "Load SVG from local file" config option. -* Better auto resize handling. -* Internet connectivity required. -* Compatible also with Grafana 6.7, 7 and 8. -* For Grafana 7.* and 8.*, use this version and apply the "Prepare Time Series" / "Multi-frame time series" transform operation to the data source. - -## Version 1.0.3 - -* Added "Auto Resize" config option. -* Supported Grafana Templating Variables. -* More efficient data update and display rendering. -* Generic tagging (@1, @2, @3, ...) compatible with the Power BI plugin. -* Better responsiveness to configuration changes. - -## Version 1.0.2 - -* Better README.md. - -## Version 1.0.1 - -* Revised version. Watermark removed. - -## Version 1.0.0 - -* Initial version. - diff --git a/dist/img/scadavis-donuts-radar.png b/dist/img/scadavis-donuts-radar.png deleted file mode 100644 index e11c0cf..0000000 Binary files a/dist/img/scadavis-donuts-radar.png and /dev/null differ diff --git a/dist/img/scadavis-large.png b/dist/img/scadavis-large.png deleted file mode 100644 index db3edc4..0000000 Binary files a/dist/img/scadavis-large.png and /dev/null differ diff --git a/dist/img/scadavis-options.png b/dist/img/scadavis-options.png deleted file mode 100644 index 035ed4e..0000000 Binary files a/dist/img/scadavis-options.png and /dev/null differ diff --git a/dist/img/scadavis-power.png b/dist/img/scadavis-power.png deleted file mode 100644 index 1602401..0000000 Binary files a/dist/img/scadavis-power.png and /dev/null differ diff --git a/dist/img/scadavis-small.png b/dist/img/scadavis-small.png deleted file mode 100644 index f39886a..0000000 Binary files a/dist/img/scadavis-small.png and /dev/null differ diff --git a/dist/img/scadavis-speedometer.png b/dist/img/scadavis-speedometer.png deleted file mode 100644 index 5d77dc3..0000000 Binary files a/dist/img/scadavis-speedometer.png and /dev/null differ diff --git a/dist/module.js b/dist/module.js deleted file mode 100644 index 1b55c7a..0000000 --- a/dist/module.js +++ /dev/null @@ -1,2 +0,0 @@ -define(["@grafana/data","react","@grafana/ui"],((e,t,o)=>(()=>{"use strict";var a={305:t=>{t.exports=e},388:e=>{e.exports=o},650:e=>{e.exports=t}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return a[e](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{n.r(i),n.d(i,{plugin:()=>m});var e=n(305),t=n(650),o=n.n(t);function a(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}class s{guidGenerator(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}createElementFromHTML(e){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild}loadURL(e){if(this.svgobj=null,this.readyfordata=!1,this.svgurl=e,""!==this.svgurl&&0===this.loadingSVG){this.loadingSVG=1;const e=new XMLHttpRequest;e.open("GET",this.svgurl);let t=this;e.onload=function(){var o,a;200===e.status&&(t.loadingSVG=0,t.componentloaded?null===(a=t.iframe)||void 0===a||null===(o=a.contentWindow)||void 0===o||o.postMessage(e.responseText,t.domain):t.svgobj=e.responseText)},e.onreadystatechange=function(o){4===e.readyState&&(200===e.status||(t.loadingSVG=0,this.onerror?t.onerror(e.statusText):console.warn("SCADAvis.io API: error loading SVG URL. "+e.statusText)))},e.send()}}resetData(){this.npt=0,this.npts={},this.vals={},this.qualifs={},this.descriptions={};const e={data:{type:"resetData"}};this.readyfordata?window.postMessage(e,this.domain):this.resetobj=e}refreshDisplay(e){let t=this;return new Promise((function(o,a){t.readyfordata?t.resolveFunction?a(new Error("Ongoing display refresh!")):(t.resolveFunction=o,t.rejectFunction=a,t.updateValues(e)):a(new Error("Not ready for data!"))}))}updateValues(e){var t,o;if(!this.readyfordata)return null;let a=this;"object"==typeof e&&null!==e&&Object.keys(e).map((function(t,o){let s;t in a.npts?s=a.npts[t]:(s=++a.npt,a.npts[t]=s),a.vals[t]=e[t],a.qualifs[t]=0}));const s={data:{type:"tags",tags:[],handle:++this.updateHandle}};return Object.keys(this.npts).map((function(e,t){s.data.tags[t]={},s.data.tags[t].path=e,s.data.tags[t].value=a.vals[e],s.data.tags[t].quality=!(128&a.qualifs[e]),"number"==typeof a.vals[e]?s.data.tags[t].type="float":"boolean"==typeof a.vals[e]?s.data.tags[t].type="bool":s.data.tags[t].type="string",s.data.tags[t].parameters={Value:{TagClientItem:a.npts[e],Alarmed:256==(256&a.qualifs[e]),Desc:a.descriptions[e]}}})),null===(o=this.iframe)||void 0===o||null===(t=o.contentWindow)||void 0===t||t.postMessage(s,this.domain),s.handle}setValue(e,t,o,a,s){if(""===e||null==e)return this.readyfordata;let n;if(o=o||!1,a=a||!1,s=s||e,e in this.npts?n=this.npts[e]:(n=++this.npt,this.npts[e]=n),this.vals[e]=t,this.qualifs[e]=(o?128:0)|(a?256:0),this.descriptions[e]=s,this.readyfordata){var i,l;const o={data:{type:"tags",tags:[],handle:++this.updateHandle}};o.data.tags[0]={},o.data.tags[0].path=e,o.data.tags[0].value=t,o.data.tags[0].quality=!(128&this.qualifs[e]),o.data.tags[0].type="number"==typeof t?"float":"boolean"==typeof t?"bool":"string",o.data.tags[0].parameters={Value:{TagClientItem:n,Alarmed:256==(256&this.qualifs[e]),Desc:this.descriptions[e]}},null===(l=this.iframe)||void 0===l||null===(i=l.contentWindow)||void 0===i||i.postMessage(o,this.domain)}return this.readyfordata}storeValue(e,t,o,a,s){if(""===e||null==e)return this.readyfordata;let n;return o=o||!1,a=a||!1,s=s||e,e in this.npts?n=this.npts[e]:(n=++this.npt,this.npts[e]=n),this.vals[e]=t,this.qualifs[e]=(o?128:0)|(a?256:0),this.descriptions[e]=s,this.readyfordata}getValue(e){return e in this.vals?this.vals[e]:null}getApiKey(){return this.apikey}getVersion(){return this.version}getIframe(){return this.iframe}getComponentState(){return!1===this.componentloaded?0:!1===this.readyfordata?1:2}getComponentVersion(){return this.version}getTagsList(){return this.tagsList}moveBy(e,t,o){const a={data:{type:"moveBy",dx:e=e||0,dy:t=t||0,animate:o=o||!1}};var s,n;this.readyfordata?null===(n=this.iframe)||void 0===n||null===(s=n.contentWindow)||void 0===s||s.postMessage(a,this.domain):this.moveobj=a}zoomTo(e,t,o){const a={data:{type:"zoomTo",zoomLevel:e=e||1.1,target:t,animate:o=o||!1}};var s,n;this.readyfordata?null===(n=this.iframe)||void 0===n||null===(s=n.contentWindow)||void 0===s||s.postMessage(a,this.domain):this.zoomobj=a}zoomToOriginal(e){const t={data:{type:"zoomToOriginal",animate:e=e||!1}};var o,a;this.readyfordata&&(null===(a=this.iframe)||void 0===a||null===(o=a.contentWindow)||void 0===o||o.postMessage(t,this.domain))}enableTools(e,t){(void 0===e||e)&&(e=!0),void 0===t&&(t=!1);const o={data:{type:"enableTools",panEnabled:e,zoomEnabled:t}};var a,s;this.readyfordata?null===(s=this.iframe)||void 0===s||null===(a=s.contentWindow)||void 0===a||a.postMessage(o,this.domain):this.enabletoolsobj=o}enableMouse(e,t){(void 0===e||e)&&(e=!0),(void 0===t||t)&&(t=!0);const o={data:{type:"enableMouse",panEnabled:e,zoomEnabled:t}};var a,s;this.readyfordata?null===(s=this.iframe)||void 0===s||null===(a=s.contentWindow)||void 0===a||a.postMessage(o,this.domain):this.enablemouseobj=o}setMouseWheel(e,t){(void 0===e||e)&&(e=!0),(void 0===t||t)&&(t=!0);const o={data:{type:"setMouseWheel",directionBackOut:e,blockEventPropagation:t}};var a,s;this.readyfordata?null===(s=this.iframe)||void 0===s||null===(a=s.contentWindow)||void 0===a||a.postMessage(o,this.domain):this.mousewheelobj=o}enableKeyboard(e){(void 0===e||e)&&(e=!0);const t={data:{type:"enableKeyboard",keyEnabled:e}};var o,a;this.readyfordata?null===(a=this.iframe)||void 0===a||null===(o=a.contentWindow)||void 0===o||o.postMessage(t,this.domain):this.enablekeyboardobj=t}enableAlarmFlash(e){(void 0===e||e)&&(e=!0);const t={data:{type:"enableAlarmFlash",alarmFlashEnabled:e}};var o,a;this.componentloaded?null===(a=this.iframe)||void 0===a||null===(o=a.contentWindow)||void 0===o||o.postMessage(t,this.domain):this.enableflashobj=t}hideWatermark(){const e={data:{type:"hideWatermark"}};var t,o;this.readyfordata?null===(o=this.iframe)||void 0===o||null===(t=o.contentWindow)||void 0===t||t.postMessage(e,this.domain):this.hidewatermarkobj=e}setColor(e,t){const o={data:{type:"setColor",colorNumber:e,colorCode:t}};var a,s;this.componentloaded?null===(s=this.iframe)||void 0===s||null===(a=s.contentWindow)||void 0===a||a.postMessage(o,this.domain):this.setcolorobj.push(o)}setColors(e){const t={data:{type:"setColors",colorsTable:e}};var o,a;this.componentloaded?null===(a=this.iframe)||void 0===a||null===(o=a.contentWindow)||void 0===o||o.postMessage(t,this.domain):this.setcolorsobj=t}on(e,t){let o=!1;switch(e){case"loaded":this.loaded=t,o=!0;break;case"ready":this.onready=t,o=!0;break;case"error":this.onerror=t,o=!0;break;case"click":this.onclick=t,o=!0}return o}constructor(e,t,o){a(this,"version","2.0.7t"),a(this,"iframe",null),a(this,"componentloaded",!1),a(this,"readyfordata",!1),a(this,"domain","*"),a(this,"rtdata",{data:{type:"tags",tags:[]}}),a(this,"npts",{}),a(this,"vals",{}),a(this,"qualifs",{}),a(this,"descriptions",{}),a(this,"npt",0),a(this,"svgobj",null),a(this,"zoomobj",null),a(this,"moveobj",null),a(this,"enabletoolsobj",null),a(this,"enablekeyboardobj",null),a(this,"enableflashobj",null),a(this,"hidewatermarkobj",null),a(this,"setcolorobj",[]),a(this,"setcolorsobj",null),a(this,"resetobj",null),a(this,"tagsList",""),a(this,"onready",null),a(this,"onerror",null),a(this,"onclick",null),a(this,"loadingSVG",0),a(this,"updateHandle",0),a(this,"resolveFunction",null),a(this,"rejectFunction",null),a(this,"container",null),a(this,"apikey",null),a(this,"iframeparams",null),a(this,"svgurl",null),a(this,"colorsTable",null),a(this,"enablemouseobj",null),a(this,"mousewheelobj",null),a(this,"loaded",null),a(this,"aux",!1),a(this,"panelContainerResizeObserver",void 0);const s=this;let n,i,l=' scrolling="no" ';"object"==typeof e?(this.container=e.container||"",this.apikey=e.apikey||"",this.iframeparams=e.iframeparams||'frameborder="0" height="250" width="250"',this.svgurl=e.svgurl||"",this.colorsTable=e.colorsTable||null):(this.container=e||"",this.apikey="",this.iframeparams=t||'frameborder="0" height="250" width="250"',this.svgurl=o||"",this.colorsTable=null),this.iframe=null,this.componentloaded=!1,this.readyfordata=!1,this.domain="*",this.rtdata={data:{type:"tags",tags:[]}},this.npts={},this.vals={},this.qualifs={},this.descriptions={},this.npt=0,this.svgobj=null,this.zoomobj=null,this.moveobj=null,this.enabletoolsobj=null,this.enablekeyboardobj=null,this.enableflashobj=null,this.hidewatermarkobj=null,this.setcolorobj=[],this.setcolorsobj=null,this.resetobj=null,this.tagsList="",this.onready=null,this.onerror=null,this.onclick=null,this.loadingSVG=0,this.updateHandle=0,this.resolveFunction=null,this.rejectFunction=null,n=this.guidGenerator(),"string"==typeof this.container&&(0===this.container.trim().length?this.container=document.body:(this.container=document.getElementById(this.container),null===this.container&&(this.container=document.body))),this.iframeparams.indexOf("scrolling")>=0&&(l=""),i='',void 0!==this.container.innerHTML?this.container.appendChild(this.createElementFromHTML(i)):this.container.insertAdjacentHTML("afterend",i),this.iframe=document.getElementById(n),this.componentloaded=!1,this.readyfordata=!1,this.colorsTable&&this.setColors(this.colorsTable),""!==this.svgurl&&this.loadURL(this.svgurl),window.addEventListener("message",(function(e){if(e.source===s.iframe.contentWindow){if("object"==typeof e.data&&void 0!==e.data.data.type&&"updated"===e.data.data.type&&e.data.data.handle===s.updateHandle)return e.data.data.error?s.rejectFunction&&s.rejectFunction(new Error(e.data.data.error)):s.resolveFunction&&s.resolveFunction(),s.resolveFunction=null,void(s.rejectFunction=null);if("object"==typeof e.data&&void 0!==e.data.data.type&&"loaded"===e.data.data.type){if(s.componentloaded=!0,s.setcolorobj.length>0){for(let t=0;t0&&s.clientHeight>0){const o=t.getIframe();o&&(o.width=""+(s.clientWidth-5),o.height=""+(s.clientHeight-5)),e.autoResize?t.zoomTo(e.zoomLevel*(s.clientWidth{var o;t.enableMouse(e.enableMousePan,e.enableMouseWheelZoom),t.enableTools(e.showZoomPan,e.showZoomPan),t.zoomToOriginal(),t.moveBy(-e.moveByX,-e.moveByY);const s=null===(o=n.parentElement)||void 0===o?void 0:o.parentElement;s&&(t.panelContainerResizeObserver=new ResizeObserver((o=>{for(const a of o)a.contentRect&&d(e,t)})),t.panelContainerResizeObserver.observe(s)),s&&s.clientWidth>0&&s.clientHeight>0?(n.width=""+(s.clientWidth-5),n.height=""+(s.clientHeight-5),e.autoResize?t.zoomTo(e.zoomLevel*(s.clientWidtho().createElement(h.FileUpload,{accept:".svg",onFileUpload:t=>{var o,a;const s=t.target;if((null===(o=s)||void 0===o?void 0:o.files)&&(null===(a=s)||void 0===a?void 0:a.files.length)>0){var n;const t=null===(n=s)||void 0===n?void 0:n.files[0];if("image/svg+xml"===t.type){const o=new FileReader;o.onload=function(){e(o.result)},o.readAsDataURL(t)}}}},"Upload SVG file"),m=new e.PanelPlugin((({options:e,data:a,width:n,height:i,onOptionsChange:h})=>{var c;const m=(0,t.useMemo)((()=>({})),[]);let p=0;for(let e=0;e{if(!(v in l)||!document.getElementById(l[v].container.id)){const t=new s({container:r[v].svId,iframeparams:`frameborder="0" height="${i}" width="${n}"`,svgurl:e.svgUrl});l[v]=t,r[v].lastOptions=Object.assign(e),t&&t.on("ready",(()=>{var o,a;t.enableMouse(e.enableMousePan,e.enableMouseWheelZoom),t.enableTools(e.showZoomPan,e.showZoomPan),t.moveBy(-e.moveByX,-e.moveByY);const s=null===(a=t.getIframe())||void 0===a||null===(o=a.parentElement)||void 0===o?void 0:o.parentElement;s&&s.clientWidth>0&&s.clientHeight>0&&(t.panelContainerResizeObserver=new ResizeObserver((o=>{for(const a of o)a.contentRect&&d(e,t)})),t.panelContainerResizeObserver.observe(s),e.autoResize?t.zoomTo(e.zoomLevel*(s.clientWidthe.addTextInput({path:"svgUrl",name:"SVG URL",description:"Enter SVG URL",defaultValue:"https://raw.githubusercontent.com/riclolsen/displayfiles/master/helloworld.svg"}).addCustomEditor({id:"svgFileId",path:"svgUrl",name:"Upload local SVG file",editor:c,defaultValue:"https://raw.githubusercontent.com/riclolsen/displayfiles/master/helloworld.svg"}).addSliderInput({path:"zoomLevel",name:"SVG zoom level",description:"Enter value <1 to shrink SVG view or >1 to grow it",defaultValue:1,settings:{min:.1,max:3,step:.1}}).addSliderInput({path:"moveByX",name:"Horizontal offset",description:"Enter value <0 to move left or >0 to move right",defaultValue:0,settings:{min:-1e3,max:1e3,step:1}}).addSliderInput({path:"moveByY",name:"Vertical offset",description:"Enter value <0 to move up or >0 to move down",defaultValue:0,settings:{min:-1e3,max:1e3,step:1}}).addBooleanSwitch({path:"autoResize",name:"Auto resize",description:"Bind SVG view size to panel size",defaultValue:!1}).addBooleanSwitch({path:"showZoomPan",name:"Show zoom/pan tool",description:"Toolbar over SVG top-left corner with zoom/pan buttons",defaultValue:!1}).addBooleanSwitch({path:"enableMousePan",name:"Enable mouse pan",description:"Pan the SVG view with mouse drag",defaultValue:!1}).addBooleanSwitch({path:"enableMouseWheelZoom",name:"Enable mouse wheel zoom",description:"Zoom the SVG view with mouse wheel roll",defaultValue:!1})))})(),i})())); -//# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map deleted file mode 100644 index eda3208..0000000 --- a/dist/module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"module.js","mappings":"2FAAAA,EAAOC,QAAUC,C,UCAjBF,EAAOC,QAAUE,C,UCAjBH,EAAOC,QAAUG,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaP,QAGrB,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,CAAC,GAOX,OAHAS,EAAoBH,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,OACf,CCrBAK,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACb,EAASe,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEjB,EAASgB,IAC5EE,OAAOC,eAAenB,EAASgB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAK3B,IACH,oBAAX4B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAenB,EAAS4B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAenB,EAAS,aAAc,CAAE8B,OAAO,GAAO,E,iFCmB7D,kB,sGAUM,MAAMC,EAgDXC,aAAAA,GACE,MAAMC,EAAK,WACT,OAA+B,OAArB,EAAIC,KAAKC,UAAuB,GAAGC,SAAS,IAAIC,UAAU,EACtE,EACA,OAAOJ,IAAOA,IAAO,IAAMA,IAAO,IAAMA,IAAO,IAAMA,IAAO,IAAMA,IAAOA,IAAOA,GAClF,CASAK,qBAAAA,CAAuBC,GACrB,MAAMC,EAAMC,SAASC,cAAc,OAEnC,OADAF,EAAIG,UAAYJ,EAAWK,OACpBJ,EAAIK,UACb,CAQAC,OAAAA,CAASC,GAIP,GAHAC,KAAKC,OAAS,KACdD,KAAKE,cAAe,EACpBF,KAAKD,OAASA,EACM,KAAhBC,KAAKD,QAAqC,IAApBC,KAAKG,WAAkB,CAC/CH,KAAKG,WAAa,EAClB,MAAMC,EAAM,IAAIC,eAChBD,EAAIE,KAAK,MAAON,KAAKD,QACrB,IAAIQ,EAAQP,KACZI,EAAII,OAAS,W,IAOPD,EAAAA,EANe,MAAfH,EAAIK,SAEJF,EAAMJ,WAAa,EAEjBI,EAAMG,gBAEI,QAAZH,EAAAA,EAAMI,cAANJ,IAAAA,GAA2B,QAA3BA,EAAAA,EAAcK,qBAAdL,IAAAA,GAAAA,EAA6BM,YAAYT,EAAIU,aAAcP,EAAMQ,QAIjER,EAAMN,OAASG,EAAIU,aAGzB,EACAV,EAAIY,mBAAqB,SAAUC,GACV,IAAnBb,EAAIc,aACa,MAAfd,EAAIK,SAENF,EAAMJ,WAAa,EACfH,KAAKmB,QACPZ,EAAMY,QAAQf,EAAIgB,YAElBC,QAAQC,KAAK,2CAA6ClB,EAAIgB,aAItE,EACAhB,EAAImB,MACN,CACF,CAOAC,SAAAA,GACExB,KAAKyB,IAAM,EACXzB,KAAK0B,KAAO,CAAC,EACb1B,KAAK2B,KAAO,CAAC,EACb3B,KAAK4B,QAAU,CAAC,EAChB5B,KAAK6B,aAAe,CAAC,EAErB,MAAMvD,EAAM,CAAEwD,KAAM,CAAEC,KAAM,cACxB/B,KAAKE,aACP8B,OAAOnB,YAAYvC,EAAK0B,KAAKe,QAE7Bf,KAAKiC,SAAW3D,CAEpB,CASA4D,cAAAA,CAAgBC,GACd,IAAI5B,EAAQP,KACZ,OAAO,IAAIoC,SAAQ,SAAUC,EAASC,GAC/B/B,EAAML,aAIPK,EAAMgC,gBACRD,EAAO,IAAIE,MAAM,8BAGnBjC,EAAMgC,gBAAkBF,EACxB9B,EAAMkC,eAAiBH,EACvB/B,EAAMmC,aAAaP,IATjBG,EAAO,IAAIE,MAAM,uBAUrB,GACF,CASAE,YAAAA,CAAcP,G,IA0CZ,IAzCA,IAAKnC,KAAKE,aACR,OAAO,KAET,IAAIK,EAAQP,KACU,iBAAXmC,GAAkC,OAAXA,GAChCjE,OAAOyE,KAAKR,GAAQS,KAAI,SAAUC,EAAKC,GACrC,IAAIpF,EACAmF,KAAOtC,EAAMmB,KACfhE,EAAI6C,EAAMmB,KAAKmB,IAEfnF,IAAM6C,EAAMkB,IACZlB,EAAMmB,KAAKmB,GAAOnF,GAEpB6C,EAAMoB,KAAKkB,GAAOV,EAAOU,GACzBtC,EAAMqB,QAAQiB,GAAO,CACvB,IAGF,MAAME,EAAc,CAClBjB,KAAM,CAAEC,KAAM,OAAQiB,KAAM,GAAIC,SAAUjD,KAAKkD,eAuBjD,OArBAhF,OAAOyE,KAAK3C,KAAK0B,MAAMkB,KAAI,SAAUC,EAAKC,GACxCC,EAAOjB,KAAKkB,KAAKF,GAAS,CAAC,EAC3BC,EAAOjB,KAAKkB,KAAKF,GAAOK,KAAON,EAC/BE,EAAOjB,KAAKkB,KAAKF,GAAOhE,MAAQyB,EAAMoB,KAAKkB,GAC3CE,EAAOjB,KAAKkB,KAAKF,GAAOM,UAAiC,IAArB7C,EAAMqB,QAAQiB,IACnB,iBAApBtC,EAAMoB,KAAKkB,GACpBE,EAAOjB,KAAKkB,KAAKF,GAAOf,KAAO,QACK,kBAApBxB,EAAMoB,KAAKkB,GAC3BE,EAAOjB,KAAKkB,KAAKF,GAAOf,KAAO,OAE/BgB,EAAOjB,KAAKkB,KAAKF,GAAOf,KAAO,SAEjCgB,EAAOjB,KAAKkB,KAAKF,GAAOO,WAAa,CACnCC,MAAO,CACLC,cAAehD,EAAMmB,KAAKmB,GAC1BW,QAA0C,MAAX,IAArBjD,EAAMqB,QAAQiB,IACxBY,KAAMlD,EAAMsB,aAAagB,IAG/B,IACW,QAAX,EAAA7C,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYkC,EAAQ/C,KAAKe,QAC9CgC,EAAOE,MAChB,CAeAS,QAAAA,CAAUb,EAAa/D,EAAe6E,EAAkBC,EAAmBC,GACzE,GAAY,KAARhB,SAAcA,EAChB,OAAO7C,KAAKE,aAEd,IAAIxC,EAaJ,GAZAiG,EAASA,IAAU,EACnBC,EAAUA,IAAW,EACrBC,EAAcA,GAAehB,EACzBA,KAAO7C,KAAK0B,KACdhE,EAAIsC,KAAK0B,KAAKmB,IAEdnF,IAAMsC,KAAKyB,IACXzB,KAAK0B,KAAKmB,GAAOnF,GAEnBsC,KAAK2B,KAAKkB,GAAO/D,EACjBkB,KAAK4B,QAAQiB,IAAQc,EAAS,IAAO,IAASC,EAAU,IAAQ,GAChE5D,KAAK6B,aAAagB,GAAOgB,EACrB7D,KAAKE,aAAc,C,IAsBrB,IArBA,MAAM6C,EAAc,CAClBjB,KAAM,CAAEC,KAAM,OAAQiB,KAAM,GAAIC,SAAUjD,KAAKkD,eAEjDH,EAAOjB,KAAKkB,KAAK,GAAK,CAAC,EACvBD,EAAOjB,KAAKkB,KAAK,GAAGG,KAAON,EAC3BE,EAAOjB,KAAKkB,KAAK,GAAGlE,MAAQA,EAC5BiE,EAAOjB,KAAKkB,KAAK,GAAGI,UAAgC,IAApBpD,KAAK4B,QAAQiB,IAE3CE,EAAOjB,KAAKkB,KAAK,GAAGjB,KADD,iBAAVjD,EACkB,QACD,kBAAVA,EACW,OAEA,SAE7BiE,EAAOjB,KAAKkB,KAAK,GAAGK,WAAa,CAC/BC,MAAO,CACLC,cAAe7F,EACf8F,QAAyC,MAAX,IAApBxD,KAAK4B,QAAQiB,IACvBY,KAAMzD,KAAK6B,aAAagB,KAGjB,QAAX,EAAA7C,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYkC,EAAQ/C,KAAKe,OACvD,CACA,OAAOf,KAAKE,YACd,CAaA4D,UAAAA,CAAYjB,EAAa/D,EAAe6E,EAAkBC,EAAmBC,GAC3E,GAAY,KAARhB,SAAcA,EAChB,OAAO7C,KAAKE,aAEd,IAAIxC,EAaJ,OAZAiG,EAASA,IAAU,EACnBC,EAAUA,IAAW,EACrBC,EAAcA,GAAehB,EACzBA,KAAO7C,KAAK0B,KACdhE,EAAIsC,KAAK0B,KAAKmB,IAEdnF,IAAMsC,KAAKyB,IACXzB,KAAK0B,KAAKmB,GAAOnF,GAEnBsC,KAAK2B,KAAKkB,GAAO/D,EACjBkB,KAAK4B,QAAQiB,IAAQc,EAAS,IAAO,IAASC,EAAU,IAAQ,GAChE5D,KAAK6B,aAAagB,GAAOgB,EAClB7D,KAAKE,YACd,CASA6D,QAAAA,CAAUlB,GACR,OAAIA,KAAO7C,KAAK2B,KACP3B,KAAK2B,KAAKkB,GAEZ,IACT,CAQAmB,SAAAA,GACE,OAAOhE,KAAKiE,MACd,CAQAC,UAAAA,GACE,OAAOlE,KAAKmE,OACd,CAQAC,SAAAA,GACE,OAAOpE,KAAKW,MACd,CAQA0D,iBAAAA,GACE,OAA6B,IAAzBrE,KAAKU,gBACA,GACwB,IAAtBV,KAAKE,aACP,EAEF,CACT,CAQAoE,mBAAAA,GACE,OAAOtE,KAAKmE,OACd,CAQAI,WAAAA,GACE,OAAOvE,KAAKwE,QACd,CAUAC,MAAAA,CAAQC,EAAYC,EAAaC,GAI/B,MAAMtG,EAAM,CAAEwD,KAAM,CAAEC,KAAM,SAAU2C,GAHtCA,EAAKA,GAAM,EAGmCC,GAF9CA,EAAKA,GAAM,EAE2CC,QADtDA,EAAUA,IAAW,I,IAGnB,IADE5E,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAK6E,QAAUvG,CAEnB,CAUAwG,MAAAA,CAAQC,EAAmBC,EAAcJ,GAGvC,MAAMtG,EAAM,CACVwD,KAAM,CACJC,KAAM,SACNgD,UALJA,EAAYA,GAAa,IAMrBC,OAAQA,EACRJ,QANJA,EAAUA,IAAW,I,IAUnB,IADE5E,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAKiF,QAAU3G,CAEnB,CAQA4G,cAAAA,CAAgBN,GAEd,MAAMtG,EAAM,CAAEwD,KAAM,CAAEC,KAAM,iBAAkB6C,QAD9CA,EAAUA,IAAW,I,IAGnB,IADE5E,KAAKE,eACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAEtD,CASAoE,WAAAA,CAAaC,EAAsBC,SACP,IAAfD,GAA8BA,KACvCA,GAAa,QAEY,IAAhBC,IACTA,GAAc,GAEhB,MAAM/G,EAAM,CACVwD,KAAM,CACJC,KAAM,cACNqD,WAAYA,EACZC,YAAaA,I,IAIf,IADErF,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAKsF,eAAiBhH,CAE1B,CASAiH,WAAAA,CAAaH,EAAsBC,SACP,IAAfD,GAA8BA,KACvCA,GAAa,SAEY,IAAhBC,GAA+BA,KACxCA,GAAc,GAEhB,MAAM/G,EAAM,CACVwD,KAAM,CACJC,KAAM,cACNqD,WAAYA,EACZC,YAAaA,I,IAIf,IADErF,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAKwF,eAAiBlH,CAE1B,CASAmH,aAAAA,CAAeC,EAA4BC,SACT,IAArBD,GAAoCA,KAC7CA,GAAmB,SAEgB,IAA1BC,GAAyCA,KAClDA,GAAwB,GAE1B,MAAMrH,EAAM,CACVwD,KAAM,CACJC,KAAM,gBACN2D,iBAAkBA,EAClBC,sBAAuBA,I,IAIzB,IADE3F,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAK4F,cAAgBtH,CAEzB,CAQAuH,cAAAA,CAAgBC,SACY,IAAfA,GAA8BA,KACvCA,GAAa,GAEf,MAAMxH,EAAM,CAAEwD,KAAM,CAAEC,KAAM,iBAAkB+D,WAAYA,I,IAExD,IADE9F,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAK+F,kBAAoBzH,CAE7B,CAQA0H,gBAAAA,CAAkBC,SACiB,IAAtBA,GAAqCA,KAC9CA,GAAoB,GAEtB,MAAM3H,EAAM,CACVwD,KAAM,CAAEC,KAAM,mBAAoBkE,kBAAmBA,I,IAGrD,IADEjG,KAAKU,gBACI,QAAX,EAAAV,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAKkG,eAAiB5H,CAE1B,CAOA6H,aAAAA,GACE,MAAM7H,EAAM,CAAEwD,KAAM,CAAEC,KAAM,kB,IAE1B,IADE/B,KAAKE,aACI,QAAX,EAAAF,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAKoG,iBAAmB9H,CAE5B,CASA+H,QAAAA,CAAUC,EAAqBC,GAC7B,MAAMjI,EAAM,CACVwD,KAAM,CACJC,KAAM,WACNuE,YAAaA,EACbC,UAAWA,I,IAIb,IADEvG,KAAKU,gBACI,QAAX,EAAAV,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAKwG,YAAYC,KAAKnI,EAE1B,CAQAoI,SAAAA,CAAWC,GACT,MAAMrI,EAAM,CACVwD,KAAM,CACJC,KAAM,YACN4E,YAAaA,I,IAIf,IADE3G,KAAKU,gBACI,QAAX,EAAAV,KAAKW,cAAL,OAA0B,QAA1B,IAAaC,qBAAb,SAA4BC,YAAYvC,EAAK0B,KAAKe,QAElDf,KAAK4G,aAAetI,CAExB,CAUAuI,EAAAA,CAAIC,EAAeC,GACjB,IAAIC,GAAM,EACV,OAAQF,GACN,IAAK,SACH9G,KAAKiH,OAASF,EACdC,GAAM,EACN,MACF,IAAK,QACHhH,KAAKkH,QAAUH,EACfC,GAAM,EACN,MACF,IAAK,QACHhH,KAAKmB,QAAU4F,EACfC,GAAM,EACN,MACF,IAAK,QACHhH,KAAKmH,QAAUJ,EACfC,GAAM,EAMV,OAAOA,CACT,CAWAI,WAAAA,CAAaC,EAA4BC,EAAuBvH,GAnpBhEoE,EAAAA,KAAAA,UAAU,UACVxD,EAAAA,KAAAA,SAAmC,MACnCD,EAAAA,KAAAA,mBAAkB,GAClBR,EAAAA,KAAAA,gBAAe,GACfa,EAAAA,KAAAA,SAAS,KACTgC,EAAAA,KAAAA,SAAc,CAAEjB,KAAM,CAAEC,KAAM,OAAQiB,KAAM,MAC5CtB,EAAAA,KAAAA,OAAY,CAAC,GACbC,EAAAA,KAAAA,OAAY,CAAC,GACbC,EAAAA,KAAAA,UAAe,CAAC,GAChBC,EAAAA,KAAAA,eAAoB,CAAC,GACrBJ,EAAAA,KAAAA,MAAM,GACNxB,EAAAA,KAAAA,SAAc,MACdgF,EAAAA,KAAAA,UAAe,MACfJ,EAAAA,KAAAA,UAAe,MACfS,EAAAA,KAAAA,iBAAsB,MACtBS,EAAAA,KAAAA,oBAAyB,MACzBG,EAAAA,KAAAA,iBAAsB,MACtBE,EAAAA,KAAAA,mBAAwB,MACxBI,EAAAA,KAAAA,cAAmB,IACnBI,EAAAA,KAAAA,eAAoB,MACpB3E,EAAAA,KAAAA,WAAgB,MAChBuC,EAAAA,KAAAA,WAAW,IACX0C,EAAAA,KAAAA,UAAe,MACf/F,EAAAA,KAAAA,UAAe,MACfgG,EAAAA,KAAAA,UAAe,MACfhH,EAAAA,KAAAA,aAAa,GACb+C,EAAAA,KAAAA,eAAe,GACfX,EAAAA,KAAAA,kBAAuB,MACvBE,EAAAA,KAAAA,iBAAsB,MACtB4E,EAAAA,KAAAA,YAAoD,MACpDpD,EAAAA,KAAAA,SAAc,MACdqD,EAAAA,KAAAA,eAAoB,MACpBvH,EAAAA,KAAAA,SAAc,MACd4G,EAAAA,KAAAA,cAAmB,MACnBnB,EAAAA,KAAAA,iBAAsB,MACtBI,EAAAA,KAAAA,gBAAqB,MACrBqB,EAAAA,KAAAA,SAAc,MACdM,EAAAA,KAAAA,OAAM,GACNC,EAAAA,KAAAA,oCAAAA,GA8mBE,MAAMjH,EAAaP,KACnB,IAAIyH,EACAC,EACAC,EAAY,mBAES,iBAAdN,GACTrH,KAAKqH,UAAYA,EAAUA,WAAa,GACxCrH,KAAKiE,OAASoD,EAAUpD,QAAU,GAClCjE,KAAKsH,aAAeD,EAAUC,cAAgB,2CAC9CtH,KAAKD,OAASsH,EAAUtH,QAAU,GAClCC,KAAK2G,YAAcU,EAAUV,aAAe,OAE5C3G,KAAKqH,UAAYA,GAAa,GAC9BrH,KAAKiE,OAAS,GACdjE,KAAKsH,aAAeA,GAAgB,2CACpCtH,KAAKD,OAASA,GAAU,GACxBC,KAAK2G,YAAc,MAGrB3G,KAAKW,OAAS,KACdX,KAAKU,iBAAkB,EACvBV,KAAKE,cAAe,EACpBF,KAAKe,OAAS,IACdf,KAAK+C,OAAS,CAAEjB,KAAM,CAAEC,KAAM,OAAQiB,KAAM,KAC5ChD,KAAK0B,KAAO,CAAC,EACb1B,KAAK2B,KAAO,CAAC,EACb3B,KAAK4B,QAAU,CAAC,EAChB5B,KAAK6B,aAAe,CAAC,EACrB7B,KAAKyB,IAAM,EACXzB,KAAKC,OAAS,KACdD,KAAKiF,QAAU,KACfjF,KAAK6E,QAAU,KACf7E,KAAKsF,eAAiB,KACtBtF,KAAK+F,kBAAoB,KACzB/F,KAAKkG,eAAiB,KACtBlG,KAAKoG,iBAAmB,KACxBpG,KAAKwG,YAAc,GACnBxG,KAAK4G,aAAe,KACpB5G,KAAKiC,SAAW,KAChBjC,KAAKwE,SAAW,GAChBxE,KAAKkH,QAAU,KACflH,KAAKmB,QAAU,KACfnB,KAAKmH,QAAU,KACfnH,KAAKG,WAAa,EAClBH,KAAKkD,aAAe,EACpBlD,KAAKuC,gBAAkB,KACvBvC,KAAKyC,eAAiB,KAEtBgF,EAAKzH,KAAKhB,gBAEoB,iBAAnBgB,KAAKqH,YACuB,IAAjCrH,KAAKqH,UAAUzH,OAAOgI,OACxB5H,KAAKqH,UAAY5H,SAASoI,MAE1B7H,KAAKqH,UAAY5H,SAASqI,eAAe9H,KAAKqH,WACvB,OAAnBrH,KAAKqH,YACPrH,KAAKqH,UAAY5H,SAASoI,QAiB5B7H,KAAKsH,aAAaS,QAAQ,cAAgB,IAC5CJ,EAAY,IAGdD,EACE,eACAD,EACA,2FACAzH,KAAKsH,aACLK,EACA,uFAC+BnK,IAA7BwC,KAAKqH,UAAU1H,UAChBK,KAAKqH,UAA6BW,YAAYhI,KAAKV,sBAAsBoI,IAEzE1H,KAAKqH,UAA6BY,mBAAmB,WAAYP,GAGpE1H,KAAKW,OAASlB,SAASqI,eAAeL,GAEtCzH,KAAKU,iBAAkB,EACvBV,KAAKE,cAAe,EAEhBF,KAAK2G,aACP3G,KAAK0G,UAAU1G,KAAK2G,aAEF,KAAhB3G,KAAKD,QACPC,KAAKF,QAAQE,KAAKD,QAGpBiC,OAAOkG,iBAAiB,WAAW,SAAUpB,GAI3C,GACEA,EAAMqB,SAAW5H,EAAMI,OAAOC,cAE9B,CAEA,GACwB,iBAAfkG,EAAMhF,WACYtE,IAAzBsJ,EAAMhF,KAAKA,KAAKC,MACS,YAAzB+E,EAAMhF,KAAKA,KAAKC,MAChB+E,EAAMhF,KAAKA,KAAKmB,SAAW1C,EAAM2C,aAWjC,OATI4D,EAAMhF,KAAKA,KAAKsG,MACd7H,EAAMkC,gBACRlC,EAAMkC,eAAe,IAAID,MAAMsE,EAAMhF,KAAKA,KAAKsG,QAExC7H,EAAMgC,iBACfhC,EAAMgC,kBAERhC,EAAMgC,gBAAkB,UACxBhC,EAAMkC,eAAiB,MAKzB,GAA0B,iBAAfqE,EAAMhF,WAA8CtE,IAAzBsJ,EAAMhF,KAAKA,KAAKC,MAA+C,WAAzB+E,EAAMhF,KAAKA,KAAKC,KAAmB,CAE7G,GADAxB,EAAMG,iBAAkB,EACpBH,EAAMiG,YAAYoB,OAAS,EAAG,CAChC,IAAK,IAAIS,EAAI,EAAGA,EAAI9H,EAAMiG,YAAYoB,OAAQS,IAC5CvB,EAAMqB,OAAOtH,YAAYN,EAAMiG,YAAY6B,GAAIvB,EAAMwB,QAEvD/H,EAAMiG,YAAc,EACtB,CAgBA,OAf2B,OAAvBjG,EAAMqG,eACRE,EAAMqB,OAAOtH,YAAYN,EAAMqG,aAAcE,EAAMwB,QACnD/H,EAAMqG,aAAe,MAEM,OAAzBrG,EAAM2F,iBACRY,EAAMqB,OAAOtH,YAAYN,EAAM2F,eAAgBY,EAAMwB,QACrD/H,EAAM2F,eAAiB,WAEJ,OAAjB3F,EAAMN,OACR6G,EAAMqB,OAAOtH,YAAYN,EAAMN,OAAQ6G,EAAMwB,QAGrB,KAAjB/H,EAAMR,QACbQ,EAAMT,QAAQS,EAAMR,QAGxB,CAGA,GAA0B,iBAAf+G,EAAMhF,WAA8CtE,IAAzBsJ,EAAMhF,KAAKA,KAAKC,MAA+C,UAAzB+E,EAAMhF,KAAKA,KAAKC,KAyC1F,OAxCAxB,EAAML,cAAe,EACrBK,EAAMiE,SAAWsC,EAAMhF,KAAKA,KAAKyG,WAAW/D,SACxCjE,EAAMwC,OAAOjB,KAAKkB,KAAK4E,QACzBrH,EAAMmC,eAEJnC,EAAM0E,UACR6B,EAAMqB,OAAOtH,YAAYN,EAAM0E,QAAS6B,EAAMwB,QAC9C/H,EAAM0E,QAAU,MAEd1E,EAAMsE,UACRiC,EAAMqB,OAAOtH,YAAYN,EAAMsE,QAASiC,EAAMwB,QAC9C/H,EAAMsE,QAAU,MAEdtE,EAAM+E,iBACRwB,EAAMqB,OAAOtH,YAAYN,EAAM+E,eAAgBwB,EAAMwB,QACrD/H,EAAM+E,eAAiB,MAErB/E,EAAMiF,iBACRsB,EAAMqB,OAAOtH,YAAYN,EAAMiF,eAAgBsB,EAAMwB,QACrD/H,EAAMiF,eAAiB,MAErBjF,EAAMqF,gBACRkB,EAAMqB,OAAOtH,YAAYN,EAAMqF,cAAekB,EAAMwB,QACpD/H,EAAMqF,cAAgB,MAEpBrF,EAAMwF,oBACRe,EAAMqB,OAAOtH,YAAYN,EAAMwF,kBAAmBe,EAAMwB,QACxD/H,EAAMwF,kBAAoB,MAExBxF,EAAM6F,mBACRU,EAAMqB,OAAOtH,YAAYN,EAAM6F,iBAAkBU,EAAMwB,QACvD/H,EAAM6F,iBAAmB,MAEvB7F,EAAM0B,WACR6E,EAAMqB,OAAOtH,YAAYN,EAAM0B,SAAU6E,EAAMwB,QAC/C/H,EAAM0B,SAAW,WAEf1B,EAAM2G,SACR3G,EAAM2G,WAMV,GAA0B,iBAAfJ,EAAMhF,WAA8CtE,IAAzBsJ,EAAMhF,KAAKA,KAAKC,MAA+C,UAAzB+E,EAAMhF,KAAKA,KAAKC,KAI1F,YAHIxB,EAAM4G,SACR5G,EAAM4G,QAAQL,EAAMhF,KAAKA,KAAKyG,WAAWzB,MAAOA,EAAMhF,KAAKA,KAAKyG,WAAW1F,KAIjF,CACF,GAGF,ECn4BF,MAAM2F,EAAiC,GACjCC,EAAsB,GAU5B,SAASC,EAAUC,EAA+BC,G,IAGrCA,EAAAA,EAFXA,EAAQ1D,iBACR0D,EAAQnE,QAAQkE,EAAQE,SAAUF,EAAQG,SAC1C,MAAMC,EAAsB,QAAjBH,EAAAA,EAAQxE,mBAARwE,IAAAA,GAAkC,QAAlCA,EAAAA,EAAqBI,qBAArBJ,IAAAA,OAAAA,EAAAA,EAAoCI,cAC/C,GAAID,GAAMA,EAAGE,YAAc,GAAKF,EAAGG,aAAe,EAAG,CACnD,MAAMvI,EAASiI,EAAQxE,YACnBzD,IACFA,EAAOwI,MAAQ,IAAMJ,EAAGE,YAAc,GACtCtI,EAAOyI,OAAS,IAAML,EAAGG,aAAe,IAEtCP,EAAQU,WACVT,EAAQ9D,OACN6D,EAAQ5D,WAAagE,EAAGE,YAAcF,EAAGG,aAAeH,EAAGE,YAAc,IAAMF,EAAGG,aAAe,MAGnGN,EAAQ9D,OAAO6D,EAAQ5D,UAE3B,MACE6D,EAAQ9D,OAAO6D,EAAQ5D,UAE3B,CAGA,SAASuE,EACPX,EACAC,EACAW,EACAC,GAEA,MAAMC,EAAOhK,SAASiK,iBAAiB,QAAUjB,EAAQc,GAAQI,KAAO,MAClEhJ,EAASiI,EAAQxE,YACvB,IAAK,IAAIiE,EAAI,EAAG1H,GAAU0H,EAAIoB,EAAK7B,OAAQS,IACrCoB,EAAKpB,GAAGxI,aAAec,IACzB8I,EAAKpB,GAAGL,YAAYrH,GACpBiI,EAAQ/B,GAAG,SAAS,K,IAKPlG,EAJXiI,EAAQrD,YAAYoD,EAAQiB,eAAgBjB,EAAQkB,sBACpDjB,EAAQzD,YAAYwD,EAAQmB,YAAanB,EAAQmB,aACjDlB,EAAQ1D,iBACR0D,EAAQnE,QAAQkE,EAAQE,SAAUF,EAAQG,SAC1C,MAAMC,EAAyB,QAApBpI,EAAAA,EAAOqI,qBAAPrI,IAAAA,OAAAA,EAAAA,EAAsBqI,cAC7BD,IACFH,EAAQpB,6BAA+B,IAAIuC,gBAAgBC,IACzD,IAAK,MAAMC,KAASD,EACdC,EAAMC,aACRxB,EAAUC,EAASC,EAEvB,IAEFA,EAAQpB,6BAA6B2C,QAAQpB,IAE3CA,GAAMA,EAAGE,YAAc,GAAKF,EAAGG,aAAe,GAChDvI,EAAOwI,MAAQ,IAAMJ,EAAGE,YAAc,GACtCtI,EAAOyI,OAAS,IAAML,EAAGG,aAAe,GACpCP,EAAQU,WACVT,EAAQ9D,OACN6D,EAAQ5D,WAAagE,EAAGE,YAAcF,EAAGG,aAAeH,EAAGE,YAAc,IAAMF,EAAGG,aAAe,MAGnGN,EAAQ9D,OAAO6D,EAAQ5D,YAGzB6D,EAAQ9D,OAAO6D,EAAQ5D,WAEzB6D,EAAQlG,aAAa8G,EAAU,KAMjCY,KAAKC,UAAU5B,EAAQc,GAAQe,eAAiBF,KAAKC,UAAU1B,KACjED,EAAUC,EAASH,EAAOe,IAC1Bd,EAAQc,GAAQe,YAAcpM,OAAOqM,OAAO5B,IAE9CC,EAAQlG,aAAa8G,EACvB,C,aC1FO,MAAMgB,EAAY,EAAIC,cAEzB,kBAACC,EAAAA,WAAUA,CACTC,OAAO,OACPC,aAAe9D,I,IAET+D,EAAcA,EADlB,MAAMA,EAAW/D,EAAM9B,OACvB,IAAI6F,QAAAA,EAAAA,SAAAA,IAAAA,OAAAA,EAAAA,EAAKC,SAASD,QAAAA,EAAAA,SAAAA,IAAAA,OAAAA,EAAAA,EAAKC,MAAMlD,QAAO,EAAE,C,IACvBiD,EAAb,MAAME,EAAOF,QAAAA,EAAAA,SAAAA,IAAAA,OAAAA,EAAAA,EAAKC,MAAM,GACxB,GAAkB,kBAAdC,EAAKhJ,KAA0B,CACjC,MAAMiJ,EAAS,IAAIC,WACnBD,EAAOxK,OAAS,WACfiK,EAASO,EAAOE,OACjB,EACAF,EAAOG,cAAcJ,EACtB,CACH,IAEH,mBCfQK,EAAS,IAAIC,EAAAA,aF0F+C,EACvE1C,UACA7G,OACAqH,QACAC,SACAkC,sB,IA6BexJ,EA1Bf,MAAM0H,GAAY+B,EAAAA,EAAAA,UAAQ,KACjB,CAAC,IACP,IACH,IAAIC,EAAkB,EACtB,IAAK,IAAInD,EAAI,EAAGA,EAAIvG,EAAK2J,OAAO7D,OAAQS,IAAK,CAC3C,MAAMqD,EAAI5J,EAAK2J,OAAOpD,GACtB,IAAK,IAAIsD,EAAI,EAAGA,EAAID,EAAEE,OAAOhE,OAAQ+D,IAAK,CACxC,MAAME,EAAIH,EAAEE,OAAOD,GACnB,GAAe,WAAXE,EAAE9J,MAAyC,IAApB8J,EAAE1J,OAAOyF,SAGpC4D,IACAhC,EAAU,IAAMgC,GAAmBK,EAAE1J,OAAO0J,EAAE1J,OAAOyF,OAAS,GAC1DiE,EAAEC,MAAM,CACV,MAAM3J,EAAS0J,EAAE1J,OACbA,EAAO4J,QACTvC,EAAU,IAAMgC,GAAmBrJ,EAAO4J,OAAO5J,EAAO4J,OAAOnE,OAAS,GACxE4B,EAAUqC,EAAEC,MAAQ3J,EAAO4J,OAAO5J,EAAO4J,OAAOnE,OAAS,KAEzD4B,EAAU,IAAMgC,GAAmBrJ,EAAO0J,EAAE1J,OAAOyF,OAAS,GAC5D4B,EAAUqC,EAAEC,MAAQD,EAAE1J,OAAOA,EAAOyF,OAAS,GAEjD,CACF,CACF,CAEA,MAAM2B,GAAqB,QAAZzH,EAAAA,EAAKkK,eAALlK,IAAAA,OAAAA,EAAAA,EAAcmK,WAAY,EACnCC,IAAc3C,KAAUf,KAAY/I,SAASqI,eAAeU,EAAOe,GAAQlC,UAAUI,IAC3F,GAAIyE,EAAW,C,IAsBGpK,EAAAA,EApBhB,IAAIwI,EAAoC,CACtC6B,OAAQ,GACRpH,WAAY,EACZ8D,SAAU,OACVC,SAAU,OACVO,YAAY,EACZS,aAAa,EACbF,gBAAgB,EAChBC,sBAAsB,G,IAIe/H,EAAAA,EAFnCyH,KAAUd,IACZ6B,EAAc7B,EAAQc,GAAQe,YAC1B7B,EAAQc,GAAQ6C,gBAAiBtK,QAAAA,EAAAA,SAAAA,IAAAA,GAAa,QAAbA,EAAAA,EAAMkK,eAANlK,IAAAA,OAAAA,EAAAA,EAAesK,gBAClDzD,EAAQwD,OAAS7B,EAAY6B,SAGjC,MAAMxC,EAAO,YAAc0C,OAAOC,aAClC7D,EAAQc,GAAU,CAChBI,KAAMA,EACN4C,YAAaC,IAAAA,cAAoB,MAAO,CAAE/E,GAAIkC,IAC9CyC,aAActK,QAAAA,EAAAA,SAAAA,IAAAA,GAAa,QAAbA,EAAAA,EAAMkK,eAANlK,IAAAA,OAAAA,EAAAA,EAAesK,aAC7B9B,YAAaA,EAEjB,CAEA,IAAK4B,GAAavD,EAAQwD,SAAW1D,EAAQc,GAAQe,YAAY6B,OAAQ,CAEvE,MAAMvD,EAAUJ,EAAOe,GACvBD,EAAaX,EAASC,EAASW,EAAQC,EACzC,CAEA,IAAK0C,GAECvD,EAAQwD,SAAW1D,EAAQc,GAAQe,YAAY6B,OAAQ,C,IACzD3D,EAAwB,QAAxBA,EAAAA,EAAOe,GAAQnF,mBAAfoE,IAAAA,GAAAA,EAA4BiE,SAC5B,MAAM7D,EAAU,IAAI8D,EAAqB,CACvCrF,UAAWoB,EAAQc,GAAQI,KAC3BrC,aAAc,2BAA2B8B,aAAkBD,KAC3DpJ,OAAQ4I,EAAQwD,SAElB,GAAIvD,EAAS,CACXJ,EAAOe,GAAUX,EACjB,MAAMjI,EAASiI,EAAQxE,Y,IAErB3E,EADEkB,IACiD,QAAnDlB,EAAAA,SAASqI,eAAeU,EAAOe,GAAQlC,UAAUI,WAAjDhI,IAAAA,GAAAA,EAAsDuI,YAAYrH,GAEtE,CACA8H,EAAQc,GAAQe,YAAcpM,OAAOqM,OAAO5B,GAC5CW,EAAaX,EAASC,EAASW,EAAQC,EACzC,CA2CF,OAxCAmD,EAAAA,EAAAA,YAAU,KAGR,KAAMpD,KAAUf,KAAY/I,SAASqI,eAAeU,EAAOe,GAAQlC,UAAUI,IAAK,CAChF,MAAMmB,EAAU,IAAI8D,EAAqB,CACvCrF,UAAWoB,EAAQc,GAAQI,KAC3BrC,aAAc,2BAA2B8B,aAAkBD,KAC3DpJ,OAAQ4I,EAAQwD,SAElB3D,EAAOe,GAAUX,EACjBH,EAAQc,GAAQe,YAAcpM,OAAOqM,OAAO5B,GACxCC,GACFA,EAAQ/B,GAAG,SAAS,K,IAIP+B,EAAAA,EAHXA,EAAQrD,YAAYoD,EAAQiB,eAAgBjB,EAAQkB,sBACpDjB,EAAQzD,YAAYwD,EAAQmB,YAAanB,EAAQmB,aACjDlB,EAAQnE,QAAQkE,EAAQE,SAAUF,EAAQG,SAC1C,MAAMC,EAAsB,QAAjBH,EAAAA,EAAQxE,mBAARwE,IAAAA,GAAkC,QAAlCA,EAAAA,EAAqBI,qBAArBJ,IAAAA,OAAAA,EAAAA,EAAoCI,cAC3CD,GAAMA,EAAGE,YAAc,GAAKF,EAAGG,aAAe,IAChDN,EAAQpB,6BAA+B,IAAIuC,gBAAgBC,IACzD,IAAK,MAAMC,KAASD,EACdC,EAAMC,aACRxB,EAAUC,EAASC,EAEvB,IAEFA,EAAQpB,6BAA6B2C,QAAQpB,GACzCJ,EAAQU,WACVT,EAAQ9D,OACN6D,EAAQ5D,WAAagE,EAAGE,YAAcF,EAAGG,aAAeH,EAAGE,YAAc,IAAMF,EAAGG,aAAe,MAGnGN,EAAQ9D,OAAO6D,EAAQ5D,YAG3B6D,EAAQlG,aAAa8G,EAAU,GAGrC,IACC,CAACb,EAASa,EAAWD,EAAQH,EAAQD,IAEjCV,EAAQc,GAAQgD,WAAW,IE5NuCK,iBAAgBC,GAClFA,EACJC,aAAa,CACZ3J,KAAM,SACN2I,KAAM,UACNjI,YAAa,gBACbkJ,aAAc,mFAEfC,gBAAgB,CACfvF,GAAI,YACJtE,KAAM,SACN2I,KAAM,wBACNmB,OAAQzC,EACRuC,aAAc,mFAEfG,eAAe,CACd/J,KAAM,YACN2I,KAAM,iBACNjI,YAAa,qDACbkJ,aAAc,EACdI,SAAU,CACRC,IAAK,GACLC,IAAK,EACLC,KAAM,MAGTJ,eAAe,CACd/J,KAAM,UACN2I,KAAM,oBACNjI,YAAa,kDACbkJ,aAAc,EACdI,SAAU,CACRC,KAAM,IACNC,IAAK,IACLC,KAAM,KAGTJ,eAAe,CACd/J,KAAM,UACN2I,KAAM,kBACNjI,YAAa,+CACbkJ,aAAc,EACdI,SAAU,CACRC,KAAM,IACNC,IAAK,IACLC,KAAM,KAGTC,iBAAiB,CAChBpK,KAAM,aACN2I,KAAM,cACNjI,YAAa,mCACbkJ,cAAc,IAEfQ,iBAAiB,CAChBpK,KAAM,cACN2I,KAAM,qBACNjI,YAAa,yDACbkJ,cAAc,IAEfQ,iBAAiB,CAChBpK,KAAM,iBACN2I,KAAM,mBACNjI,YAAa,mCACbkJ,cAAc,IAEfQ,iBAAiB,CAChBpK,KAAM,uBACN2I,KAAM,0BACNjI,YAAa,0CACbkJ,cAAc,K","sources":["webpack:///external amd \"@grafana/data\"","webpack:///external amd \"@grafana/ui\"","webpack:///external amd \"react\"","webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///./synoptic/index.ts","webpack:///./ScadavisPanel.tsx","webpack:///./SvgFilePicker.tsx","webpack:///./module.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__305__;","module.exports = __WEBPACK_EXTERNAL_MODULE__388__;","module.exports = __WEBPACK_EXTERNAL_MODULE__650__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/*\r\n *\r\n * SCADAvis.io Synoptic API © 2018-2023 Ricardo L. Olsen / DSC Systems ALL RIGHTS RESERVED.\r\n *\r\n * This program is free software: you can redistribute it and/or modify\r\n * it under the terms of the GNU General Public License as published by\r\n * the Free Software Foundation, version 3.\r\n *\r\n * This program is distributed in the hope that it will be useful, but\r\n * WITHOUT ANY WARRANTY; without even the implied warranty of\r\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\n * General Public License for more details.\r\n *\r\n * You should have received a copy of the GNU General Public License\r\n * along with this program. If not, see .\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\r\n */\r\n\r\nexport type SvArgs = {\r\n container: HTMLDivElement | string;\r\n apikey: string;\r\n iframeparams: string | null;\r\n svgurl: string | null;\r\n colorsTable: Record;\r\n};\r\n\r\nexport class ScadaVis {\r\n version = '2.0.7t';\r\n iframe: HTMLIFrameElement | null = null;\r\n componentloaded = false;\r\n readyfordata = false;\r\n domain = '*';\r\n rtdata: any = { data: { type: 'tags', tags: [] } };\r\n npts: any = {};\r\n vals: any = {};\r\n qualifs: any = {};\r\n descriptions: any = {};\r\n npt = 0;\r\n svgobj: any = null;\r\n zoomobj: any = null;\r\n moveobj: any = null;\r\n enabletoolsobj: any = null;\r\n enablekeyboardobj: any = null;\r\n enableflashobj: any = null;\r\n hidewatermarkobj: any = null;\r\n setcolorobj: any = [];\r\n setcolorsobj: any = null;\r\n resetobj: any = null;\r\n tagsList = '';\r\n onready: any = null;\r\n onerror: any = null;\r\n onclick: any = null;\r\n loadingSVG = 0;\r\n updateHandle = 0;\r\n resolveFunction: any = null;\r\n rejectFunction: any = null;\r\n container: HTMLDivElement | string | Object | any = null;\r\n apikey: any = null;\r\n iframeparams: any = null;\r\n svgurl: any = null;\r\n colorsTable: any = null;\r\n enablemouseobj: any = null;\r\n mousewheelobj: any = null;\r\n loaded: any = null;\r\n aux = false;\r\n panelContainerResizeObserver: any;\r\n\r\n /**\r\n * Generate an unique DOM element ID.\r\n * @private\r\n * @method guidGenerator\r\n * @memberof scadavis\r\n * @returns {string} DOM ID.\r\n */\r\n guidGenerator (): string {\r\n const S4 = function () {\r\n return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n };\r\n return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4();\r\n }\r\n\r\n /**\r\n * Create a DOM element from HTML.\r\n * @private\r\n * @method createElementFromHTML\r\n * @memberof scadavis\r\n * @returns {string} DOM ID.\r\n */\r\n createElementFromHTML (htmlString: string): ChildNode | null {\r\n const div = document.createElement('div');\r\n div.innerHTML = htmlString.trim();\r\n return div.firstChild;\r\n }\r\n\r\n /**\r\n * Load the SVG synoptic display file from a SVG URL.\r\n * @method loadURL\r\n * @memberof scadavis\r\n * @param {string} svgurl - The SVG URL.\r\n */\r\n loadURL (svgurl: string) {\r\n this.svgobj = null;\r\n this.readyfordata = false;\r\n this.svgurl = svgurl;\r\n if (this.svgurl !== '' && this.loadingSVG === 0) {\r\n this.loadingSVG = 1;\r\n const xhr = new XMLHttpRequest();\r\n xhr.open('GET', this.svgurl); // here you point to the SVG synoptic display file\r\n let _this = this;\r\n xhr.onload = function () {\r\n if (xhr.status === 200) {\r\n {\r\n _this.loadingSVG = 0;\r\n }\r\n if (_this.componentloaded) {\r\n // SCADAvis component already loaded?\r\n _this.iframe?.contentWindow?.postMessage(xhr.responseText, _this.domain);\r\n }\r\n // send the SVG file contents to the component\r\n else {\r\n _this.svgobj = xhr.responseText;\r\n } // buffers the result for later use (this can save some time)\r\n }\r\n };\r\n xhr.onreadystatechange = function (oEvent) {\r\n if (xhr.readyState === 4) {\r\n if (xhr.status === 200) {\r\n } else {\r\n _this.loadingSVG = 0;\r\n if (this.onerror) {\r\n _this.onerror(xhr.statusText);\r\n } else {\r\n console.warn('SCADAvis.io API: error loading SVG URL. ' + xhr.statusText);\r\n }\r\n }\r\n }\r\n };\r\n xhr.send();\r\n }\r\n }\r\n\r\n /**\r\n * Reset all data values and tags.\r\n * @method resetData\r\n * @memberof scadavis\r\n */\r\n resetData () {\r\n this.npt = 0;\r\n this.npts = {};\r\n this.vals = {};\r\n this.qualifs = {};\r\n this.descriptions = {};\r\n\r\n const obj = { data: { type: 'resetData' } };\r\n if (this.readyfordata) {\r\n window.postMessage(obj, this.domain);\r\n } else {\r\n this.resetobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Update values for tags to the component. Send all tags available. Work as a promise. Only available for version 2+.\r\n * @method refreshDisplay\r\n * @memberof scadavis\r\n * @param {Object.} [values] - values in a object like { \"tag1\" : 1.0, \"tag2\": 1.2, \"tag3\": true }.\r\n * @returns {Object} Returns a promise. The promise resolves after the display refresh is completed.\r\n */\r\n refreshDisplay (values?: Record) {\r\n let _this = this;\r\n return new Promise(function (resolve, reject) {\r\n if (!_this.readyfordata) {\r\n reject(new Error('Not ready for data!'));\r\n return;\r\n }\r\n if (_this.resolveFunction) {\r\n reject(new Error('Ongoing display refresh!'));\r\n return;\r\n }\r\n _this.resolveFunction = resolve;\r\n _this.rejectFunction = reject;\r\n _this.updateValues(values);\r\n });\r\n }\r\n\r\n /**\r\n * Update values for tags to the component. Send all tags available. (use refreshDisplay when promise-based method preferred)\r\n * @method updateValues\r\n * @memberof scadavis\r\n * @param {Object.} [values] - values in a object like { \"tag1\" : 1.0, \"tag2\": 1.2, \"tag3\": true }.\r\n * @returns {number} Returns request handle or null if not ready.\r\n */\r\n updateValues (values?: Record) {\r\n if (!this.readyfordata) {\r\n return null;\r\n }\r\n let _this = this;\r\n if (typeof values === 'object' && values !== null) {\r\n Object.keys(values).map(function (tag, index) {\r\n let n;\r\n if (tag in _this.npts) {\r\n n = _this.npts[tag];\r\n } else {\r\n n = ++_this.npt;\r\n _this.npts[tag] = n;\r\n }\r\n _this.vals[tag] = values[tag];\r\n _this.qualifs[tag] = 0x00;\r\n });\r\n }\r\n\r\n const rtdata: any = {\r\n data: { type: 'tags', tags: [], handle: ++this.updateHandle },\r\n };\r\n Object.keys(this.npts).map(function (tag, index) {\r\n rtdata.data.tags[index] = {};\r\n rtdata.data.tags[index].path = tag;\r\n rtdata.data.tags[index].value = _this.vals[tag];\r\n rtdata.data.tags[index].quality = !(_this.qualifs[tag] & 0x80);\r\n if (typeof _this.vals[tag] === 'number') {\r\n rtdata.data.tags[index].type = 'float';\r\n } else if (typeof _this.vals[tag] === 'boolean') {\r\n rtdata.data.tags[index].type = 'bool';\r\n } else {\r\n rtdata.data.tags[index].type = 'string';\r\n }\r\n rtdata.data.tags[index].parameters = {\r\n Value: {\r\n TagClientItem: _this.npts[tag],\r\n Alarmed: (_this.qualifs[tag] & 0x100) === 0x100,\r\n Desc: _this.descriptions[tag],\r\n },\r\n };\r\n });\r\n this.iframe?.contentWindow?.postMessage(rtdata, this.domain);\r\n return rtdata.handle;\r\n }\r\n\r\n /**\r\n * Set a value for a tag. The component will be updated immediately if the component is ready for data.\r\n * Notice that updating the component at too many times per second can cause performance problems.\r\n * Preferably update many values using storeValue() then call updateValues() once (repeat after a second or more).\r\n * @method setValue\r\n * @memberof scadavis\r\n * @param {string} tag - Tag name.\r\n * @param {number} value - Value for the tag.\r\n * @param {bool} [failed=false] - True if value is bad or old, false or absent if value is good.\r\n * @param {bool} [alarmed=false] - True if value is alarmed, false or absent if value is normal.\r\n * @param {string} [description=tag] - Description.\r\n * @returns {bool} Returns true if the component was updated (true) or the value was buffered (false).\r\n */\r\n setValue (tag: string, value: number, failed?: boolean, alarmed?: boolean, description?: string) {\r\n if (tag === '' || tag === undefined || tag === null) {\r\n return this.readyfordata;\r\n }\r\n let n;\r\n failed = failed || false;\r\n alarmed = alarmed || false;\r\n description = description || tag;\r\n if (tag in this.npts) {\r\n n = this.npts[tag];\r\n } else {\r\n n = ++this.npt;\r\n this.npts[tag] = n;\r\n }\r\n this.vals[tag] = value;\r\n this.qualifs[tag] = (failed ? 0x80 : 0x00) | (alarmed ? 0x100 : 0x00);\r\n this.descriptions[tag] = description;\r\n if (this.readyfordata) {\r\n const rtdata: any = {\r\n data: { type: 'tags', tags: [], handle: ++this.updateHandle },\r\n };\r\n rtdata.data.tags[0] = {};\r\n rtdata.data.tags[0].path = tag;\r\n rtdata.data.tags[0].value = value;\r\n rtdata.data.tags[0].quality = !(this.qualifs[tag] & 0x80);\r\n if (typeof value === 'number') {\r\n rtdata.data.tags[0].type = 'float';\r\n } else if (typeof value === 'boolean') {\r\n rtdata.data.tags[0].type = 'bool';\r\n } else {\r\n rtdata.data.tags[0].type = 'string';\r\n }\r\n rtdata.data.tags[0].parameters = {\r\n Value: {\r\n TagClientItem: n,\r\n Alarmed: (this.qualifs[tag] & 0x100) === 0x100,\r\n Desc: this.descriptions[tag],\r\n },\r\n };\r\n this.iframe?.contentWindow?.postMessage(rtdata, this.domain);\r\n }\r\n return this.readyfordata;\r\n }\r\n\r\n /**\r\n * Store a value for a tag. The component will not be updated until called updateValues().\r\n * @method storeValue\r\n * @memberof scadavis\r\n * @param {string} tag - Tag name.\r\n * @param {number} value - Value for the tag.\r\n * @param {bool} [failed=false] - True if value is bad or old, false or absent if value is good.\r\n * @param {bool} [alarmed=false] - True if value is alarmed, false or absent if value is normal.\r\n * @param {string} [description=tag] - Description.\r\n * @returns {bool} - Returns true if the component is ready for data, false if not.\r\n */\r\n storeValue (tag: string, value: number, failed?: boolean, alarmed?: boolean, description?: string) {\r\n if (tag === '' || tag === undefined || tag === null) {\r\n return this.readyfordata;\r\n }\r\n let n;\r\n failed = failed || false;\r\n alarmed = alarmed || false;\r\n description = description || tag;\r\n if (tag in this.npts) {\r\n n = this.npts[tag];\r\n } else {\r\n n = ++this.npt;\r\n this.npts[tag] = n;\r\n }\r\n this.vals[tag] = value;\r\n this.qualifs[tag] = (failed ? 0x80 : 0x00) | (alarmed ? 0x100 : 0x00);\r\n this.descriptions[tag] = description;\r\n return this.readyfordata;\r\n }\r\n\r\n /**\r\n * Get a value for a tag.\r\n * @method getValue\r\n * @memberof scadavis\r\n * @param {Object} tag - Tag name.\r\n * @returns {number} Returns the value for the tag or null if not found.\r\n */\r\n getValue (tag: string): number | null {\r\n if (tag in this.vals) {\r\n return this.vals[tag];\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Recover the API Key.\r\n * @method getApiKey\r\n * @memberof scadavis\r\n * @returns {string} API Key.\r\n */\r\n getApiKey (): string {\r\n return this.apikey;\r\n }\r\n\r\n /**\r\n * Get SCADAvis.io API Version.\r\n * @method getVersion\r\n * @memberof scadavis\r\n * @returns {string} SCADAvis.io API Version.\r\n */\r\n getVersion (): string {\r\n return this.version;\r\n }\r\n\r\n /**\r\n * Get the DOM element of the iframe.\r\n * @method getIframe\r\n * @memberof scadavis\r\n * @returns {Object} DOM element reference.\r\n */\r\n getIframe (): HTMLIFrameElement | null {\r\n return this.iframe;\r\n }\r\n\r\n /**\r\n * Get the current state of the component.\r\n * @method getComponentState\r\n * @memberof scadavis\r\n * @returns {number} 0=not loaded, 1=loaded and ready for graphics, 2=SVG graphics processed and ready for data.\r\n */\r\n getComponentState (): number {\r\n if (this.componentloaded === false) {\r\n return 0;\r\n } else if (this.readyfordata === false) {\r\n return 1;\r\n }\r\n return 2;\r\n }\r\n\r\n /**\r\n * Get SCADAvis.io Component Version.\r\n * @method getComponentVersion\r\n * @memberof scadavis\r\n * @returns {string} SCADAvis.io Component Version.\r\n */\r\n getComponentVersion (): string {\r\n return this.version;\r\n }\r\n\r\n /**\r\n * Get tags list from the loaded SVG graphics.\r\n * @method getTagsList\r\n * @memberof scadavis\r\n * @returns {string} Tags list.\r\n */\r\n getTagsList (): string {\r\n return this.tagsList;\r\n }\r\n\r\n /**\r\n * Move the graphic. Multiple calls have cumulative effect.\r\n * @method moveBy\r\n * @memberof scadavis\r\n * @param {number} [dx=0] Horizontal distance.\r\n * @param {number} [dy=0] Vertical distance.\r\n * @param {boolean} [animate=false] Animate or not.\r\n */\r\n moveBy (dx: number, dy?: number, animate?: any) {\r\n dx = dx || 0;\r\n dy = dy || 0;\r\n animate = animate || false;\r\n const obj = { data: { type: 'moveBy', dx: dx, dy: dy, animate: animate } };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.moveobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Apply zoom level. Multiple calls have cumulative effect.\r\n * @method zoomTo\r\n * @memberof scadavis\r\n * @param {number} [zoomLevel=1.1] Zoom level. >1 zoom in, <1 zoom out.\r\n * @param {string|{x: number, y: number}} [target={x:0,y:0}] Id of object to zoom in/out or x/y coordinates.\r\n * @param {boolean} [animate=false] Animate or not.\r\n */\r\n zoomTo (zoomLevel: number, target?: any, animate?: boolean) {\r\n zoomLevel = zoomLevel || 1.1;\r\n animate = animate || false;\r\n const obj = {\r\n data: {\r\n type: 'zoomTo',\r\n zoomLevel: zoomLevel,\r\n target: target,\r\n animate: animate,\r\n },\r\n };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.zoomobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Apply default zoom level/position.\r\n * @method zoomToOriginal\r\n * @memberof scadavis\r\n * @param {boolean} [animate=false] Animate or not.\r\n */\r\n zoomToOriginal (animate?: boolean) {\r\n animate = animate || false;\r\n const obj = { data: { type: 'zoomToOriginal', animate: animate } };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n }\r\n }\r\n\r\n /**\r\n * Enable or disable pan and zoom tools.\r\n * @method enableTools\r\n * @memberof scadavis\r\n * @param {boolean} [panEnabled=true] Enable/disable Pan tool.\r\n * @param {boolean} [zoomEnabled=false] Enable/disable Zoom tool.\r\n */\r\n enableTools (panEnabled?: boolean, zoomEnabled?: boolean) {\r\n if (typeof panEnabled === 'undefined' || panEnabled) {\r\n panEnabled = true;\r\n }\r\n if (typeof zoomEnabled === 'undefined') {\r\n zoomEnabled = false;\r\n }\r\n const obj = {\r\n data: {\r\n type: 'enableTools',\r\n panEnabled: panEnabled,\r\n zoomEnabled: zoomEnabled,\r\n },\r\n };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.enabletoolsobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Enable or disable pan and zoom via mouse.\r\n * @method enableMouse\r\n * @memberof scadavis\r\n * @param {boolean} [panEnabled=true] Enable/disable pan via mouse.\r\n * @param {boolean} [zoomEnabled=true] Enable/disable zoom via mouse.\r\n */\r\n enableMouse (panEnabled?: boolean, zoomEnabled?: boolean) {\r\n if (typeof panEnabled === 'undefined' || panEnabled) {\r\n panEnabled = true;\r\n }\r\n if (typeof zoomEnabled === 'undefined' || zoomEnabled) {\r\n zoomEnabled = true;\r\n }\r\n const obj = {\r\n data: {\r\n type: 'enableMouse',\r\n panEnabled: panEnabled,\r\n zoomEnabled: zoomEnabled,\r\n },\r\n };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.enablemouseobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Set direction of zoom bound to mouse wheel, and event propagation.\r\n * @method setMouseWheel\r\n * @memberof scadavis\r\n * @param {boolean} [directionBackOut=true] true=back/out, false=back/in.\r\n * @param {boolean} [blockEventPropagation=true] Enable/disable wheel event propagation.\r\n */\r\n setMouseWheel (directionBackOut?: boolean, blockEventPropagation?: boolean) {\r\n if (typeof directionBackOut === 'undefined' || directionBackOut) {\r\n directionBackOut = true;\r\n }\r\n if (typeof blockEventPropagation === 'undefined' || blockEventPropagation) {\r\n blockEventPropagation = true;\r\n }\r\n const obj = {\r\n data: {\r\n type: 'setMouseWheel',\r\n directionBackOut: directionBackOut,\r\n blockEventPropagation: blockEventPropagation,\r\n },\r\n };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.mousewheelobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Enable or disable keyboard functions (zoom & pan).\r\n * @method enableKeyboard\r\n * @memberof scadavis\r\n * @param {boolean} [keyEnabled=true] Enable/disable Pan tool.\r\n */\r\n enableKeyboard (keyEnabled?: boolean) {\r\n if (typeof keyEnabled === 'undefined' || keyEnabled) {\r\n keyEnabled = true;\r\n }\r\n const obj = { data: { type: 'enableKeyboard', keyEnabled: keyEnabled } };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.enablekeyboardobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Enable or disable alarm flash (objects blinking when alarmed).\r\n * @method enableAlarmFlash\r\n * @memberof scadavis\r\n * @param {boolean} [alarmFlashEnabled=true] Enable/disable global alarm flash.\r\n */\r\n enableAlarmFlash (alarmFlashEnabled?: boolean) {\r\n if (typeof alarmFlashEnabled === 'undefined' || alarmFlashEnabled) {\r\n alarmFlashEnabled = true;\r\n }\r\n const obj = {\r\n data: { type: 'enableAlarmFlash', alarmFlashEnabled: alarmFlashEnabled },\r\n };\r\n if (this.componentloaded) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.enableflashobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Hides the watermark.\r\n * @method hideWatermark\r\n * @memberof scadavis\r\n */\r\n hideWatermark () {\r\n const obj = { data: { type: 'hideWatermark' } };\r\n if (this.readyfordata) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.hidewatermarkobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Set color code for color shortcuts.\r\n * @method setColor\r\n * @memberof scadavis\r\n * @param {number} [colorNumber] Color shortcut number.\r\n * @param {string} [colorCode] Color code.\r\n */\r\n setColor (colorNumber: number, colorCode: string) {\r\n const obj = {\r\n data: {\r\n type: 'setColor',\r\n colorNumber: colorNumber,\r\n colorCode: colorCode,\r\n },\r\n };\r\n if (this.componentloaded) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.setcolorobj.push(obj);\r\n }\r\n }\r\n\r\n /**\r\n * Set color codes for color shortcuts.\r\n * @method setColors\r\n * @memberof scadavis\r\n * @param {Object.} [colorsTable] Color shortcut number.\r\n */\r\n setColors (colorsTable: Record) {\r\n const obj = {\r\n data: {\r\n type: 'setColors',\r\n colorsTable: colorsTable,\r\n },\r\n };\r\n if (this.componentloaded) {\r\n this.iframe?.contentWindow?.postMessage(obj, this.domain);\r\n } else {\r\n this.setcolorsobj = obj;\r\n }\r\n }\r\n\r\n /**\r\n * Set event listeners.\r\n * @method on\r\n * @memberof scadavis\r\n * @param {string} event Event name, one of: \"ready\", \"click\" (the first parameter of callback is the element id).\r\n * @param {function} callback Callback function.\r\n * @returns True for valid event, false for invalid event name.\r\n */\r\n on (event: string, callback: Function): boolean {\r\n let ret = false;\r\n switch (event) {\r\n case 'loaded':\r\n this.loaded = callback;\r\n ret = true;\r\n break;\r\n case 'ready':\r\n this.onready = callback;\r\n ret = true;\r\n break;\r\n case 'error':\r\n this.onerror = callback;\r\n ret = true;\r\n break;\r\n case 'click':\r\n this.onclick = callback;\r\n ret = true;\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n /**\r\n * Must be created with the \"new\" keyword. (use scadavisInit when promise-based method preferred). E.g. var svgraph = new scadavis(\"div1\", \"\", \"https://svgurl.com/svgurl.svg\");\r\n * @class scadavis - SCADAvis.io synoptic API class.\r\n * @param {string} [container] - ID of the container object. If empty or null the iframe will be appended to the body.\r\n * @param {string} [iframeparams] - Parameter string for configuring iframe (excluding id and src and sandbox) e.g. 'frameborder=\"0\" height=\"250\" width=\"250\"'.\r\n * @param {string} [svgurl] - URL for the SVG file.\r\n * @param {{container: string|Object, iframeparams: string, svgurl: string, colorsTable: Object}} [paramsobj] - Alternatively parameters can be passed in an object.\r\n * Example usage: var svgraph = new scadavis(\"div1\", \"\", \"https://svgurl.com/svgurl.svg\");\r\n */\r\n constructor (container: SvArgs | string, iframeparams?: string, svgurl?: string) {\r\n const _this: any = this;\r\n let id;\r\n let iframehtm;\r\n let scrolling = ' scrolling=\"no\" ';\r\n\r\n if (typeof container === 'object') {\r\n this.container = container.container || '';\r\n this.apikey = container.apikey || '';\r\n this.iframeparams = container.iframeparams || 'frameborder=\"0\" height=\"250\" width=\"250\"';\r\n this.svgurl = container.svgurl || '';\r\n this.colorsTable = container.colorsTable || null;\r\n } else {\r\n this.container = container || '';\r\n this.apikey = '';\r\n this.iframeparams = iframeparams || 'frameborder=\"0\" height=\"250\" width=\"250\"';\r\n this.svgurl = svgurl || '';\r\n this.colorsTable = null;\r\n }\r\n\r\n this.iframe = null;\r\n this.componentloaded = false;\r\n this.readyfordata = false;\r\n this.domain = '*';\r\n this.rtdata = { data: { type: 'tags', tags: [] } };\r\n this.npts = {};\r\n this.vals = {};\r\n this.qualifs = {};\r\n this.descriptions = {};\r\n this.npt = 0;\r\n this.svgobj = null;\r\n this.zoomobj = null;\r\n this.moveobj = null;\r\n this.enabletoolsobj = null;\r\n this.enablekeyboardobj = null;\r\n this.enableflashobj = null;\r\n this.hidewatermarkobj = null;\r\n this.setcolorobj = [];\r\n this.setcolorsobj = null;\r\n this.resetobj = null;\r\n this.tagsList = '';\r\n this.onready = null;\r\n this.onerror = null;\r\n this.onclick = null;\r\n this.loadingSVG = 0;\r\n this.updateHandle = 0;\r\n this.resolveFunction = null;\r\n this.rejectFunction = null;\r\n\r\n id = this.guidGenerator();\r\n\r\n if (typeof this.container === 'string') {\r\n if (this.container.trim().length === 0) {\r\n this.container = document.body;\r\n } else {\r\n this.container = document.getElementById(this.container);\r\n if (this.container === null) {\r\n this.container = document.body;\r\n }\r\n }\r\n }\r\n\r\n //// get library path\r\n //const scripts = document.getElementsByTagName('script');\r\n //let libPath = '.';\r\n //for (let i = 0; i < scripts.length; ++i) {\r\n // const pos = scripts[i].src.indexOf('synopticapi.js');\r\n // if (pos > 0) {\r\n // libPath = scripts[i].src.substring(0, pos - 1);\r\n // break;\r\n // }\r\n //}\r\n\r\n // default is scrolling='no'\r\n if (this.iframeparams.indexOf('scrolling') >= 0) {\r\n scrolling = '';\r\n }\r\n\r\n iframehtm =\r\n '`;\r\n if (this.container.innerHTML !== undefined) {\r\n (this.container as HTMLDivElement).appendChild(this.createElementFromHTML(iframehtm) as Node);\r\n } else {\r\n (this.container as HTMLDivElement).insertAdjacentHTML('afterend', iframehtm);\r\n }\r\n\r\n this.iframe = document.getElementById(id) as HTMLIFrameElement;\r\n\r\n this.componentloaded = false;\r\n this.readyfordata = false;\r\n\r\n if (this.colorsTable) {\r\n this.setColors(this.colorsTable);\r\n }\r\n if (this.svgurl !== '') {\r\n this.loadURL(this.svgurl);\r\n }\r\n\r\n window.addEventListener('message', function (event: any) {\r\n // receive messages, watch for messages from the SCADAvis.io component.\r\n\r\n // for better security: check the origin of the message ( must be from the SCADAvis.io domain and component iframe )\r\n if (\r\n event.source === _this.iframe.contentWindow\r\n // && event.origin === this.domain\r\n ) {\r\n // when message of type \"updated\", resolve promise\r\n if (\r\n typeof event.data === 'object' &&\r\n event.data.data.type !== undefined &&\r\n event.data.data.type === 'updated' &&\r\n event.data.data.handle === _this.updateHandle\r\n ) {\r\n if (event.data.data.error) {\r\n if (_this.rejectFunction) {\r\n _this.rejectFunction(new Error(event.data.data.error));\r\n }\r\n } else if (_this.resolveFunction) {\r\n _this.resolveFunction();\r\n }\r\n _this.resolveFunction = null;\r\n _this.rejectFunction = null;\r\n return;\r\n }\r\n\r\n // when message of type \"loaded\", get and send an SVG file to it\r\n if (typeof event.data === 'object' && event.data.data.type !== undefined && event.data.data.type === 'loaded') {\r\n _this.componentloaded = true;\r\n if (_this.setcolorobj.length > 0) {\r\n for (let i = 0; i < _this.setcolorobj.length; i++) {\r\n event.source.postMessage(_this.setcolorobj[i], event.origin);\r\n }\r\n _this.setcolorobj = [];\r\n }\r\n if (_this.setcolorsobj !== null) {\r\n event.source.postMessage(_this.setcolorsobj, event.origin);\r\n _this.setcolorsobj = null;\r\n }\r\n if (_this.enableflashobj !== null) {\r\n event.source.postMessage(_this.enableflashobj, event.origin);\r\n _this.enableflashobj = null;\r\n }\r\n if (_this.svgobj !== null) {\r\n event.source.postMessage(_this.svgobj, event.origin);\r\n }\r\n // send the SVG file contents to the component\r\n else if (_this.svgurl !== '') {\r\n _this.loadURL(_this.svgurl);\r\n }\r\n return;\r\n }\r\n\r\n // when message type \"ready\", the SVG screen is processed, then we can send real time data to the SCADAvis.io component\r\n if (typeof event.data === 'object' && event.data.data.type !== undefined && event.data.data.type === 'ready') {\r\n _this.readyfordata = true;\r\n _this.tagsList = event.data.data.attributes.tagsList;\r\n if (_this.rtdata.data.tags.length) {\r\n _this.updateValues();\r\n }\r\n if (_this.zoomobj) {\r\n event.source.postMessage(_this.zoomobj, event.origin);\r\n _this.zoomobj = null;\r\n }\r\n if (_this.moveobj) {\r\n event.source.postMessage(_this.moveobj, event.origin);\r\n _this.moveobj = null;\r\n }\r\n if (_this.enabletoolsobj) {\r\n event.source.postMessage(_this.enabletoolsobj, event.origin);\r\n _this.enabletoolsobj = null;\r\n }\r\n if (_this.enablemouseobj) {\r\n event.source.postMessage(_this.enablemouseobj, event.origin);\r\n _this.enablemouseobj = null;\r\n }\r\n if (_this.mousewheelobj) {\r\n event.source.postMessage(_this.mousewheelobj, event.origin);\r\n _this.mousewheelobj = null;\r\n }\r\n if (_this.enablekeyboardobj) {\r\n event.source.postMessage(_this.enablekeyboardobj, event.origin);\r\n _this.enablekeyboardobj = null;\r\n }\r\n if (_this.hidewatermarkobj) {\r\n event.source.postMessage(_this.hidewatermarkobj, event.origin);\r\n _this.hidewatermarkobj = null;\r\n }\r\n if (_this.resetobj) {\r\n event.source.postMessage(_this.resetobj, event.origin);\r\n _this.resetobj = null;\r\n }\r\n if (_this.onready) {\r\n _this.onready();\r\n }\r\n return;\r\n }\r\n\r\n // when message of type \"click\", emit the event callback\r\n if (typeof event.data === 'object' && event.data.data.type !== undefined && event.data.data.type === 'click') {\r\n if (_this.onclick) {\r\n _this.onclick(event.data.data.attributes.event, event.data.data.attributes.tag);\r\n }\r\n return;\r\n }\r\n }\r\n });\r\n\r\n // return this\r\n }\r\n\r\n /**\r\n * Initialization of the library via promise. Only available for version 2+.\r\n * @function scadavisInit\r\n * @global\r\n * @param {string} [container] - ID of the container object. If empty or null the iframe will be appended to the body.\r\n * @param {string} [iframeparams] - Parameter string for configuring iframe (excluding id and src and sandbox) e.g. 'frameborder=\"0\" height=\"250\" width=\"250\"'.\r\n * @param {string} [svgurl] - URL for the SVG file.\r\n * @param {{container: string|Object, iframeparams: string, svgurl: string, colorsTable: Object}} [paramsobj] - Alternatively parameters can be passed in an object.\r\n * @returns {Object} Returns a promise with the {@link scadavis} object as a parameter. The promise resolves after the svg file is preprocessed (if an SVG file was specified) or after the component is loaded.\r\n * Example usage: scadavisInit( {container: \"div1\", svgurl: \"file.svg\"} ).then(function (sv) { ... });\r\n */\r\n /* \r\nscadavisInit (container: any, iframeparams: string, svgurl: string) {\r\n let _this = this;\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n if (typeof container === 'object') {\r\n svgurl = svgurl || container.svgurl;\r\n delete container.svgurl;\r\n }\r\n const sv = _this.scadavis(container, iframeparams, '');\r\n if (!svgurl) {\r\n resolve(sv);\r\n return;\r\n }\r\n sv.on('error', function (errMsg: any) {\r\n reject(errMsg);\r\n });\r\n sv.on('ready', function () {\r\n resolve(sv);\r\n });\r\n sv.loadURL(svgurl);\r\n } catch (e) {\r\n reject(e);\r\n }\r\n });\r\n}\r\n*/\r\n}\r\n","// SCADAVis.io Synoptic Panel for Grafana\n// © 2023 Ricardo L. Olsen / DSC Systems\n\nimport { PanelProps } from '@grafana/data';\nimport React, { useEffect, useMemo } from 'react';\nimport { ScadavisPanelOptions } from 'types';\nimport * as synopticapi from './synoptic';\n\nconst svObjs: synopticapi.ScadaVis[] = [];\nconst svState: svStateT[] = [];\ntype tagValuesT = Record;\ntype svStateT = {\n svId: string;\n svReactElem: any;\n dashboardUID: string;\n lastOptions: ScadavisPanelOptions;\n};\n\n// apply zoom, etc. to the SVG view\nfunction doAdjusts(options: ScadavisPanelOptions, svgraph: synopticapi.ScadaVis) {\n svgraph.zoomToOriginal();\n svgraph.moveBy(-options.moveByX, -options.moveByY);\n const el = svgraph.getIframe()?.parentElement?.parentElement;\n if (el && el.clientWidth > 0 && el.clientHeight > 0) {\n const iframe = svgraph.getIframe();\n if (iframe) {\n iframe.width = '' + (el.clientWidth - 5);\n iframe.height = '' + (el.clientHeight - 5);\n }\n if (options.autoResize) {\n svgraph.zoomTo(\n options.zoomLevel * (el.clientWidth < el.clientHeight ? el.clientWidth / 250 : el.clientHeight / 250)\n );\n } else {\n svgraph.zoomTo(options.zoomLevel);\n }\n } else {\n svgraph.zoomTo(options.zoomLevel);\n }\n}\n\n// update for edit mode (will have 2 parent elements for the scadavis div)\nfunction updatePanels(\n options: ScadavisPanelOptions,\n svgraph: synopticapi.ScadaVis,\n objInd: number,\n tagValues: tagValuesT\n) {\n const elms = document.querySelectorAll(\"[id='\" + svState[objInd].svId + \"']\");\n const iframe = svgraph.getIframe();\n for (let i = 0; iframe && i < elms.length; i++) {\n if (elms[i].firstChild !== iframe) {\n elms[i].appendChild(iframe);\n svgraph.on('ready', () => {\n svgraph.enableMouse(options.enableMousePan, options.enableMouseWheelZoom);\n svgraph.enableTools(options.showZoomPan, options.showZoomPan);\n svgraph.zoomToOriginal();\n svgraph.moveBy(-options.moveByX, -options.moveByY);\n const el = iframe.parentElement?.parentElement;\n if (el) {\n svgraph.panelContainerResizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.contentRect) {\n doAdjusts(options, svgraph);\n }\n }\n });\n svgraph.panelContainerResizeObserver.observe(el);\n }\n if (el && el.clientWidth > 0 && el.clientHeight > 0) {\n iframe.width = '' + (el.clientWidth - 5);\n iframe.height = '' + (el.clientHeight - 5);\n if (options.autoResize) {\n svgraph.zoomTo(\n options.zoomLevel * (el.clientWidth < el.clientHeight ? el.clientWidth / 250 : el.clientHeight / 250)\n );\n } else {\n svgraph.zoomTo(options.zoomLevel);\n }\n } else {\n svgraph.zoomTo(options.zoomLevel);\n }\n svgraph.updateValues(tagValues);\n });\n }\n }\n\n // changed options, apply new zoom etc.\n if (JSON.stringify(svState[objInd].lastOptions) !== JSON.stringify(options)) {\n doAdjusts(options, svObjs[objInd]);\n svState[objInd].lastOptions = Object.assign(options);\n }\n svgraph.updateValues(tagValues);\n}\n\nexport const ScadavisPanel: React.FC> = ({\n options,\n data,\n width,\n height,\n onOptionsChange,\n}) => {\n // maps tag values\n const tagValues = useMemo((): tagValuesT => {\n return {};\n }, []);\n let cntMappedFields = 0;\n for (let i = 0; i < data.series.length; i++) {\n const s = data.series[i];\n for (let j = 0; j < s.fields.length; j++) {\n const f = s.fields[j];\n if (f.type !== 'number' || f.values.length === 0) {\n continue;\n }\n cntMappedFields++;\n tagValues['@' + cntMappedFields] = f.values[f.values.length - 1];\n if (f.name) {\n const values = f.values as any;\n if (values.buffer) {\n tagValues['@' + cntMappedFields] = values.buffer[values.buffer.length - 1];\n tagValues[f.name] = values.buffer[values.buffer.length - 1];\n } else {\n tagValues['@' + cntMappedFields] = values[f.values.length - 1];\n tagValues[f.name] = f.values[values.length - 1];\n }\n }\n }\n }\n\n const objInd = data.request?.panelId || -1;\n const firstExec = !(objInd in svObjs) || !document.getElementById(svObjs[objInd].container.id);\n if (firstExec) {\n // first execution: create object to save current state\n let lastOptions: ScadavisPanelOptions = {\n svgUrl: '',\n zoomLevel: -1,\n moveByX: -999999,\n moveByY: -999999,\n autoResize: false,\n showZoomPan: false,\n enableMousePan: false,\n enableMouseWheelZoom: false,\n };\n if (objInd in svState) {\n lastOptions = svState[objInd].lastOptions;\n if (svState[objInd].dashboardUID === data?.request?.dashboardUID) {\n options.svgUrl = lastOptions.svgUrl;\n }\n }\n const svId = 'scadavis_' + crypto.randomUUID();\n svState[objInd] = {\n svId: svId,\n svReactElem: React.createElement('div', { id: svId }),\n dashboardUID: data?.request?.dashboardUID as string,\n lastOptions: lastOptions,\n };\n }\n\n if (!firstExec && options.svgUrl === svState[objInd].lastOptions.svgUrl) {\n // check edit mode (will have 2 parent elements for the scadavis div)\n const svgraph = svObjs[objInd];\n updatePanels(options, svgraph, objInd, tagValues);\n }\n\n if (!firstExec) {\n // new SVG file (loaded as URL or from URL)?\n if (options.svgUrl !== svState[objInd].lastOptions.svgUrl) {\n svObjs[objInd].getIframe()?.remove();\n const svgraph = new synopticapi.ScadaVis({\n container: svState[objInd].svId,\n iframeparams: `frameborder=\"0\" height=\"${height}\" width=\"${width}\"`,\n svgurl: options.svgUrl,\n } as synopticapi.SvArgs);\n if (svgraph) {\n svObjs[objInd] = svgraph;\n const iframe = svgraph.getIframe();\n if (iframe) {\n document.getElementById(svObjs[objInd].container.id)?.appendChild(iframe);\n }\n }\n svState[objInd].lastOptions = Object.assign(options);\n updatePanels(options, svgraph, objInd, tagValues);\n }\n }\n\n useEffect(() => {\n // at first execution, after the react object created (id=svState[objInd].svId),\n // will create the scadavis object with the react object as the parent\n if (!(objInd in svObjs) || !document.getElementById(svObjs[objInd].container.id)) {\n const svgraph = new synopticapi.ScadaVis({\n container: svState[objInd].svId,\n iframeparams: `frameborder=\"0\" height=\"${height}\" width=\"${width}\"`,\n svgurl: options.svgUrl,\n } as synopticapi.SvArgs);\n svObjs[objInd] = svgraph;\n svState[objInd].lastOptions = Object.assign(options);\n if (svgraph) {\n svgraph.on('ready', () => {\n svgraph.enableMouse(options.enableMousePan, options.enableMouseWheelZoom);\n svgraph.enableTools(options.showZoomPan, options.showZoomPan);\n svgraph.moveBy(-options.moveByX, -options.moveByY);\n const el = svgraph.getIframe()?.parentElement?.parentElement;\n if (el && el.clientWidth > 0 && el.clientHeight > 0) {\n svgraph.panelContainerResizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n if (entry.contentRect) {\n doAdjusts(options, svgraph);\n }\n }\n });\n svgraph.panelContainerResizeObserver.observe(el);\n if (options.autoResize) {\n svgraph.zoomTo(\n options.zoomLevel * (el.clientWidth < el.clientHeight ? el.clientWidth / 250 : el.clientHeight / 250)\n );\n } else {\n svgraph.zoomTo(options.zoomLevel);\n }\n }\n svgraph.updateValues(tagValues);\n });\n }\n }\n }, [options, tagValues, objInd, height, width]);\n\n return svState[objInd].svReactElem;\n};\n","import React from 'react';\r\nimport { FileUpload } from '@grafana/ui';\r\n\r\nexport const UploadSVG = ( { onChange }: { onChange: (value: string) => any } ) => {\r\n return (\r\n {\r\n const tgt: any = event.target;\r\n if (tgt?.files && tgt?.files.length>0){\r\n const file = tgt?.files[0];\r\n if (file.type === \"image/svg+xml\") {\r\n const reader = new FileReader();\r\n reader.onload = function () {\r\n onChange(reader.result as string); \r\n }\r\n reader.readAsDataURL(file);\r\n } \r\n }\r\n }}\r\n >\r\n Upload SVG file\r\n \r\n );\r\n};\r\n","import { PanelPlugin } from '@grafana/data';\nimport { ScadavisPanel } from './ScadavisPanel';\nimport { ScadavisPanelOptions } from './types';\nimport { UploadSVG } from './SvgFilePicker';\n\nexport const plugin = new PanelPlugin(ScadavisPanel).setPanelOptions(builder => {\n return builder\n .addTextInput({\n path: 'svgUrl',\n name: 'SVG URL',\n description: 'Enter SVG URL',\n defaultValue: 'https://raw.githubusercontent.com/riclolsen/displayfiles/master/helloworld.svg',\n })\n .addCustomEditor({\n id: 'svgFileId',\n path: 'svgUrl',\n name: 'Upload local SVG file',\n editor: UploadSVG,\n defaultValue: 'https://raw.githubusercontent.com/riclolsen/displayfiles/master/helloworld.svg',\n })\n .addSliderInput({\n path: 'zoomLevel',\n name: 'SVG zoom level',\n description: 'Enter value <1 to shrink SVG view or >1 to grow it',\n defaultValue: 1,\n settings: {\n min: 0.1,\n max: 3,\n step: 0.1,\n },\n })\n .addSliderInput({\n path: 'moveByX',\n name: 'Horizontal offset',\n description: 'Enter value <0 to move left or >0 to move right',\n defaultValue: 0,\n settings: {\n min: -1000,\n max: 1000,\n step: 1,\n },\n })\n .addSliderInput({\n path: 'moveByY',\n name: 'Vertical offset',\n description: 'Enter value <0 to move up or >0 to move down',\n defaultValue: 0,\n settings: {\n min: -1000,\n max: 1000,\n step: 1,\n },\n })\n .addBooleanSwitch({\n path: 'autoResize',\n name: 'Auto resize',\n description: 'Bind SVG view size to panel size',\n defaultValue: false,\n })\n .addBooleanSwitch({\n path: 'showZoomPan',\n name: 'Show zoom/pan tool',\n description: 'Toolbar over SVG top-left corner with zoom/pan buttons',\n defaultValue: false,\n })\n .addBooleanSwitch({\n path: 'enableMousePan',\n name: 'Enable mouse pan',\n description: 'Pan the SVG view with mouse drag',\n defaultValue: false,\n })\n .addBooleanSwitch({\n path: 'enableMouseWheelZoom',\n name: 'Enable mouse wheel zoom',\n description: 'Zoom the SVG view with mouse wheel roll',\n defaultValue: false,\n });\n});\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__305__","__WEBPACK_EXTERNAL_MODULE__388__","__WEBPACK_EXTERNAL_MODULE__650__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","ScadaVis","guidGenerator","S4","Math","random","toString","substring","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","firstChild","loadURL","svgurl","this","svgobj","readyfordata","loadingSVG","xhr","XMLHttpRequest","open","_this","onload","status","componentloaded","iframe","contentWindow","postMessage","responseText","domain","onreadystatechange","oEvent","readyState","onerror","statusText","console","warn","send","resetData","npt","npts","vals","qualifs","descriptions","data","type","window","resetobj","refreshDisplay","values","Promise","resolve","reject","resolveFunction","Error","rejectFunction","updateValues","keys","map","tag","index","rtdata","tags","handle","updateHandle","path","quality","parameters","Value","TagClientItem","Alarmed","Desc","setValue","failed","alarmed","description","storeValue","getValue","getApiKey","apikey","getVersion","version","getIframe","getComponentState","getComponentVersion","getTagsList","tagsList","moveBy","dx","dy","animate","moveobj","zoomTo","zoomLevel","target","zoomobj","zoomToOriginal","enableTools","panEnabled","zoomEnabled","enabletoolsobj","enableMouse","enablemouseobj","setMouseWheel","directionBackOut","blockEventPropagation","mousewheelobj","enableKeyboard","keyEnabled","enablekeyboardobj","enableAlarmFlash","alarmFlashEnabled","enableflashobj","hideWatermark","hidewatermarkobj","setColor","colorNumber","colorCode","setcolorobj","push","setColors","colorsTable","setcolorsobj","on","event","callback","ret","loaded","onready","onclick","constructor","container","iframeparams","aux","panelContainerResizeObserver","id","iframehtm","scrolling","length","body","getElementById","indexOf","appendChild","insertAdjacentHTML","addEventListener","source","error","i","origin","attributes","svObjs","svState","doAdjusts","options","svgraph","moveByX","moveByY","el","parentElement","clientWidth","clientHeight","width","height","autoResize","updatePanels","objInd","tagValues","elms","querySelectorAll","svId","enableMousePan","enableMouseWheelZoom","showZoomPan","ResizeObserver","entries","entry","contentRect","observe","JSON","stringify","lastOptions","assign","UploadSVG","onChange","FileUpload","accept","onFileUpload","tgt","files","file","reader","FileReader","result","readAsDataURL","plugin","PanelPlugin","onOptionsChange","useMemo","cntMappedFields","series","s","j","fields","f","name","buffer","request","panelId","firstExec","svgUrl","dashboardUID","crypto","randomUUID","svReactElem","React","remove","synopticapi","useEffect","setPanelOptions","builder","addTextInput","defaultValue","addCustomEditor","editor","addSliderInput","settings","min","max","step","addBooleanSwitch"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/plugin.json b/dist/plugin.json deleted file mode 100644 index d4cfb53..0000000 --- a/dist/plugin.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/grafana/grafana/master/docs/sources/developers/plugins/plugin.schema.json", - "type": "panel", - "name": "SCADAvis Synoptic Panel", - "id": "scadavis-synoptic-panel", - "info": { - "description": "SCADA-like synoptic panel for grafana", - "author": { - "name": "Ricardo L. Olsen", - "url": "https://scadavis.io" - }, - "keywords": [ - "scada", - "svg" - ], - "logos": { - "small": "img/scadavis-small.png", - "large": "img/scadavis-large.png" - }, - "links": [ - { - "name": "Project site", - "url": "https://github.com/riclolsen/scadavis-synoptic-panel" - }, - { - "name": "GPL License", - "url": "https://www.gnu.org/licenses/gpl-3.0.txt" - } - ], - "screenshots": [ - { - "name": "Power", - "path": "img/scadavis-power.png" - } - ], - "version": "2.0.0", - "updated": "2023-11-29" - }, - "dependencies": { - "grafanaDependency": ">=9.0.0", - "plugins": [] - } -} diff --git a/dist/synoptic/cdn/chroma.min.js b/dist/synoptic/cdn/chroma.min.js deleted file mode 100644 index fe03b20..0000000 --- a/dist/synoptic/cdn/chroma.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see chroma.min.js.LICENSE.txt */ -!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(r="undefined"!=typeof globalThis?globalThis:r||self).chroma=e()}(this,(function(){"use strict";for(var r=function(r,e,n){return void 0===e&&(e=0),void 0===n&&(n=1),rn?n:r},e=r,n={},t=0,a=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];t255)&&(r._clipped=!0),r[n]=e(r[n],0,255)):3===n&&(r[n]=e(r[n],0,1));return r},limit:r,type:o,unpack:function(r,e){return void 0===e&&(e=null),r.length>=3?Array.prototype.slice.call(r):"object"==u(r[0])&&e?e.split("").filter((function(e){return void 0!==r[0][e]})).map((function(e){return r[0][e]})):r[0]},last:function(r){if(r.length<2)return null;var e=r.length-1;return"string"==c(r[e])?r[e].toLowerCase():null},PI:i,TWOPI:2*i,PITHIRD:i/3,DEG2RAD:i/180,RAD2DEG:180/i},h={format:{},autodetect:[]},s=l.last,d=l.clip_rgb,b=l.type,p=h,g=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=this;if("object"===b(r[0])&&r[0].constructor&&r[0].constructor===this.constructor)return r[0];var t=s(r),a=!1;if(!t){a=!0,p.sorted||(p.autodetect=p.autodetect.sort((function(r,e){return e.p-r.p})),p.sorted=!0);for(var f=0,o=p.autodetect;f4?r[4]:1;return 1===f?[0,0,0,o]:[n>=1?0:255*(1-n)*(1-f),t>=1?0:255*(1-t)*(1-f),a>=1?0:255*(1-a)*(1-f),o]},x.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=A(r,"cmyk"),"array"===E(r)&&4===r.length)return"cmyk"}});var F=l.unpack,P=l.last,O=function(r){return Math.round(100*r)/100},j=l.unpack,G=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=(r=j(r,"rgba"))[0],t=r[1],a=r[2];n/=255,t/=255,a/=255;var f,o,u=Math.min(n,t,a),c=Math.max(n,t,a),i=(c+u)/2;return c===u?(f=0,o=Number.NaN):f=i<.5?(c-u)/(c+u):(c-u)/(2-c-u),n==c?o=(t-a)/(c-u):t==c?o=2+(a-n)/(c-u):a==c&&(o=4+(n-t)/(c-u)),(o*=60)<0&&(o+=360),r.length>3&&void 0!==r[3]?[o,f,i,r[3]]:[o,f,i]},R=l.unpack,q=l.last,L=G,I=Math.round,B=l.unpack,C=Math.round,D=function(){for(var r,e=[],n=arguments.length;n--;)e[n]=arguments[n];var t,a,f,o=(e=B(e,"hsl"))[0],u=e[1],c=e[2];if(0===u)t=a=f=255*c;else{var i=[0,0,0],l=[0,0,0],h=c<.5?c*(1+u):c+u-c*u,s=2*c-h,d=o/360;i[0]=d+1/3,i[1]=d,i[2]=d-1/3;for(var b=0;b<3;b++)i[b]<0&&(i[b]+=1),i[b]>1&&(i[b]-=1),6*i[b]<1?l[b]=s+6*(h-s)*i[b]:2*i[b]<1?l[b]=h:3*i[b]<2?l[b]=s+(h-s)*(2/3-i[b])*6:l[b]=s;t=(r=[C(255*l[0]),C(255*l[1]),C(255*l[2])])[0],a=r[1],f=r[2]}return e.length>3?[t,a,f,e[3]]:[t,a,f,1]},Y=D,S=h,T=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,$=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,z=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,X=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,U=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,V=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,W=Math.round,K=function(r){var e;if(r=r.toLowerCase().trim(),S.format.named)try{return S.format.named(r)}catch(r){}if(e=r.match(T)){for(var n=e.slice(1,4),t=0;t<3;t++)n[t]=+n[t];return n[3]=1,n}if(e=r.match($)){for(var a=e.slice(1,5),f=0;f<4;f++)a[f]=+a[f];return a}if(e=r.match(z)){for(var o=e.slice(1,4),u=0;u<3;u++)o[u]=W(2.55*o[u]);return o[3]=1,o}if(e=r.match(X)){for(var c=e.slice(1,5),i=0;i<3;i++)c[i]=W(2.55*c[i]);return c[3]=+c[3],c}if(e=r.match(U)){var l=e.slice(1,4);l[1]*=.01,l[2]*=.01;var h=Y(l);return h[3]=1,h}if(e=r.match(V)){var s=e.slice(1,4);s[1]*=.01,s[2]*=.01;var d=Y(s);return d[3]=+e[4],d}};K.test=function(r){return T.test(r)||$.test(r)||z.test(r)||X.test(r)||U.test(r)||V.test(r)};var Z=y,H=v,J=h,Q=l.type,rr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=R(r,"rgba"),t=q(r)||"rgb";return"hsl"==t.substr(0,3)?function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=F(r,"hsla"),t=P(r)||"lsa";return n[0]=O(n[0]||0),n[1]=O(100*n[1])+"%",n[2]=O(100*n[2])+"%","hsla"===t||n.length>3&&n[3]<1?(n[3]=n.length>3?n[3]:1,t="hsla"):n.length=3,t+"("+n.join(",")+")"}(L(n),t):(n[0]=I(n[0]),n[1]=I(n[1]),n[2]=I(n[2]),("rgba"===t||n.length>3&&n[3]<1)&&(n[3]=n.length>3?n[3]:1,t="rgba"),t+"("+n.slice(0,"rgb"===t?3:4).join(",")+")")},er=K;H.prototype.css=function(r){return rr(this._rgb,r)},Z.css=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(H,[null].concat(r,["css"])))},J.format.css=er,J.autodetect.push({p:5,test:function(r){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];if(!e.length&&"string"===Q(r)&&er.test(r))return"css"}});var nr=v,tr=y,ar=l.unpack;h.format.gl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=ar(r,"rgba");return n[0]*=255,n[1]*=255,n[2]*=255,n},tr.gl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(nr,[null].concat(r,["gl"])))},nr.prototype.gl=function(){var r=this._rgb;return[r[0]/255,r[1]/255,r[2]/255,r[3]]};var fr=l.unpack,or=l.unpack,ur=Math.floor,cr=l.unpack,ir=l.type,lr=y,hr=v,sr=h;hr.prototype.hcg=function(){return function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t=fr(r,"rgb"),a=t[0],f=t[1],o=t[2],u=Math.min(a,f,o),c=Math.max(a,f,o),i=c-u,l=100*i/255,h=u/(255-i)*100;return 0===i?n=Number.NaN:(a===c&&(n=(f-o)/i),f===c&&(n=2+(o-a)/i),o===c&&(n=4+(a-f)/i),(n*=60)<0&&(n+=360)),[n,l,h]}(this._rgb)},lr.hcg=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(hr,[null].concat(r,["hcg"])))},sr.format.hcg=function(){for(var r,e,n,t,a,f,o=[],u=arguments.length;u--;)o[u]=arguments[u];var c,i,l,h=(o=or(o,"hcg"))[0],s=o[1],d=o[2];d*=255;var b=255*s;if(0===s)c=i=l=d;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var p=ur(h/=60),g=h-p,v=d*(1-s),m=v+b*(1-g),y=v+b*g,k=v+b;switch(p){case 0:c=(r=[k,y,v])[0],i=r[1],l=r[2];break;case 1:c=(e=[m,k,v])[0],i=e[1],l=e[2];break;case 2:c=(n=[v,k,y])[0],i=n[1],l=n[2];break;case 3:c=(t=[v,m,k])[0],i=t[1],l=t[2];break;case 4:c=(a=[y,v,k])[0],i=a[1],l=a[2];break;case 5:c=(f=[k,v,m])[0],i=f[1],l=f[2]}}return[c,i,l,o.length>3?o[3]:1]},sr.autodetect.push({p:1,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=cr(r,"hcg"),"array"===ir(r)&&3===r.length)return"hcg"}});var dr=l.unpack,br=l.last,pr=Math.round,gr=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=dr(r,"rgba"),t=n[0],a=n[1],f=n[2],o=n[3],u=br(r)||"auto";void 0===o&&(o=1),"auto"===u&&(u=o<1?"rgba":"rgb");var c="000000"+((t=pr(t))<<16|(a=pr(a))<<8|(f=pr(f))).toString(16);c=c.substr(c.length-6);var i="0"+pr(255*o).toString(16);switch(i=i.substr(i.length-2),u.toLowerCase()){case"rgba":return"#"+c+i;case"argb":return"#"+i+c;default:return"#"+c}},vr=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,mr=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,yr=function(r){if(r.match(vr)){4!==r.length&&7!==r.length||(r=r.substr(1)),3===r.length&&(r=(r=r.split(""))[0]+r[0]+r[1]+r[1]+r[2]+r[2]);var e=parseInt(r,16);return[e>>16,e>>8&255,255&e,1]}if(r.match(mr)){5!==r.length&&9!==r.length||(r=r.substr(1)),4===r.length&&(r=(r=r.split(""))[0]+r[0]+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]);var n=parseInt(r,16);return[n>>24&255,n>>16&255,n>>8&255,Math.round((255&n)/255*100)/100]}throw new Error("unknown hex color: "+r)},kr=y,wr=v,Mr=l.type,Nr=h,_r=gr;wr.prototype.hex=function(r){return _r(this._rgb,r)},kr.hex=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(wr,[null].concat(r,["hex"])))},Nr.format.hex=yr,Nr.autodetect.push({p:4,test:function(r){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];if(!e.length&&"string"===Mr(r)&&[3,4,5,6,7,8,9].indexOf(r.length)>=0)return"hex"}});var xr=l.unpack,Ar=l.TWOPI,Er=Math.min,Fr=Math.sqrt,Pr=Math.acos,Or=l.unpack,jr=l.limit,Gr=l.TWOPI,Rr=l.PITHIRD,qr=Math.cos,Lr=l.unpack,Ir=l.type,Br=y,Cr=v,Dr=h;Cr.prototype.hsi=function(){return function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t=xr(r,"rgb"),a=t[0],f=t[1],o=t[2],u=Er(a/=255,f/=255,o/=255),c=(a+f+o)/3,i=c>0?1-u/c:0;return 0===i?n=NaN:(n=(a-f+(a-o))/2,n/=Fr((a-f)*(a-f)+(a-o)*(f-o)),n=Pr(n),o>f&&(n=Ar-n),n/=Ar),[360*n,i,c]}(this._rgb)},Br.hsi=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(Cr,[null].concat(r,["hsi"])))},Dr.format.hsi=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t,a,f=(r=Or(r,"hsi"))[0],o=r[1],u=r[2];return isNaN(f)&&(f=0),isNaN(o)&&(o=0),f>360&&(f-=360),f<0&&(f+=360),(f/=360)<1/3?t=1-((a=(1-o)/3)+(n=(1+o*qr(Gr*f)/qr(Rr-Gr*f))/3)):f<2/3?a=1-((n=(1-o)/3)+(t=(1+o*qr(Gr*(f-=1/3))/qr(Rr-Gr*f))/3)):n=1-((t=(1-o)/3)+(a=(1+o*qr(Gr*(f-=2/3))/qr(Rr-Gr*f))/3)),[255*(n=jr(u*n*3)),255*(t=jr(u*t*3)),255*(a=jr(u*a*3)),r.length>3?r[3]:1]},Dr.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=Lr(r,"hsi"),"array"===Ir(r)&&3===r.length)return"hsi"}});var Yr=l.unpack,Sr=l.type,Tr=y,$r=v,zr=h,Xr=G;$r.prototype.hsl=function(){return Xr(this._rgb)},Tr.hsl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply($r,[null].concat(r,["hsl"])))},zr.format.hsl=D,zr.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=Yr(r,"hsl"),"array"===Sr(r)&&3===r.length)return"hsl"}});var Ur=l.unpack,Vr=Math.min,Wr=Math.max,Kr=l.unpack,Zr=Math.floor,Hr=l.unpack,Jr=l.type,Qr=y,re=v,ee=h;re.prototype.hsv=function(){return function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t,a,f=(r=Ur(r,"rgb"))[0],o=r[1],u=r[2],c=Vr(f,o,u),i=Wr(f,o,u),l=i-c;return a=i/255,0===i?(n=Number.NaN,t=0):(t=l/i,f===i&&(n=(o-u)/l),o===i&&(n=2+(u-f)/l),u===i&&(n=4+(f-o)/l),(n*=60)<0&&(n+=360)),[n,t,a]}(this._rgb)},Qr.hsv=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(re,[null].concat(r,["hsv"])))},ee.format.hsv=function(){for(var r,e,n,t,a,f,o=[],u=arguments.length;u--;)o[u]=arguments[u];var c,i,l,h=(o=Kr(o,"hsv"))[0],s=o[1],d=o[2];if(d*=255,0===s)c=i=l=d;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var b=Zr(h/=60),p=h-b,g=d*(1-s),v=d*(1-s*p),m=d*(1-s*(1-p));switch(b){case 0:c=(r=[d,m,g])[0],i=r[1],l=r[2];break;case 1:c=(e=[v,d,g])[0],i=e[1],l=e[2];break;case 2:c=(n=[g,d,m])[0],i=n[1],l=n[2];break;case 3:c=(t=[g,v,d])[0],i=t[1],l=t[2];break;case 4:c=(a=[m,g,d])[0],i=a[1],l=a[2];break;case 5:c=(f=[d,g,v])[0],i=f[1],l=f[2]}}return[c,i,l,o.length>3?o[3]:1]},ee.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=Hr(r,"hsv"),"array"===Jr(r)&&3===r.length)return"hsv"}});var ne={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},te=ne,ae=l.unpack,fe=Math.pow,oe=function(r){return(r/=255)<=.04045?r/12.92:fe((r+.055)/1.055,2.4)},ue=function(r){return r>te.t3?fe(r,1/3):r/te.t2+te.t0},ce=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=ae(r,"rgb"),t=function(r,e,n){return r=oe(r),e=oe(e),n=oe(n),[ue((.4124564*r+.3575761*e+.1804375*n)/te.Xn),ue((.2126729*r+.7151522*e+.072175*n)/te.Yn),ue((.0193339*r+.119192*e+.9503041*n)/te.Zn)]}(n[0],n[1],n[2]),a=t[0],f=t[1],o=116*f-16;return[o<0?0:o,500*(a-f),200*(f-t[2])]},ie=ne,le=l.unpack,he=Math.pow,se=function(r){return 255*(r<=.00304?12.92*r:1.055*he(r,1/2.4)-.055)},de=function(r){return r>ie.t1?r*r*r:ie.t2*(r-ie.t0)},be=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,t,a,f=(r=le(r,"lab"))[0],o=r[1],u=r[2];return t=(f+16)/116,n=isNaN(o)?t:t+o/500,a=isNaN(u)?t:t-u/200,t=ie.Yn*de(t),n=ie.Xn*de(n),a=ie.Zn*de(a),[se(3.2404542*n-1.5371385*t-.4985314*a),se(-.969266*n+1.8760108*t+.041556*a),se(.0556434*n-.2040259*t+1.0572252*a),r.length>3?r[3]:1]},pe=l.unpack,ge=l.type,ve=y,me=v,ye=h,ke=ce;me.prototype.lab=function(){return ke(this._rgb)},ve.lab=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(me,[null].concat(r,["lab"])))},ye.format.lab=be,ye.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=pe(r,"lab"),"array"===ge(r)&&3===r.length)return"lab"}});var we=l.unpack,Me=l.RAD2DEG,Ne=Math.sqrt,_e=Math.atan2,xe=Math.round,Ae=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=we(r,"lab"),t=n[0],a=n[1],f=n[2],o=Ne(a*a+f*f),u=(_e(f,a)*Me+360)%360;return 0===xe(1e4*o)&&(u=Number.NaN),[t,o,u]},Ee=l.unpack,Fe=ce,Pe=Ae,Oe=l.unpack,je=l.DEG2RAD,Ge=Math.sin,Re=Math.cos,qe=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Oe(r,"lch"),t=n[0],a=n[1],f=n[2];return isNaN(f)&&(f=0),[t,Re(f*=je)*a,Ge(f)*a]},Le=l.unpack,Ie=qe,Be=be,Ce=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=(r=Le(r,"lch"))[0],t=r[1],a=r[2],f=Ie(n,t,a),o=f[0],u=f[1],c=f[2],i=Be(o,u,c);return[i[0],i[1],i[2],r.length>3?r[3]:1]},De=l.unpack,Ye=Ce,Se=l.unpack,Te=l.type,$e=y,ze=v,Xe=h,Ue=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Ee(r,"rgb"),t=n[0],a=n[1],f=n[2],o=Fe(t,a,f),u=o[0],c=o[1],i=o[2];return Pe(u,c,i)};ze.prototype.lch=function(){return Ue(this._rgb)},ze.prototype.hcl=function(){return Ue(this._rgb).reverse()},$e.lch=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(ze,[null].concat(r,["lch"])))},$e.hcl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(ze,[null].concat(r,["hcl"])))},Xe.format.lch=Ce,Xe.format.hcl=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=De(r,"hcl").reverse();return Ye.apply(void 0,n)},["lch","hcl"].forEach((function(r){return Xe.autodetect.push({p:2,test:function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];if(e=Se(e,r),"array"===Te(e)&&3===e.length)return r}})}));var Ve={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},We=h,Ke=l.type,Ze=Ve,He=yr,Je=gr;v.prototype.name=function(){for(var r=Je(this._rgb,"rgb"),e=0,n=Object.keys(Ze);e0;)e[n]=arguments[n+1];if(!e.length&&"string"===Ke(r)&&Ze[r.toLowerCase()])return"named"}});var Qe=l.unpack,rn=l.type,en=y,nn=v,tn=h,an=l.type;nn.prototype.num=function(){return function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Qe(r,"rgb");return(n[0]<<16)+(n[1]<<8)+n[2]}(this._rgb)},en.num=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(nn,[null].concat(r,["num"])))},tn.format.num=function(r){if("number"==rn(r)&&r>=0&&r<=16777215)return[r>>16,r>>8&255,255&r,1];throw new Error("unknown num color: "+r)},tn.autodetect.push({p:5,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(1===r.length&&"number"===an(r[0])&&r[0]>=0&&r[0]<=16777215)return"num"}});var fn=y,on=v,un=h,cn=l.unpack,ln=l.type,hn=Math.round;on.prototype.rgb=function(r){return void 0===r&&(r=!0),!1===r?this._rgb.slice(0,3):this._rgb.slice(0,3).map(hn)},on.prototype.rgba=function(r){return void 0===r&&(r=!0),this._rgb.slice(0,4).map((function(e,n){return n<3?!1===r?e:hn(e):e}))},fn.rgb=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(on,[null].concat(r,["rgb"])))},un.format.rgb=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=cn(r,"rgba");return void 0===n[3]&&(n[3]=1),n},un.autodetect.push({p:3,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=cn(r,"rgba"),"array"===ln(r)&&(3===r.length||4===r.length&&"number"==ln(r[3])&&r[3]>=0&&r[3]<=1))return"rgb"}});var sn=Math.log,dn=function(r){var e,n,t,a=r/100;return a<66?(e=255,n=a<6?0:-155.25485562709179-.44596950469579133*(n=a-2)+104.49216199393888*sn(n),t=a<20?0:.8274096064007395*(t=a-10)-254.76935184120902+115.67994401066147*sn(t)):(e=351.97690566805693+.114206453784165*(e=a-55)-40.25366309332127*sn(e),n=325.4494125711974+.07943456536662342*(n=a-50)-28.0852963507957*sn(n),t=255),[e,n,t,1]},bn=dn,pn=l.unpack,gn=Math.round,vn=y,mn=v,yn=h;mn.prototype.temp=mn.prototype.kelvin=mn.prototype.temperature=function(){return function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];for(var n,t=pn(r,"rgb"),a=t[0],f=t[2],o=1e3,u=4e4;u-o>.4;){var c=bn(n=.5*(u+o));c[2]/c[0]>=f/a?u=n:o=n}return gn(n)}(this._rgb)},vn.temp=vn.kelvin=vn.temperature=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(mn,[null].concat(r,["temp"])))},yn.format.temp=yn.format.kelvin=yn.format.temperature=dn;var kn=l.unpack,wn=Math.cbrt,Mn=Math.pow,Nn=Math.sign,_n=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=kn(r,"rgb"),t=n[0],a=n[1],f=n[2],o=[xn(t/255),xn(a/255),xn(f/255)],u=o[0],c=o[1],i=o[2],l=wn(.4122214708*u+.5363325363*c+.0514459929*i),h=wn(.2119034982*u+.6806995451*c+.1073969566*i),s=wn(.0883024619*u+.2817188376*c+.6299787005*i);return[.2104542553*l+.793617785*h-.0040720468*s,1.9779984951*l-2.428592205*h+.4505937099*s,.0259040371*l+.7827717662*h-.808675766*s]};function xn(r){var e=Math.abs(r);return e<.04045?r/12.92:(Nn(r)||1)*Mn((e+.055)/1.055,2.4)}var An=l.unpack,En=Math.pow,Fn=Math.sign,Pn=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=(r=An(r,"lab"))[0],t=r[1],a=r[2],f=En(n+.3963377774*t+.2158037573*a,3),o=En(n-.1055613458*t-.0638541728*a,3),u=En(n-.0894841775*t-1.291485548*a,3);return[255*On(4.0767416621*f-3.3077115913*o+.2309699292*u),255*On(-1.2684380046*f+2.6097574011*o-.3413193965*u),255*On(-.0041960863*f-.7034186147*o+1.707614701*u),r.length>3?r[3]:1]};function On(r){var e=Math.abs(r);return e>.0031308?(Fn(r)||1)*(1.055*En(e,1/2.4)-.055):12.92*r}var jn=l.unpack,Gn=l.type,Rn=y,qn=v,Ln=h,In=_n;qn.prototype.oklab=function(){return In(this._rgb)},Rn.oklab=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(qn,[null].concat(r,["oklab"])))},Ln.format.oklab=Pn,Ln.autodetect.push({p:3,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=jn(r,"oklab"),"array"===Gn(r)&&3===r.length)return"oklab"}});var Bn=l.unpack,Cn=_n,Dn=Ae,Yn=l.unpack,Sn=qe,Tn=Pn,$n=l.unpack,zn=l.type,Xn=y,Un=v,Vn=h;Un.prototype.oklch=function(){return function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=Bn(r,"rgb"),t=n[0],a=n[1],f=n[2],o=Cn(t,a,f),u=o[0],c=o[1],i=o[2];return Dn(u,c,i)}(this._rgb)},Xn.oklch=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];return new(Function.prototype.bind.apply(Un,[null].concat(r,["oklch"])))},Vn.format.oklch=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];var n=(r=Yn(r,"lch"))[0],t=r[1],a=r[2],f=Sn(n,t,a),o=f[0],u=f[1],c=f[2],i=Tn(o,u,c);return[i[0],i[1],i[2],r.length>3?r[3]:1]},Vn.autodetect.push({p:3,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=$n(r,"oklch"),"array"===zn(r)&&3===r.length)return"oklch"}});var Wn=v,Kn=l.type;Wn.prototype.alpha=function(r,e){return void 0===e&&(e=!1),void 0!==r&&"number"===Kn(r)?e?(this._rgb[3]=r,this):new Wn([this._rgb[0],this._rgb[1],this._rgb[2],r],"rgb"):this._rgb[3]},v.prototype.clipped=function(){return this._rgb._clipped||!1};var Zn=v,Hn=ne;Zn.prototype.darken=function(r){void 0===r&&(r=1);var e=this.lab();return e[0]-=Hn.Kn*r,new Zn(e,"lab").alpha(this.alpha(),!0)},Zn.prototype.brighten=function(r){return void 0===r&&(r=1),this.darken(-r)},Zn.prototype.darker=Zn.prototype.darken,Zn.prototype.brighter=Zn.prototype.brighten,v.prototype.get=function(r){var e=r.split("."),n=e[0],t=e[1],a=this[n]();if(t){var f=n.indexOf(t)-("ok"===n.substr(0,2)?2:0);if(f>-1)return a[f];throw new Error("unknown channel "+t+" in mode "+n)}return a};var Jn=v,Qn=l.type,rt=Math.pow;Jn.prototype.luminance=function(r){if(void 0!==r&&"number"===Qn(r)){if(0===r)return new Jn([0,0,0,this._rgb[3]],"rgb");if(1===r)return new Jn([255,255,255,this._rgb[3]],"rgb");var e=this.luminance(),n=20,t=function(e,a){var f=e.interpolate(a,.5,"rgb"),o=f.luminance();return Math.abs(r-o)<1e-7||!n--?f:o>r?t(e,f):t(f,a)},a=(e>r?t(new Jn([0,0,0]),this):t(this,new Jn([255,255,255]))).rgb();return new Jn(a.concat([this._rgb[3]]))}return et.apply(void 0,this._rgb.slice(0,3))};var et=function(r,e,n){return.2126*(r=nt(r))+.7152*(e=nt(e))+.0722*nt(n)},nt=function(r){return(r/=255)<=.03928?r/12.92:rt((r+.055)/1.055,2.4)},tt={},at=v,ft=l.type,ot=tt,ut=function(r,e,n){void 0===n&&(n=.5);for(var t=[],a=arguments.length-3;a-- >0;)t[a]=arguments[a+3];var f=t[0]||"lrgb";if(ot[f]||t.length||(f=Object.keys(ot)[0]),!ot[f])throw new Error("interpolation mode "+f+" is not defined");return"object"!==ft(r)&&(r=new at(r)),"object"!==ft(e)&&(e=new at(e)),ot[f](r,e,n).alpha(r.alpha()+n*(e.alpha()-r.alpha()))},ct=v,it=ut;ct.prototype.mix=ct.prototype.interpolate=function(r,e){void 0===e&&(e=.5);for(var n=[],t=arguments.length-2;t-- >0;)n[t]=arguments[t+2];return it.apply(void 0,[this,r,e].concat(n))};var lt=v;lt.prototype.premultiply=function(r){void 0===r&&(r=!1);var e=this._rgb,n=e[3];return r?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new lt([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};var ht=v,st=ne;ht.prototype.saturate=function(r){void 0===r&&(r=1);var e=this.lch();return e[1]+=st.Kn*r,e[1]<0&&(e[1]=0),new ht(e,"lch").alpha(this.alpha(),!0)},ht.prototype.desaturate=function(r){return void 0===r&&(r=1),this.saturate(-r)};var dt=v,bt=l.type;dt.prototype.set=function(r,e,n){void 0===n&&(n=!1);var t=r.split("."),a=t[0],f=t[1],o=this[a]();if(f){var u=a.indexOf(f)-("ok"===a.substr(0,2)?2:0);if(u>-1){if("string"==bt(e))switch(e.charAt(0)){case"+":case"-":o[u]+=+e;break;case"*":o[u]*=+e.substr(1);break;case"/":o[u]/=+e.substr(1);break;default:o[u]=+e}else{if("number"!==bt(e))throw new Error("unsupported value for Color.set");o[u]=e}var c=new dt(o,a);return n?(this._rgb=c._rgb,this):c}throw new Error("unknown channel "+f+" in mode "+a)}return o};var pt=v;tt.rgb=function(r,e,n){var t=r._rgb,a=e._rgb;return new pt(t[0]+n*(a[0]-t[0]),t[1]+n*(a[1]-t[1]),t[2]+n*(a[2]-t[2]),"rgb")};var gt=v,vt=Math.sqrt,mt=Math.pow;tt.lrgb=function(r,e,n){var t=r._rgb,a=t[0],f=t[1],o=t[2],u=e._rgb,c=u[0],i=u[1],l=u[2];return new gt(vt(mt(a,2)*(1-n)+mt(c,2)*n),vt(mt(f,2)*(1-n)+mt(i,2)*n),vt(mt(o,2)*(1-n)+mt(l,2)*n),"rgb")};var yt=v;tt.lab=function(r,e,n){var t=r.lab(),a=e.lab();return new yt(t[0]+n*(a[0]-t[0]),t[1]+n*(a[1]-t[1]),t[2]+n*(a[2]-t[2]),"lab")};var kt=v,wt=function(r,e,n,t){var a,f,o,u,c,i,l,h,s,d,b,p,g;return"hsl"===t?(o=r.hsl(),u=e.hsl()):"hsv"===t?(o=r.hsv(),u=e.hsv()):"hcg"===t?(o=r.hcg(),u=e.hcg()):"hsi"===t?(o=r.hsi(),u=e.hsi()):"lch"===t||"hcl"===t?(t="hcl",o=r.hcl(),u=e.hcl()):"oklch"===t&&(o=r.oklch().reverse(),u=e.oklch().reverse()),"h"!==t.substr(0,1)&&"oklch"!==t||(c=(a=o)[0],l=a[1],s=a[2],i=(f=u)[0],h=f[1],d=f[2]),isNaN(c)||isNaN(i)?isNaN(c)?isNaN(i)?p=Number.NaN:(p=i,1!=s&&0!=s||"hsv"==t||(b=h)):(p=c,1!=d&&0!=d||"hsv"==t||(b=l)):p=c+n*(i>c&&i-c>180?i-(c+360):i180?i+360-c:i-c),void 0===b&&(b=l+n*(h-l)),g=s+n*(d-s),new kt("oklch"===t?[g,b,p]:[p,b,g],t)},Mt=wt,Nt=function(r,e,n){return Mt(r,e,n,"lch")};tt.lch=Nt,tt.hcl=Nt;var _t=v;tt.num=function(r,e,n){var t=r.num(),a=e.num();return new _t(t+n*(a-t),"num")};var xt=wt;tt.hcg=function(r,e,n){return xt(r,e,n,"hcg")};var At=wt;tt.hsi=function(r,e,n){return At(r,e,n,"hsi")};var Et=wt;tt.hsl=function(r,e,n){return Et(r,e,n,"hsl")};var Ft=wt;tt.hsv=function(r,e,n){return Ft(r,e,n,"hsv")};var Pt=v;tt.oklab=function(r,e,n){var t=r.oklab(),a=e.oklab();return new Pt(t[0]+n*(a[0]-t[0]),t[1]+n*(a[1]-t[1]),t[2]+n*(a[2]-t[2]),"oklab")};var Ot=wt;tt.oklch=function(r,e,n){return Ot(r,e,n,"oklch")};var jt=v,Gt=l.clip_rgb,Rt=Math.pow,qt=Math.sqrt,Lt=Math.PI,It=Math.cos,Bt=Math.sin,Ct=Math.atan2,Dt=y,Yt=l.type,St=Math.pow,Tt=function(r){var e="rgb",n=Dt("#ccc"),t=0,a=[0,1],f=[],o=[0,0],u=!1,c=[],i=!1,l=0,h=1,s=!1,d={},b=!0,p=1,g=function(r){if((r=r||["#fff","#000"])&&"string"===Yt(r)&&Dt.brewer&&Dt.brewer[r.toLowerCase()]&&(r=Dt.brewer[r.toLowerCase()]),"array"===Yt(r)){1===r.length&&(r=[r[0],r[0]]),r=r.slice(0);for(var e=0;e2){var s=function(r){if(null!=u){for(var e=u.length-1,n=0;n=u[n];)n++;return n-1}return 0}(r);i=s/(u.length-2)}else i=h!==l?(r-l)/(h-l):1;i=m(i),t||(i=v(i)),1!==p&&(i=St(i,p)),i=o[0]+i*(1-o[0]-o[1]),i=Math.min(1,Math.max(0,i));var g=Math.floor(1e4*i);if(b&&d[g])a=d[g];else{if("array"===Yt(c))for(var y=0;y=k&&y===f.length-1){a=c[y];break}if(i>k&&i2){var i=r.map((function(e,n){return n/(r.length-1)})),s=r.map((function(r){return(r-l)/(h-l)}));s.every((function(r,e){return i[e]===r}))||(m=function(r){if(r<=0||r>=1)return r;for(var e=0;r>=s[e+1];)e++;var n=(r-s[e])/(s[e+1]-s[e]);return i[e]+n*(i[e+1]-i[e])})}}return a=[l,h],w},w.mode=function(r){return arguments.length?(e=r,k(),w):e},w.range=function(r,e){return g(r),w},w.out=function(r){return i=r,w},w.spread=function(r){return arguments.length?(t=r,w):t},w.correctLightness=function(r){return null==r&&(r=!0),s=r,k(),v=s?function(r){for(var e=y(0,!0).lab()[0],n=y(1,!0).lab()[0],t=e>n,a=y(r,!0).lab()[0],f=e+(n-e)*r,o=a-f,u=0,c=1,i=20;Math.abs(o)>.01&&i-- >0;)t&&(o*=-1),o<0?(u=r,r+=.5*(c-r)):(c=r,r+=.5*(u-r)),o=(a=y(r,!0).lab()[0])-f;return r}:function(r){return r},w},w.padding=function(r){return null!=r?("number"===Yt(r)&&(r=[r,r]),o=r,w):o},w.colors=function(e,n){arguments.length<2&&(n="hex");var t=[];if(0===arguments.length)t=c.slice(0);else if(1===e)t=[w(.5)];else if(e>1){var f=a[0],o=a[1]-f;t=function(r,e,n){for(var t=[],a=0f;a?o++:o--)t.push(o);return t}(0,e).map((function(r){return w(f+r/(e-1)*o)}))}else{r=[];var i=[];if(u&&u.length>2)for(var l=1,h=u.length,s=1<=h;s?lh;s?l++:l--)i.push(.5*(u[l-1]+u[l]));else i=a;t=i.map((function(r){return w(r)}))}return Dt[n]&&(t=t.map((function(r){return r[n]()}))),t},w.cache=function(r){return null!=r?(b=r,w):b},w.gamma=function(r){return null!=r?(p=r,w):p},w.nodata=function(r){return null!=r?(n=Dt(r),w):n},w},$t=v,zt=Tt,Xt=y,Ut=function(r,e,n){if(!Ut[n])throw new Error("unknown blend mode "+n);return Ut[n](r,e)},Vt=function(r){return function(e,n){var t=Xt(n).rgb(),a=Xt(e).rgb();return Xt.rgb(r(t,a))}},Wt=function(r){return function(e,n){var t=[];return t[0]=r(e[0],n[0]),t[1]=r(e[1],n[1]),t[2]=r(e[2],n[2]),t}};Ut.normal=Vt(Wt((function(r){return r}))),Ut.multiply=Vt(Wt((function(r,e){return r*e/255}))),Ut.screen=Vt(Wt((function(r,e){return 255*(1-(1-r/255)*(1-e/255))}))),Ut.overlay=Vt(Wt((function(r,e){return e<128?2*r*e/255:255*(1-2*(1-r/255)*(1-e/255))}))),Ut.darken=Vt(Wt((function(r,e){return r>e?e:r}))),Ut.lighten=Vt(Wt((function(r,e){return r>e?r:e}))),Ut.dodge=Vt(Wt((function(r,e){return 255===r||(r=e/255*255/(1-r/255))>255?255:r}))),Ut.burn=Vt(Wt((function(r,e){return 255*(1-(1-e/255)/(r/255))})));for(var Kt=Ut,Zt=l.type,Ht=l.clip_rgb,Jt=l.TWOPI,Qt=Math.pow,ra=Math.sin,ea=Math.cos,na=y,ta=v,aa=Math.floor,fa=Math.random,oa=o,ua=Math.log,ca=Math.pow,ia=Math.floor,la=Math.abs,ha=function(r,e){void 0===e&&(e=null);var n={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===oa(r)&&(r=Object.values(r)),r.forEach((function(r){e&&"object"===oa(r)&&(r=r[e]),null==r||isNaN(r)||(n.values.push(r),n.sum+=r,rn.max&&(n.max=r),n.count+=1)})),n.domain=[n.min,n.max],n.limits=function(r,e){return sa(n,r,e)},n},sa=function(r,e,n){void 0===e&&(e="equal"),void 0===n&&(n=7),"array"==oa(r)&&(r=ha(r));var t=r.min,a=r.max,f=r.values.sort((function(r,e){return r-e}));if(1===n)return[t,a];var o=[];if("c"===e.substr(0,1)&&(o.push(t),o.push(a)),"e"===e.substr(0,1)){o.push(t);for(var u=1;u 0");var c=Math.LOG10E*ua(t),i=Math.LOG10E*ua(a);o.push(t);for(var l=1;l200&&(y=!1)}for(var L={},I=0;I.9999999&&(t[3]=1),new jt(Gt(t))}(r,n);for(var f=r.shift(),o=f.get(e),u=[],c=0,i=0,l=0;l=360;)b-=360;o[d]=b}else o[d]=o[d]/u[d];return s/=t,new jt(o,e).alpha(s>.99999?1:s,!0)},Ia.bezier=function(r){var e=function(r){var e,n,t,a,f,o,u;if(2===(r=r.map((function(r){return new $t(r)}))).length)e=r.map((function(r){return r.lab()})),f=e[0],o=e[1],a=function(r){var e=[0,1,2].map((function(e){return f[e]+r*(o[e]-f[e])}));return new $t(e,"lab")};else if(3===r.length)n=r.map((function(r){return r.lab()})),f=n[0],o=n[1],u=n[2],a=function(r){var e=[0,1,2].map((function(e){return(1-r)*(1-r)*f[e]+2*(1-r)*r*o[e]+r*r*u[e]}));return new $t(e,"lab")};else if(4===r.length){var c;t=r.map((function(r){return r.lab()})),f=t[0],o=t[1],u=t[2],c=t[3],a=function(r){var e=[0,1,2].map((function(e){return(1-r)*(1-r)*(1-r)*f[e]+3*(1-r)*(1-r)*r*o[e]+3*(1-r)*r*r*u[e]+r*r*r*c[e]}));return new $t(e,"lab")}}else{if(!(r.length>=5))throw new RangeError("No point in running bezier with only one color.");var i,l,h;i=r.map((function(r){return r.lab()})),h=r.length-1,l=function(r){for(var e=[1,1],n=1;nt?(n+.05)/(t+.05):(t+.05)/(n+.05)},Ia.deltaE=function(r,e,n,t,a){void 0===n&&(n=1),void 0===t&&(t=1),void 0===a&&(a=1);var f=function(r){return 360*r/(2*xa)},o=function(r){return 2*xa*r/360};r=new pa(r),e=new pa(e);var u=Array.from(r.lab()),c=u[0],i=u[1],l=u[2],h=Array.from(e.lab()),s=h[0],d=h[1],b=h[2],p=(c+s)/2,g=(ga(va(i,2)+va(l,2))+ga(va(d,2)+va(b,2)))/2,v=.5*(1-ga(va(g,7)/(va(g,7)+va(25,7)))),m=i*(1+v),y=d*(1+v),k=ga(va(m,2)+va(l,2)),w=ga(va(y,2)+va(b,2)),M=(k+w)/2,N=f(ka(l,m)),_=f(ka(b,y)),x=N>=0?N:N+360,A=_>=0?_:_+360,E=wa(x-A)>180?(x+A+360)/2:(x+A)/2,F=1-.17*Ma(o(E-30))+.24*Ma(o(2*E))+.32*Ma(o(3*E+6))-.2*Ma(o(4*E-63)),P=A-x;P=wa(P)<=180?P:A<=x?P+360:P-360,P=2*ga(k*w)*Na(o(P)/2);var O=s-c,j=w-k,G=1+.015*va(p-50,2)/ga(20+va(p-50,2)),R=1+.045*M,q=1+.015*M*F,L=30*_a(-va((E-275)/25,2)),I=-2*ga(va(M,7)/(va(M,7)+va(25,7)))*Na(2*o(L)),B=ga(va(O/(n*G),2)+va(j/(t*R),2)+va(P/(a*q),2)+I*(j/(t*R))*(P/(a*q)));return ya(0,ma(100,B))},Ia.distance=function(r,e,n){void 0===n&&(n="lab"),r=new Aa(r),e=new Aa(e);var t=r.get(n),a=e.get(n),f=0;for(var o in t){var u=(t[o]||0)-(a[o]||0);f+=u*u}return Math.sqrt(f)},Ia.limits=da.limits,Ia.valid=function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];try{return new(Function.prototype.bind.apply(Ea,[null].concat(r))),!0}catch(r){return!1}},Ia.scales=Oa,Ia.colors=Ve,Ia.brewer=La,Ia})); \ No newline at end of file diff --git a/dist/synoptic/cdn/chroma.min.js.LICENSE.txt b/dist/synoptic/cdn/chroma.min.js.LICENSE.txt deleted file mode 100644 index 63e3f38..0000000 --- a/dist/synoptic/cdn/chroma.min.js.LICENSE.txt +++ /dev/null @@ -1,56 +0,0 @@ -/** - * chroma.js - JavaScript library for color conversions - * - * Copyright (c) 2011-2019, Gregor Aisch - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. The name Gregor Aisch may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ------------------------------------------------------- - * - * chroma.js includes colors from colorbrewer2.org, which are released under - * the following license: - * - * Copyright (c) 2002 Cynthia Brewer, Mark Harrower, - * and The Pennsylvania State University. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific - * language governing permissions and limitations under the License. - * - * ------------------------------------------------------ - * - * Named colors are taken from X11 Color Names. - * http://www.w3.org/TR/css3-color/#svg-color - * - * @preserve - */ diff --git a/dist/synoptic/cdn/d3.v7.min.js b/dist/synoptic/cdn/d3.v7.min.js deleted file mode 100644 index 9d2c0ca..0000000 --- a/dist/synoptic/cdn/d3.v7.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function n(t,n){return null==t||null==n?NaN:tn?1:t>=n?0:NaN}function e(t,n){return null==t||null==n?NaN:nt?1:n>=t?0:NaN}function r(t){let r,o,a;function u(t,n,e=0,i=t.length){if(e>>1;o(t[r],n)<0?e=r+1:i=r}while(en(t(e),r),a=(n,e)=>t(n)-e):(r=t===n||t===e?t:i,o=t,a=t),{left:u,center:function(t,n,e=0,r=t.length){const i=u(t,n,e,r-1);return i>e&&a(t[i-1],n)>-a(t[i],n)?i-1:i},right:function(t,n,e=0,i=t.length){if(e>>1;o(t[r],n)<=0?e=r+1:i=r}while(e=n&&(yield n);else{let e=-1;for(let r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}const u=r(n),c=u.right,f=u.left,s=r(o).center;var l=c;const h=p(v),d=p((function(t){const n=v(t);return(t,e,r,i,o)=>{n(t,e,0+(r<<=2),0+(i<<=2),o<<=2),n(t,e,r+1,i+1,o),n(t,e,r+2,i+2,o),n(t,e,r+3,i+3,o)}}));function p(t){return function(n,e,r=e){if(!((e=+e)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=n;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(void 0!==a?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!e&&!r)return n;const u=e&&t(e),c=r&&t(r),f=i.slice();return u&&c?(g(u,f,i,o,a),g(u,i,f,o,a),g(u,f,i,o,a),y(c,i,f,o,a),y(c,f,i,o,a),y(c,i,f,o,a)):u?(g(u,i,f,o,a),g(u,f,i,o,a),g(u,i,f,o,a)):c&&(y(c,i,f,o,a),y(c,f,i,o,a),y(c,i,f,o,a)),n}}function g(t,n,e,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let u=t*r[i];const c=a*t;for(let t=i,n=i+c;t{if(!((a-=u)>=o))return;let c=n*i[o];const f=u*n,s=f+u;for(let t=o,n=o+f;t=n&&++e;else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(i=+i)>=i&&++e}return e}function b(t){return 0|t.length}function m(t){return!(t>0)}function x(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function w(t,n){let e,r=0,i=0,o=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(e=n-i,i+=e/++r,o+=e*(n-i));else{let a=-1;for(let u of t)null!=(u=n(u,++a,t))&&(u=+u)>=u&&(e=u-i,i+=e/++r,o+=e*(u-i))}if(r>1)return o/(r-1)}function M(t,n){const e=w(t,n);return e?Math.sqrt(e):e}function A(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r=o&&(e=r=o):(e>o&&(e=o),r0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}class S extends Map{constructor(t,n=P){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[n,e]of t)this.set(n,e)}get(t){return super.get(k(this,t))}has(t){return super.has(k(this,t))}set(t,n){return super.set(N(this,t),n)}delete(t){return super.delete(C(this,t))}}class E extends Set{constructor(t,n=P){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(k(this,t))}add(t){return super.add(N(this,t))}delete(t){return super.delete(C(this,t))}}function k({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function N({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function C({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function P(t){return null!==t&&"object"==typeof t?t.valueOf():t}function z(t){return t}function D(t,...n){return U(t,z,z,n)}function R(t,...n){return U(t,Array.from,z,n)}function F(t,n){for(let e=1,r=n.length;et.pop().map((([n,e])=>[...t,n,e]))));return t}function q(t,n,...e){return U(t,z,n,e)}function I(t,n,...e){return U(t,Array.from,n,e)}function O(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function U(t,n,e,r){return function t(i,o){if(o>=r.length)return e(i);const a=new S,u=r[o++];let c=-1;for(const t of i){const n=u(t,++c,i),e=a.get(n);e?e.push(t):a.set(n,[t])}for(const[n,e]of a)a.set(n,t(e,o));return n(a)}(t,0)}function B(t,n){return Array.from(n,(n=>t[n]))}function Y(t,...n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[e]=n;if(e&&2!==e.length||n.length>1){const r=Uint32Array.from(t,((t,n)=>n));return n.length>1?(n=n.map((n=>t.map(n))),r.sort(((t,e)=>{for(const r of n){const n=j(r[t],r[e]);if(n)return n}}))):(e=t.map(e),r.sort(((t,n)=>j(e[t],e[n])))),B(t,r)}return t.sort(L(e))}function L(t=n){if(t===n)return j;if("function"!=typeof t)throw new TypeError("compare is not a function");return(n,e)=>{const r=t(n,e);return r||0===r?r:(0===t(e,e))-(0===t(n,n))}}function j(t,n){return(null==t||!(t>=t))-(null==n||!(n>=n))||(tn?1:0)}var $=Array.prototype.slice;function H(t){return()=>t}var X=Math.sqrt(50),G=Math.sqrt(10),V=Math.sqrt(2);function W(t,n,e){var r,i,o,a,u=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n0){let e=Math.round(t/a),r=Math.round(n/a);for(e*an&&--r,o=new Array(i=r-e+1);++un&&--r,o=new Array(i=r-e+1);++u=0?(o>=X?10:o>=G?5:o>=V?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=X?10:o>=G?5:o>=V?2:1)}function K(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=X?i*=10:o>=G?i*=5:o>=V&&(i*=2),n0?(t=Math.floor(t/i)*i,n=Math.ceil(n/i)*i):i<0&&(t=Math.ceil(t*i)/i,n=Math.floor(n*i)/i),r=i}}function J(t){return Math.ceil(Math.log(_(t))/Math.LN2)+1}function tt(){var t=z,n=A,e=J;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,u=r.length,c=new Array(u);for(i=0;i=h)if(t>=h&&n===A){const t=Z(s,h,e);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else d.pop()}for(var p=d.length;d[0]<=s;)d.shift(),--p;for(;d[p-1]>h;)d.pop(),--p;var g,y=new Array(p+1);for(i=0;i<=p;++i)(g=y[i]=[]).x0=i>0?d[i-1]:s,g.x1=i0)for(i=0;i=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function et(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e=o)&&(e=o,r=i);return r}function rt(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function it(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e>n||void 0===e&&n>=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e>o||void 0===e&&o>=o)&&(e=o,r=i);return r}function ot(t,n,e=0,r=t.length-1,i){for(i=void 0===i?j:L(i);r>e;){if(r-e>600){const o=r-e+1,a=n-e+1,u=Math.log(o),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(o-c)/o)*(a-o/2<0?-1:1);ot(t,n,Math.max(e,Math.floor(n-a*c/o+f)),Math.min(r,Math.floor(n+(o-a)*c/o+f)),i)}const o=t[n];let a=e,u=r;for(at(t,e,n),i(t[r],o)>0&&at(t,e,r);a0;)--u}0===i(t[e],o)?at(t,e,u):(++u,at(t,u,r)),u<=n&&(e=u+1),n<=u&&(r=u-1)}return t}function at(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function ut(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)>0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r}function ct(t,n,e){if(r=(t=Float64Array.from(a(t,e))).length){if((n=+n)<=0||r<2)return rt(t);if(n>=1)return nt(t);var r,i=(r-1)*n,o=Math.floor(i),u=nt(ot(t,o).subarray(0,o+1));return u+(rt(t.subarray(o+1))-u)*(i-o)}}function ft(t,n,e=o){if(r=t.length){if((n=+n)<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,a=Math.floor(i),u=+e(t[a],a,t);return u+(+e(t[a+1],a+1,t)-u)*(i-a)}}function st(t,n,e){if(r=(t=Float64Array.from(a(t,e))).length){if((n=+n)<=0||r<2)return it(t);if(n>=1)return et(t);var r,i=Math.floor((r-1)*n),o=ot(Uint32Array.from(t,((t,n)=>n)),i,0,r-1,((n,e)=>j(t[n],t[e])));return ut(o.subarray(0,i+1),(n=>t[n]))}}function lt(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}function ht(t,n){return[t,n]}function dt(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r+t(n)}function Et(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function kt(){return!this.__axis}function Nt(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,f=1===t||4===t?-1:1,s=4===t||2===t?"x":"y",l=1===t||3===t?At:Tt;function h(h){var d=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,p=null==i?n.tickFormat?n.tickFormat.apply(n,e):wt:i,g=Math.max(o,0)+u,y=n.range(),v=+y[0]+c,_=+y[y.length-1]+c,b=(n.bandwidth?Et:St)(n.copy(),c),m=h.selection?h.selection():h,x=m.selectAll(".domain").data([null]),w=m.selectAll(".tick").data(d,n).order(),M=w.exit(),A=w.enter().append("g").attr("class","tick"),T=w.select("line"),S=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(A),T=T.merge(A.append("line").attr("stroke","currentColor").attr(s+"2",f*o)),S=S.merge(A.append("text").attr("fill","currentColor").attr(s,f*g).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),h!==m&&(x=x.transition(h),w=w.transition(h),T=T.transition(h),S=S.transition(h),M=M.transition(h).attr("opacity",Mt).attr("transform",(function(t){return isFinite(t=b(t))?l(t+c):this.getAttribute("transform")})),A.attr("opacity",Mt).attr("transform",(function(t){var n=this.parentNode.__axis;return l((n&&isFinite(n=n(t))?n:b(t))+c)}))),M.remove(),x.attr("d",4===t||2===t?a?"M"+f*a+","+v+"H"+c+"V"+_+"H"+f*a:"M"+c+","+v+"V"+_:a?"M"+v+","+f*a+"V"+c+"H"+_+"V"+f*a:"M"+v+","+c+"H"+_),w.attr("opacity",1).attr("transform",(function(t){return l(b(t)+c)})),T.attr(s+"2",f*o),S.attr(s,f*g).text(p),m.filter(kt).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),m.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(n=t,h):n},h.ticks=function(){return e=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(e=null==t?[]:Array.from(t),h):e.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(c=+t,h):c},h}var Ct={value:()=>{}};function Pt(){for(var t,n=0,e=arguments.length,r={};n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++o0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),qt.hasOwnProperty(n)?{space:qt[n],local:t}:t}function Ot(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===Ft&&n.documentElement.namespaceURI===Ft?n.createElement(t):n.createElementNS(e,t)}}function Ut(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Bt(t){var n=It(t);return(n.local?Ut:Ot)(n)}function Yt(){}function Lt(t){return null==t?Yt:function(){return this.querySelector(t)}}function jt(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function $t(){return[]}function Ht(t){return null==t?$t:function(){return this.querySelectorAll(t)}}function Xt(t){return function(){return this.matches(t)}}function Gt(t){return function(n){return n.matches(t)}}var Vt=Array.prototype.find;function Wt(){return this.firstElementChild}var Zt=Array.prototype.filter;function Kt(){return Array.from(this.children)}function Qt(t){return new Array(t.length)}function Jt(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function tn(t,n,e,r,i,o){for(var a,u=0,c=n.length,f=o.length;un?1:t>=n?0:NaN}function an(t){return function(){this.removeAttribute(t)}}function un(t){return function(){this.removeAttributeNS(t.space,t.local)}}function cn(t,n){return function(){this.setAttribute(t,n)}}function fn(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function sn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function ln(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function hn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function dn(t){return function(){this.style.removeProperty(t)}}function pn(t,n,e){return function(){this.style.setProperty(t,n,e)}}function gn(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function yn(t,n){return t.style.getPropertyValue(n)||hn(t).getComputedStyle(t,null).getPropertyValue(n)}function vn(t){return function(){delete this[t]}}function _n(t,n){return function(){this[t]=n}}function bn(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function mn(t){return t.trim().split(/^|\s+/)}function xn(t){return t.classList||new wn(t)}function wn(t){this._node=t,this._names=mn(t.getAttribute("class")||"")}function Mn(t,n){for(var e=xn(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Hn=[null];function Xn(t,n){this._groups=t,this._parents=n}function Gn(){return new Xn([[document.documentElement]],Hn)}function Vn(t){return"string"==typeof t?new Xn([[document.querySelector(t)]],[document.documentElement]):new Xn([[t]],Hn)}Xn.prototype=Gn.prototype={constructor:Xn,select:function(t){"function"!=typeof t&&(t=Lt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=m&&(m=b+1);!(_=y[m])&&++m=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=on);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?dn:"function"==typeof n?gn:pn)(t,n,null==e?"":e)):yn(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?vn:"function"==typeof n?bn:_n)(t,n)):this.node()[t]},classed:function(t,n){var e=mn(t+"");if(arguments.length<2){for(var r=xn(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Yn:Bn,r=0;r()=>t;function ue(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:f,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:s}})}function ce(t){return!t.ctrlKey&&!t.button}function fe(){return this.parentNode}function se(t,n){return null==n?{x:t.x,y:t.y}:n}function le(){return navigator.maxTouchPoints||"ontouchstart"in this}function he(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function de(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function pe(){}ue.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var ge=.7,ye=1/ge,ve="\\s*([+-]?\\d+)\\s*",_e="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",be="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",me=/^#([0-9a-f]{3,8})$/,xe=new RegExp(`^rgb\\(${ve},${ve},${ve}\\)$`),we=new RegExp(`^rgb\\(${be},${be},${be}\\)$`),Me=new RegExp(`^rgba\\(${ve},${ve},${ve},${_e}\\)$`),Ae=new RegExp(`^rgba\\(${be},${be},${be},${_e}\\)$`),Te=new RegExp(`^hsl\\(${_e},${be},${be}\\)$`),Se=new RegExp(`^hsla\\(${_e},${be},${be},${_e}\\)$`),Ee={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ke(){return this.rgb().formatHex()}function Ne(){return this.rgb().formatRgb()}function Ce(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=me.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Pe(n):3===e?new Fe(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?ze(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?ze(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=xe.exec(t))?new Fe(n[1],n[2],n[3],1):(n=we.exec(t))?new Fe(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Me.exec(t))?ze(n[1],n[2],n[3],n[4]):(n=Ae.exec(t))?ze(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Te.exec(t))?Ye(n[1],n[2]/100,n[3]/100,1):(n=Se.exec(t))?Ye(n[1],n[2]/100,n[3]/100,n[4]):Ee.hasOwnProperty(t)?Pe(Ee[t]):"transparent"===t?new Fe(NaN,NaN,NaN,0):null}function Pe(t){return new Fe(t>>16&255,t>>8&255,255&t,1)}function ze(t,n,e,r){return r<=0&&(t=n=e=NaN),new Fe(t,n,e,r)}function De(t){return t instanceof pe||(t=Ce(t)),t?new Fe((t=t.rgb()).r,t.g,t.b,t.opacity):new Fe}function Re(t,n,e,r){return 1===arguments.length?De(t):new Fe(t,n,e,null==r?1:r)}function Fe(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function qe(){return`#${Be(this.r)}${Be(this.g)}${Be(this.b)}`}function Ie(){const t=Oe(this.opacity);return`${1===t?"rgb(":"rgba("}${Ue(this.r)}, ${Ue(this.g)}, ${Ue(this.b)}${1===t?")":`, ${t})`}`}function Oe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ue(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Be(t){return((t=Ue(t))<16?"0":"")+t.toString(16)}function Ye(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new $e(t,n,e,r)}function Le(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof pe||(t=Ce(t)),!t)return new $e;if(t instanceof $e)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new $e(a,u,c,t.opacity)}function je(t,n,e,r){return 1===arguments.length?Le(t):new $e(t,n,e,null==r?1:r)}function $e(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function He(t){return(t=(t||0)%360)<0?t+360:t}function Xe(t){return Math.max(0,Math.min(1,t||0))}function Ge(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}he(pe,Ce,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:ke,formatHex:ke,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Le(this).formatHsl()},formatRgb:Ne,toString:Ne}),he(Fe,Re,de(pe,{brighter(t){return t=null==t?ye:Math.pow(ye,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ge:Math.pow(ge,t),new Fe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Fe(Ue(this.r),Ue(this.g),Ue(this.b),Oe(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qe,formatHex:qe,formatHex8:function(){return`#${Be(this.r)}${Be(this.g)}${Be(this.b)}${Be(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ie,toString:Ie})),he($e,je,de(pe,{brighter(t){return t=null==t?ye:Math.pow(ye,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ge:Math.pow(ge,t),new $e(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new Fe(Ge(t>=240?t-240:t+120,i,r),Ge(t,i,r),Ge(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new $e(He(this.h),Xe(this.s),Xe(this.l),Oe(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Oe(this.opacity);return`${1===t?"hsl(":"hsla("}${He(this.h)}, ${100*Xe(this.s)}%, ${100*Xe(this.l)}%${1===t?")":`, ${t})`}`}}));const Ve=Math.PI/180,We=180/Math.PI,Ze=.96422,Ke=.82521,Qe=4/29,Je=6/29,tr=3*Je*Je;function nr(t){if(t instanceof rr)return new rr(t.l,t.a,t.b,t.opacity);if(t instanceof sr)return lr(t);t instanceof Fe||(t=De(t));var n,e,r=ur(t.r),i=ur(t.g),o=ur(t.b),a=ir((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?n=e=a:(n=ir((.4360747*r+.3850649*i+.1430804*o)/Ze),e=ir((.0139322*r+.0971045*i+.7141733*o)/Ke)),new rr(116*a-16,500*(n-a),200*(a-e),t.opacity)}function er(t,n,e,r){return 1===arguments.length?nr(t):new rr(t,n,e,null==r?1:r)}function rr(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function ir(t){return t>.008856451679035631?Math.pow(t,1/3):t/tr+Qe}function or(t){return t>Je?t*t*t:tr*(t-Qe)}function ar(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function ur(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cr(t){if(t instanceof sr)return new sr(t.h,t.c,t.l,t.opacity);if(t instanceof rr||(t=nr(t)),0===t.a&&0===t.b)return new sr(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function Sr(t,n){return function(e){return t+e*n}}function Er(t,n){var e=n-t;return e?Sr(t,e>180||e<-180?e-360*Math.round(e/360):e):Tr(isNaN(t)?n:t)}function kr(t,n){var e=n-t;return e?Sr(t,e):Tr(isNaN(t)?n:t)}var Nr=function t(n){var e=function(t){return 1==(t=+t)?kr:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Tr(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=Re(t)).r,(n=Re(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=kr(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Cr(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:Ir(e,r)})),o=Br.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Ir(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Ir(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Ir(t,e)},{i:u-2,x:Ir(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(void 0,t),n=n._next;--li}function Ai(){gi=(pi=vi.now())+yi,li=hi=0;try{Mi()}finally{li=0,function(){for(var t,n,e=fi,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:fi=n);si=t,Si(r)}(),gi=0}}function Ti(){var t=vi.now(),n=t-pi;n>1e3&&(yi-=n,pi=t)}function Si(t){li||(hi&&(hi=clearTimeout(hi)),t-gi>24?(t<1/0&&(hi=setTimeout(Ai,t-vi.now()-yi)),di&&(di=clearInterval(di))):(di||(pi=vi.now(),di=setInterval(Ti,1e3)),li=1,_i(Ai)))}function Ei(t,n,e){var r=new xi;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}xi.prototype=wi.prototype={constructor:xi,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?bi():+e)+(null==n?0:+n),this._next||si===this||(si?si._next=this:fi=this,si=this),this._call=t,this._time=e,Si()},stop:function(){this._call&&(this._call=null,this._time=1/0,Si())}};var ki=Pt("start","end","cancel","interrupt"),Ni=[];function Ci(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var f,s,l,h;if(1!==e.state)return u();for(f in i)if((h=i[f]).name===e.name){if(3===h.state)return Ei(o);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+f0)throw new Error("too late; already scheduled");return e}function zi(t,n){var e=Di(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Di(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ri(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function Fi(t,n){var e,r;return function(){var i=zi(this,t),o=i.tween;if(o!==e)for(var a=0,u=(r=e=o).length;a=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Pi:zi;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=It(t),r="transform"===e?Zr:Oi;return this.attrTween(t,"function"==typeof n?(e.local?$i:ji)(e,r,Ii(this,"attr."+t,n)):null==n?(e.local?Bi:Ui)(e):(e.local?Li:Yi)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=It(t);return this.tween(e,(r.local?Hi:Xi)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Wr:Oi;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=yn(this,t),a=(this.style.removeProperty(t),yn(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,Qi(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=yn(this,t),u=e(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=yn(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=n(r=a,u))}}(t,r,Ii(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var c=zi(this,t),f=c.on,s=null==c.value[a]?o||(o=Qi(n)):void 0;f===e&&i===s||(r=(e=f).copy()).on(u,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=yn(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ii(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Di(this.node(),e).tween,o=0,a=i.length;o()=>t;function Co(t,{sourceEvent:n,target:e,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Po(t){t.preventDefault(),t.stopImmediatePropagation()}var zo={name:"drag"},Do={name:"space"},Ro={name:"handle"},Fo={name:"center"};const{abs:qo,max:Io,min:Oo}=Math;function Uo(t){return[+t[0],+t[1]]}function Bo(t){return[Uo(t[0]),Uo(t[1])]}var Yo={name:"x",handles:["w","e"].map(Wo),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Lo={name:"y",handles:["n","s"].map(Wo),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},jo={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Wo),input:function(t){return null==t?null:Bo(t)},output:function(t){return t}},$o={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ho={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Xo={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Go={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Vo={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Wo(t){return{type:t}}function Zo(t){return!t.ctrlKey&&!t.button}function Ko(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Qo(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jo(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function ta(t){var n,e=Ko,r=Zo,i=Qo,o=!0,a=Pt("start","brush","end"),u=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([Wo("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",$o.overlay).merge(e).each((function(){var t=Jo(this).extent;Vn(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([Wo("selection")]).enter().append("rect").attr("class","selection").attr("cursor",$o.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return $o[t.type]})),n.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){var t=Vn(this),n=Jo(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function s(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new l(t,n,e):r}function l(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function h(e){if((!n||e.touches)&&r.apply(this,arguments)){var i,a,u,c,l,h,d,p,g,y,v,_=this,b=e.target.__data__.type,m="selection"===(o&&e.metaKey?b="overlay":b)?zo:o&&e.altKey?Fo:Ro,x=t===Lo?null:Go[b],w=t===Yo?null:Vo[b],M=Jo(_),A=M.extent,T=M.selection,S=A[0][0],E=A[0][1],k=A[1][0],N=A[1][1],C=0,P=0,z=x&&w&&o&&e.shiftKey,D=Array.from(e.touches||[e],(t=>{const n=t.identifier;return(t=Jn(t,_)).point0=t.slice(),t.identifier=n,t}));Ri(_);var R=s(_,arguments,!0).beforestart();if("overlay"===b){T&&(g=!0);const n=[D[0],D[1]||D[0]];M.selection=T=[[i=t===Lo?S:Oo(n[0][0],n[1][0]),u=t===Yo?E:Oo(n[0][1],n[1][1])],[l=t===Lo?k:Io(n[0][0],n[1][0]),d=t===Yo?N:Io(n[0][1],n[1][1])]],D.length>1&&U(e)}else i=T[0][0],u=T[0][1],l=T[1][0],d=T[1][1];a=i,c=u,h=l,p=d;var F=Vn(_).attr("pointer-events","none"),q=F.selectAll(".overlay").attr("cursor",$o[b]);if(e.touches)R.moved=O,R.ended=B;else{var I=Vn(e.view).on("mousemove.brush",O,!0).on("mouseup.brush",B,!0);o&&I.on("keydown.brush",(function(t){switch(t.keyCode){case 16:z=x&&w;break;case 18:m===Ro&&(x&&(l=h-C*x,i=a+C*x),w&&(d=p-P*w,u=c+P*w),m=Fo,U(t));break;case 32:m!==Ro&&m!==Fo||(x<0?l=h-C:x>0&&(i=a-C),w<0?d=p-P:w>0&&(u=c-P),m=Do,q.attr("cursor",$o.selection),U(t));break;default:return}Po(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:z&&(y=v=z=!1,U(t));break;case 18:m===Fo&&(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=Ro,U(t));break;case 32:m===Do&&(t.altKey?(x&&(l=h-C*x,i=a+C*x),w&&(d=p-P*w,u=c+P*w),m=Fo):(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=Ro),q.attr("cursor",$o[b]),U(t));break;default:return}Po(t)}),!0),ie(e.view)}f.call(_),R.start(e,m.name)}function O(t){for(const n of t.changedTouches||[t])for(const t of D)t.identifier===n.identifier&&(t.cur=Jn(n,_));if(z&&!y&&!v&&1===D.length){const t=D[0];qo(t.cur[0]-t[0])>qo(t.cur[1]-t[1])?v=!0:y=!0}for(const t of D)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,Po(t),U(t)}function U(t){const n=D[0],e=n.point0;var r;switch(C=n[0]-e[0],P=n[1]-e[1],m){case Do:case zo:x&&(C=Io(S-i,Oo(k-l,C)),a=i+C,h=l+C),w&&(P=Io(E-u,Oo(N-d,P)),c=u+P,p=d+P);break;case Ro:D[1]?(x&&(a=Io(S,Oo(k,D[0][0])),h=Io(S,Oo(k,D[1][0])),x=1),w&&(c=Io(E,Oo(N,D[0][1])),p=Io(E,Oo(N,D[1][1])),w=1)):(x<0?(C=Io(S-i,Oo(k-i,C)),a=i+C,h=l):x>0&&(C=Io(S-l,Oo(k-l,C)),a=i,h=l+C),w<0?(P=Io(E-u,Oo(N-u,P)),c=u+P,p=d):w>0&&(P=Io(E-d,Oo(N-d,P)),c=u,p=d+P));break;case Fo:x&&(a=Io(S,Oo(k,i-C*x)),h=Io(S,Oo(k,l+C*x))),w&&(c=Io(E,Oo(N,u-P*w)),p=Io(E,Oo(N,d+P*w)))}ht+e))}function sa(t,n){var e=0,r=null,i=null,o=null;function a(a){var u,c=a.length,f=new Array(c),s=fa(0,c),l=new Array(c*c),h=new Array(c),d=0;a=Float64Array.from({length:c*c},n?(t,n)=>a[n%c][n/c|0]:(t,n)=>a[n/c|0][n%c]);for(let n=0;nr(f[t],f[n])));for(const e of s){const r=n;if(t){const t=fa(1+~c,c).filter((t=>t<0?a[~t*c+e]:a[e*c+t]));i&&t.sort(((t,n)=>i(t<0?-a[~t*c+e]:a[e*c+t],n<0?-a[~n*c+e]:a[e*c+n])));for(const r of t)r<0?(l[~r*c+e]||(l[~r*c+e]={source:null,target:null})).target={index:e,startAngle:n,endAngle:n+=a[~r*c+e]*d,value:a[~r*c+e]}:(l[e*c+r]||(l[e*c+r]={source:null,target:null})).source={index:e,startAngle:n,endAngle:n+=a[e*c+r]*d,value:a[e*c+r]};h[e]={index:e,startAngle:r,endAngle:n,value:f[e]}}else{const t=fa(0,c).filter((t=>a[e*c+t]||a[t*c+e]));i&&t.sort(((t,n)=>i(a[e*c+t],a[e*c+n])));for(const r of t){let t;if(eda)if(Math.abs(s*u-c*f)>da&&i){var h=e-o,d=r-a,p=u*u+c*c,g=h*h+d*d,y=Math.sqrt(p),v=Math.sqrt(l),_=i*Math.tan((la-Math.acos((p+l-g)/(2*y*v)))/2),b=_/v,m=_/y;Math.abs(b-1)>da&&(this._+="L"+(t+b*f)+","+(n+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+m*u)+","+(this._y1=n+m*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n)},arc:function(t,n,e,r,i,o){t=+t,n=+n,o=!!o;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,f=n+u,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>da||Math.abs(this._y1-f)>da)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%ha+ha),l>pa?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>da&&(this._+="A"+e+","+e+",0,"+ +(l>=la)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};var va=Array.prototype.slice;function _a(t){return function(){return t}}function ba(t){return t.source}function ma(t){return t.target}function xa(t){return t.radius}function wa(t){return t.startAngle}function Ma(t){return t.endAngle}function Aa(){return 0}function Ta(){return 10}function Sa(t){var n=ba,e=ma,r=xa,i=xa,o=wa,a=Ma,u=Aa,c=null;function f(){var f,s=n.apply(this,arguments),l=e.apply(this,arguments),h=u.apply(this,arguments)/2,d=va.call(arguments),p=+r.apply(this,(d[0]=s,d)),g=o.apply(this,d)-oa,y=a.apply(this,d)-oa,v=+i.apply(this,(d[0]=l,d)),_=o.apply(this,d)-oa,b=a.apply(this,d)-oa;if(c||(c=f=ya()),h>ca&&(na(y-g)>2*h+ca?y>g?(g+=h,y-=h):(g-=h,y+=h):g=y=(g+y)/2,na(b-_)>2*h+ca?b>_?(_+=h,b-=h):(_-=h,b+=h):_=b=(_+b)/2),c.moveTo(p*ea(g),p*ra(g)),c.arc(0,0,p,g,y),g!==_||y!==b)if(t){var m=v-+t.apply(this,arguments),x=(_+b)/2;c.quadraticCurveTo(0,0,m*ea(_),m*ra(_)),c.lineTo(v*ea(x),v*ra(x)),c.lineTo(m*ea(b),m*ra(b))}else c.quadraticCurveTo(0,0,v*ea(_),v*ra(_)),c.arc(0,0,v,_,b);if(c.quadraticCurveTo(0,0,p*ea(g),p*ra(g)),c.closePath(),f)return c=null,f+""||null}return t&&(f.headRadius=function(n){return arguments.length?(t="function"==typeof n?n:_a(+n),f):t}),f.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:_a(+t),f):r},f.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:_a(+t),f):r},f.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:_a(+t),f):i},f.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:_a(+t),f):o},f.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:_a(+t),f):a},f.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:_a(+t),f):u},f.source=function(t){return arguments.length?(n=t,f):n},f.target=function(t){return arguments.length?(e=t,f):e},f.context=function(t){return arguments.length?(c=null==t?null:t,f):c},f}var Ea=Array.prototype.slice;function ka(t,n){return t-n}var Na=t=>()=>t;function Ca(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function za(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function Da(){}var Ra=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function Fa(){var t=1,n=1,e=J,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(ka);else{const e=A(t),r=K(e[0],e[1],n);n=W(Math.floor(e[0]/r)*r,Math.floor(e[1]/r-1)*r,n)}return n.map((n=>o(t,n)))}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,c,f,s,l,h=new Array,d=new Array;for(o=u=-1,f=e[0]>=r,Ra[f<<1].forEach(p);++o=r,Ra[c|f<<1].forEach(p);for(Ra[f<<0].forEach(p);++u=r,s=e[u*t]>=r,Ra[f<<1|s<<2].forEach(p);++o=r,l=s,s=e[u*t+o+1]>=r,Ra[c|f<<1|s<<2|l<<3].forEach(p);Ra[f|s<<3].forEach(p)}for(o=-1,s=e[u*t]>=r,Ra[s<<2].forEach(p);++o=r,Ra[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],c=[t[1][0]+o,t[1][1]+u],f=a(r),s=a(c);(n=d[f])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[f])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=f]=n):h[f]=d[s]={start:f,end:s,ring:[r,c]}}Ra[s<<3].forEach(p)}(e,i,(function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var n,e=0,r=o.length;e0&&a0&&u=0&&o>=0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?Na(Ea.call(t)):Na(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:Da,i):r===u},i}function qa(t){return t[0]}function Ia(t){return t[1]}function Oa(){return 1}const Ua=134217729;function Ba(t,n,e,r,i){let o,a,u,c,f=n[0],s=r[0],l=0,h=0;s>f==s>-f?(o=f,f=n[++l]):(o=s,s=r[++h]);let d=0;if(lf==s>-f?(a=f+o,u=o-(a-f),f=n[++l]):(a=s+o,u=o-(a-s),s=r[++h]),o=a,0!==u&&(i[d++]=u);lf==s>-f?(a=o+f,c=a-o,u=o-(a-c)+(f-c),f=n[++l]):(a=o+s,c=a-o,u=o-(a-c)+(s-c),s=r[++h]),o=a,0!==u&&(i[d++]=u);for(;l0!=u>0)return c;const f=Math.abs(a+u);return Math.abs(c)>=33306690738754716e-32*f?c:-function(t,n,e,r,i,o,a){let u,c,f,s,l,h,d,p,g,y,v,_,b,m,x,w,M,A;const T=t-i,S=e-i,E=n-o,k=r-o;m=T*k,h=Ua*T,d=h-(h-T),p=T-d,h=Ua*k,g=h-(h-k),y=k-g,x=p*y-(m-d*g-p*g-d*y),w=E*S,h=Ua*E,d=h-(h-E),p=E-d,h=Ua*S,g=h-(h-S),y=S-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,La[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,La[1]=b-(v+l)+(l-w),A=_+v,l=A-_,La[2]=_-(A-l)+(v-l),La[3]=A;let N=function(t,n){let e=n[0];for(let t=1;t<4;t++)e+=n[t];return e}(0,La),C=22204460492503146e-32*a;if(N>=C||-N>=C)return N;if(l=t-T,u=t-(T+l)+(l-i),l=e-S,f=e-(S+l)+(l-i),l=n-E,c=n-(E+l)+(l-o),l=r-k,s=r-(k+l)+(l-o),0===u&&0===c&&0===f&&0===s)return N;if(C=11093356479670487e-47*a+33306690738754706e-32*Math.abs(N),N+=T*s+k*u-(E*f+S*c),N>=C||-N>=C)return N;m=u*k,h=Ua*u,d=h-(h-u),p=u-d,h=Ua*k,g=h-(h-k),y=k-g,x=p*y-(m-d*g-p*g-d*y),w=c*S,h=Ua*c,d=h-(h-c),p=c-d,h=Ua*S,g=h-(h-S),y=S-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,Xa[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,Xa[1]=b-(v+l)+(l-w),A=_+v,l=A-_,Xa[2]=_-(A-l)+(v-l),Xa[3]=A;const P=Ba(4,La,4,Xa,ja);m=T*s,h=Ua*T,d=h-(h-T),p=T-d,h=Ua*s,g=h-(h-s),y=s-g,x=p*y-(m-d*g-p*g-d*y),w=E*f,h=Ua*E,d=h-(h-E),p=E-d,h=Ua*f,g=h-(h-f),y=f-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,Xa[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,Xa[1]=b-(v+l)+(l-w),A=_+v,l=A-_,Xa[2]=_-(A-l)+(v-l),Xa[3]=A;const z=Ba(P,ja,4,Xa,$a);m=u*s,h=Ua*u,d=h-(h-u),p=u-d,h=Ua*s,g=h-(h-s),y=s-g,x=p*y-(m-d*g-p*g-d*y),w=c*f,h=Ua*c,d=h-(h-c),p=c-d,h=Ua*f,g=h-(h-f),y=f-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,Xa[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,Xa[1]=b-(v+l)+(l-w),A=_+v,l=A-_,Xa[2]=_-(A-l)+(v-l),Xa[3]=A;const D=Ba(z,$a,4,Xa,Ha);return Ha[D-1]}(t,n,e,r,i,o,f)}const Va=Math.pow(2,-52),Wa=new Uint32Array(512);class Za{static from(t,n=eu,e=ru){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const e=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*e),this._halfedges=new Int32Array(3*e),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:e,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,c=-1/0,f=-1/0;for(let n=0;nc&&(c=e),r>f&&(f=r),this._ids[n]=n}const s=(a+c)/2,l=(u+f)/2;let h,d,p,g=1/0;for(let n=0;n0&&(d=n,g=e)}let _=t[2*d],b=t[2*d+1],m=1/0;for(let n=0;nr&&(n[e++]=i,r=this._dists[i])}return this.hull=n.subarray(0,e),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Ga(y,v,_,b,x,w)<0){const t=d,n=_,e=b;d=p,_=x,b=w,p=t,x=n,w=e}const M=function(t,n,e,r,i,o){const a=e-t,u=r-n,c=i-t,f=o-n,s=a*a+u*u,l=c*c+f*f,h=.5/(a*f-u*c);return{x:t+(f*s-u*l)*h,y:n+(a*l-c*s)*h}}(y,v,_,b,x,w);this._cx=M.x,this._cy=M.y;for(let n=0;n0&&Math.abs(f-o)<=Va&&Math.abs(s-a)<=Va)continue;if(o=f,a=s,c===h||c===d||c===p)continue;let l=0;for(let t=0,n=this._hashKey(f,s);t=0;)if(y=g,y===l){y=-1;break}if(-1===y)continue;let v=this._addTriangle(y,c,e[y],-1,-1,r[y]);r[c]=this._legalize(v+2),r[y]=v,A++;let _=e[y];for(;g=e[_],Ga(f,s,t[2*_],t[2*_+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(_,c,g,r[c],-1,r[_]),r[c]=this._legalize(v+2),e[_]=_,A--,_=g;if(y===l)for(;g=n[y],Ga(f,s,t[2*g],t[2*g+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(g,c,y,-1,r[y],r[g]),this._legalize(v+2),r[g]=v,e[y]=y,A--,y=g;this._hullStart=n[c]=y,e[y]=n[_]=c,e[c]=_,i[this._hashKey(f,s)]=c,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(A);for(let t=0,n=this._hullStart;t0?3-e:1+e)/4}(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:e,coords:r}=this;let i=0,o=0;for(;;){const a=e[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=Wa[--i];continue}const c=a-a%3,f=u+(t+1)%3,s=c+(a+2)%3,l=n[o],h=n[t],d=n[f],p=n[s];if(Qa(r[2*l],r[2*l+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=l;const r=e[s];if(-1===r){let n=this._hullStart;do{if(this._hullTri[n]===s){this._hullTri[n]=t;break}n=this._hullPrev[n]}while(n!==this._hullStart)}this._link(t,r),this._link(a,e[o]),this._link(o,s);const u=c+(a+1)%3;i=e&&n[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=e+1,o=r;nu(t,e+r>>1,i),n[t[e]]>n[t[r]]&&nu(t,e,r),n[t[i]]>n[t[r]]&&nu(t,i,r),n[t[e]]>n[t[i]]&&nu(t,e,i);const a=t[i],u=n[a];for(;;){do{i++}while(n[t[i]]u);if(o=o-e?(tu(t,n,i,r),tu(t,n,e,o-1)):(tu(t,n,e,o-1),tu(t,n,i,r))}}function nu(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function eu(t){return t[0]}function ru(t){return t[1]}const iu=1e-6;class ou{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,e){const r=(t=+t)+(e=+e),i=n=+n;if(e<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>iu||Math.abs(this._y1-i)>iu)&&(this._+="L"+r+","+i),e&&(this._+=`A${e},${e},0,1,1,${t-e},${n}A${e},${e},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,n,e,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+e}v${+r}h${-e}Z`}value(){return this._||null}}class au{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class uu{constructor(t,[n,e,r,i]=[0,0,960,500]){if(!((r=+r)>=(n=+n)&&(i=+i)>=(e=+e)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=n,this.ymax=i,this.ymin=e,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:e},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,e.length/3*2);for(let n,r,o=0,a=0,u=e.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(n>=this.ymax)return null;(i=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/e)this.xmax?2:0)|(nthis.ymax?8:0)}}const cu=2*Math.PI,fu=Math.pow;function su(t){return t[0]}function lu(t){return t[1]}function hu(t,n,e){return[t+Math.sin(t+n)*e,n+Math.cos(t-n)*e]}class du{static from(t,n=su,e=lu,r){return new du("length"in t?function(t,n,e,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:n,coords:e}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},((t,n)=>n)).sort(((t,e)=>n[2*t]-n[2*e]||n[2*t+1]-n[2*e+1]));const t=this.collinear[0],e=this.collinear[this.collinear.length-1],r=[n[2*t],n[2*t+1],n[2*e],n[2*e+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,e=n.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new uu(this,t)}*neighbors(t){const{inedges:n,hull:e,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const n=a.indexOf(t);return n>0&&(yield a[n-1]),void(n=0&&i!==e&&i!==r;)e=i;return i}_step(t,n,e){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:c}=this;if(-1===r[t]||!c.length)return(t+1)%(c.length>>1);let f=t,s=fu(n-c[2*t],2)+fu(e-c[2*t+1],2);const l=r[t];let h=l;do{let r=u[h];const l=fu(n-c[2*r],2)+fu(e-c[2*r+1],2);if(l=o?c=!0:10===(r=t.charCodeAt(a++))?f=!0:13===r&&(f=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;a9999?"+"+_u(t,6):_u(t,4)}(t.getUTCFullYear())+"-"+_u(t.getUTCMonth()+1,2)+"-"+_u(t.getUTCDate(),2)+(i?"T"+_u(n,2)+":"+_u(e,2)+":"+_u(r,2)+"."+_u(i,3)+"Z":r?"T"+_u(n,2)+":"+_u(e,2)+":"+_u(r,2)+"Z":e||n?"T"+_u(n,2)+":"+_u(e,2)+"Z":"")}(t):n.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,n){var e,i,o=r(t,(function(t,r){if(e)return e(t,r-1);i=t,e=n?function(t,n){var e=yu(t);return function(r,i){return n(e(r),i,t)}}(t,n):yu(t)}));return o.columns=i||[],o},parseRows:r,format:function(n,e){return null==e&&(e=vu(n)),[e.map(a).join(t)].concat(i(n,e)).join("\n")},formatBody:function(t,n){return null==n&&(n=vu(t)),i(t,n).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}var mu=bu(","),xu=mu.parse,wu=mu.parseRows,Mu=mu.format,Au=mu.formatBody,Tu=mu.formatRows,Su=mu.formatRow,Eu=mu.formatValue,ku=bu("\t"),Nu=ku.parse,Cu=ku.parseRows,Pu=ku.format,zu=ku.formatBody,Du=ku.formatRows,Ru=ku.formatRow,Fu=ku.formatValue;const qu=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();function Iu(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function Ou(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function Uu(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Bu(t,n){return fetch(t,n).then(Uu)}function Yu(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),Bu(n,e).then((function(n){return t(n,r)}))}}var Lu=Yu(xu),ju=Yu(Nu);function $u(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Hu(t){return(n,e)=>Bu(n,e).then((n=>(new DOMParser).parseFromString(n,t)))}var Xu=Hu("application/xml"),Gu=Hu("text/html"),Vu=Hu("image/svg+xml");function Wu(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,c,f,s,l,h,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function Zu(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Ku(t){return t[0]}function Qu(t){return t[1]}function Ju(t,n,e){var r=new tc(null==n?Ku:n,null==e?Qu:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function tc(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function nc(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var ec=Ju.prototype=tc.prototype;function rc(t){return function(){return t}}function ic(t){return 1e-6*(t()-.5)}function oc(t){return t.x+t.vx}function ac(t){return t.y+t.vy}function uc(t){return t.index}function cc(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}ec.copy=function(){var t,n,e=new tc(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=nc(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=nc(n));return e},ec.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return Wu(this.cover(n,e),n,e,t)},ec.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=c.y0)>d||(a=c.x1)=v)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,g.data),b=n-+this._y.call(null,g.data),m=_*_+b*b;if(m=(u=(p+y)/2))?p=u:y=u,(s=a>=(c=(g+v)/2))?g=c:v=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},ec.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function pc(t){return(t=dc(Math.abs(t)))?t[1]:NaN}var gc,yc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function vc(t){if(!(n=yc.exec(t)))throw new Error("invalid format: "+t);var n;return new _c({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function _c(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function bc(t,n){var e=dc(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}vc.prototype=_c.prototype,_c.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var mc={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>bc(100*t,n),r:bc,s:function(t,n){var e=dc(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(gc=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+dc(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function xc(t){return t}var wc,Mc=Array.prototype.map,Ac=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Tc(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?xc:(n=Mc.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?xc:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(Mc.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var n=(t=vc(t)).fill,e=t.align,l=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,v=t.trim,_=t.type;"n"===_?(g=!0,_="g"):mc[_]||(void 0===y&&(y=12),v=!0,_="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",m="$"===h?o:/[%p]/.test(_)?c:"",x=mc[_],w=/[defgprs%]/.test(_);function M(t){var i,o,c,h=b,M=m;if("c"===_)M=x(t)+M,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),y),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),A&&0==+t&&"+"!==l&&(A=!1),h=(A?"("===l?l:f:"-"===l||"("===l?"":l)+h,M=("s"===_?Ac[8+gc/3]:"")+M+(A&&"("===l?")":""),w)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var T=h.length+t.length+M.length,S=T>1)+h+t+M+S.slice(T);break;default:t=S+h+t+M}return u(t)}return y=void 0===y?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,n){var e=l(((t=vc(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(pc(n)/3))),i=Math.pow(10,-r),o=Ac[8+r/3];return function(t){return e(i*t)+o}}}}function Sc(n){return wc=Tc(n),t.format=wc.format,t.formatPrefix=wc.formatPrefix,wc}function Ec(t){return Math.max(0,-pc(Math.abs(t)))}function kc(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(pc(n)/3)))-pc(Math.abs(t)))}function Nc(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,pc(n)-pc(t))+1}t.format=void 0,t.formatPrefix=void 0,Sc({thousands:",",grouping:[3],currency:["$",""]});var Cc=1e-6,Pc=1e-12,zc=Math.PI,Dc=zc/2,Rc=zc/4,Fc=2*zc,qc=180/zc,Ic=zc/180,Oc=Math.abs,Uc=Math.atan,Bc=Math.atan2,Yc=Math.cos,Lc=Math.ceil,jc=Math.exp,$c=Math.hypot,Hc=Math.log,Xc=Math.pow,Gc=Math.sin,Vc=Math.sign||function(t){return t>0?1:t<0?-1:0},Wc=Math.sqrt,Zc=Math.tan;function Kc(t){return t>1?0:t<-1?zc:Math.acos(t)}function Qc(t){return t>1?Dc:t<-1?-Dc:Math.asin(t)}function Jc(t){return(t=Gc(t/2))*t}function tf(){}function nf(t,n){t&&rf.hasOwnProperty(t.type)&&rf[t.type](t,n)}var ef={Feature:function(t,n){nf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Yc(n=(n*=Ic)/2+Rc),a=Gc(n),u=hf*a,c=lf*o+u*Yc(i),f=u*r*Gc(i);Af.add(Bc(f,c)),sf=t,lf=o,hf=a}function Pf(t){return[Bc(t[1],t[0]),Qc(t[2])]}function zf(t){var n=t[0],e=t[1],r=Yc(e);return[r*Yc(n),r*Gc(n),Gc(e)]}function Df(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Rf(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Ff(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function qf(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function If(t){var n=Wc(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var Of,Uf,Bf,Yf,Lf,jf,$f,Hf,Xf,Gf,Vf,Wf,Zf,Kf,Qf,Jf,ts={point:ns,lineStart:rs,lineEnd:is,polygonStart:function(){ts.point=os,ts.lineStart=as,ts.lineEnd=us,xf=new T,Sf.polygonStart()},polygonEnd:function(){Sf.polygonEnd(),ts.point=ns,ts.lineStart=rs,ts.lineEnd=is,Af<0?(df=-(gf=180),pf=-(yf=90)):xf>Cc?yf=90:xf<-1e-6&&(pf=-90),Mf[0]=df,Mf[1]=gf},sphere:function(){df=-(gf=180),pf=-(yf=90)}};function ns(t,n){wf.push(Mf=[df=t,gf=t]),nyf&&(yf=n)}function es(t,n){var e=zf([t*Ic,n*Ic]);if(mf){var r=Rf(mf,e),i=Rf([r[1],-r[0],0],r);If(i),i=Pf(i);var o,a=t-vf,u=a>0?1:-1,c=i[0]*qc*u,f=Oc(a)>180;f^(u*vfyf&&(yf=o):f^(u*vf<(c=(c+360)%360-180)&&cyf&&(yf=n)),f?tcs(df,gf)&&(gf=t):cs(t,gf)>cs(df,gf)&&(df=t):gf>=df?(tgf&&(gf=t)):t>vf?cs(df,t)>cs(df,gf)&&(gf=t):cs(t,gf)>cs(df,gf)&&(df=t)}else wf.push(Mf=[df=t,gf=t]);nyf&&(yf=n),mf=e,vf=t}function rs(){ts.point=es}function is(){Mf[0]=df,Mf[1]=gf,ts.point=ns,mf=null}function os(t,n){if(mf){var e=t-vf;xf.add(Oc(e)>180?e+(e>0?360:-360):e)}else _f=t,bf=n;Sf.point(t,n),es(t,n)}function as(){Sf.lineStart()}function us(){os(_f,bf),Sf.lineEnd(),Oc(xf)>Cc&&(df=-(gf=180)),Mf[0]=df,Mf[1]=gf,mf=null}function cs(t,n){return(n-=t)<0?n+360:n}function fs(t,n){return t[0]-n[0]}function ss(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nzc?t+Math.round(-t/Fc)*Fc:t,n]}function Ts(t,n,e){return(t%=Fc)?n||e?Ms(Es(t),ks(n,e)):Es(t):n||e?ks(n,e):As}function Ss(t){return function(n,e){return[(n+=t)>zc?n-Fc:n<-zc?n+Fc:n,e]}}function Es(t){var n=Ss(t);return n.invert=Ss(-t),n}function ks(t,n){var e=Yc(t),r=Gc(t),i=Yc(n),o=Gc(n);function a(t,n){var a=Yc(n),u=Yc(t)*a,c=Gc(t)*a,f=Gc(n),s=f*e+u*r;return[Bc(c*i-s*o,u*e-f*r),Qc(s*i+c*o)]}return a.invert=function(t,n){var a=Yc(n),u=Yc(t)*a,c=Gc(t)*a,f=Gc(n),s=f*i-c*o;return[Bc(c*i+f*o,u*e+s*r),Qc(s*e-u*r)]},a}function Ns(t){function n(n){return(n=t(n[0]*Ic,n[1]*Ic))[0]*=qc,n[1]*=qc,n}return t=Ts(t[0]*Ic,t[1]*Ic,t.length>2?t[2]*Ic:0),n.invert=function(n){return(n=t.invert(n[0]*Ic,n[1]*Ic))[0]*=qc,n[1]*=qc,n},n}function Cs(t,n,e,r,i,o){if(e){var a=Yc(n),u=Gc(n),c=r*e;null==i?(i=n+r*Fc,o=n-c/2):(i=Ps(a,i),o=Ps(a,o),(r>0?io)&&(i+=r*Fc));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Ds(t,n){return Oc(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function qs(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,E=S*A,k=E>zc,N=y*w;if(c.add(Bc(N*S*Gc(E),v*M+N*Yc(E))),a+=k?A+S*Fc:A,k^p>=e^m>=e){var C=Rf(zf(d),zf(b));If(C);var P=Rf(o,C);If(P);var z=(k^A>=0?-1:1)*Qc(P[2]);(r>z||r===z&&(C[0]||C[1]))&&(u+=k^A>=0?1:-1)}}return(a<-1e-6||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(Bs))}return h}}function Bs(t){return t.length>1}function Ys(t,n){return((t=t.x)[0]<0?t[1]-Dc-Cc:Dc-t[1])-((n=n.x)[0]<0?n[1]-Dc-Cc:Dc-n[1])}As.invert=As;var Ls=Us((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?zc:-zc,c=Oc(o-e);Oc(c-zc)0?Dc:-Dc),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=zc&&(Oc(e-i)Cc?Uc((Gc(n)*(o=Yc(r))*Gc(e)-Gc(r)*(i=Yc(n))*Gc(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*Dc,r.point(-zc,i),r.point(0,i),r.point(zc,i),r.point(zc,0),r.point(zc,-i),r.point(0,-i),r.point(-zc,-i),r.point(-zc,0),r.point(-zc,i);else if(Oc(t[0]-n[0])>Cc){var o=t[0]0,i=Oc(n)>Cc;function o(t,e){return Yc(t)*Yc(e)>n}function a(t,e,r){var i=[1,0,0],o=Rf(zf(t),zf(e)),a=Df(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var f=n*a/c,s=-n*u/c,l=Rf(i,o),h=qf(i,f);Ff(h,qf(o,s));var d=l,p=Df(h,d),g=Df(d,d),y=p*p-g*(Df(h,h)-1);if(!(y<0)){var v=Wc(y),_=qf(d,(-p-v)/g);if(Ff(_,h),_=Pf(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x0^_[1]<(Oc(_[0]-m)zc^(m<=_[0]&&_[0]<=x)){var S=qf(d,(-p+v)/g);return Ff(S,h),[_,Pf(S)]}}}function u(n,e){var i=r?t:zc-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return Us(o,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],g=o(l,h),y=r?g?0:u(l,h):g?u(l+(l<0?zc:-zc),h):0;if(!n&&(f=c=g)&&t.lineStart(),g!==c&&(!(d=a(n,p))||Ds(n,d)||Ds(p,d))&&(p[2]=1),g!==c)s=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1],2),t.lineEnd()),n=d;else if(i&&n&&r^g){var v;y&e||!(v=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||n&&Ds(n,p)||t.point(p[0],p[1]),n=p,c=g,e=y},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,o){Cs(o,t,e,i,n,r)}),r?[0,-t]:[-zc,t-zc])}var $s,Hs,Xs,Gs,Vs=1e9,Ws=-Vs;function Zs(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,f){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||c(i,o)<0^u>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else f.point(o[0],o[1])}function a(r,i){return Oc(r[0]-t)0?0:3:Oc(r[0]-e)0?2:1:Oc(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,f,s,l,h,d,p,g,y,v,_,b=a,m=zs(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]),v=!0,y=!1,p=g=NaN},lineEnd:function(){c&&(M(l,h),d&&y&&m.rejoin(),c.push(m.result())),x.point=w,y&&b.lineEnd()},polygonStart:function(){b=m,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(c=lt(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Fs(c,u,n,o,a),a.polygonEnd()),b=a,c=f=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(f&&s.push([o,a]),v)l=o,h=a,d=u,v=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&y)b.point(o,a);else{var c=[p=Math.max(Ws,Math.min(Vs,p)),g=Math.max(Ws,Math.min(Vs,g))],m=[o=Math.max(Ws,Math.min(Vs,o)),a=Math.max(Ws,Math.min(Vs,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=n[0]-u,h=n[1]-c;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(n[0]=u+s*l,n[1]=c+s*h),!0}}}}}(c,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(y||(b.lineStart(),b.point(c[0],c[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,g=a,y=u}return x}}var Ks={sphere:tf,point:tf,lineStart:function(){Ks.point=Js,Ks.lineEnd=Qs},lineEnd:tf,polygonStart:tf,polygonEnd:tf};function Qs(){Ks.point=Ks.lineEnd=tf}function Js(t,n){Hs=t*=Ic,Xs=Gc(n*=Ic),Gs=Yc(n),Ks.point=tl}function tl(t,n){t*=Ic;var e=Gc(n*=Ic),r=Yc(n),i=Oc(t-Hs),o=Yc(i),a=r*Gc(i),u=Gs*e-Xs*r*o,c=Xs*e+Gs*r*o;$s.add(Bc(Wc(a*a+u*u),c)),Hs=t,Xs=e,Gs=r}function nl(t){return $s=new T,uf(t,Ks),+$s}var el=[null,null],rl={type:"LineString",coordinates:el};function il(t,n){return el[0]=t,el[1]=n,nl(rl)}var ol={Feature:function(t,n){return ul(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=il(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))Cc})).map(c)).concat(dt(Lc(o/d)*d,i,d).filter((function(t){return Oc(t%g)>Cc})).map(f))}return v.lines=function(){return _().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),v.precision(y)):[[r,u],[e,a]]},v.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),v.precision(y)):[[n,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(y=+h,c=dl(o,i,90),f=pl(n,t,y),s=dl(u,a,90),l=pl(r,e,y),v):y},v.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}var yl,vl,_l,bl,ml=t=>t,xl=new T,wl=new T,Ml={point:tf,lineStart:tf,lineEnd:tf,polygonStart:function(){Ml.lineStart=Al,Ml.lineEnd=El},polygonEnd:function(){Ml.lineStart=Ml.lineEnd=Ml.point=tf,xl.add(Oc(wl)),wl=new T},result:function(){var t=xl/2;return xl=new T,t}};function Al(){Ml.point=Tl}function Tl(t,n){Ml.point=Sl,yl=_l=t,vl=bl=n}function Sl(t,n){wl.add(bl*t-_l*n),_l=t,bl=n}function El(){Sl(yl,vl)}var kl,Nl,Cl,Pl,zl=Ml,Dl=1/0,Rl=Dl,Fl=-Dl,ql=Fl,Il={point:function(t,n){tFl&&(Fl=t),nql&&(ql=n)},lineStart:tf,lineEnd:tf,polygonStart:tf,polygonEnd:tf,result:function(){var t=[[Dl,Rl],[Fl,ql]];return Fl=ql=-(Rl=Dl=1/0),t}},Ol=Il,Ul=0,Bl=0,Yl=0,Ll=0,jl=0,$l=0,Hl=0,Xl=0,Gl=0,Vl={point:Wl,lineStart:Zl,lineEnd:Jl,polygonStart:function(){Vl.lineStart=th,Vl.lineEnd=nh},polygonEnd:function(){Vl.point=Wl,Vl.lineStart=Zl,Vl.lineEnd=Jl},result:function(){var t=Gl?[Hl/Gl,Xl/Gl]:$l?[Ll/$l,jl/$l]:Yl?[Ul/Yl,Bl/Yl]:[NaN,NaN];return Ul=Bl=Yl=Ll=jl=$l=Hl=Xl=Gl=0,t}};function Wl(t,n){Ul+=t,Bl+=n,++Yl}function Zl(){Vl.point=Kl}function Kl(t,n){Vl.point=Ql,Wl(Cl=t,Pl=n)}function Ql(t,n){var e=t-Cl,r=n-Pl,i=Wc(e*e+r*r);Ll+=i*(Cl+t)/2,jl+=i*(Pl+n)/2,$l+=i,Wl(Cl=t,Pl=n)}function Jl(){Vl.point=Wl}function th(){Vl.point=eh}function nh(){rh(kl,Nl)}function eh(t,n){Vl.point=rh,Wl(kl=Cl=t,Nl=Pl=n)}function rh(t,n){var e=t-Cl,r=n-Pl,i=Wc(e*e+r*r);Ll+=i*(Cl+t)/2,jl+=i*(Pl+n)/2,$l+=i,Hl+=(i=Pl*t-Cl*n)*(Cl+t),Xl+=i*(Pl+n),Gl+=3*i,Wl(Cl=t,Pl=n)}var ih=Vl;function oh(t){this._context=t}oh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Fc)}},result:tf};var ah,uh,ch,fh,sh,lh=new T,hh={point:tf,lineStart:function(){hh.point=dh},lineEnd:function(){ah&&ph(uh,ch),hh.point=tf},polygonStart:function(){ah=!0},polygonEnd:function(){ah=null},result:function(){var t=+lh;return lh=new T,t}};function dh(t,n){hh.point=ph,uh=fh=t,ch=sh=n}function ph(t,n){fh-=t,sh-=n,lh.add(Wc(fh*fh+sh*sh)),fh=t,sh=n}var gh=hh;function yh(){this._string=[]}function vh(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function _h(t){return function(n){var e=new bh;for(var r in t)e[r]=t[r];return e.stream=n,e}}function bh(){}function mh(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),uf(e,t.stream(Ol)),n(Ol.result()),null!=r&&t.clipExtent(r),t}function xh(t,n,e){return mh(t,(function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])}),e)}function wh(t,n,e){return xh(t,[[0,0],n],e)}function Mh(t,n,e){return mh(t,(function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])}),e)}function Ah(t,n,e){return mh(t,(function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])}),e)}yh.prototype={_radius:4.5,_circle:vh(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=vh(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},bh.prototype={constructor:bh,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Th=Yc(30*Ic);function Sh(t,n){return+n?function(t,n){function e(r,i,o,a,u,c,f,s,l,h,d,p,g,y){var v=f-r,_=s-i,b=v*v+_*_;if(b>4*n&&g--){var m=a+h,x=u+d,w=c+p,M=Wc(m*m+x*x+w*w),A=Qc(w/=M),T=Oc(Oc(w)-1)n||Oc((v*N+_*C)/b-.5)>.3||a*h+u*d+c*p2?t[2]%360*Ic:0,N()):[y*qc,v*qc,_*qc]},E.angle=function(t){return arguments.length?(b=t%360*Ic,N()):b*qc},E.reflectX=function(t){return arguments.length?(m=t?-1:1,N()):m<0},E.reflectY=function(t){return arguments.length?(x=t?-1:1,N()):x<0},E.precision=function(t){return arguments.length?(a=Sh(u,S=t*t),C()):Wc(S)},E.fitExtent=function(t,n){return xh(E,t,n)},E.fitSize=function(t,n){return wh(E,t,n)},E.fitWidth=function(t,n){return Mh(E,t,n)},E.fitHeight=function(t,n){return Ah(E,t,n)},function(){return n=t.apply(this,arguments),E.invert=n.invert&&k,N()}}function Ph(t){var n=0,e=zc/3,r=Ch(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Ic,e=t[1]*Ic):[n*qc,e*qc]},i}function zh(t,n){var e=Gc(t),r=(e+Gc(n))/2;if(Oc(r)0?n<-Dc+Cc&&(n=-Dc+Cc):n>Dc-Cc&&(n=Dc-Cc);var e=i/Xc(Yh(n),r);return[e*Gc(r*t),i-e*Yc(r*t)]}return o.invert=function(t,n){var e=i-n,o=Vc(r)*Wc(t*t+e*e),a=Bc(t,Oc(e))*Vc(e);return e*r<0&&(a-=zc*Vc(t)*Vc(e)),[a/r,2*Uc(Xc(i/o,1/r))-Dc]},o}function jh(t,n){return[t,n]}function $h(t,n){var e=Yc(t),r=t===n?Gc(t):(e-Yc(n))/(n-t),i=e/r+t;if(Oc(r)=0;)n+=e[r].value;else n=1;t.value=n}function ad(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=cd)):void 0===n&&(n=ud);for(var e,r,i,o,a,u=new ld(t),c=[u];e=c.pop();)if((i=n(e.data))&&(a=(i=Array.from(i)).length))for(e.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new ld(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(sd)}function ud(t){return t.children}function cd(t){return Array.isArray(t)?t[1]:null}function fd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function sd(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function ld(t){this.data=t,this.depth=this.height=0,this.parent=null}function hd(t){return null==t?null:dd(t)}function dd(t){if("function"!=typeof t)throw new Error;return t}function pd(){return 0}function gd(t){return function(){return t}}Zh.invert=function(t,n){for(var e,r=n,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=e=(r*(Hh+Xh*i+o*(Gh+Vh*i))-n)/(Hh+3*Xh*i+o*(7*Gh+9*Vh*i)))*r)*i*i,!(Oc(e)Cc&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Jh.invert=qh(Qc),td.invert=qh((function(t){return 2*Uc(t)})),nd.invert=function(t,n){return[-n,2*Uc(jc(t))-Dc]},ld.prototype=ad.prototype={constructor:ld,count:function(){return this.eachAfter(od)},each:function(t,n){let e=-1;for(const r of this)t.call(n,r,++e,this);return this},eachAfter:function(t,n){for(var e,r,i,o=this,a=[o],u=[],c=-1;o=a.pop();)if(u.push(o),e=o.children)for(r=0,i=e.length;r=0;--r)o.push(e[r]);return this},find:function(t,n){let e=-1;for(const r of this)if(t.call(n,r,++e,this))return r},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return ad(this).eachBefore(fd)},[Symbol.iterator]:function*(){var t,n,e,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,n=i.children)for(e=0,r=n.length;e(t=(1664525*t+1013904223)%yd)/yd}function _d(t,n){for(var e,r,i=0,o=(t=function(t,n){let e,r,i=t.length;for(;i;)r=n()*i--|0,e=t[i],t[i]=t[r],t[r]=e;return t}(Array.from(t),n)).length,a=[];i0&&e*e>r*r+i*i}function wd(t,n){for(var e=0;e1e-6?(E+Math.sqrt(E*E-4*S*k))/(2*S):k/E);return{x:r+w+M*N,y:i+A+T*N,r:N}}function Sd(t,n,e){var r,i,o,a,u=t.x-n.x,c=t.y-n.y,f=u*u+c*c;f?(i=n.r+e.r,i*=i,a=t.r+e.r,i>(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function Ed(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function kd(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Nd(t){this._=t,this.next=null,this.previous=null}function Cd(t,n){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var e,r,i,o,a,u,c,f,s,l,h;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(o>2))return e.r+r.r;Sd(r,e,i=t[2]),e=new Nd(e),r=new Nd(r),i=new Nd(i),e.next=i.previous=r,r.next=e.previous=i,i.next=r.previous=e;t:for(c=3;c1&&!jd(t,n););return t.slice(0,n)}function jd(t,n){if("/"===t[n]){let e=0;for(;n>0&&"\\"===t[--n];)++e;if(0==(1&e))return!0}return!1}function $d(t,n){return t.parent===n.parent?1:2}function Hd(t){var n=t.children;return n?n[0]:t.t}function Xd(t){var n=t.children;return n?n[n.length-1]:t.t}function Gd(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function Vd(t,n,e){return t.a.parent===n.parent?t.a:e}function Wd(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function Zd(t,n,e,r,i){for(var o,a=t.children,u=-1,c=a.length,f=t.value&&(i-e)/t.value;++uh&&(h=u),y=s*s*g,(d=Math.max(h/y,y/l))>p){s-=u;break}p=d}v.push(a={value:s,dice:c1?n:1)},e}(Kd),tp=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?n:1)},e}(Kd);function np(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function ep(t,n){return t[0]-n[0]||t[1]-n[1]}function rp(t){const n=t.length,e=[0,1];let r,i=2;for(r=2;r1&&np(t[e[i-2]],t[e[i-1]],t[r])<=0;)--i;e[i++]=r}return e.slice(0,i)}var ip=Math.random,op=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(ip),ap=function t(n){function e(t,e){return arguments.length<2&&(e=t,t=0),t=Math.floor(t),e=Math.floor(e)-t,function(){return Math.floor(n()*e+t)}}return e.source=t,e}(ip),up=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(ip),cp=function t(n){var e=up.source(n);function r(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(ip),fp=function t(n){function e(t){return(t=+t)<=0?()=>0:function(){for(var e=0,r=t;r>1;--r)e+=n();return e+r*n()}}return e.source=t,e}(ip),sp=function t(n){var e=fp.source(n);function r(t){if(0==(t=+t))return n;var r=e(t);return function(){return r()/t}}return r.source=t,r}(ip),lp=function t(n){function e(t){return function(){return-Math.log1p(-n())/t}}return e.source=t,e}(ip),hp=function t(n){function e(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-n(),t)}}return e.source=t,e}(ip),dp=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+t)}}return e.source=t,e}(ip),pp=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-n())/t)})}return e.source=t,e}(ip),gp=function t(n){var e=up.source(n)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-n())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(n(),1/t):()=>1;return function(){do{do{var t=e(),u=1+o*t}while(u<=0);u*=u*u;var c=1-n()}while(c>=1-.0331*t*t*t*t&&Math.log(c)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(ip),yp=function t(n){var e=gp.source(n);function r(t,n){var r=e(t),i=e(n);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(ip),vp=function t(n){var e=pp.source(n),r=yp.source(n);function i(t,n){return t=+t,(n=+n)>=1?()=>t:n<=0?()=>0:function(){for(var i=0,o=t,a=n;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),c=r(u,o-u+1)();c<=a?(i+=u,o-=u,a=(a-c)/(1-c)):(o=u-1,a/=c)}for(var f=a<.5,s=e(f?a:1-a),l=s(),h=0;l<=o;++h)l+=s();return i+(f?h:o-h)}}return i.source=t,i}(ip),_p=function t(n){function e(t,e,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=n=>Math.pow(n,t)),e=null==e?0:+e,r=null==r?1:+r,function(){return e+r*i(-Math.log1p(-n()))}}return e.source=t,e}(ip),bp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){return t+e*Math.tan(Math.PI*n())}}return e.source=t,e}(ip),mp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){var r=n();return t+e*Math.log(r/(1-r))}}return e.source=t,e}(ip),xp=function t(n){var e=gp.source(n),r=vp.source(n);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=e(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var c=-Math.log1p(-n()),f=0;c<=o;++f)c-=Math.log1p(-n());return i+f}}return i.source=t,i}(ip);const wp=1/4294967296;function Mp(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function Ap(t,n){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof n?this.interpolator(n):this.range(n)}return this}const Tp=Symbol("implicit");function Sp(){var t=new S,n=[],e=[],r=Tp;function i(i){let o=t.get(i);if(void 0===o){if(r!==Tp)return r;t.set(i,o=n.push(i)-1)}return e[o%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new S;for(const r of e)t.has(r)||t.set(r,n.push(r)-1);return i},i.range=function(t){return arguments.length?(e=Array.from(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Sp(n,e).unknown(r)},Mp.apply(i,arguments),i}function Ep(){var t,n,e=Sp().unknown(void 0),r=e.domain,i=e.range,o=0,a=1,u=!1,c=0,f=0,s=.5;function l(){var e=r().length,l=an&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(a[0],a[t-1])),r=t>2?Rp:Dp,i=o=null,l}function l(n){return null==n||isNaN(n=+n)?e:(i||(i=r(a.map(t),u,c)))(t(f(n)))}return l.invert=function(e){return f(n((o||(o=r(u,a.map(t),Ir)))(e)))},l.domain=function(t){return arguments.length?(a=Array.from(t,Np),s()):a.slice()},l.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},l.rangeRound=function(t){return u=Array.from(t),c=jr,s()},l.clamp=function(t){return arguments.length?(f=!!t||Pp,s()):f!==Pp},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function Ip(){return qp()(Pp,Pp)}function Op(n,e,r,i){var o,a=K(n,e,r);switch((i=vc(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=kc(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Nc(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=Ec(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function Up(t){var n=t.domain;return t.ticks=function(t){var e=n();return W(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return Op(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,c=o[a],f=o[u],s=10;for(f0;){if((i=Z(c,f,e))===r)return o[a]=c,o[u]=f,n(o);if(i>0)c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i}r=i}return t},t}function Bp(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-n,e)}function Gp(n){const e=n(Yp,Lp),r=e.domain;let i,o,a=10;function u(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}(a),o=function(t){return 10===t?Hp:t===Math.E?Math.exp:n=>Math.pow(t,n)}(a),r()[0]<0?(i=Xp(i),o=Xp(o),n(jp,$p)):n(Yp,Lp),e}return e.base=function(t){return arguments.length?(a=+t,u()):a},e.domain=function(t){return arguments.length?(r(t),u()):r()},e.ticks=t=>{const n=r();let e=n[0],u=n[n.length-1];const c=u0){for(;l<=h;++l)for(f=1;fu)break;p.push(s)}}else for(;l<=h;++l)for(f=a-1;f>=1;--f)if(s=l>0?f/o(-l):f*o(l),!(su)break;p.push(s)}2*p.length{if(null==n&&(n=10),null==r&&(r=10===a?"s":","),"function"!=typeof r&&(a%1||null!=(r=vc(r)).precision||(r.trim=!0),r=t.format(r)),n===1/0)return r;const u=Math.max(1,a*n/e.ticks().length);return t=>{let n=t/o(Math.round(i(t)));return n*ar(Bp(r(),{floor:t=>o(Math.floor(i(t))),ceil:t=>o(Math.ceil(i(t)))})),e}function Vp(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function Wp(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function Zp(t){var n=1,e=t(Vp(n),Wp(n));return e.constant=function(e){return arguments.length?t(Vp(n=+e),Wp(n)):n},Up(e)}function Kp(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function Qp(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Jp(t){return t<0?-t*t:t*t}function tg(t){var n=t(Pp,Pp),e=1;function r(){return 1===e?t(Pp,Pp):.5===e?t(Qp,Jp):t(Kp(e),Kp(1/e))}return n.exponent=function(t){return arguments.length?(e=+t,r()):e},Up(n)}function ng(){var t=tg(qp());return t.copy=function(){return Fp(t,ng()).exponent(t.exponent())},Mp.apply(t,arguments),t}function eg(t){return Math.sign(t)*t*t}var rg=new Date,ig=new Date;function og(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=function(n){return t(n=new Date(+n)),n},i.ceil=function(e){return t(e=new Date(e-1)),n(e,1),t(e),e},i.round=function(t){var n=i(t),e=i.ceil(t);return t-n0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););}))},e&&(i.count=function(n,r){return rg.setTime(+n),ig.setTime(+r),t(rg),t(ig),Math.floor(e(rg,ig))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var ag=og((function(){}),(function(t,n){t.setTime(+t+n)}),(function(t,n){return n-t}));ag.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?og((function(n){n.setTime(Math.floor(n/t)*t)}),(function(n,e){n.setTime(+n+e*t)}),(function(n,e){return(e-n)/t})):ag:null};var ug=ag,cg=ag.range;const fg=1e3,sg=6e4,lg=36e5,hg=864e5,dg=6048e5,pg=31536e6;var gg=og((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,n){t.setTime(+t+n*fg)}),(function(t,n){return(n-t)/fg}),(function(t){return t.getUTCSeconds()})),yg=gg,vg=gg.range,_g=og((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*fg)}),(function(t,n){t.setTime(+t+n*sg)}),(function(t,n){return(n-t)/sg}),(function(t){return t.getMinutes()})),bg=_g,mg=_g.range,xg=og((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*fg-t.getMinutes()*sg)}),(function(t,n){t.setTime(+t+n*lg)}),(function(t,n){return(n-t)/lg}),(function(t){return t.getHours()})),wg=xg,Mg=xg.range,Ag=og((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*sg)/hg),(t=>t.getDate()-1)),Tg=Ag,Sg=Ag.range;function Eg(t){return og((function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),(function(t,n){t.setDate(t.getDate()+7*n)}),(function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*sg)/dg}))}var kg=Eg(0),Ng=Eg(1),Cg=Eg(2),Pg=Eg(3),zg=Eg(4),Dg=Eg(5),Rg=Eg(6),Fg=kg.range,qg=Ng.range,Ig=Cg.range,Og=Pg.range,Ug=zg.range,Bg=Dg.range,Yg=Rg.range,Lg=og((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,n){t.setMonth(t.getMonth()+n)}),(function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),jg=Lg,$g=Lg.range,Hg=og((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,n){t.setFullYear(t.getFullYear()+n)}),(function(t,n){return n.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Hg.every=function(t){return isFinite(t=Math.floor(t))&&t>0?og((function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),(function(n,e){n.setFullYear(n.getFullYear()+e*t)})):null};var Xg=Hg,Gg=Hg.range,Vg=og((function(t){t.setUTCSeconds(0,0)}),(function(t,n){t.setTime(+t+n*sg)}),(function(t,n){return(n-t)/sg}),(function(t){return t.getUTCMinutes()})),Wg=Vg,Zg=Vg.range,Kg=og((function(t){t.setUTCMinutes(0,0,0)}),(function(t,n){t.setTime(+t+n*lg)}),(function(t,n){return(n-t)/lg}),(function(t){return t.getUTCHours()})),Qg=Kg,Jg=Kg.range,ty=og((function(t){t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+n)}),(function(t,n){return(n-t)/hg}),(function(t){return t.getUTCDate()-1})),ny=ty,ey=ty.range;function ry(t){return og((function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCDate(t.getUTCDate()+7*n)}),(function(t,n){return(n-t)/dg}))}var iy=ry(0),oy=ry(1),ay=ry(2),uy=ry(3),cy=ry(4),fy=ry(5),sy=ry(6),ly=iy.range,hy=oy.range,dy=ay.range,py=uy.range,gy=cy.range,yy=fy.range,vy=sy.range,_y=og((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCMonth(t.getUTCMonth()+n)}),(function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),by=_y,my=_y.range,xy=og((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)}),(function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));xy.every=function(t){return isFinite(t=Math.floor(t))&&t>0?og((function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),(function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null};var wy=xy,My=xy.range;function Ay(t,n,e,i,o,a){const u=[[yg,1,fg],[yg,5,5e3],[yg,15,15e3],[yg,30,3e4],[a,1,sg],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,lg],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,hg],[i,2,1728e5],[e,1,dg],[n,1,2592e6],[n,3,7776e6],[t,1,pg]];function c(n,e,i){const o=Math.abs(e-n)/i,a=r((([,,t])=>t)).right(u,o);if(a===u.length)return t.every(K(n/pg,e/pg,i));if(0===a)return ug.every(Math.max(K(n,e,i),1));const[c,f]=u[o/u[a-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:Wv,s:Zv,S:yv,u:vv,U:_v,V:mv,w:xv,W:wv,x:null,X:null,y:Mv,Y:Tv,Z:Ev,"%":Vv},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:kv,e:kv,f:Dv,g:$v,G:Xv,H:Nv,I:Cv,j:Pv,L:zv,m:Rv,M:Fv,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:Wv,s:Zv,S:qv,u:Iv,U:Ov,V:Bv,w:Yv,W:Lv,x:null,X:null,y:jv,Y:Hv,Z:Gv,"%":Vv},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=_.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return A(t,n,e,r)},d:Qy,e:Qy,f:iv,g:Vy,G:Gy,H:tv,I:tv,j:Jy,L:rv,m:Ky,M:nv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s.get(r[0].toLowerCase()),e+r[0].length):-1},q:Zy,Q:av,s:uv,S:ev,u:jy,U:$y,V:Hy,w:Ly,W:Xy,x:function(t,n,r){return A(t,e,n,r)},X:function(t,n,e){return A(t,r,n,e)},y:Vy,Y:Gy,Z:Wy,"%":ov};function w(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Cy(Py(o.y,0,1))).getUTCDay(),r=i>4||0===i?oy.ceil(r):oy(r),r=ny.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Ny(Py(o.y,0,1))).getDay(),r=i>4||0===i?Ng.ceil(r):Ng(r),r=Tg.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Cy(Py(o.y,0,1)).getUTCDay():Ny(Py(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Cy(o)):Ny(o)}}function A(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in Ry?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}var Dy,Ry={"-":"",_:" ",0:"0"},Fy=/^\s*\d+/,qy=/^%/,Iy=/[\\^$*+?|[\]().{}]/g;function Oy(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),n])))}function Ly(t,n,e){var r=Fy.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function jy(t,n,e){var r=Fy.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function $y(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Hy(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Xy(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function Gy(t,n,e){var r=Fy.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Vy(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function Wy(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Zy(t,n,e){var r=Fy.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function Ky(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function Qy(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function Jy(t,n,e){var r=Fy.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function tv(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function nv(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function ev(t,n,e){var r=Fy.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function rv(t,n,e){var r=Fy.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function iv(t,n,e){var r=Fy.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function ov(t,n,e){var r=qy.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function av(t,n,e){var r=Fy.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function uv(t,n,e){var r=Fy.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function cv(t,n){return Oy(t.getDate(),n,2)}function fv(t,n){return Oy(t.getHours(),n,2)}function sv(t,n){return Oy(t.getHours()%12||12,n,2)}function lv(t,n){return Oy(1+Tg.count(Xg(t),t),n,3)}function hv(t,n){return Oy(t.getMilliseconds(),n,3)}function dv(t,n){return hv(t,n)+"000"}function pv(t,n){return Oy(t.getMonth()+1,n,2)}function gv(t,n){return Oy(t.getMinutes(),n,2)}function yv(t,n){return Oy(t.getSeconds(),n,2)}function vv(t){var n=t.getDay();return 0===n?7:n}function _v(t,n){return Oy(kg.count(Xg(t)-1,t),n,2)}function bv(t){var n=t.getDay();return n>=4||0===n?zg(t):zg.ceil(t)}function mv(t,n){return t=bv(t),Oy(zg.count(Xg(t),t)+(4===Xg(t).getDay()),n,2)}function xv(t){return t.getDay()}function wv(t,n){return Oy(Ng.count(Xg(t)-1,t),n,2)}function Mv(t,n){return Oy(t.getFullYear()%100,n,2)}function Av(t,n){return Oy((t=bv(t)).getFullYear()%100,n,2)}function Tv(t,n){return Oy(t.getFullYear()%1e4,n,4)}function Sv(t,n){var e=t.getDay();return Oy((t=e>=4||0===e?zg(t):zg.ceil(t)).getFullYear()%1e4,n,4)}function Ev(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+Oy(n/60|0,"0",2)+Oy(n%60,"0",2)}function kv(t,n){return Oy(t.getUTCDate(),n,2)}function Nv(t,n){return Oy(t.getUTCHours(),n,2)}function Cv(t,n){return Oy(t.getUTCHours()%12||12,n,2)}function Pv(t,n){return Oy(1+ny.count(wy(t),t),n,3)}function zv(t,n){return Oy(t.getUTCMilliseconds(),n,3)}function Dv(t,n){return zv(t,n)+"000"}function Rv(t,n){return Oy(t.getUTCMonth()+1,n,2)}function Fv(t,n){return Oy(t.getUTCMinutes(),n,2)}function qv(t,n){return Oy(t.getUTCSeconds(),n,2)}function Iv(t){var n=t.getUTCDay();return 0===n?7:n}function Ov(t,n){return Oy(iy.count(wy(t)-1,t),n,2)}function Uv(t){var n=t.getUTCDay();return n>=4||0===n?cy(t):cy.ceil(t)}function Bv(t,n){return t=Uv(t),Oy(cy.count(wy(t),t)+(4===wy(t).getUTCDay()),n,2)}function Yv(t){return t.getUTCDay()}function Lv(t,n){return Oy(oy.count(wy(t)-1,t),n,2)}function jv(t,n){return Oy(t.getUTCFullYear()%100,n,2)}function $v(t,n){return Oy((t=Uv(t)).getUTCFullYear()%100,n,2)}function Hv(t,n){return Oy(t.getUTCFullYear()%1e4,n,4)}function Xv(t,n){var e=t.getUTCDay();return Oy((t=e>=4||0===e?cy(t):cy.ceil(t)).getUTCFullYear()%1e4,n,4)}function Gv(){return"+0000"}function Vv(){return"%"}function Wv(t){return+t}function Zv(t){return Math.floor(+t/1e3)}function Kv(n){return Dy=zy(n),t.timeFormat=Dy.format,t.timeParse=Dy.parse,t.utcFormat=Dy.utcFormat,t.utcParse=Dy.utcParse,Dy}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,Kv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var Qv="%Y-%m-%dT%H:%M:%S.%LZ",Jv=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(Qv),t_=Jv,n_=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse(Qv),e_=n_;function r_(t){return new Date(t)}function i_(t){return t instanceof Date?+t:+new Date(+t)}function o_(t,n,e,r,i,o,a,u,c,f){var s=Ip(),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),g=f("%I:%M"),y=f("%I %p"),v=f("%a %d"),_=f("%b %d"),b=f("%B"),m=f("%Y");function x(t){return(c(t)Pr(t[t.length-1]),M_=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(l_),A_=w_(M_),T_=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(l_),S_=w_(T_),E_=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(l_),k_=w_(E_),N_=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(l_),C_=w_(N_),P_=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(l_),z_=w_(P_),D_=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(l_),R_=w_(D_),F_=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(l_),q_=w_(F_),I_=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(l_),O_=w_(I_),U_=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(l_),B_=w_(U_),Y_=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(l_),L_=w_(Y_),j_=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(l_),$_=w_(j_),H_=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(l_),X_=w_(H_),G_=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(l_),V_=w_(G_),W_=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(l_),Z_=w_(W_),K_=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(l_),Q_=w_(K_),J_=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(l_),tb=w_(J_),nb=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(l_),eb=w_(nb),rb=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(l_),ib=w_(rb),ob=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(l_),ab=w_(ob),ub=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(l_),cb=w_(ub),fb=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(l_),sb=w_(fb),lb=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(l_),hb=w_(lb),db=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(l_),pb=w_(db),gb=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(l_),yb=w_(gb),vb=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(l_),_b=w_(vb),bb=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(l_),mb=w_(bb),xb=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(l_),wb=w_(xb),Mb=ui(mr(300,.5,0),mr(-240,.5,1)),Ab=ui(mr(-100,.75,.35),mr(80,1.5,.8)),Tb=ui(mr(260,.75,.35),mr(80,1.5,.8)),Sb=mr(),Eb=Re(),kb=Math.PI/3,Nb=2*Math.PI/3;function Cb(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var Pb=Cb(l_("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),zb=Cb(l_("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),Db=Cb(l_("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Rb=Cb(l_("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Fb(t){return function(){return t}}const qb=Math.abs,Ib=Math.atan2,Ob=Math.cos,Ub=Math.max,Bb=Math.min,Yb=Math.sin,Lb=Math.sqrt,jb=1e-12,$b=Math.PI,Hb=$b/2,Xb=2*$b;function Gb(t){return t>=1?Hb:t<=-1?-Hb:Math.asin(t)}function Vb(t){return t.innerRadius}function Wb(t){return t.outerRadius}function Zb(t){return t.startAngle}function Kb(t){return t.endAngle}function Qb(t){return t&&t.padAngle}function Jb(t,n,e,r,i,o,a){var u=t-e,c=n-r,f=(a?o:-o)/Lb(u*u+c*c),s=f*c,l=-f*u,h=t+s,d=n+l,p=e+s,g=r+l,y=(h+p)/2,v=(d+g)/2,_=p-h,b=g-d,m=_*_+b*b,x=i-o,w=h*g-p*d,M=(b<0?-1:1)*Lb(Ub(0,x*x*m-w*w)),A=(w*b-_*M)/m,T=(-w*_-b*M)/m,S=(w*b+_*M)/m,E=(-w*_+b*M)/m,k=A-y,N=T-v,C=S-y,P=E-v;return k*k+N*N>C*C+P*P&&(A=S,T=E),{cx:A,cy:T,x01:-s,y01:-l,x11:A*(i/x-1),y11:T*(i/x-1)}}var tm=Array.prototype.slice;function nm(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function em(t){this._context=t}function rm(t){return new em(t)}function im(t){return t[0]}function om(t){return t[1]}function am(t,n){var e=Fb(!0),r=null,i=rm,o=null;function a(a){var u,c,f,s=(a=nm(a)).length,l=!1;for(null==r&&(o=i(f=ya())),u=0;u<=s;++u)!(u=s;--l)u.point(y[l],v[l]);u.lineEnd(),u.areaEnd()}g&&(y[f]=+t(h,f,c),v[f]=+n(h,f,c),u.point(r?+r(h,f,c):y[f],e?+e(h,f,c):v[f]))}if(d)return u=null,d+""||null}function f(){return am().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?im:Fb(+t),n="function"==typeof n?n:Fb(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?om:Fb(+e),c.x=function(n){return arguments.length?(t="function"==typeof n?n:Fb(+n),r=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:Fb(+n),c):t},c.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Fb(+t),c):r},c.y=function(t){return arguments.length?(n="function"==typeof t?t:Fb(+t),e=null,c):n},c.y0=function(t){return arguments.length?(n="function"==typeof t?t:Fb(+t),c):n},c.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Fb(+t),c):e},c.lineX0=c.lineY0=function(){return f().x(t).y(n)},c.lineY1=function(){return f().x(t).y(e)},c.lineX1=function(){return f().x(r).y(n)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:Fb(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function cm(t,n){return nt?1:n>=t?0:NaN}function fm(t){return t}em.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var sm=hm(rm);function lm(t){this._curve=t}function hm(t){function n(n){return new lm(t(n))}return n._curve=t,n}function dm(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(hm(t)):n()._curve},t}function pm(){return dm(am().curve(sm))}function gm(){var t=um().curve(sm),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return dm(e())},delete t.lineX0,t.lineEndAngle=function(){return dm(r())},delete t.lineX1,t.lineInnerRadius=function(){return dm(i())},delete t.lineY0,t.lineOuterRadius=function(){return dm(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(hm(t)):n()._curve},t}function ym(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}lm.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};class vm{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}class _m{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,0==this._point++)this._x0=t,this._y0=n;else{const e=ym(this._x0,this._y0),r=ym(this._x0,this._y0=(this._y0+n)/2),i=ym(t,this._y0),o=ym(t,n);this._context.moveTo(...e),this._context.bezierCurveTo(...r,...i,...o)}}}function bm(t){return new vm(t,!0)}function mm(t){return new vm(t,!1)}function xm(t){return new _m(t)}function wm(t){return t.source}function Mm(t){return t.target}function Am(t){let n=wm,e=Mm,r=im,i=om,o=null,a=null;function u(){let u;const c=tm.call(arguments),f=n.apply(this,c),s=e.apply(this,c);if(null==o&&(a=t(u=ya())),a.lineStart(),c[0]=f,a.point(+r.apply(this,c),+i.apply(this,c)),c[0]=s,a.point(+r.apply(this,c),+i.apply(this,c)),a.lineEnd(),u)return a=null,u+""||null}return u.source=function(t){return arguments.length?(n=t,u):n},u.target=function(t){return arguments.length?(e=t,u):e},u.x=function(t){return arguments.length?(r="function"==typeof t?t:Fb(+t),u):r},u.y=function(t){return arguments.length?(i="function"==typeof t?t:Fb(+t),u):i},u.context=function(n){return arguments.length?(null==n?o=a=null:a=t(o=n),u):o},u}const Tm=Lb(3);var Sm={draw(t,n){const e=.59436*Lb(n+Bb(n/28,.75)),r=e/2,i=r*Tm;t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},Em={draw(t,n){const e=Lb(n/$b);t.moveTo(e,0),t.arc(0,0,e,0,Xb)}},km={draw(t,n){const e=Lb(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}};const Nm=Lb(1/3),Cm=2*Nm;var Pm={draw(t,n){const e=Lb(n/Cm),r=e*Nm;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},zm={draw(t,n){const e=.62625*Lb(n);t.moveTo(0,-e),t.lineTo(e,0),t.lineTo(0,e),t.lineTo(-e,0),t.closePath()}},Dm={draw(t,n){const e=.87559*Lb(n-Bb(n/7,2));t.moveTo(-e,0),t.lineTo(e,0),t.moveTo(0,e),t.lineTo(0,-e)}},Rm={draw(t,n){const e=Lb(n),r=-e/2;t.rect(r,r,e,e)}},Fm={draw(t,n){const e=.4431*Lb(n);t.moveTo(e,e),t.lineTo(e,-e),t.lineTo(-e,-e),t.lineTo(-e,e),t.closePath()}};const qm=Yb($b/10)/Yb(7*$b/10),Im=Yb(Xb/10)*qm,Om=-Ob(Xb/10)*qm;var Um={draw(t,n){const e=Lb(.8908130915292852*n),r=Im*e,i=Om*e;t.moveTo(0,-e),t.lineTo(r,i);for(let n=1;n<5;++n){const o=Xb*n/5,a=Ob(o),u=Yb(o);t.lineTo(u*e,-a*e),t.lineTo(a*r-u*i,u*r+a*i)}t.closePath()}};const Bm=Lb(3);var Ym={draw(t,n){const e=-Lb(n/(3*Bm));t.moveTo(0,2*e),t.lineTo(-Bm*e,-e),t.lineTo(Bm*e,-e),t.closePath()}};const Lm=Lb(3);var jm={draw(t,n){const e=.6824*Lb(n),r=e/2,i=e*Lm/2;t.moveTo(0,-e),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}};const $m=-.5,Hm=Lb(3)/2,Xm=1/Lb(12),Gm=3*(Xm/2+1);var Vm={draw(t,n){const e=Lb(n/Gm),r=e/2,i=e*Xm,o=r,a=e*Xm+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo($m*r-Hm*i,Hm*r+$m*i),t.lineTo($m*o-Hm*a,Hm*o+$m*a),t.lineTo($m*u-Hm*c,Hm*u+$m*c),t.lineTo($m*r+Hm*i,$m*i-Hm*r),t.lineTo($m*o+Hm*a,$m*a-Hm*o),t.lineTo($m*u+Hm*c,$m*c-Hm*u),t.closePath()}},Wm={draw(t,n){const e=.6189*Lb(n-Bb(n/6,1.7));t.moveTo(-e,-e),t.lineTo(e,e),t.moveTo(-e,e),t.lineTo(e,-e)}};const Zm=[Em,km,Pm,Rm,Um,Ym,Vm],Km=[Em,Dm,Wm,jm,Sm,Fm,zm];function Qm(){}function Jm(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function tx(t){this._context=t}function nx(t){this._context=t}function ex(t){this._context=t}function rx(t,n){this._basis=new tx(t),this._beta=n}tx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Jm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Jm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},nx.prototype={areaStart:Qm,areaEnd:Qm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Jm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},ex.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Jm(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},rx.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var ix=function t(n){function e(t){return 1===n?new tx(t):new rx(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function ox(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function ax(t,n){this._context=t,this._k=(1-n)/6}ax.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ox(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:ox(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var ux=function t(n){function e(t){return new ax(t,n)}return e.tension=function(n){return t(+n)},e}(0);function cx(t,n){this._context=t,this._k=(1-n)/6}cx.prototype={areaStart:Qm,areaEnd:Qm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:ox(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var fx=function t(n){function e(t){return new cx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function sx(t,n){this._context=t,this._k=(1-n)/6}sx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:ox(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var lx=function t(n){function e(t){return new sx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function hx(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>jb){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>jb){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function dx(t,n){this._context=t,this._alpha=n}dx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:hx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var px=function t(n){function e(t){return n?new dx(t,n):new ax(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function gx(t,n){this._context=t,this._alpha=n}gx.prototype={areaStart:Qm,areaEnd:Qm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:hx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var yx=function t(n){function e(t){return n?new gx(t,n):new cx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function vx(t,n){this._context=t,this._alpha=n}vx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:hx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var _x=function t(n){function e(t){return n?new vx(t,n):new sx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function bx(t){this._context=t}function mx(t){return t<0?-1:1}function xx(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(mx(o)+mx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function wx(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function Mx(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function Ax(t){this._context=t}function Tx(t){this._context=new Sx(t)}function Sx(t){this._context=t}function Ex(t){this._context=t}function kx(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function zx(t,n){return t[n]}function Dx(t){const n=[];return n.key=t,n}function Rx(t){var n=t.map(Fx);return Px(t).sort((function(t,e){return n[t]-n[e]}))}function Fx(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function qx(t){var n=t.map(Ix);return Px(t).sort((function(t,e){return n[t]-n[e]}))}function Ix(t){for(var n,e=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var Ox=t=>()=>t;function Ux(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Bx(t,n,e){this.k=t,this.x=n,this.y=e}Bx.prototype={constructor:Bx,scale:function(t){return 1===t?this:new Bx(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new Bx(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Yx=new Bx(1,0,0);function Lx(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Yx;return t.__zoom}function jx(t){t.stopImmediatePropagation()}function $x(t){t.preventDefault(),t.stopImmediatePropagation()}function Hx(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Xx(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function Gx(){return this.__zoom||Yx}function Vx(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Wx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zx(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}Lx.prototype=Bx.prototype,t.Adder=T,t.Delaunay=du,t.FormatSpecifier=_c,t.InternMap=S,t.InternSet=E,t.Node=ld,t.Voronoi=uu,t.ZoomTransform=Bx,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>1&&e.name===n)return new to([[t]],ko,n,+r);return null},t.arc=function(){var t=Vb,n=Wb,e=Fb(0),r=null,i=Zb,o=Kb,a=Qb,u=null;function c(){var c,f,s=+t.apply(this,arguments),l=+n.apply(this,arguments),h=i.apply(this,arguments)-Hb,d=o.apply(this,arguments)-Hb,p=qb(d-h),g=d>h;if(u||(u=c=ya()),ljb)if(p>Xb-jb)u.moveTo(l*Ob(h),l*Yb(h)),u.arc(0,0,l,h,d,!g),s>jb&&(u.moveTo(s*Ob(d),s*Yb(d)),u.arc(0,0,s,d,h,g));else{var y,v,_=h,b=d,m=h,x=d,w=p,M=p,A=a.apply(this,arguments)/2,T=A>jb&&(r?+r.apply(this,arguments):Lb(s*s+l*l)),S=Bb(qb(l-s)/2,+e.apply(this,arguments)),E=S,k=S;if(T>jb){var N=Gb(T/s*Yb(A)),C=Gb(T/l*Yb(A));(w-=2*N)>jb?(m+=N*=g?1:-1,x-=N):(w=0,m=x=(h+d)/2),(M-=2*C)>jb?(_+=C*=g?1:-1,b-=C):(M=0,_=b=(h+d)/2)}var P=l*Ob(_),z=l*Yb(_),D=s*Ob(x),R=s*Yb(x);if(S>jb){var F,q=l*Ob(b),I=l*Yb(b),O=s*Ob(m),U=s*Yb(m);if(p<$b&&(F=function(t,n,e,r,i,o,a,u){var c=e-t,f=r-n,s=a-i,l=u-o,h=l*c-s*f;if(!(h*h1?0:t<-1?$b:Math.acos(t)}((B*L+Y*j)/(Lb(B*B+Y*Y)*Lb(L*L+j*j)))/2),H=Lb(F[0]*F[0]+F[1]*F[1]);E=Bb(S,(s-H)/($-1)),k=Bb(S,(l-H)/($+1))}}M>jb?k>jb?(y=Jb(O,U,P,z,l,k,g),v=Jb(q,I,D,R,l,k,g),u.moveTo(y.cx+y.x01,y.cy+y.y01),kjb&&w>jb?E>jb?(y=Jb(D,R,q,I,s,-E,g),v=Jb(P,z,O,U,s,-E,g),u.lineTo(y.cx+y.x01,y.cy+y.y01),E=0))throw new RangeError("invalid r");let e=t.length;if(!((e=Math.floor(e))>=0))throw new RangeError("invalid length");if(!e||!n)return t;const r=v(n),i=t.slice();return r(t,i,0,e,1),r(i,t,0,e,1),r(t,i,0,e,1),t},t.blur2=h,t.blurImage=d,t.brush=function(){return ta(jo)},t.brushSelection=function(t){var n=t.__brush;return n?n.dim.output(n.selection):null},t.brushX=function(){return ta(Yo)},t.brushY=function(){return ta(Lo)},t.buffer=function(t,n){return fetch(t,n).then(Ou)},t.chord=function(){return sa(!1,!1)},t.chordDirected=function(){return sa(!0,!1)},t.chordTranspose=function(){return sa(!1,!0)},t.cluster=function(){var t=ed,n=1,e=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(rd,0)/t.length}(e),n.y=function(t){return 1+t.reduce(id,0)}(e)):(n.x=o?a+=t(n,o):0,n.y=0,o=n)}));var u=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=u.x-t(u,c)/2,s=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.color=Ce,t.contourDensity=function(){var t=qa,n=Ia,e=Oa,r=960,i=500,o=20,a=2,u=3*o,c=r+2*u>>a,f=i+2*u>>a,s=Na(20);function l(r){var i=new Float32Array(c*f),s=Math.pow(2,-a),l=-1;for(const o of r){var d=(t(o,++l,r)+u)*s,p=(n(o,l,r)+u)*s,g=+e(o,l,r);if(d>=0&&d=0&&pt*r)))(n).map(((t,n)=>(t.value=+e[n],p(t))))}function p(t){return t.coordinates.forEach(g),t}function g(t){t.forEach(y)}function y(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function _(){return c=r+2*(u=3*o)>>a,f=i+2*u>>a,d}return d.contours=function(t){var n=l(t),e=Fa().size([c,f]),r=Math.pow(2,2*a),i=t=>{t=+t;var i=p(e.contour(n,t*r));return i.value=t,i};return Object.defineProperty(i,"max",{get:()=>nt(n)/r}),i},d.x=function(n){return arguments.length?(t="function"==typeof n?n:Na(+n),d):t},d.y=function(t){return arguments.length?(n="function"==typeof t?t:Na(+t),d):n},d.weight=function(t){return arguments.length?(e="function"==typeof t?t:Na(+t),d):e},d.size=function(t){if(!arguments.length)return[r,i];var n=+t[0],e=+t[1];if(!(n>=0&&e>=0))throw new Error("invalid size");return r=n,i=e,_()},d.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),_()},d.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?Na(Ea.call(t)):Na(t),d):s},d.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,_()},d},t.contours=Fa,t.count=_,t.create=function(t){return Vn(Bt(t).call(document.documentElement))},t.creator=Bt,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),e=(t=t.map(x)).map(b),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(m))return o;for(;;){o.push(i.map(((n,e)=>t[e][n])));let a=r;for(;++i[a]===e[a];){if(0===a)return n?o.map(n):o;i[a--]=0}}},t.csv=Lu,t.csvFormat=Mu,t.csvFormatBody=Au,t.csvFormatRow=Su,t.csvFormatRows=Tu,t.csvFormatValue=Eu,t.csvParse=xu,t.csvParseRows=wu,t.cubehelix=mr,t.cumsum=function(t,n){var e=0,r=0;return Float64Array.from(t,void 0===n?t=>e+=+t||0:i=>e+=+n(i,r++,t)||0)},t.curveBasis=function(t){return new tx(t)},t.curveBasisClosed=function(t){return new nx(t)},t.curveBasisOpen=function(t){return new ex(t)},t.curveBumpX=bm,t.curveBumpY=mm,t.curveBundle=ix,t.curveCardinal=ux,t.curveCardinalClosed=fx,t.curveCardinalOpen=lx,t.curveCatmullRom=px,t.curveCatmullRomClosed=yx,t.curveCatmullRomOpen=_x,t.curveLinear=rm,t.curveLinearClosed=function(t){return new bx(t)},t.curveMonotoneX=function(t){return new Ax(t)},t.curveMonotoneY=function(t){return new Tx(t)},t.curveNatural=function(t){return new Ex(t)},t.curveStep=function(t){return new Nx(t,.5)},t.curveStepAfter=function(t){return new Nx(t,1)},t.curveStepBefore=function(t){return new Nx(t,0)},t.descending=e,t.deviation=M,t.difference=function(t,...n){t=new E(t);for(const e of n)for(const n of e)t.delete(n);return t},t.disjoint=function(t,n){const e=n[Symbol.iterator](),r=new E;for(const n of t){if(r.has(n))return!1;let t,i;for(;({value:t,done:i}=e.next())&&!i;){if(Object.is(n,t))return!1;r.add(t)}}return!0},t.dispatch=Pt,t.drag=function(){var t,n,e,r,i=ce,o=fe,a=se,u=le,c={},f=Pt("start","drag","end"),s=0,l=0;function h(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",v,te).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var c=b(this,o.call(this,a,u),a,u,"mouse");c&&(Vn(a.view).on("mousemove.drag",p,ne).on("mouseup.drag",g,ne),ie(a.view),ee(a),e=!1,t=a.clientX,n=a.clientY,c("start",a))}}function p(r){if(re(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>l}c.mouse("drag",r)}function g(t){Vn(t.view).on("mousemove.drag mouseup.drag",null),oe(t.view,e),re(t),c.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,u=o.call(this,t,n),c=a.length;for(e=0;e+t,t.easePoly=co,t.easePolyIn=ao,t.easePolyInOut=co,t.easePolyOut=uo,t.easeQuad=io,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=io,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=lo,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*so)},t.easeSinInOut=lo,t.easeSinOut=function(t){return Math.sin(t*so)},t.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(!n(r,++e,t))return!1;return!0},t.extent=A,t.fcumsum=function(t,n){const e=new T;let r=-1;return Float64Array.from(t,void 0===n?t=>e.add(+t||0):i=>e.add(+n(i,++r,t)||0))},t.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const e=[];let r=-1;for(const i of t)n(i,++r,t)&&e.push(i);return e},t.flatGroup=function(t,...n){return F(R(t,...n),n)},t.flatRollup=function(t,n,...e){return F(I(t,n,...e),e)},t.forceCenter=function(t,n){var e,r=1;function i(){var i,o,a=e.length,u=0,c=0;for(i=0;if+p||os+p||ac.index){var g=f-u.x-u.vx,y=s-u.y-u.vy,v=g*g+y*y;vt.r&&(t.r=t[n].r)}function c(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r[u(t,n,r),t])));for(a=0,i=new Array(f);a=u)){(t.data!==n||t.next)&&(0===l&&(p+=(l=ic(e))*l),0===h&&(p+=(h=ic(e))*h),p(t=(1664525*t+1013904223)%fc)/fc}();function l(){h(),f.call("tick",n),e1?(null==e?u.delete(t):u.set(t,p(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},t.forceX=function(t){var n,e,r,i=rc(.1);function o(t){for(var i,o=0,a=n.length;o=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++ecs(r[0],r[1])&&(r[1]=i[1]),cs(i[0],r[1])>cs(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=cs(r[1],i[0]))>a&&(a=u,df=i[0],gf=r[1])}return wf=Mf=null,df===1/0||pf===1/0?[[NaN,NaN],[NaN,NaN]]:[[df,pf],[gf,yf]]},t.geoCentroid=function(t){Of=Uf=Bf=Yf=Lf=jf=$f=Hf=0,Xf=new T,Gf=new T,Vf=new T,uf(t,ls);var n=+Xf,e=+Gf,r=+Vf,i=$c(n,e,r);return i2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=nd,t.gray=function(t,n){return new rr(t,0,0,null==n?1:n)},t.greatest=ut,t.greatestIndex=function(t,e=n){if(1===e.length)return et(t,e);let r,i=-1,o=-1;for(const n of t)++o,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=o);return i},t.group=D,t.groupSort=function(t,e,r){return(2!==e.length?Y(q(t,e,r),(([t,e],[r,i])=>n(e,i)||n(t,r))):Y(D(t,r),(([t,r],[i,o])=>e(r,o)||n(t,i)))).map((([t])=>t))},t.groups=R,t.hcl=fr,t.hierarchy=ad,t.histogram=tt,t.hsl=je,t.html=Gu,t.image=function(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))},t.index=function(t,...n){return U(t,z,O,n)},t.indexes=function(t,...n){return U(t,Array.from,O,n)},t.interpolate=Lr,t.interpolateArray=function(t,n){return(Rr(n)?Dr:Fr)(t,n)},t.interpolateBasis=Mr,t.interpolateBasisClosed=Ar,t.interpolateBlues=hb,t.interpolateBrBG=A_,t.interpolateBuGn=L_,t.interpolateBuPu=$_,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=Tb,t.interpolateCubehelix=ai,t.interpolateCubehelixDefault=Mb,t.interpolateCubehelixLong=ui,t.interpolateDate=qr,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateGnBu=X_,t.interpolateGreens=pb,t.interpolateGreys=yb,t.interpolateHcl=ri,t.interpolateHclLong=ii,t.interpolateHsl=ti,t.interpolateHslLong=ni,t.interpolateHue=function(t,n){var e=Er(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateInferno=Db,t.interpolateLab=function(t,n){var e=kr((t=er(t)).l,(n=er(n)).l),r=kr(t.a,n.a),i=kr(t.b,n.b),o=kr(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateMagma=zb,t.interpolateNumber=Ir,t.interpolateNumberArray=Dr,t.interpolateObject=Or,t.interpolateOrRd=V_,t.interpolateOranges=wb,t.interpolatePRGn=S_,t.interpolatePiYG=k_,t.interpolatePlasma=Rb,t.interpolatePuBu=Q_,t.interpolatePuBuGn=Z_,t.interpolatePuOr=C_,t.interpolatePuRd=tb,t.interpolatePurples=_b,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return Sb.h=360*t-100,Sb.s=1.5-1.5*n,Sb.l=.8-.9*n,Sb+""},t.interpolateRdBu=z_,t.interpolateRdGy=R_,t.interpolateRdPu=eb,t.interpolateRdYlBu=q_,t.interpolateRdYlGn=O_,t.interpolateReds=mb,t.interpolateRgb=Nr,t.interpolateRgbBasis=Pr,t.interpolateRgbBasisClosed=zr,t.interpolateRound=jr,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,Eb.r=255*(n=Math.sin(t))*n,Eb.g=255*(n=Math.sin(t+kb))*n,Eb.b=255*(n=Math.sin(t+Nb))*n,Eb+""},t.interpolateSpectral=B_,t.interpolateString=Yr,t.interpolateTransformCss=Wr,t.interpolateTransformSvg=Zr,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=Pb,t.interpolateWarm=Ab,t.interpolateYlGn=ab,t.interpolateYlGnBu=ib,t.interpolateYlOrBr=cb,t.interpolateYlOrRd=sb,t.interpolateZoom=Qr,t.interrupt=Ri,t.intersection=function(t,...n){t=new E(t),n=n.map(bt);t:for(const e of t)for(const r of n)if(!r.has(e)){t.delete(e);continue t}return t},t.interval=function(t,n,e){var r=new xi,i=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?bi():+e,r._restart((function o(a){a+=i,r._restart(o,i+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)},t.isoFormat=t_,t.isoParse=e_,t.json=function(t,n){return fetch(t,n).then($u)},t.lab=er,t.lch=function(t,n,e,r){return 1===arguments.length?cr(t):new sr(e,n,t,null==r?1:r)},t.least=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)<0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r},t.leastIndex=pt,t.line=am,t.lineRadial=pm,t.link=Am,t.linkHorizontal=function(){return Am(bm)},t.linkRadial=function(){const t=Am(xm);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return Am(mm)},t.local=Zn,t.map=function(t,n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof n)throw new TypeError("mapper is not a function");return Array.from(t,((e,r)=>n(e,r,t)))},t.matcher=Xt,t.max=nt,t.maxIndex=et,t.mean=function(t,n){let e=0,r=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++e,r+=n);else{let i=-1;for(let o of t)null!=(o=n(o,++i,t))&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e},t.median=function(t,n){return ct(t,.5,n)},t.medianIndex=function(t,n){return st(t,.5,n)},t.merge=lt,t.min=rt,t.minIndex=it,t.mode=function(t,n){const e=new S;if(void 0===n)for(let n of t)null!=n&&n>=n&&e.set(n,(e.get(n)||0)+1);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&i>=i&&e.set(i,(e.get(i)||0)+1)}let r,i=0;for(const[t,n]of e)n>i&&(i=n,r=t);return r},t.namespace=It,t.namespaces=qt,t.nice=Q,t.now=bi,t.pack=function(){var t=null,n=1,e=1,r=pd;function i(i){const o=vd();return i.x=n/2,i.y=e/2,t?i.eachBefore(zd(t)).eachAfter(Dd(r,.5,o)).eachBefore(Rd(1)):i.eachBefore(zd(Pd)).eachAfter(Dd(pd,1,o)).eachAfter(Dd(r,i.r/Math.min(n,e),o)).eachBefore(Rd(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=hd(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:gd(+t),i):r},i},t.packEnclose=function(t){return _d(t,vd())},t.packSiblings=function(t){return Cd(t,vd()),t},t.pairs=function(t,n=ht){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&qd(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,f=d?(v-h*b)/d:0;u0?l*f:0)+b,g[c]={data:a[c],index:u,value:l,startAngle:y,endAngle:s,padAngle:_};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:Fb(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Fb(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:Fb(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Fb(+t),a):o},a},t.piecewise=ci,t.pointRadial=ym,t.pointer=Jn,t.pointers=function(t,n){return t.target&&(t=Qn(t),void 0===n&&(n=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>Jn(t,n)))},t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eu!=f>u&&a<(c-e)*(u-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[o[n]][2]]);for(n=+u;n(n=1664525*n+1013904223|0,wp*(n>>>0))},t.randomLogNormal=cp,t.randomLogistic=mp,t.randomNormal=up,t.randomPareto=hp,t.randomPoisson=xp,t.randomUniform=op,t.randomWeibull=_p,t.range=dt,t.rank=function(t,e=n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let r=Array.from(t);const i=new Float64Array(r.length);2!==e.length&&(r=r.map(e),e=n);const o=(t,n)=>e(r[t],r[n]);let a,u;return Uint32Array.from(r,((t,n)=>n)).sort(e===n?(t,n)=>j(r[t],r[n]):L(o)).forEach(((t,n)=>{const e=o(t,void 0===a?t:a);e>=0?((void 0===a||e>0)&&(a=t,u=n),i[t]=u):i[t]=NaN})),i},t.reduce=function(t,n,e){if("function"!=typeof n)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:e}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)e=n(e,o,++a,t);return e},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=Re,t.ribbon=function(){return Sa()},t.ribbonArrow=function(){return Sa(Ta)},t.rollup=q,t.rollups=I,t.scaleBand=Ep,t.scaleDiverging=function t(){var n=Up(f_()(Pp));return n.copy=function(){return u_(n,t())},Ap.apply(n,arguments)},t.scaleDivergingLog=function t(){var n=Gp(f_()).domain([.1,1,10]);return n.copy=function(){return u_(n,t()).base(n.base())},Ap.apply(n,arguments)},t.scaleDivergingPow=s_,t.scaleDivergingSqrt=function(){return s_.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var n=Zp(f_());return n.copy=function(){return u_(n,t()).constant(n.constant())},Ap.apply(n,arguments)},t.scaleIdentity=function t(n){var e;function r(t){return null==t||isNaN(t=+t)?e:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,Np),r):n.slice()},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,Np):[0,1],Up(r)},t.scaleImplicit=Tp,t.scaleLinear=function t(){var n=Ip();return n.copy=function(){return Fp(n,t())},Mp.apply(n,arguments),Up(n)},t.scaleLog=function t(){const n=Gp(qp()).domain([1,10]);return n.copy=()=>Fp(n,t()).base(n.base()),Mp.apply(n,arguments),n},t.scaleOrdinal=Sp,t.scalePoint=function(){return kp(Ep.apply(null,arguments).paddingInner(1))},t.scalePow=ng,t.scaleQuantile=function t(){var e,r=[],i=[],o=[];function a(){var t=0,n=Math.max(1,i.length);for(o=new Array(n-1);++t0?o[n-1]:r[0],n=i?[o[i-1],r]:[o[n-1],o[n]]},u.unknown=function(t){return arguments.length?(n=t,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return t().domain([e,r]).range(a).unknown(n)},Mp.apply(Up(u),arguments)},t.scaleRadial=function t(){var n,e=Ip(),r=[0,1],i=!1;function o(t){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(t));return isNaN(r)?n:i?Math.round(r):r}return o.invert=function(t){return e.invert(eg(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((r=Array.from(t,Np)).map(eg)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t(e.domain(),r).round(i).clamp(e.clamp()).unknown(n)},Mp.apply(o,arguments),Up(o)},t.scaleSequential=function t(){var n=Up(a_()(Pp));return n.copy=function(){return u_(n,t())},Ap.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=Gp(a_()).domain([1,10]);return n.copy=function(){return u_(n,t()).base(n.base())},Ap.apply(n,arguments)},t.scaleSequentialPow=c_,t.scaleSequentialQuantile=function t(){var e=[],r=Pp;function i(t){if(null!=t&&!isNaN(t=+t))return r((l(e,t,1)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(n),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return e.map(((t,n)=>r(n/(e.length-1))))},i.quantiles=function(t){return Array.from({length:t+1},((n,r)=>ct(e,r/t)))},i.copy=function(){return t(r).domain(e)},Ap.apply(i,arguments)},t.scaleSequentialSqrt=function(){return c_.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=Zp(a_());return n.copy=function(){return u_(n,t()).constant(n.constant())},Ap.apply(n,arguments)},t.scaleSqrt=function(){return ng.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var n=Zp(qp());return n.copy=function(){return Fp(n,t()).constant(n.constant())},Mp.apply(n,arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[l(e,t,0,i)]:n}return o.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),o):e.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t().domain(e).range(r).unknown(n)},Mp.apply(o,arguments)},t.scaleTime=function(){return Mp.apply(o_(Ey,ky,Xg,jg,kg,Tg,wg,bg,yg,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return Mp.apply(o_(Ty,Sy,wy,by,iy,ny,Qg,Wg,yg,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,n){const e=pt(t,n);return e<0?void 0:e},t.schemeAccent=d_,t.schemeBlues=lb,t.schemeBrBG=M_,t.schemeBuGn=Y_,t.schemeBuPu=j_,t.schemeCategory10=h_,t.schemeDark2=p_,t.schemeGnBu=H_,t.schemeGreens=db,t.schemeGreys=gb,t.schemeOrRd=G_,t.schemeOranges=xb,t.schemePRGn=T_,t.schemePaired=g_,t.schemePastel1=y_,t.schemePastel2=v_,t.schemePiYG=E_,t.schemePuBu=K_,t.schemePuBuGn=W_,t.schemePuOr=N_,t.schemePuRd=J_,t.schemePurples=vb,t.schemeRdBu=P_,t.schemeRdGy=D_,t.schemeRdPu=nb,t.schemeRdYlBu=F_,t.schemeRdYlGn=I_,t.schemeReds=bb,t.schemeSet1=__,t.schemeSet2=b_,t.schemeSet3=m_,t.schemeSpectral=U_,t.schemeTableau10=x_,t.schemeYlGn=ob,t.schemeYlGnBu=rb,t.schemeYlOrBr=ub,t.schemeYlOrRd=fb,t.select=Vn,t.selectAll=function(t){return"string"==typeof t?new Xn([document.querySelectorAll(t)],[document.documentElement]):new Xn([jt(t)],Hn)},t.selection=Gn,t.selector=Lt,t.selectorAll=Ht,t.shuffle=gt,t.shuffler=yt,t.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(n(r,++e,t))return!0;return!1},t.sort=Y,t.stack=function(){var t=Fb([]),n=Px,e=Cx,r=zx;function i(i){var o,a,u=Array.from(t.apply(this,arguments),Dx),c=u.length,f=-1;for(const t of i)for(o=0,++f;o0)for(var e,r,i,o,a,u,c=0,f=t[n[0]].length;c0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;afunction(t){let n=(t=`${t}`).length;return jd(t,n-1)&&!jd(t,n-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(n,e,r)))),e=n.map(Ld),i=new Set(n).add("");for(const t of e)i.has(t)||(i.add(t),n.push(t),e.push(Ld(t)),h.push(Ud));d=(t,e)=>n[e],p=(t,n)=>e[n]}for(a=0,i=h.length;a=0&&(f=h[t]).data===Ud;--t)f.data=null}if(u.parent=Id,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(sd),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(n=hd(t),r):n},r.parentId=function(t){return arguments.length?(e=hd(t),r):e},r.path=function(n){return arguments.length?(t=hd(n),r):t},r},t.style=yn,t.subset=function(t,n){return mt(n,t)},t.sum=function(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e},t.superset=mt,t.svg=Vu,t.symbol=function(t,n){let e=null;function r(){let r;if(e||(e=r=ya()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),r)return e=null,r+""||null}return t="function"==typeof t?t:Fb(t||Em),n="function"==typeof n?n:Fb(void 0===n?64:+n),r.type=function(n){return arguments.length?(t="function"==typeof n?n:Fb(n),r):t},r.size=function(t){return arguments.length?(n="function"==typeof t?t:Fb(+t),r):n},r.context=function(t){return arguments.length?(e=null==t?null:t,r):e},r},t.symbolAsterisk=Sm,t.symbolCircle=Em,t.symbolCross=km,t.symbolDiamond=Pm,t.symbolDiamond2=zm,t.symbolPlus=Dm,t.symbolSquare=Rm,t.symbolSquare2=Fm,t.symbolStar=Um,t.symbolTriangle=Ym,t.symbolTriangle2=jm,t.symbolWye=Vm,t.symbolX=Wm,t.symbols=Zm,t.symbolsFill=Zm,t.symbolsStroke=Km,t.text=Bu,t.thresholdFreedmanDiaconis=function(t,n,e){return Math.ceil((e-n)/(2*(ct(t,.75)-ct(t,.25))*Math.pow(_(t),-1/3)))},t.thresholdScott=function(t,n,e){return Math.ceil((e-n)*Math.cbrt(_(t))/(3.49*M(t)))},t.thresholdSturges=J,t.tickFormat=Op,t.tickIncrement=Z,t.tickStep=K,t.ticks=W,t.timeDay=Tg,t.timeDays=Sg,t.timeFormatDefaultLocale=Kv,t.timeFormatLocale=zy,t.timeFriday=Dg,t.timeFridays=Bg,t.timeHour=wg,t.timeHours=Mg,t.timeInterval=og,t.timeMillisecond=ug,t.timeMilliseconds=cg,t.timeMinute=bg,t.timeMinutes=mg,t.timeMonday=Ng,t.timeMondays=qg,t.timeMonth=jg,t.timeMonths=$g,t.timeSaturday=Rg,t.timeSaturdays=Yg,t.timeSecond=yg,t.timeSeconds=vg,t.timeSunday=kg,t.timeSundays=Fg,t.timeThursday=zg,t.timeThursdays=Ug,t.timeTickInterval=ky,t.timeTicks=Ey,t.timeTuesday=Cg,t.timeTuesdays=Ig,t.timeWednesday=Pg,t.timeWednesdays=Og,t.timeWeek=kg,t.timeWeeks=Fg,t.timeYear=Xg,t.timeYears=Gg,t.timeout=Ei,t.timer=wi,t.timerFlush=Mi,t.transition=no,t.transpose=vt,t.tree=function(){var t=$d,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,a=new Wd(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new Wd(r[i],i)),e.parent=n;return(a.parent=new Wd(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),g=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=Xd(u),o=Hd(o),u&&o;)c=Hd(c),(a=Xd(a)).a=n,(i=u.z+l-o.z-f+t(u._,o._))>0&&(Gd(Vd(u,n,r),n,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!Xd(a)&&(a.t=u,a.m+=l-s),o&&!Hd(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=Jd,n=!1,e=1,r=1,i=[0],o=pd,a=pd,u=pd,c=pd,f=pd;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Fd),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}for(var l=f[n],h=r/2+l,d=n+1,p=e-1;d>>1;f[g]c-o){var _=r?(i*v+a*y)/r:a;t(n,d,y,i,o,_,c),t(d,e,v,_,o,a,c)}else{var b=r?(o*v+c*y)/r:c;t(n,d,y,i,o,a,b),t(d,e,v,i,b,a,c)}}(0,c,t.value,n,e,r,i)},t.treemapDice=qd,t.treemapResquarify=tp,t.treemapSlice=Zd,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?Zd:qd)(t,n,e,r,i)},t.treemapSquarify=Jd,t.tsv=ju,t.tsvFormat=Pu,t.tsvFormatBody=zu,t.tsvFormatRow=Ru,t.tsvFormatRows=Du,t.tsvFormatValue=Fu,t.tsvParse=Nu,t.tsvParseRows=Cu,t.union=function(...t){const n=new E;for(const e of t)for(const t of e)n.add(t);return n},t.utcDay=ny,t.utcDays=ey,t.utcFriday=fy,t.utcFridays=yy,t.utcHour=Qg,t.utcHours=Jg,t.utcMillisecond=ug,t.utcMilliseconds=cg,t.utcMinute=Wg,t.utcMinutes=Zg,t.utcMonday=oy,t.utcMondays=hy,t.utcMonth=by,t.utcMonths=my,t.utcSaturday=sy,t.utcSaturdays=vy,t.utcSecond=yg,t.utcSeconds=vg,t.utcSunday=iy,t.utcSundays=ly,t.utcThursday=cy,t.utcThursdays=gy,t.utcTickInterval=Sy,t.utcTicks=Ty,t.utcTuesday=ay,t.utcTuesdays=dy,t.utcWednesday=uy,t.utcWednesdays=py,t.utcWeek=iy,t.utcWeeks=ly,t.utcYear=wy,t.utcYears=My,t.variance=w,t.version="7.6.1",t.window=hn,t.xml=Xu,t.zip=function(){return vt(arguments)},t.zoom=function(){var t,n,e,r=Hx,i=Xx,o=Zx,a=Vx,u=Wx,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Qr,h=Pt("start","zoom","end"),d=500,p=0,g=10;function y(t){t.property("__zoom",Gx).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",T).filter(u).on("touchstart.zoom",S).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(c[0],Math.min(c[1],n)))===t.k?t:new Bx(n,t.x,t.y)}function _(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new Bx(t.k,r,i)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function m(t,n,e,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=x(t,o).event(r),u=i.apply(t,o),c=null==e?b(u):"function"==typeof e?e.apply(t,o):e,f=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof n?n.apply(t,o):n,d=l(s.invert(c).concat(f/s.k),h.invert(c).concat(f/h.k));return function(t){if(1===t)t=h;else{var n=d(t),e=f/n[2];t=new Bx(e,c[0]-n[0]*e,c[1]-n[1]*e)}a.zoom(null,t)}}))}function x(t,n,e){return!e&&t.__zooming||new w(t,n)}function w(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function M(t,...n){if(r.apply(this,arguments)){var e=x(this,n).event(t),i=this.__zoom,u=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),s=Jn(t);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=i.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[s,i.invert(s)],Ri(this),e.start()}$x(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),150),e.zoom("mouse",o(_(v(i,u),e.mouse[0],e.mouse[1]),e.extent,f))}}function A(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=x(this,n,!0).event(t),u=Vn(t.view).on("mousemove.zoom",(function(t){if($x(t),!a.moved){var n=t.clientX-s,e=t.clientY-l;a.moved=n*n+e*e>p}a.event(t).zoom("mouse",o(_(a.that.__zoom,a.mouse[0]=Jn(t,i),a.mouse[1]),a.extent,f))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),oe(t.view,a.moved),$x(t),a.event(t).end()}),!0),c=Jn(t,i),s=t.clientX,l=t.clientY;ie(t.view),jx(t),a.mouse=[c,this.__zoom.invert(c)],Ri(this),a.start()}}function T(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=Jn(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),c=e.k*(t.shiftKey?.5:2),l=o(_(v(e,c),a,u),i.apply(this,n),f);$x(t),s>0?Vn(this).transition().duration(s).call(m,l,a,t):Vn(this).call(y.transform,l,a,t)}}function S(e,...i){if(r.apply(this,arguments)){var o,a,u,c,f=e.touches,s=f.length,l=x(this,i,e.changedTouches.length===s).event(e);for(jx(e),a=0;a+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){p()},ae=be((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{H.apply(D=O.call(w.childNodes),w.childNodes),D[w.childNodes.length].nodeType}catch(t){H={apply:D.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function se(e,t,r,i){var o,s,l,c,f,h,y,m=t&&t.ownerDocument,w=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return r;if(!i&&(p(t),t=t||d,g)){if(11!==w&&(f=Z.exec(e)))if(o=f[1]){if(9===w){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return H.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return H.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!A[e+" "]&&(!v||!v.test(e))&&(1!==w||"object"!==t.nodeName.toLowerCase())){if(y=e,m=t,1===w&&(U.test(e)||z.test(e))){for((m=ee.test(e)&&ye(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,ie):t.setAttribute("id",c=b)),s=(h=a(e)).length;s--;)h[s]=(c?"#"+c:":scope")+" "+xe(h[s]);y=h.join(",")}try{return H.apply(r,m.querySelectorAll(y)),r}catch(t){A(e,!0)}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ue(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function le(e){return e[b]=!0,e}function ce(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var n=e.split("|"),i=n.length;i--;)r.attrHandle[n[i]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function de(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ge(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return le((function(t){return t=+t,le((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function ye(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},p=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!=d&&9===a.nodeType&&a.documentElement&&(h=(d=a).documentElement,g=!o(d),w!=d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=ce((function(e){return h.appendChild(e).appendChild(d.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=K.test(d.getElementsByClassName),n.getById=ce((function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],v=[],(n.qsa=K.test(d.querySelectorAll))&&(ce((function(e){var t;h.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+b+"-]").length||v.push("~="),(t=d.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=K.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),y.push("!=",F)})),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=K.test(h.compareDocumentPosition),x=t||K.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==d||e.ownerDocument==w&&x(w,e)?-1:t==d||t.ownerDocument==w&&x(w,t)?1:c?P(c,e)-P(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==d?-1:t==d?1:i?-1:o?1:c?P(c,e)-P(c,t):0;if(i===o)return pe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?pe(a[r],s[r]):a[r]==w?-1:s[r]==w?1:0}),d},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(p(e),n.matchesSelector&&g&&!A[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=se.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return h(t)?w.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?w.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?w.grep(e,(function(e){return-1)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),N.test(r[1])&&w.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,D=w(v);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter((function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=v.createDocumentFragment().appendChild(v.createElement("div")),(fe=v.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),d.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",d.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",d.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?w.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&w(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),v.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||w.expando+"_"+Ct.guid++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",(function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Vt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=h(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Vt,"$1"+i):!1!==t.jsonp&&(t.url+=(Et.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always((function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Xt.push(i)),a&&h(o)&&o(a[0]),a=o=void 0})),"script"})),d.createHTMLDocument=((Ut=v.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),w.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(d.createHTMLDocument?((r=(t=v.implementation.createHTMLDocument("")).createElement("base")).href=v.location.href,t.head.appendChild(r)):t=v),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&w(o).remove(),w.merge([],i.childNodes)));var r,i,o},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(w.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,o||[e.responseText,t,e])}))}),this},w.expr.pseudos.animated=function(e){return w.grep(w.timers,(function(t){return e===t.elem})).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=w.css(e,"position"),c=w(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=w.css(e,"top"),u=w.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),h(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){w.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===w.css(e,"position");)e=e.offsetParent;return e||re}))}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return B(this,(function(e,r,i){var o;if(g(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i}),e,r,arguments.length)}})),w.each(["top","left"],(function(e,t){w.cssHooks[t]=_e(d.pixelPosition,(function(e,n){if(n)return n=Be(e,t),Pe.test(n)?w(e).position()[t]+"px":n}))})),w.each({Height:"height",Width:"width"},(function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return B(this,(function(t,n,i){var o;return g(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)}),t,a?i:void 0,a)}}))})),w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){w.fn[t]=function(e){return this.on(t,e)}})),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){w.fn[t]=function(e,n){return 0t;t++)if(void 0!==this[t])return this[t]},f=function(){for(var t=this.length;--t;)if(void 0!==this[t])return this[t]},c=Object.prototype.toString,h=String,d=Array.isArray||function(t){return t instanceof Array||"[object Array]"==c.call(t)};eve=function(t,r){var i,a=n,o=Array.prototype.slice.call(arguments,2),u=eve.listeners(t),c=0,h=[],d={},p=[],g=e;p.firstDefined=l,p.lastDefined=f,e=t,n=0;for(var v=0,m=u.length;m>v;v++)"zIndex"in u[v]&&(h.push(u[v].zIndex),u[v].zIndex<0&&(d[u[v].zIndex]=u[v]));for(h.sort(s);h[c]<0;)if(i=d[h[c++]],p.push(i.apply(r,o)),n)return n=a,p;for(v=0;m>v;v++)if("zIndex"in(i=u[v]))if(i.zIndex==h[c]){if(p.push(i.apply(r,o)),n)break;do{if((i=d[h[++c]])&&p.push(i.apply(r,o)),n)break}while(i)}else d[i.zIndex]=i;else if(p.push(i.apply(r,o)),n)break;return n=a,e=g,p},eve._events=u,eve.listeners=function(t){var e,n,r,i,o,s,l,f,c=d(t)?t:t.split(a),h=u,p=[h],g=[];for(i=0,o=c.length;o>i;i++){for(f=[],s=0,l=p.length;l>s;s++)for(n=[(h=p[s].n)[c[i]],h["*"]],r=2;r--;)(e=n[r])&&(f.push(e),g=g.concat(e.f||[]));p=f}return g},eve.separator=function(t){t?(t="["+(t=h(t).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",a=new RegExp(t)):a=/[\.\/]/},eve.on=function(t,e){if("function"!=typeof e)return function(){};for(var n=d(t)?d(t[0])?t:[t]:h(t).split(o),r=0,i=n.length;i>r;r++)!function(t){for(var n,r=d(t)?t:h(t).split(a),i=u,o=0,s=r.length;s>o;o++)i=(i=i.n).hasOwnProperty(r[o])&&i[r[o]]||(i[r[o]]={n:{}});for(i.f=i.f||[],o=0,s=i.f.length;s>o;o++)if(i.f[o]==e){n=!0;break}!n&&i.f.push(e)}(n[r]);return function(t){+t==+t&&(e.zIndex=+t)}},eve.f=function(t){var e=[].slice.call(arguments,1);return function(){eve.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},eve.stop=function(){n=1},eve.nt=function(t){var n=d(e)?e.join("."):e;return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(n):n},eve.nts=function(){return d(e)?e:e.split(a)},eve.off=eve.unbind=function(t,e){if(t){var n=d(t)?d(t[0])?t:[t]:h(t).split(o);if(n.length>1)for(var r=0,s=n.length;s>r;r++)eve.off(n[r],e);else{n=d(t)?t:h(t).split(a);var l,f,c,p,g,v=[u],m=[];for(r=0,s=n.length;s>r;r++)for(p=0;pr;r++)for(l=v[r];l.n;){if(e){if(l.f){for(p=0,g=l.f.length;g>p;p++)if(l.f[p]==e){l.f.splice(p,1);break}!l.f.length&&delete l.f}for(f in l.n)if(l.n[i](f)&&l.n[f].f){var y=l.n[f].f;for(p=0,g=y.length;g>p;p++)if(y[p]==e){y.splice(p,1);break}!y.length&&delete l.n[f].f}}else for(f in delete l.f,l.n)l.n[i](f)&&l.n[f].f&&delete l.n[f].f;l=l.n}t:for(r=0,s=m.length;s>r;r++){for(f in(l=m[r]).n[l.name].f)continue t;for(f in l.n[l.name].n)continue t;delete l.n[l.name]}}}else eve._events=u={n:{}}},eve.once=function(t,e){var n=function(){return eve.off(t,n),e.apply(this,arguments)};return eve.on(t,n)},eve.version=r,eve.toString=function(){return"You are running Eve "+r},"undefined"!=typeof module&&module.exports?module.exports=eve:"function"==typeof define&&define.amd?define("eve",[],(function(){return eve})):t.eve=eve}(this),function(t,e){if("function"==typeof define&&define.amd)define(["eve"],(function(n){return e(t,n)}));else if("undefined"!=typeof exports){var n=require("eve");module.exports=e(t,n)}else e(t,t.eve)}(window||this,(function(t,e){var n=function(e){var n,r={},i=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(t){return setTimeout(t,16,(new Date).getTime()),!0},a=Array.isArray||function(t){return t instanceof Array||"[object Array]"==Object.prototype.toString.call(t)},o=0,s="M"+(+new Date).toString(36),u=function(){return s+(o++).toString(36)},l=Date.now||function(){return+new Date},f=function(t){var e=this;if(null==t)return e.s;var n=e.s-t;e.b+=e.dur*n,e.B+=e.dur*n,e.s=t},c=function(t){return null==t?this.spd:void(this.spd=t)},h=function(t){var e=this;return null==t?e.dur:(e.s=e.s*t/e.dur,void(e.dur=t))},d=function(){var t=this;delete r[t.id],t.update(),e("mina.stop."+t.id,t)},p=function(){var t=this;t.pdif||(delete r[t.id],t.update(),t.pdif=t.get()-t.b)},g=function(){var t=this;t.pdif&&(t.b=t.get()-t.pdif,delete t.pdif,r[t.id]=t,m())},v=function(){var t,e=this;if(a(e.start)){t=[];for(var n=0,r=e.start.length;r>n;n++)t[n]=+e.start[n]+(e.end[n]-e.start[n])*e.easing(e.s)}else t=+e.start+(e.end-e.start)*e.easing(e.s);e.set(t)},m=function(t){if(t){var a=0;for(var o in r)if(r.hasOwnProperty(o)){var s=r[o],u=s.get();a++,s.s=(u-s.b)/(s.dur/s.spd),s.s>=1&&(delete r[o],s.s=1,a--,function(t){setTimeout((function(){e("mina.finish."+t.id,t)}))}(s)),s.update()}n=!!a&&i(m)}else n||(n=i(m))},y=function(t,e,n,i,a,o,s){var l={id:u(),start:t,end:e,b:n,s:0,dur:i-n,spd:1,get:a,set:o,easing:s||y.linear,status:f,speed:c,duration:h,stop:d,pause:p,resume:g,update:v};r[l.id]=l;var x,b=0;for(x in r)if(r.hasOwnProperty(x)&&2==++b)break;return 1==b&&m(),l};return y.time=l,y.getById=function(t){return r[t]||null},y.linear=function(t){return t},y.easeout=function(t){return Math.pow(t,1.7)},y.easein=function(t){return Math.pow(t,.48)},y.easeinout=function(t){if(1==t)return 1;if(0==t)return 0;var e=.48-t/1.04,n=Math.sqrt(.1734+e*e),r=n-e,i=-n-e,a=Math.pow(Math.abs(r),1/3)*(0>r?-1:1)+Math.pow(Math.abs(i),1/3)*(0>i?-1:1)+.5;return 3*(1-a)*a*a+a*a*a},y.backin=function(t){if(1==t)return 1;var e=1.70158;return t*t*((e+1)*t-e)},y.backout=function(t){if(0==t)return 0;var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},y.elastic=function(t){return t==!!t?t:Math.pow(2,-10*t)*Math.sin((t-.075)*(2*Math.PI)/.3)+1},y.bounce=function(t){var e=7.5625,n=2.75;return 1/n>t?e*t*t:2/n>t?e*(t-=1.5/n)*t+.75:2.5/n>t?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},t.mina=y,y}(void 0===e?function(){}:e),r=function(t){function n(t,e){if(t){if(t.nodeType)return d(t);if(i(t,"array")&&n.set)return n.set.apply(n,t);if(t instanceof l)return t;if(null==e)try{return d(t=v.doc.querySelector(String(t)))}catch(t){return null}}return new h(t=null==t?"100%":t,e=null==e?"100%":e)}function r(t,e){if(e){if("#text"==t&&(t=v.doc.createTextNode(e.text||e["#text"]||"")),"#comment"==t&&(t=v.doc.createComment(e.text||e["#text"]||"")),"string"==typeof t&&(t=r(t)),"string"==typeof e)return 1==t.nodeType?"xlink:"==e.substring(0,6)?t.getAttributeNS(q,e.substring(6)):"xml:"==e.substring(0,4)?t.getAttributeNS(O,e.substring(4)):t.getAttribute(e):"text"==e?t.nodeValue:null;if(1==t.nodeType){for(var n in e)if(e[m](n)){var i=y(e[n]);i?"xlink:"==n.substring(0,6)?t.setAttributeNS(q,n.substring(6),i):"xml:"==n.substring(0,4)?t.setAttributeNS(O,n.substring(4),i):t.setAttribute(n,i):t.removeAttribute(n)}}else"text"in e&&(t.nodeValue=e.text)}else t=v.doc.createElementNS(O,t);return t}function i(t,e){return"finite"==(e=y.prototype.toLowerCase.call(e))?isFinite(t):!("array"!=e||!(t instanceof Array||Array.isArray&&Array.isArray(t)))||"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||S.call(t).slice(8,-1).toLowerCase()==e}function a(t,e,n){return function r(){var i=Array.prototype.slice.call(arguments,0),a=i.join("␀"),o=r.cache=r.cache||{},s=r.count=r.count||[];return o[m](a)?(function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return t.push(t.splice(n,1)[0])}(s,a),n?n(o[a]):o[a]):(s.length>=1e3&&delete o[s.shift()],s.push(a),o[a]=t.apply(e,i),n?n(o[a]):o[a])}}function o(t){return t%360*A/180}function s(t){return t.node.ownerSVGElement&&d(t.node.ownerSVGElement)||n.select("svg")}function u(t){i(t,"array")||(t=Array.prototype.slice.call(arguments,0));for(var e=0,n=0,r=this.node;this[e];)delete this[e++];for(e=0;en;n++){var i={type:t[n].type,attr:t[n].attr()},a=t[n].children();e.push(i),a.length&&p(a,i.childNodes=[])}}n.version="0.5.1",n.toString=function(){return"Snap v"+this.version},n._={};var v={win:t.window,doc:t.window.document};n._.glob=v;var m="hasOwnProperty",y=String,x=parseFloat,b=parseInt,F=Math,C=F.max,w=F.min,B=F.abs,A=(F.pow,F.PI),E=(F.round,""),S=Object.prototype.toString,k=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?%?)\s*\))\s*$/i,D=(n._.separator=/[,\s]+/,/[\s]*,[\s]*/),_={hs:1,rg:1},T=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,M=/([rstm])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,N=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\s]*,?[\s]*/gi,j=0,P="S"+(+new Date).toString(36),L=function(t){return(t&&t.type?t.type:E)+P+(j++).toString(36)},q="http://www.w3.org/1999/xlink",O="http://www.w3.org/2000/svg",V={};n.url=function(t){return"url('#"+t+"')"},n._.$=r,n._.id=L,n.format=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,n=function(t,n,r){var i=r;return n.replace(e,(function(t,e,n,r,a){e=e||r,i&&(e in i&&(i=i[e]),"function"==typeof i&&a&&(i=i()))})),i=(null==i||i==r?t:i)+""};return function(e,r){return y(e).replace(t,(function(t,e){return n(t,e,r)}))}}(),n._.clone=function t(e){if("function"==typeof e||Object(e)!==e)return e;var n=new e.constructor;for(var r in e)e[m](r)&&(n[r]=t(e[r]));return n},n._.cacher=a,n.rad=o,n.deg=function(t){return 180*t/A%360},n.sin=function(t){return F.sin(n.rad(t))},n.tan=function(t){return F.tan(n.rad(t))},n.cos=function(t){return F.cos(n.rad(t))},n.asin=function(t){return n.deg(F.asin(t))},n.acos=function(t){return n.deg(F.acos(t))},n.atan=function(t){return n.deg(F.atan(t))},n.atan2=function(t){return n.deg(F.atan2(t))},n.angle=function t(e,n,r,i,a,o){if(null==a){var s=e-r,u=n-i;return s||u?(180+180*F.atan2(-u,-s)/A+360)%360:0}return t(e,n,a,o)-t(r,i,a,o)},n.len=function(t,e,r,i){return Math.sqrt(n.len2(t,e,r,i))},n.len2=function(t,e,n,r){return(t-n)*(t-n)+(e-r)*(e-r)},n.closestPoint=function(t,e,n){function r(t){var r=t.x-e,i=t.y-n;return r*r+i*i}for(var i,a,o,s,u=t.node,l=u.getTotalLength(),f=l/u.pathSegList.numberOfItems*.125,c=1/0,h=0;l>=h;h+=f)(s=r(o=u.getPointAtLength(h))).5;){var d,p,g,v,m,y;(g=a-f)>=0&&(m=r(d=u.getPointAtLength(g)))a)return e-a;if(a>t-n)return e-a+t}return e},n.getRGB=a((function(t){if(!t||(t=y(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:I};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:I};if(!(_[m](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=G(t)),!t)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:I};var e,r,a,o,s,u,l=t.match(k);return l?(l[2]&&(a=b(l[2].substring(5),16),r=b(l[2].substring(3,5),16),e=b(l[2].substring(1,3),16)),l[3]&&(a=b((s=l[3].charAt(3))+s,16),r=b((s=l[3].charAt(2))+s,16),e=b((s=l[3].charAt(1))+s,16)),l[4]&&(u=l[4].split(D),e=x(u[0]),"%"==u[0].slice(-1)&&(e*=2.55),r=x(u[1]),"%"==u[1].slice(-1)&&(r*=2.55),a=x(u[2]),"%"==u[2].slice(-1)&&(a*=2.55),"rgba"==l[1].toLowerCase().slice(0,4)&&(o=x(u[3])),u[3]&&"%"==u[3].slice(-1)&&(o/=100)),l[5]?(u=l[5].split(D),e=x(u[0]),"%"==u[0].slice(-1)&&(e/=100),r=x(u[1]),"%"==u[1].slice(-1)&&(r/=100),a=x(u[2]),"%"==u[2].slice(-1)&&(a/=100),("deg"==u[0].slice(-3)||"°"==u[0].slice(-1))&&(e/=360),"hsba"==l[1].toLowerCase().slice(0,4)&&(o=x(u[3])),u[3]&&"%"==u[3].slice(-1)&&(o/=100),n.hsb2rgb(e,r,a,o)):l[6]?(u=l[6].split(D),e=x(u[0]),"%"==u[0].slice(-1)&&(e/=100),r=x(u[1]),"%"==u[1].slice(-1)&&(r/=100),a=x(u[2]),"%"==u[2].slice(-1)&&(a/=100),("deg"==u[0].slice(-3)||"°"==u[0].slice(-1))&&(e/=360),"hsla"==l[1].toLowerCase().slice(0,4)&&(o=x(u[3])),u[3]&&"%"==u[3].slice(-1)&&(o/=100),n.hsl2rgb(e,r,a,o)):(e=w(F.round(e),255),r=w(F.round(r),255),a=w(F.round(a),255),o=w(C(o,0),1),(l={r:e,g:r,b:a,toString:I}).hex="#"+(16777216|a|r<<8|e<<16).toString(16).slice(1),l.opacity=i(o,"finite")?o:1,l)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:I}}),n),n.hsb=a((function(t,e,r){return n.hsb2rgb(t,e,r).hex})),n.hsl=a((function(t,e,r){return n.hsl2rgb(t,e,r).hex})),n.rgb=a((function(t,e,n,r){if(i(r,"finite")){var a=F.round;return"rgba("+[a(t),a(e),a(n),+r.toFixed(2)]+")"}return"#"+(16777216|n|e<<8|t<<16).toString(16).slice(1)}));var G=function(t){var e=v.doc.getElementsByTagName("head")[0]||v.doc.getElementsByTagName("svg")[0],n="rgb(255, 0, 0)";return(G=a((function(t){if("red"==t.toLowerCase())return n;e.style.color=n,e.style.color=t;var r=v.doc.defaultView.getComputedStyle(e,E).getPropertyValue("color");return r==n?null:r})))(t)},z=function(){return"hsb("+[this.h,this.s,this.b]+")"},R=function(){return"hsl("+[this.h,this.s,this.l]+")"},I=function(){return 1==this.opacity||null==this.opacity?this.hex:"rgba("+[this.r,this.g,this.b,this.opacity]+")"},U=function(t,e,r){if(null==e&&i(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(r=t.b,e=t.g,t=t.r),null==e&&i(t,string)){var a=n.getRGB(t);t=a.r,e=a.g,r=a.b}return(t>1||e>1||r>1)&&(t/=255,e/=255,r/=255),[t,e,r]},X=function(t,e,r,a){var o={r:t=F.round(255*t),g:e=F.round(255*e),b:r=F.round(255*r),opacity:i(a,"finite")?a:1,hex:n.rgb(t,e,r),toString:I};return i(a,"finite")&&(o.opacity=a),o};n.color=function(t){var e;return i(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=n.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):i(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=n.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.opacity=1,t.hex=e.hex):(i(t,"string")&&(t=n.getRGB(t)),i(t,"object")&&"r"in t&&"g"in t&&"b"in t&&!("error"in t)?(e=n.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=n.rgb2hsb(t),t.v=e.b):((t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1,t.error=1)),t.toString=I,t},n.hsb2rgb=function(t,e,n,r){var a,o,s,u,l;return i(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(n=t.b,e=t.s,r=t.o,t=t.h),u=(l=n*e)*(1-B((t=(t*=360)%360/60)%2-1)),a=o=s=n-l,X(a+=[l,u,0,0,u,l][t=~~t],o+=[u,l,l,u,0,0][t],s+=[0,0,u,l,l,u][t],r)},n.hsl2rgb=function(t,e,n,r){var a,o,s,u,l;return i(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(n=t.l,e=t.s,t=t.h),(t>1||e>1||n>1)&&(t/=360,e/=100,n/=100),u=(l=2*e*(.5>n?n:1-n))*(1-B((t=(t*=360)%360/60)%2-1)),a=o=s=n-l/2,X(a+=[l,u,0,0,u,l][t=~~t],o+=[u,l,l,u,0,0][t],s+=[0,0,u,l,l,u][t],r)},n.rgb2hsb=function(t,e,n){var r,i;return t=(n=U(t,e,n))[0],e=n[1],n=n[2],{h:((0==(i=(r=C(t,e,n))-w(t,e,n))?null:r==t?(e-n)/i:r==e?(n-t)/i+2:(t-e)/i+4)+360)%6*60/360,s:0==i?0:i/r,b:r,toString:z}},n.rgb2hsl=function(t,e,n){var r,i,a,o;return t=(n=U(t,e,n))[0],e=n[1],n=n[2],r=((i=C(t,e,n))+(a=w(t,e,n)))/2,{h:((0==(o=i-a)?null:i==t?(e-n)/o:i==e?(n-t)/o+2:(t-e)/o+4)+360)%6*60/360,s:0==o?0:.5>r?o/(2*r):o/(2-2*r),l:r,toString:R}},n.parsePathString=function(t){if(!t)return null;var e=n.path(t);if(e.arr)return n.path.clone(e.arr);var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},a=[];return i(t,"array")&&i(t[0],"array")&&(a=n.path.clone(t)),a.length||y(t).replace(T,(function(t,e,n){var i=[],o=e.toLowerCase();if(n.replace(N,(function(t,e){e&&i.push(+e)})),"m"==o&&i.length>2&&(a.push([e].concat(i.splice(0,2))),o="l",e="m"==e?"l":"L"),"o"==o&&1==i.length&&a.push([e,i[0]]),"r"==o)a.push([e].concat(i));else for(;i.length>=r[o]&&(a.push([e].concat(i.splice(0,r[o]))),r[o]););})),a.toString=n.path.toString,e.arr=n.path.clone(a),a};var $=n.parseTransformString=function(t){if(!t)return null;var e=[];return i(t,"array")&&i(t[0],"array")&&(e=n.path.clone(t)),e.length||y(t).replace(M,(function(t,n,r){var i=[];n.toLowerCase(),r.replace(N,(function(t,e){e&&i.push(+e)})),e.push([n].concat(i))})),e.toString=n.path.toString,e};n._.svgTransform2string=function(t){var e=[];return t=t.replace(/(?:^|\s)(\w+)\(([^)]+)\)/g,(function(t,n,r){return r=r.split(/\s*,\s*|\s+/),"rotate"==n&&1==r.length&&r.push(0,0),"scale"==n&&(r.length>2?r=r.slice(0,2):2==r.length&&r.push(0,0),1==r.length&&r.push(r[0],0,0)),"skewX"==n?e.push(["m",1,0,F.tan(o(r[0])),1,0,0]):"skewY"==n?e.push(["m",1,F.tan(o(r[0])),0,1,0,0]):e.push([n.charAt(0)].concat(r)),t})),e},n._.rgTransform=/^[a-z][\s]*-?\.?\d/i,n._.transform2matrix=function(t,e){var r=$(t),i=new n.Matrix;if(r)for(var a=0,o=r.length;o>a;a++){var s,u,l,f,c,h=r[a],d=h.length,p=y(h[0]).toLowerCase(),g=h[0]!=p,v=g?i.invert():0;"t"==p&&2==d?i.translate(h[1],0):"t"==p&&3==d?g?(s=v.x(0,0),u=v.y(0,0),l=v.x(h[1],h[2]),f=v.y(h[1],h[2]),i.translate(l-s,f-u)):i.translate(h[1],h[2]):"r"==p?2==d?(c=c||e,i.rotate(h[1],c.x+c.width/2,c.y+c.height/2)):4==d&&(g?(l=v.x(h[2],h[3]),f=v.y(h[2],h[3]),i.rotate(h[1],l,f)):i.rotate(h[1],h[2],h[3])):"s"==p?2==d||3==d?(c=c||e,i.scale(h[1],h[d-1],c.x+c.width/2,c.y+c.height/2)):4==d?g?(l=v.x(h[2],h[3]),f=v.y(h[2],h[3]),i.scale(h[1],h[1],l,f)):i.scale(h[1],h[1],h[2],h[3]):5==d&&(g?(l=v.x(h[3],h[4]),f=v.y(h[3],h[4]),i.scale(h[1],h[2],l,f)):i.scale(h[1],h[2],h[3],h[4])):"m"==p&&7==d&&i.add(h[1],h[2],h[3],h[4],h[5],h[6])}return i},n._unit2px=function(t,e,n){function i(t){if(null==t)return E;if(t==+t)return t;r(f,{width:t});try{return f.getBBox().width}catch(t){return 0}}function a(t){if(null==t)return E;if(t==+t)return t;r(f,{height:t});try{return f.getBBox().height}catch(t){return 0}}function o(r,i){null==e?l[r]=i(t.attr(r)||0):r==e&&(l=i(null==n?t.attr(r)||0:n))}var u=s(t).node,l={},f=u.querySelector(".svg---mgr");switch(f||(f=r("rect"),r(f,{x:-9e9,y:-9e9,width:10,height:10,class:"svg---mgr",fill:"none"}),u.appendChild(f)),t.type){case"rect":o("rx",i),o("ry",a);case"image":o("width",i),o("height",a);case"text":o("x",i),o("y",a);break;case"circle":o("cx",i),o("cy",a),o("r",i);break;case"ellipse":o("cx",i),o("cy",a),o("rx",i),o("ry",a);break;case"line":o("x1",i),o("x2",i),o("y1",a),o("y2",a);break;case"marker":o("refX",i),o("markerWidth",i),o("refY",a),o("markerHeight",a);break;case"radialGradient":o("fx",i),o("fy",a);break;case"tspan":o("dx",i),o("dy",a);break;default:o(e,i)}return u.removeChild(f),l},v.doc.contains||v.doc.compareDocumentPosition,n._.getSomeDefs=function(t){var e=t.node.ownerSVGElement&&d(t.node.ownerSVGElement)||t.node.parentNode&&d(t.node.parentNode)||n.select("svg")||n(0,0),r=e.select("defs"),i=null!=r&&r.node;return i||(i=c("defs",e.node).node),i},n._.getSomeSVG=s,n.select=function(t){return t=y(t).replace(/([^\\]):/g,"$1\\:"),d(v.doc.querySelector(t))},n.selectAll=function(t){for(var e=v.doc.querySelectorAll(t),r=(n.set||Array)(),i=0;iu;u++)s[o[u].nodeName]=o[u].nodeValue;return s}if(i(t,"string")){if(!(arguments.length>1))return e("snap.util.getattr."+t,r).firstDefined();var f={};f[t]=n,t=f}for(var c in t)t[m](c)&&e("snap.util.attr."+c,r,t[c]);return r},n.parse=function(t){var e=v.doc.createDocumentFragment(),n=!0,r=v.doc.createElement("div");if((t=y(t)).match(/^\s*<\s*svg(?:\s|>)/)||(t=""+t+"",n=!1),r.innerHTML=t,t=r.getElementsByTagName("svg")[0])if(n)e=t;else for(;t.firstChild;)e.appendChild(t.firstChild);return new f(e)},n.fragment=function(){for(var t=Array.prototype.slice.call(arguments,0),e=v.doc.createDocumentFragment(),r=0,i=t.length;i>r;r++){var a=t[r];a.node&&a.node.nodeType&&e.appendChild(a.node),a.nodeType&&e.appendChild(a),"string"==typeof a&&e.appendChild(n.parse(a).node)}return new f(e)},n._.make=c,n._.wrap=d,h.prototype.el=function(t,e){var n=c(t,this.node);return e&&n.attr(e),n},l.prototype.children=function(){for(var t=[],e=this.node.childNodes,r=0,i=e.length;i>r;r++)t[r]=n(e[r]);return t},l.prototype.toJSON=function(){var t=[];return p([this],t),t[0]},e.on("snap.util.getattr",(function(){var t=e.nt(),n=(t=t.substring(t.lastIndexOf(".")+1)).replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}));return H[m](n)?this.node.ownerDocument.defaultView.getComputedStyle(this.node,null).getPropertyValue(n):r(this.node,t)}));var H={"alignment-baseline":0,"baseline-shift":0,clip:0,"clip-path":0,"clip-rule":0,color:0,"color-interpolation":0,"color-interpolation-filters":0,"color-profile":0,"color-rendering":0,cursor:0,direction:0,display:0,"dominant-baseline":0,"enable-background":0,fill:0,"fill-opacity":0,"fill-rule":0,filter:0,"flood-color":0,"flood-opacity":0,font:0,"font-family":0,"font-size":0,"font-size-adjust":0,"font-stretch":0,"font-style":0,"font-variant":0,"font-weight":0,"glyph-orientation-horizontal":0,"glyph-orientation-vertical":0,"image-rendering":0,kerning:0,"letter-spacing":0,"lighting-color":0,marker:0,"marker-end":0,"marker-mid":0,"marker-start":0,mask:0,opacity:0,overflow:0,"pointer-events":0,"shape-rendering":0,"stop-color":0,"stop-opacity":0,stroke:0,"stroke-dasharray":0,"stroke-dashoffset":0,"stroke-linecap":0,"stroke-linejoin":0,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":0,"text-decoration":0,"text-rendering":0,"unicode-bidi":0,visibility:0,"word-spacing":0,"writing-mode":0};e.on("snap.util.attr",(function(t){var n=e.nt(),i={};i[n=n.substring(n.lastIndexOf(".")+1)]=t;var a=n.replace(/-(\w)/gi,(function(t,e){return e.toUpperCase()})),o=n.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}));H[m](o)?this.node.style[a]=null==t?E:t:r(this.node,i)})),h.prototype,n.ajax=function(t,n,r,a){var o=new XMLHttpRequest,s=L();if(o){if(i(n,"function"))a=r,r=n,n=null;else if(i(n,"object")){var u=[];for(var l in n)n.hasOwnProperty(l)&&u.push(encodeURIComponent(l)+"="+encodeURIComponent(n[l]));n=u.join("&")}return o.open(n?"POST":"GET",t,!0),n&&(o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded")),r&&(e.once("snap.ajax."+s+".0",r),e.once("snap.ajax."+s+".200",r),e.once("snap.ajax."+s+".304",r)),o.onreadystatechange=function(){4==o.readyState&&e("snap.ajax."+s+"."+o.status,a,o)},4==o.readyState||o.send(n),o}},n.load=function(t,e,r){n.ajax(t,(function(t){var i=n.parse(t.responseText);r?e.call(r,i):e(i)}))};var Y=function(t){var e=t.getBoundingClientRect(),n=t.ownerDocument,r=n.body,i=n.documentElement,a=i.clientTop||r.clientTop||0,o=i.clientLeft||r.clientLeft||0;return{y:e.top+(g.win.pageYOffset||i.scrollTop||r.scrollTop)-a,x:e.left+(g.win.pageXOffset||i.scrollLeft||r.scrollLeft)-o}};return n.getElementByPoint=function(t,e){var n=(this.canvas,v.doc.elementFromPoint(t,e));if(v.win.opera&&"svg"==n.tagName){var r=Y(n),i=n.createSVGRect();i.x=t-r.x,i.y=e-r.y,i.width=i.height=1;var a=n.getIntersectionList(i,null);a.length&&(n=a[a.length-1])}return n?d(n):null},n.plugin=function(t){t(n,l,h,v,f)},v.win.Snap=n,n}(t||this);return r.plugin((function(n,r,i,a,o){function s(t,e){if(null==e){var r=!0;if(!(e="linearGradient"==t.type||"radialGradient"==t.type?t.node.getAttribute("gradientTransform"):"pattern"==t.type?t.node.getAttribute("patternTransform"):t.node.getAttribute("transform")))return new n.Matrix;e=n._.svgTransform2string(e)}else e=n._.rgTransform.test(e)?c(e).replace(/\.{3}|\u2026/g,t._.transform||""):n._.svgTransform2string(e),f(e,"array")&&(e=n.path?n.path.toString.call(e):c(e)),t._.transform=e;var i=n._.transform2matrix(e,t.getBBox(1));return r?i:void(t.matrix=i)}function u(t){return function(){var e=t?"<"+this.type:"",n=this.node.attributes,r=this.node.childNodes;if(t)for(var i=0,a=n.length;a>i;i++)e+=" "+n[i].name+'="'+n[i].value.replace(/"/g,'\\"')+'"';if(r.length){for(t&&(e+=">"),i=0,a=r.length;a>i;i++)3==r[i].nodeType?e+=r[i].nodeValue:1==r[i].nodeType&&(e+=v(r[i]).toString());t&&(e+="")}else t&&(e+="/>");return e}}var l=r.prototype,f=n.is,c=String,h=n._unit2px,d=n._.$,p=n._.make,g=n._.getSomeDefs,v=n._.wrap;l.getBBox=function(t){if("tspan"==this.type)return n._.box(this.node.getClientRects().item(0));if(!n.Matrix||!n.path)return this.node.getBBox();var e=this,r=new n.Matrix;if(e.removed)return n._.box();for(;"use"==e.type;)if(t||(r=r.add(e.transform().localMatrix.translate(e.attr("x")||0,e.attr("y")||0))),e.original)e=e.original;else{var i=e.attr("xlink:href");e=e.original=e.node.ownerDocument.getElementById(i.substring(i.indexOf("#")+1))}var a=e._,o=n.path.get[e.type]||n.path.get.deflt;try{return t?(a.bboxwt=o?n.path.getBBox(e.realPath=o(e)):n._.box(e.node.getBBox()),n._.box(a.bboxwt)):(e.realPath=o(e),e.matrix=e.transform().localMatrix,a.bbox=n.path.getBBox(n.path.map(e.realPath,r.add(e.matrix))),n._.box(a.bbox))}catch(t){return n._.box()}};var m=function(){return this.string};l.transform=function(t){var e=this._;if(null==t){for(var r,i=this,a=new n.Matrix(this.node.getCTM()),o=s(this),u=[o],l=new n.Matrix,f=o.toTransformString(),h=c(o)==c(this.matrix)?c(e.transform):f;"svg"!=i.type&&(i=i.parent());)u.push(s(i));for(r=u.length;r--;)l.add(u[r]);return{string:h,globalMatrix:a,totalMatrix:l,localMatrix:o,diffMatrix:a.clone().add(o.invert()),global:a.toTransformString(),total:l.toTransformString(),local:f,toString:m}}return t instanceof n.Matrix?(this.matrix=t,this._.transform=t.toTransformString()):s(this,t),this.node&&("linearGradient"==this.type||"radialGradient"==this.type?d(this.node,{gradientTransform:this.matrix}):"pattern"==this.type?d(this.node,{patternTransform:this.matrix}):d(this.node,{transform:this.matrix})),this},l.parent=function(){return v(this.node.parentNode)},l.append=l.add=function(t){if(t){if("set"==t.type){var e=this;return t.forEach((function(t){e.add(t)})),this}t=v(t),this.node.appendChild(t.node),t.paper=this.paper}return this},l.appendTo=function(t){return t&&(t=v(t)).append(this),this},l.prepend=function(t){if(t){if("set"==t.type){var e,n=this;return t.forEach((function(t){e?e.after(t):n.prepend(t),e=t})),this}var r=(t=v(t)).parent();this.node.insertBefore(t.node,this.node.firstChild),this.add&&this.add(),t.paper=this.paper,this.parent()&&this.parent().add(),r&&r.add()}return this},l.prependTo=function(t){return(t=v(t)).prepend(this),this},l.before=function(t){if("set"==t.type){var e=this;return t.forEach((function(t){var n=t.parent();e.node.parentNode.insertBefore(t.node,e.node),n&&n.add()})),this.parent().add(),this}var n=(t=v(t)).parent();return this.node.parentNode.insertBefore(t.node,this.node),this.parent()&&this.parent().add(),n&&n.add(),t.paper=this.paper,this},l.after=function(t){var e=(t=v(t)).parent();return this.node.nextSibling?this.node.parentNode.insertBefore(t.node,this.node.nextSibling):this.node.parentNode.appendChild(t.node),this.parent()&&this.parent().add(),e&&e.add(),t.paper=this.paper,this},l.insertBefore=function(t){t=v(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},l.insertAfter=function(t){t=v(t);var e=this.parent();return t.node.parentNode.insertBefore(this.node,t.node.nextSibling),this.paper=t.paper,e&&e.add(),t.parent()&&t.parent().add(),this},l.remove=function(){var t=this.parent();return this.node.parentNode&&this.node.parentNode.removeChild(this.node),delete this.paper,this.removed=!0,t&&t.add(),this},l.select=function(t){return v(this.node.querySelector(t))},l.selectAll=function(t){for(var e=this.node.querySelectorAll(t),r=(n.set||Array)(),i=0;il;l++){e(i=a[l],"fill"),e(i,"stroke"),e(i,"filter"),e(i,"mask"),e(i,"clip-path"),r(i);var c=d(i.node,"id");c&&(d(i.node,{id:i.id}),s.push({old:c,id:i.id}))}for(l=0,f=s.length;f>l;l++){var h=u[s[l].old];if(h)for(var p=0,g=h.length;g>p;p++)h[p](s[l].id)}}(t),t.insertAfter(this),t},l.toDefs=function(){return g(this).appendChild(this.node),this},l.pattern=l.toPattern=function(t,e,n,r){var i=p("pattern",g(this));return null==t&&(t=this.getBBox()),f(t,"object")&&"x"in t&&(e=t.y,n=t.width,r=t.height,t=t.x),d(i.node,{x:t,y:e,width:n,height:r,patternUnits:"userSpaceOnUse",id:i.id,viewBox:[t,e,n,r].join(" ")}),i.node.appendChild(this.node),i},l.marker=function(t,e,n,r,i,a){var o=p("marker",g(this));return null==t&&(t=this.getBBox()),f(t,"object")&&"x"in t&&(e=t.y,n=t.width,r=t.height,i=t.refX||t.cx,a=t.refY||t.cy,t=t.x),d(o.node,{viewBox:[t,e,n,r].join(" "),markerWidth:n,markerHeight:r,orient:"auto",refX:i||0,refY:a||0,id:o.id}),o.node.appendChild(this.node),o};var y={};l.data=function(t,r){var i=y[this.id]=y[this.id]||{};if(0==arguments.length)return e("snap.data.get."+this.id,this,i,null),i;if(1==arguments.length){if(n.is(t,"object")){for(var a in t)t.hasOwnProperty(a)&&this.data(a,t[a]);return this}return e("snap.data.get."+this.id,this,i[t],t),i[t]}return i[t]=r,e("snap.data.set."+this.id,this,r,t),this},l.removeData=function(t){return null==t?y[this.id]={}:y[this.id]&&delete y[this.id][t],this},l.outerSVG=l.toString=u(1),l.innerSVG=u(),l.toDataURL=function(){if(t&&t.btoa){var e=this.getBBox(),r=n.format('{contents}',{x:+e.x.toFixed(3),y:+e.y.toFixed(3),width:+e.width.toFixed(3),height:+e.height.toFixed(3),contents:this.outerSVG()});return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(r)))}},o.prototype.select=l.select,o.prototype.selectAll=l.selectAll})),r.plugin((function(t,r,i,a,o){function s(t,e,n){return function(r){var i=r.slice(t,e);return 1==i.length&&(i=i[0]),n?n(i):i}}var u=r.prototype,l=t.is,f=String,c="hasOwnProperty",h=function(t,e,r,i){"function"!=typeof r||r.length||(i=r,r=n.linear),this.attr=t,this.dur=e,r&&(this.easing=r),i&&(this.callback=i)};t._.Animation=h,t.animation=function(t,e,n,r){return new h(t,e,n,r)},u.inAnim=function(){var t=this,e=[];for(var n in t.anims)t.anims[c](n)&&function(t){e.push({anim:new h(t._attrs,t.dur,t.easing,t._callback),mina:t,curStatus:t.status(),status:function(e){return t.status(e)},stop:function(){t.stop()}})}(t.anims[n]);return e},t.animate=function(t,r,i,a,o,s){"function"!=typeof o||o.length||(s=o,o=n.linear);var u=n.time(),l=n(t,r,u,u+a,n.time,i,o);return s&&e.once("mina.finish."+l.id,s),l},u.stop=function(){for(var t=this.inAnim(),e=0,n=t.length;n>e;e++)t[e].stop();return this},u.animate=function(t,r,i,a){"function"!=typeof i||i.length||(a=i,i=n.linear),t instanceof h&&(a=t.callback,i=t.easing,r=t.dur,t=t.attr);var o,u,d,p,g=[],v=[],m={},y=this;for(var x in t)if(t[c](x)){y.equal?(o=(p=y.equal(x,f(t[x]))).from,u=p.to,d=p.f):(o=+y.attr(x),u=+t[x]);var b=l(o,"array")?o.length:1;m[x]=s(g.length,g.length+b,d),g=g.concat(o),v=v.concat(u)}var F=n.time(),C=n(g,v,F,F+r,n.time,(function(t){var e={};for(var n in m)m[c](n)&&(e[n]=m[n](t));y.attr(e)}),i);return y.anims[C.id]=C,C._attrs=t,C._callback=a,e("snap.animcreated."+y.id,C),e.once("mina.finish."+C.id,(function(){e.off("mina.*."+C.id),delete y.anims[C.id],a&&a.call(y)})),e.once("mina.stop."+C.id,(function(){e.off("mina.*."+C.id),delete y.anims[C.id]})),y}})),r.plugin((function(t,e,n,r,i){function a(t,e,n,r,i,a){return null==e&&"[object SVGMatrix]"==o.call(t)?(this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.e=t.e,void(this.f=t.f)):void(null!=t?(this.a=+t,this.b=+e,this.c=+n,this.d=+r,this.e=+i,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0))}var o=Object.prototype.toString,s=String,u=Math;!function(e){function n(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var e=u.sqrt(n(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}e.add=function(t,e,n,r,i,o){if(t&&t instanceof a)return this.add(t.a,t.b,t.c,t.d,t.e,t.f);var s=t*this.a+e*this.c,u=t*this.b+e*this.d;return this.e+=i*this.a+o*this.c,this.f+=i*this.b+o*this.d,this.c=n*this.a+r*this.c,this.d=n*this.b+r*this.d,this.a=s,this.b=u,this},a.prototype.multLeft=function(t,e,n,r,i,o){if(t&&t instanceof a)return this.multLeft(t.a,t.b,t.c,t.d,t.e,t.f);var s=t*this.a+n*this.b,u=t*this.c+n*this.d,l=t*this.e+n*this.f+i;return this.b=e*this.a+r*this.b,this.d=e*this.c+r*this.d,this.f=e*this.e+r*this.f+o,this.a=s,this.c=u,this.e=l,this},e.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new a(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},e.clone=function(){return new a(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(t,e){return this.e+=t*this.a+e*this.c,this.f+=t*this.b+e*this.d,this},e.scale=function(t,e,n,r){return null==e&&(e=t),(n||r)&&this.translate(n,r),this.a*=t,this.b*=t,this.c*=e,this.d*=e,(n||r)&&this.translate(-n,-r),this},e.rotate=function(e,n,r){e=t.rad(e),n=n||0,r=r||0;var i=+u.cos(e).toFixed(9),a=+u.sin(e).toFixed(9);return this.add(i,a,-a,i,n,r),this.add(1,0,0,1,-n,-r)},e.skewX=function(t){return this.skew(t,0)},e.skewY=function(t){return this.skew(0,t)},e.skew=function(e,n){e=e||0,n=n||0,e=t.rad(e),n=t.rad(n);var r=u.tan(e).toFixed(9),i=u.tan(n).toFixed(9);return this.add(1,i,r,1,0,0)},e.x=function(t,e){return t*this.a+e*this.c+this.e},e.y=function(t,e){return t*this.b+e*this.d+this.f},e.get=function(t){return+this[s.fromCharCode(97+t)].toFixed(4)},e.toString=function(){return"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.determinant=function(){return this.a*this.d-this.b*this.c},e.split=function(){var e={};e.dx=this.e,e.dy=this.f;var i=[[this.a,this.b],[this.c,this.d]];e.scalex=u.sqrt(n(i[0])),r(i[0]),e.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*e.shear,i[1][1]-i[0][1]*e.shear],e.scaley=u.sqrt(n(i[1])),r(i[1]),e.shear/=e.scaley,this.determinant()<0&&(e.scalex=-e.scalex);var a=i[0][1],o=i[1][1];return 0>o?(e.rotate=t.deg(u.acos(o)),0>a&&(e.rotate=360-e.rotate)):e.rotate=t.deg(u.asin(a)),e.isSimple=!(+e.shear.toFixed(9)||e.scalex.toFixed(9)!=e.scaley.toFixed(9)&&e.rotate),e.isSuperSimple=!+e.shear.toFixed(9)&&e.scalex.toFixed(9)==e.scaley.toFixed(9)&&!e.rotate,e.noRotation=!+e.shear.toFixed(9)&&!e.rotate,e},e.toTransformString=function(t){var e=t||this.split();return+e.shear.toFixed(9)?"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]:(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[+e.dx.toFixed(4),+e.dy.toFixed(4)]:"")+(e.rotate?"r"+[+e.rotate.toFixed(4),0,0]:"")+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:""))}}(a.prototype),t.Matrix=a,t.matrix=function(t,e,n,r,i,o){return new a(t,e,n,r,i,o)}})),r.plugin((function(t,n,r,i,a){function o(r){return function(i){if(e.stop(),i instanceof a&&1==i.node.childNodes.length&&("radialGradient"==i.node.firstChild.tagName||"linearGradient"==i.node.firstChild.tagName||"pattern"==i.node.firstChild.tagName)&&(i=i.node.firstChild,d(this).appendChild(i),i=c(i)),i instanceof n)if("radialGradient"==i.type||"linearGradient"==i.type||"pattern"==i.type){i.node.id||g(i.node,{id:i.id});var o=v(i.node.id)}else o=i.attr(r);else if((o=t.color(i)).error){var s=t(d(this).ownerSVGElement).gradient(i);s?(s.node.id||g(s.node,{id:s.id}),o=v(s.node.id)):o=i}else o=m(o);var u={};u[r]=o,g(this.node,u),this.node.style[r]=x}}function s(t){e.stop(),t==+t&&(t+="px"),this.node.style.fontSize=t}function u(t){for(var e=[],n=t.childNodes,r=0,i=n.length;i>r;r++){var a=n[r];3==a.nodeType&&e.push(a.nodeValue),"tspan"==a.tagName&&(1==a.childNodes.length&&3==a.firstChild.nodeType?e.push(a.firstChild.nodeValue):e.push(u(a)))}return e}function l(){return e.stop(),this.node.style.fontSize}var f=t._.make,c=t._.wrap,h=t.is,d=t._.getSomeDefs,p=/^url\((['"]?)([^)]+)\1\)$/,g=t._.$,v=t.url,m=String,y=t._.separator,x="";t.deurl=function(t){var e=String(t).match(p);return e?e[2]:t},e.on("snap.util.attr.mask",(function(t){if(t instanceof n||t instanceof a){if(e.stop(),t instanceof a&&1==t.node.childNodes.length&&(t=t.node.firstChild,d(this).appendChild(t),t=c(t)),"mask"==t.type)var r=t;else(r=f("mask",d(this))).node.appendChild(t.node);!r.node.id&&g(r.node,{id:r.id}),g(this.node,{mask:v(r.id)})}})),function(t){e.on("snap.util.attr.clip",t),e.on("snap.util.attr.clip-path",t),e.on("snap.util.attr.clipPath",t)}((function(t){if(t instanceof n||t instanceof a){e.stop();for(var r,i=t.node;i;){if("clipPath"===i.nodeName){r=new n(i);break}if("svg"===i.nodeName){r=void 0;break}i=i.parentNode}r||((r=f("clipPath",d(this))).node.appendChild(t.node),!r.node.id&&g(r.node,{id:r.id})),g(this.node,{"clip-path":v(r.node.id||r.id)})}})),e.on("snap.util.attr.fill",o("fill")),e.on("snap.util.attr.stroke",o("stroke"));var b=/^([lr])(?:\(([^)]*)\))?(.*)$/i;e.on("snap.util.grad.parse",(function(t){function e(t,e){for(var n=(e-s)/(t-u),r=u;t>r;r++)a[r].offset=+(+s+n*(r-u)).toFixed(2);u=t,s=e}var n=(t=m(t)).match(b);if(!n)return null;var r=n[1],i=n[2],a=n[3];i=i.split(/\s*,\s*/).map((function(t){return+t==t?+t:t})),1==i.length&&0==i[0]&&(i=[]),a=(a=a.split("-")).map((function(t){var e={color:(t=t.split(":"))[0]};return t[1]&&(e.offset=parseFloat(t[1])),e}));var o=a.length,s=0,u=0;o--;for(var l=0;o>l;l++)"offset"in a[l]&&e(l,a[l].offset);return a[o].offset=a[o].offset||100,e(o,a[o].offset),{type:r,params:i,stops:a}})),e.on("snap.util.attr.d",(function(n){e.stop(),h(n,"array")&&h(n[0],"array")&&(n=t.path.toString.call(n)),(n=m(n)).match(/[ruo]/i)&&(n=t.path.toAbsolute(n)),g(this.node,{d:n})}))(-1),e.on("snap.util.attr.#text",(function(t){e.stop(),t=m(t);for(var n=i.doc.createTextNode(t);this.node.firstChild;)this.node.removeChild(this.node.firstChild);this.node.appendChild(n)}))(-1),e.on("snap.util.attr.path",(function(t){e.stop(),this.attr({d:t})}))(-1),e.on("snap.util.attr.class",(function(t){e.stop(),this.node.className.baseVal=t}))(-1),e.on("snap.util.attr.viewBox",(function(t){var n;n=h(t,"object")&&"x"in t?[t.x,t.y,t.width,t.height].join(" "):h(t,"array")?t.join(" "):t,g(this.node,{viewBox:n}),e.stop()}))(-1),e.on("snap.util.attr.transform",(function(t){this.transform(t),e.stop()}))(-1),e.on("snap.util.attr.r",(function(t){"rect"==this.type&&(e.stop(),g(this.node,{rx:t,ry:t}))}))(-1),e.on("snap.util.attr.textpath",(function(t){if(e.stop(),"text"==this.type){var r,i,a;if(!t&&this.textPath){for(i=this.textPath;i.node.firstChild;)this.node.appendChild(i.node.firstChild);return i.remove(),void delete this.textPath}if(h(t,"string")){var o=d(this),s=c(o.parentNode).path(t);o.appendChild(s.node),r=s.id,s.attr({id:r})}else(t=c(t))instanceof n&&((r=t.attr("id"))||(r=t.id,t.attr({id:r})));if(r)if(i=this.textPath,a=this.node,i)i.attr({"xlink:href":"#"+r});else{for(i=g("textPath",{"xlink:href":"#"+r});a.firstChild;)i.appendChild(a.firstChild);a.appendChild(i),this.textPath=c(i)}}}))(-1),e.on("snap.util.attr.text",(function(t){if("text"==this.type){for(var n=this.node,r=function(t){var e=g("tspan");if(h(t,"array"))for(var n=0;n1&&(t=Array.prototype.slice.call(arguments,0));var e={};return u(t,"object")&&!u(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polyline",e)},s.polygon=function(t){arguments.length>1&&(t=Array.prototype.slice.call(arguments,0));var e={};return u(t,"object")&&!u(t,"array")?e=t:null!=t&&(e={points:t}),this.el("polygon",e)},function(){function r(){return this.selectAll("stop")}function i(t,e){var r=f("stop"),i={offset:+e+"%"};t=n.color(t),i["stop-color"]=t.hex,t.opacity<1&&(i["stop-opacity"]=t.opacity),f(r,i);for(var a,o=this.stops(),s=0;se){this.node.insertBefore(r,o[s].node),a=!0;break}return a||this.node.appendChild(r),this}function a(){if("linearGradient"==this.type){var t=f(this.node,"x1")||0,e=f(this.node,"x2")||1,r=f(this.node,"y1")||0,i=f(this.node,"y2")||0;return n._.box(t,r,math.abs(e-t),math.abs(i-r))}var a=this.node.cx||.5,o=this.node.cy||.5,s=this.node.r||0;return n._.box(a-s,o-s,2*s,2*s)}function o(t){var r=t,i=this.stops();if("string"==typeof t&&(r=e("snap.util.grad.parse",null,"l(0,0,0,1)"+t).firstDefined().stops),n.is(r,"array")){for(var a=0;as;s++){var c=a[s];r.addStop(c.color,c.offset)}return r}(this.defs,t)},s.gradientLinear=function(t,e,n,r){return u(this.defs,t,e,n,r)},s.gradientRadial=function(t,e,n,r,i){return l(this.defs,t,e,n,r,i)},s.toString=function(){var t,e=this.node.ownerDocument,r=e.createDocumentFragment(),i=e.createElement("div"),a=this.node.cloneNode(!0);return r.appendChild(i),i.appendChild(a),n._.$(a,{xmlns:"http://www.w3.org/2000/svg"}),t=i.innerHTML,r.removeChild(r.firstChild),t},s.toDataURL=function(){return t&&t.btoa?"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(this))):void 0},s.clear=function(){for(var t,e=this.node.firstChild;e;)t=e.nextSibling,"defs"!=e.tagName?e.parentNode.removeChild(e):s.clear.call({node:e}),e=t}}()})),r.plugin((function(t,e,n,r){function i(t){var e=i.ps=i.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout((function(){for(var n in e)e[M](n)&&n!=t&&(e[n].sleep--,!e[n].sleep&&delete e[n])})),e[t]}function a(t,e,n,r){return null==t&&(t=e=n=r=0),null==e&&(e=t.y,n=t.width,r=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:r,h:r,x2:t+n,y2:e+r,cx:t+n/2,cy:e+r/2,r1:P.min(n,r)/2,r2:P.max(n,r)/2,r0:P.sqrt(n*n+r*r)/2,path:b(t,e,n,r),vb:[t,e,n,r].join(" ")}}function o(){return this.join(",").replace(N,"$1")}function s(t){var e=T(t);return e.toString=o,e}function u(t,e,n,r,i,a,o,s,u){return null==u?g(t,e,n,r,i,a,o,s):f(t,e,n,r,i,a,o,s,function(t,e,n,r,i,a,o,s,u){if(!(0>u||g(t,e,n,r,i,a,o,s).01;)l=g(t,e,n,r,i,a,o,s,c+=(u>l?1:-1)*(f/=2));return c}}(t,e,n,r,i,a,o,s,u))}function l(n,r){function i(t){return+(+t).toFixed(3)}return t._.cacher((function(t,a,o){t instanceof e&&(t=t.attr("d"));for(var s,l,c,h,d,p="",g={},v=0,m=0,y=(t=S(t)).length;y>m;m++){if("M"==(c=t[m])[0])s=+c[1],l=+c[2];else{if(v+(h=u(s,l,c[1],c[2],c[3],c[4],c[5],c[6]))>a){if(r&&!g.start){if(p+=["C"+i((d=u(s,l,c[1],c[2],c[3],c[4],c[5],c[6],a-v)).start.x),i(d.start.y),i(d.m.x),i(d.m.y),i(d.x),i(d.y)],o)return p;g.start=p,p=["M"+i(d.x),i(d.y)+"C"+i(d.n.x),i(d.n.y),i(d.end.x),i(d.end.y),i(c[5]),i(c[6])].join(),v+=h,s=+c[5],l=+c[6];continue}if(!n&&!r)return u(s,l,c[1],c[2],c[3],c[4],c[5],c[6],a-v)}v+=h,s=+c[5],l=+c[6]}p+=c.shift()+c}return g.end=p,n?v:r?g:f(s,l,c[0],c[1],c[2],c[3],c[4],c[5],1)}),null,t._.clone)}function f(t,e,n,r,i,a,o,s,u){var l=1-u,f=V(l,3),c=V(l,2),h=u*u,d=h*u,p=t+2*u*(n-t)+h*(i-2*n+t),g=e+2*u*(r-e)+h*(a-2*r+e),v=n+2*u*(i-n)+h*(o-2*i+n),m=r+2*u*(a-r)+h*(s-2*a+r);return{x:f*t+3*c*u*n+3*l*u*u*i+d*o,y:f*e+3*c*u*r+3*l*u*u*a+d*s,m:{x:p,y:g},n:{x:v,y:m},start:{x:l*t+u*n,y:l*e+u*r},end:{x:l*i+u*o,y:l*a+u*s},alpha:90-180*P.atan2(p-v,g-m)/L}}function c(e,n,r,i,o,s,u,l){t.is(e,"array")||(e=[e,n,r,i,o,s,u,l]);var f=E.apply(null,e);return a(f.min.x,f.min.y,f.max.x-f.min.x,f.max.y-f.min.y)}function h(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height}function d(t,e){return t=a(t),h(e=a(e),t.x,t.y)||h(e,t.x2,t.y)||h(e,t.x,t.y2)||h(e,t.x2,t.y2)||h(t,e.x,e.y)||h(t,e.x2,e.y)||h(t,e.x,e.y2)||h(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}function p(t,e,n,r,i){return t*(t*(-3*e+9*n-9*r+3*i)+6*e-12*n+6*r)-3*e+3*n}function g(t,e,n,r,i,a,o,s,u){null==u&&(u=1);for(var l=(u=u>1?1:0>u?0:u)/2,f=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],c=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,d=0;12>d;d++){var g=l*f[d]+l,v=p(g,t,n,i,o),m=p(g,e,r,a,s),y=v*v+m*m;h+=c[d]*P.sqrt(y)}return l*h}function v(t,e,n,r,i,a,o,s){if(!(O(t,n)O(i,o)||O(e,r)O(a,s))){var u=(t-n)*(a-s)-(e-r)*(i-o);if(u){var l=((t*r-e*n)*(i-o)-(t-n)*(i*s-a*o))/u,f=((t*r-e*n)*(a-s)-(e-r)*(i*s-a*o))/u,c=+l.toFixed(2),h=+f.toFixed(2);if(!(c<+q(t,n).toFixed(2)||c>+O(t,n).toFixed(2)||c<+q(i,o).toFixed(2)||c>+O(i,o).toFixed(2)||h<+q(e,r).toFixed(2)||h>+O(e,r).toFixed(2)||h<+q(a,s).toFixed(2)||h>+O(a,s).toFixed(2)))return{x:l,y:f}}}}function m(t,e,n){if(!d(c(t),c(e)))return n?0:[];for(var r=~~(g.apply(0,t)/8),i=~~(g.apply(0,e)/8),a=[],o=[],s={},u=n?0:[],l=0;r+1>l;l++){var h=f.apply(0,t.concat(l/r));a.push({x:h.x,y:h.y,t:l/r})}for(l=0;i+1>l;l++)h=f.apply(0,e.concat(l/i)),o.push({x:h.x,y:h.y,t:l/i});for(l=0;r>l;l++)for(var p=0;i>p;p++){var m=a[l],y=a[l+1],x=o[p],b=o[p+1],F=G(y.x-m.x)<.001?"y":"x",C=G(b.x-x.x)<.001?"y":"x",w=v(m.x,m.y,y.x,y.y,x.x,x.y,b.x,b.y);if(w){if(s[w.x.toFixed(4)]==w.y.toFixed(4))continue;s[w.x.toFixed(4)]=w.y.toFixed(4);var B=m.t+G((w[F]-m[F])/(y[F]-m[F]))*(y.t-m.t),A=x.t+G((w[C]-x[C])/(b[C]-x[C]))*(b.t-x.t);B>=0&&1>=B&&A>=0&&1>=A&&(n?u++:u.push({x:w.x,y:w.y,t1:B,t2:A}))}}return u}function y(t,e,n){t=S(t),e=S(e);for(var r,i,a,o,s,u,l,f,c,h,d=n?0:[],p=0,g=t.length;g>p;p++){var v=t[p];if("M"==v[0])r=s=v[1],i=u=v[2];else{"C"==v[0]?(c=[r,i].concat(v.slice(1)),r=c[6],i=c[7]):(c=[r,i,r,i,s,u,s,u],r=s,i=u);for(var y=0,x=e.length;x>y;y++){var b=e[y];if("M"==b[0])a=l=b[1],o=f=b[2];else{"C"==b[0]?(h=[a,o].concat(b.slice(1)),a=h[6],o=h[7]):(h=[a,o,a,o,l,f,l,f],a=l,o=f);var F=m(c,h,n);if(n)d+=F;else{for(var C=0,w=F.length;w>C;C++)F[C].segment1=p,F[C].segment2=y,F[C].bez1=c,F[C].bez2=h;d=d.concat(F)}}}}}return d}function x(t){var e=i(t);if(e.bbox)return T(e.bbox);if(!t)return a();for(var n,r=0,o=0,s=[],u=[],l=0,f=(t=S(t)).length;f>l;l++)if("M"==(n=t[l])[0])r=n[1],o=n[2],s.push(r),u.push(o);else{var c=E(r,o,n[1],n[2],n[3],n[4],n[5],n[6]);s=s.concat(c.min.x,c.max.x),u=u.concat(c.min.y,c.max.y),r=n[5],o=n[6]}var h=q.apply(0,s),d=q.apply(0,u),p=a(h,d,O.apply(0,s)-h,O.apply(0,u)-d);return e.bbox=T(p),p}function b(t,e,n,r,i){if(i)return[["M",+t+ +i,e],["l",n-2*i,0],["a",i,i,0,0,1,i,i],["l",0,r-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-n,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-r],["a",i,i,0,0,1,i,-i],["z"]];var a=[["M",t,e],["l",n,0],["l",0,r],["l",-n,0],["z"]];return a.toString=o,a}function F(t,e,n,r,i){if(null==i&&null==r&&(r=n),t=+t,e=+e,n=+n,r=+r,null!=i)var a=Math.PI/180,s=t+n*Math.cos(-r*a),u=t+n*Math.cos(-i*a),l=[["M",s,e+n*Math.sin(-r*a)],["A",n,n,0,+(i-r>180),0,u,e+n*Math.sin(-i*a)]];else l=[["M",t,e],["m",0,-r],["a",n,r,0,1,1,0,2*r],["a",n,r,0,1,1,0,-2*r],["z"]];return l.toString=o,l}function C(e){var n=i(e);if(n.abs)return s(n.abs);if(_(e,"array")&&_(e&&e[0],"array")||(e=t.parsePathString(e)),!e||!e.length)return[["M",0,0]];var r,a=[],u=0,l=0,f=0,c=0,h=0;"M"==e[0][0]&&(f=u=+e[0][1],c=l=+e[0][2],h++,a[0]=["M",u,l]);for(var d,p,g=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),v=h,m=e.length;m>v;v++){if(a.push(d=[]),(r=(p=e[v])[0])!=r.toUpperCase())switch(d[0]=r.toUpperCase(),d[0]){case"A":d[1]=p[1],d[2]=p[2],d[3]=p[3],d[4]=p[4],d[5]=p[5],d[6]=+p[6]+u,d[7]=+p[7]+l;break;case"V":d[1]=+p[1]+l;break;case"H":d[1]=+p[1]+u;break;case"R":for(var y=[u,l].concat(p.slice(1)),x=2,b=y.length;b>x;x++)y[x]=+y[x]+u,y[++x]=+y[x]+l;a.pop(),a=a.concat(k(y,g));break;case"O":a.pop(),(y=F(u,l,p[1],p[2])).push(y[0]),a=a.concat(y);break;case"U":a.pop(),a=a.concat(F(u,l,p[1],p[2],p[3])),d=["U"].concat(a[a.length-1].slice(-2));break;case"M":f=+p[1]+u,c=+p[2]+l;default:for(x=1,b=p.length;b>x;x++)d[x]=+p[x]+(x%2?u:l)}else if("R"==r)y=[u,l].concat(p.slice(1)),a.pop(),a=a.concat(k(y,g)),d=["R"].concat(p.slice(-2));else if("O"==r)a.pop(),(y=F(u,l,p[1],p[2])).push(y[0]),a=a.concat(y);else if("U"==r)a.pop(),a=a.concat(F(u,l,p[1],p[2],p[3])),d=["U"].concat(a[a.length-1].slice(-2));else for(var C=0,w=p.length;w>C;C++)d[C]=p[C];if("O"!=(r=r.toUpperCase()))switch(d[0]){case"Z":u=+f,l=+c;break;case"H":u=d[1];break;case"V":l=d[1];break;case"M":f=d[d.length-2],c=d[d.length-1];default:u=d[d.length-2],l=d[d.length-1]}}return a.toString=o,n.abs=s(a),a}function w(t,e,n,r){return[t,e,n,r,n,r]}function B(t,e,n,r,i,a){var o=1/3,s=2/3;return[o*t+s*n,o*e+s*r,o*i+s*n,o*a+s*r,i,a]}function A(e,n,r,i,a,o,s,u,l,f){var c,h=120*L/180,d=L/180*(+a||0),p=[],g=t._.cacher((function(t,e,n){return{x:t*P.cos(n)-e*P.sin(n),y:t*P.sin(n)+e*P.cos(n)}}));if(!r||!i)return[e,n,u,l,u,l];if(f)B=f[0],E=f[1],C=f[2],w=f[3];else{e=(c=g(e,n,-d)).x,n=c.y,u=(c=g(u,l,-d)).x,l=c.y;var v=(P.cos(L/180*a),P.sin(L/180*a),(e-u)/2),m=(n-l)/2,y=v*v/(r*r)+m*m/(i*i);y>1&&(r*=y=P.sqrt(y),i*=y);var x=r*r,b=i*i,F=(o==s?-1:1)*P.sqrt(G((x*b-x*m*m-b*v*v)/(x*m*m+b*v*v))),C=F*r*m/i+(e+u)/2,w=F*-i*v/r+(n+l)/2,B=P.asin(((n-w)/i).toFixed(9)),E=P.asin(((l-w)/i).toFixed(9));0>(B=C>e?L-B:B)&&(B=2*L+B),0>(E=C>u?L-E:E)&&(E=2*L+E),s&&B>E&&(B-=2*L),!s&&E>B&&(E-=2*L)}var S=E-B;if(G(S)>h){var k=E,D=u,_=l;E=B+h*(s&&E>B?1:-1),p=A(u=C+r*P.cos(E),l=w+i*P.sin(E),r,i,a,0,s,D,_,[E,k,C,w])}S=E-B;var T=P.cos(B),M=P.sin(B),N=P.cos(E),j=P.sin(E),q=P.tan(S/4),O=4/3*r*q,V=4/3*i*q,z=[e,n],R=[e+O*M,n-V*T],I=[u+O*j,l-V*N],U=[u,l];if(R[0]=2*z[0]-R[0],R[1]=2*z[1]-R[1],f)return[R,I,U].concat(p);for(var X=[],$=0,H=(p=[R,I,U].concat(p).join().split(",")).length;H>$;$++)X[$]=$%2?g(p[$-1],p[$],d).y:g(p[$],p[$+1],d).x;return X}function E(t,e,n,r,i,a,o,s){for(var u,l,f,c,h,d,p,g,v=[],m=[[],[]],y=0;2>y;++y)if(0==y?(l=6*t-12*n+6*i,u=-3*t+9*n-9*i+3*o,f=3*n-3*t):(l=6*e-12*r+6*a,u=-3*e+9*r-9*a+3*s,f=3*r-3*e),G(u)<1e-12){if(G(l)<1e-12)continue;(c=-f/l)>0&&1>c&&v.push(c)}else p=l*l-4*f*u,g=P.sqrt(p),0>p||((h=(-l+g)/(2*u))>0&&1>h&&v.push(h),(d=(-l-g)/(2*u))>0&&1>d&&v.push(d));for(var x,b=v.length,F=b;b--;)x=1-(c=v[b]),m[0][b]=x*x*x*t+3*x*x*c*n+3*x*c*c*i+c*c*c*o,m[1][b]=x*x*x*e+3*x*x*c*r+3*x*c*c*a+c*c*c*s;return m[0][F]=t,m[1][F]=e,m[0][F+1]=o,m[1][F+1]=s,m[0].length=m[1].length=F+2,{min:{x:q.apply(0,m[0]),y:q.apply(0,m[1])},max:{x:O.apply(0,m[0]),y:O.apply(0,m[1])}}}function S(t,e){var n=!e&&i(t);if(!e&&n.curve)return s(n.curve);for(var r=C(t),a=e&&C(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},u={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},l=function(t,e,n){var r,i;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"].concat(A.apply(0,[e.x,e.y].concat(t.slice(1))));break;case"S":"C"==n||"S"==n?(r=2*e.x-e.bx,i=2*e.y-e.by):(r=e.x,i=e.y),t=["C",r,i].concat(t.slice(1));break;case"T":"Q"==n||"T"==n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"].concat(B(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"].concat(B(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"].concat(w(e.x,e.y,t[1],t[2]));break;case"H":t=["C"].concat(w(e.x,e.y,t[1],e.y));break;case"V":t=["C"].concat(w(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"].concat(w(e.x,e.y,e.X,e.Y))}return t},f=function(t,e){if(t[e].length>7){t[e].shift();for(var n=t[e];n.length;)h[e]="A",a&&(d[e]="A"),t.splice(e++,0,["C"].concat(n.splice(0,6)));t.splice(e,1),m=O(r.length,a&&a.length||0)}},c=function(t,e,n,i,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",i.x,i.y]),n.bx=0,n.by=0,n.x=t[o][1],n.y=t[o][2],m=O(r.length,a&&a.length||0))},h=[],d=[],p="",g="",v=0,m=O(r.length,a&&a.length||0);m>v;v++){r[v]&&(p=r[v][0]),"C"!=p&&(h[v]=p,v&&(g=h[v-1])),r[v]=l(r[v],o,g),"A"!=h[v]&&"C"==p&&(h[v]="C"),f(r,v),a&&(a[v]&&(p=a[v][0]),"C"!=p&&(d[v]=p,v&&(g=d[v-1])),a[v]=l(a[v],u,g),"A"!=d[v]&&"C"==p&&(d[v]="C"),f(a,v)),c(r,a,o,u,v),c(a,r,u,o,v);var y=r[v],x=a&&a[v],b=y.length,F=a&&x.length;o.x=y[b-2],o.y=y[b-1],o.bx=j(y[b-4])||o.x,o.by=j(y[b-3])||o.y,u.bx=a&&(j(x[F-4])||u.x),u.by=a&&(j(x[F-3])||u.y),u.x=a&&x[F-2],u.y=a&&x[F-1]}return a||(n.curve=s(r)),a?[r,a]:r}function k(t,e){for(var n=[],r=0,i=t.length;i-2*!e>r;r+=2){var a=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?i-4==r?a[3]={x:+t[0],y:+t[1]}:i-2==r&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[i-2],y:+t[i-1]}:i-4==r?a[3]=a[2]:r||(a[0]={x:+t[r],y:+t[r+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n}var D=e.prototype,_=t.is,T=t._.clone,M="hasOwnProperty",N=/,?([a-z]),?/gi,j=parseFloat,P=Math,L=P.PI,q=P.min,O=P.max,V=P.pow,G=P.abs,z=l(1),R=l(),I=l(0,1),U=t._unit2px,X={path:function(t){return t.attr("path")},circle:function(t){var e=U(t);return F(e.cx,e.cy,e.r)},ellipse:function(t){var e=U(t);return F(e.cx||0,e.cy||0,e.rx,e.ry)},rect:function(t){var e=U(t);return b(e.x||0,e.y||0,e.width,e.height,e.rx,e.ry)},image:function(t){var e=U(t);return b(e.x||0,e.y||0,e.width,e.height)},line:function(t){return"M"+[t.attr("x1")||0,t.attr("y1")||0,t.attr("x2"),t.attr("y2")]},polyline:function(t){return"M"+t.attr("points")},polygon:function(t){return"M"+t.attr("points")+"z"},deflt:function(t){var e=t.node.getBBox();return b(e.x,e.y,e.width,e.height)}};t.path=i,t.path.getTotalLength=z,t.path.getPointAtLength=R,t.path.getSubpath=function(t,e,n){if(this.getTotalLength(t)-n<1e-6)return I(t,e).end;var r=I(t,n,1);return e?I(r,e).end:r},D.getTotalLength=function(){return this.node.getTotalLength?this.node.getTotalLength():void 0},D.getPointAtLength=function(t){return R(this.attr("d"),t)},D.getSubpath=function(e,n){return t.path.getSubpath(this.attr("d"),e,n)},t._.box=a,t.path.findDotsAtSegment=f,t.path.bezierBBox=c,t.path.isPointInsideBBox=h,t.closest=function(e,n,r,i){for(var o=100,s=a(e-o/2,n-o/2,o,o),u=[],l=r[0].hasOwnProperty("x")?function(t){return{x:r[t].x,y:r[t].y}}:function(t){return{x:r[t],y:i[t]}},f=0;1e6>=o&&!f;){for(var c=0,d=r.length;d>c;c++){var p=l(c);if(h(s,p.x,p.y)){f++,u.push(p);break}}f||(s=a(e-(o*=2)/2,n-o/2,o,o))}if(1e6!=o){var g,v=1/0;for(c=0,d=u.length;d>c;c++){var m=t.len(e,n,u[c].x,u[c].y);v>m&&(v=m,u[c].len=m,g=u[c])}return g}},t.path.isBBoxIntersect=d,t.path.intersection=function(t,e){return y(t,e)},t.path.intersectionNumber=function(t,e){return y(t,e,1)},t.path.isPointInside=function(t,e,n){var r=x(t);return h(r,e,n)&&y(t,[["M",e,n],["H",r.x2+10]],1)%2==1},t.path.getBBox=x,t.path.get=X,t.path.toRelative=function(e){var n=i(e),r=String.prototype.toLowerCase;if(n.rel)return s(n.rel);t.is(e,"array")&&t.is(e&&e[0],"array")||(e=t.parsePathString(e));var a=[],u=0,l=0,f=0,c=0,h=0;"M"==e[0][0]&&(f=u=e[0][1],c=l=e[0][2],h++,a.push(["M",u,l]));for(var d=h,p=e.length;p>d;d++){var g=a[d]=[],v=e[d];if(v[0]!=r.call(v[0]))switch(g[0]=r.call(v[0]),g[0]){case"a":g[1]=v[1],g[2]=v[2],g[3]=v[3],g[4]=v[4],g[5]=v[5],g[6]=+(v[6]-u).toFixed(3),g[7]=+(v[7]-l).toFixed(3);break;case"v":g[1]=+(v[1]-l).toFixed(3);break;case"m":f=v[1],c=v[2];default:for(var m=1,y=v.length;y>m;m++)g[m]=+(v[m]-(m%2?u:l)).toFixed(3)}else{g=a[d]=[],"m"==v[0]&&(f=v[1]+u,c=v[2]+l);for(var x=0,b=v.length;b>x;x++)a[d][x]=v[x]}var F=a[d].length;switch(a[d][0]){case"z":u=f,l=c;break;case"h":u+=+a[d][F-1];break;case"v":l+=+a[d][F-1];break;default:u+=+a[d][F-2],l+=+a[d][F-1]}}return a.toString=o,n.rel=s(a),a},t.path.toAbsolute=C,t.path.toCubic=S,t.path.map=function(t,e){if(!e)return t;var n,r,i,a,o,s,u;for(i=0,o=(t=S(t)).length;o>i;i++)for(a=1,s=(u=t[i]).length;s>a;a+=2)n=e.x(u[a],u[a+1]),r=e.y(u[a],u[a+1]),u[a]=n,u[a+1]=r;return t},t.path.toString=o,t.path.clone=s})),r.plugin((function(t,r,i,a){var o=Math.max,s=Math.min,u=function(t){if(this.items=[],this.bindings={},this.length=0,this.type="set",t)for(var e=0,n=t.length;n>e;e++)t[e]&&(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},l=u.prototype;l.push=function(){for(var t,e,n=0,r=arguments.length;r>n;n++)(t=arguments[n])&&(this[e=this.items.length]=this.items[e]=t,this.length++);return this},l.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},l.forEach=function(t,e){for(var n=0,r=this.items.length;r>n;n++)if(!1===t.call(e,this.items[n],n))return this;return this},l.animate=function(r,i,a,o){"function"!=typeof a||a.length||(o=a,a=n.linear),r instanceof t._.Animation&&(o=r.callback,a=r.easing,i=a.dur,r=r.attr);var s=arguments;if(t.is(r,"array")&&t.is(s[s.length-1],"array"))var u=!0;var l,f=function(){l?this.b=l:l=this.b},c=0,h=this,d=o&&function(){++c==h.length&&o.call(this)};return this.forEach((function(t,n){e.once("snap.animcreated."+t.id,f),u?s[n]&&t.animate.apply(t,s[n]):t.animate(r,i,a,d)}))},l.remove=function(){for(;this.length;)this.pop().remove();return this},l.bind=function(t,e,n){var r={};if("function"==typeof e)this.bindings[t]=e;else{var i=n||t;this.bindings[t]=function(t){r[i]=t,e.attr(r)}}return this},l.attr=function(t){var e={};for(var n in t)this.bindings[n]?this.bindings[n](t[n]):e[n]=t[n];for(var r=0,i=this.items.length;i>r;r++)this.items[r].attr(e);return this},l.clear=function(){for(;this.length;)this.pop()},l.splice=function(t,e,n){t=0>t?o(this.length+t,0):t,e=o(0,s(this.length-t,e));var r,i=[],a=[],l=[];for(r=2;rr;r++)a.push(this[t+r]);for(;rr?l[r]:i[r-f];for(r=this.items.length=this.length-=e-f;this[r];)delete this[r++];return new u(a)},l.exclude=function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]==t)return this.splice(e,1),!0;return!1},l.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},l.getBBox=function(){for(var t=[],e=[],n=[],r=[],i=this.items.length;i--;)if(!this.items[i].removed){var a=this.items[i].getBBox();t.push(a.x),e.push(a.y),n.push(a.x+a.width),r.push(a.y+a.height)}return{x:t=s.apply(0,t),y:e=s.apply(0,e),x2:n=o.apply(0,n),y2:r=o.apply(0,r),width:n-t,height:r-e,cx:t+(n-t)/2,cy:e+(r-e)/2}},l.clone=function(t){t=new u;for(var e=0,n=this.items.length;n>e;e++)t.push(this.items[e].clone());return t},l.toString=function(){return"Snap‘s set"},l.type="set",t.Set=u,t.set=function(){var t=new u;return arguments.length&&t.push.apply(t,Array.prototype.slice.call(arguments,0)),t}})),r.plugin((function(t,n,r,i){function a(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}}function o(e,n,r){e=e||new t.Matrix,n=n||new t.Matrix,e=t.parseTransformString(e.toTransformString())||[],n=t.parseTransformString(n.toTransformString())||[];for(var i,o,s,u,l=Math.max(e.length,n.length),f=[],d=[],p=0;l>p;p++){if(s=e[p]||a(n[p]),u=n[p]||a(s),s[0]!=u[0]||"r"==s[0].toLowerCase()&&(s[2]!=u[2]||s[3]!=u[3])||"s"==s[0].toLowerCase()&&(s[3]!=u[3]||s[4]!=u[4])){e=t._.transform2matrix(e,r()),n=t._.transform2matrix(n,r()),f=[["m",e.a,e.b,e.c,e.d,e.e,e.f]],d=[["m",n.a,n.b,n.c,n.d,n.e,n.f]];break}for(f[p]=[],d[p]=[],i=0,o=Math.max(s.length,u.length);o>i;i++)i in s&&(f[p][i]=s[i]),i in u&&(d[p][i]=u[i])}return{from:h(f),to:h(d),f:c(f)}}function s(t){return t}function u(t){return function(e){return+e.toFixed(3)+t}}function l(t){return t.join(" ")}function f(e){return t.rgb(e[0],e[1],e[2],e[3])}function c(t){var e,n,r,i,a,o,s=0,u=[];for(e=0,n=t.length;n>e;e++){for(a="[",o=['"'+t[e][0]+'"'],r=1,i=t[e].length;i>r;r++)o[r]="val["+s+++"]";a+=o+"]",u[e]=a}return Function("val","return Snap.path.toString.call(["+u+"])")}function h(t){for(var e=[],n=0,r=t.length;r>n;n++)for(var i=1,a=t[n].length;a>i;i++)e.push(t[n][i]);return e}function d(t){return isFinite(t)}var p={},g=/[%a-z]+$/i,v=String;p.stroke=p.fill="colour",n.prototype.equal=function(t,n){return e("snap.util.equal",this,t,n).firstDefined()},e.on("snap.util.equal",(function(e,n){var r,i,a=v(this.attr(e)||""),m=this;if("colour"==p[e])return r=t.color(a),i=t.color(n),{from:[r.r,r.g,r.b,r.opacity],to:[i.r,i.g,i.b,i.opacity],f};if("viewBox"==e)return{from:r=this.attr(e).vb.split(" ").map(Number),to:i=n.split(" ").map(Number),f:l};if("transform"==e||"gradientTransform"==e||"patternTransform"==e)return"string"==typeof n&&(n=v(n).replace(/\.{3}|\u2026/g,a)),o(a=this.matrix,n=t._.rgTransform.test(n)?t._.transform2matrix(n,this.getBBox()):t._.transform2matrix(t._.svgTransform2string(n),this.getBBox()),(function(){return m.getBBox(1)}));if("d"==e||"path"==e)return{from:h((r=t.path.toCubic(a,n))[0]),to:h(r[1]),f:c(r[0])};if("points"==e)return{from:r=v(a).split(t._.separator),to:i=v(n).split(t._.separator),f:function(t){return t}};if(d(a)&&d(n))return{from:parseFloat(a),to:parseFloat(n),f:s};var y=a.match(g),x=v(n).match(g);return y&&function(e,n){return!(!t.is(e,"array")||!t.is(n,"array"))&&e.toString()==n.toString()}(y,x)?{from:parseFloat(a),to:parseFloat(n),f:u(y)}:{from:this.asPX(e),to:this.asPX(e,n),f:s}}))})),r.plugin((function(t,n,r,i){for(var a=n.prototype,o=("createTouch"in i.doc),s=["click","dblclick","mousedown","mousemove","mouseout","mouseover","mouseup","touchstart","touchmove","touchend","touchcancel"],u={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},l=function(t,e){var n="y"==t?"scrollTop":"scrollLeft",r=e&&e.node?e.node.ownerDocument:i.doc;return r[n in r.documentElement?"documentElement":"body"][n]},f=function(){return this.originalEvent.preventDefault()},c=function(){return this.originalEvent.stopPropagation()},h=function(t,e,n,r){var i=o&&u[e]?u[e]:e,a=function(i){var a=l("y",r),s=l("x",r);if(o&&u.hasOwnProperty(e))for(var h=0,d=i.targetTouches&&i.targetTouches.length;d>h;h++)if(i.targetTouches[h].target==t||t.contains(i.targetTouches[h].target)){var p=i;(i=i.targetTouches[h]).originalEvent=p,i.preventDefault=f,i.stopPropagation=c;break}var g=i.clientX+s,v=i.clientY+a;return n.call(r,i,g,v)};return e!==i&&t.addEventListener(e,a,!1),t.addEventListener(i,a,!1),function(){return e!==i&&t.removeEventListener(e,a,!1),t.removeEventListener(i,a,!1),!0}},d=[],p=function(t){for(var n,r=t.clientX,i=t.clientY,a=l("y"),s=l("x"),u=d.length;u--;){if(n=d[u],o){for(var f,c=t.touches&&t.touches.length;c--;)if((f=t.touches[c]).identifier==n.el._drag.id||n.el.node.contains(f.target)){r=f.clientX,i=f.clientY,(t.originalEvent?t.originalEvent:t).preventDefault();break}}else t.preventDefault();var h=n.el.node;h.nextSibling,h.parentNode,h.style.display,r+=s,i+=a,e("snap.drag.move."+n.el.id,n.move_scope||n.el,r-n.el._drag.x,i-n.el._drag.y,r,i,t)}},g=function(n){t.unmousemove(p).unmouseup(g);for(var r,i=d.length;i--;)(r=d[i]).el._drag={},e("snap.drag.end."+r.el.id,r.end_scope||r.start_scope||r.move_scope||r.el,n),e.off("snap.drag.*."+r.el.id);d=[]},v=s.length;v--;)!function(e){t[e]=a[e]=function(n,r){if(t.is(n,"function"))this.events=this.events||[],this.events.push({name:e,f:n,unbind:h(this.node||document,e,n,r||this)});else for(var i=0,a=this.events.length;a>i;i++)if(this.events[i].name==e)try{this.events[i].f.call(this)}catch(t){}return this},t["un"+e]=a["un"+e]=function(t){for(var n=this.events||[],r=n.length;r--;)if(n[r].name==e&&(n[r].f==t||!t))return n[r].unbind(),n.splice(r,1),!n.length&&delete this.events,this;return this}}(s[v]);a.hover=function(t,e,n,r){return this.mouseover(t,n).mouseout(e,r||n)},a.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var m=[];a.drag=function(n,r,i,a,o,s){function u(u,l,f){(u.originalEvent||u).preventDefault(),c._drag.x=l,c._drag.y=f,c._drag.id=u.identifier,!d.length&&t.mousemove(p).mouseup(g),d.push({el:c,move_scope:a,start_scope:o,end_scope:s}),r&&e.on("snap.drag.start."+c.id,r),n&&e.on("snap.drag.move."+c.id,n),i&&e.on("snap.drag.end."+c.id,i),e("snap.drag.start."+c.id,o||a||c,l,f,u)}function l(t,n,r){e("snap.draginit."+c.id,c,t,n,r)}var f,c=this;return arguments.length?(e.on("snap.draginit."+c.id,u),c._drag={},m.push({el:c,start:u,init:l}),c.mousedown(l),c):c.drag((function(t,e){this.attr({transform:f+(f?"T":"t")+[t,e]})}),(function(){f=this.transform().local}))},a.undrag=function(){for(var n=m.length;n--;)m[n].el==this&&(this.unmousedown(m[n].init),m.splice(n,1),e.unbind("snap.drag.*."+this.id),e.unbind("snap.draginit."+this.id));return!m.length&&t.unmousemove(p).unmouseup(g),this}})),r.plugin((function(t,n,r,i){var a=(n.prototype,r.prototype),o=/^\s*url\((.+)\)/,s=String,u=t._.$;t.filter={},a.filter=function(e){var r=this;"svg"!=r.type&&(r=r.paper);var i=t.parse(s(e)),a=t._.id(),o=(r.node.offsetWidth,r.node.offsetHeight,u("filter"));return u(o,{id:a,filterUnits:"userSpaceOnUse"}),o.appendChild(i.node),r.defs.appendChild(o),new n(o)},e.on("snap.util.getattr.filter",(function(){e.stop();var n=u(this.node,"filter");if(n){var r=s(n).match(o);return r&&t.select(r[1])}})),e.on("snap.util.attr.filter",(function(r){if(r instanceof n&&"filter"==r.type){e.stop();var i=r.node.id;i||(u(r.node,{id:r.id}),i=r.id),u(this.node,{filter:t.url(i)})}r&&"none"!=r||(e.stop(),this.node.removeAttribute("filter"))})),t.filter.blur=function(e,n){null==e&&(e=2);var r=null==n?e:[e,n];return t.format('',{def:r})},t.filter.blur.toString=function(){return this()},t.filter.shadow=function(e,n,r,i,a){return null==a&&(null==i?(a=r,r=4,i="#000"):(a=i,i=r,r=4)),null==r&&(r=4),null==a&&(a=1),null==e&&(e=0,n=2),null==n&&(n=e),i=t.color(i),t.format('',{color:i,dx:e,dy:n,blur:r,opacity:a})},t.filter.shadow.toString=function(){return this()},t.filter.grayscale=function(e){return null==e&&(e=1),t.format('',{a:.2126+.7874*(1-e),b:.7152-.7152*(1-e),c:.0722-.0722*(1-e),d:.2126-.2126*(1-e),e:.7152+.2848*(1-e),f:.0722-.0722*(1-e),g:.2126-.2126*(1-e),h:.0722+.9278*(1-e)})},t.filter.grayscale.toString=function(){return this()},t.filter.sepia=function(e){return null==e&&(e=1),t.format('',{a:.393+.607*(1-e),b:.769-.769*(1-e),c:.189-.189*(1-e),d:.349-.349*(1-e),e:.686+.314*(1-e),f:.168-.168*(1-e),g:.272-.272*(1-e),h:.534-.534*(1-e),i:.131+.869*(1-e)})},t.filter.sepia.toString=function(){return this()},t.filter.saturate=function(e){return null==e&&(e=1),t.format('',{amount:1-e})},t.filter.saturate.toString=function(){return this()},t.filter.hueRotate=function(e){return e=e||0,t.format('',{angle:e})},t.filter.hueRotate.toString=function(){return this()},t.filter.invert=function(e){return null==e&&(e=1),t.format('',{amount:e,amount2:1-e})},t.filter.invert.toString=function(){return this()},t.filter.brightness=function(e){return null==e&&(e=1),t.format('',{amount:e})},t.filter.brightness.toString=function(){return this()},t.filter.contrast=function(e){return null==e&&(e=1),t.format('',{amount:e,amount2:.5-e/2})},t.filter.contrast.toString=function(){return this()}})),r.plugin((function(t,e,n,r,i){var a=t._.box,o=t.is,s=/^[^a-z]*([tbmlrc])/i,u=function(){return"T"+this.dx+","+this.dy};e.prototype.getAlign=function(t,e){null==e&&o(t,"string")&&(e=t,t=null);var n=(t=t||this.paper).getBBox?t.getBBox():a(t),r=this.getBBox(),i={};switch(e=(e=e&&e.match(s))?e[1].toLowerCase():"c"){case"t":i.dx=0,i.dy=n.y-r.y;break;case"b":i.dx=0,i.dy=n.y2-r.y2;break;case"m":i.dx=0,i.dy=n.cy-r.cy;break;case"l":i.dx=n.x-r.x,i.dy=0;break;case"r":i.dx=n.x2-r.x2,i.dy=0;break;default:i.dx=n.cx-r.cx,i.dy=0}return i.toString=u,i},e.prototype.align=function(t,e){return this.transform("..."+this.getAlign(t,e))}})),r.plugin((function(e,n,r,i){function a(t){t=t.split(/(?=#)/);var e=new String(t[5]);return e[50]=t[0],e[100]=t[1],e[200]=t[2],e[300]=t[3],e[400]=t[4],e[500]=t[5],e[600]=t[6],e[700]=t[7],e[800]=t[8],e[900]=t[9],t[10]&&(e.A100=t[10],e.A200=t[11],e.A400=t[12],e.A700=t[13]),e}e.mui={},e.flat={},e.mui.red=a("#ffebee#ffcdd2#ef9a9a#e57373#ef5350#f44336#e53935#d32f2f#c62828#b71c1c#ff8a80#ff5252#ff1744#d50000"),e.mui.pink=a("#FCE4EC#F8BBD0#F48FB1#F06292#EC407A#E91E63#D81B60#C2185B#AD1457#880E4F#FF80AB#FF4081#F50057#C51162"),e.mui.purple=a("#F3E5F5#E1BEE7#CE93D8#BA68C8#AB47BC#9C27B0#8E24AA#7B1FA2#6A1B9A#4A148C#EA80FC#E040FB#D500F9#AA00FF"),e.mui.deeppurple=a("#EDE7F6#D1C4E9#B39DDB#9575CD#7E57C2#673AB7#5E35B1#512DA8#4527A0#311B92#B388FF#7C4DFF#651FFF#6200EA"),e.mui.indigo=a("#E8EAF6#C5CAE9#9FA8DA#7986CB#5C6BC0#3F51B5#3949AB#303F9F#283593#1A237E#8C9EFF#536DFE#3D5AFE#304FFE"),e.mui.blue=a("#E3F2FD#BBDEFB#90CAF9#64B5F6#64B5F6#2196F3#1E88E5#1976D2#1565C0#0D47A1#82B1FF#448AFF#2979FF#2962FF"),e.mui.lightblue=a("#E1F5FE#B3E5FC#81D4FA#4FC3F7#29B6F6#03A9F4#039BE5#0288D1#0277BD#01579B#80D8FF#40C4FF#00B0FF#0091EA"),e.mui.cyan=a("#E0F7FA#B2EBF2#80DEEA#4DD0E1#26C6DA#00BCD4#00ACC1#0097A7#00838F#006064#84FFFF#18FFFF#00E5FF#00B8D4"),e.mui.teal=a("#E0F2F1#B2DFDB#80CBC4#4DB6AC#26A69A#009688#00897B#00796B#00695C#004D40#A7FFEB#64FFDA#1DE9B6#00BFA5"),e.mui.green=a("#E8F5E9#C8E6C9#A5D6A7#81C784#66BB6A#4CAF50#43A047#388E3C#2E7D32#1B5E20#B9F6CA#69F0AE#00E676#00C853"),e.mui.lightgreen=a("#F1F8E9#DCEDC8#C5E1A5#AED581#9CCC65#8BC34A#7CB342#689F38#558B2F#33691E#CCFF90#B2FF59#76FF03#64DD17"),e.mui.lime=a("#F9FBE7#F0F4C3#E6EE9C#DCE775#D4E157#CDDC39#C0CA33#AFB42B#9E9D24#827717#F4FF81#EEFF41#C6FF00#AEEA00"),e.mui.yellow=a("#FFFDE7#FFF9C4#FFF59D#FFF176#FFEE58#FFEB3B#FDD835#FBC02D#F9A825#F57F17#FFFF8D#FFFF00#FFEA00#FFD600"),e.mui.amber=a("#FFF8E1#FFECB3#FFE082#FFD54F#FFCA28#FFC107#FFB300#FFA000#FF8F00#FF6F00#FFE57F#FFD740#FFC400#FFAB00"),e.mui.orange=a("#FFF3E0#FFE0B2#FFCC80#FFB74D#FFA726#FF9800#FB8C00#F57C00#EF6C00#E65100#FFD180#FFAB40#FF9100#FF6D00"),e.mui.deeporange=a("#FBE9E7#FFCCBC#FFAB91#FF8A65#FF7043#FF5722#F4511E#E64A19#D84315#BF360C#FF9E80#FF6E40#FF3D00#DD2C00"),e.mui.brown=a("#EFEBE9#D7CCC8#BCAAA4#A1887F#8D6E63#795548#6D4C41#5D4037#4E342E#3E2723"),e.mui.grey=a("#FAFAFA#F5F5F5#EEEEEE#E0E0E0#BDBDBD#9E9E9E#757575#616161#424242#212121"),e.mui.bluegrey=a("#ECEFF1#CFD8DC#B0BEC5#90A4AE#78909C#607D8B#546E7A#455A64#37474F#263238"),e.flat.turquoise="#1abc9c",e.flat.greensea="#16a085",e.flat.sunflower="#f1c40f",e.flat.orange="#f39c12",e.flat.emerland="#2ecc71",e.flat.nephritis="#27ae60",e.flat.carrot="#e67e22",e.flat.pumpkin="#d35400",e.flat.peterriver="#3498db",e.flat.belizehole="#2980b9",e.flat.alizarin="#e74c3c",e.flat.pomegranate="#c0392b",e.flat.amethyst="#9b59b6",e.flat.wisteria="#8e44ad",e.flat.clouds="#ecf0f1",e.flat.silver="#bdc3c7",e.flat.wetasphalt="#34495e",e.flat.midnightblue="#2c3e50",e.flat.concrete="#95a5a6",e.flat.asbestos="#7f8c8d",e.importMUIColors=function(){for(var n in e.mui)e.mui.hasOwnProperty(n)&&(t[n]=e.mui[n])}})),r})); \ No newline at end of file diff --git a/dist/synoptic/cdn/vega-lite.min-5.5.0.js b/dist/synoptic/cdn/vega-lite.min-5.5.0.js deleted file mode 100644 index 754343d..0000000 --- a/dist/synoptic/cdn/vega-lite.min-5.5.0.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vega")):"function"==typeof define&&define.amd?define(["exports","vega"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).vegaLite={},e.vega)}(this,(function(e,t){"use strict";Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function e(){var t=isNaN(arguments[0])?1:Number(arguments[0]);return t?Array.prototype.reduce.call(this,(function(n,i){return Array.isArray(i)?n.push.apply(n,e.call(i,t-1)):n.push(i),n}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(e){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var n={exports:{}};!function(e){var t=function(){function e(e,t){return null!=t&&e instanceof t}var t,n,i;try{t=Map}catch(e){t=function(){}}try{n=Set}catch(e){n=function(){}}try{i=Promise}catch(e){i=function(){}}function o(r,s,c,l,u){"object"==typeof s&&(c=s.depth,l=s.prototype,u=s.includeNonEnumerable,s=s.circular);var d=[],f=[],p="undefined"!=typeof Buffer;return void 0===s&&(s=!0),void 0===c&&(c=1/0),function r(c,m){if(null===c)return null;if(0===m)return c;var g,h;if("object"!=typeof c)return c;if(e(c,t))g=new t;else if(e(c,n))g=new n;else if(e(c,i))g=new i((function(e,t){c.then((function(t){e(r(t,m-1))}),(function(e){t(r(e,m-1))}))}));else if(o.__isArray(c))g=[];else if(o.__isRegExp(c))g=new RegExp(c.source,a(c)),c.lastIndex&&(g.lastIndex=c.lastIndex);else if(o.__isDate(c))g=new Date(c.getTime());else{if(p&&Buffer.isBuffer(c))return g=Buffer.allocUnsafe?Buffer.allocUnsafe(c.length):new Buffer(c.length),c.copy(g),g;e(c,Error)?g=Object.create(c):void 0===l?(h=Object.getPrototypeOf(c),g=Object.create(h)):(g=Object.create(l),h=l)}if(s){var v=d.indexOf(c);if(-1!=v)return f[v];d.push(c),f.push(g)}for(var y in e(c,t)&&c.forEach((function(e,t){var n=r(t,m-1),i=r(e,m-1);g.set(n,i)})),e(c,n)&&c.forEach((function(e){var t=r(e,m-1);g.add(t)})),c){var b;h&&(b=Object.getOwnPropertyDescriptor(h,y)),b&&null==b.set||(g[y]=r(c[y],m-1))}if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(c);for(y=0;yc(e,t)))}:o(e)?{or:e.or.map((e=>c(e,t)))}:t(e)}const l=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,o,r;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(o=i;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(r=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;for(o=i;0!=o--;){var a=r[o];if(!e(t[a],n[a]))return!1}return!0}return t!=t&&n!=n},u=n.exports;function d(e){throw new Error(e)}function f(e,n){const i={};for(const o of n)t.hasOwnProperty(e,o)&&(i[o]=e[o]);return i}function p(e,t){const n={...e};for(const e of t)delete n[e];return n}Set.prototype.toJSON=function(){return"Set(".concat([...this].map((e=>i(e))).join(","),")")};const m=i;function g(e){if(t.isNumber(e))return e;const n=t.isString(e)?e:i(e);if(n.length<250)return n;let o=0;for(let e=0;e1?t-1:0),i=1;i0===t?e:"[".concat(e,"]"))),o=e.map(((t,n)=>e.slice(0,n+1).join("")));for(const e of o)n.add(e)}return n}function O(e,t){return void 0===e||void 0===t||D(F(e),F(t))}function z(e){return 0===_(e).length}const _=Object.keys,C=Object.values,N=Object.entries;function P(e){return!0===e||!1===e}function A(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function j(e,t){return a(e)?"!(".concat(j(e.not,t),")"):r(e)?"(".concat(e.and.map((e=>j(e,t))).join(") && ("),")"):o(e)?"(".concat(e.or.map((e=>j(e,t))).join(") || ("),")"):t(e)}function E(e,t){if(0===t.length)return!0;const n=t.shift();return n in e&&E(e[n],t)&&delete e[n],z(e)}function T(e){return e.charAt(0).toUpperCase()+e.substr(1)}function M(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum";const i=t.splitAccessPath(e),o=[];for(let e=1;e<=i.length;e++){const r="[".concat(i.slice(0,e).map(t.stringValue).join("]["),"]");o.push("".concat(n).concat(r))}return o.join(" && ")}function L(e){return"".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"datum","[").concat(t.stringValue(t.splitAccessPath(e).join(".")),"]")}function q(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function W(e){return"".concat(t.splitAccessPath(e).map(q).join("\\."))}function R(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function U(e){return"".concat(t.splitAccessPath(e).join("."))}function B(e){return e?t.splitAccessPath(e).length:0}function I(){for(var e=arguments.length,t=new Array(e),n=0;nsn(e[t])?A("_".concat(t,"_").concat(N(e[t]))):A("_".concat(t,"_").concat(e[t])))).join("")}function on(e){return!0===e||an(e)&&!e.binned}function rn(e){return"binned"===e||an(e)&&!0===e.binned}function an(e){return t.isObject(e)}function sn(e){return null==e?void 0:e.param}function cn(e){switch(e){case Q:case $:case ve:case pe:case me:case ge:case ke:case be:case xe:case we:case he:return 6;case Se:return 4;default:return 10}}function ln(e){return!(null==e||!e.expr)}function un(e){const t=_(e||{}),n={};for(const i of t)n[i]=xn(e[i]);return n}function dn(e){const{anchor:t,frame:n,offset:i,orient:o,angle:r,limit:a,color:s,subtitleColor:c,subtitleFont:l,subtitleFontSize:u,subtitleFontStyle:d,subtitleFontWeight:p,subtitleLineHeight:m,subtitlePadding:g,...h}=e,v={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...o?{orient:o}:{},...void 0!==r?{angle:r}:{},...void 0!==a?{limit:a}:{}},y={...c?{subtitleColor:c}:{},...l?{subtitleFont:l}:{},...u?{subtitleFontSize:u}:{},...d?{subtitleFontStyle:d}:{},...p?{subtitleFontWeight:p}:{},...m?{subtitleLineHeight:m}:{},...g?{subtitlePadding:g}:{}};return{titleMarkConfig:{...h,...s?{fill:s}:{}},subtitleMarkConfig:f(e,["align","baseline","dx","dy","limit"]),nonMarkTitleProperties:v,subtitle:y}}function fn(e){return t.isString(e)||t.isArray(e)&&t.isString(e[0])}function pn(e){return!(null==e||!e.signal)}function mn(e){return!!e.step}function gn(e){return!t.isArray(e)&&"field"in e&&"data"in e}const hn=_({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),vn={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},yn=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function bn(e){const n=t.isArray(e.condition)?e.condition.map(wn):wn(e.condition);return{...xn(e),condition:n}}function xn(e){if(ln(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function wn(e){if(ln(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function kn(e){if(ln(e)){const{expr:t,...n}=e;return{signal:t,...n}}return pn(e)?e:void 0!==e?{value:e}:void 0}function Sn(e){return pn(e)?e.signal:t.stringValue(e.value)}function Dn(e){return pn(e)?e.signal:null==e?null:t.stringValue(e)}function Fn(e,t,n){for(const i of n){const n=_n(i,t.markDef,t.config);void 0!==n&&(e[i]=kn(n))}return e}function On(e){var t;return[].concat(e.type,null!==(t=e.style)&&void 0!==t?t:[])}function zn(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{vgChannel:o,ignoreVgConfig:r}=i;return o&&void 0!==t[o]?t[o]:void 0!==t[e]?t[e]:!r||o&&o!==e?_n(e,t,n,i):void 0}function _n(e,t,n){let{vgChannel:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return I(i?Cn(e,t,n.style):void 0,Cn(e,t,n.style),i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function Cn(e,t,n){return Nn(e,On(t),n)}function Nn(e,n,i){let o;n=t.array(n);for(const t of n){const n=i[t];n&&void 0!==n[e]&&(o=n[e])}return o}function Pn(e,n){return t.array(e).reduce(((e,t)=>{var i;return e.field.push(Gr(t,n)),e.order.push(null!==(i=t.sort)&&void 0!==i?i:"ascending"),e}),{field:[],order:[]})}function An(e,t){const n=[...e];return t.forEach((e=>{for(const t of n)if(l(t,e))return;n.push(e)})),n}function jn(e,n){return l(e,n)||!n?e:e?[...t.array(e),...t.array(n)].join(", "):n}function En(e,t){const n=e.value,i=t.value;if(null==n||null===i)return{explicit:e.explicit,value:null};if((fn(n)||pn(n))&&(fn(i)||pn(i)))return{explicit:e.explicit,value:jn(n,i)};if(fn(n)||pn(n))return{explicit:e.explicit,value:n};if(fn(i)||pn(i))return{explicit:e.explicit,value:i};if(!(fn(n)||pn(n)||fn(i)||pn(i)))return{explicit:e.explicit,value:An(n,i)};throw new Error("It should never reach here")}function Tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mn(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,Ln(e,t,"set"),n),n}function Ln(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function qn(e){return"Invalid specification ".concat(m(e),'. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".')}function Wn(e){return"".concat("width"==e?"Width":"Height",' "container" only works for single views and layered views.')}function Rn(e){const t="width"==e?"x":"y";return"".concat("width"==e?"Width":"Height",' "container" only works well with autosize "fit" or "fit-').concat(t,'".')}function Un(e){return e?'Dropping "fit-'.concat(e,'" because spec has discrete ').concat(nt(e),"."):'Dropping "fit" because spec has discrete size.'}function Bn(e){return"Unknown field for ".concat(e,". Cannot calculate view size.")}function In(e){return'Cannot project a selection on encoding channel "'.concat(e,'", which has no field.')}function Hn(e,t){return'Cannot project a selection on encoding channel "'.concat(e,'" as it uses an aggregate function ("').concat(t,'").')}function Vn(e){return"Selection not supported for ".concat(e," yet.")}function Gn(e){return'The "columns" property cannot be used when "'.concat(e,'" has nested row/column.')}function Yn(e,t,n){return'An ancestor parsed field "'.concat(e,'" as ').concat(n," but a child wants to parse the field as ").concat(t,".")}function Xn(e){return"Config.customFormatTypes is not true, thus custom format type and format for channel ".concat(e," are dropped.")}function Jn(e){return"".concat(e,"Offset dropped because ").concat(e," is continuous")}function Qn(e){return"There is no ".concat(e," encoding. Replacing ").concat(e,"Offset encoding as ").concat(e,".")}function $n(e){return'Invalid field type "'.concat(e,'".')}function Kn(e,t){const{fill:n,stroke:i}=t;return"Dropping color ".concat(e," as the plot also has ").concat(n&&i?"fill and stroke":n?"fill":"stroke",".")}function Zn(e,t){return"Dropping ".concat(m(e),' from channel "').concat(t,'" since it does not contain any data field, datum, value, or signal.')}function ei(e,t,n){return"".concat(e,' dropped as it is incompatible with "').concat(t,'"').concat(n?" when ".concat(n):"",".")}function ti(e){return"".concat(e," encoding has no scale, so specified scale is ignored.")}function ni(e){return"".concat(e," encoding should be discrete (ordinal / nominal / binned).")}function ii(e){return"".concat(e," encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).")}function oi(e,t){return'Using discrete channel "'.concat(e,'" to encode "').concat(t,'" field can be misleading as it does not encode ').concat("ordinal"===t?"order":"magnitude",".")}function ri(e){return"Using unaggregated domain with raw field has no effect (".concat(m(e),").")}function ai(e){return'Unaggregated domain not applicable for "'.concat(e,'" since it produces values outside the origin domain of the source data.')}function si(e){return"Unaggregated domain is currently unsupported for log scale (".concat(m(e),").")}function ci(e,t,n){return"".concat(n,"-scale's \"").concat(t,'" is dropped as it does not work with ').concat(e," scale.")}function li(e){return'The step for "'.concat(e,'" is dropped because the ').concat("width"===e?"x":"y"," is continuous.")}const ui="Domains that should be unioned has conflicting sort properties. Sort will be set to true.";function di(e,t){return"Invalid ".concat(e,": ").concat(m(t),".")}function fi(e){return"1D error band does not support ".concat(e,".")}function pi(e){return"Channel ".concat(e,' is required for "binned" bin.')}const mi=t.logger(t.Warn);let gi=mi;function hi(){gi.warn(...arguments)}function vi(e){if(e&&t.isObject(e))for(const t of Fi)if(t in e)return!0;return!1}const yi=["january","february","march","april","may","june","july","august","september","october","november","december"],bi=yi.map((e=>e.substr(0,3))),xi=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],wi=xi.map((e=>e.substr(0,3)));function ki(e,n){const i=[];if(n&&void 0!==e.day&&_(e).length>1&&(hi(function(e){return"Dropping day from datetime ".concat(m(e)," as day cannot be combined with other units.")}(e)),delete(e=u(e)).day),void 0!==e.year?i.push(e.year):i.push(2012),void 0!==e.month){const o=n?function(e){if(J(e)&&(e=+e),t.isNumber(e))return e-1;{const t=e.toLowerCase(),n=yi.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),o=bi.indexOf(i);if(-1!==o)return o;throw new Error(di("month",e))}}(e.month):e.month;i.push(o)}else if(void 0!==e.quarter){const o=n?function(e){if(J(e)&&(e=+e),t.isNumber(e))return e>4&&hi(di("quarter",e)),e-1;throw new Error(di("quarter",e))}(e.quarter):e.quarter;i.push(t.isNumber(o)?3*o:"".concat(o,"*3"))}else i.push(0);if(void 0!==e.date)i.push(e.date);else if(void 0!==e.day){const o=n?function(e){if(J(e)&&(e=+e),t.isNumber(e))return e%7;{const t=e.toLowerCase(),n=xi.indexOf(t);if(-1!==n)return n;const i=t.substr(0,3),o=wi.indexOf(i);if(-1!==o)return o;throw new Error(di("day",e))}}(e.day):e.day;i.push(t.isNumber(o)?o+1:"".concat(o,"+1"))}else i.push(1);for(const t of["hours","minutes","seconds","milliseconds"]){const n=e[t];i.push(void 0===n?0:n)}return i}function Si(e){const t=ki(e,!0).join(", ");return e.utc?"utc(".concat(t,")"):"datetime(".concat(t,")")}const Di={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Fi=_(Di);function Oi(e){return e.startsWith("utc")}const zi={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function _i(e){return Fi.filter((t=>Ci(e,t)))}function Ci(e,t){const n=e.indexOf(t);return!(n<0||n>0&&"seconds"===t&&"i"===e.charAt(n-1)||e.length>n+3&&"day"===t&&"o"===e.charAt(n+3)||n>0&&"year"===t&&"f"===e.charAt(n-1))}function Ni(e){if(!e)return;const t=_i(e);return"timeUnitSpecifier(".concat(m(t),", ").concat(m(zi),")")}function Pi(e){if(!e)return;let n;return t.isString(e)?n={unit:e}:t.isObject(e)&&(n={...e,...e.unit?{unit:e.unit}:{}}),Oi(n.unit)&&(n.utc=!0,n.unit=n.unit.substr(3)),n}function Ai(e){return!(null==e||!e.field)&&void 0!==e.equal}function ji(e){return!(null==e||!e.field)&&void 0!==e.lt}function Ei(e){return!(null==e||!e.field)&&void 0!==e.lte}function Ti(e){return!(null==e||!e.field)&&void 0!==e.gt}function Mi(e){return!(null==e||!e.field)&&void 0!==e.gte}function Li(e){if(null!=e&&e.field){if(t.isArray(e.range)&&2===e.range.length)return!0;if(pn(e.range))return!0}return!1}function qi(e){return!(null==e||!e.field)&&(t.isArray(e.oneOf)||t.isArray(e.in))}function Wi(e){return qi(e)||Ai(e)||Li(e)||ji(e)||Ti(e)||Ei(e)||Mi(e)}function Ri(e,t){return la(e,{timeUnit:t,wrapTime:!0})}function Ui(e){var t;let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{field:i}=e,o=null===(t=Pi(e.timeUnit))||void 0===t?void 0:t.unit,r=o?"time(".concat(function(e,t){let{end:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{end:!1};const i=M(t),o=Oi(e)?"utc":"";function r(e){return"quarter"===e?"(".concat(o,"quarter(").concat(i,")-1)"):"".concat(o).concat(e,"(").concat(i,")")}let a;const s={};for(const t of Fi)Ci(e,t)&&(s[t]=r(t),a=t);return n&&(s[a]+="+1"),function(e){const t=ki(e,!1).join(", ");return e.utc?"utc(".concat(t,")"):"datetime(".concat(t,")")}(s)}(o,i),")"):Gr(e,{expr:"datum"});if(Ai(e))return"".concat(r,"===").concat(Ri(e.equal,o));if(ji(e)){const t=e.lt;return"".concat(r,"<").concat(Ri(t,o))}if(Ti(e)){const t=e.gt;return"".concat(r,">").concat(Ri(t,o))}if(Ei(e)){const t=e.lte;return"".concat(r,"<=").concat(Ri(t,o))}if(Mi(e)){const t=e.gte;return"".concat(r,">=").concat(Ri(t,o))}if(qi(e))return"indexof([".concat(function(e,t){return e.map((e=>Ri(e,t)))}(e.oneOf,o).join(","),"], ").concat(r,") !== -1");if(function(e){return!(null==e||!e.field)&&void 0!==e.valid}(e))return Bi(r,e.valid);if(Li(e)){const{range:t}=e,i=pn(t)?{signal:"".concat(t.signal,"[0]")}:t[0],a=pn(t)?{signal:"".concat(t.signal,"[1]")}:t[1];if(null!==i&&null!==a&&n)return"inrange("+r+", ["+Ri(i,o)+", "+Ri(a,o)+"])";const s=[];return null!==i&&s.push("".concat(r," >= ").concat(Ri(i,o))),null!==a&&s.push("".concat(r," <= ").concat(Ri(a,o))),s.length>0?s.join(" && "):"true"}throw new Error("Invalid field predicate: ".concat(m(e)))}function Bi(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?"!isValid(".concat(e,") || !isFinite(+").concat(e,")"):"isValid(".concat(e,") && isFinite(+").concat(e,")")}function Ii(e){var t;return Wi(e)&&e.timeUnit?{...e,timeUnit:null===(t=Pi(e.timeUnit))||void 0===t?void 0:t.unit}:e}function Hi(e){return"quantitative"===e||"temporal"===e}function Vi(e){return"ordinal"===e||"nominal"===e}const Gi="quantitative",Yi="ordinal",Xi="temporal",Ji="nominal",Qi="geojson",$i="log",Ki="time",Zi="utc",eo="point",to="band",no={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function io(e,t){const n=no[e],i=no[t];return n===i||"ordinal-position"===n&&"time"===i||"ordinal-position"===i&&"time"===n}const oo={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function ro(e){return oo[e]}const ao=new Set(["linear","log","pow","sqrt","symlog"]),so=new Set([...ao,"time","utc"]);function co(e){return ao.has(e)}const lo=new Set(["quantile","quantize","threshold"]),uo=new Set([...so,...lo,"sequential","identity"]),fo=new Set(["ordinal","bin-ordinal","point","band"]);function po(e){return fo.has(e)}function mo(e){return uo.has(e)}function go(e){return so.has(e)}function ho(e){return lo.has(e)}function vo(e){return null==e?void 0:e.param}const{type:yo,domain:bo,range:xo,rangeMax:wo,rangeMin:ko,scheme:So,...Do}={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},Fo=_(Do);function Oo(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return go(e)||"band"===e||"point"===e;case"padding":case"rangeMin":case"rangeMax":return go(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return"band"===e;case"domainMax":case"domainMid":case"domainMin":case"clamp":return go(e);case"nice":return go(e)||"quantize"===e||"threshold"===e;case"exponent":return"pow"===e;case"base":return"log"===e;case"constant":return"symlog"===e;case"zero":return mo(e)&&!v(["log","time","utc","threshold","quantile"],e)}}function zo(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Le(e)?void 0:'Cannot use the scale property "'.concat(t,'" with non-color channel.');case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}const _o={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},Co=_o.arc,No=_o.area,Po=_o.bar,Ao=_o.image,jo=_o.line,Eo=_o.point,To=_o.rect,Mo=_o.rule,Lo=_o.text,qo=_o.tick,Wo=_o.trail,Ro=_o.circle,Uo=_o.square,Bo=_o.geoshape;function Io(e){return["line","area","trail"].includes(e)}function Ho(e){return["rect","bar","image","arc"].includes(e)}const Vo=new Set(_(_o));function Go(e){return e.type}const Yo=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit","fill","fillOpacity"],Xo=_({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Jo=_({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Qo(e){return e&&null!=e.band}const $o={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]};function Ko(e){const{channel:t,channelDef:n,markDef:i,scale:o,config:r}=e,a=ir(e);return jr(n)&&!Zt(n.aggregate)&&o&&go(o.get("type"))?function(e){let{fieldDef:t,channel:n,markDef:i,ref:o,config:r}=e;return Io(i.type)?o:null===zn("invalid",i,r)?[Zo(t,n),o]:o}({fieldDef:n,channel:t,markDef:i,ref:a,config:r}):a}function Zo(e,t){return{test:er(e,!0),..."y"===Ze(t)?{field:{group:"height"}}:{value:0}}}function er(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Bi(t.isString(e)?e:Gr(e,{expr:"datum"}),!n)}function tr(e,t,n,i){const o={};if(t&&(o.scale=t),Tr(e)){const{datum:t}=e;vi(t)?o.signal=Si(t):pn(t)?o.signal=t.signal:ln(t)?o.signal=t.expr:o.value=t}else o.field=Gr(e,n);if(i){const{offset:e,band:t}=i;e&&(o.offset=e),t&&(o.band=t)}return o}function nr(e){let{scaleName:t,fieldOrDatumDef:n,fieldOrDatumDef2:i,offset:o,startSuffix:r,bandPosition:a=.5}=e;const s=01&&void 0!==arguments[1]?arguments[1]:{},n=e.field;const i=t.prefix;let o=t.suffix,r="";if(function(e){return"count"===e.aggregate}(e))n=G("count");else{let i;if(!t.nofn)if(function(e){return"op"in e}(e))i=e.op;else{const{bin:l,aggregate:u,timeUnit:d}=e;var a,s;if(on(l))i=nn(l),o=(null!==(a=t.binSuffix)&&void 0!==a?a:"")+(null!==(s=t.suffix)&&void 0!==s?s:"");else if(u)Qt(u)?(r='["'.concat(n,'"]'),n="argmax_".concat(u.argmax)):Jt(u)?(r='["'.concat(n,'"]'),n="argmin_".concat(u.argmin)):i=String(u);else if(d){var c;i=function(e){const{utc:t,...n}=Pi(e);return n.unit?(t?"utc":"")+_(n).map((e=>A("".concat("unit"===e?"":"_".concat(e,"_")).concat(n[e])))).join(""):(t?"utc":"")+"timeunit"+_(n).map((e=>A("_".concat(e,"_").concat(n[e])))).join("")}(d),o=(!["range","mid"].includes(t.binSuffix)&&t.binSuffix||"")+(null!==(c=t.suffix)&&void 0!==c?c:"")}}i&&(n=n?"".concat(i,"_").concat(n):i)}return o&&(n="".concat(n,"_").concat(o)),i&&(n="".concat(i,"_").concat(n)),t.forAs?U(n):t.expr?L(n,t.expr)+r:W(n)+r}function Yr(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return!0;case"quantitative":return jr(e)&&!!e.bin;case"temporal":return!1}throw new Error($n(e.type))}const Xr=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function(e){const{aggregate:t,bin:n,timeUnit:i,field:o}=e;if(Qt(t))return"".concat(o," for argmax(").concat(t.argmax,")");if(Jt(t))return"".concat(o," for argmin(").concat(t.argmin,")");const r=Pi(i),a=t||(null==r?void 0:r.unit)||(null==r?void 0:r.maxbins)&&"timeunit"||on(n)&&"bin";return a?"".concat(a.toUpperCase(),"(").concat(o,")"):o}(e);default:return function(e,t){const{field:n,bin:i,timeUnit:o,aggregate:r}=e;if("count"===r)return t.countTitle;if(on(i))return"".concat(n," (binned)");if(o){var a;const e=null===(a=Pi(o))||void 0===a?void 0:a.unit;if(e)return"".concat(n," (").concat(_i(e).join("-"),")")}else if(r)return Qt(r)?"".concat(n," for max ").concat(r.argmax):Jt(r)?"".concat(n," for min ").concat(r.argmin):"".concat(T(r)," of ").concat(n);return n}(e,t)}};let Jr=Xr;function Qr(e){Jr=e}function $r(e,t,n){var i;let{allowDisabling:o,includeDefault:r=!0}=n;const a=null===(i=Kr(e))||void 0===i?void 0:i.title;if(!jr(e))return null!=a?a:e.title;const s=e,c=r?Zr(s,t):void 0;return o?I(a,s.title,c):null!==(l=null!=a?a:s.title)&&void 0!==l?l:c;var l}function Kr(e){return Br(e)&&e.axis?e.axis:Ir(e)&&e.legend?e.legend:Sr(e)&&e.header?e.header:void 0}function Zr(e,t){return Jr(e,t)}function ea(e){if(Hr(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}{var t;const n=null!==(t=Kr(e))&&void 0!==t?t:{},{format:i,formatType:o}=n;return{format:i,formatType:o}}}function ta(e){return jr(e)?e:Pr(e)?e.condition:void 0}function na(e){return qr(e)?e:Ar(e)?e.condition:void 0}function ia(e,n,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.isString(e)||t.isNumber(e)||t.isBoolean(e)?(hi(function(e,t,n){return"Channel ".concat(e," is a ").concat(t,". Converted to {value: ").concat(m(n),"}.")}(n,t.isString(e)?"string":t.isNumber(e)?"number":"boolean",e)),{value:e}):qr(e)?oa(e,n,i,o):Ar(e)?{...e,condition:oa(e.condition,n,i,o)}:e}function oa(e,n,i,o){if(Hr(e)){const{format:t,formatType:r,...a}=e;if(rr(r)&&!i.customFormatTypes)return hi(Xn(n)),oa(a,n,i,o)}else{const t=Br(e)?"axis":Ir(e)?"legend":Sr(e)?"header":null;if(t&&e[t]){const{format:r,formatType:a,...s}=e[t];if(rr(a)&&!i.customFormatTypes)return hi(Xn(n)),oa({...e,[t]:s},n,i,o)}}return jr(e)?ra(e,n,o):function(e){let n=e.type;if(n)return e;const{datum:i}=e;return n=t.isNumber(i)?"quantitative":t.isString(i)?"nominal":vi(i)?"temporal":void 0,{...e,type:n}}(e)}function ra(e,n){let{compositeMark:i=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{aggregate:o,timeUnit:r,bin:a,field:s}=e,c={...e};if(i||!o||$t(o)||Qt(o)||Jt(o)||(hi(function(e){return'Invalid aggregation operator "'.concat(e,'".')}(o)),delete c.aggregate),r&&(c.timeUnit=Pi(r)),s&&(c.field="".concat(s)),on(a)&&(c.bin=aa(a,n)),rn(a)&&!Dt(n)&&hi(function(e){return"Channel ".concat(e,' should not be used with "binned" bin.')}(n)),Wr(c)){const{type:e}=c,t=function(e){if(e)switch(e=e.toLowerCase()){case"q":case Gi:return"quantitative";case"t":case Xi:return"temporal";case"o":case Yi:return"ordinal";case"n":case Ji:return"nominal";case Qi:return"geojson"}}(e);e!==t&&(c.type=t),"quantitative"!==e&&Zt(o)&&(hi(function(e,t){return'Invalid field type "'.concat(e,'" for aggregate: "').concat(t,'", using "quantitative" instead.')}(e,o)),c.type="quantitative")}else if(!Ke(n)){const e=function(e,n){var i;switch(n){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Or(e)&&t.isArray(e.sort))return"ordinal";const{aggregate:o,bin:r,timeUnit:a}=e;if(a)return"temporal";if(r||o&&!Qt(o)&&!Jt(o))return"quantitative";if(Ur(e)&&null!==(i=e.scale)&&void 0!==i&&i.type)switch(no[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(c,n);c.type=e}if(Wr(c)){const{compatible:e,warning:t}=function(e,t){const n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:"Channel ".concat(t," should not be used with a geojson data.")};switch(t){case Q:case $:case K:return Yr(e)?sa:{compatible:!1,warning:ni(t)};case Z:case ee:case ie:case oe:case pe:case me:case ge:case De:case Oe:case ze:case _e:case Ce:case Ne:case ye:case se:case re:case Pe:return sa;case ue:case fe:case le:case de:return n!==Gi?{compatible:!1,warning:"Channel ".concat(t," should be used with a quantitative field only, not ").concat(e.type," field.")}:sa;case be:case xe:case we:case ke:case ve:case ce:case ae:case te:case ne:return"nominal"!==n||e.sort?sa:{compatible:!1,warning:"Channel ".concat(t," should not be used with an unsorted discrete field.")};case he:case Se:return Yr(e)||Ur(i=e)&&ho(null===(o=i.scale)||void 0===o?void 0:o.type)?sa:{compatible:!1,warning:ii(t)};case Fe:return"nominal"!==e.type||"sort"in e?sa:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}var i,o}(c,n)||{};!1===e&&hi(t)}if(Or(c)&&t.isString(c.sort)){const{sort:e}=c;if(yr(e))return{...c,sort:{encoding:e}};const t=e.substr(1);if("-"===e.charAt(0)&&yr(t))return{...c,sort:{encoding:t,order:"descending"}}}if(Sr(c)){const{header:e}=c;if(e){const{orient:t,...n}=e;if(t)return{...c,header:{...n,labelOrient:e.labelOrient||t,titleOrient:e.titleOrient||t}}}}return c}function aa(e,n){return t.isBoolean(e)?{maxbins:cn(n)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:{...e,maxbins:cn(n)}}const sa={compatible:!0};function ca(e){const{formatType:t}=ea(e);return"time"===t||!t&&(n=e)&&("temporal"===n.type||jr(n)&&!!n.timeUnit);var n}function la(e,n){var i;let{timeUnit:o,type:r,wrapTime:a,undefinedIfExprNotRequired:s}=n;const c=o&&(null===(i=Pi(o))||void 0===i?void 0:i.unit);let l,u=c||"temporal"===r;return ln(e)?l=e.expr:pn(e)?l=e.signal:vi(e)?(u=!0,l=Si(e)):(t.isString(e)||t.isNumber(e))&&u&&(l="datetime(".concat(m(e),")"),function(e){return!!Di[e]}(c)&&(t.isNumber(e)&&e<1e4||t.isString(e)&&isNaN(Date.parse(e)))&&(l=Si({[c]:e}))),l?a&&u?"time(".concat(l,")"):l:s?void 0:m(e)}function ua(e,t){const{type:n}=e;return t.map((t=>{const i=la(t,{timeUnit:jr(e)?e.timeUnit:void 0,type:n,undefinedIfExprNotRequired:!0});return void 0!==i?{signal:i}:t}))}function da(e,t){return on(e.bin)?Bt(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const fa={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function pa(e){return null==e?void 0:e.condition}const ma=["domain","grid","labels","ticks","title"],ga={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},ha={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},va={...ha,style:1,labelExpr:1,encoding:1};function ya(e){return!!va[e]}const ba=_({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function xa(e){return"mark"in e}class wa{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return!!xa(e)&&(Go(t=e.mark)?t.type:t)===this.name;var t}}function ka(e,n){const i=e&&e[n];return!!i&&(t.isArray(i)?y(i,(e=>!!e.field)):jr(i)||Pr(i))}function Sa(e,n){const i=e&&e[n];return!!i&&(t.isArray(i)?y(i,(e=>!!e.field)):jr(i)||Tr(i)||Ar(i))}function Da(e,t){if(Dt(t)){const n=e[t];if((jr(n)||Tr(n))&&Vi(n.type))return Sa(e,it(t))}return!1}function Fa(e){return y(Ue,(n=>{if(ka(e,n)){const i=e[n];if(t.isArray(i))return y(i,(e=>!!e.aggregate));{const e=ta(i);return e&&!!e.aggregate}}return!1}))}function Oa(e,t){const n=[],i=[],o=[],r=[],a={};return Na(e,((s,c)=>{if(jr(s)){const{field:l,aggregate:u,bin:d,timeUnit:f,...p}=s;if(u||f||d){const e=Kr(s),m=null==e?void 0:e.title;let g=Gr(s,{forAs:!0});const h={...m?[]:{title:$r(s,t,{allowDisabling:!0})},...p,field:g};if(u){let e;if(Qt(u)?(e="argmax",g=Gr({op:"argmax",field:u.argmax},{forAs:!0}),h.field="".concat(g,".").concat(l)):Jt(u)?(e="argmin",g=Gr({op:"argmin",field:u.argmin},{forAs:!0}),h.field="".concat(g,".").concat(l)):"boxplot"!==u&&"errorbar"!==u&&"errorband"!==u&&(e=u),e){const t={op:e,as:g};l&&(t.field=l),r.push(t)}}else if(n.push(g),Wr(s)&&on(d)){if(i.push({bin:d,field:l,as:g}),n.push(Gr(s,{binSuffix:"end"})),da(s,c)&&n.push(Gr(s,{binSuffix:"range"})),Dt(c)){const e={field:"".concat(g,"_end")};a["".concat(c,"2")]=e}h.bin="binned",Ke(c)||(h.type=Gi)}else if(f){o.push({timeUnit:f,field:l,as:g});const e=Wr(s)&&s.type!==Xi&&"time";e&&(c===De||c===_e?h.formatType=e:function(e){return!!xt[e]}(c)?h.legend={formatType:e,...h.legend}:Dt(c)&&(h.axis={formatType:e,...h.axis}))}a[c]=h}else n.push(l),a[c]=e[c]}else a[c]=e[c]})),{bins:i,timeUnits:o,aggregate:r,groupby:n,encoding:a}}function za(e,t,n){const i=function(e,t){return function(e){switch(e){case pe:case me:case ge:case Pe:case Oe:case ze:case _e:case Ce:case Fe:case be:case xe:case we:case ke:case K:case Q:case $:return It;case Z:case ee:case ie:case oe:case le:case ue:return Vt;case te:case ne:case de:case fe:return{area:"always",bar:"always",image:"always",rect:"always",rule:"always",circle:"binned",point:"binned",square:"binned",tick:"binned",line:"binned",trail:"binned"};case ve:return{point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",text:"always",line:"always",trail:"always"};case Se:return{line:"always",point:"always",tick:"always",rule:"always",circle:"always",square:"always",bar:"always",geoshape:"always"};case he:return{point:"always",geoshape:"always"};case De:return{text:"always"};case ye:return{point:"always",square:"always",text:"always"};case Ne:return{image:"always"};case se:case re:return{text:"always",arc:"always"};case ce:case ae:return{arc:"always"}}}(e)[t]}(t,n);if(!i)return!1;if("binned"===i){const n=e[t===te?Z:ee];return!!(jr(n)&&jr(e[t])&&rn(n.bin))}return!0}function _a(e,t){const n={};for(const i of _(e)){const o=ia(e[i],i,t,{compositeMark:!0});n[i]=o}return n}function Ca(e){const n=[];for(const i of _(e))if(ka(e,i)){const o=e[i],r=t.array(o);for(const e of r)jr(e)?n.push(e):Pr(e)&&n.push(e.condition)}return n}function Na(e,n,i){if(e)for(const o of _(e)){const r=e[o];if(t.isArray(r))for(const e of r)n.call(i,e,o);else n.call(i,r,o)}}function Pa(e,n){return _(n).reduce(((i,o)=>{switch(o){case Z:case ee:case Ce:case Pe:case Ne:case te:case ne:case ie:case oe:case se:case ce:case re:case ae:case le:case ue:case de:case fe:case De:case he:case ye:case _e:return i;case Fe:if("line"===e||"trail"===e)return i;case Oe:case ze:{const e=n[o];if(t.isArray(e)||jr(e))for(const n of t.array(e))n.aggregate||i.push(Gr(n,{}));return i}case ve:if("trail"===e)return i;case pe:case me:case ge:case be:case xe:case we:case Se:case ke:{const e=ta(n[o]);return e&&!e.aggregate&&i.push(Gr(e,{})),i}}}),[])}function Aa(e,t,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if("tooltip"in n)return{tooltip:n.tooltip};const o=e.map((e=>{let{fieldPrefix:n,titlePrefix:o}=e;const r=i?" of ".concat(ja(t)):"";return{field:n+t.field,type:t.type,title:pn(o)?{signal:"".concat(o,'"').concat(escape(r),'"')}:o+r}}));return{tooltip:[...o,...k(Ca(n).map(Vr),g)]}}function ja(e){const{title:t,field:n}=e;return I(t,n)}function Ea(e,n,i,o,r){const{scale:a,axis:s}=i;return c=>{let{partName:l,mark:u,positionPrefix:d,endPositionPrefix:f,extraEncoding:p={}}=c;const m=ja(i);return Ta(e,l,r,{mark:u,encoding:{[n]:{field:"".concat(d,"_").concat(i.field),type:i.type,...void 0!==m?{title:m}:{},...void 0!==a?{scale:a}:{},...void 0!==s?{axis:s}:{}},...t.isString(f)?{["".concat(n,"2")]:{field:"".concat(f,"_").concat(i.field)}}:{},...o,...p}})}}function Ta(e,n,i,o){const{clip:r,color:a,opacity:s}=e,c=e.type;return e[n]||void 0===e[n]&&i[n]?[{...o,mark:{...i[n],...r?{clip:r}:{},...a?{color:a}:{},...s?{opacity:s}:{},...Go(o.mark)?o.mark:{type:o.mark},style:"".concat(c,"-").concat(String(n)),...t.isBoolean(e[n])?{}:e[n]}}]:[]}function Ma(e,t,n){const{encoding:i}=e,o="vertical"===t?"y":"x",r=i[o],a=i["".concat(o,"2")],s=i["".concat(o,"Error")],c=i["".concat(o,"Error2")];return{continuousAxisChannelDef:La(r,n),continuousAxisChannelDef2:La(a,n),continuousAxisChannelDefError:La(s,n),continuousAxisChannelDefError2:La(c,n),continuousAxis:o}}function La(e,t){if(null!=e&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&hi(function(e,t){return"Continuous axis should not have customized aggregation function ".concat(e,"; ").concat(t," already agregates the axis.")}(n,t)),i}return e}function qa(e,t){const{mark:n,encoding:i}=e,{x:o,y:r}=i;if(Go(n)&&n.orient)return n.orient;if(Mr(o)){if(Mr(r)){const e=jr(o)&&o.aggregate,n=jr(r)&&r.aggregate;if(e||n!==t){if(n||e!==t){if(e===t&&n===t)throw new Error("Both x and y cannot have aggregate");return ca(r)&&!ca(o)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(Mr(r))return"vertical";throw new Error("Need a valid continuous axis for ".concat(t,"s"))}const Wa="boxplot",Ra=new wa(Wa,Ba);function Ua(e){return t.isNumber(e)?"tukey":e}function Ba(e,n){var i;let{config:o}=n;e={...e,encoding:_a(e.encoding,o)};const{mark:r,encoding:a,params:s,projection:c,...l}=e,u=Go(r)?r:{type:r};s&&hi(Vn("boxplot"));const d=null!==(i=u.extent)&&void 0!==i?i:o.boxplot.extent,f=zn("size",u,o),m=Ua(d),{bins:g,timeUnits:h,transform:v,continuousAxisChannelDef:y,continuousAxis:b,groupby:x,aggregate:w,encodingWithoutContinuousAxis:k,ticksOrient:S,boxOrient:D,customTooltipWithoutAggregatedField:F}=function(e,n,i){const o=qa(e,Wa),{continuousAxisChannelDef:r,continuousAxis:a}=Ma(e,o,Wa),s=r.field,c=Ua(n),l=[...Ia(s),{op:"median",field:s,as:"mid_box_".concat(s)},{op:"min",field:s,as:("min-max"===c?"lower_whisker_":"min_")+s},{op:"max",field:s,as:("min-max"===c?"upper_whisker_":"max_")+s}],u="min-max"===c||"tukey"===c?[]:[{calculate:'datum["upper_box_'.concat(s,'"] - datum["lower_box_').concat(s,'"]'),as:"iqr_".concat(s)},{calculate:'min(datum["upper_box_'.concat(s,'"] + datum["iqr_').concat(s,'"] * ').concat(n,', datum["max_').concat(s,'"])'),as:"upper_whisker_".concat(s)},{calculate:'max(datum["lower_box_'.concat(s,'"] - datum["iqr_').concat(s,'"] * ').concat(n,', datum["min_').concat(s,'"])'),as:"lower_whisker_".concat(s)}],{[a]:d,...f}=e.encoding,{customTooltipWithoutAggregatedField:p,filteredEncoding:m}=function(e){const{tooltip:n,...i}=e;if(!n)return{filteredEncoding:i};let o,r;if(t.isArray(n)){for(const e of n)e.aggregate?(o||(o=[]),o.push(e)):(r||(r=[]),r.push(e));o&&(i.tooltip=o)}else n.aggregate?i.tooltip=n:r=n;return t.isArray(r)&&1===r.length&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:i}}(f),{bins:g,timeUnits:h,aggregate:v,groupby:y,encoding:b}=Oa(m,i),x="vertical"===o?"horizontal":"vertical",w=o;return{bins:g,timeUnits:h,transform:[...g,...h,{aggregate:[...v,...l],groupby:y},...u],groupby:y,aggregate:v,continuousAxisChannelDef:r,continuousAxis:a,encodingWithoutContinuousAxis:b,ticksOrient:x,boxOrient:w,customTooltipWithoutAggregatedField:p}}(e,d,o),{color:O,size:_,...C}=k,N=e=>Ea(u,b,y,e,o.boxplot),P=N(C),A=N(k),j=N({...C,..._?{size:_}:{}}),E=Aa([{fieldPrefix:"min-max"===m?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===m?"lower_whisker_":"min_",titlePrefix:"Min"}],y,k),T={type:"tick",color:"black",opacity:1,orient:S,invalid:null,aria:!1},M="min-max"===m?E:Aa([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],y,k),L=[...P({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:M}),...P({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:M}),...P({partName:"ticks",mark:T,positionPrefix:"lower_whisker",extraEncoding:M}),...P({partName:"ticks",mark:T,positionPrefix:"upper_whisker",extraEncoding:M})],q=[..."tukey"!==m?L:[],...A({partName:"box",mark:{type:"bar",...f?{size:f}:{},orient:D,invalid:null,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:E}),...j({partName:"median",mark:{type:"tick",invalid:null,...t.isObject(o.boxplot.median)&&o.boxplot.median.color?{color:o.boxplot.median.color}:{},...f?{size:f}:{},orient:S,aria:!1},positionPrefix:"mid_box",extraEncoding:E})];var W;if("min-max"===m)return{...l,transform:(null!==(W=l.transform)&&void 0!==W?W:[]).concat(v),layer:q};const R='datum["lower_box_'.concat(y.field,'"]'),U='datum["upper_box_'.concat(y.field,'"]'),B="(".concat(U," - ").concat(R,")"),I="".concat(R," - ").concat(d," * ").concat(B),H="".concat(U," + ").concat(d," * ").concat(B),V='datum["'.concat(y.field,'"]'),G={joinaggregate:Ia(y.field),groupby:x},Y={transform:[{filter:"(".concat(I," <= ").concat(V,") && (").concat(V," <= ").concat(H,")")},{aggregate:[{op:"min",field:y.field,as:"lower_whisker_".concat(y.field)},{op:"max",field:y.field,as:"upper_whisker_".concat(y.field)},{op:"min",field:"lower_box_".concat(y.field),as:"lower_box_".concat(y.field)},{op:"max",field:"upper_box_".concat(y.field),as:"upper_box_".concat(y.field)},...w],groupby:x}],layer:L},{tooltip:X,...J}=C,{scale:Q,axis:$}=y,K=ja(y),Z=p($,["title"]),ee=Ta(u,"outliers",o.boxplot,{transform:[{filter:"(".concat(V," < ").concat(I,") || (").concat(V," > ").concat(H,")")}],mark:"point",encoding:{[b]:{field:y.field,type:y.type,...void 0!==K?{title:K}:{},...void 0!==Q?{scale:Q}:{},...z(Z)?{}:{axis:Z}},...J,...O?{color:O}:{},...F?{tooltip:F}:{}}})[0];let te;const ne=[...g,...h,G];return ee?te={transform:ne,layer:[ee,Y]}:(te=Y,te.transform.unshift(...ne)),{...l,layer:[te,{transform:v,layer:q}]}}function Ia(e){return[{op:"q1",field:e,as:"lower_box_".concat(e)},{op:"q3",field:e,as:"upper_box_".concat(e)}]}const Ha="errorbar",Va=new wa(Ha,Ga);function Ga(e,t){let{config:n}=t;e={...e,encoding:_a(e.encoding,n)};const{transform:i,continuousAxisChannelDef:o,continuousAxis:r,encodingWithoutContinuousAxis:a,ticksOrient:s,markDef:c,outerSpec:l,tooltipEncoding:u}=Ya(e,Ha,n);delete a.size;const d=Ea(c,r,o,a,n.errorbar),f=c.thickness,p=c.size,m={type:"tick",orient:s,aria:!1,...void 0!==f?{thickness:f}:{},...void 0!==p?{size:p}:{}},g=[...d({partName:"ticks",mark:m,positionPrefix:"lower",extraEncoding:u}),...d({partName:"ticks",mark:m,positionPrefix:"upper",extraEncoding:u}),...d({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...void 0!==f?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:i,...g.length>1?{layer:g}:{...g[0]}}}function Ya(e,t,n){var i;const{mark:o,encoding:r,params:a,projection:s,...c}=e,l=Go(o)?o:{type:o};a&&hi(Vn(t));const{orient:u,inputType:d}=function(e,t){const{encoding:n}=e;if(function(e){return(qr(e.x)||qr(e.y))&&!qr(e.x2)&&!qr(e.y2)&&!qr(e.xError)&&!qr(e.xError2)&&!qr(e.yError)&&!qr(e.yError2)}(n))return{orient:qa(e,t),inputType:"raw"};const i=function(e){return qr(e.x2)||qr(e.y2)}(n),o=function(e){return qr(e.xError)||qr(e.xError2)||qr(e.yError)||qr(e.yError2)}(n),r=n.x,a=n.y;if(i){if(o)throw new Error("".concat(t," cannot be both type aggregated-upper-lower and aggregated-error"));const e=n.x2,i=n.y2;if(qr(e)&&qr(i))throw new Error("".concat(t," cannot have both x2 and y2"));if(qr(e)){if(Mr(r))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error("Both x and x2 have to be quantitative in ".concat(t))}if(qr(i)){if(Mr(a))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error("Both y and y2 have to be quantitative in ".concat(t))}throw new Error("No ranged axis")}{const e=n.xError,i=n.xError2,o=n.yError,s=n.yError2;if(qr(i)&&!qr(e))throw new Error("".concat(t," cannot have xError2 without xError"));if(qr(s)&&!qr(o))throw new Error("".concat(t," cannot have yError2 without yError"));if(qr(e)&&qr(o))throw new Error("".concat(t," cannot have both xError and yError with both are quantiative"));if(qr(e)){if(Mr(r))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}if(qr(o)){if(Mr(a))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:p,continuousAxisChannelDefError:m,continuousAxisChannelDefError2:g,continuousAxis:h}=Ma(e,u,t),{errorBarSpecificAggregate:v,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:x}=function(e,t,n,i,o,r,a,s){let c=[],l=[];const u=t.field;let d,f=!1;if("raw"===r){const t=e.center?e.center:e.extent?"iqr"===e.extent?"median":"mean":s.errorbar.center,n=e.extent?e.extent:"mean"===t?"stderr":"iqr";if("median"===t!=("iqr"===n)&&hi(function(e,t,n){return"".concat(e," is not usually used with ").concat(t," for ").concat(n,".")}(t,n,a)),"stderr"===n||"stdev"===n)c=[{op:n,field:u,as:"extent_".concat(u)},{op:t,field:u,as:"center_".concat(u)}],l=[{calculate:'datum["center_'.concat(u,'"] + datum["extent_').concat(u,'"]'),as:"upper_".concat(u)},{calculate:'datum["center_'.concat(u,'"] - datum["extent_').concat(u,'"]'),as:"lower_".concat(u)}],d=[{fieldPrefix:"center_",titlePrefix:T(t)},{fieldPrefix:"upper_",titlePrefix:Xa(t,n,"+")},{fieldPrefix:"lower_",titlePrefix:Xa(t,n,"-")}],f=!0;else{let e,t,i;"ci"===n?(e="mean",t="ci0",i="ci1"):(e="median",t="q1",i="q3"),c=[{op:t,field:u,as:"lower_".concat(u)},{op:i,field:u,as:"upper_".concat(u)},{op:e,field:u,as:"center_".concat(u)}],d=[{fieldPrefix:"upper_",titlePrefix:$r({field:u,aggregate:i,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:$r({field:u,aggregate:t,type:"quantitative"},s,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:$r({field:u,aggregate:e,type:"quantitative"},s,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&hi((p=e.center,m=e.extent,"".concat(m?"extent ":"").concat(m&&p?"and ":"").concat(p?"center ":"").concat(m&&p?"are ":"is ","not needed when data are aggregated."))),"aggregated-upper-lower"===r?(d=[],l=[{calculate:'datum["'.concat(n.field,'"]'),as:"upper_".concat(u)},{calculate:'datum["'.concat(u,'"]'),as:"lower_".concat(u)}]):"aggregated-error"===r&&(d=[{fieldPrefix:"",titlePrefix:u}],l=[{calculate:'datum["'.concat(u,'"] + datum["').concat(i.field,'"]'),as:"upper_".concat(u)}],o?l.push({calculate:'datum["'.concat(u,'"] + datum["').concat(o.field,'"]'),as:"lower_".concat(u)}):l.push({calculate:'datum["'.concat(u,'"] - datum["').concat(i.field,'"]'),as:"lower_".concat(u)}));for(const e of l)d.push({fieldPrefix:e.as.substring(0,6),titlePrefix:R(R(e.calculate,'datum["',""),'"]',"")})}var p,m;return{postAggregateCalculates:l,errorBarSpecificAggregate:c,tooltipSummary:d,tooltipTitleWithFieldName:f}}(l,f,p,m,g,d,t,n),{[h]:w,["x"===h?"x2":"y2"]:k,["x"===h?"xError":"yError"]:S,["x"===h?"xError2":"yError2"]:D,...F}=r,{bins:O,timeUnits:z,aggregate:_,groupby:C,encoding:N}=Oa(F,n),P=[..._,...v],A="raw"!==d?[]:C,j=Aa(b,f,N,x);return{transform:[...null!==(i=c.transform)&&void 0!==i?i:[],...O,...z,...0===P.length?[]:[{aggregate:P,groupby:A}],...y],groupby:A,continuousAxisChannelDef:f,continuousAxis:h,encodingWithoutContinuousAxis:N,ticksOrient:"vertical"===u?"horizontal":"vertical",markDef:l,outerSpec:c,tooltipEncoding:j}}function Xa(e,t,n){return"".concat(T(e)," ").concat(n," ").concat(t)}const Ja="errorband",Qa=new wa(Ja,$a);function $a(e,t){let{config:n}=t;e={...e,encoding:_a(e.encoding,n)};const{transform:i,continuousAxisChannelDef:o,continuousAxis:r,encodingWithoutContinuousAxis:a,markDef:s,outerSpec:c,tooltipEncoding:l}=Ya(e,Ja,n),u=s,d=Ea(u,r,o,a,n.errorband),f=void 0!==e.encoding.x&&void 0!==e.encoding.y;let p={type:f?"area":"rect"},m={type:f?"line":"rule"};const g={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(p={...p,...g,ariaRoleDescription:"errorband"},m={...m,...g,aria:!1}):u.interpolate?hi(fi("interpolate")):u.tension&&hi(fi("tension")),{...c,transform:i,layer:[...d({partName:"band",mark:p,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...d({partName:"borders",mark:m,positionPrefix:"lower",extraEncoding:l}),...d({partName:"borders",mark:m,positionPrefix:"upper",extraEncoding:l})]}}const Ka={};function Za(e,t,n){const i=new wa(e,t);Ka[e]={normalizer:i,parts:n}}Za(Wa,Ba,["box","median","outliers","rule","ticks"]),Za(Ha,Ga,["ticks","rule"]),Za(Ja,$a,["band","borders"]);const es=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],ts={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},ns={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},is=_(ts),os=_(ns),rs=_({header:1,headerRow:1,headerColumn:1,headerFacet:1}),as=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],ss="_vgsid_",cs={point:{on:"click",fields:[ss],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[mousedown, window:mouseup] > window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function ls(e){return"legend"===e||!(null==e||!e.legend)}function us(e){return ls(e)&&t.isObject(e)}function ds(e){return!(null==e||!e.select)}function fs(e){const t=[];for(const n of e||[]){if(ds(n))continue;const{expr:e,bind:i,...o}=n;if(i&&e){const n={...o,bind:i,init:e};t.push(n)}else{const n={...o,...e?{update:e}:{},...i?{bind:i}:{}};t.push(n)}}return t}function ps(e){return"concat"in e}function ms(e){return"vconcat"in e}function gs(e){return"hconcat"in e}function hs(e){let{step:t,offsetIsDiscrete:n}=e;var i;return n?null!==(i=t.for)&&void 0!==i?i:"offset":"position"}function vs(e){return t.isObject(e)&&void 0!==e.step}function ys(e){return e.view||e.width||e.height}const bs=_({align:1,bounds:1,center:1,columns:1,spacing:1});function xs(e,t){var n;return null!==(n=e[t])&&void 0!==n?n:e["width"===t?"continuousWidth":"continuousHeight"]}function ws(e,t){const n=ks(e,t);return vs(n)?n.step:Ss}function ks(e,t){var n;return I(null!==(n=e[t])&&void 0!==n?n:e["width"===t?"discreteWidth":"discreteHeight"],{step:e.step})}const Ss=20,Ds={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:Ss},mark:{color:"#4c78a8",invalid:"filter",timeUnitBandSize:1},arc:{},area:{},bar:{binSpacing:1,continuousBandSize:5,timeUnitBandPosition:.5},circle:{},geoshape:{},image:{},line:{},point:{},rect:{binSpacing:0,continuousBandSize:5,timeUnitBandPosition:.5},rule:{color:"black"},square:{},text:{color:"black"},tick:{thickness:1},trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:{pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:9,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4},projection:{},legend:{gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:cs,style:{},title:{},facet:{spacing:20},concat:{spacing:20},normalizedNumberFormat:".0%"},Fs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],Os={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},zs={blue:Fs[0],orange:Fs[1],red:Fs[2],teal:Fs[3],green:Fs[4],yellow:Fs[5],purple:Fs[6],pink:Fs[7],brown:Fs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function _s(e){const t=_(e||{}),n={};for(const i of t){const t=e[i];n[i]=pa(t)?bn(t):xn(t)}return n}const Cs=[...Jo,...ba,...rs,"background","padding","legend","lineBreak","scale","style","title","view"];function Ns(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:n,font:i,fontSize:o,selection:r,...a}=e,s=t.mergeConfig({},u(Ds),i?function(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}(i):{},n?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{signals:[{name:"color",value:t.isObject(e)?{...zs,...e}:zs}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}(n):{},o?function(e){return{signals:[{name:"fontSize",value:t.isObject(e)?{...Os,...e}:Os}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}(o):{},a||{});r&&t.writeConfig(s,"selection",r,!0);const c=p(s,Cs);for(const e of["background","lineBreak","padding"])s[e]&&(c[e]=xn(s[e]));for(const e of Jo)s[e]&&(c[e]=un(s[e]));for(const e of ba)s[e]&&(c[e]=_s(s[e]));for(const e of rs)s[e]&&(c[e]=un(s[e]));return s.legend&&(c.legend=un(s.legend)),s.scale&&(c.scale=un(s.scale)),s.style&&(c.style=function(e){const t=_(e),n={};for(const i of t)n[i]=_s(e[i]);return n}(s.style)),s.title&&(c.title=un(s.title)),s.view&&(c.view=un(s.view)),c}const Ps=new Set(["view",...Vo]),As=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],js={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],area:["line","point"],bar:["binSpacing","continuousBandSize","discreteBandSize"],rect:["binSpacing","continuousBandSize","discreteBandSize"],line:["point"],tick:["bandSize","thickness"]};function Es(e){e=u(e);for(const t of As)delete e[t];if(e.axis)for(const t in e.axis)pa(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of es)delete e.legend[t];if(e.mark){for(const t of Xo)delete e.mark[t];e.mark.tooltip&&t.isObject(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(fs(e.params)),delete e.params);for(const t of Ps){for(const n of Xo)delete e[t][n];const n=js[t];if(n)for(const i of n)delete e[t][i];Ts(e,t)}for(const t of _(Ka))delete e[t];!function(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=dn(e.title);z(t)||(e.style["group-title"]={...e.style["group-title"],...t}),z(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),z(i)?delete e.title:e.title=i}(e);for(const n in e)t.isObject(e[n])&&z(e[n])&&delete e[n];return z(e)?void 0:e}function Ts(e,t,n,i){var o;"view"===t&&(n="cell");const r={...i?e[t][i]:e[t],...e.style[null!==(o=n)&&void 0!==o?o:t]};var a;z(r)||(e.style[null!==(a=n)&&void 0!==a?a:t]=r),i||delete e[t]}function Ms(e){return"layer"in e}class Ls{map(e,t){return Dr(e)?this.mapFacet(e,t):function(e){return"repeat"in e}(e)?this.mapRepeat(e,t):gs(e)?this.mapHConcat(e,t):ms(e)?this.mapVConcat(e,t):ps(e)?this.mapConcat(e,t):this.mapLayerOrUnit(e,t)}mapLayerOrUnit(e,t){if(Ms(e))return this.mapLayer(e,t);if(xa(e))return this.mapUnit(e,t);throw new Error(qn(e))}mapLayer(e,t){return{...e,layer:e.layer.map((e=>this.mapLayerOrUnit(e,t)))}}mapHConcat(e,t){return{...e,hconcat:e.hconcat.map((e=>this.map(e,t)))}}mapVConcat(e,t){return{...e,vconcat:e.vconcat.map((e=>this.map(e,t)))}}mapConcat(e,t){const{concat:n,...i}=e;return{...i,concat:n.map((e=>this.map(e,t)))}}mapFacet(e,t){return{...e,spec:this.map(e.spec,t)}}mapRepeat(e,t){return{...e,spec:this.map(e.spec,t)}}}const qs={zero:1,center:1,normalize:1},Ws=new Set([Co,Po,No,Mo,Eo,Ro,Uo,jo,Lo,qo]),Rs=new Set([Po,No,Co]);function Us(e){return jr(e)&&"quantitative"===Er(e)&&!e.bin}function Bs(e,t){const n="x"===t?"y":"radius",i=e[t],o=e[n];if(jr(i)&&jr(o))if(Us(i)&&Us(o)){if(i.stack)return t;if(o.stack)return n;const e=jr(i)&&!!i.aggregate;if(e!==(jr(o)&&!!o.aggregate))return e?t:n;{var r,a;const e=null===(r=i.scale)||void 0===r?void 0:r.type,s=null===(a=o.scale)||void 0===a?void 0:a.type;if(e&&"linear"!==e)return n;if(s&&"linear"!==s)return t}}else{if(Us(i))return t;if(Us(o))return n}else{if(Us(i))return t;if(Us(o))return n}}function Is(e,n){var i,o;const r=Go(e)?e.type:e;if(!Ws.has(r))return null;const a=Bs(n,"x")||Bs(n,"theta");if(!a)return null;const s=n[a],c=jr(s)?Gr(s,{}):void 0,l=function(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(a),u=[],d=new Set;if(n[l]){const e=n[l],t=jr(e)?Gr(e,{}):void 0;t&&t!==c&&(u.push(l),d.add(t));const i="x"===l?"xOffset":"yOffset",o=n[i],r=jr(o)?Gr(o,{}):void 0;r&&r!==c&&(u.push(i),d.add(r))}const f=wt.reduce(((e,i)=>{if("tooltip"!==i&&ka(n,i)){const o=n[i];for(const n of t.array(o)){const t=ta(n);if(t.aggregate)continue;const o=Gr(t,{});o&&d.has(o)||e.push({channel:i,fieldDef:t})}}return e}),[]);let p;return void 0!==s.stack?p=t.isBoolean(s.stack)?s.stack?"zero":null:s.stack:Rs.has(r)&&(p="zero"),p&&p in qs?Fa(n)&&0===f.length?null:null!=s&&null!==(i=s.scale)&&void 0!==i&&i.type&&"linear"!==(null==s||null===(o=s.scale)||void 0===o?void 0:o.type)?(hi(function(e){return"Cannot stack non-linear scale (".concat(e,").")}(s.scale.type)),null):qr(n[tt(a)])?(void 0!==s.stack&&hi('Cannot stack "'.concat(m=a,'" if there is already "').concat(m,'2".')),null):(jr(s)&&s.aggregate&&!en.has(s.aggregate)&&hi((g=s.aggregate,'Stacking is applied even though the aggregate function is non-summative ("'.concat(g,'").'))),{groupbyChannels:u,groupbyFields:d,fieldChannel:a,impute:null!==s.impute&&Io(r),stackBy:f,offset:p}):null;var m,g}function Hs(e){const{point:t,line:n,...i}=e;return _(i).length>1?i:i.type}function Vs(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:p(e[t],["point","line"])});return e}function Gs(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;return"transparent"===e.point?{opacity:0}:e.point?t.isObject(e.point)?e.point:{}:void 0!==e.point?null:n.point||i.shape?t.isObject(n.point)?n.point:{}:void 0}function Ys(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.line?!0===e.line?{}:e.line:void 0!==e.line?null:t.line?!0===t.line?{}:t.line:void 0}class Xs{constructor(){Tn(this,"name","path-overlay")}hasMatchingType(e,t){if(xa(e)){const{mark:n,encoding:i}=e,o=Go(n)?n:{type:n};switch(o.type){case"line":case"rule":case"trail":return!!Gs(o,t[o.type],i);case"area":return!!Gs(o,t[o.type],i)||!!Ys(o,t[o.type])}}return!1}run(e,t,n){const{config:i}=t,{params:o,projection:r,mark:a,encoding:s,...c}=e,l=_a(s,i),u=Go(a)?a:{type:a},d=Gs(u,i[u.type],l),m="area"===u.type&&Ys(u,i[u.type]),g=[{...o?{params:o}:{},mark:Hs({..."area"===u.type&&void 0===u.opacity&&void 0===u.fillOpacity?{opacity:.7}:{},...u}),encoding:p(l,["shape"])}],h=Is(u,l);let v=l;if(h){const{fieldChannel:e,offset:t}=h;v={...l,[e]:{...l[e],...t?{stack:t}:{}}}}return m&&g.push({...r?{projection:r}:{},mark:{type:"line",...f(u,["clip","interpolate","tension","tooltip"]),...m},encoding:v}),d&&g.push({...r?{projection:r}:{},mark:{type:"point",opacity:1,filled:!0,...f(u,["clip","tooltip"]),...d},encoding:v}),n({...c,layer:g},{...t,config:Vs(i)})}}function Js(e,t){return t?kr(e)?tc(e,t):Ks(e,t):e}function Qs(e,t){return t?tc(e,t):e}function $s(e,n,i){const o=n[e];return(r=o)&&!t.isString(r)&&"repeat"in r?o.repeat in i?{...n,[e]:i[o.repeat]}:void hi(function(e){return'Unknown repeated value "'.concat(e,'".')}(o.repeat)):n;var r}function Ks(e,t){if(void 0!==(e=$s("field",e,t))){if(null===e)return null;if(Or(e)&&xr(e.sort)){const n=$s("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function Zs(e,t){if(jr(e))return Ks(e,t);{const n=$s("datum",e,t);return n===e||n.type||(n.type="nominal"),n}}function ec(e,t){if(!qr(e)){if(Ar(e)){const n=Zs(e.condition,t);if(n)return{...e,condition:n};{const{condition:t,...n}=e;return n}}return e}{const n=Zs(e,t);if(n)return n;if(Nr(e))return{condition:e.condition}}}function tc(e,n){const i={};for(const o in e)if(t.hasOwnProperty(e,o)){const r=e[o];if(t.isArray(r))i[o]=r.map((e=>ec(e,n))).filter((e=>e));else{const e=ec(r,n);void 0!==e&&(i[o]=e)}}return i}class nc{constructor(){Tn(this,"name","RuleForRangedLine")}hasMatchingType(e){if(xa(e)){const{encoding:t,mark:n}=e;if("line"===n||Go(n)&&"line"===n.type)for(const e of $e){const n=t[Ze(e)];if(t[e]&&(jr(n)&&!rn(n.bin)||Tr(n)))return!0}}return!1}run(e,n,i){const{encoding:o,mark:r}=e;var a,s;return hi((a=!!o.x2,s=!!o.y2,"Line mark is for continuous lines and thus cannot be used with ".concat(a&&s?"x2 and y2":a?"x2":"y2",". We will use the rule mark (line segments) instead."))),i({...e,mark:t.isObject(r)?{...r,type:"rule"}:"rule"},n)}}function ic(e){let{parentEncoding:n,encoding:i={},layer:o}=e,r={};if(n){const e=new Set([..._(n),..._(i)]);for(const a of e){const e=i[a],s=n[a];if(qr(e)){const t={...s,...e};r[a]=t}else Ar(e)?r[a]={...e,condition:{...s,...e.condition}}:e||null===e?r[a]=e:(o||Rr(s)||pn(s)||qr(s)||t.isArray(s))&&(r[a]=s)}}else r=i;return!r||z(r)?void 0:r}function oc(e){const{parentProjection:t,projection:n}=e;return t&&n&&hi(function(e){const{parentProjection:t,projection:n}=e;return"Layer's shared projection ".concat(m(t)," is overridden by a child projection ").concat(m(n),".")}({parentProjection:t,projection:n})),null!=n?n:t}function rc(e){return"filter"in e}function ac(e){return"lookup"in e}function sc(e){return"pivot"in e}function cc(e){return"density"in e}function lc(e){return"quantile"in e}function uc(e){return"regression"in e}function dc(e){return"loess"in e}function fc(e){return"sample"in e}function pc(e){return"window"in e}function mc(e){return"joinaggregate"in e}function gc(e){return"flatten"in e}function hc(e){return"calculate"in e}function vc(e){return"bin"in e}function yc(e){return"impute"in e}function bc(e){return"timeUnit"in e}function xc(e){return"aggregate"in e}function wc(e){return"stack"in e}function kc(e){return"fold"in e}function Sc(e,t){const{transform:n,...i}=e;return n?{...i,transform:n.map((e=>{if(rc(e))return{filter:Oc(e,t)};if(vc(e)&&an(e.bin))return{...e,bin:Fc(e.bin)};if(ac(e)){const{selection:t,...n}=e.from;return t?{...e,from:{param:t,...n}}:e}return e}))}:e}function Dc(e,n){var i,o;const r=u(e);if(jr(r)&&an(r.bin)&&(r.bin=Fc(r.bin)),Ur(r)&&null!==(i=r.scale)&&void 0!==i&&null!==(o=i.domain)&&void 0!==o&&o.selection){const{selection:e,...t}=r.scale.domain;r.scale.domain={...t,...e?{param:e}:{}}}if(Nr(r))if(t.isArray(r.condition))r.condition=r.condition.map((e=>{const{selection:t,param:i,test:o,...r}=e;return i?e:{...r,test:Oc(e,n)}}));else{const{selection:e,param:t,test:i,...o}=Dc(r.condition,n);r.condition=t?r.condition:{...o,test:Oc(r.condition,n)}}return r}function Fc(e){const t=e.extent;if(null!=t&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Oc(e,t){const n=e=>c(e,(e=>{var n,i,o;const r={param:e,empty:null===(n=t.emptySelections[e])||void 0===n||n};return null!==(o=(i=t.selectionPredicates)[e])&&void 0!==o||(i[e]=[]),t.selectionPredicates[e].push(r),r}));return e.selection?n(e.selection):c(e.test||e.filter,(e=>e.selection?n(e.selection):e))}class zc extends Ls{map(e,t){var n;const i=null!==(n=t.selections)&&void 0!==n?n:[];if(e.params&&!xa(e)){const t=[];for(const n of e.params)ds(n)?i.push(n):t.push(n);e.params=t}return t.selections=i,super.map(e,_c(e,t))}mapUnit(e,n){var i;const o=n.selections;if(!o||!o.length)return e;const r=(null!==(i=n.path)&&void 0!==i?i:[]).concat(e.name),a=[];for(const n of o)if(n.views&&n.views.length)for(const i of n.views)(t.isString(i)&&(i===e.name||r.indexOf(i)>=0)||t.isArray(i)&&i.map((e=>r.indexOf(e))).every(((e,t,n)=>-1!==e&&(0===t||e>n[t-1]))))&&a.push(n);else a.push(n);return a.length&&(e.params=a),e}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=zc.prototype[e];zc.prototype[e]=function(e,n){return t.call(this,e,_c(e,n))}}function _c(e,t){var n;return e.name?{...t,path:(null!==(n=t.path)&&void 0!==n?n:[]).concat(e.name)}:t}function Cc(e,t){void 0===t&&(t=Ns(e.config));const n=function(e){const t={config:arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}};return Ac.map(Nc.map(Pc.map(e,t),t),t)}(e,t),{width:i,height:o}=e,r=function(e,t,n){let{width:i,height:o}=t;const r=xa(e)||Ms(e),a={};r?"container"==i&&"container"==o?(a.type="fit",a.contains="padding"):"container"==i?(a.type="fit-x",a.contains="padding"):"container"==o&&(a.type="fit-y",a.contains="padding"):("container"==i&&(hi(Wn("width")),i=void 0),"container"==o&&(hi(Wn("height")),o=void 0));const s={type:"pad",...a,...n?jc(n.autosize):{},...jc(e.autosize)};if("fit"!==s.type||r||(hi('Autosize "fit" only works for single views and layered views.'),s.type="pad"),"container"==i&&"fit"!=s.type&&"fit-x"!=s.type&&hi(Rn("width")),"container"==o&&"fit"!=s.type&&"fit-y"!=s.type&&hi(Rn("height")),!l(s,{type:"pad"}))return s}(n,{width:i,height:o,autosize:e.autosize},t);return{...n,...r?{autosize:r}:{}}}const Nc=new class extends Ls{constructor(){super(...arguments),Tn(this,"nonFacetUnitNormalizers",[Ra,Va,Qa,new Xs,new nc])}map(e,t){if(xa(e)){const n=ka(e.encoding,Q),i=ka(e.encoding,$),o=ka(e.encoding,K);if(n||i||o)return this.mapFacetedUnit(e,t)}return super.map(e,t)}mapUnit(e,t){const{parentEncoding:n,parentProjection:i}=t,o=Qs(e.encoding,t.repeater),r={...e,...o?{encoding:o}:{}};if(n||i)return this.mapUnitWithParentEncodingOrProjection(r,t);const a=this.mapLayerOrUnit.bind(this);for(const e of this.nonFacetUnitNormalizers)if(e.hasMatchingType(r,t.config))return e.run(r,t,a);return r}mapRepeat(e,n){return function(e){return!t.isArray(e.repeat)&&e.repeat.layer}(e)?this.mapLayerRepeat(e,n):this.mapNonLayerRepeat(e,n)}mapLayerRepeat(e,t){const{repeat:n,spec:i,...o}=e,{row:r,column:a,layer:s}=n,{repeater:c={},repeaterPrefix:l=""}=t;return r||a?this.mapRepeat({...e,repeat:{...r?{row:r}:{},...a?{column:a}:{}},spec:{repeat:{layer:s},spec:i}},t):{...o,layer:s.map((e=>{const n={...c,layer:e},o="".concat((i.name||"")+l,"child__layer_").concat(A(e)),r=this.mapLayerOrUnit(i,{...t,repeater:n,repeaterPrefix:o});return r.name=o,r}))}}mapNonLayerRepeat(e,n){var i;const{repeat:o,spec:r,data:a,...s}=e;!t.isArray(o)&&e.columns&&(e=p(e,["columns"]),hi(Gn("repeat")));const c=[],{repeater:l={},repeaterPrefix:u=""}=n,d=!t.isArray(o)&&o.row||[l?l.row:null],f=!t.isArray(o)&&o.column||[l?l.column:null],m=t.isArray(o)&&o||[l?l.repeat:null];for(const e of m)for(const i of d)for(const a of f){const s={repeat:e,row:i,column:a,layer:l.layer},d=(r.name||"")+u+"child__"+(t.isArray(o)?"".concat(A(e)):(o.row?"row_".concat(A(i)):"")+(o.column?"column_".concat(A(a)):"")),f=this.map(r,{...n,repeater:s,repeaterPrefix:d});f.name=d,c.push(p(f,["data"]))}const g=t.isArray(o)?e.columns:o.column?o.column.length:1;return{data:null!==(i=r.data)&&void 0!==i?i:a,align:"all",...s,columns:g,concat:c}}mapFacet(e,t){const{facet:n}=e;return kr(n)&&e.columns&&(e=p(e,["columns"]),hi(Gn("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){const{encoding:n,projection:i}=e,{parentEncoding:o,parentProjection:r,config:a}=t,s=oc({parentProjection:r,projection:i}),c=ic({parentEncoding:o,encoding:Qs(n,t.repeater)});return this.mapUnit({...e,...s?{projection:s}:{},...c?{encoding:c}:{}},{config:a})}mapFacetedUnit(e,t){const{row:n,column:i,facet:o,...r}=e.encoding,{mark:a,width:s,projection:c,height:l,view:u,params:d,encoding:f,...p}=e,{facetMapping:m,layout:g}=this.getFacetMappingAndLayout({row:n,column:i,facet:o},t),h=Qs(r,t.repeater);return this.mapFacet({...p,...g,facet:m,spec:{...s?{width:s}:{},...l?{height:l}:{},...u?{view:u}:{},...c?{projection:c}:{},mark:a,encoding:h,...d?{params:d}:{}}},t)}getFacetMappingAndLayout(e,t){const{row:n,column:i,facet:o}=e;if(n||i){o&&hi((a=[...n?[Q]:[],...i?[$]:[]],"Facet encoding dropped as ".concat(a.join(" and ")," ").concat(a.length>1?"are":"is"," also specified.")));const t={},s={};for(const n of[Q,$]){const i=e[n];if(i){const{align:e,center:o,spacing:a,columns:c,...l}=i;t[n]=l;for(const e of["align","center","spacing"]){var r;void 0!==i[e]&&(null!==(r=s[e])&&void 0!==r||(s[e]={}),s[e][n]=i[e])}}}return{facetMapping:t,layout:s}}{const{align:e,center:n,spacing:i,columns:r,...a}=o;return{facetMapping:Js(a,t.repeater),layout:{...e?{align:e}:{},...n?{center:n}:{},...i?{spacing:i}:{},...r?{columns:r}:{}}}}var a}mapLayer(e,t){let{parentEncoding:n,parentProjection:i,...o}=t;const{encoding:r,projection:a,...s}=e,c={...o,parentEncoding:ic({parentEncoding:n,encoding:r,layer:!0}),parentProjection:oc({parentProjection:i,projection:a})};return super.mapLayer(s,c)}},Pc=new class extends Ls{map(e,t){var n,i;return null!==(n=t.emptySelections)&&void 0!==n||(t.emptySelections={}),null!==(i=t.selectionPredicates)&&void 0!==i||(t.selectionPredicates={}),e=Sc(e,t),super.map(e,t)}mapLayerOrUnit(e,t){if((e=Sc(e,t)).encoding){const n={};for(const[i,o]of N(e.encoding))n[i]=Dc(o,t);e={...e,encoding:n}}return super.mapLayerOrUnit(e,t)}mapUnit(e,t){const{selection:n,...i}=e;return n?{...i,params:N(n).map((e=>{let[n,i]=e;const{init:o,bind:r,empty:a,...s}=i;"single"===s.type?(s.type="point",s.toggle=!1):"multi"===s.type&&(s.type="point"),t.emptySelections[n]="none"!==a;for(const e of C(null!==(c=t.selectionPredicates[n])&&void 0!==c?c:{})){var c;e.empty="none"!==a}return{name:n,value:o,select:s,bind:r}}))}:e}},Ac=new zc;function jc(e){return t.isString(e)?{type:e}:null!=e?e:{}}const Ec=["background","padding"];function Tc(e,t){const n={};for(const t of Ec)e&&void 0!==e[t]&&(n[t]=xn(e[t]));return t&&(n.params=e.params),n}class Mc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.explicit=e,this.implicit=t}clone(){return new Mc(u(this.explicit),u(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(e){return I(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){let{value:n,explicit:i}=t;void 0!==n&&this.set(e,n,i)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){let{explicit:n,implicit:i}=t;void 0!==n[e]?this.set(e,n[e],!0):void 0!==i[e]&&this.set(e,i[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const t of _(e.combine())){const n=e.getWithExplicit(t);this.setWithExplicit(t,n)}}}function Lc(e){return{explicit:!0,value:e}}function qc(e){return{explicit:!1,value:e}}function Wc(e){return(t,n,i,o)=>{const r=e(t.value,n.value);return r>0?t:r<0?n:Rc(t,n,i,o)}}function Rc(e,t,n,i){return e.explicit&&t.explicit&&hi(function(e,t,n,i){return"Conflicting ".concat(t.toString(),' property "').concat(e.toString(),'" (').concat(m(n)," and ").concat(m(i),"). Using ").concat(m(n),".")}(n,i,e.value,t.value)),e}function Uc(e,t,n,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Rc;return void 0===e||void 0===e.value?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:l(e.value,t.value)?e:o(e,t,n,i)}class Bc extends Mc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(e,t),this.explicit=e,this.implicit=t,this.parseNothing=n}clone(){const e=super.clone();return e.parseNothing=this.parseNothing,e}}function Ic(e){return"url"in e}function Hc(e){return"values"in e}function Vc(e){return"name"in e&&!Ic(e)&&!Hc(e)&&!Gc(e)}function Gc(e){return e&&(Yc(e)||Xc(e)||Jc(e))}function Yc(e){return"sequence"in e}function Xc(e){return"sphere"in e}function Jc(e){return"graticule"in e}let Qc;function $c(e){let n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.identity;if(t.isArray(e)){const t=e.map((e=>$c(e,n,i)));return n?"[".concat(t.join(", "),"]"):t}return vi(e)?i(n?Si(e):function(e){const t=ki(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}(e)):n?i(m(e)):e}function Kc(e,n){for(const o of C(null!==(i=e.component.selection)&&void 0!==i?i:{})){var i;const r=o.name;let a="".concat(r).concat(lu,", ").concat("global"===o.resolve?"true":"{unit: ".concat(pu(e),"}"));for(const t of fu)t.defined(o)&&(t.signals&&(n=t.signals(e,o,n)),t.modifyExpr&&(a=t.modifyExpr(e,o,a)));n.push({name:r+uu,on:[{events:{signal:o.name+lu},update:"modify(".concat(t.stringValue(o.name+cu),", ").concat(a,")")}]})}return tl(n)}function Zc(e,n){if(e.component.selection&&_(e.component.selection).length){const i=t.stringValue(e.getName("cell"));n.unshift({name:"facet",value:{},on:[{events:t.parseSelector("mousemove","scope"),update:"isTuple(facet) ? facet : group(".concat(i,").datum")}]})}return tl(n)}function el(e,t){for(const i of C(null!==(n=e.component.selection)&&void 0!==n?n:{})){var n;for(const n of fu)n.defined(i)&&n.marks&&(t=n.marks(e,i,t))}return t}function tl(e){return e.map((e=>(e.on&&!e.on.length&&delete e.on,e)))}!function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup"}(Qc||(Qc={}));class nl{constructor(e,t){this.debugName=t,Tn(this,"_children",[]),Tn(this,"_parent",null),Tn(this,"_hash",void 0),e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){this._parent=e,e&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){this._children.includes(e)?hi("Attempt to add the same child twice."):void 0!==t?this._children.splice(t,0,e):this._children.push(e)}removeChild(e){const t=this._children.indexOf(e);return this._children.splice(t,1),t}remove(){let e=this._parent.removeChild(this);for(const t of this._children)t._parent=this._parent,this._parent.addChild(t,e++)}insertAsParentOf(e){const t=e.parent;t.removeChild(this),this.parent=t,e.parent=this}swapWithParent(){const e=this._parent,t=e.parent;for(const t of this._children)t.parent=e;this._children=[],e.removeChild(this);const n=e.parent.removeChild(e);this._parent=t,t.addChild(this,n),e.parent=this}}class il extends nl{clone(){const e=new this.constructor;return e.debugName="clone_".concat(this.debugName),e._source=this._source,e._name="clone_".concat(this._name),e.type=this.type,e.refCounts=this.refCounts,e.refCounts[e._name]=0,e}constructor(e,t,n,i){super(e,t),this.type=n,this.refCounts=i,Tn(this,"_source",void 0),Tn(this,"_name",void 0),this._source=this._name=t,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return void 0===this._hash&&(this._hash="Output ".concat(V())),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(e){this._source=e}}class ol extends nl{clone(){return new ol(null,u(this.formula))}constructor(e,t){super(e),this.formula=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,t)=>{const{field:n,timeUnit:i}=t;if(i){const o=Gr(t,{forAs:!0});e[g({as:o,field:n,timeUnit:i})]={as:o,field:n,timeUnit:i}}return e}),{});return z(n)?null:new ol(e,n)}static makeFromTransform(e,t){const{timeUnit:n,...i}={...t},o={...i,timeUnit:Pi(n)};return new ol(e,{[g(o)]:o})}merge(e){this.formula={...this.formula};for(const t in e.formula)this.formula[t]||(this.formula[t]=e.formula[t]);for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}removeFormulas(e){const t={};for(const[n,i]of N(this.formula))e.has(i.as)||(t[n]=i);this.formula=t}producedFields(){return new Set(C(this.formula).map((e=>e.as)))}dependentFields(){return new Set(C(this.formula).map((e=>e.field)))}hash(){return"TimeUnit ".concat(g(this.formula))}assemble(){const e=[];for(const t of C(this.formula)){const{field:n,as:i,timeUnit:o}=t,{unit:r,utc:a,...s}=Pi(o);e.push({field:W(n),type:"timeunit",...r?{units:_i(r)}:{},...a?{timezone:"utc"}:{},...s,as:[i,"".concat(i,"_end")]})}return e}}const rl="_tuple_fields";class al{constructor(){Tn(this,"hasChannel",void 0),Tn(this,"hasField",void 0),Tn(this,"hasSelectionId",void 0),Tn(this,"timeUnit",void 0),Tn(this,"items",void 0);for(var e=arguments.length,t=new Array(e),n=0;n!0,parse:(e,n,i)=>{var o;const r=n.name,a=null!==(o=n.project)&&void 0!==o?o:n.project=new al,s={},c={},l=new Set,u=(e,t)=>{const n="visual"===t?e.channel:e.field;let i=A("".concat(r,"_").concat(n));for(let e=1;l.has(i);e++)i=A("".concat(r,"_").concat(n,"_").concat(e));return l.add(i),{[t]:i}},d=n.type,f=e.config.selection[d],p=void 0!==i.value?t.array(i.value):null;let{fields:m,encodings:h}=t.isObject(i.select)?i.select:{};if(!m&&!h&&p)for(const e of p)if(t.isObject(e))for(const t of _(e))Je[t]?(h||(h=[])).push(t):"interval"===d?(hi('Interval selections should be initialized using "x" and/or "y" keys.'),h=f.encodings):(m||(m=[])).push(t);m||h||(h=f.encodings,"fields"in f&&(m=f.fields));for(const t of null!==(v=h)&&void 0!==v?v:[]){var v;const n=e.fieldDef(t);if(n){let i=n.field;if(n.aggregate){hi(Hn(t,n.aggregate));continue}if(!i){hi(In(t));continue}if(n.timeUnit){i=e.vgField(t);const o={timeUnit:n.timeUnit,as:i,field:n.field};c[g(o)]=o}if(!s[i]){let o="E";"interval"===d?mo(e.getScaleComponent(t).get("type"))&&(o="R"):n.bin&&(o="R-RE");const r={field:i,channel:t,type:o};r.signals={...u(r,"data"),...u(r,"visual")},a.items.push(s[i]=r),a.hasField[i]=a.hasChannel[t]=s[i],a.hasSelectionId=a.hasSelectionId||i===ss}}else hi(In(t))}for(const e of null!==(y=m)&&void 0!==y?y:[]){var y;if(a.hasField[e])continue;const t={type:"E",field:e};t.signals={...u(t,"data")},a.items.push(t),a.hasField[e]=t,a.hasSelectionId=a.hasSelectionId||e===ss}p&&(n.init=p.map((e=>a.items.map((n=>t.isObject(e)?void 0!==e[n.channel]?e[n.channel]:e[n.field]:e))))),z(c)||(a.timeUnit=new ol(null,c))},signals:(e,t,n)=>{const i=t.name+rl;return n.filter((e=>e.name===i)).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map((e=>{const{signals:t,hasLegend:n,...i}=e;return i.field=W(i.field),i}))})}},cl={defined:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const o=i.channel;if(!Bt(o))continue;const r=e.getScaleComponent(o),a=r?r.get("type"):void 0;r&&mo(a)?(r.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)):hi("Scale bindings are currently only supported for scales with unbinned, continuous domains.")}},topLevelSignals:(e,n,i)=>{const o=n.scales.filter((e=>0===i.filter((t=>t.name===e.signals.data)).length));if(!e.parent||ul(e)||0===o.length)return i;const r=i.filter((e=>e.name===n.name))[0];let a=r.update;if(a.indexOf(du)>=0)r.update="{".concat(o.map((e=>"".concat(t.stringValue(W(e.field)),": ").concat(e.signals.data))).join(", "),"}");else{for(const e of o){const n="".concat(t.stringValue(W(e.field)),": ").concat(e.signals.data);a.includes(n)||(a="".concat(a.substring(0,a.length-1),", ").concat(n,"}"))}r.update=a}return i.concat(o.map((e=>({name:e.signals.data}))))},signals:(e,t,n)=>{if(e.parent&&!ul(e))for(const e of t.scales){const t=n.filter((t=>t.name===e.signals.data))[0];t.push="outer",delete t.value,delete t.update}return n}};function ll(e,n){const i=t.stringValue(e.scaleName(n));return"domain(".concat(i,")")}function ul(e){var t;return e.parent&&$f(e.parent)&&(null!==(t=!e.parent.parent)&&void 0!==t?t:ul(e.parent.parent))}const dl="_brush",fl="_scale_trigger",pl={defined:e=>"interval"===e.type,signals:(e,n,i)=>{const o=n.name,r=o+rl,a=cl.defined(n),s=n.init?n.init[0]:null,c=[],l=[];if(n.translate&&!a){const e="!event.item || event.item.mark.name !== ".concat(t.stringValue(o+dl));ml(n,((n,i)=>{var o,r;const a=t.array(null!==(r=(o=i.between[0]).filter)&&void 0!==r?r:o.filter=[]);return a.includes(e)||a.push(e),n}))}n.project.items.forEach(((o,r)=>{const a=o.channel;if(a!==Z&&a!==ee)return void hi("Interval selections only support x and y encoding channels.");const u=s?s[r]:null,d=function(e,n,i,o){const r=i.channel,a=i.signals.visual,s=i.signals.data,c=cl.defined(n),l=t.stringValue(e.scaleName(r)),u=e.getScaleComponent(r),d=u?u.get("type"):void 0,f=e=>"scale(".concat(l,", ").concat(e,")"),p=e.getSizeSignalRef(r===Z?"width":"height").signal,m="".concat(r,"(unit)"),g=ml(n,((e,t)=>[...e,{events:t.between[0],update:"[".concat(m,", ").concat(m,"]")},{events:t,update:"[".concat(a,"[0], clamp(").concat(m,", 0, ").concat(p,")]")}]));return g.push({events:{signal:n.name+fl},update:mo(d)?"[".concat(f("".concat(s,"[0]")),", ").concat(f("".concat(s,"[1]")),"]"):"[0, 0]"}),c?[{name:s,on:[]}]:[{name:a,...o?{init:$c(o,!0,f)}:{value:[]},on:g},{name:s,...o?{init:$c(o)}:{},on:[{events:{signal:a},update:"".concat(a,"[0] === ").concat(a,"[1] ? null : invert(").concat(l,", ").concat(a,")")}]}]}(e,n,o,u),f=o.signals.data,p=o.signals.visual,m=t.stringValue(e.scaleName(a)),g=mo(e.getScaleComponent(a).get("type"))?"+":"";i.push(...d),c.push(f),l.push({scaleName:e.scaleName(a),expr:"(!isArray(".concat(f,") || ")+"(".concat(g,"invert(").concat(m,", ").concat(p,")[0] === ").concat(g).concat(f,"[0] && ")+"".concat(g,"invert(").concat(m,", ").concat(p,")[1] === ").concat(g).concat(f,"[1]))")})})),!a&&l.length&&i.push({name:o+fl,value:{},on:[{events:l.map((e=>({scale:e.scaleName}))),update:"".concat(l.map((e=>e.expr)).join(" && ")," ? ").concat(o+fl," : {}")}]});const u="unit: ".concat(pu(e),", fields: ").concat(r,", values");return i.concat({name:o+lu,...s?{init:"{".concat(u,": ").concat($c(s),"}")}:{},...c.length?{on:[{events:[{signal:c.join(" || ")}],update:"".concat(c.join(" && ")," ? {").concat(u,": [").concat(c,"]} : null")}]}:{}})},marks:(e,n,i)=>{const o=n.name,{x:r,y:a}=n.project.hasChannel,s=null==r?void 0:r.signals.visual,c=null==a?void 0:a.signals.visual,l="data(".concat(t.stringValue(n.name+cu),")");if(cl.defined(n)||!r&&!a)return i;const u={x:void 0!==r?{signal:"".concat(s,"[0]")}:{value:0},y:void 0!==a?{signal:"".concat(c,"[0]")}:{value:0},x2:void 0!==r?{signal:"".concat(s,"[1]")}:{field:{group:"width"}},y2:void 0!==a?{signal:"".concat(c,"[1]")}:{field:{group:"height"}}};if("global"===n.resolve)for(const t of _(u))u[t]=[{test:"".concat(l,".length && ").concat(l,"[0].unit === ").concat(pu(e)),...u[t]},{value:0}];const{fill:d,fillOpacity:f,cursor:p,...m}=n.mark,g=_(m).reduce(((e,t)=>(e[t]=[{test:[void 0!==r&&"".concat(s,"[0] !== ").concat(s,"[1]"),void 0!==a&&"".concat(c,"[0] !== ").concat(c,"[1]")].filter((e=>e)).join(" && "),value:m[t]},{value:null}],e)),{});return[{name:"".concat(o+dl,"_bg"),type:"rect",clip:!0,encode:{enter:{fill:{value:d},fillOpacity:{value:f}},update:u}},...i,{name:o+dl,type:"rect",clip:!0,encode:{enter:{...p?{cursor:{value:p}}:{},fill:{value:"transparent"}},update:{...u,...g}}}]}};function ml(e,t){return e.events.reduce(((e,n)=>n.between?t(e,n):(hi("".concat(n," is not an ordered event stream for interval selections.")),e)),[])}const gl={defined:e=>"point"===e.type,signals:(e,n,i)=>{var o;const r=n.name,a=r+rl,s=n.project,c="(item().isVoronoi ? datum.datum : datum)",l=C(null!==(o=e.component.selection)&&void 0!==o?o:{}).reduce(((e,t)=>"interval"===t.type?e.concat(t.name+dl):e),[]).map((e=>"indexof(item().mark.name, '".concat(e,"') < 0"))).join(" && "),u="datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0".concat(l?" && ".concat(l):"");let d="unit: ".concat(pu(e),", ");if(n.project.hasSelectionId)d+="".concat(ss,": ").concat(c,"[").concat(t.stringValue(ss),"]");else{const n=s.items.map((n=>{const i=e.fieldDef(n.channel);return null!=i&&i.bin?"[".concat(c,"[").concat(t.stringValue(e.vgField(n.channel,{})),"], ")+"".concat(c,"[").concat(t.stringValue(e.vgField(n.channel,{binSuffix:"end"})),"]]"):"".concat(c,"[").concat(t.stringValue(n.field),"]")})).join(", ");d+="fields: ".concat(a,", values: [").concat(n,"]")}const f=n.events;return i.concat([{name:r+lu,on:f?[{events:f,update:"".concat(u," ? {").concat(d,"} : null"),force:!0}]:[]}])}};function hl(e,n,i,o){const r=Nr(n)&&n.condition,a=o(n);return r?{[i]:[...t.array(r).map((t=>{const n=o(t);if(function(e){return e.param}(t)){const{param:i,empty:o}=t;return{test:xu(e,{param:i,empty:o}),...n}}return{test:ku(e,t.test),...n}})),...void 0!==a?[a]:[]]}:void 0!==a?{[i]:a}:{}}function vl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text";const n=e.encoding[t];return hl(e,n,t,(t=>yl(t,e.config)))}function yl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"datum";if(e){if(Rr(e))return kn(e.value);if(qr(e)){const{format:i,formatType:o}=ea(e);return sr({fieldOrDatumDef:e,format:i,formatType:o,expr:n,config:t})}}}function bl(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{encoding:i,markDef:o,config:r,stack:a}=e,s=i.tooltip;if(t.isArray(s))return{tooltip:wl({tooltip:s},a,r,n)};{const c=n.reactiveGeom?"datum.datum":"datum";return hl(e,s,"tooltip",(e=>{const s=yl(e,r,c);if(s)return s;if(null===e)return;let l=zn("tooltip",o,r);return!0===l&&(l={content:"encoding"}),t.isString(l)?{value:l}:t.isObject(l)?pn(l)?l:"encoding"===l.content?wl(i,a,r,n):{signal:c}:void 0}))}}function xl(e,n,i){let{reactiveGeom:o}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r={},a=o?"datum.datum":"datum",s=[];function c(o,c){var l;const u=Ze(c),d=Wr(o)?o:{...o,type:e[u].type},f=d.title||Zr(d,i),p=t.array(f).join(", ");let m;if(Dt(c)){const t="x"===c?"x2":"y2",n=ta(e[t]);if(rn(d.bin)&&n){const e=Gr(d,{expr:a}),o=Gr(n,{expr:a}),{format:s,formatType:c}=ea(d);m=gr(e,o,s,c,i),r[t]=!0}}if((Dt(c)||c===se||c===re)&&n&&n.fieldChannel===c&&"normalize"===n.offset){const{format:e,formatType:t}=ea(d);m=sr({fieldOrDatumDef:d,format:e,formatType:t,expr:a,config:i,normalizeStack:!0}).signal}null!==(l=m)&&void 0!==l||(m=yl(d,i,a).signal),s.push({channel:c,key:p,value:m})}Na(e,((e,t)=>{jr(e)?c(e,t):Pr(e)&&c(e.condition,t)}));const l={};for(const{channel:e,key:t,value:n}of s)r[e]||l[t]||(l[t]=n);return l}function wl(e,t,n){let{reactiveGeom:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=xl(e,t,n,{reactiveGeom:i}),r=N(o).map((e=>{let[t,n]=e;return'"'.concat(t,'": ').concat(n)}));return r.length>0?{signal:"{".concat(r.join(", "),"}")}:void 0}function kl(e){const{markDef:t,config:n}=e,i=zn("aria",t,n);return!1===i?{}:{...i?{aria:i}:{},...Sl(e),...Dl(e)}}function Sl(e){const{mark:t,markDef:n,config:i}=e;if(!1===i.aria)return{};const o=zn("ariaRoleDescription",n,i);return null!=o?{ariaRoleDescription:{value:o}}:t in vn?{}:{ariaRoleDescription:{value:t}}}function Dl(e){const{encoding:t,markDef:n,config:i,stack:o}=e,r=t.description;if(r)return hl(e,r,"description",(t=>yl(t,e.config)));const a=zn("description",n,i);if(null!=a)return{description:kn(a)};if(!1===i.aria)return{};const s=xl(t,o,i);return z(s)?void 0:{description:{signal:N(s).map(((e,t)=>{let[n,i]=e;return'"'.concat(t>0?"; ":"").concat(n,': " + (').concat(i,")")})).join(" + ")}}}function Fl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{markDef:i,encoding:o,config:r}=t,{vgChannel:a}=n;let{defaultRef:s,defaultValue:c}=n;var l;void 0===s&&(null!==(l=c)&&void 0!==l||(c=zn(e,i,r,{vgChannel:a,ignoreVgConfig:!0})),void 0!==c&&(s=kn(c)));const u=o[e];return hl(t,u,null!=a?a:e,(n=>ir({channel:e,channelDef:n,markDef:i,config:r,scaleName:t.scaleName(e),scale:t.getScaleComponent(e),stack:null,defaultRef:s})))}function Ol(e){var t,n,i,o;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{filled:void 0};const{markDef:a,encoding:s,config:c}=e,{type:l}=a,u=null!==(t=r.filled)&&void 0!==t?t:zn("filled",a,c),d=v(["bar","point","circle","square","geoshape"],l)?"transparent":void 0,f=null!==(n=null!==(i=zn(!0===u?"color":void 0,a,c,{vgChannel:"fill"}))&&void 0!==i?i:c.mark[!0===u&&"color"])&&void 0!==n?n:d,p=null!==(o=zn(!1===u?"color":void 0,a,c,{vgChannel:"stroke"}))&&void 0!==o?o:c.mark[!1===u&&"color"],m=u?"fill":"stroke",g={...f?{fill:kn(f)}:{},...p?{stroke:kn(p)}:{}};return a.color&&(u?a.fill:a.stroke)&&hi(Kn("property",{fill:"fill"in a,stroke:"stroke"in a})),{...g,...Fl("color",e,{vgChannel:m,defaultValue:u?f:p}),...Fl("fill",e,{defaultValue:s.fill?f:void 0}),...Fl("stroke",e,{defaultValue:s.stroke?p:void 0})}}function zl(e){const{encoding:t,mark:n}=e,i=t.order;return!Io(n)&&Rr(i)?hl(e,i,"zindex",(e=>kn(e.value))):{}}function _l(e){let{channel:t,markDef:n,encoding:i={},model:o,bandPosition:r}=e;const a="".concat(t,"Offset"),s=n[a],c=i[a];if(("xOffset"===a||"yOffset"===a)&&c)return{offsetType:"encoding",offset:ir({channel:a,channelDef:c,markDef:n,config:null==o?void 0:o.config,scaleName:o.scaleName(a),scale:o.getScaleComponent(a),stack:null,defaultRef:kn(s),bandPosition:r})};const l=n[a];return l?{offsetType:"visual",offset:l}:{}}function Cl(e,t,n){let{defaultPos:i,vgChannel:o}=n;const{encoding:r,markDef:a,config:s,stack:c}=t,l=r[e],u=r[tt(e)],d=t.scaleName(e),f=t.getScaleComponent(e),{offset:p,offsetType:m}=_l({channel:e,markDef:a,encoding:r,model:t,bandPosition:.5}),g=Nl({model:t,defaultPos:i,channel:e,scaleName:d,scale:f}),h=!l&&Dt(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:function(e){const{channel:t,channelDef:n,scaleName:i,stack:o,offset:r,markDef:a}=e;if(qr(n)&&o&&t===o.fieldChannel){if(jr(n)){let e=n.bandPosition;if(void 0!==e||"text"!==a.type||"radius"!==t&&"theta"!==t||(e=.5),void 0!==e)return nr({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:e,offset:r})}return tr(n,i,{suffix:"end"},{offset:r})}return Ko(e)}({channel:e,channelDef:l,channel2Def:u,markDef:a,config:s,scaleName:d,scale:f,stack:c,offset:p,defaultRef:g,bandPosition:"encoding"===m?0:void 0});return h?{[o||e]:h}:void 0}function Nl(e){let{model:t,defaultPos:n,channel:i,scaleName:o,scale:r}=e;const{markDef:a,config:s}=t;return()=>{const e=Ze(i),c=et(i),l=zn(i,a,s,{vgChannel:c});if(void 0!==l)return or(i,l);switch(n){case"zeroOrMin":case"zeroOrMax":if(o){const e=r.get("type");if(v([$i,Ki,Zi],e));else if(r.domainDefinitelyIncludesZero())return{scale:o,value:0}}if("zeroOrMin"===n)return"y"===e?{field:{group:"height"}}:{value:0};switch(e){case"radius":return{signal:"min(".concat(t.width.signal,",").concat(t.height.signal,")/2")};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":return{...t[nt(i)],mult:.5}}}}const Pl={left:"x",center:"xc",right:"x2"},Al={top:"y",middle:"yc",bottom:"y2"};function jl(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"middle";if("radius"===e||"theta"===e)return et(e);const o="x"===e?"align":"baseline",r=zn(o,t,n);let a;return pn(r)?(hi(function(e){return"The ".concat(e," for range marks cannot be an expression")}(o)),a=void 0):a=r,"x"===e?Pl[a||("top"===i?"left":"center")]:Al[a||i]}function El(e,t,n){let{defaultPos:i,defaultPos2:o,range:r}=n;return r?Tl(e,t,{defaultPos:i,defaultPos2:o}):Cl(e,t,{defaultPos:i})}function Tl(e,t,n){let{defaultPos:i,defaultPos2:o}=n;const{markDef:r,config:a}=t,s=tt(e),c=nt(e),l=function(e,t,n){const{encoding:i,mark:o,markDef:r,stack:a,config:s}=e,c=Ze(n),l=nt(n),u=et(n),d=i[c],f=e.scaleName(c),p=e.getScaleComponent(c),{offset:m}=_l(n in i||n in r?{channel:n,markDef:r,encoding:i,model:e}:{channel:c,markDef:r,encoding:i,model:e});if(!d&&("x2"===n||"y2"===n)&&(i.latitude||i.longitude)){const t=nt(n),i=e.markDef[t];return null!=i?{[t]:{value:i}}:{[u]:{field:e.getName(n)}}}const g=function(e){let{channel:t,channelDef:n,channel2Def:i,markDef:o,config:r,scaleName:a,scale:s,stack:c,offset:l,defaultRef:u}=e;return qr(n)&&c&&t.charAt(0)===c.fieldChannel.charAt(0)?tr(n,a,{suffix:"start"},{offset:l}):Ko({channel:t,channelDef:i,scaleName:a,scale:s,stack:c,markDef:o,config:r,offset:l,defaultRef:u})}({channel:n,channelDef:d,channel2Def:i[n],markDef:r,config:s,scaleName:f,scale:p,stack:a,offset:m,defaultRef:void 0});return void 0!==g?{[u]:g}:Ml(n,r)||Ml(n,{[n]:Cn(n,r,s.style),[l]:Cn(l,r,s.style)})||Ml(n,s[o])||Ml(n,s.mark)||{[u]:Nl({model:e,defaultPos:t,channel:n,scaleName:f,scale:p})()}}(t,o,s);return{...Cl(e,t,{defaultPos:i,vgChannel:l[c]?jl(e,r,a):et(e)}),...l}}function Ml(e,t){const n=nt(e),i=et(e);if(void 0!==t[i])return{[i]:or(e,t[i])};if(void 0!==t[e])return{[i]:or(e,t[e])};if(t[n]){const i=t[n];if(!Qo(i))return{[n]:or(e,i)};hi(function(e){return"Position range does not support relative band size for ".concat(e,".")}(n))}}function Ll(e,n){var i,o;const{config:r,encoding:a,markDef:s}=e,c=s.type,l=tt(n),u=nt(n),d=a[n],f=a[l],p=e.getScaleComponent(n),m=p?p.get("type"):void 0,g=s.orient,h=null!==(i=null!==(o=a[u])&&void 0!==o?o:a.size)&&void 0!==i?i:zn("size",s,r,{vgChannel:u}),v="bar"===c&&("x"===n?"vertical"===g:"horizontal"===g);return!jr(d)||!(on(d.bin)||rn(d.bin)||d.timeUnit&&!f)||h&&!Qo(h)||po(m)?(qr(d)&&po(m)||v)&&!f?function(e,n,i){const{markDef:o,encoding:r,config:a,stack:s}=i,c=o.orient,l=i.scaleName(n),u=i.getScaleComponent(n),d=nt(n),f=tt(n),p=function(e){switch(e){case Z:return"xOffset";case ee:return"yOffset";case te:return"x2Offset";case ne:return"y2Offset";case se:return"thetaOffset";case re:return"radiusOffset";case ce:return"theta2Offset";case ae:return"radius2Offset"}}(n),m=i.scaleName(p),g="horizontal"===c&&"y"===n||"vertical"===c&&"x"===n;let h;(r.size||o.size)&&(g?h=Fl("size",i,{vgChannel:d,defaultRef:kn(o.size)}):hi(function(e){return'Cannot apply size to non-oriented mark "'.concat(e,'".')}(o.type)));const v=!!h,y=_r({channel:n,fieldDef:e,markDef:o,config:a,scaleType:null==u?void 0:u.get("type"),useVlSizeChannel:g});h=h||{[d]:ql(d,m||l,u,a,y)};const b=jl(n,o,a,"band"===(null==u?void 0:u.get("type"))&&Qo(y)&&!v?"top":"middle"),x="xc"===b||"yc"===b,{offset:w,offsetType:k}=_l({channel:n,markDef:o,encoding:r,model:i,bandPosition:x?.5:0}),S=Ko({channel:n,channelDef:e,markDef:o,config:a,scaleName:l,scale:u,stack:s,offset:w,defaultRef:Nl({model:i,defaultPos:"mid",channel:n,scaleName:l,scale:u}),bandPosition:x?"encoding"===k?0:.5:pn(y)?{signal:"(1-".concat(y,")/2")}:Qo(y)?(1-y.band)/2:0});if(d)return{[b]:S,...h};{const e=et(f),n=h[d],i=w?{...n,offset:w}:n;return{[b]:S,[e]:t.isArray(S)?[S[0],{...S[1],offset:i}]:{...S,offset:i}}}}(d,n,e):Tl(n,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"}):function(e){var t,n,i;let{fieldDef:o,fieldDef2:r,channel:a,model:s}=e;const{config:c,markDef:l,encoding:u}=s,d=s.getScaleComponent(a),f=s.scaleName(a),p=d?d.get("type"):void 0,m=d.get("reverse"),g=_r({channel:a,fieldDef:o,markDef:l,config:c,scaleType:p}),h=null===(t=s.component.axes[a])||void 0===t?void 0:t[0],v=null!==(n=null==h?void 0:h.get("translate"))&&void 0!==n?n:.5,y=Dt(a)&&null!==(i=zn("binSpacing",l,c))&&void 0!==i?i:0,b=tt(a),x=et(a),w=et(b),{offset:k}=_l({channel:a,markDef:l,encoding:u,model:s,bandPosition:0}),S=pn(g)?{signal:"(1-".concat(g.signal,")/2")}:Qo(g)?(1-g.band)/2:.5;if(on(o.bin)||o.timeUnit)return{[w]:Rl({fieldDef:o,scaleName:f,bandPosition:S,offset:Wl(b,y,m,v,k)}),[x]:Rl({fieldDef:o,scaleName:f,bandPosition:pn(S)?{signal:"1-".concat(S.signal)}:1-S,offset:Wl(a,y,m,v,k)})};if(rn(o.bin)){const e=tr(o,f,{},{offset:Wl(b,y,m,v,k)});if(jr(r))return{[w]:e,[x]:tr(r,f,{},{offset:Wl(a,y,m,v,k)})};if(an(o.bin)&&o.bin.step)return{[w]:e,[x]:{signal:'scale("'.concat(f,'", ').concat(Gr(o,{expr:"datum"})," + ").concat(o.bin.step,")"),offset:Wl(a,y,m,v,k)}}}hi(pi(b))}({fieldDef:d,fieldDef2:f,channel:n,model:e})}function ql(e,n,i,o,r){if(Qo(r)){if(!i)return{mult:r.band,field:{group:e}};{const e=i.get("type");if("band"===e){let e="bandwidth('".concat(n,"')");return 1!==r.band&&(e="".concat(r.band," * ").concat(e)),{signal:"max(0.25, ".concat(e,")")}}1!==r.band&&(hi(function(e){return"Cannot use the relative band size with ".concat(e," scale.")}(e)),r=void 0)}}else{if(pn(r))return r;if(r)return{value:r}}if(i){const e=i.get("range");if(mn(e)&&t.isNumber(e.step))return{value:e.step-2}}return{value:ws(o.view,e)-2}}function Wl(e,t,n,i,o){if(je(e))return 0;const r="x"===e||"y2"===e?-t/2:t/2;if(pn(n)||pn(o)||pn(i)){const e=Dn(n),t=Dn(o),a=Dn(i);return{signal:(a?"".concat(a," + "):"")+(e?"(".concat(e," ? -1 : 1) * "):"")+(t?"(".concat(t," + ").concat(r,")"):r)}}return o=o||0,i+(n?-o-r:+o+r)}function Rl(e){let{fieldDef:t,scaleName:n,bandPosition:i,offset:o}=e;return nr({scaleName:n,fieldOrDatumDef:t,bandPosition:i,offset:o})}const Ul=new Set(["aria","width","height"]);function Bl(e,t){const{fill:n,stroke:i}="include"===t.color?Ol(e):{};return{...Hl(e.markDef,t),...Il(e,"fill",n),...Il(e,"stroke",i),...Fl("opacity",e),...Fl("fillOpacity",e),...Fl("strokeOpacity",e),...Fl("strokeWidth",e),...Fl("strokeDash",e),...zl(e),...bl(e),...vl(e,"href"),...kl(e)}}function Il(e,n,i){const{config:o,mark:r,markDef:a}=e;if("hide"===zn("invalid",a,o)&&i&&!Io(r)){const o=function(e,t){let{invalid:n=!1,channels:i}=t;const o=i.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){const o=i.get("type"),r=e.vgField(n,{expr:"datum"});r&&mo(o)&&(t[r]=!0)}return t}),{}),r=_(o);if(r.length>0){const e=n?"||":"&&";return r.map((e=>er(e,n))).join(" ".concat(e," "))}}(e,{invalid:!0,channels:Ut});if(o)return{[n]:[{test:o,value:null},...t.array(i)]}}return i?{[n]:i}:{}}function Hl(e,t){return hn.reduce(((n,i)=>(Ul.has(i)||void 0===e[i]||"ignore"===t[i]||(n[i]=kn(e[i])),n)),{})}function Vl(e){const{config:t,markDef:n}=e;if(zn("invalid",n,t)){const t=function(e,t){let{invalid:n=!1,channels:i}=t;const o=i.reduce(((t,n)=>{const i=e.getScaleComponent(n);if(i){var o;const r=i.get("type"),a=e.vgField(n,{expr:"datum",binSuffix:null!==(o=e.stack)&&void 0!==o&&o.impute?"mid":void 0});a&&mo(r)&&(t[a]=!0)}return t}),{}),r=_(o);if(r.length>0){const e=n?"||":"&&";return r.map((e=>er(e,n))).join(" ".concat(e," "))}}(e,{channels:St});if(t)return{defined:{signal:t}}}return{}}function Gl(e,t){if(void 0!==t)return{[e]:kn(t)}}const Yl="voronoi",Xl={defined:e=>"point"===e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Yl)},marks:(e,t,n)=>{const{x:i,y:o}=t.project.hasChannel,r=e.mark;if(Io(r))return hi('The "nearest" transform is not supported for '.concat(r," marks.")),n;const a={name:e.getName(Yl),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...bl(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!o?"datum.datum.x || 0":"0"},y:{expr:o||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let s=0,c=!1;return n.forEach(((t,n)=>{var i;const o=null!==(i=t.name)&&void 0!==i?i:"";o===e.component.mark[0].name?s=n:o.indexOf(Yl)>=0&&(c=!0)})),c||n.splice(s+1,0,a),n}},Jl={defined:e=>"point"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!ls(e.bind),parse:(e,t,n)=>gu(t,n),topLevelSignals:(e,n,i)=>{const o=n.name,r=n.project,a=n.bind,s=n.init&&n.init[0],c=Xl.defined(n)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach(((e,r)=>{const l=A("".concat(o,"_").concat(e.field));var u,d;i.filter((e=>e.name===l)).length||i.unshift({name:l,...s?{init:$c(s[r])}:{value:null},on:n.events?[{events:n.events,update:"datum && item().mark.marktype !== 'group' ? ".concat(c,"[").concat(t.stringValue(e.field),"] : null")}]:[],bind:null!==(u=null!==(d=a[e.field])&&void 0!==d?d:a[e.channel])&&void 0!==u?u:a})})),i},signals:(e,t,n)=>{const i=t.name,o=t.project,r=n.filter((e=>e.name===i+lu))[0],a=i+rl,s=o.items.map((e=>A("".concat(i,"_").concat(e.field)))),c=s.map((e=>"".concat(e," !== null"))).join(" && ");return s.length&&(r.update="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null")),delete r.value,delete r.on,n}},Ql="_toggle",$l={defined:e=>"point"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+Ql,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+lu,i=t.name+Ql;return"".concat(i," ? null : ").concat(n,", ")+("global"===t.resolve?"".concat(i," ? null : true, "):"".concat(i," ? null : {unit: ").concat(pu(e),"}, "))+"".concat(i," ? ").concat(n," : null")}},Kl={defined:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,n)=>{n.clear&&(n.clear=t.isString(n.clear)?t.parseSelector(n.clear,"view"):n.clear)},topLevelSignals:(e,t,n)=>{if(Jl.defined(t))for(const e of t.project.items){const i=n.findIndex((n=>n.name===A("".concat(t.name,"_").concat(e.field))));-1!==i&&n[i].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(e,i){-1!==e&&n[e].on&&n[e].on.push({events:t.clear,update:i})}if("interval"===t.type)for(const e of t.project.items){const t=n.findIndex((t=>t.name===e.signals.visual));i(t,"[0, 0]"),-1===t&&i(n.findIndex((t=>t.name===e.signals.data)),"null")}else{let e=n.findIndex((e=>e.name===t.name+lu));i(e,"null"),$l.defined(t)&&(e=n.findIndex((e=>e.name===t.name+Ql)),i(e,"false"))}return n}},Zl={defined:e=>{const t="global"===e.resolve&&e.bind&&ls(e.bind),n=1===e.project.items.length&&e.project.items[0].field!==ss;return t&&!n&&hi("Legend bindings are only supported for selections over an individual field or encoding channel."),t&&n},parse:(e,n,i)=>{const o=u(i);if(o.select=t.isString(o.select)?{type:o.select,toggle:n.toggle}:{...o.select,toggle:n.toggle},gu(n,o),t.isObject(i.select)&&(i.select.on||i.select.clear)){const e='event.item && indexof(event.item.mark.role, "legend") < 0';for(const i of n.events){var r;i.filter=t.array(null!==(r=i.filter)&&void 0!==r?r:[]),i.filter.includes(e)||i.filter.push(e)}}const a=us(n.bind)?n.bind.legend:"click",s=t.isString(a)?t.parseSelector(a,"view"):t.array(a);n.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,o=us(t.bind)&&t.bind.legend,r=e=>t=>{const n=u(t);return n.markname=e,n};for(const e of t.project.items){if(!e.hasLegend)continue;const a="".concat(A(e.field),"_legend"),s="".concat(i,"_").concat(a);if(0===n.filter((e=>e.name===s)).length){const e=o.merge.map(r("".concat(a,"_symbols"))).concat(o.merge.map(r("".concat(a,"_labels")))).concat(o.merge.map(r("".concat(a,"_entries"))));n.unshift({name:s,...t.init?{}:{value:null},on:[{events:e,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:o.merge,update:"!event.item || !datum ? null : ".concat(s),force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,o=t.project,r=n.find((e=>e.name===i+lu)),a=i+rl,s=o.items.filter((e=>e.hasLegend)).map((e=>A("".concat(i,"_").concat(A(e.field),"_legend")))),c=s.map((e=>"".concat(e," !== null"))).join(" && "),l="".concat(c," ? {fields: ").concat(a,", values: [").concat(s.join(", "),"]} : null");t.events&&s.length>0?r.on.push({events:s.map((e=>({signal:e}))),update:l}):s.length>0&&(r.update=l,delete r.value,delete r.on);const u=n.find((e=>e.name===i+Ql)),d=us(t.bind)&&t.bind.legend;return u&&(t.events?u.on.push({...u.on[0],events:d}):u.on[0].events=d),n}},eu="_translate_anchor",tu="_translate_delta",nu={defined:e=>"interval"===e.type&&e.translate,signals:(e,n,i)=>{const o=n.name,r=cl.defined(n),a=o+eu,{x:s,y:c}=n.project.hasChannel;let l=t.parseSelector(n.translate,"scope");return r||(l=l.map((e=>(e.between[0].markname=o+dl,e)))),i.push({name:a,value:{},on:[{events:l.map((e=>e.between[0])),update:"{x: x(unit), y: y(unit)"+(void 0!==s?", extent_x: ".concat(r?ll(e,Z):"slice(".concat(s.signals.visual,")")):"")+(void 0!==c?", extent_y: ".concat(r?ll(e,ee):"slice(".concat(c.signals.visual,")")):"")+"}"}]},{name:o+tu,value:{},on:[{events:l,update:"{x: ".concat(a,".x - x(unit), y: ").concat(a,".y - y(unit)}")}]}),void 0!==s&&iu(e,n,s,"width",i),void 0!==c&&iu(e,n,c,"height",i),i}};function iu(e,t,n,i,o){var r,a;const s=t.name,c=s+eu,l=s+tu,u=n.channel,d=cl.defined(t),f=o.filter((e=>e.name===n.signals[d?"data":"visual"]))[0],p=e.getSizeSignalRef(i).signal,m=e.getScaleComponent(u),g=m.get("type"),h=m.get("reverse"),v=d?u===Z?h?"":"-":h?"-":"":"",y="".concat(c,".extent_").concat(u),b="".concat(v).concat(l,".").concat(u," / ").concat(d?"".concat(p):"span(".concat(y,")")),x=d?"log"===g?"panLog":"symlog"===g?"panSymlog":"pow"===g?"panPow":"panLinear":"panLinear",w=d?"pow"===g?", ".concat(null!==(r=m.get("exponent"))&&void 0!==r?r:1):"symlog"===g?", ".concat(null!==(a=m.get("constant"))&&void 0!==a?a:1):"":"",k="".concat(x,"(").concat(y,", ").concat(b).concat(w,")");f.on.push({events:{signal:l},update:d?k:"clampRange(".concat(k,", 0, ").concat(p,")")})}const ou="_zoom_anchor",ru="_zoom_delta",au={defined:e=>"interval"===e.type&&e.zoom,signals:(e,n,i)=>{const o=n.name,r=cl.defined(n),a=o+ru,{x:s,y:c}=n.project.hasChannel,l=t.stringValue(e.scaleName(Z)),u=t.stringValue(e.scaleName(ee));let d=t.parseSelector(n.zoom,"scope");return r||(d=d.map((e=>(e.markname=o+dl,e)))),i.push({name:o+ou,on:[{events:d,update:r?"{"+[l?"x: invert(".concat(l,", x(unit))"):"",u?"y: invert(".concat(u,", y(unit))"):""].filter((e=>!!e)).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:a,on:[{events:d,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==s&&su(e,n,s,"width",i),void 0!==c&&su(e,n,c,"height",i),i}};function su(e,t,n,i,o){var r,a;const s=t.name,c=n.channel,l=cl.defined(t),u=o.filter((e=>e.name===n.signals[l?"data":"visual"]))[0],d=e.getSizeSignalRef(i).signal,f=e.getScaleComponent(c),p=f.get("type"),m=l?ll(e,c):u.name,g=s+ru,h="".concat(s).concat(ou,".").concat(c),v=l?"log"===p?"zoomLog":"symlog"===p?"zoomSymlog":"pow"===p?"zoomPow":"zoomLinear":"zoomLinear",y=l?"pow"===p?", ".concat(null!==(r=f.get("exponent"))&&void 0!==r?r:1):"symlog"===p?", ".concat(null!==(a=f.get("constant"))&&void 0!==a?a:1):"":"",b="".concat(v,"(").concat(m,", ").concat(h,", ").concat(g).concat(y,")");u.on.push({events:{signal:g},update:l?b:"clampRange(".concat(b,", 0, ").concat(d,")")})}const cu="_store",lu="_tuple",uu="_modify",du="vlSelectionResolve",fu=[gl,pl,sl,$l,Jl,cl,Zl,Kl,nu,au,Xl];function pu(e){let{escape:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{escape:!0},i=n?t.stringValue(e.name):e.name;const o=function(e){let t=e.parent;for(;t&&!Jf(t);)t=t.parent;return t}(e);if(o){const{facet:e}=o;for(const n of We)e[n]&&(i+=" + '__facet_".concat(n,"_' + (facet[").concat(t.stringValue(o.vgField(n)),"])"))}return i}function mu(e){var t;return C(null!==(t=e.component.selection)&&void 0!==t?t:{}).reduce(((e,t)=>e||t.project.hasSelectionId),!1)}function gu(e,n){!t.isString(n.select)&&n.select.on||delete e.events,!t.isString(n.select)&&n.select.clear||delete e.clear,!t.isString(n.select)&&n.select.toggle||delete e.toggle}function hu(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...hu(e.object)),t.push(...hu(e.property))),t)}function vu(e){return"MemberExpression"===e.object.type?vu(e.object):"datum"===e.object.name}function yu(e){const n=t.parseExpression(e),i=new Set;return n.visit((e=>{"MemberExpression"===e.type&&vu(e)&&i.add(hu(e).slice(1).join("."))})),i}class bu extends nl{clone(){return new bu(null,this.model,u(this.filter))}constructor(e,t,n){super(e),this.model=t,this.filter=n,Tn(this,"expr",void 0),Tn(this,"_dependentFields",void 0),this.expr=ku(this.model,this.filter,this),this._dependentFields=yu(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter ".concat(this.expr)}}function xu(e,n,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"datum";const r=t.isString(n)?n:n.param,a=A(r),s=t.stringValue(a+cu);let c;try{c=e.getSelectionComponent(a,r)}catch(e){return"!!".concat(a)}if(c.project.timeUnit){const t=null!=i?i:e.component.data.raw,n=c.project.timeUnit.clone();t.parent?n.insertAsParentOf(t):t.parent=n}const l=c.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u="global"===c.resolve?")":", ".concat(t.stringValue(c.resolve),")"),d="".concat(l).concat(s,", ").concat(o).concat(u),f="length(data(".concat(s,"))");return!1===n.empty?"".concat(f," && ").concat(d):"!".concat(f," || ").concat(d)}function wu(e,n,i){const o=A(n),r=i.encoding;let a,s=i.field;try{a=e.getSelectionComponent(o,n)}catch(e){return o}if(r||s){if(r&&!s){const e=a.project.items.filter((e=>e.channel===r));!e.length||e.length>1?(s=a.project.items[0].field,hi((e.length?"Multiple ":"No ")+"matching ".concat(t.stringValue(r)," encoding found for selection ").concat(t.stringValue(i.param),". ")+'Using "field": '.concat(t.stringValue(s),"."))):s=e[0].field}}else s=a.project.items[0].field,a.project.items.length>1&&hi('A "field" or "encoding" must be specified when using a selection as a scale domain. '+'Using "field": '.concat(t.stringValue(s),"."));return"".concat(a.name,"[").concat(t.stringValue(W(s)),"]")}function ku(e,n,i){return j(n,(n=>t.isString(n)?n:function(e){return null==e?void 0:e.param}(n)?xu(e,n,i):Ui(n)))}function Su(e,n){if(e)return t.isArray(e)&&!fn(e)?e.map((e=>Zr(e,n))).join(", "):e}function Du(e,t,n,i){var o,r,a,s,c;null!==(o=e.encode)&&void 0!==o||(e.encode={}),null!==(a=(r=e.encode)[t])&&void 0!==a||(r[t]={}),null!==(c=(s=e.encode[t]).update)&&void 0!==c||(s.update={}),e.encode[t].update[n]=i}function Fu(e,n,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{header:!1};const{disable:r,orient:a,scale:s,labelExpr:c,title:l,zindex:u,...d}=e.combine();if(!r){for(const e in d){const i=ga[e],o=d[e];if(i&&i!==n&&"both"!==i)delete d[e];else if(pa(o)){const{condition:n,...i}=o,r=t.array(n),a=fa[e];if(a){const{vgProp:t,part:n}=a;Du(d,n,t,[...r.map((e=>{const{test:t,...n}=e;return{test:ku(null,t),...n}})),i]),delete d[e]}else if(null===a){const t={signal:r.map((e=>{const{test:t,...n}=e;return"".concat(ku(null,t)," ? ").concat(Sn(n)," : ")})).join("")+Sn(i)};d[e]=t}}else if(pn(o)){const t=fa[e];if(t){const{vgProp:n,part:i}=t;Du(d,i,n,o),delete d[e]}}v(["labelAlign","labelBaseline"],e)&&null===d[e]&&delete d[e]}if("grid"===n){if(!d.grid)return;if(d.encode){const{grid:e}=d.encode;d.encode={...e?{grid:e}:{}},z(d.encode)&&delete d.encode}return{scale:s,orient:a,...d,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:I(u,0)}}{if(!o.header&&e.mainExtracted)return;if(void 0!==c){var f,p;let e=c;null!==(f=d.encode)&&void 0!==f&&null!==(p=f.labels)&&void 0!==p&&p.update&&pn(d.encode.labels.update.text)&&(e=R(c,"datum.label",d.encode.labels.update.text.signal)),Du(d,"labels","text",{signal:e})}if(null===d.labelAlign&&delete d.labelAlign,d.encode){for(const t of ma)e.hasAxisPart(t)||delete d.encode[t];z(d.encode)&&delete d.encode}const t=Su(l,i);return{scale:s,orient:a,grid:!1,...t?{title:t}:{},...d,...!1===i.aria?{aria:!1}:{},zindex:I(u,0)}}}}function Ou(e){const{axes:t}=e.component,n=[];for(const i of St)if(t[i])for(const o of t[i])if(!o.get("disable")&&!o.get("gridScale")){const t="x"===i?"height":"width",o=e.getSizeSignalRef(t).signal;t!==o&&n.push({name:t,update:o})}return n}function zu(e,t,n,i){return Object.assign.apply(null,[{},...e.map((e=>{if("axisOrient"===e){const e="x"===n?"bottom":"left",o=t["x"===n?"axisBottom":"axisLeft"]||{},r=t["x"===n?"axisTop":"axisRight"]||{},a=new Set([..._(o),..._(r)]),s={};for(const t of a.values())s[t]={signal:"".concat(i.signal,' === "').concat(e,'" ? ').concat(Dn(o[t])," : ").concat(Dn(r[t]))};return s}return t[e]}))])}function _u(e,n){const i=[{}];for(const r of e){var o;let e=null===(o=n[r])||void 0===o?void 0:o.style;if(e){e=t.array(e);for(const t of e)i.push(n.style[t])}}return Object.assign.apply(null,i)}function Cu(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=Nn(e,n,t);if(void 0!==o)return{configFrom:"style",configValue:o};for(const t of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"]){var r;if(void 0!==(null===(r=i[t])||void 0===r?void 0:r[e]))return{configFrom:t,configValue:i[t][e]}}return{}}const Nu={scale:e=>{let{model:t,channel:n}=e;return t.scaleName(n)},format:e=>{let{fieldOrDatumDef:t,config:n,axis:i}=e;const{format:o,formatType:r}=i;return ur(t,t.type,o,r,n,!0)},formatType:e=>{let{axis:t,fieldOrDatumDef:n,scaleType:i}=e;const{formatType:o}=t;return dr(o,n,i)},grid:e=>{var t;let{fieldOrDatumDef:n,axis:i,scaleType:o}=e;return null!==(t=i.grid)&&void 0!==t?t:function(e,t){return!po(e)&&jr(t)&&!on(null==t?void 0:t.bin)&&!rn(null==t?void 0:t.bin)}(o,n)},gridScale:e=>{let{model:t,channel:n}=e;return function(e,t){const n="x"===t?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}(t,n)},labelAlign:e=>{let{axis:t,labelAngle:n,orient:i,channel:o}=e;return t.labelAlign||ju(n,i,o)},labelAngle:e=>{let{labelAngle:t}=e;return t},labelBaseline:e=>{let{axis:t,labelAngle:n,orient:i,channel:o}=e;return t.labelBaseline||Au(n,i,o)},labelFlush:e=>{var t;let{axis:n,fieldOrDatumDef:i,channel:o}=e;return null!==(t=n.labelFlush)&&void 0!==t?t:function(e,t){if("x"===t&&v(["quantitative","temporal"],e))return!0}(i.type,o)},labelOverlap:e=>{var n;let{axis:i,fieldOrDatumDef:o,scaleType:r}=e;return null!==(n=i.labelOverlap)&&void 0!==n?n:function(e,n,i,o){if(i&&!t.isObject(o)||"nominal"!==e&&"ordinal"!==e)return"log"!==n&&"symlog"!==n||"greedy"}(o.type,r,jr(o)&&!!o.timeUnit,jr(o)?o.sort:void 0)},orient:e=>{let{orient:t}=e;return t},tickCount:e=>{var t;let{channel:n,model:i,axis:o,fieldOrDatumDef:r,scaleType:a}=e;const s="x"===n?"width":"y"===n?"height":void 0,c=s?i.getSizeSignalRef(s):void 0;return null!==(t=o.tickCount)&&void 0!==t?t:function(e){let{fieldOrDatumDef:t,scaleType:n,size:i,values:o}=e;if(!o&&!po(n)&&"log"!==n){if(jr(t)){var r;if(on(t.bin))return{signal:"ceil(".concat(i.signal,"/10)")};if(t.timeUnit&&v(["month","hours","day","quarter"],null===(r=Pi(t.timeUnit))||void 0===r?void 0:r.unit))return}return{signal:"ceil(".concat(i.signal,"/40)")}}}({fieldOrDatumDef:r,scaleType:a,size:c,values:o.values})},title:e=>{let{axis:t,model:n,channel:i}=e;if(void 0!==t.title)return t.title;const o=Eu(n,i);if(void 0!==o)return o;const r=n.typedFieldDef(i),a="x"===i?"x2":"y2",s=n.fieldDef(a);return An(r?[Fr(r)]:[],jr(s)?[Fr(s)]:[])},values:e=>{let{axis:n,fieldOrDatumDef:i}=e;return function(e,n){const i=e.values;return t.isArray(i)?ua(n,i):pn(i)?i:void 0}(n,i)},zindex:e=>{var t;let{axis:n,fieldOrDatumDef:i,mark:o}=e;return null!==(t=n.zindex)&&void 0!==t?t:function(e,t){return"rect"===e&&Yr(t)?1:0}(o,i)}};function Pu(e){return"(((".concat(e.signal," % 360) + 360) % 360)")}function Au(e,t,n,i){if(void 0!==e){if("x"===n){if(pn(e)){const n=Pu(e),i=pn(t)?"(".concat(t.signal,' === "top")'):"top"===t;return{signal:"(45 < ".concat(n," && ").concat(n," < 135) || (225 < ").concat(n," && ").concat(n,' < 315) ? "middle" :')+"(".concat(n," <= 45 || 315 <= ").concat(n,") === ").concat(i,' ? "bottom" : "top"')}}if(45{if(Ur(t)&&wr(t.sort)){const{field:i,timeUnit:o}=t,r=t.sort,a=r.map(((e,t)=>"".concat(Ui({field:i,timeUnit:o,equal:e})," ? ").concat(t," : "))).join("")+r.length;e=new Tu(e,{calculate:a,as:Mu(t,n,{forAs:!0})})}})),e}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate ".concat(g(this.transform))}}function Mu(e,t,n){return Gr(e,{prefix:t,suffix:"sort_index",...null!=n?n:{}})}function Lu(e,t){return v(["top","bottom"],t)?"column":v(["left","right"],t)||"row"===e?"row":"column"}function qu(e,t,n,i){const o="row"===i?n.headerRow:"column"===i?n.headerColumn:n.headerFacet;return I((t||{})[e],o[e],n.header[e])}function Wu(e,t,n,i){const o={};for(const r of e){const e=qu(r,t||{},n,i);void 0!==e&&(o[r]=e)}return o}const Ru=["row","column"],Uu=["header","footer"];function Bu(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,o=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:r,titleAngle:a,titleOrient:s}=Wu(["titleAnchor","titleAngle","titleOrient"],o.header,i,t),c=Lu(t,s),l=X(a);return{name:"".concat(t,"-title"),type:"group",role:"".concat(c,"-title"),title:{text:n,..."row"===t?{orient:"left"}:{},style:"guide-title",...Hu(l,c),...Iu(c,l,r),...$u(i,o,t,is,ts)}}}function Iu(e,t){switch(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"middle"){case"start":return{align:"left"};case"end":return{align:"right"}}const n=ju(t,"row"===e?"left":"top","row"===e?"y":"x");return n?{align:n}:{}}function Hu(e,t){const n=Au(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return n?{baseline:n}:{}}function Vu(e,t){const n=e.component.layoutHeaders[t],i=[];for(const o of Uu)if(n[o])for(const r of n[o]){const a=Xu(e,t,o,n,r);null!=a&&i.push(a)}return i}function Gu(e,n){const{sort:i}=e;var o;return xr(i)?{field:Gr(i,{expr:"datum"}),order:null!==(o=i.order)&&void 0!==o?o:"ascending"}:t.isArray(i)?{field:Mu(e,n,{expr:"datum"}),order:"ascending"}:{field:Gr(e,{expr:"datum"}),order:null!=i?i:"ascending"}}function Yu(e,t,n){const{format:i,formatType:o,labelAngle:r,labelAnchor:a,labelOrient:s,labelExpr:c}=Wu(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=sr({fieldOrDatumDef:e,format:i,formatType:o,expr:"parent",config:n}).signal,u=Lu(t,s);return{text:{signal:c?R(R(c,"datum.label",l),"datum.value",Gr(e,{expr:"parent"})):l},..."row"===t?{orient:"left"}:{},style:"guide-label",frame:"group",...Hu(r,u),...Iu(u,r,a),...$u(n,e,t,os,ns)}}function Xu(e,t,n,i,o){if(o){let r=null;const{facetFieldDef:a}=i,s=e.config?e.config:void 0;if(a&&o.labels){const{labelOrient:e}=Wu(["labelOrient"],a.header,s,t);("row"===t&&!v(["top","bottom"],e)||"column"===t&&!v(["left","right"],e))&&(r=Yu(a,t,s))}const c=Jf(e)&&!kr(e.facet),l=o.axes,u=(null==l?void 0:l.length)>0;if(r||u){const s="row"===t?"height":"width";return{name:e.getName("".concat(t,"_").concat(n)),type:"group",role:"".concat(t,"-").concat(n),...i.facetFieldDef?{from:{data:e.getName("".concat(t,"_domain"))},sort:Gu(a,t)}:{},...u&&c?{from:{data:e.getName("facet_domain_".concat(t))}}:{},...r?{title:r}:{},...o.sizeSignal?{encode:{update:{[s]:o.sizeSignal}}}:{},...u?{axes:l}:{}}}}return null}const Ju={column:{start:0,end:1},row:{start:1,end:0}};function Qu(e,t){return Ju[t][e]}function $u(e,t,n,i,o){const r={};for(const a of i){if(!o[a])continue;const i=qu(a,null==t?void 0:t.header,e,n);void 0!==i&&(r[o[a]]=i)}return r}function Ku(e){return[...Zu(e,"width"),...Zu(e,"height"),...Zu(e,"childWidth"),...Zu(e,"childHeight")]}function Zu(e,t){const n="width"===t?"x":"y",i=e.component.layoutSize.get(t);if(!i||"merged"===i)return[];const o=e.getSizeSignalRef(t).signal;if("step"===i){const t=e.getScaleComponent(n);if(t){const i=t.get("type"),r=t.get("range");if(po(i)&&mn(r)){const i=e.scaleName(n);return Jf(e.parent)&&"independent"===e.parent.component.resolve.scale[n]?[ed(i,r)]:[ed(i,r),{name:o,update:td(i,t,"domain('".concat(i,"').length"))}]}}throw new Error("layout size is step although width/height is not step.")}if("container"==i){const t=o.endsWith("width"),n=t?"containerSize()[0]":"containerSize()[1]",i=xs(e.config.view,t?"width":"height"),r="isFinite(".concat(n,") ? ").concat(n," : ").concat(i);return[{name:o,init:r,on:[{update:r,events:"window:resize"}]}]}return[{name:o,value:i}]}function ed(e,t){const n="".concat(e,"_step");return pn(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function td(e,t,n){const i=t.get("type"),o=t.get("padding"),r=I(t.get("paddingOuter"),o);let a=t.get("paddingInner");return a="band"===i?void 0!==a?a:o:1,"bandspace(".concat(n,", ").concat(Dn(a),", ").concat(Dn(r),") * ").concat(e,"_step")}function nd(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function id(e,t){return _(e).reduce(((n,i)=>{const o=e[i];return{...n,...hl(t,o,i,(e=>kn(e.value)))}}),{})}function od(e,t){if(Jf(t))return"theta"===e?"independent":"shared";if($f(t))return"shared";if(Qf(t))return Dt(e)||"theta"===e||"radius"===e?"independent":"shared";throw new Error("invalid model type for resolve")}function rd(e,t){const n=e.scale[t],i=Dt(t)?"axis":"legend";return"independent"===n?("shared"===e[i][t]&&hi(function(e){return'Setting the scale to be independent for "'.concat(e,'" means we also have to set the guide (axis or legend) to be independent.')}(t)),"independent"):e[i][t]||"shared"}const ad=_({aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});class sd extends Mc{}const cd={symbols:function(e,n){var i,o,r,a;let{fieldOrDatumDef:s,model:c,channel:l,legendCmpt:u,legendType:d}=n;if("symbol"!==d)return;const{markDef:f,encoding:p,config:m,mark:g}=c,h=f.filled&&"trail"!==g;let v={...Fn({},c,Yo),...Ol(c,{filled:h})};const y=null!==(i=u.get("symbolOpacity"))&&void 0!==i?i:m.legend.symbolOpacity,b=null!==(o=u.get("symbolFillColor"))&&void 0!==o?o:m.legend.symbolFillColor,x=null!==(r=u.get("symbolStrokeColor"))&&void 0!==r?r:m.legend.symbolStrokeColor,w=void 0===y?null!==(a=ld(p.opacity))&&void 0!==a?a:f.opacity:void 0;var k;if(v.fill)if("fill"===l||h&&l===pe)delete v.fill;else if(v.fill.field)b?delete v.fill:(v.fill=kn(null!==(k=m.legend.symbolBaseFillColor)&&void 0!==k?k:"black"),v.fillOpacity=kn(null!=w?w:1));else if(t.isArray(v.fill)){var S,D,F;const e=null!==(S=null!==(D=ud(null!==(F=p.fill)&&void 0!==F?F:p.color))&&void 0!==D?D:f.fill)&&void 0!==S?S:h&&f.color;e&&(v.fill=kn(e))}if(v.stroke)if("stroke"===l||!h&&l===pe)delete v.stroke;else if(v.stroke.field||x)delete v.stroke;else if(t.isArray(v.stroke)){const e=I(ud(p.stroke||p.color),f.stroke,h?f.color:void 0);e&&(v.stroke={value:e})}if(l!==be){const e=jr(s)&&fd(0,u,s);e?v.opacity=[{test:e,...kn(null!=w?w:1)},kn(m.legend.unselectedOpacity)]:w&&(v.opacity=kn(w))}return v={...v,...e},z(v)?void 0:v},gradient:function(e,t){var n;let{model:i,legendType:o,legendCmpt:r}=t;if("gradient"!==o)return;const{config:a,markDef:s,encoding:c}=i;let l={};const u=void 0===(null!==(n=r.get("gradientOpacity"))&&void 0!==n?n:a.legend.gradientOpacity)?ld(c.opacity)||s.opacity:void 0;return u&&(l.opacity=kn(u)),l={...l,...e},z(l)?void 0:l},labels:function(e,t){let{fieldOrDatumDef:n,model:i,channel:o,legendCmpt:r}=t;const a=i.legend(o)||{},s=i.config,c=jr(n)?fd(0,r,n):void 0,l=c?[{test:c,value:1},{value:s.legend.unselectedOpacity}]:void 0,{format:u,formatType:d}=a;let f;rr(d)?f=lr({fieldOrDatumDef:n,field:"datum.value",format:u,formatType:d,config:s}):void 0===u&&void 0===d&&s.customFormatTypes&&("quantitative"===n.type&&s.numberFormatType?f=lr({fieldOrDatumDef:n,field:"datum.value",format:s.numberFormat,formatType:s.numberFormatType,config:s}):"temporal"===n.type&&s.timeFormatType&&jr(n)&&void 0===n.timeUnit&&(f=lr({fieldOrDatumDef:n,field:"datum.value",format:s.timeFormat,formatType:s.timeFormatType,config:s})));const p={...l?{opacity:l}:{},...f?{text:f}:{},...e};return z(p)?void 0:p},entries:function(e,t){let{legendCmpt:n}=t;const i=n.get("selections");return null!=i&&i.length?{...e,fill:{value:"transparent"}}:e}};function ld(e){return dd(e,((e,t)=>Math.max(e,t.value)))}function ud(e){return dd(e,((e,t)=>I(e,t.value)))}function dd(e,n){return function(e){const n=null==e?void 0:e.condition;return!!n&&(t.isArray(n)||Rr(n))}(e)?t.array(e.condition).reduce(n,e.value):Rr(e)?e.value:void 0}function fd(e,n,i){const o=n.get("selections");if(null==o||!o.length)return;const r=t.stringValue(i.field);return o.map((e=>{const n=t.stringValue(A(e)+cu);return"(!length(data(".concat(n,")) || (").concat(e,"[").concat(r,"] && indexof(").concat(e,"[").concat(r,"], datum.value) >= 0))")})).join(" || ")}const pd={direction:e=>{let{direction:t}=e;return t},format:e=>{let{fieldOrDatumDef:t,legend:n,config:i}=e;const{format:o,formatType:r}=n;return ur(t,t.type,o,r,i,!1)},formatType:e=>{let{legend:t,fieldOrDatumDef:n,scaleType:i}=e;const{formatType:o}=t;return dr(o,n,i)},gradientLength:e=>{var t,n;const{legend:i,legendConfig:o}=e;return null!==(t=null!==(n=i.gradientLength)&&void 0!==n?n:o.gradientLength)&&void 0!==t?t:function(e){let{legendConfig:t,model:n,direction:i,orient:o,scaleType:r}=e;const{gradientHorizontalMaxLength:a,gradientHorizontalMinLength:s,gradientVerticalMaxLength:c,gradientVerticalMinLength:l}=t;if(go(r))return"horizontal"===i?"top"===o||"bottom"===o?hd(n,"width",s,a):s:hd(n,"height",l,c)}(e)},labelOverlap:e=>{var t,n;let{legend:i,legendConfig:o,scaleType:r}=e;return null!==(t=null!==(n=i.labelOverlap)&&void 0!==n?n:o.labelOverlap)&&void 0!==t?t:function(e){if(v(["quantile","threshold","log","symlog"],e))return"greedy"}(r)},symbolType:e=>{var t;let{legend:n,markDef:i,channel:o,encoding:r}=e;return null!==(t=n.symbolType)&&void 0!==t?t:function(e,t,n,i){if("shape"!==t){var o;const e=null!==(o=ud(n))&&void 0!==o?o:i;if(e)return e}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(i.type,o,r.shape,i.shape)},title:e=>{let{fieldOrDatumDef:t,config:n}=e;return $r(t,n,{allowDisabling:!0})},type:e=>{let{legendType:t,scaleType:n,channel:i}=e;if(Le(i)&&go(n)){if("gradient"===t)return}else if("symbol"===t)return;return t},values:e=>{let{fieldOrDatumDef:n,legend:i}=e;return function(e,n){const i=e.values;return t.isArray(i)?ua(n,i):pn(i)?i:void 0}(i,n)}};function md(e){const{legend:t}=e;return I(t.type,function(e){let{channel:t,timeUnit:n,scaleType:i}=e;if(Le(t)){if(v(["quarter","month","day"],n))return"symbol";if(go(i))return"gradient"}return"symbol"}(e))}function gd(e){var t,n;let{legendConfig:i,legendType:o,orient:r,legend:a}=e;return null!==(t=null!==(n=a.direction)&&void 0!==n?n:i[o?"gradientDirection":"symbolDirection"])&&void 0!==t?t:function(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(r,o)}function hd(e,t,n,i){const o=e.getSizeSignalRef(t).signal;return{signal:"clamp(".concat(o,", ").concat(n,", ").concat(i,")")}}function vd(e){const t=Xf(e)?function(e){const{encoding:t}=e,n={};for(const i of[pe,...as]){const o=na(t[i]);o&&e.getScaleComponent(i)&&(i===he&&jr(o)&&o.type===Qi||(n[i]=bd(e,i)))}return n}(e):function(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){vd(i);for(const o of _(i.component.legends))n.legend[o]=rd(e.component.resolve,o),"shared"===n.legend[o]&&(t[o]=xd(t[o],i.component.legends[o]),t[o]||(n.legend[o]="independent",delete t[o]))}for(const i of _(t))for(const t of e.children)t.component.legends[i]&&"shared"===n.legend[i]&&delete t.component.legends[i];return t}(e);return e.component.legends=t,t}function yd(e,t,n,i){switch(t){case"disable":return void 0!==n;case"values":return!(null==n||!n.values);case"title":if("title"===t&&e===(null==i?void 0:i.title))return!0}return e===(n||{})[t]}function bd(e,t){var n,i,o;let r=e.legend(t);const{markDef:a,encoding:s,config:c}=e,l=c.legend,u=new sd({},function(e,t){const n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"===t?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}(e,t));!function(e,t,n){var i;const o=null===(i=e.fieldDef(t))||void 0===i?void 0:i.field;for(const i of C(null!==(r=e.component.selection)&&void 0!==r?r:{})){var r,a;const e=null!==(a=i.project.hasField[o])&&void 0!==a?a:i.project.hasChannel[t];if(e&&Zl.defined(i)){var s;const t=null!==(s=n.get("selections"))&&void 0!==s?s:[];t.push(i.name),n.set("selections",t,!1),e.hasLegend=!0}}}(e,t,u);const d=void 0!==r?!r:l.disable;if(u.set("disable",d,void 0!==r),d)return u;r=r||{};const f=e.getScaleComponent(t).get("type"),p=na(s[t]),m=jr(p)?null===(n=Pi(p.timeUnit))||void 0===n?void 0:n.unit:void 0,g=r.orient||c.legend.orient||"right",h=md({legend:r,channel:t,timeUnit:m,scaleType:f}),v={legend:r,channel:t,model:e,markDef:a,encoding:s,fieldOrDatumDef:p,legendConfig:l,config:c,scaleType:f,orient:g,legendType:h,direction:gd({legend:r,legendType:h,orient:g,legendConfig:l})};for(const n of ad){if("gradient"===h&&n.startsWith("symbol")||"symbol"===h&&n.startsWith("gradient"))continue;const i=n in pd?pd[n](v):r[n];if(void 0!==i){const o=yd(i,n,r,e.fieldDef(t));(o||void 0===c.legend[n])&&u.set(n,i,o)}}const y=null!==(i=null===(o=r)||void 0===o?void 0:o.encoding)&&void 0!==i?i:{},b=u.get("selections"),x={},w={fieldOrDatumDef:p,model:e,channel:t,legendCmpt:u,legendType:h};for(const t of["labels","legend","title","symbols","gradient","entries"]){var k;const n=id(null!==(k=y[t])&&void 0!==k?k:{},e),i=t in cd?cd[t](n,w):n;void 0===i||z(i)||(x[t]={...null!=b&&b.length&&jr(p)?{name:"".concat(A(p.field),"_legend_").concat(t)}:{},...null!=b&&b.length?{interactive:!!b}:{},update:i})}var S;return z(x)||u.set("encode",x,!(null===(S=r)||void 0===S||!S.encoding)),u}function xd(e,t){if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let o=!1;for(const n of ad){const i=Uc(e.getWithExplicit(n),t.getWithExplicit(n),n,"legend",((e,t)=>{switch(n){case"symbolType":return wd(e,t);case"title":return En(e,t);case"type":return o=!0,qc("symbol")}return Rc(e,t,n,"legend")}));e.setWithExplicit(n,i)}var r,a,s,c;return o&&(null!==(r=e.implicit)&&void 0!==r&&null!==(a=r.encode)&&void 0!==a&&a.gradient&&E(e.implicit,["encode","gradient"]),null!==(s=e.explicit)&&void 0!==s&&null!==(c=s.encode)&&void 0!==c&&c.gradient&&E(e.explicit,["encode","gradient"])),e}function wd(e,t){return"circle"===t.value?t:e}function kd(e){const t=e.component.legends,n={};for(const i of _(t)){const o=e.getScaleComponent(i),r=m(o.get("domains"));if(n[r])for(const e of n[r])xd(e,t[i])||n[r].push(t[i]);else n[r]=[t[i].clone()]}return C(n).flat().map((t=>function(e,t){var n;const{disable:i,labelExpr:o,selections:r,...a}=e.combine();if(!i){if(!1===t.aria&&null==a.aria&&(a.aria=!1),null!==(n=a.encode)&&void 0!==n&&n.symbols){const e=a.encode.symbols.update;!e.fill||"transparent"===e.fill.value||e.stroke||a.stroke||(e.stroke={value:"transparent"});for(const t of as)a[t]&&delete e[t]}if(a.title||delete a.title,void 0!==o){var s,c;let e=o;null!==(s=a.encode)&&void 0!==s&&null!==(c=s.labels)&&void 0!==c&&c.update&&pn(a.encode.labels.update.text)&&(e=R(o,"datum.label",a.encode.labels.update.text.signal)),function(e,t,n,i){var o,r,a,s,c;null!==(o=e.encode)&&void 0!==o||(e.encode={}),null!==(a=(r=e.encode)[t])&&void 0!==a||(r[t]={}),null!==(c=(s=e.encode[t]).update)&&void 0!==c||(s.update={}),e.encode[t].update.text=i}(a,"labels",0,{signal:e})}return a}}(t,e.config))).filter((e=>void 0!==e))}function Sd(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const o={signal:"[".concat(t.size.map((e=>e.signal)).join(", "),"]")},r=t.data.reduce(((t,n)=>{const i=pn(n)?n.signal:"data('".concat(e.lookupDataSource(n),"')");return v(t,i)||t.push(i),t}),[]);if(r.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:o,fit:{signal:r.length>1?"[".concat(r.join(", "),"]"):r[0]},...n}]}return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const Dd=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class Fd extends Mc{constructor(e,t,n,i){super({...t},{name:e}),this.specifiedProjection=t,this.size=n,this.data=i,Tn(this,"merged",!1)}get isFit(){return!!this.data}}function Od(e){e.component.projection=Xf(e)?function(e){if(e.hasProjection){var t;const n=un(e.specifiedProjection),i=!(n&&(null!=n.scale||null!=n.translate)),o=i?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=i?function(e){const t=[],{encoding:n}=e;for(const i of[[ue,le],[fe,de]])(na(n[i[0]])||na(n[i[1]]))&&t.push({signal:e.getName("geojson_".concat(t.length))});return e.channelHasField(he)&&e.typedFieldDef(he).type===Qi&&t.push({signal:e.getName("geojson_".concat(t.length))}),0===t.length&&t.push(e.requestDataName(Qc.Main)),t}(e):void 0,a=new Fd(e.projectionName(!0),{...null!==(t=un(e.config.projection))&&void 0!==t?t:{},...null!=n?n:{}},o,r);return a.get("type")||a.set("type","equalEarth",!1),a}}(e):function(e){if(0===e.children.length)return;let n;for(const t of e.children)Od(t);const i=b(e.children,(e=>{const i=e.component.projection;if(i){if(n){const e=function(e,n){const i=b(Dd,(i=>!t.hasOwnProperty(e.explicit,i)&&!t.hasOwnProperty(n.explicit,i)||!!(t.hasOwnProperty(e.explicit,i)&&t.hasOwnProperty(n.explicit,i)&&l(e.get(i),n.get(i)))));if(l(e.size,n.size)){if(i)return e;if(l(e.explicit,{}))return n;if(l(n.explicit,{}))return e}return null}(n,i);return e&&(n=e),!!e}return n=i,!0}return!0}));if(n&&i){const t=e.projectionName(!0),i=new Fd(t,n.specifiedProjection,n.size,u(n.data));for(const n of e.children){const e=n.component.projection;e&&(e.isFit&&i.data.push(...n.component.projection.data),n.renameProjection(e.get("name"),t),e.merged=!0)}return i}}(e)}function zd(e,t,n,i){if(da(t,n)){var o,r;const a=Xf(e)&&null!==(o=null!==(r=e.axis(n))&&void 0!==r?r:e.legend(n))&&void 0!==o?o:{},s=Gr(t,{expr:"datum"}),c=Gr(t,{expr:"datum",binSuffix:"end"});return{formulaAs:Gr(t,{binSuffix:"range",forAs:!0}),formula:gr(s,c,a.format,a.formatType,i)}}return{}}function _d(e,t){return"".concat(nn(e),"_").concat(t)}function Cd(e,t,n){var i;const o=_d(null!==(i=aa(n,void 0))&&void 0!==i?i:{},t);return e.getName("".concat(o,"_bins"))}function Nd(e,n,i){let o,r;o=function(e){return"as"in e}(e)?t.isString(e.as)?[e.as,"".concat(e.as,"_end")]:[e.as[0],e.as[1]]:[Gr(e,{forAs:!0}),Gr(e,{binSuffix:"end",forAs:!0})];const a={...aa(n,void 0)},s=_d(a,e.field),{signal:c,extentSignal:l}=function(e,t){return{signal:e.getName("".concat(t,"_bins")),extentSignal:e.getName("".concat(t,"_extent"))}}(i,s);if(sn(a.extent)){const e=a.extent;r=wu(i,e.param,e),delete a.extent}return{key:s,binComponent:{bin:a,field:e.field,as:[o],...c?{signal:c}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}}}}class Pd extends nl{clone(){return new Pd(null,u(this.bins))}constructor(e,t){super(e),this.bins=t}static makeFromEncoding(e,t){const n=t.reduceFieldDef(((e,n,i)=>{if(Wr(n)&&on(n.bin)){const{key:o,binComponent:r}=Nd(n,n.bin,t);e[o]={...r,...e[o],...zd(t,n,i,t.config)}}return e}),{});return z(n)?null:new Pd(e,n)}static makeFromTransform(e,t,n){const{key:i,binComponent:o}=Nd(t,t.bin,n);return new Pd(e,{[i]:o})}merge(e,t){for(const n of _(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=k([...this.bins[n].as,...e.bins[n].as],g)):this.bins[n]=e.bins[n];for(const t of e.children)e.removeChild(t),t.parent=this;e.remove()}producedFields(){return new Set(C(this.bins).map((e=>e.as)).flat(2))}dependentFields(){return new Set(C(this.bins).map((e=>e.field)))}hash(){return"Bin ".concat(g(this.bins))}assemble(){return C(this.bins).flatMap((e=>{const t=[],[n,...i]=e.as,{extent:o,...r}=e.bin,a={type:"bin",field:W(e.field),as:n,signal:e.signal,...sn(o)?{extent:null}:{extent:o},...e.span?{span:{signal:"span(".concat(e.span,")")}}:{},...r};!o&&e.extentSignal&&(t.push({type:"extent",field:W(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const e of i)for(let i=0;i<2;i++)t.push({type:"formula",expr:Gr({field:n[i]},{expr:"datum"}),as:e[i]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t}))}}function Ad(e,n,i,o){var r;const a=Xf(o)?o.encoding[tt(n)]:void 0;if(Wr(i)&&Xf(o)&&Cr(i,a,o.markDef,o.config))e.add(Gr(i,{})),e.add(Gr(i,{suffix:"end"})),i.bin&&da(i,n)&&e.add(Gr(i,{binSuffix:"range"}));else if(n in Ee){const t=function(e){switch(e){case le:return"y";case de:return"y2";case ue:return"x";case fe:return"x2"}}(n);e.add(o.getName(t))}else e.add(Gr(i));return Ur(i)&&function(e){return t.isObject(e)&&"field"in e}(null===(r=i.scale)||void 0===r?void 0:r.range)&&e.add(i.scale.range.field),e}class jd extends nl{clone(){return new jd(null,new Set(this.dimensions),u(this.measures))}constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}get groupBy(){return this.dimensions}static makeFromEncoding(e,t){let n=!1;t.forEachFieldDef((e=>{e.aggregate&&(n=!0)}));const i={},o=new Set;return n?(t.forEachFieldDef(((e,n)=>{const{aggregate:r,field:a}=e;if(r)if("count"===r){var s;null!==(s=i["*"])&&void 0!==s||(i["*"]={}),i["*"].count=new Set([Gr(e,{forAs:!0})])}else{if(Jt(r)||Qt(r)){var c;const e=Jt(r)?"argmin":"argmax",t=r[e];null!==(c=i[t])&&void 0!==c||(i[t]={}),i[t][e]=new Set([Gr({op:e,field:t},{forAs:!0})])}else{var l;null!==(l=i[a])&&void 0!==l||(i[a]={}),i[a][r]=new Set([Gr(e,{forAs:!0})])}var u;Bt(n)&&"unaggregated"===t.scaleDomain(n)&&(null!==(u=i[a])&&void 0!==u||(i[a]={}),i[a].min=new Set([Gr({field:a,aggregate:"min"},{forAs:!0})]),i[a].max=new Set([Gr({field:a,aggregate:"max"},{forAs:!0})]))}else Ad(o,n,e,t)})),o.size+_(i).length===0?null:new jd(e,o,i)):null}static makeFromTransform(e,t){const n=new Set,i={};for(const e of t.aggregate){const{op:t,field:n,as:a}=e;var o,r;t&&("count"===t?(null!==(o=i["*"])&&void 0!==o||(i["*"]={}),i["*"].count=new Set([a||Gr(e,{forAs:!0})])):(null!==(r=i[n])&&void 0!==r||(i[n]={}),i[n][t]=new Set([a||Gr(e,{forAs:!0})])))}for(const e of null!==(a=t.groupby)&&void 0!==a?a:[]){var a;n.add(e)}return n.size+_(i).length===0?null:new jd(e,n,i)}merge(e){return S(this.dimensions,e.dimensions)?(function(e,t){for(const i of _(t)){const o=t[i];for(const t of _(o)){var n;i in e?e[i][t]=new Set([...null!==(n=e[i][t])&&void 0!==n?n:[],...o[t]]):e[i]={[t]:o[t]}}}}(this.measures,e.measures),!0):(function(){gi.debug(...arguments)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,..._(this.measures)])}producedFields(){const e=new Set;for(const t of _(this.measures))for(const n of _(this.measures[t])){const i=this.measures[t][n];0===i.size?e.add("".concat(n,"_").concat(t)):i.forEach(e.add,e)}return e}hash(){return"Aggregate ".concat(g({dimensions:this.dimensions,measures:this.measures}))}assemble(){const e=[],t=[],n=[];for(const i of _(this.measures))for(const o of _(this.measures[i]))for(const r of this.measures[i][o])n.push(r),e.push(o),t.push("*"===i?null:W(i));return{type:"aggregate",groupby:[...this.dimensions].map(W),ops:e,fields:t,as:n}}}class Ed extends nl{constructor(e,n,i,o){super(e),this.model=n,this.name=i,this.data=o,Tn(this,"column",void 0),Tn(this,"row",void 0),Tn(this,"facet",void 0),Tn(this,"childModel",void 0);for(const e of We){const i=n.facet[e];if(i){const{bin:o,sort:r}=i;this[e]={name:n.getName("".concat(e,"_domain")),fields:[Gr(i),...on(o)?[Gr(i,{binSuffix:"end"})]:[]],...xr(r)?{sortField:r}:t.isArray(r)?{sortIndexField:Mu(i,e)}:{}}}}this.childModel=n.child}hash(){let e="Facet";for(const t of We)this[t]&&(e+=" ".concat(t.charAt(0),":").concat(g(this[t])));return e}get fields(){const e=[];for(const n of We){var t;null!==(t=this[n])&&void 0!==t&&t.fields&&e.push(...this[n].fields)}return e}dependentFields(){const e=new Set(this.fields);for(const t of We)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const t of St){const n=this.childModel.component.scales[t];if(n&&!n.merged){const i=n.get("type"),o=n.get("range");if(po(i)&&mn(o)){const n=Ff(Of(this.childModel,t));n?e[t]=n:hi(Bn(t))}}}return e}assembleRowColumnHeaderData(e,t,n){const i={row:"y",column:"x",facet:void 0}[e],o=[],r=[],a=[];i&&n&&n[i]&&(t?(o.push("distinct_".concat(n[i])),r.push("max")):(o.push(n[i]),r.push("distinct")),a.push("distinct_".concat(n[i])));const{sortField:s,sortIndexField:c}=this[e];if(s){const{op:e=hr,field:t}=s;o.push(t),r.push(e),a.push(Gr(s,{forAs:!0}))}else c&&(o.push(c),r.push("max"),a.push(c));return{name:this[e].name,source:null!=t?t:this.data,transform:[{type:"aggregate",groupby:this[e].fields,...o.length?{fields:o,ops:r,as:a}:{}}]}}assembleFacetHeaderData(e){const{columns:t}=this.model.layout,{layoutHeaders:n}=this.model.component,i=[],o={};for(const e of Ru){for(const t of Uu){var r;const i=null!==(r=n[e]&&n[e][t])&&void 0!==r?r:[];for(const t of i){var a;if((null===(a=t.axes)||void 0===a?void 0:a.length)>0){o[e]=!0;break}}}if(o[e]){const n='length(data("'.concat(this.facet.name,'"))'),o="row"===e?t?{signal:"ceil(".concat(n," / ").concat(t,")")}:1:t?{signal:"min(".concat(n,", ").concat(t,")")}:{signal:n};i.push({name:"".concat(this.facet.name,"_").concat(e),transform:[{type:"sequence",start:0,stop:o}]})}}const{row:s,column:c}=o;return(s||c)&&i.unshift(this.assembleRowColumnHeaderData("facet",null,e)),i}assemble(){const e=[];let t=null;const n=this.getChildIndependentFieldsWithStep(),{column:i,row:o,facet:r}=this;if(i&&o&&(n.x||n.y)){var a,s;t="cross_".concat(this.column.name,"_").concat(this.row.name);const i=[].concat(null!==(a=n.x)&&void 0!==a?a:[],null!==(s=n.y)&&void 0!==s?s:[]),o=i.map((()=>"distinct"));e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:i,ops:o}]})}for(const i of[$,Q])this[i]&&e.push(this.assembleRowColumnHeaderData(i,t,n));if(r){const t=this.assembleFacetHeaderData(n);t&&e.push(...t)}return e}}function Td(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Md(e){const n={};return s(e.filter,(e=>{if(Wi(e)){let o=null;if(Ai(e))o=xn(e.equal);else if(Ei(e))o=xn(e.lte);else if(ji(e))o=xn(e.lt);else if(Ti(e))o=xn(e.gt);else if(Mi(e))o=xn(e.gte);else if(Li(e))o=e.range[0];else if(qi(e)){var i;o=(null!==(i=e.oneOf)&&void 0!==i?i:e.in)[0]}o&&(vi(o)?n[e.field]="date":t.isNumber(o)?n[e.field]="number":t.isString(o)&&(n[e.field]="string")),e.timeUnit&&(n[e.field]="date")}})),n}function Ld(e){const n={};function i(e){var i;ca(e)?n[e.field]="date":"quantitative"===e.type&&(i=e.aggregate,t.isString(i)&&v(["min","max"],i))?n[e.field]="number":B(e.field)>1?e.field in n||(n[e.field]="flatten"):Ur(e)&&xr(e.sort)&&B(e.sort.field)>1&&(e.sort.field in n||(n[e.sort.field]="flatten"))}if((Xf(e)||Jf(e))&&e.forEachFieldDef(((t,n)=>{if(Wr(t))i(t);else{const o=Ze(n),r=e.fieldDef(o);i({...t,type:r.type})}})),Xf(e)){const{mark:t,markDef:i,encoding:o}=e;if(Io(t)&&!e.encoding.order){const e=o["horizontal"===i.orient?"y":"x"];jr(e)&&"quantitative"===e.type&&!(e.field in n)&&(n[e.field]="number")}}return n}class qd extends nl{clone(){return new qd(null,u(this._parse))}constructor(e,t){super(e),Tn(this,"_parse",void 0),this._parse=t}hash(){return"Parse ".concat(g(this._parse))}static makeExplicit(e,t,n){var i;let o={};const r=t.data;return!Gc(r)&&null!=r&&null!==(i=r.format)&&void 0!==i&&i.parse&&(o=r.format.parse),this.makeWithAncestors(e,o,{},n)}static makeWithAncestors(e,t,n,i){for(const e of _(n)){const t=i.getWithExplicit(e);void 0!==t.value&&(t.explicit||t.value===n[e]||"derived"===t.value||"flatten"===n[e]?delete n[e]:hi(Yn(e,n[e],t.value)))}for(const e of _(t)){const n=i.get(e);void 0!==n&&(n===t[e]?delete t[e]:hi(Yn(e,t[e],n)))}const o=new Mc(t,n);i.copyAll(o);const r={};for(const e of _(o.combine())){const t=o.get(e);null!==t&&(r[e]=t)}return 0===_(r).length||i.parseNothing?null:new qd(e,r)}get parse(){return this._parse}merge(e){this._parse={...this._parse,...e.parse},e.remove()}assembleFormatParse(){const e={};for(const t of _(this._parse)){const n=this._parse[t];1===B(t)&&(e[t]=n)}return e}producedFields(){return new Set(_(this._parse))}dependentFields(){return new Set(_(this._parse))}assembleTransforms(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return _(this._parse).filter((t=>!e||B(t)>1)).map((e=>{const t=function(e,t){const n=M(e);if("number"===t)return"toNumber(".concat(n,")");if("boolean"===t)return"toBoolean(".concat(n,")");if("string"===t)return"toString(".concat(n,")");if("date"===t)return"toDate(".concat(n,")");if("flatten"===t)return n;if(t.startsWith("date:")){const e=Td(t.slice(5,t.length));return"timeParse(".concat(n,",'").concat(e,"')")}if(t.startsWith("utc:")){const e=Td(t.slice(4,t.length));return"utcParse(".concat(n,",'").concat(e,"')")}return hi('Unrecognized parse "'.concat(t,'".')),null}(e,this._parse[e]);return t?{type:"formula",expr:t,as:U(e)}:null})).filter((e=>null!==e))}}class Wd extends nl{clone(){return new Wd(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([ss])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:ss}}}class Rd extends nl{clone(){return new Rd(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule ".concat(g(this.params))}assemble(){return{type:"graticule",...!0===this.params?{}:this.params}}}class Ud extends nl{clone(){return new Ud(null,this.params)}constructor(e,t){super(e),this.params=t}dependentFields(){return new Set}producedFields(){var e;return new Set([null!==(e=this.params.as)&&void 0!==e?e:"data"])}hash(){return"Hash ".concat(g(this.params))}assemble(){return{type:"sequence",...this.params}}}class Bd extends nl{constructor(e){var t;let n;if(super(null),Tn(this,"_data",void 0),Tn(this,"_name",void 0),Tn(this,"_generator",void 0),null!==(t=e)&&void 0!==t||(e={name:"source"}),Gc(e)||(n=e.format?{...p(e.format,["parse"])}:{}),Hc(e))this._data={values:e.values};else if(Ic(e)){if(this._data={url:e.url},!n.type){let t=/(?:\.([^.]+))?$/.exec(e.url)[1];v(["json","csv","tsv","dsv","topojson"],t)||(t="json"),n.type=t}}else Xc(e)?this._data={values:[{type:"Sphere"}]}:(Vc(e)||Gc(e))&&(this._data={});this._generator=Gc(e),e.name&&(this._name=e.name),n&&!z(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function Id(e){return e instanceof Bd||e instanceof Rd||e instanceof Ud}var Hd=new WeakMap;class Vd{constructor(){(function(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,{writable:!0,value:void 0})})(this,Hd),Mn(this,Hd,!1)}setModified(){Mn(this,Hd,!0)}get modifiedFlag(){return function(e,t){return t.get?t.get.call(e):t.value}(this,Ln(this,Hd,"get"))}}class Gd extends Vd{getNodeDepths(e,t,n){n.set(e,t);for(const i of e.children)this.getNodeDepths(i,t+1,n);return n}optimize(e){const t=[...this.getNodeDepths(e,0,new Map).entries()].sort(((e,t)=>t[1]-e[1]));for(const e of t)this.run(e[0]);return this.modifiedFlag}}class Yd extends Vd{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class Xd extends Yd{mergeNodes(e,t){const n=t.shift();for(const i of t)e.removeChild(i),i.parent=n,i.remove()}run(e){const t=e.children.map((e=>e.hash())),n={};for(let i=0;i1&&(this.setModified(),this.mergeNodes(e,n[t]))}}class Jd extends Yd{constructor(e){super(),Tn(this,"requiresSelectionId",void 0),this.requiresSelectionId=e&&mu(e)}run(e){e instanceof Wd&&(this.requiresSelectionId&&(Id(e.parent)||e.parent instanceof jd||e.parent instanceof qd)||(this.setModified(),e.remove()))}}class Qd extends Vd{optimize(e){return this.run(e,new Set),this.modifiedFlag}run(e,t){let n=new Set;e instanceof ol&&(n=e.producedFields(),D(n,t)&&(this.setModified(),e.removeFormulas(t),0===e.producedFields.length&&e.remove()));for(const i of e.children)this.run(i,new Set([...t,...n]))}}class $d extends Yd{constructor(){super()}run(e){e instanceof il&&!e.isRequired()&&(this.setModified(),e.remove())}}class Kd extends Gd{run(e){if(!(Id(e)||e.numChildren()>1))for(const t of e.children)if(t instanceof qd)if(e instanceof qd)this.setModified(),e.merge(t);else{if(O(e.producedFields(),t.dependentFields()))continue;this.setModified(),t.swapWithParent()}}}class Zd extends Gd{run(e){const t=[...e.children],n=e.children.filter((e=>e instanceof qd));if(e.numChildren()>1&&n.length>=1){const i={},o=new Set;for(const e of n){const t=e.parse;for(const e of _(t))e in i?i[e]!==t[e]&&o.add(e):i[e]=t[e]}for(const e of o)delete i[e];if(!z(i)){this.setModified();const n=new qd(e,i);for(const o of t){if(o instanceof qd)for(const e of _(i))delete o.parse[e];e.removeChild(o),o.parent=n,o instanceof qd&&0===_(o.parse).length&&o.remove()}}}}}class ef extends Gd{run(e){e instanceof il||e.numChildren()>0||e instanceof Ed||e instanceof Bd||(this.setModified(),e.remove())}}class tf extends Gd{run(e){const t=e.children.filter((e=>e instanceof ol)),n=t.pop();for(const e of t)this.setModified(),n.merge(e)}}class nf extends Gd{run(e){const t=e.children.filter((e=>e instanceof jd)),n={};for(const e of t){const t=g(e.groupBy);t in n||(n[t]=[]),n[t].push(e)}for(const t of _(n)){const i=n[t];if(i.length>1){const t=i.pop();for(const n of i)t.merge(n)&&(e.removeChild(n),n.parent=t,n.remove(),this.setModified())}}}}class of extends Gd{constructor(e){super(),this.model=e}run(e){const t=!(Id(e)||e instanceof bu||e instanceof qd||e instanceof Wd),n=[],i=[];for(const o of e.children)o instanceof Pd&&(t&&!O(e.producedFields(),o.dependentFields())?n.push(o):i.push(o));if(n.length>0){const t=n.pop();for(const e of n)t.merge(e,this.model.renameSignal.bind(this.model));this.setModified(),e instanceof Pd?e.merge(t,this.model.renameSignal.bind(this.model)):t.swapWithParent()}if(i.length>1){const e=i.pop();for(const t of i)e.merge(t,this.model.renameSignal.bind(this.model));this.setModified()}}}class rf extends Gd{run(e){const t=[...e.children];if(!y(t,(e=>e instanceof il))||e.numChildren()<=1)return;const n=[];let i;for(const o of t)if(o instanceof il){let t=o;for(;1===t.numChildren();){const[e]=t.children;if(!(e instanceof il))break;t=e}n.push(...t.children),i?(e.removeChild(o),o.parent=i.parent,i.parent.removeChild(i),i.parent=t,this.setModified()):i=t}else n.push(o);if(n.length){this.setModified();for(const e of n)e.parent.removeChild(e),e.parent=i}}}class af extends nl{clone(){return new af(null,u(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=k(this.transform.groupby.concat(e),(e=>e))}dependentFields(){const e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map((e=>e.field)).filter((e=>void 0!==e)).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Gr(e)}hash(){return"JoinAggregateTransform ".concat(g(this.transform))}assemble(){const e=[],t=[],n=[];for(const i of this.transform.joinaggregate)t.push(i.op),n.push(this.getDefaultName(i)),e.push(void 0===i.field?null:i.field);const i=this.transform.groupby;return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==i?{groupby:i}:{}}}}class sf extends nl{clone(){return new sf(null,u(this._stack))}constructor(e,t){super(e),Tn(this,"_stack",void 0),this._stack=t}static makeFromTransform(e,n){const{stack:i,groupby:o,as:r,offset:a="zero"}=n,s=[],c=[];if(void 0!==n.sort)for(const e of n.sort)s.push(e.field),c.push(I(e.order,"ascending"));const l={field:s,order:c};let u;return u=function(e){return t.isArray(e)&&e.every((e=>t.isString(e)))&&e.length>1}(r)?r:t.isString(r)?[r,"".concat(r,"_end")]:["".concat(n.stack,"_start"),"".concat(n.stack,"_end")],new sf(e,{dimensionFieldDefs:[],stackField:i,groupby:o,offset:a,sort:l,facetby:[],as:u})}static makeFromEncoding(e,n){const i=n.stack,{encoding:o}=n;if(!i)return null;const{groupbyChannels:r,fieldChannel:a,offset:s,impute:c}=i,l=r.map((e=>ta(o[e]))).filter((e=>!!e)),u=function(e){return e.stack.stackBy.reduce(((e,t)=>{const n=Gr(t.fieldDef);return n&&e.push(n),e}),[])}(n),d=n.encoding.order;let f;return f=t.isArray(d)||jr(d)?Pn(d):u.reduce(((e,t)=>(e.field.push(t),e.order.push("y"===a?"descending":"ascending"),e)),{field:[],order:[]}),new sf(e,{dimensionFieldDefs:l,stackField:n.vgField(a),facetby:[],stackby:u,sort:f,offset:s,impute:c,as:[n.vgField(a,{suffix:"start",forAs:!0}),n.vgField(a,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return"Stack ".concat(g(this._stack))}getGroupbyFields(){const{dimensionFieldDefs:e,impute:t,groupby:n}=this._stack;return e.length>0?e.map((e=>e.bin?t?[Gr(e,{binSuffix:"mid"})]:[Gr(e,{}),Gr(e,{binSuffix:"end"})]:[Gr(e)])).flat():null!=n?n:[]}assemble(){const e=[],{facetby:t,dimensionFieldDefs:n,stackField:i,stackby:o,sort:r,offset:a,impute:s,as:c}=this._stack;if(s)for(const r of n){const{bandPosition:n=.5,bin:a}=r;if(a){const t=Gr(r,{expr:"datum"}),i=Gr(r,{expr:"datum",binSuffix:"end"});e.push({type:"formula",expr:"".concat(n,"*").concat(t,"+").concat(1-n,"*").concat(i),as:Gr(r,{binSuffix:"mid",forAs:!0})})}e.push({type:"impute",field:i,groupby:[...o,...t],key:Gr(r,{binSuffix:"mid"}),method:"value",value:0})}return e.push({type:"stack",groupby:[...this.getGroupbyFields(),...t],field:i,sort:r,as:c,offset:a}),e}}class cf extends nl{clone(){return new cf(null,u(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){this.transform.groupby=k(this.transform.groupby.concat(e),(e=>e))}dependentFields(){var e,t;const n=new Set;return(null!==(e=this.transform.groupby)&&void 0!==e?e:[]).forEach(n.add,n),(null!==(t=this.transform.sort)&&void 0!==t?t:[]).forEach((e=>n.add(e.field))),this.transform.window.map((e=>e.field)).filter((e=>void 0!==e)).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!==(t=e.as)&&void 0!==t?t:Gr(e)}hash(){return"WindowTransform ".concat(g(this.transform))}assemble(){const e=[],t=[],n=[],i=[];for(const o of this.transform.window)t.push(o.op),n.push(this.getDefaultName(o)),i.push(void 0===o.param?null:o.param),e.push(void 0===o.field?null:o.field);const o=this.transform.frame,r=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&t.every((e=>$t(e))))return{type:"joinaggregate",as:n,ops:t,fields:e,...void 0!==r?{groupby:r}:{}};const a=[],s=[];if(void 0!==this.transform.sort)for(const e of this.transform.sort){var c;a.push(e.field),s.push(null!==(c=e.order)&&void 0!==c?c:"ascending")}const l={field:a,order:s},u=this.transform.ignorePeers;return{type:"window",params:i,as:n,ops:t,fields:e,sort:l,...void 0!==u?{ignorePeers:u}:{},...void 0!==r?{groupby:r}:{},...void 0!==o?{frame:o}:{}}}}function lf(e){if(e instanceof Ed)if(1!==e.numChildren()||e.children[0]instanceof il){const n=e.model.component.data.main;uf(n);const i=(t=e,function e(n){if(!(n instanceof Ed)){const i=n.clone();if(i instanceof il){const e=df+i.getSource();i.setSource(e),t.model.component.data.outputNodes[e]=i}else(i instanceof jd||i instanceof sf||i instanceof cf||i instanceof af)&&i.addDimensions(t.fields);for(const t of n.children.flatMap(e))t.parent=i;return[i]}return n.children.flatMap(e)}),o=e.children.map(i).flat();for(const e of o)e.parent=n}else{const t=e.children[0];(t instanceof jd||t instanceof sf||t instanceof cf||t instanceof af)&&t.addDimensions(e.fields),t.swapWithParent(),lf(e)}else e.children.map(lf);var t}function uf(e){if(e instanceof il&&e.type===Qc.Main&&1===e.numChildren()){const t=e.children[0];t instanceof Ed||(t.swapWithParent(),uf(e))}}const df="scale_";function ff(e){for(const t of e){for(const e of t.children)if(e.parent!==t)return!1;if(!ff(t.children))return!1}return!0}function pf(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function mf(e,t,n){let i=e.sources,o=!1;return o=pf(new $d,i)||o,o=pf(new Jd(t),i)||o,i=i.filter((e=>e.numChildren()>0)),o=pf(new ef,i)||o,i=i.filter((e=>e.numChildren()>0)),n||(o=pf(new Kd,i)||o,o=pf(new of(t),i)||o,o=pf(new Qd,i)||o,o=pf(new Zd,i)||o,o=pf(new nf,i)||o,o=pf(new tf,i)||o,o=pf(new Xd,i)||o,o=pf(new rf,i)||o),e.sources=i,o}class gf{constructor(e){Tn(this,"signal",void 0),Object.defineProperty(this,"signal",{enumerable:!0,get:e})}static fromName(e,t){return new gf((()=>e(t)))}}function hf(e){Xf(e)?function(e){const t=e.component.scales;for(const n of _(t)){const i=vf(e,n);if(t[n].setWithExplicit("domains",i),wf(e,n),e.component.data.isFaceted){let t=e;for(;!Jf(t)&&t.parent;)t=t.parent;if("shared"===t.component.resolve.scale[n])for(const e of i.value)gn(e)&&(e.data=df+e.data.replace(df,""))}}}(e):function(e){for(const t of e.children)hf(t);const t=e.component.scales;for(const n of _(t)){let i,o=null;for(const t of e.children){const e=t.component.scales[n];if(e){i=void 0===i?e.getWithExplicit("domains"):Uc(i,e.getWithExplicit("domains"),"domains","scale",Sf);const t=e.get("selectionExtent");o&&t&&o.param!==t.param&&hi("The same selection must be used to override scale domains in a layered view."),o=t}}t[n].setWithExplicit("domains",i),o&&t[n].set("selectionExtent",o,!0)}}(e)}function vf(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,o=function(e,t,n,i){if("unaggregated"===e){const{valid:e,reason:i}=kf(t,n);if(!e)return void hi(i)}else if(void 0===e&&i.useUnaggregatedDomain){const{valid:e}=kf(t,n);if(e)return"unaggregated"}return e}(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return o!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:o}),"x"===t&&na(i.x2)?na(i.x)?Uc(bf(n,o,e,"x"),bf(n,o,e,"x2"),"domain","scale",Sf):bf(n,o,e,"x2"):"y"===t&&na(i.y2)?na(i.y)?Uc(bf(n,o,e,"y"),bf(n,o,e,"y2"),"domain","scale",Sf):bf(n,o,e,"y2"):bf(n,o,e,t)}function yf(e,t,n){var i;const o=null===(i=Pi(n))||void 0===i?void 0:i.unit;return"temporal"===t||o?function(e,t,n){return e.map((e=>{const i=la(e,{timeUnit:n,type:t});return{signal:"{data: ".concat(i,"}")}}))}(e,t,o):[e]}function bf(e,n,i,o){const{encoding:r}=i,a=na(r[o]),{type:s}=a,c=a.timeUnit;if(function(e){return null==e?void 0:e.unionWith}(n)){const t=bf(e,void 0,i,o),r=yf(n.unionWith,s,c);return Lc([...t.value,...r])}if(pn(n))return Lc([n]);if(n&&"unaggregated"!==n&&!vo(n))return Lc(yf(n,s,c));const l=i.stack;if(l&&o===l.fieldChannel){if("normalize"===l.offset)return qc([[0,1]]);const e=i.requestDataName(Qc.Main);return qc([{data:e,field:i.vgField(o,{suffix:"start"})},{data:e,field:i.vgField(o,{suffix:"end"})}])}const u=Bt(o)&&jr(a)?function(e,t,n){if(!po(n))return;const i=e.fieldDef(t),o=i.sort;if(wr(o))return{op:"min",field:Mu(i,t),order:"ascending"};const{stack:r}=e,a=r?new Set([...r.groupbyFields,...r.stackBy.map((e=>e.fieldDef.field))]):void 0;if(xr(o))return xf(o,r&&!a.has(o.field));if(br(o)){const{encoding:t,order:n}=o,i=e.fieldDef(t),{aggregate:s,field:c}=i,l=r&&!a.has(c);if(Jt(s)||Qt(s))return xf({field:Gr(i),order:n},l);if($t(s)||!s)return xf({op:s,field:c,order:n},l)}else{if("descending"===o)return{op:"min",field:e.vgField(t),order:"descending"};if(v(["ascending",void 0],o))return!0}}(i,o,e):void 0;if(Tr(a))return qc(yf([a.datum],s,c));const d=a;if("unaggregated"===n){const e=i.requestDataName(Qc.Main),{field:t}=a;return qc([{data:e,field:Gr({field:t,aggregate:"min"})},{data:e,field:Gr({field:t,aggregate:"max"})}])}if(on(d.bin)){if(po(e))return qc("bin-ordinal"===e?[]:[{data:P(u)?i.requestDataName(Qc.Main):i.requestDataName(Qc.Raw),field:i.vgField(o,da(d,o)?{binSuffix:"range"}:{}),sort:!0!==u&&t.isObject(u)?u:{field:i.vgField(o,{}),op:"min"}}]);{const{bin:e}=d;if(on(e)){const t=Cd(i,d.field,e);return qc([new gf((()=>{const e=i.getSignalName(t);return"[".concat(e,".start, ").concat(e,".stop]")}))])}return qc([{data:i.requestDataName(Qc.Main),field:i.vgField(o,{})}])}}if(d.timeUnit&&v(["time","utc"],e)&&Cr(d,Xf(i)?i.encoding[tt(o)]:void 0,i.markDef,i.config)){const e=i.requestDataName(Qc.Main);return qc([{data:e,field:i.vgField(o)},{data:e,field:i.vgField(o,{suffix:"end"})}])}return qc(u?[{data:P(u)?i.requestDataName(Qc.Main):i.requestDataName(Qc.Raw),field:i.vgField(o),sort:u}]:[{data:i.requestDataName(Qc.Main),field:i.vgField(o)}])}function xf(e,t){const{op:n,field:i,order:o}=e;return{op:null!=n?n:t?"sum":hr,...i?{field:W(i)}:{},...o?{order:o}:{}}}function wf(e,t){var n;const i=e.component.scales[t],o=e.specifiedScales[t].domain,r=null===(n=e.fieldDef(t))||void 0===n?void 0:n.bin,a=vo(o)&&o,s=an(r)&&sn(r.extent)&&r.extent;(a||s)&&i.set("selectionExtent",null!=a?a:s,!0)}function kf(e,n){const{aggregate:i,type:o}=e;return i?t.isString(i)&&!tn.has(i)?{valid:!1,reason:ai(i)}:"quantitative"===o&&"log"===n?{valid:!1,reason:si(e)}:{valid:!0}:{valid:!1,reason:ri(e)}}function Sf(e,t,n,i){return e.explicit&&t.explicit&&hi(function(e,t,n,i){return"Conflicting ".concat(t.toString(),' property "').concat(e.toString(),'" (').concat(m(n)," and ").concat(m(i),"). Using the union of the two domains.")}(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function Df(e){const n=k(e.map((e=>{if(gn(e)){const{sort:t,...n}=e;return n}return e})),g),i=k(e.map((e=>{if(gn(e)){const t=e.sort;return void 0===t||P(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}})).filter((e=>void 0!==e)),g);if(0===n.length)return;if(1===n.length){const n=e[0];if(gn(n)&&i.length>0){let e=i[0];if(i.length>1)hi(ui),e=!0;else if(t.isObject(e)&&"field"in e){const t=e.field;n.field===t&&(e=!e.order||{order:e.order})}return{...n,sort:e}}return n}const o=k(i.map((e=>P(e)||!("op"in e)||t.isString(e.op)&&e.op in Xt?e:(hi(function(e){return"Dropping sort property ".concat(m(e),' as unioned domains only support boolean or op "count", "min", and "max".')}(e)),!0))),g);let r;1===o.length?r=o[0]:o.length>1&&(hi(ui),r=!0);const a=k(e.map((e=>gn(e)?e.data:null)),(e=>e));return 1===a.length&&null!==a[0]?{data:a[0],fields:n.map((e=>e.field)),...r?{sort:r}:{}}:{fields:n,...r?{sort:r}:{}}}function Ff(e){if(gn(e)&&t.isString(e.field))return e.field;if(function(e){return!t.isArray(e)&&"fields"in e&&!("data"in e)}(e)){let n;for(const i of e.fields)if(gn(i)&&t.isString(i.field))if(n){if(n!==i.field)return hi("Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect."),n}else n=i.field;return hi("Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect."),n}if(function(e){return!t.isArray(e)&&"fields"in e&&"data"in e}(e)){hi("Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.");const n=e.fields[0];return t.isString(n)?n:void 0}}function Of(e,t){const n=e.component.scales[t].get("domains").map((t=>(gn(t)&&(t.data=e.lookupDataSource(t.data)),t)));return Df(n)}function zf(e){return $f(e)||Qf(e)?e.children.reduce(((e,t)=>e.concat(zf(t))),_f(e)):_f(e)}function _f(e){return _(e.component.scales).reduce(((n,i)=>{const o=e.component.scales[i];if(o.merged)return n;const r=o.combine(),{name:a,type:s,selectionExtent:c,domains:l,range:u,reverse:d,...f}=r,p=function(e,n,i,o){if(Dt(i)){if(mn(e))return{step:{signal:"".concat(n,"_step")}}}else if(t.isObject(e)&&gn(e))return{...e,data:o.lookupDataSource(e.data)};return e}(r.range,a,i,e),m=Of(e,i),g=c?function(e,n,i,o){const r=wu(e,n.param,n);return{signal:mo(i.get("type"))&&t.isArray(o)&&o[0]>o[1]?"isValid(".concat(r,") && reverse(").concat(r,")"):r}}(e,c,o,m):null;return n.push({name:a,type:s,...m?{domain:m}:{},...g?{domainRaw:g}:{},range:p,...void 0!==d?{reverse:d}:{},...f}),n}),[])}class Cf extends Mc{constructor(e,t){super({},{name:e}),Tn(this,"merged",!1),this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||y(this.get("domains"),(e=>t.isArray(e)&&2===e.length&&e[0]<=0&&e[1]>=0))}}const Nf=["range","scheme"];function Pf(e,n){const i=e.fieldDef(n);if(null!=i&&i.bin){const{bin:o,field:r}=i,a=nt(n),s=e.getName(a);if(t.isObject(o)&&o.binned&&void 0!==o.step)return new gf((()=>{const t=e.scaleName(n),i='(domain("'.concat(t,'")[1] - domain("').concat(t,'")[0]) / ').concat(o.step);return"".concat(e.getSignalName(s)," / (").concat(i,")")}));if(on(o)){const t=Cd(e,r,o);return new gf((()=>{const n=e.getSignalName(t),i="(".concat(n,".stop - ").concat(n,".start) / ").concat(n,".step");return"".concat(e.getSignalName(s)," / (").concat(i,")")}))}}}function Af(e,n){const i=n.specifiedScales[e],{size:o}=n,r=n.getScaleComponent(e).get("type");for(const o of Nf)if(void 0!==i[o]){const a=Oo(r,o),s=zo(e,o);if(a)if(s)hi(s);else switch(o){case"range":{const o=i.range;if(t.isArray(o)){if(Dt(e))return Lc(o.map((e=>{if("width"===e||"height"===e){const t=n.getName(e),i=n.getSignalName.bind(n);return gf.fromName(i,t)}return e})))}else if(t.isObject(o))return Lc({data:n.requestDataName(Qc.Main),field:o.field,sort:{op:"min",field:n.vgField(e)}});return Lc(o)}case"scheme":return Lc(jf(i[o]))}else hi(ci(r,o,e))}const a=e===Z||"xOffset"===e?"width":"height",s=o[a];if(vs(s))if(Dt(e))if(po(r)){const t=Ef(s,n,e);if(t)return Lc({step:t})}else hi(li(a));else if(Ct(e)){const t=e===ie?"x":"y";if("band"===n.getScaleComponent(t).get("type")){const e=Tf(s,r);if(e)return Lc(e)}}const{rangeMin:c,rangeMax:l}=i,u=function(e,n){const{size:i,config:o,mark:r,encoding:a}=n,s=n.getSignalName.bind(n),{type:c}=na(a[e]),l=n.getScaleComponent(e).get("type"),{domain:u,domainMid:f}=n.specifiedScales[e];switch(e){case Z:case ee:{if(v(["point","band"],l)){const t=Mf(e,i,o.view);if(vs(t))return{step:Ef(t,n,e)}}const t=nt(e),r=n.getName(t);return e===ee&&mo(l)?[gf.fromName(s,r),0]:[0,gf.fromName(s,r)]}case ie:case oe:return function(e,t,n){const i=e===ie?"x":"y",o=t.getScaleComponent(i).get("type"),r=t.scaleName(i);if("band"===o){const e=Mf(i,t.size,t.config.view);if(vs(e)){const t=Tf(e,n);if(t)return t}return[0,{signal:"bandwidth('".concat(r,"')")}]}return d("Cannot use ".concat(e," scale if ").concat(i," scale is not discrete."))}(e,n,l);case ve:{const a=Lf(r,n.component.scales[e].get("zero"),o),s=function(e,n,i,o){const r={x:Pf(i,"x"),y:Pf(i,"y")};switch(e){case"bar":case"tick":{if(void 0!==o.scale.maxBandSize)return o.scale.maxBandSize;const e=Wf(n,r,o.view);return t.isNumber(e)?e-1:new gf((()=>"".concat(e.signal," - 1")))}case"line":case"trail":case"rule":return o.scale.maxStrokeWidth;case"text":return o.scale.maxFontSize;case"point":case"square":case"circle":{if(o.scale.maxSize)return o.scale.maxSize;const e=Wf(n,r,o.view);return t.isNumber(e)?Math.pow(qf*e,2):new gf((()=>"pow(".concat(qf," * ").concat(e.signal,", 2)")))}}throw new Error(ei("size",e))}(r,i,n,o);return ho(l)?function(e,t,n){const i=()=>{const i=Dn(t),o=Dn(e),r="(".concat(i," - ").concat(o,") / (").concat(n," - 1)");return"sequence(".concat(o,", ").concat(i," + ").concat(r,", ").concat(r,")")};return pn(t)?new gf(i):{signal:i()}}(a,s,function(e,n,i,o){switch(e){case"quantile":return n.scale.quantileCount;case"quantize":return n.scale.quantizeCount;case"threshold":return void 0!==i&&t.isArray(i)?i.length+1:(hi(function(e){return"Domain for ".concat(e," is required for threshold scale.")}(o)),3)}}(l,o,u,e)):[a,s]}case se:return[0,2*Math.PI];case ye:return[0,360];case re:return[0,new gf((()=>{const e=n.getSignalName("width"),t=n.getSignalName("height");return"min(".concat(e,",").concat(t,")/2")}))];case ke:return[o.scale.minStrokeWidth,o.scale.maxStrokeWidth];case Se:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case he:return"symbol";case pe:case me:case ge:return"ordinal"===l?"nominal"===c?"category":"ordinal":void 0!==f?"diverging":"rect"===r||"geoshape"===r?"heatmap":"ramp";case be:case xe:case we:return[o.scale.minOpacity,o.scale.maxOpacity]}}(e,n);return(void 0!==c||void 0!==l)&&Oo(r,"rangeMin")&&t.isArray(u)&&2===u.length?Lc([null!=c?c:u[0],null!=l?l:u[1]]):qc(u)}function jf(e){return function(e){return!t.isString(e)&&!!e.name}(e)?{scheme:e.name,...p(e,["name"])}:{scheme:e}}function Ef(e,n,i){const{encoding:o}=n,r=n.getScaleComponent(i),a=it(i),s=o[a];if("offset"===hs({step:e,offsetIsDiscrete:qr(s)&&Vi(s.type)})&&Sa(o,a)){var c;const i=n.getScaleComponent(a),o=n.scaleName(a);let s="domain('".concat(o,"').length");if("band"===i.get("type")){var l,u,d,f;const e=null!==(l=null!==(u=i.get("paddingInner"))&&void 0!==u?u:i.get("padding"))&&void 0!==l?l:0,t=null!==(d=null!==(f=i.get("paddingOuter"))&&void 0!==f?f:i.get("padding"))&&void 0!==d?d:0;s="bandspace(".concat(s,", ").concat(e,", ").concat(t,")")}const m=null!==(c=r.get("paddingInner"))&&void 0!==c?c:r.get("padding");return{signal:"".concat(e.step," * ").concat(s," / (1-").concat((p=m,pn(p)?p.signal:t.stringValue(p)),")")}}return e.step;var p}function Tf(e,t){if("offset"===hs({step:e,offsetIsDiscrete:po(t)}))return{step:e.step}}function Mf(e,t,n){const i=e===Z?"width":"height";return t[i]||ks(n,i)}function Lf(e,t,n){if(t)return pn(t)?{signal:"".concat(t.signal," ? 0 : ").concat(Lf(e,!1,n))}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(ei("size",e))}const qf=.95;function Wf(e,t,n){const i=vs(e.width)?e.width.step:ws(n,"width"),o=vs(e.height)?e.height.step:ws(n,"height");return t.x||t.y?new gf((()=>{const e=[t.x?t.x.signal:i,t.y?t.y.signal:o];return"min(".concat(e.join(", "),")")})):Math.min(i,o)}function Rf(e,t){Xf(e)?function(e,t){const n=e.component.scales,{config:i,encoding:o,markDef:r,specifiedScales:a}=e;for(const s of _(n)){const c=a[s],l=n[s],u=e.getScaleComponent(s),d=na(o[s]),f=c[t],p=u.get("type"),m=u.get("padding"),g=u.get("paddingInner"),h=Oo(p,t),v=zo(s,t);if(void 0!==f&&(h?v&&hi(v):hi(ci(p,t,s))),h&&void 0===v)if(void 0!==f){const e=d.timeUnit,n=d.type;switch(t){case"domainMax":case"domainMin":vi(c[t])||"temporal"===n||e?l.set(t,{signal:la(c[t],{type:n,timeUnit:e})},!0):l.set(t,c[t],!0);break;default:l.copyKeyFromObject(t,c)}}else{const n=t in Uf?Uf[t]({model:e,channel:s,fieldOrDatumDef:d,scaleType:p,scalePadding:m,scalePaddingInner:g,domain:c.domain,domainMin:c.domainMin,domainMax:c.domainMax,markDef:r,config:i,hasNestedOffsetScale:Da(o,s)}):i.scale[t];void 0!==n&&l.set(t,n,!1)}}}(e,t):If(e,t)}const Uf={bins:e=>{let{model:t,fieldOrDatumDef:n}=e;return jr(n)?function(e,t){const n=t.bin;if(on(n)){const i=Cd(e,t.field,n);return new gf((()=>e.getSignalName(i)))}if(rn(n)&&an(n)&&void 0!==n.step)return{step:n.step}}(t,n):void 0},interpolate:e=>{let{channel:t,fieldOrDatumDef:n}=e;return function(e,t){if(v([pe,me,ge],e)&&"nominal"!==t)return"hcl"}(t,n.type)},nice:e=>{let{scaleType:n,channel:i,domain:o,domainMin:r,domainMax:a,fieldOrDatumDef:s}=e;return function(e,n,i,o,r,a){var s;if(!(null!==(s=ta(a))&&void 0!==s&&s.bin||t.isArray(i)||null!=r||null!=o||v([Ki,Zi],e)))return!!Dt(n)||void 0}(n,i,o,r,a,s)},padding:e=>{let{channel:t,scaleType:n,fieldOrDatumDef:i,markDef:o,config:r}=e;return function(e,t,n,i,o,r){if(Dt(e)){if(go(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;const{type:t,orient:a}=o;if("bar"===t&&(!jr(i)||!i.bin&&!i.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return r.continuousBandSize}if(t===eo)return n.pointPadding}}(t,n,r.scale,i,o,r.bar)},paddingInner:e=>{let{scalePadding:t,channel:n,markDef:i,scaleType:o,config:r,hasNestedOffsetScale:a}=e;return function(e,t,n,i,o){let r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0===e){if(Dt(t)){const{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:i,bandWithNestedOffsetPaddingInner:a}=o;return r?a:I(e,"bar"===n?t:i)}return Ct(t)&&i===to?o.offsetBandPaddingInner:void 0}}(t,n,i.type,o,r.scale,a)},paddingOuter:e=>{let{scalePadding:t,channel:n,scaleType:i,scalePaddingInner:o,config:r,hasNestedOffsetScale:a}=e;return function(e,t,n,i,o){let r=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(void 0===e)if(Dt(t)){const{bandPaddingOuter:e,bandWithNestedOffsetPaddingOuter:t}=o;if(r)return t;if(n===to)return I(e,pn(i)?{signal:"".concat(i.signal,"/2")}:i/2)}else if(Ct(t)){if(n===eo)return.5;if(n===to)return o.offsetBandPaddingOuter}}(t,n,i,o,r.scale,a)},reverse:e=>{let{fieldOrDatumDef:t,scaleType:n,channel:i,config:o}=e;return function(e,t,n,i){return"x"===n&&void 0!==i.xReverse?mo(e)&&"descending"===t?pn(i.xReverse)?{signal:"!".concat(i.xReverse.signal)}:!i.xReverse:i.xReverse:!(!mo(e)||"descending"!==t)||void 0}(n,jr(t)?t.sort:void 0,i,o.scale)},zero:e=>{let{channel:n,fieldOrDatumDef:i,domain:o,markDef:r,scaleType:a}=e;return function(e,n,i,o,r){if(i&&"unaggregated"!==i&&mo(r)){if(t.isArray(i)){const e=i[0],t=i[i.length-1];if(e<=0&&t>=0)return!0}return!1}if("size"===e&&"quantitative"===n.type&&!ho(r))return!0;if((!jr(n)||!n.bin)&&v([...St,...Ot],e)){const{orient:t,type:n}=o;return!v(["bar","area","line","trail"],n)||!("horizontal"===t&&"y"===e||"vertical"===t&&"x"===e)}return!1}(n,i,o,r,a)}};function Bf(e){Xf(e)?function(e){const t=e.component.scales;for(const n of Ut){const i=t[n];if(!i)continue;const o=Af(n,e);i.setWithExplicit("range",o)}}(e):If(e,"range")}function If(e,t){const n=e.component.scales;for(const n of e.children)"range"===t?Bf(n):Rf(n,t);for(const i of _(n)){let o;for(const n of e.children){const e=n.component.scales[i];e&&(o=Uc(o,e.getWithExplicit(t),t,"scale",Wc(((e,n)=>"range"===t&&e.step&&n.step?e.step-n.step:0))))}n[i].setWithExplicit(t,o)}}function Hf(e,t,n,i){const o=function(e,t,n,i){switch(t.type){case"nominal":case"ordinal":var o;if(Le(e)||"discrete"===Gt(e))return"shape"===e&&"ordinal"===t.type&&hi(oi(e,"ordinal")),"ordinal";if(Dt(e)||Ct(e)){if(v(["rect","bar","image","rule"],n.type))return"band";if(i)return"band"}else if("arc"===n.type&&e in Ft)return"band";return Qo(n[nt(e)])||Br(t)&&null!==(o=t.axis)&&void 0!==o&&o.tickBand?"band":"point";case"temporal":return Le(e)?"time":"discrete"===Gt(e)?(hi(oi(e,"temporal")),"ordinal"):jr(t)&&t.timeUnit&&Pi(t.timeUnit).utc?"utc":"time";case"quantitative":return Le(e)?jr(t)&&on(t.bin)?"bin-ordinal":"linear":"discrete"===Gt(e)?(hi(oi(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error($n(t.type))}(t,n,i,arguments.length>4&&void 0!==arguments[4]&&arguments[4]),{type:r}=e;return Bt(t)?void 0!==r?function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Bt(e))return!1;switch(e){case Z:case ee:case ie:case oe:case se:case re:return!!go(t)||"band"===t||"point"===t&&!n;case ve:case ke:case be:case xe:case we:case ye:return go(t)||ho(t)||v(["band","point","ordinal"],t);case pe:case me:case ge:return"band"!==t;case Se:case he:return"ordinal"===t||ho(t)}}(t,r)?jr(n)&&!function(e,t){return v([Yi,Ji],t)?void 0===e||po(e):t===Xi?v([Ki,Zi,void 0],e):t!==Gi||co(e)||ho(e)||void 0===e}(r,n.type)?(hi(function(e,t){return'FieldDef does not work with "'.concat(e,'" scale. We are using "').concat(t,'" scale instead.')}(r,o)),o):r:(hi(function(e,t,n){return'Channel "'.concat(e,'" does not work with "').concat(t,'" scale. We are using "').concat(n,'" scale instead.')}(t,r,o)),o):o:null}function Vf(e){Xf(e)?e.component.scales=function(e){const{encoding:t,mark:n,markDef:i}=e,o={};for(const a of Ut){const s=na(t[a]);if(s&&n===Bo&&a===he&&s.type===Qi)continue;let c=s&&s.scale;if(!Ct(a)||Da(t,ot(a))){if(s&&null!==c&&!1!==c){var r;null!==(r=c)&&void 0!==r||(c={});const n=Hf(c,a,s,i,Da(t,a));o[a]=new Cf(e.scaleName("".concat(a),!0),{value:n,explicit:c.type===n})}}else c&&hi(ti(a))}return o}(e):e.component.scales=function(e){const t=e.component.scales={},n={},i=e.component.resolve;for(const t of e.children){Vf(t);for(const a of _(t.component.scales)){var o,r;if(null!==(r=(o=i.scale)[a])&&void 0!==r||(o[a]=od(a,e)),"shared"===i.scale[a]){const e=n[a],o=t.component.scales[a].getWithExplicit("type");e?io(e.value,o.value)?n[a]=Uc(e,o,"type","scale",Gf):(i.scale[a]="independent",delete n[a]):n[a]=o}}}for(const i of _(n)){const o=e.scaleName(i,!0),r=n[i];t[i]=new Cf(o,r);for(const t of e.children){const e=t.component.scales[i];e&&(t.renameScale(e.get("name"),o),e.merged=!0)}}return t}(e)}const Gf=Wc(((e,t)=>ro(e)-ro(t)));class Yf{constructor(){Tn(this,"nameMap",void 0),this.nameMap={}}rename(e,t){this.nameMap[e]=t}has(e){return void 0!==this.nameMap[e]}get(e){for(;this.nameMap[e]&&e!==this.nameMap[e];)e=this.nameMap[e];return e}}function Xf(e){return"unit"===(null==e?void 0:e.type)}function Jf(e){return"facet"===(null==e?void 0:e.type)}function Qf(e){return"concat"===(null==e?void 0:e.type)}function $f(e){return"layer"===(null==e?void 0:e.type)}class Kf{constructor(e,n,i,o,r,a,s){var l,d;this.type=n,this.parent=i,this.config=r,Tn(this,"name",void 0),Tn(this,"size",void 0),Tn(this,"title",void 0),Tn(this,"description",void 0),Tn(this,"data",void 0),Tn(this,"transforms",void 0),Tn(this,"layout",void 0),Tn(this,"scaleNameMap",void 0),Tn(this,"projectionNameMap",void 0),Tn(this,"signalNameMap",void 0),Tn(this,"component",void 0),Tn(this,"view",void 0),Tn(this,"children",void 0),Tn(this,"correctDataNames",(e=>{var t,n,i;return null!==(t=e.from)&&void 0!==t&&t.data&&(e.from.data=this.lookupDataSource(e.from.data)),null!==(n=e.from)&&void 0!==n&&null!==(i=n.facet)&&void 0!==i&&i.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e})),this.parent=i,this.config=r,this.view=un(s),this.name=null!==(l=e.name)&&void 0!==l?l:o,this.title=fn(e.title)?{text:e.title}:e.title?un(e.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Yf,this.projectionNameMap=i?i.projectionNameMap:new Yf,this.signalNameMap=i?i.signalNameMap:new Yf,this.data=e.data,this.description=e.description,this.transforms=(null!==(d=e.transform)&&void 0!==d?d:[]).map((e=>rc(e)?{filter:c(e.filter,Ii)}:e)),this.layout="layer"===n||"unit"===n?{}:function(e,n,i){const o=i[n],r={},{spacing:a,columns:s}=o;void 0!==a&&(r.spacing=a),void 0!==s&&(Dr(e)&&!kr(e.facet)||ps(e))&&(r.columns=s),ms(e)&&(r.columns=1);for(const n of bs)if(void 0!==e[n])if("spacing"===n){var c,l;const i=e[n];r[n]=t.isNumber(i)?i:{row:null!==(c=i.row)&&void 0!==c?c:a,column:null!==(l=i.column)&&void 0!==l?l:a}}else r[n]=e[n];return r}(e,n,r),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:Dr(e)||(null==i?void 0:i.component.data.isFaceted)&&void 0===e.data},layoutSize:new Mc,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...a?u(a):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function(e){let{ignoreRange:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Vf(e),hf(e);for(const t of Fo)Rf(e,t);t||Bf(e)}(this)}parseProjection(){Od(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){vd(this)}assembleEncodeFromView(e){const{style:t,...n}=e,i={};for(const e of _(n)){const t=n[e];void 0!==t&&(i[e]=kn(t))}return i}assembleGroupEncodeEntry(e){let t={};var n;return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=kn(this.description)),"unit"!==this.type&&"layer"!==this.type)?z(t)?void 0:t:{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...null!==(n=t)&&void 0!==n?n:{}}}assembleLayout(){if(!this.layout)return;const{spacing:e,...t}=this.layout,{component:n,config:i}=this,o=function(e,t){const n={};for(const i of We){const o=e[i];if(null!=o&&o.facetFieldDef){const{titleAnchor:e,titleOrient:r}=Wu(["titleAnchor","titleOrient"],o.facetFieldDef.header,t,i),a=Lu(i,r),s=Qu(e,a);void 0!==s&&(n[a]=s)}}return z(n)?void 0:n}(n.layoutHeaders,i);return{padding:e,...this.assembleDefaultLayout(),...t,...o?{titleBand:o}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:e}=this.component;let t=[];for(const n of We)e[n].title&&t.push(Bu(this,n));for(const e of Ru)t=t.concat(Vu(this,e));return t}assembleAxes(){return function(e,t){const{x:n=[],y:i=[]}=e;return[...n.map((e=>Fu(e,"grid",t))),...i.map((e=>Fu(e,"grid",t))),...n.map((e=>Fu(e,"main",t))),...i.map((e=>Fu(e,"main",t)))].filter((e=>e))}(this.component.axes,this.config)}assembleLegends(){return kd(this)}assembleProjections(){return function(e){return $f(e)||Qf(e)?function(e){return e.children.reduce(((e,t)=>e.concat(t.assembleProjections())),Sd(e))}(e):Sd(e)}(this)}assembleTitle(){var e;const{encoding:t,...n}=null!==(e=this.title)&&void 0!==e?e:{},i={...dn(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};var o,r;if(i.text)return v(["unit","layer"],this.type)?v(["middle",void 0],i.anchor)&&(null!==(o=i.frame)&&void 0!==o||(i.frame="group")):null!==(r=i.anchor)&&void 0!==r||(i.anchor="start"),z(i)?void 0:i}assembleGroup(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={};e=e.concat(this.assembleSignals()),e.length>0&&(t.signals=e);const n=this.assembleLayout();n&&(t.layout=n),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const i=!this.parent||Jf(this.parent)?zf(this):[];i.length>0&&(t.scales=i);const o=this.assembleAxes();o.length>0&&(t.axes=o);const r=this.assembleLegends();return r.length>0&&(t.legends=r),t}getName(e){return A((this.name?"".concat(this.name,"_"):"")+e)}getDataName(e){return this.getName(Qc[e].toLowerCase())}requestDataName(e){const t=this.getDataName(e),n=this.component.data.outputNodeRefCounts;return n[t]=(n[t]||0)+1,t}getSizeSignalRef(e){if(Jf(this.parent)){const t=zt(nd(e)),n=this.component.scales[t];if(n&&!n.merged){const e=n.get("type"),i=n.get("range");if(po(e)&&mn(i)){const e=n.get("name"),i=Ff(Of(this,t));return i?{signal:td(e,n,Gr({aggregate:"distinct",field:i},{expr:"datum"}))}:(hi(Bn(t)),null)}}}return{signal:this.signalNameMap.get(this.getName(e))}}lookupDataSource(e){const t=this.component.data.outputNodes[e];return t?t.getSource():e}getSignalName(e){return this.signalNameMap.get(e)}renameSignal(e,t){this.signalNameMap.rename(e,t)}renameScale(e,t){this.scaleNameMap.rename(e,t)}renameProjection(e,t){this.projectionNameMap.rename(e,t)}scaleName(e,t){return t?this.getName(e):Qe(e)&&Bt(e)&&this.component.scales[e]||this.scaleNameMap.has(this.getName(e))?this.scaleNameMap.get(this.getName(e)):void 0}projectionName(e){return e?this.getName("projection"):this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection"))?this.projectionNameMap.get(this.getName("projection")):void 0}getScaleComponent(e){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const t=this.component.scales[e];return t&&!t.merged?t:this.parent?this.parent.getScaleComponent(e):void 0}getSelectionComponent(e,t){let n=this.component.selection[e];if(!n&&this.parent&&(n=this.parent.getSelectionComponent(e,t)),!n)throw new Error(function(e){return'Cannot find a selection named "'.concat(e,'".')}(t));return n}hasAxisOrientSignalRef(){var e,t;return(null===(e=this.component.axes.x)||void 0===e?void 0:e.some((e=>e.hasOrientSignalRef())))||(null===(t=this.component.axes.y)||void 0===t?void 0:t.some((e=>e.hasOrientSignalRef())))}}class Zf extends Kf{vgField(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.fieldDef(e);if(n)return Gr(n,t)}reduceFieldDef(e,n){return function(e,n,i,o){return e?_(e).reduce(((i,r)=>{const a=e[r];return t.isArray(a)?a.reduce(((e,t)=>n.call(o,e,t,r)),i):n.call(o,i,a,r)}),i):i}(this.getMapping(),((t,n,i)=>{const o=ta(n);return o?e(t,o,i):t}),n)}forEachFieldDef(e,t){Na(this.getMapping(),((t,n)=>{const i=ta(t);i&&e(i,n)}),t)}}class ep extends nl{clone(){return new ep(null,u(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=u(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:"value",null!==(o=r[1])&&void 0!==o?o:"density"],t.groupby&&null==t.minsteps&&null==t.maxsteps&&null==t.steps&&(this.transform.steps=200)}dependentFields(){var e;return new Set([this.transform.density,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"DensityTransform ".concat(g(this.transform))}assemble(){const{density:e,...t}=this.transform;return{type:"kde",field:e,...t}}}class tp extends nl{clone(){return new tp(null,{...this.filter})}constructor(e,t){super(e),this.filter=t}static make(e,t){const{config:n,mark:i,markDef:o}=t;if("filter"!==zn("invalid",o,n))return null;const r=t.reduceFieldDef(((e,n,o)=>{const r=Bt(o)&&t.getScaleComponent(o);return r&&mo(r.get("type"))&&"count"!==n.aggregate&&!Io(i)&&(e[n.field]=n),e}),{});return _(r).length?new tp(e,r):null}dependentFields(){return new Set(_(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid ".concat(g(this.filter))}assemble(){const e=_(this.filter).reduce(((e,t)=>{const n=this.filter[t],i=Gr(n,{expr:"datum"});return null!==n&&("temporal"===n.type?e.push("(isDate(".concat(i,") || (isValid(").concat(i,") && isFinite(+").concat(i,")))")):"quantitative"===n.type&&(e.push("isValid(".concat(i,")")),e.push("isFinite(+".concat(i,")")))),e}),[]);return e.length>0?{type:"filter",expr:e.join(" && ")}:null}}class np extends nl{clone(){return new np(this.parent,u(this.transform))}constructor(e,t){super(e),this.transform=t,this.transform=u(t);const{flatten:n,as:i=[]}=this.transform;this.transform.as=n.map(((e,t)=>{var n;return null!==(n=i[t])&&void 0!==n?n:e}))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform ".concat(g(this.transform))}assemble(){const{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class ip extends nl{clone(){return new ip(null,u(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=u(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:"key",null!==(o=r[1])&&void 0!==o?o:"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform ".concat(g(this.transform))}assemble(){const{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class op extends nl{clone(){return new op(null,u(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const i of[[ue,le],[fe,de]]){const o=i.map((e=>{const n=na(t.encoding[e]);return jr(n)?n.field:Tr(n)?{expr:"".concat(n.datum)}:Rr(n)?{expr:"".concat(n.value)}:void 0}));(o[0]||o[1])&&(e=new op(e,o,null,t.getName("geojson_".concat(n++))))}if(t.channelHasField(he)){const i=t.typedFieldDef(he);i.type===Qi&&(e=new op(e,null,i.field,t.getName("geojson_".concat(n++))))}return e}constructor(e,t,n,i){super(e),this.fields=t,this.geojson=n,this.signal=i}dependentFields(){var e;const n=(null!==(e=this.fields)&&void 0!==e?e:[]).filter(t.isString);return new Set([...this.geojson?[this.geojson]:[],...n])}producedFields(){return new Set}hash(){return"GeoJSON ".concat(this.geojson," ").concat(this.signal," ").concat(g(this.fields))}assemble(){return[...this.geojson?[{type:"filter",expr:'isValid(datum["'.concat(this.geojson,'"])')}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class rp extends nl{clone(){return new rp(null,this.projection,u(this.fields),u(this.as))}constructor(e,t,n,i){super(e),this.projection=t,this.fields=n,this.as=i}static parseAll(e,t){if(!t.projectionName())return e;for(const n of[[ue,le],[fe,de]]){const i=n.map((e=>{const n=na(t.encoding[e]);return jr(n)?n.field:Tr(n)?{expr:"".concat(n.datum)}:Rr(n)?{expr:"".concat(n.value)}:void 0})),o=n[0]===fe?"2":"";(i[0]||i[1])&&(e=new rp(e,t.projectionName(),i,[t.getName("x".concat(o)),t.getName("y".concat(o))]))}return e}dependentFields(){return new Set(this.fields.filter(t.isString))}producedFields(){return new Set(this.as)}hash(){return"Geopoint ".concat(this.projection," ").concat(g(this.fields)," ").concat(g(this.as))}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class ap extends nl{clone(){return new ap(null,u(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:i}=e,o=[t,n,...i?[i]:[]].join(",");return{signal:"sequence(".concat(o,")")}}static makeFromTransform(e,t){return new ap(e,t)}static makeFromEncoding(e,t){const n=t.encoding,i=n.x,o=n.y;if(jr(i)&&jr(o)){const r=i.impute?i:o.impute?o:void 0;if(void 0===r)return;const a=i.impute?o:o.impute?i:void 0,{method:s,value:c,frame:l,keyvals:u}=r.impute,d=Pa(t.mark,n);return new ap(e,{impute:r.field,key:a.field,...s?{method:s}:{},...void 0!==c?{value:c}:{},...l?{frame:l}:{},...void 0!==u?{keyvals:u}:{},...d.length?{groupby:d}:{}})}return null}hash(){return"Impute ".concat(g(this.transform))}assemble(){const{impute:e,key:t,keyvals:n,method:i,groupby:o,value:r,frame:a=[null,null]}=this.transform,s={type:"impute",field:e,key:t,...n?{keyvals:(c=n,void 0!==(null==c?void 0:c.stop)?this.processSequence(n):n)}:{},method:"value",...o?{groupby:o}:{},value:i&&"value"!==i?null:r};var c;return i&&"value"!==i?[s,{type:"window",as:["imputed_".concat(e,"_value")],ops:[i],fields:[e],frame:a,ignorePeers:!1,...o?{groupby:o}:{}},{type:"formula",expr:"datum.".concat(e," === null ? datum.imputed_").concat(e,"_value : datum.").concat(e),as:e}]:[s]}}class sp extends nl{clone(){return new sp(null,u(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=u(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:t.on,null!==(o=r[1])&&void 0!==o?o:t.loess]}dependentFields(){var e;return new Set([this.transform.loess,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"LoessTransform ".concat(g(this.transform))}assemble(){const{loess:e,on:t,...n}=this.transform;return{type:"loess",x:t,y:e,...n}}}class cp extends nl{clone(){return new cp(null,u(this.transform),this.secondary)}constructor(e,t,n){super(e),this.transform=t,this.secondary=n}static make(e,t,n,i){const o=t.component.data.sources,{from:r}=n;let a=null;if(function(e){return"data"in e}(r)){let e=Sp(r.data,o);e||(e=new Bd(r.data),o.push(e));const n=t.getName("lookup_".concat(i));a=new il(e,n,Qc.Lookup,t.component.data.outputNodeRefCounts),t.component.data.outputNodes[n]=a}else if(function(e){return"param"in e}(r)){const e=r.param;let i;n={as:e,...n};try{i=t.getSelectionComponent(A(e),e)}catch(t){throw new Error(function(e){return'Lookups can only be performed on selection parameters. "'.concat(e,'" is a variable parameter.')}(e))}if(a=i.materialized,!a)throw new Error(function(e){return'Cannot define and lookup the "'.concat(e,'" selection in the same view. ')+"Try moving the lookup into a second, layered view?"}(e))}return new cp(e,n,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?t.array(this.transform.as):this.transform.from.fields)}hash(){return"Lookup ".concat(g({transform:this.transform,secondary:this.secondary}))}assemble(){let e;if(this.transform.from.fields)e={values:this.transform.from.fields,...this.transform.as?{as:t.array(this.transform.as)}:{}};else{let n=this.transform.as;t.isString(n)||(hi('If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'),n="_lookup"),e={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...e,...this.transform.default?{default:this.transform.default}:{}}}}class lp extends nl{clone(){return new lp(null,u(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=u(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:"prob",null!==(o=r[1])&&void 0!==o?o:"value"]}dependentFields(){var e;return new Set([this.transform.quantile,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"QuantileTransform ".concat(g(this.transform))}assemble(){const{quantile:e,...t}=this.transform;return{type:"quantile",field:e,...t}}}class up extends nl{clone(){return new up(null,u(this.transform))}constructor(e,t){var n,i,o;super(e),this.transform=t,this.transform=u(t);const r=null!==(n=this.transform.as)&&void 0!==n?n:[void 0,void 0];this.transform.as=[null!==(i=r[0])&&void 0!==i?i:t.on,null!==(o=r[1])&&void 0!==o?o:t.regression]}dependentFields(){var e;return new Set([this.transform.regression,this.transform.on,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}producedFields(){return new Set(this.transform.as)}hash(){return"RegressionTransform ".concat(g(this.transform))}assemble(){const{regression:e,on:t,...n}=this.transform;return{type:"regression",x:t,y:e,...n}}}class dp extends nl{clone(){return new dp(null,u(this.transform))}constructor(e,t){super(e),this.transform=t}addDimensions(e){var t;this.transform.groupby=k((null!==(t=this.transform.groupby)&&void 0!==t?t:[]).concat(e),(e=>e))}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!==(e=this.transform.groupby)&&void 0!==e?e:[]])}hash(){return"PivotTransform ".concat(g(this.transform))}assemble(){const{pivot:e,value:t,groupby:n,limit:i,op:o}=this.transform;return{type:"pivot",field:e,value:t,...void 0!==i?{limit:i}:{},...void 0!==o?{op:o}:{},...void 0!==n?{groupby:n}:{}}}}class fp extends nl{clone(){return new fp(null,u(this.transform))}constructor(e,t){super(e),this.transform=t}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform ".concat(g(this.transform))}assemble(){return{type:"sample",size:this.transform.sample}}}function pp(e){let t=0;return function n(i,o){var r;if(i instanceof Bd&&!i.isGenerator&&!Ic(i.data)&&(e.push(o),o={name:null,source:o.name,transform:[]}),i instanceof qd&&(i.parent instanceof Bd&&!o.source?(o.format={...null!==(r=o.format)&&void 0!==r?r:{},parse:i.assembleFormatParse()},o.transform.push(...i.assembleTransforms(!0))):o.transform.push(...i.assembleTransforms())),i instanceof Ed)return o.name||(o.name="data_".concat(t++)),!o.source||o.transform.length>0?(e.push(o),i.data=o.name):i.data=o.source,void e.push(...i.assemble());switch((i instanceof Rd||i instanceof Ud||i instanceof tp||i instanceof bu||i instanceof Tu||i instanceof rp||i instanceof jd||i instanceof cp||i instanceof cf||i instanceof af||i instanceof ip||i instanceof np||i instanceof ep||i instanceof sp||i instanceof lp||i instanceof up||i instanceof Wd||i instanceof fp||i instanceof dp)&&o.transform.push(i.assemble()),(i instanceof Pd||i instanceof ol||i instanceof ap||i instanceof sf||i instanceof op)&&o.transform.push(...i.assemble()),i instanceof il&&(o.source&&0===o.transform.length?i.setSource(o.source):i.parent instanceof il?i.setSource(o.name):(o.name||(o.name="data_".concat(t++)),i.setSource(o.name),1===i.numChildren()&&(e.push(o),o={name:null,source:o.name,transform:[]}))),i.numChildren()){case 0:i instanceof il&&(!o.source||o.transform.length>0)&&e.push(o);break;case 1:n(i.children[0],o);break;default:{o.name||(o.name="data_".concat(t++));let r=o.name;!o.source||o.transform.length>0?e.push(o):r=o.source;for(const e of i.children)n(e,{name:null,source:r,transform:[]});break}}}}function mp(e){return"top"===e||"left"===e||pn(e)?"header":"footer"}function gp(e,n){const{facet:i,config:o,child:r,component:a}=e;if(e.channelHasField(n)){var s;const c=i[n],l=qu("title",null,o,n);let u=$r(c,o,{allowDisabling:!0,includeDefault:void 0===l||!!l});r.component.layoutHeaders[n].title&&(u=t.isArray(u)?u.join(", "):u,u+=" / ".concat(r.component.layoutHeaders[n].title),r.component.layoutHeaders[n].title=null);const d=qu("labelOrient",c.header,o,n),f=null!==c.header&&I(null===(s=c.header)||void 0===s?void 0:s.labels,o.header.labels,!0),p=v(["bottom","right"],d)?"footer":"header";a.layoutHeaders[n]={title:null!==c.header?u:null,facetFieldDef:c,[p]:"facet"===n?[]:[hp(e,n,f)]}}}function hp(e,t,n){const i="row"===t?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function vp(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:o,resolve:r}=e.component;if(r.axis[t]=rd(r,t),"shared"===r.axis[t]){const r="x"===t?"column":"row",a=o[r];for(const o of n.component.axes[t]){var i;const t=mp(o.get("orient"));null!==(i=a[t])&&void 0!==i||(a[t]=[hp(e,r,!1)]);const n=Fu(o,"main",e.config,{header:!0});n&&a[t][0].axes.push(n),o.mainExtracted=!0}}}}function yp(e){for(const t of e.children)t.parseLayoutSize()}function bp(e,t){const n=nd(t),i=zt(n),o=e.component.resolve,r=e.component.layoutSize;let a;for(const t of e.children){var s;const r=t.component.layoutSize.getWithExplicit(n),c=null!==(s=o.scale[i])&&void 0!==s?s:od(i,e);if("independent"===c&&"step"===r.value){a=void 0;break}if(a){if("independent"===c&&a.value!==r.value){a=void 0;break}a=Uc(a,r,n,"")}else a=r}if(a){for(const i of e.children)e.renameSignal(i.getName(n),e.getName(t)),i.component.layoutSize.set(n,"merged",!1);r.setWithExplicit(t,a)}else r.setWithExplicit(t,{explicit:!1,value:void 0})}function xp(e,t){const n="width"===t?"x":"y",i=e.config,o=e.getScaleComponent(n);if(o){const e=o.get("type"),n=o.get("range");if(po(e)){const e=ks(i.view,t);return mn(n)||vs(e)?"step":e}return xs(i.view,t)}if(e.hasProjection||"arc"===e.mark)return xs(i.view,t);{const e=ks(i.view,t);return vs(e)?e.step:e}}function wp(e,t,n){return Gr(t,{suffix:"by_".concat(Gr(e)),...null!=n?n:{}})}class kp extends Zf{constructor(e,t,n,i){super(e,"facet",t,n,i,e.resolve),Tn(this,"facet",void 0),Tn(this,"child",void 0),Tn(this,"children",void 0),this.child=Jp(e.spec,this,this.getName("child"),void 0,i),this.children=[this.child],this.facet=this.initFacet(e.facet)}initFacet(e){if(!kr(e))return{facet:this.initFacetFieldDef(e,"facet")};const t=_(e),n={};for(const i of t){if(![Q,$].includes(i)){hi(ei(i,"facet"));break}const t=e[i];if(void 0===t.field){hi(Zn(t,i));break}n[i]=this.initFacetFieldDef(t,i)}return n}initFacetFieldDef(e,t){const n=ra(e,t);return n.header?n.header=un(n.header):null===n.header&&(n.header=null),n}channelHasField(e){return!!this.facet[e]}fieldDef(e){return this.facet[e]}parseData(){this.component.data=Dp(this),this.child.parseData()}parseLayoutSize(){yp(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),function(e){for(const t of We)gp(e,t);vp(e,"x"),vp(e,"y")}(this)}assembleSelectionTopLevelSignals(e){return this.child.assembleSelectionTopLevelSignals(e)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(e){return this.child.assembleSelectionData(e)}getHeaderLayoutMixins(){const e={};for(const o of We)for(const r of Uu){const a=this.component.layoutHeaders[o],s=a[r],{facetFieldDef:c}=a;if(c){const n=qu("titleOrient",c.header,this.config,o);if(["right","bottom"].includes(n)){var t;const i=Lu(o,n);null!==(t=e.titleAnchor)&&void 0!==t||(e.titleAnchor={}),e.titleAnchor[i]="end"}}if(null!=s&&s[0]){const t="row"===o?"height":"width",s="header"===r?"headerBand":"footerBand";var n,i;"facet"===o||this.child.component.layoutSize.get(t)||(null!==(n=e[s])&&void 0!==n||(e[s]={}),e[s][o]=.5),a.title&&(null!==(i=e.offset)&&void 0!==i||(e.offset={}),e.offset["row"===o?"rowTitle":"columnTitle"]=10)}}return e}assembleDefaultLayout(){const{column:e,row:t}=this.facet,n=e?this.columnDistinctSignal():t?1:void 0;let i="all";return(t||"independent"!==this.component.resolve.scale.x)&&(e||"independent"!==this.component.resolve.scale.y)||(i="none"),{...this.getHeaderLayoutMixins(),...n?{columns:n}:{},bounds:"full",align:i}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof kp)){const e=this.getName("column_domain");return{signal:"length(data('".concat(e,"'))")}}}assembleGroupStyle(){}assembleGroup(e){return this.parent&&this.parent instanceof kp?{...this.channelHasField("column")?{encode:{update:{columns:{field:Gr(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(e)}:super.assembleGroup(e)}getCardinalityAggregateForChild(){const e=[],t=[],n=[];if(this.child instanceof kp){if(this.child.channelHasField("column")){const i=Gr(this.child.facet.column);e.push(i),t.push("distinct"),n.push("distinct_".concat(i))}}else for(const i of St){const o=this.child.component.scales[i];if(o&&!o.merged){const r=o.get("type"),a=o.get("range");if(po(r)&&mn(a)){const o=Ff(Of(this.child,i));o?(e.push(o),t.push("distinct"),n.push("distinct_".concat(o))):hi(Bn(i))}}}return{fields:e,ops:t,as:n}}assembleFacet(){const{name:e,data:n}=this.component.data.facetRoot,{row:i,column:o}=this.facet,{fields:r,ops:a,as:s}=this.getCardinalityAggregateForChild(),c=[];for(const e of We){const n=this.facet[e];if(n){c.push(Gr(n));const{bin:l,sort:u}=n;if(on(l)&&c.push(Gr(n,{binSuffix:"end"})),xr(u)){const{field:e,op:t=hr}=u,c=wp(n,u);i&&o?(r.push(c),a.push("max"),s.push(c)):(r.push(e),a.push(t),s.push(c))}else if(t.isArray(u)){const t=Mu(n,e);r.push(t),a.push("max"),s.push(t)}}}const l=!!i&&!!o;return{name:e,data:n,groupby:c,...l||r.length>0?{aggregate:{...l?{cross:l}:{},...r.length?{fields:r,ops:a,as:s}:{}}}:{}}}facetSortFields(e){const{facet:n}=this,i=n[e];return i?xr(i.sort)?[wp(i,i.sort,{expr:"datum"})]:t.isArray(i.sort)?[Mu(i,e,{expr:"datum"})]:[Gr(i,{expr:"datum"})]:[]}facetSortOrder(e){const{facet:n}=this,i=n[e];if(i){const{sort:e}=i;return[(xr(e)?e.order:!t.isArray(e)&&e)||"ascending"]}return[]}assembleLabelTitle(){const{facet:e,config:t}=this;if(e.facet)return Yu(e.facet,"facet",t);const n={row:["top","bottom"],column:["left","right"]};for(const o of Ru)if(e[o]){var i;const r=qu("labelOrient",null===(i=e[o])||void 0===i?void 0:i.header,t,o);if(n[o].includes(r))return Yu(e[o],o,t)}}assembleMarks(){const{child:e}=this,t=function(e){const t=[],n=pp(t);for(const t of e.children)n(t,{source:e.name,name:null,transform:[]});return t}(this.component.data.facetRoot),n=e.assembleGroupEncodeEntry(!1),i=this.assembleLabelTitle()||e.assembleTitle(),o=e.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...i?{title:i}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:We.map((e=>this.facetSortFields(e))).flat(),order:We.map((e=>this.facetSortOrder(e))).flat()},...t.length>0?{data:t}:{},...n?{encode:{update:n}}:{},...e.assembleGroup(Zc(this,[]))}]}getMapping(){return this.facet}}function Sp(e,t){for(const a of t){var n,i,o,r;const t=a.data;if(e.name&&a.hasName()&&e.name!==a.dataName)continue;const s=null===(n=e.format)||void 0===n?void 0:n.mesh,c=null===(i=t.format)||void 0===i?void 0:i.feature;if(s&&c)continue;const u=null===(o=e.format)||void 0===o?void 0:o.feature;if((u||c)&&u!==c)continue;const d=null===(r=t.format)||void 0===r?void 0:r.mesh;if(!s&&!d||s===d)if(Hc(e)&&Hc(t)){if(l(e.values,t.values))return a}else if(Ic(e)&&Ic(t)){if(e.url===t.url)return a}else if(Vc(e)&&e.name===a.dataName)return a}return null}function Dp(e){var t,n,i;let o=function(e,t){if(e.data||!e.parent){if(null===e.data){const e=new Bd({values:[]});return t.push(e),e}const n=Sp(e.data,t);if(n)return Gc(e.data)||(n.data.format=x({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const n=new Bd(e.data);return t.push(n),n}}return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}(e,e.component.data.sources);const{outputNodes:r,outputNodeRefCounts:a}=e.component.data,s=e.data,c=s&&(Gc(s)||Ic(s)||Hc(s))||!e.parent?new Bc:e.parent.component.data.ancestorParse.clone();Gc(s)?(Yc(s)?o=new Ud(o,s.sequence):Jc(s)&&(o=new Rd(o,s.graticule)),c.parseNothing=!0):null===(null==s||null===(t=s.format)||void 0===t?void 0:t.parse)&&(c.parseNothing=!0),o=null!==(n=qd.makeExplicit(o,e,c))&&void 0!==n?n:o,o=new Wd(o);const l=e.parent&&$f(e.parent);var u;(Xf(e)||Jf(e))&&l&&(o=null!==(u=Pd.makeFromEncoding(o,e))&&void 0!==u?u:o),e.transforms.length>0&&(o=function(e,t,n){let i=0;for(const a of t.transforms){let s,c;if(hc(a))c=e=new Tu(e,a),s="derived";else if(rc(a)){var o;const i=Md(a);c=e=null!==(o=qd.makeWithAncestors(e,{},i,n))&&void 0!==o?o:e,e=new bu(e,t,a.filter)}else if(vc(a))c=e=Pd.makeFromTransform(e,a,t),s="number";else if(bc(a))s="date",void 0===n.getWithExplicit(a.field).value&&(e=new qd(e,{[a.field]:s}),n.set(a.field,s,!1)),c=e=ol.makeFromTransform(e,a);else if(xc(a))c=e=jd.makeFromTransform(e,a),s="number",mu(t)&&(e=new Wd(e));else if(ac(a))c=e=cp.make(e,t,a,i++),s="derived";else if(pc(a))c=e=new cf(e,a),s="number";else if(mc(a))c=e=new af(e,a),s="number";else if(wc(a))c=e=sf.makeFromTransform(e,a),s="derived";else if(kc(a))c=e=new ip(e,a),s="derived";else if(gc(a))c=e=new np(e,a),s="derived";else if(sc(a))c=e=new dp(e,a),s="derived";else if(fc(a))e=new fp(e,a);else if(yc(a))c=e=ap.makeFromTransform(e,a),s="derived";else if(cc(a))c=e=new ep(e,a),s="derived";else if(lc(a))c=e=new lp(e,a),s="derived";else if(uc(a))c=e=new up(e,a),s="derived";else{if(!dc(a)){hi("Ignoring an invalid transform: ".concat(m(a),"."));continue}c=e=new sp(e,a),s="derived"}if(c&&void 0!==s)for(const e of null!==(r=c.producedFields())&&void 0!==r?r:[]){var r;n.set(e,s,!1)}}return e}(o,e,c));const d=function(e){const t={};if(Xf(e)&&e.component.selection)for(const n of _(e.component.selection)){const i=e.component.selection[n];for(const e of i.project.items)!e.channel&&B(e.field)>1&&(t[e.field]="flatten")}return t}(e),f=Ld(e);var p,g;o=null!==(i=qd.makeWithAncestors(o,{},{...d,...f},c))&&void 0!==i?i:o,Xf(e)&&(o=op.parseAll(o,e),o=rp.parseAll(o,e)),(Xf(e)||Jf(e))&&(l||(o=null!==(g=Pd.makeFromEncoding(o,e))&&void 0!==g?g:o),o=null!==(p=ol.makeFromEncoding(o,e))&&void 0!==p?p:o,o=Tu.parseAllForSortIndex(o,e));const h=e.getDataName(Qc.Raw),v=new il(o,h,Qc.Raw,a);if(r[h]=v,o=v,Xf(e)){var y,b;const t=jd.makeFromEncoding(o,e);t&&(o=t,mu(e)&&(o=new Wd(o))),o=null!==(y=ap.makeFromEncoding(o,e))&&void 0!==y?y:o,o=null!==(b=sf.makeFromEncoding(o,e))&&void 0!==b?b:o}var w;Xf(e)&&(o=null!==(w=tp.make(o,e))&&void 0!==w?w:o);const k=e.getDataName(Qc.Main),S=new il(o,k,Qc.Main,a);r[k]=S,o=S,Xf(e)&&function(e,t){for(const[i,o]of N(null!==(n=e.component.selection)&&void 0!==n?n:{})){var n;const r=e.getName("lookup_".concat(i));e.component.data.outputNodes[r]=o.materialized=new il(new bu(t,e,{param:i}),r,Qc.Lookup,e.component.data.outputNodeRefCounts)}}(e,S);let D=null;if(Jf(e)){var F;const t=e.getName("facet");o=null!==(F=function(e,t){const{row:n,column:i}=t;if(n&&i){let t=null;for(const o of[n,i])if(xr(o.sort)){const{field:n,op:i=hr}=o.sort;e=t=new af(e,{joinaggregate:[{op:i,field:n,as:wp(o,o.sort,{forAs:!0})}],groupby:[Gr(o)]})}return t}return null}(o,e.facet))&&void 0!==F?F:o,D=new Ed(o,e,t,S.getSource()),r[t]=D}return{...e.component.data,outputNodes:r,outputNodeRefCounts:a,raw:v,main:S,facetRoot:D,ancestorParse:c}}class Fp extends Kf{constructor(e,t,n,i){var o,r,a,s;super(e,"concat",t,n,i,e.resolve),Tn(this,"children",void 0),"shared"!==(null===(o=e.resolve)||void 0===o||null===(r=o.axis)||void 0===r?void 0:r.x)&&"shared"!==(null===(a=e.resolve)||void 0===a||null===(s=a.axis)||void 0===s?void 0:s.y)||hi("Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415)."),this.children=this.getChildren(e).map(((e,t)=>Jp(e,this,this.getName("concat_".concat(t)),void 0,i)))}parseData(){this.component.data=Dp(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of _(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return ms(e)?e.vconcat:gs(e)?e.hconcat:e.concat}parseLayoutSize(){!function(e){yp(e);const t=1===e.layout.columns?"width":"childWidth",n=void 0===e.layout.columns?"height":"childHeight";bp(e,t),bp(e,n)}(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.forEach((e=>e.assembleSignals())),[]}assembleLayoutSignals(){const e=Ku(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleMarks(){return this.children.map((e=>{const t=e.assembleTitle(),n=e.assembleGroupStyle(),i=e.assembleGroupEncodeEntry(!1);return{type:"group",name:e.getName("group"),...t?{title:t}:{},...n?{style:n}:{},...i?{encode:{update:i}}:{},...e.assembleGroup()}}))}assembleGroupStyle(){}assembleDefaultLayout(){const e=this.layout.columns;return{...null!=e?{columns:e}:{},bounds:"full",align:"each"}}}const Op={disable:1,gridScale:1,scale:1,...ha,labelExpr:1,encode:1},zp=_(Op);class _p extends Mc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new _p(u(this.explicit),u(this.implicit),this.mainExtracted)}hasAxisPart(e){return!("axis"!==e&&("grid"===e||"title"===e?!this.get(e):!1===(t=this.get(e))||null===t));var t}hasOrientSignalRef(){return pn(this.explicit.orient)}}const Cp={bottom:"top",top:"bottom",left:"right",right:"left"};function Np(e,t){if(!e)return t.map((e=>e.clone()));{if(e.length!==t.length)return;const n=e.length;for(let i=0;i{switch(n){case"title":return En(e,t);case"gridScale":return{explicit:e.explicit,value:I(e.value,t.value)}}return Rc(e,t,n,"axis")}));e.setWithExplicit(n,i)}return e}function Ap(e,t,n,i,o){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(pn(n.labelAngle)?n.labelAngle:X(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===Eu(i,o))return!0}return e===n[t]}const jp=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function Ep(e,t){var n,i,o,r,a;let s=t.axis(e);const c=new _p,l=na(t.encoding[e]),{mark:u,config:d}=t,f=(null===(n=s)||void 0===n?void 0:n.orient)||(null===(i=d["x"===e?"axisX":"axisY"])||void 0===i?void 0:i.orient)||(null===(o=d.axis)||void 0===o?void 0:o.orient)||function(e){return"x"===e?"bottom":"left"}(e),p=t.getScaleComponent(e).get("type"),m=function(e,t,n,i){const o="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:co(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],r="x"===e?"axisX":"axisY",a=pn(n)?"axisOrient":"axis".concat(T(n)),s=[...o,...o.map((e=>r+e.substr(4)))],c=["axis",a,r];return{vlOnlyAxisConfig:zu(s,i,e,n),vgAxisConfig:zu(c,i,e,n),axisConfigStyle:_u([...c,...s],i)}}(e,p,f,t.config),g=void 0!==s?!s:Cu("disable",d.style,null===(r=s)||void 0===r?void 0:r.style,m).configValue;if(c.set("disable",g,void 0!==s),g)return c;s=s||{};const h=function(e,t,n,i,o){const r=null==t?void 0:t.labelAngle;if(void 0!==r)return pn(r)?r:X(r);{const{configValue:r}=Cu("labelAngle",i,null==t?void 0:t.style,o);return void 0!==r?X(r):n!==Z||!v([Ji,Yi],e.type)||jr(e)&&e.timeUnit?void 0:270}}(l,s,e,d.style,m),y={fieldOrDatumDef:l,axis:s,channel:e,model:t,scaleType:p,orient:f,labelAngle:h,mark:u,config:d};for(const n of zp){const i=n in Nu?Nu[n](y):ya(n)?s[n]:void 0,o=void 0!==i,r=Ap(i,n,s,t,e);if(o&&r)c.set(n,i,r);else{const{configValue:e,configFrom:t}=ya(n)&&"values"!==n?Cu(n,d.style,s.style,m):{},a=void 0!==e;o&&!a?c.set(n,i,r):("vgAxisConfig"!==t||jp.has(n)&&a||pa(e)||pn(e))&&c.set(n,e,!1)}}const b=null!==(a=s.encoding)&&void 0!==a?a:{},x=ma.reduce(((n,i)=>{var o;if(!c.hasAxisPart(i))return n;const r=id(null!==(o=b[i])&&void 0!==o?o:{},t),a="labels"===i?function(e,t,n){var i;const{encoding:o,config:r}=e,a=null!==(i=na(o[t]))&&void 0!==i?i:na(o[tt(t)]),s=e.axis(t)||{},{format:c,formatType:l}=s;if(rr(l))return{text:lr({fieldOrDatumDef:a,field:"datum.value",format:c,formatType:l,config:r}),...n};if(void 0===c&&void 0===l&&r.customFormatTypes){if("quantitative"===Er(a)){if(Br(a)&&"normalize"===a.stack&&r.normalizedNumberFormatType)return{text:lr({fieldOrDatumDef:a,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:lr({fieldOrDatumDef:a,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if("temporal"===Er(a)&&r.timeFormatType&&jr(a)&&!a.timeUnit)return{text:lr({fieldOrDatumDef:a,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}(t,e,r):r;return void 0===a||z(a)||(n[i]={update:a}),n}),{});return z(x)||c.set("encode",x,!!s.encoding||void 0!==s.labelAngle),c}function Tp(e,t){const{config:n}=e;return{...Bl(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Cl("x",e,{defaultPos:"mid"}),...Cl("y",e,{defaultPos:"mid"}),...Fl("size",e),...Fl("angle",e),...Mp(e,0,t)}}function Mp(e,t,n){return n?{shape:{value:n}}:Fl("shape",e)}const Lp={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?{...Bl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...El("x",e,{defaultPos:"horizontal"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==n}),...El("y",e,{defaultPos:"vertical"===n?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==n}),...Fl("size",e,{vgChannel:"strokeWidth"})}:{}}};function qp(e,t,n){if(void 0===zn("align",e,n))return"center"}function Wp(e,t,n){if(void 0===zn("baseline",e,n))return"middle"}const Rp={vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,o="horizontal"===i?"width":"height",r="horizontal"===i?"height":"width";return{...Bl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Cl("x",e,{defaultPos:"mid",vgChannel:"xc"}),...Cl("y",e,{defaultPos:"mid",vgChannel:"yc"}),...Fl("size",e,{defaultValue:Up(e),vgChannel:o}),[r]:kn(zn("thickness",n,t))}}};function Up(e){var n;const{config:i,markDef:o}=e,{orient:r}=o,a="horizontal"===r?"width":"height",s=e.getScaleComponent("horizontal"===r?"x":"y"),c=null!==(n=zn("size",o,i,{vgChannel:a}))&&void 0!==n?n:i.tick.bandSize;if(void 0!==c)return c;{const e=s?s.get("range"):void 0;return e&&mn(e)&&t.isNumber(e.step)?3*e.step/4:3*ws(i.view,a)/4}}const Bp={arc:{vgMark:"arc",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Cl("x",e,{defaultPos:"mid"}),...Cl("y",e,{defaultPos:"mid"}),...Ll(e,"radius"),...Ll(e,"theta")})},area:{vgMark:"area",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...El("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient}),...El("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient}),...Vl(e)})},bar:{vgMark:"rect",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ll(e,"x"),...Ll(e,"y")})},circle:{vgMark:"symbol",encodeEntry:e=>Tp(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&jr(n)&&n.type===Qi?{field:Gr(n,{expr:"datum"})}:{}}]}},image:{vgMark:"image",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Ll(e,"x"),...Ll(e,"y"),...vl(e,"url")})},line:{vgMark:"line",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Cl("x",e,{defaultPos:"mid"}),...Cl("y",e,{defaultPos:"mid"}),...Fl("size",e,{vgChannel:"strokeWidth"}),...Vl(e)})},point:{vgMark:"symbol",encodeEntry:e=>Tp(e)},rect:{vgMark:"rect",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Ll(e,"x"),...Ll(e,"y")})},rule:Lp,square:{vgMark:"symbol",encodeEntry:e=>Tp(e,"square")},text:{vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Bl(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Cl("x",e,{defaultPos:"mid"}),...Cl("y",e,{defaultPos:"mid"}),...vl(e),...Fl("size",e,{vgChannel:"fontSize"}),...Fl("angle",e),...Gl("align",qp(e.markDef,0,t)),...Gl("baseline",Wp(e.markDef,0,t)),...Cl("radius",e,{defaultPos:null}),...Cl("theta",e,{defaultPos:null})}}},tick:Rp,trail:{vgMark:"trail",encodeEntry:e=>({...Bl(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Cl("x",e,{defaultPos:"mid"}),...Cl("y",e,{defaultPos:"mid"}),...Fl("size",e),...Vl(e)})}},Ip="faceted_path_",Hp="stack_group_";function Vp(e){const{encoding:n,stack:i,mark:o,markDef:r,config:a}=e,s=n.order;if(!(!t.isArray(s)&&Rr(s)&&h(s.value)||!s&&h(zn("order",r,a)))){if((t.isArray(s)||jr(s))&&!i)return Pn(s,{expr:"datum"});if(Io(o)){const i="horizontal"===r.orient?"y":"x",o=n[i];if(jr(o)){const n=o.sort;if(t.isArray(n))return{field:Gr(o,{prefix:i,suffix:"sort_index",expr:"datum"})};if(xr(n))return{field:Gr({aggregate:Fa(e.encoding)?n.op:void 0,field:n.field},{expr:"datum"})};if(br(n))return{field:Gr(e.fieldDef(n.encoding),{expr:"datum"}),order:n.order};if(null===n)return;var c;return{field:Gr(o,{binSuffix:null!==(c=e.stack)&&void 0!==c&&c.impute?"mid":void 0,expr:"datum"})}}}}}function Gp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{fromPrefix:""};const{mark:n,markDef:i,encoding:o,config:r}=e,a=I(i.clip,function(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(null!=t&&t.get("selectionExtent")||null!=n&&n.get("selectionExtent"))||void 0}(e),function(e){const t=e.component.projection;return!(!t||t.isFit)||void 0}(e)),s=On(i),c=o.key,l=Vp(e),u=function(e){if(!e.component.selection)return null;const t=_(e.component.selection).length;let n=t,i=e.parent;for(;i&&0===n;)n=_(i.component.selection).length,i=i.parent;return n?{interactive:t>0||!!e.encoding.tooltip}:null}(e),d=zn("aria",i,r),f=Bp[n].postEncodingTransform?Bp[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:Bp[n].vgMark,...a?{clip:!0}:{},...s?{style:s}:{},...c?{key:c.field}:{},...l?{sort:l}:{},...u||{},...!1===d?{aria:d}:{},from:{data:t.fromPrefix+e.requestDataName(Qc.Main)},encode:{update:Bp[n].encodeEntry(e)},...f?{transform:f}:{}}]}class Yp extends Zf{constructor(e,n,i){var o;let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;super(e,"unit",n,i,a,void 0,ys(e)?e.view:void 0),Tn(this,"markDef",void 0),Tn(this,"encoding",void 0),Tn(this,"specifiedScales",{}),Tn(this,"stack",void 0),Tn(this,"specifiedAxes",{}),Tn(this,"specifiedLegends",{}),Tn(this,"specifiedProjection",{}),Tn(this,"selection",[]),Tn(this,"children",[]);const s=Go(e.mark)?{...e.mark}:{type:e.mark},c=s.type;void 0===s.filled&&(s.filled=function(e,t,n){let{graticule:i}=n;if(i)return!1;const o=_n("filled",e,t),r=e.type;return I(o,r!==Eo&&r!==jo&&r!==Mo)}(s,a,{graticule:e.data&&Jc(e.data)}));const l=this.encoding=function(e,n,i,o){const r={};for(const t of _(e))Qe(t)||hi("".concat(a=t,"-encoding is dropped as ").concat(a," is not a valid encoding channel."));var a;for(let a of rt){if(!e[a])continue;const s=e[a];if(Ct(a)){const e=ot(a),t=r[e];if(jr(t)){if(Hi(t.type)&&jr(s)){hi(Jn(e));continue}}else a=e,hi(Qn(e))}if("angle"!==a||"arc"!==n||e.theta||(hi("Arc marks uses theta channel rather than angle, replacing angle with theta."),a=se),za(e,a,n)){if(a===ve&&"line"===n){const t=ta(e[a]);if(null!=t&&t.aggregate){hi("Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.");continue}}if(a===pe&&(i?"fill"in e:"stroke"in e))hi(Kn("encoding",{fill:"fill"in e,stroke:"stroke"in e}));else if(a===Oe||a===Fe&&!t.isArray(s)&&!Rr(s)||a===_e&&t.isArray(s))s&&(r[a]=t.array(s).reduce(((e,t)=>(jr(t)?e.push(ra(t,a)):hi(Zn(t,a)),e)),[]));else{if(a===_e&&null===s)r[a]=null;else if(!(jr(s)||Tr(s)||Rr(s)||Nr(s)||pn(s))){hi(Zn(s,a));continue}r[a]=ia(s,a,o)}}else hi(ei(a,n))}return r}(e.encoding||{},c,s.filled,a);this.markDef=function(e,t,n){const i=un(e),o=zn("orient",i,n);var r,a;if(i.orient=function(e,t,n){switch(e){case Eo:case Ro:case Uo:case Lo:case To:case Ao:return}const{x:i,y:o,x2:r,y2:a}=t;switch(e){case Po:if(jr(i)&&(rn(i.bin)||jr(o)&&o.aggregate&&!i.aggregate))return"vertical";if(jr(o)&&(rn(o.bin)||jr(i)&&i.aggregate&&!o.aggregate))return"horizontal";if(a||r){if(n)return n;if(!r&&(jr(i)&&i.type===Gi&&!on(i.bin)||Lr(i)))return"horizontal";if(!a&&(jr(o)&&o.type===Gi&&!on(o.bin)||Lr(o)))return"vertical"}case Mo:if(r&&(!jr(i)||!rn(i.bin))&&a&&(!jr(o)||!rn(o.bin)))return;case No:if(a)return jr(o)&&rn(o.bin)?"horizontal":"vertical";if(r)return jr(i)&&rn(i.bin)?"vertical":"horizontal";if(e===Mo){if(i&&!o)return"vertical";if(o&&!i)return"horizontal"}case jo:case qo:{const t=Mr(i),r=Mr(o);if(n)return n;if(t&&!r)return"tick"!==e?"horizontal":"vertical";if(!t&&r)return"tick"!==e?"vertical":"horizontal";if(t&&r){const t=i,n=o,r=t.type===Xi,a=n.type===Xi;return r&&!a?"tick"!==e?"vertical":"horizontal":!r&&a?"tick"!==e?"horizontal":"vertical":!t.aggregate&&n.aggregate?"tick"!==e?"vertical":"horizontal":t.aggregate&&!n.aggregate&&"tick"!==e?"horizontal":"vertical"}return}}return"vertical"}(i.type,t,o),void 0!==o&&o!==i.orient&&hi((r=i.orient,a=o,'Specified orient "'.concat(r,'" overridden with "').concat(a,'".'))),"bar"===i.type&&i.orient){const e=zn("cornerRadiusEnd",i,n);if(void 0!==e){const n="horizontal"===i.orient&&t.x2||"vertical"===i.orient&&t.y2?["cornerRadius"]:$o[i.orient];for(const t of n)i[t]=e;void 0!==i.cornerRadiusEnd&&delete i.cornerRadiusEnd}}return void 0===zn("opacity",i,n)&&(i.opacity=function(e,t){if(v([Eo,qo,Ro,Uo],e)&&!Fa(t))return.7}(i.type,t)),void 0===zn("cursor",i,n)&&(i.cursor=function(e,t,n){return t.href||e.href||zn("href",e,n)?"pointer":e.cursor}(i,t,n)),i}(s,l,a),this.size=function(e){let{encoding:t,size:n}=e;for(const e of St){const i=nt(e);vs(n[i])&&Mr(t[e])&&(delete n[i],hi(li(i)))}return n}({encoding:l,size:ys(e)?{...r,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}}:r}),this.stack=Is(c,l),this.specifiedScales=this.initScales(c,l),this.specifiedAxes=this.initAxes(l),this.specifiedLegends=this.initLegends(l),this.specifiedProjection=e.projection,this.selection=(null!==(o=e.params)&&void 0!==o?o:[]).filter((e=>ds(e)))}get hasProjection(){const{encoding:e}=this,t=this.mark===Bo,n=e&&Te.some((t=>qr(e[t])));return t||n}scaleDomain(e){const t=this.specifiedScales[e];return t?t.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,t){return Ut.reduce(((e,n)=>{const i=na(t[n]);var o;return i&&(e[n]=this.initScale(null!==(o=i.scale)&&void 0!==o?o:{})),e}),{})}initScale(e){const{domain:n,range:i}=e,o=un(e);return t.isArray(n)&&(o.domain=n.map(xn)),t.isArray(i)&&(o.range=i.map(xn)),o}initAxes(e){return St.reduce(((t,n)=>{const i=e[n];if(qr(i)||n===Z&&qr(e.x2)||n===ee&&qr(e.y2)){const e=qr(i)?i.axis:void 0;t[n]=e?this.initAxis({...e}):e}return t}),{})}initAxis(e){const t=_(e),n={};for(const i of t){const t=e[i];n[i]=pa(t)?bn(t):xn(t)}return n}initLegends(e){return Wt.reduce(((t,n)=>{const i=na(e[n]);if(i&&function(e){switch(e){case pe:case me:case ge:case ve:case he:case be:case ke:case Se:return!0;case xe:case we:case ye:return!1}}(n)){const e=i.legend;t[n]=e?un(e):e}return t}),{})}parseData(){this.component.data=Dp(this)}parseLayoutSize(){!function(e){const{size:t,component:n}=e;for(const i of St){const o=nt(i);if(t[o]){const e=t[o];n.layoutSize.set(o,vs(e)?"step":e,!0)}else{const t=xp(e,o);n.layoutSize.set(o,t,!1)}}}(this)}parseSelections(){this.component.selection=function(e,n){const i={},o=e.config.selection;if(!n||!n.length)return i;for(const a of n){const n=A(a.name),s=a.select,c=t.isString(s)?s:s.type,l=t.isObject(s)?u(s):{type:c},d=o[c];for(const e in d){var r;"fields"!==e&&"encodings"!==e&&("mark"===e&&(l[e]={...d[e],...l[e]}),(void 0===l[e]||!0===l[e])&&(l[e]=null!==(r=d[e])&&void 0!==r?r:l[e]))}const f=i[n]={...l,name:n,type:c,init:a.value,bind:a.bind,events:t.isString(l.on)?t.parseSelector(l.on,"scope"):t.array(u(l.on))};for(const t of fu)t.defined(f)&&t.parse&&t.parse(e,f,a)}return i}(this,this.selection)}parseMarkGroup(){this.component.mark=function(e){if(v([jo,No,Wo],e.mark)){const t=Pa(e.mark,e.encoding);if(t.length>0)return function(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:Ip+e.requestDataName(Qc.Main),data:e.requestDataName(Qc.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Gp(e,{fromPrefix:Ip})}]}(e,t)}else if(e.mark===Po){const t=yn.some((t=>zn(t,e.markDef,e.config)));if(e.stack&&!e.fieldDef("size")&&t)return function(e){var t;const[n]=Gp(e,{fromPrefix:Hp}),i=e.scaleName(e.stack.fieldChannel),o=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.vgField(e.stack.fieldChannel,t)},r=(e,t)=>{const n=[o({prefix:"min",suffix:"start",expr:t}),o({prefix:"max",suffix:"start",expr:t}),o({prefix:"min",suffix:"end",expr:t}),o({prefix:"max",suffix:"end",expr:t})];return"".concat(e,"(").concat(n.map((e=>"scale('".concat(i,"',").concat(e,")"))).join(","),")")};let a,s;"x"===e.stack.fieldChannel?(a={...f(n.encode.update,["y","yc","y2","height",...yn]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},s={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},n.encode.update={...p(n.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(a={...f(n.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},s={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},n.encode.update={...p(n.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const t of yn){const i=_n(t,e.markDef,e.config);n.encode.update[t]?(a[t]=n.encode.update[t],delete n.encode.update[t]):i&&(a[t]=kn(i)),i&&(n.encode.update[t]={value:0})}const c=[];if((null===(t=e.stack.groupbyChannels)||void 0===t?void 0:t.length)>0)for(const t of e.stack.groupbyChannels){const n=e.fieldDef(t),i=Gr(n);i&&c.push(i),(null!=n&&n.bin||null!=n&&n.timeUnit)&&c.push(Gr(n,{binSuffix:"end"}))}return a=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce(((t,i)=>{if(n.encode.update[i])return{...t,[i]:n.encode.update[i]};{const n=_n(i,e.markDef,e.config);return void 0!==n?{...t,[i]:kn(n)}:t}}),a),a.stroke&&(a.strokeForeground={value:!0},a.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Qc.Main),name:Hp+e.requestDataName(Qc.Main),groupby:c,aggregate:{fields:[o({suffix:"start"}),o({suffix:"start"}),o({suffix:"end"}),o({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:a},marks:[{type:"group",encode:{update:s},marks:[n]}]}]}(e)}return Gp(e)}(this)}parseAxesAndHeaders(){var e;this.component.axes=(e=this,St.reduce(((t,n)=>(e.component.scales[n]&&(t[n]=[Ep(n,e)]),t)),{}))}assembleSelectionTopLevelSignals(e){return function(e,n){let i=!1;for(const r of C(null!==(o=e.component.selection)&&void 0!==o?o:{})){var o;const a=r.name,s=t.stringValue(a+cu);if(0===n.filter((e=>e.name===a)).length){const e="global"===r.resolve?"union":r.resolve,i="point"===r.type?", true, true)":")";n.push({name:r.name,update:"".concat(du,"(").concat(s,", ").concat(t.stringValue(e)).concat(i)})}i=!0;for(const t of fu)t.defined(r)&&t.topLevelSignals&&(n=t.topLevelSignals(e,r,n))}return i&&0===n.filter((e=>"unit"===e.name)).length&&n.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),tl(n)}(this,e)}assembleSignals(){return[...Ou(this),...Kc(this,[])]}assembleSelectionData(e){return function(e,t){const n=[...t],i=pu(e,{escape:!1});for(const t of C(null!==(o=e.component.selection)&&void 0!==o?o:{})){var o;const e={name:t.name+cu};if(t.project.hasSelectionId&&(e.transform=[{type:"collect",sort:{field:ss}}]),t.init){const n=t.project.items.map((e=>{const{signals:t,...n}=e;return n}));e.values=t.project.hasSelectionId?t.init.map((e=>({unit:i,[ss]:$c(e,!1)[0]}))):t.init.map((e=>({unit:i,fields:n,values:$c(e,!1)})))}n.filter((e=>e.name===t.name+cu)).length||n.push(e)}return n}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return Ku(this)}assembleMarks(){var e;let t=null!==(e=this.component.mark)&&void 0!==e?e:[];return this.parent&&$f(this.parent)||(t=el(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:e}=this.view||{};return void 0!==e?e:this.encoding.x||this.encoding.y?"cell":void 0}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return ka(this.encoding,e)}fieldDef(e){return ta(this.encoding[e])}typedFieldDef(e){const t=this.fieldDef(e);return Wr(t)?t:null}}class Xp extends Kf{constructor(e,t,n,i,o){super(e,"layer",t,n,o,e.resolve,e.view),Tn(this,"children",void 0);const r={...i,...e.width?{width:e.width}:{},...e.height?{height:e.height}:{}};this.children=e.layer.map(((e,t)=>{if(Ms(e))return new Xp(e,this,this.getName("layer_".concat(t)),r,o);if(xa(e))return new Yp(e,this,this.getName("layer_".concat(t)),r,o);throw new Error(qn(e))}))}parseData(){this.component.data=Dp(this);for(const e of this.children)e.parseData()}parseLayoutSize(){yp(this),bp(this,"width"),bp(this,"height")}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of _(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){!function(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const i of e.children){i.parseAxesAndHeaders();for(const o of _(i.component.axes))n.axis[o]=rd(e.component.resolve,o),"shared"===n.axis[o]&&(t[o]=Np(t[o],i.component.axes[o]),t[o]||(n.axis[o]="independent",delete t[o]))}for(const r of St){for(const a of e.children)if(a.component.axes[r]){if("independent"===n.axis[r]){var o;t[r]=(null!==(o=t[r])&&void 0!==o?o:[]).concat(a.component.axes[r]);for(const e of a.component.axes[r]){const{value:t,explicit:n}=e.getWithExplicit("orient");if(!pn(t)){if(i[t]>0&&!n){const n=Cp[t];i[t]>i[n]&&e.set("orient",n,!1)}i[t]++}}}delete a.component.axes[r]}if("independent"===n.axis[r]&&t[r]&&t[r].length>1)for(const e of t[r])e.get("grid")&&!e.explicit.grid&&(e.implicit.grid=!1)}}(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce(((e,t)=>t.assembleSelectionTopLevelSignals(e)),e)}assembleSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleSignals())),Ou(this))}assembleLayoutSignals(){return this.children.reduce(((e,t)=>e.concat(t.assembleLayoutSignals())),Ku(this))}assembleSelectionData(e){return this.children.reduce(((e,t)=>t.assembleSelectionData(e)),e)}assembleGroupStyle(){const e=new Set;for(const n of this.children)for(const i of t.array(n.assembleGroupStyle()))e.add(i);const n=Array.from(e);return n.length>1?n:1===n.length?n[0]:void 0}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle(),e)return e}assembleLayout(){return null}assembleMarks(){return function(e,t){for(const n of e.children)Xf(n)&&(t=el(n,t));return t}(this,this.children.flatMap((e=>e.assembleMarks())))}assembleLegends(){return this.children.reduce(((e,t)=>e.concat(t.assembleLegends())),kd(this))}}function Jp(e,t,n,i,o){if(Dr(e))return new kp(e,t,n,o);if(Ms(e))return new Xp(e,t,n,i,o);if(xa(e))return new Yp(e,t,n,i,o);if(function(e){return ms(e)||gs(e)||ps(e)}(e))return new Fp(e,t,n,o);throw new Error(qn(e))}function Qp(e,n,i,o){const r=o.component.layoutSize.get("width"),a=o.component.layoutSize.get("height");if(void 0===n?(n={type:"pad"},o.hasAxisOrientSignalRef()&&(n.resize=!0)):t.isString(n)&&(n={type:n}),r&&a&&("fit"===(s=n.type)||"fit-x"===s||"fit-y"===s))if("step"===r&&"step"===a)hi(Un()),n.type="pad";else if("step"===r||"step"===a){const e="step"===r?"width":"height";hi(Un(zt(e)));const t="width"===e?"height":"width";n.type=function(e){return e?"fit-".concat(zt(e)):"fit"}(t)}var s;return{...1===_(n).length&&n.type?"pad"===n.type?{}:{autosize:n.type}:{autosize:n},...Tc(i,!1),...Tc(e,!0)}}function $p(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;const o=e.config?Es(e.config):void 0,r=[].concat(e.assembleSelectionData([]),function(e,t){const n=[],i=pp(n);let o=0;for(const t of e.sources){t.hasName()||(t.dataName="source_".concat(o++));const e=t.assemble();i(t,e)}for(const e of n)0===e.transform.length&&delete e.transform;let r=0;for(const[e,t]of n.entries()){var a;0!==(null!==(a=t.transform)&&void 0!==a?a:[]).length||t.source||n.splice(r++,0,n.splice(e,1)[0])}for(const t of n)for(const n of null!==(s=t.transform)&&void 0!==s?s:[]){var s;"lookup"===n.type&&(n.from=e.outputNodes[n.from].getSource())}for(const e of n)e.name in t&&(e.values=t[e.name]);return n}(e.component.data,n)),a=e.assembleProjections(),s=e.assembleTitle(),c=e.assembleGroupStyle(),l=e.assembleGroupEncodeEntry(!0);let u=e.assembleLayoutSignals();u=u.filter((e=>"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1)));const{params:d,...f}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...f,...s?{title:s}:{},...c?{style:c}:{},...l?{encode:{update:l}}:{},data:r,...a.length>0?{projections:a}:{},...e.assembleGroup([...u,...e.assembleSelectionTopLevelSignals([]),...fs(d)]),...o?{config:o}:{},...i?{usermeta:i}:{}}}e.accessPathDepth=B,e.accessPathWithDatum=M,e.compile=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n.logger&&function(e){gi=e}(n.logger),n.fieldTitle&&Qr(n.fieldTitle);try{const i=Ns(t.mergeConfig(n.config,e.config)),o=Cc(e,i),r=Jp(o,null,"",void 0,i);return r.parse(),function(e,t){ff(e.sources);let n=0,i=0;for(let i=0;i<5&&mf(e,t,!0);i++)n++;e.sources.map(lf);for(let n=0;n<5&&mf(e,t,!1);n++)i++;ff(e.sources),5===Math.max(n,i)&&hi("Maximum optimization runs(".concat(5,") reached."))}(r.component.data,r),{spec:$p(r,Qp(e,o.autosize,i,r),e.datasets,e.usermeta),normalized:o}}finally{n.logger&&(gi=mi),n.fieldTitle&&Qr(Xr)}},e.contains=v,e.deepEqual=l,e.deleteNestedProperty=E,e.duplicate=u,e.entries=N,e.every=b,e.fieldIntersection=O,e.flatAccessWithDatum=L,e.getFirstDefined=I,e.hasIntersection=D,e.hash=g,e.internalField=G,e.isBoolean=P,e.isEmpty=z,e.isEqual=function(e,t){const n=_(e),i=_(t);if(n.length!==i.length)return!1;for(const i of n)if(e[i]!==t[i])return!1;return!0},e.isInternalField=Y,e.isNullOrFalse=h,e.isNumeric=J,e.keys=_,e.logicalExpr=j,e.mergeDeep=x,e.never=d,e.normalize=Cc,e.normalizeAngle=X,e.omit=p,e.pick=f,e.prefixGenerator=F,e.removePathFromField=U,e.replaceAll=R,e.replacePathInField=W,e.resetIdCounter=function(){H=42},e.setEqual=S,e.some=y,e.stringify=m,e.titleCase=T,e.unique=k,e.uniqueId=V,e.vals=C,e.varName=A,e.version="5.2.0",Object.defineProperty(e,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/dist/synoptic/cdn/vega.min-5.22.1.js b/dist/synoptic/cdn/vega.min-5.22.1.js deleted file mode 100644 index 7f596bd..0000000 --- a/dist/synoptic/cdn/vega.min-5.22.1.js +++ /dev/null @@ -1 +0,0 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).vega={})}(this,(function(t){"use strict";function e(t,e,n){return t.fields=e||[],t.fname=n,t}function n(t){return null==t?null:t.fname}function r(t){return null==t?null:t.fields}function i(t){return 1===t.length?o(t[0]):a(t)}const o=t=>function(e){return e[t]},a=t=>{const e=t.length;return function(n){for(let r=0;rr&&c(),s=r=i+1):"]"===o&&(s||u("Access path missing open bracket: "+t),s>0&&c(),s=0,r=i+1):i>r?c():r=i+1}return s&&u("Access path missing closing bracket: "+t),a&&u("Access path missing closing quote: "+t),i>r&&(i++,c()),e}function l(t,n,r){const o=s(t);return t=1===o.length?o[0]:t,e((r&&r.get||i)(o),[t],n||t)}const c=l("id"),f=e((t=>t),[],"identity"),h=e((()=>0),[],"zero"),d=e((()=>1),[],"one"),p=e((()=>!0),[],"true"),g=e((()=>!1),[],"false");function m(t,e,n){const r=[e].concat([].slice.call(n));console[t].apply(console,r)}function y(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:m,r=t||0;return{level(t){return arguments.length?(r=+t,this):r},error(){return r>=1&&n(e||"error","ERROR",arguments),this},warn(){return r>=2&&n(e||"warn","WARN",arguments),this},info(){return r>=3&&n(e||"log","INFO",arguments),this},debug(){return r>=4&&n(e||"log","DEBUG",arguments),this}}}var v=Array.isArray;function _(t){return t===Object(t)}const x=t=>"__proto__"!==t;function b(){for(var t=arguments.length,e=new Array(t),n=0;n{for(const n in e)if("signals"===n)t.signals=k(t.signals,e.signals);else{const r="legend"===n?{layout:1}:"style"===n||null;w(t,n,e[n],r)}return t}),{})}function w(t,e,n,r){if(!x(e))return;let i,o;if(_(n)&&!v(n))for(i in o=_(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?w(o,i,n[i]):x(i)&&(o[i]=n[i]);else t[e]=n}function k(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function A(t){return t[t.length-1]}function M(t){return null==t||""===t?null:+t}const E=t=>e=>t*Math.exp(e),D=t=>e=>Math.log(t*e),C=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),F=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,S=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function B(t,e,n,r){const i=n(t[0]),o=n(A(t)),a=(o-i)*e;return[r(i-a),r(o-a)]}function T(t,e){return B(t,e,M,f)}function N(t,e){var n=Math.sign(t[0]);return B(t,e,D(n),E(n))}function z(t,e,n){return B(t,e,S(n),S(1/n))}function O(t,e,n){return B(t,e,C(n),F(n))}function R(t,e,n,r,i){const o=r(t[0]),a=r(A(t)),u=null!=e?r(e):(o+a)/2;return[i(u+(o-u)*n),i(u+(a-u)*n)]}function L(t,e,n){return R(t,e,n,M,f)}function U(t,e,n){const r=Math.sign(t[0]);return R(t,e,n,D(r),E(r))}function q(t,e,n,r){return R(t,e,n,S(r),S(1/r))}function P(t,e,n,r){return R(t,e,n,C(r),F(r))}function j(t){return 1+~~(new Date(t).getMonth()/3)}function I(t){return 1+~~(new Date(t).getUTCMonth()/3)}function $(t){return null!=t?v(t)?t:[t]:[]}function W(t,e,n){let r,i=t[0],o=t[1];return o=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function H(t){return"function"==typeof t}function Y(t,n,i){i=i||{},n=$(n)||[];const o=[],a=[],u={},s=i.comparator||V;return $(t).forEach(((t,e)=>{null!=t&&(o.push("descending"===n[e]?-1:1),a.push(t=H(t)?t:l(t,null,i)),(r(t)||[]).forEach((t=>u[t]=1)))})),0===a.length?null:e(s(a,o),Object.keys(u))}const G=(t,e)=>(te||null==e)&&null!=t?1:(e=e instanceof Date?+e:e,(t=t instanceof Date?+t:t)!==t&&e==e?-1:e!=e&&t==t?1:0),V=(t,e)=>1===t.length?X(t[0],e[0]):J(t,e,t.length),X=(t,e)=>function(n,r){return G(t(n),t(r))*e},J=(t,e,n)=>(e.push(0),function(r,i){let o,a=0,u=-1;for(;0===a&&++ut}function Q(t,e){let n;return r=>{n&&clearTimeout(n),n=setTimeout((()=>(e(r),n=null)),t)}}function K(t){for(let e,n,r=1,i=arguments.length;ro&&(o=r))}else{for(r=e(t[a]);ao&&(o=r))}return[i,o]}function et(t,e){const n=t.length;let r,i,o,a,u,s=-1;if(null==e){for(;++s=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++si&&(r=i,a=s),o=i){r=o=i;break}if(s===n)return[-1,-1];for(a=u=s;++si&&(r=i,a=s),or(t)?n[t]:void 0,set(t,e){return r(t)||(++i.size,n[t]===it&&--i.empty),n[t]=e,this},delete(t){return r(t)&&(--i.size,++i.empty,n[t]=it),this},clear(){i.size=i.empty=0,i.object=n={}},test(t){return arguments.length?(e=t,i):e},clean(){const t={};let r=0;for(const i in n){const o=n[i];o===it||e&&e(o)||(t[i]=o,++r)}i.size=r,i.empty=0,i.object=n=t}};return t&&Object.keys(t).forEach((e=>{i.set(e,t[e])})),i}function at(t,e,n,r,i,o){if(!n&&0!==n)return o;const a=+n;let u,s=t[0],l=A(t);la&&(i=o,o=a,a=i),r=void 0===r||r,((n=void 0===n||n)?o<=t:ot.replace(/\\(.)/g,"$1"))):$(t));const o=t&&t.length,a=r&&r.get||i,u=t=>a(n?[t]:s(t));let l;if(o)if(1===o){const e=u(t[0]);l=function(t){return""+e(t)}}else{const e=t.map(u);l=function(t){let n=""+e[0](t),r=0;for(;++r{e={},n={},r=0},o=(i,o)=>(++r>t&&(n=e,e={},r=1),e[i]=o);return i(),{clear:i,has:t=>rt(e,t)||rt(n,t),get:t=>rt(e,t)?e[t]:rt(n,t)?o(t,n[t]):void 0,set:(t,n)=>rt(e,t)?e[t]=n:o(t,n)}}function vt(t,e,n,r){const i=e.length,o=n.length;if(!o)return e;if(!i)return n;const a=r||new e.constructor(i+o);let u=0,s=0,l=0;for(;u0?n[s++]:e[u++];for(;u=0;)n+=t;return n}function xt(t,e,n,r){const i=n||" ",o=t+"",a=e-o.length;return a<=0?o:"left"===r?_t(i,a)+o:"center"===r?_t(i,~~(a/2))+o+_t(i,Math.ceil(a/2)):o+_t(i,a)}function bt(t){return t&&A(t)-t[0]||0}function wt(t){return v(t)?"["+t.map(wt)+"]":_(t)||pt(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function kt(t){return null==t||""===t?null:!(!t||"false"===t||"0"===t||!t)}const At=t=>ht(t)||ct(t)?t:Date.parse(t);function Mt(t,e){return e=e||At,null==t||""===t?null:e(t)}function Et(t){return null==t||""===t?null:t+""}function Dt(t){const e={},n=t.length;for(let r=0;r1)r=function(t,e,n){var r,i=[],o=[];function a(t){var e=t<0?~t:t;(o[e]||(o[e]=[])).push({i:t,g:r})}function u(t){t.forEach(a)}function s(t){t.forEach(u)}return function t(e){switch(r=e,e.type){case"GeometryCollection":e.geometries.forEach(t);break;case"LineString":u(e.arcs);break;case"MultiLineString":case"Polygon":s(e.arcs);break;case"MultiPolygon":!function(t){t.forEach(s)}(e.arcs)}}(e),o.forEach(null==n?function(t){i.push(t[0].i)}:function(t){n(t[0].g,t[t.length-1].g)&&i.push(t[0].i)}),i}(0,e,n);else for(i=0,r=new Array(o=t.arcs.length);ie?1:t>=e?0:NaN}function $t(t){let e=t,n=t,r=t;function i(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(i>>1;r(t[n],e)<0?i=n+1:o=n}while(it(e)-n,n=It,r=(e,n)=>It(t(e),n)),{left:i,center:function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=i(t,n,r,(arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length)-1);return o>r&&e(t[o-1],n)>-e(t[o],n)?o-1:o},right:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;if(i>>1;r(t[n],e)<=0?i=n+1:o=n}while(i0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}class Jt extends Map{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Qt(this,t))}has(t){return super.has(Qt(this,t))}set(t,e){return super.set(Kt(this,t),e)}delete(t){return super.delete(te(this,t))}}class Zt extends Set{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const e of t)this.add(e)}has(t){return super.has(Qt(this,t))}add(t){return super.add(Kt(this,t))}delete(t){return super.delete(te(this,t))}}function Qt(t,e){let{_intern:n,_key:r}=t;const i=r(e);return n.has(i)?n.get(i):e}function Kt(t,e){let{_intern:n,_key:r}=t;const i=r(e);return n.has(i)?n.get(i):(n.set(i,e),e)}function te(t,e){let{_intern:n,_key:r}=t;const i=r(e);return n.has(i)&&(e=n.get(i),n.delete(i)),e}function ee(t){return null!==t&&"object"==typeof t?t.valueOf():t}function ne(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(te?1:0)}var re=Math.sqrt(50),ie=Math.sqrt(10),oe=Math.sqrt(2);function ae(t,e,n){var r,i,o,a,u=-1;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if((r=e0){let n=Math.round(t/a),r=Math.round(e/a);for(n*ae&&--r,o=new Array(i=r-n+1);++ue&&--r,o=new Array(i=r-n+1);++u=0?(o>=re?10:o>=ie?5:o>=oe?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=re?10:o>=ie?5:o>=oe?2:1)}function se(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=re?i*=10:o>=ie?i*=5:o>=oe&&(i*=2),e=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n=i)&&(n=i)}return n}function ce(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n>i||void 0===n&&i>=i)&&(n=i)}return n}function fe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length-1,i=arguments.length>4?arguments[4]:void 0;for(i=void 0===i?ne:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:It;if(t===It)return ne;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,u=Math.log(o),s=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*s*(o-s)/o)*(a-o/2<0?-1:1);fe(t,e,Math.max(n,Math.floor(e-a*s/o+l)),Math.min(r,Math.floor(e+(o-a)*s/o+l)),i)}const o=t[e];let a=n,u=r;for(he(t,n,e),i(t[r],o)>0&&he(t,n,r);a0;)--u}0===i(t[n],o)?he(t,n,u):(++u,he(t,u,r)),u<=e&&(n=u+1),e<=u&&(r=u-1)}return t}function he(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function de(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),r=t.length){if((e=+e)<=0||r<2)return ce(t);if(e>=1)return le(t);var r,i=(r-1)*e,o=Math.floor(i),a=le(fe(t,o).subarray(0,o+1));return a+(ce(t.subarray(o+1))-a)*(i-o)}}function pe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Wt;if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t);return a+(+n(t[o+1],o+1,t)-a)*(i-o)}}function ge(t,e){return de(t,.5,e)}function me(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function ye(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r1?r[0]+r.slice(2):r,+t.slice(n+1)]}function be(t){return(t=xe(Math.abs(t)))?t[1]:NaN}var we,ke=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ae(t){if(!(e=ke.exec(t)))throw new Error("invalid format: "+t);var e;return new Me({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Me(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Ee(t,e){var n=xe(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Ae.prototype=Me.prototype,Me.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var De={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Ee(100*t,e),r:Ee,s:function(t,e){var n=xe(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(we=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+xe(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Ce(t){return t}var Fe,Se,Be,Te=Array.prototype.map,Ne=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ze(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Ce:(e=Te.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=e[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>r));)u=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Ce:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Te.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=Ae(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):De[v]||(void 0===m&&(m=12),y=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var _="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?s:"",b=De[v],w=/[defgprs%]/.test(v);function k(t){var i,o,s,h=_,k=x;if("c"===v)k=b(t)+k,t="";else{var A=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:b(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),A&&0==+t&&"+"!==f&&(A=!1),h=(A?"("===f?f:l:"-"===f||"("===f?"":f)+h,k=("s"===v?Ne[8+we/3]:"")+k+(A&&"("===f?")":""),w)for(i=-1,o=t.length;++i(s=t.charCodeAt(i))||s>57){k=(46===s?a+t.slice(i+1):t.slice(i))+k,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var M=h.length+t.length+k.length,E=M>1)+h+t+k+E.slice(M);break;default:t=E+h+t+k}return u(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return t+""},k}return{format:f,formatPrefix:function(t,e){var n=f(((t=Ae(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(be(e)/3))),i=Math.pow(10,-r),o=Ne[8+r/3];return function(t){return n(i*t)+o}}}}function Oe(t){return Math.max(0,-be(Math.abs(t)))}function Re(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(be(e)/3)))-be(Math.abs(t)))}function Le(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,be(e)-be(t))+1}Fe=ze({thousands:",",grouping:[3],currency:["$",""]}),Se=Fe.format,Be=Fe.formatPrefix;var Ue=new Date,qe=new Date;function Pe(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return u;do{u.push(a=new Date(+n)),e(n,o),t(n)}while(a=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Ue.setTime(+e),qe.setTime(+r),t(Ue),t(qe),Math.floor(n(Ue,qe))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t==0}:function(e){return i.count(0,e)%t==0}):i:null}),i}var je=Pe((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));je.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Pe((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):je:null};var Ie=je;const $e=1e3,We=6e4,He=36e5,Ye=864e5,Ge=6048e5,Ve=31536e6;var Xe=Pe((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*$e)}),(function(t,e){return(e-t)/$e}),(function(t){return t.getUTCSeconds()})),Je=Xe,Ze=Pe((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*$e)}),(function(t,e){t.setTime(+t+e*We)}),(function(t,e){return(e-t)/We}),(function(t){return t.getMinutes()})),Qe=Ze,Ke=Pe((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*$e-t.getMinutes()*We)}),(function(t,e){t.setTime(+t+e*He)}),(function(t,e){return(e-t)/He}),(function(t){return t.getHours()})),tn=Ke,en=Pe((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*We)/Ye),(t=>t.getDate()-1)),nn=en;function rn(t){return Pe((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*We)/Ge}))}var on=rn(0),an=rn(1);rn(2),rn(3);var un=rn(4);rn(5),rn(6);var sn=Pe((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),ln=sn,cn=Pe((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));cn.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Pe((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var fn=cn,hn=Pe((function(t){t.setUTCSeconds(0,0)}),(function(t,e){t.setTime(+t+e*We)}),(function(t,e){return(e-t)/We}),(function(t){return t.getUTCMinutes()})),dn=hn,pn=Pe((function(t){t.setUTCMinutes(0,0,0)}),(function(t,e){t.setTime(+t+e*He)}),(function(t,e){return(e-t)/He}),(function(t){return t.getUTCHours()})),gn=pn,mn=Pe((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/Ye}),(function(t){return t.getUTCDate()-1})),yn=mn;function vn(t){return Pe((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/Ge}))}var _n=vn(0),xn=vn(1);vn(2),vn(3);var bn=vn(4);vn(5),vn(6);var wn=Pe((function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCMonth(t.getUTCMonth()+e)}),(function(t,e){return e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())}),(function(t){return t.getUTCMonth()})),kn=wn,An=Pe((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));An.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Pe((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Mn=An;function En(t,e,n,r,i,o){const a=[[Je,1,$e],[Je,5,5e3],[Je,15,15e3],[Je,30,3e4],[o,1,We],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,He],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,Ye],[r,2,1728e5],[n,1,Ge],[e,1,2592e6],[e,3,7776e6],[t,1,Ve]];function u(e,n,r){const i=Math.abs(n-e)/r,o=$t((t=>{let[,,e]=t;return e})).right(a,i);if(o===a.length)return t.every(se(e/Ve,n/Ve,r));if(0===o)return Ie.every(Math.max(se(e,n,r),1));const[u,s]=a[i/a[o-1][2](t[e]=1+n,t)),{});function Wn(t){const e=$(t).slice(),n={};return e.length||u("Missing time unit."),e.forEach((t=>{rt($n,t)?n[t]=1:u("Invalid time unit: ".concat(t,"."))})),(n.week||n.day?1:0)+(n.quarter||n.month||n.date?1:0)+(n.dayofyear?1:0)>1&&u("Incompatible time units: ".concat(t)),e.sort(((t,e)=>$n[t]-$n[e])),e}const Hn={[Bn]:"%Y ",[Tn]:"Q%q ",[Nn]:"%b ",[On]:"%d ",[zn]:"W%U ",[Rn]:"%a ",[Ln]:"%j ",[Un]:"%H:00",[qn]:"00:%M",[Pn]:":%S",[jn]:".%L",["".concat(Bn,"-").concat(Nn)]:"%Y-%m ",["".concat(Bn,"-").concat(Nn,"-").concat(On)]:"%Y-%m-%d ",["".concat(Un,"-").concat(qn)]:"%H:%M"};function Yn(t,e){const n=K({},Hn,e),r=Wn(t),i=r.length;let o,a,u="",s=0;for(s=0;ss;--o)if(a=r.slice(s,o).join("-"),null!=n[a]){u+=n[a],s=o;break}return u.trim()}const Gn=new Date;function Vn(t){return Gn.setFullYear(t),Gn.setMonth(0),Gn.setDate(1),Gn.setHours(0,0,0,0),Gn}function Xn(t){return Zn(new Date(t))}function Jn(t){return Qn(new Date(t))}function Zn(t){return nn.count(Vn(t.getFullYear())-1,t)}function Qn(t){return on.count(Vn(t.getFullYear())-1,t)}function Kn(t){return Vn(t).getDay()}function tr(t,e,n,r,i,o,a){if(0<=t&&t<100){const u=new Date(-1,e,n,r,i,o,a);return u.setFullYear(t),u}return new Date(t,e,n,r,i,o,a)}function er(t){return rr(new Date(t))}function nr(t){return ir(new Date(t))}function rr(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return yn.count(e-1,t)}function ir(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return _n.count(e-1,t)}function or(t){return Gn.setTime(Date.UTC(t,0,1)),Gn.getUTCDay()}function ar(t,e,n,r,i,o,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,r,i,o,a));return t.setUTCFullYear(n.y),t}return new Date(Date.UTC(t,e,n,r,i,o,a))}function ur(t,e,n,r,i){const o=e||1,a=A(t),u=(t,e,i)=>function(t,e,n,r){const i=n<=1?t:r?(e,i)=>r+n*Math.floor((t(e,i)-r)/n):(e,r)=>n*Math.floor(t(e,r)/n);return e?(t,n)=>e(i(t,n),n):i}(n[i=i||t],r[i],t===a&&o,e),s=new Date,l=Dt(t),c=l.year?u(Bn):Z(2012),f=l.month?u(Nn):l.quarter?u(Tn):h,p=l.week&&l.day?u(Rn,1,zn+Rn):l.week?u(zn,1):l.day?u(Rn,1):l.date?u(On,1):l.dayofyear?u(Ln,1):d,g=l.hours?u(Un):h,m=l.minutes?u(qn):h,y=l.seconds?u(Pn):h,v=l.milliseconds?u(jn):h;return function(t){s.setTime(+t);const e=c(s);return i(e,f(s),p(s,e),g(s),m(s),y(s),v(s))}}function sr(t,e,n){return e+7*t-(n+6)%7}const lr={[Bn]:t=>t.getFullYear(),[Tn]:t=>Math.floor(t.getMonth()/3),[Nn]:t=>t.getMonth(),[On]:t=>t.getDate(),[Un]:t=>t.getHours(),[qn]:t=>t.getMinutes(),[Pn]:t=>t.getSeconds(),[jn]:t=>t.getMilliseconds(),[Ln]:t=>Zn(t),[zn]:t=>Qn(t),[zn+Rn]:(t,e)=>sr(Qn(t),t.getDay(),Kn(e)),[Rn]:(t,e)=>sr(1,t.getDay(),Kn(e))},cr={[Tn]:t=>3*t,[zn]:(t,e)=>sr(t,0,Kn(e))};function fr(t,e){return ur(t,e||1,lr,cr,tr)}const hr={[Bn]:t=>t.getUTCFullYear(),[Tn]:t=>Math.floor(t.getUTCMonth()/3),[Nn]:t=>t.getUTCMonth(),[On]:t=>t.getUTCDate(),[Un]:t=>t.getUTCHours(),[qn]:t=>t.getUTCMinutes(),[Pn]:t=>t.getUTCSeconds(),[jn]:t=>t.getUTCMilliseconds(),[Ln]:t=>rr(t),[zn]:t=>ir(t),[Rn]:(t,e)=>sr(1,t.getUTCDay(),or(e)),[zn+Rn]:(t,e)=>sr(ir(t),t.getUTCDay(),or(e))},dr={[Tn]:t=>3*t,[zn]:(t,e)=>sr(t,0,or(e))};function pr(t,e){return ur(t,e||1,hr,dr,ar)}const gr={[Bn]:fn,[Tn]:ln.every(3),[Nn]:ln,[zn]:on,[On]:nn,[Rn]:nn,[Ln]:nn,[Un]:tn,[qn]:Qe,[Pn]:Je,[jn]:Ie},mr={[Bn]:Mn,[Tn]:kn.every(3),[Nn]:kn,[zn]:_n,[On]:yn,[Rn]:yn,[Ln]:yn,[Un]:gn,[qn]:dn,[Pn]:Je,[jn]:Ie};function yr(t){return gr[t]}function vr(t){return mr[t]}function _r(t,e,n){return t?t.offset(e,n):void 0}function xr(t,e,n){return _r(yr(t),e,n)}function br(t,e,n){return _r(vr(t),e,n)}function wr(t,e,n,r){return t?t.range(e,n,r):void 0}function kr(t,e,n,r){return wr(yr(t),e,n,r)}function Ar(t,e,n,r){return wr(vr(t),e,n,r)}const Mr=31536e6,Er=[Bn,Nn,On,Un,qn,Pn,jn],Dr=Er.slice(0,-1),Cr=Dr.slice(0,-1),Fr=Cr.slice(0,-1),Sr=Fr.slice(0,-1),Br=[Bn,Nn],Tr=[Bn],Nr=[[Dr,1,1e3],[Dr,5,5e3],[Dr,15,15e3],[Dr,30,3e4],[Cr,1,6e4],[Cr,5,3e5],[Cr,15,9e5],[Cr,30,18e5],[Fr,1,36e5],[Fr,3,108e5],[Fr,6,216e5],[Fr,12,432e5],[Sr,1,864e5],[[Bn,zn],1,6048e5],[Br,1,2592e6],[Br,3,7776e6],[Tr,1,Mr]];function zr(t){const e=t.extent,n=t.maxbins||40,r=Math.abs(bt(e))/n;let i,o,a=$t((t=>t[2])).right(Nr,r);return a===Nr.length?(i=Tr,o=se(e[0]/Mr,e[1]/Mr,n)):a?(a=Nr[r/Nr[a-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:oo,s:ao,S:Ei,u:Di,U:Ci,V:Si,w:Bi,W:Ti,x:null,X:null,y:Ni,Y:Oi,Z:Li,"%":io},x={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:Ui,e:Ui,f:$i,g:to,G:no,H:qi,I:Pi,j:ji,L:Ii,m:Wi,M:Hi,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:oo,s:ao,S:Yi,u:Gi,U:Vi,V:Ji,w:Zi,W:Qi,x:null,X:null,y:Ki,Y:eo,Z:ro,"%":io},b={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=f.exec(e.slice(n));return r?(t.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=y.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return A(t,e,n,r)},d:si,e:si,f:pi,g:ii,G:ri,H:ci,I:ci,j:li,L:di,m:ui,M:fi,p:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:ai,Q:mi,s:yi,S:hi,u:Kr,U:ti,V:ei,w:Qr,W:ni,x:function(t,e,r){return A(t,n,e,r)},X:function(t,e,n){return A(t,r,e,n)},y:ii,Y:ri,Z:oi,"%":gi};function w(t,e){return function(n){var r,i,o,a=[],u=-1,s=0,l=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Rr(Lr(o.y,0,1))).getUTCDay(),r=i>4||0===i?xn.ceil(r):xn(r),r=yn.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Or(Lr(o.y,0,1))).getDay(),r=i>4||0===i?an.ceil(r):an(r),r=nn.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Rr(Lr(o.y,0,1)).getUTCDay():Or(Lr(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Rr(o)):Or(o)}}function A(t,e,n,r){for(var i,o,a=0,u=e.length,s=n.length;a=s)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=b[i in Wr?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return _.x=w(n,_),_.X=w(r,_),_.c=w(e,_),x.x=w(n,x),x.X=w(r,x),x.c=w(e,x),{format:function(t){var e=w(t+="",_);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=w(t+="",x);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var qr,Pr,jr,Ir,$r,Wr={"-":"",_:" ",0:"0"},Hr=/^\s*\d+/,Yr=/^%/,Gr=/[\\^$*+?|[\]().{}]/g;function Vr(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),e])))}function Qr(t,e,n){var r=Hr.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Kr(t,e,n){var r=Hr.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function ti(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function ei(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ni(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ri(t,e,n){var r=Hr.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function ii(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function oi(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ai(t,e,n){var r=Hr.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function ui(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function si(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function li(t,e,n){var r=Hr.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function ci(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function fi(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function hi(t,e,n){var r=Hr.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function di(t,e,n){var r=Hr.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function pi(t,e,n){var r=Hr.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function gi(t,e,n){var r=Yr.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function mi(t,e,n){var r=Hr.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function yi(t,e,n){var r=Hr.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function vi(t,e){return Vr(t.getDate(),e,2)}function _i(t,e){return Vr(t.getHours(),e,2)}function xi(t,e){return Vr(t.getHours()%12||12,e,2)}function bi(t,e){return Vr(1+nn.count(fn(t),t),e,3)}function wi(t,e){return Vr(t.getMilliseconds(),e,3)}function ki(t,e){return wi(t,e)+"000"}function Ai(t,e){return Vr(t.getMonth()+1,e,2)}function Mi(t,e){return Vr(t.getMinutes(),e,2)}function Ei(t,e){return Vr(t.getSeconds(),e,2)}function Di(t){var e=t.getDay();return 0===e?7:e}function Ci(t,e){return Vr(on.count(fn(t)-1,t),e,2)}function Fi(t){var e=t.getDay();return e>=4||0===e?un(t):un.ceil(t)}function Si(t,e){return t=Fi(t),Vr(un.count(fn(t),t)+(4===fn(t).getDay()),e,2)}function Bi(t){return t.getDay()}function Ti(t,e){return Vr(an.count(fn(t)-1,t),e,2)}function Ni(t,e){return Vr(t.getFullYear()%100,e,2)}function zi(t,e){return Vr((t=Fi(t)).getFullYear()%100,e,2)}function Oi(t,e){return Vr(t.getFullYear()%1e4,e,4)}function Ri(t,e){var n=t.getDay();return Vr((t=n>=4||0===n?un(t):un.ceil(t)).getFullYear()%1e4,e,4)}function Li(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Vr(e/60|0,"0",2)+Vr(e%60,"0",2)}function Ui(t,e){return Vr(t.getUTCDate(),e,2)}function qi(t,e){return Vr(t.getUTCHours(),e,2)}function Pi(t,e){return Vr(t.getUTCHours()%12||12,e,2)}function ji(t,e){return Vr(1+yn.count(Mn(t),t),e,3)}function Ii(t,e){return Vr(t.getUTCMilliseconds(),e,3)}function $i(t,e){return Ii(t,e)+"000"}function Wi(t,e){return Vr(t.getUTCMonth()+1,e,2)}function Hi(t,e){return Vr(t.getUTCMinutes(),e,2)}function Yi(t,e){return Vr(t.getUTCSeconds(),e,2)}function Gi(t){var e=t.getUTCDay();return 0===e?7:e}function Vi(t,e){return Vr(_n.count(Mn(t)-1,t),e,2)}function Xi(t){var e=t.getUTCDay();return e>=4||0===e?bn(t):bn.ceil(t)}function Ji(t,e){return t=Xi(t),Vr(bn.count(Mn(t),t)+(4===Mn(t).getUTCDay()),e,2)}function Zi(t){return t.getUTCDay()}function Qi(t,e){return Vr(xn.count(Mn(t)-1,t),e,2)}function Ki(t,e){return Vr(t.getUTCFullYear()%100,e,2)}function to(t,e){return Vr((t=Xi(t)).getUTCFullYear()%100,e,2)}function eo(t,e){return Vr(t.getUTCFullYear()%1e4,e,4)}function no(t,e){var n=t.getUTCDay();return Vr((t=n>=4||0===n?bn(t):bn.ceil(t)).getUTCFullYear()%1e4,e,4)}function ro(){return"+0000"}function io(){return"%"}function oo(t){return+t}function ao(t){return Math.floor(+t/1e3)}function uo(t){const e={};return n=>e[n]||(e[n]=t(n))}function so(t){const e=uo(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=Ae(t||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return r=e(n),i=e(".1f")(1)[1],t=>{const e=r(t),n=e.indexOf(i);if(n<0)return e;let o=function(t,e){let n,r=t.lastIndexOf("e");if(r>0)return r;for(r=t.length;--r>e;)if(n=t.charCodeAt(r),n>=48&&n<=57)return r+1}(e,n);const a=on;)if("0"!==e[o]){++o;break}return e.slice(0,o)+a}}return e(n);var r,i},formatSpan(t,r,i,o){o=Ae(null==o?",f":o);const a=se(t,r,i),u=Math.max(Math.abs(t),Math.abs(r));let s;if(null==o.precision)switch(o.type){case"s":return isNaN(s=Re(a,u))||(o.precision=s),n(o,u);case"":case"e":case"g":case"p":case"r":isNaN(s=Le(a,u))||(o.precision=s-("e"===o.type));break;case"f":case"%":isNaN(s=Oe(a))||(o.precision=s-2*("%"===o.type))}return e(o)}}}let lo,co;function fo(){return lo=so({format:Se,formatPrefix:Be})}function ho(t){return so(ze(t))}function po(t){return arguments.length?lo=ho(t):lo}function go(t,e,n){_(n=n||{})||u("Invalid time multi-format specifier: ".concat(n));const r=e(Pn),i=e(qn),o=e(Un),a=e(On),s=e(zn),l=e(Nn),c=e(Tn),f=e(Bn),h=t(n.milliseconds||".%L"),d=t(n.seconds||":%S"),p=t(n.minutes||"%I:%M"),g=t(n.hours||"%I %p"),m=t(n.date||n.day||"%a %d"),y=t(n.week||"%b %d"),v=t(n.month||"%B"),x=t(n.quarter||"%B"),b=t(n.year||"%Y");return t=>(r(t)pt(t)?e(t):go(e,yr,t),utcFormat:t=>pt(t)?n(t):go(n,vr,t),timeParse:uo(t.parse),utcParse:uo(t.utcParse)}}function yo(){return co=mo({format:Pr,parse:jr,utcFormat:Ir,utcParse:$r})}function vo(t){return mo(Ur(t))}function _o(t){return arguments.length?co=vo(t):co}qr=Ur({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),Pr=qr.format,jr=qr.parse,Ir=qr.utcFormat,$r=qr.utcParse,fo(),yo();const xo=(t,e)=>K({},t,e);function bo(t,e){const n=t?ho(t):po(),r=e?vo(e):_o();return xo(n,r)}function wo(t,e){const n=arguments.length;return n&&2!==n&&u("defaultLocale expects either zero or two arguments."),n?xo(po(t),_o(e)):xo(po(),_o())}const ko=/^(data:|([A-Za-z]+:)?\/\/)/,Ao=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,Mo=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;async function Eo(t,e){const n=await this.sanitize(t,e),r=n.href;return n.localFile?this.file(r):this.http(r,e)}async function Do(t,e){e=K({},this.options,e);const n=this.fileAccess,r={href:null};let i,o,a;const s=Ao.test(t.replace(Mo,""));null!=t&&"string"==typeof t&&s||u("Sanitize failure, invalid URI: "+wt(t));const l=ko.test(t);return(a=e.baseURL)&&!l&&(t.startsWith("/")||a.endsWith("/")||(t="/"+t),t=a+t),o=(i=t.startsWith("file://"))||"file"===e.mode||"http"!==e.mode&&!l&&n,i?t=t.slice(7):t.startsWith("//")&&("file"===e.defaultProtocol?(t=t.slice(2),o=!0):t=(e.defaultProtocol||"http")+":"+t),Object.defineProperty(r,"localFile",{value:!!o}),r.href=t,e.target&&(r.target=e.target+""),e.rel&&(r.rel=e.rel+""),"image"===e.context&&e.crossOrigin&&(r.crossOrigin=e.crossOrigin+""),r}function Co(t){return t?e=>new Promise(((n,r)=>{t.readFile(e,((t,e)=>{t?r(t):n(e)}))})):Fo}async function Fo(){u("No file system access.")}function So(t){return t?async function(e,n){const r=K({},this.options.http,n),i=n&&n.response,o=await t(e,r);return o.ok?H(o[i])?o[i]():o.text():u(o.status+""+o.statusText)}:Bo}async function Bo(){u("No HTTP fetch method available.")}const To=t=>!(Number.isNaN(+t)||t instanceof Date),No={boolean:kt,integer:M,number:M,date:Mt,string:Et,unknown:f},zo=[t=>"true"===t||"false"===t||!0===t||!1===t,t=>To(t)&&Number.isInteger(+t),To,t=>!Number.isNaN(Date.parse(t))],Oo=["boolean","integer","number","date"];function Ro(t,e){if(!t||!t.length)return"unknown";const n=t.length,r=zo.length,i=zo.map(((t,e)=>e+1));for(let a,u,s=0,l=0;s0===t?e:t),0)-1]}function Lo(t,e){return e.reduce(((e,n)=>(e[n]=Ro(t,n),e)),{})}function Uo(t){const e=function(e,n){const r={delimiter:t};return qo(e,n?K(n,r):r)};return e.responseType="text",e}function qo(t,e){return e.header&&(t=e.header.map(wt).join(e.delimiter)+"\n"+t),function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,u=0,s=o<=0,l=!1;function c(){if(s)return Bt;if(l)return l=!1,St;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++=o?s=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+zt(t,6):zt(t,4)}(t.getUTCFullYear())+"-"+zt(t.getUTCMonth()+1,2)+"-"+zt(t.getUTCDate(),2)+(i?"T"+zt(e,2)+":"+zt(n,2)+":"+zt(r,2)+"."+zt(i,3)+"Z":r?"T"+zt(e,2)+":"+zt(n,2)+":"+zt(r,2)+"Z":n||e?"T"+zt(e,2)+":"+zt(n,2)+"Z":"")}(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=Tt(t);return function(r,i){return e(n(r),i,t)}}(t,e):Tt(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=Nt(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=Nt(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}(e.delimiter).parse(t+"")}function Po(t,e){const n=e&&e.property?l(e.property):f;return!_(t)||(r=t,"function"==typeof Buffer&&H(Buffer.isBuffer)&&Buffer.isBuffer(r))?n(JSON.parse(t)):function(t,e){return!v(t)&&ft(t)&&(t=[...t]),e&&e.copy?JSON.parse(JSON.stringify(t)):t}(n(t),e);var r}qo.responseType="text",Po.responseType="json";const jo={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function Io(t,e){let n,r,i,o;return t=Po(t,e),e&&e.feature?(n=Rt,i=e.feature):e&&e.mesh?(n=Pt,i=e.mesh,o=jo[e.filter]):u("Missing TopoJSON feature or mesh parameter."),r=(r=t.objects[i])?n(t,r,o):u("Invalid TopoJSON object: "+i),r&&r.features||[r]}Io.responseType="json";const $o={dsv:qo,csv:Uo(","),tsv:Uo("\t"),json:Po,topojson:Io};function Wo(t,e){return arguments.length>1?($o[t]=e,this):rt($o,t)?$o[t]:null}function Ho(t){const e=Wo(t);return e&&e.responseType||"text"}function Yo(t,e,n,r){const i=Wo((e=e||{}).type||"json");return i||u("Unknown data format type: "+e.type),t=i(t,e),e.parse&&function(t,e,n,r){if(!t.length)return;const i=_o();n=n||i.timeParse,r=r||i.utcParse;let o,a,u,s,l,c,f=t.columns||Object.keys(t[0]);"auto"===e&&(e=Lo(t,f)),f=Object.keys(e);const h=f.map((t=>{const i=e[t];let o,a;if(i&&(i.startsWith("date:")||i.startsWith("utc:")))return o=i.split(/:(.+)?/,2),a=o[1],("'"===a[0]&&"'"===a[a.length-1]||'"'===a[0]&&'"'===a[a.length-1])&&(a=a.slice(1,-1)),("utc"===o[0]?r:n)(a);if(!No[i])throw Error("Illegal format pattern: "+t+":"+i);return No[i]}));for(u=0,l=t.length,c=f.length;u({options:e||{},sanitize:Do,load:Eo,fileAccess:!1,file:Co(null),http:So(t)})}("undefined"!=typeof fetch&&fetch);function Vo(t){const e=t||f,n=[],r={};return n.add=t=>{const i=e(t);return r[i]||(r[i]=1,n.push(t)),n},n.remove=t=>{const i=e(t);if(r[i]){r[i]=0;const e=n.indexOf(t);e>=0&&n.splice(e,1)}return n},n}async function Xo(t,e){try{await e(t)}catch(e){t.error(e)}}const Jo=Symbol("vega_id");let Zo=1;function Qo(t){return!(!t||!Ko(t))}function Ko(t){return t[Jo]}function ta(t,e){return t[Jo]=e,t}function ea(t){const e=t===Object(t)?t:{data:t};return Ko(e)?e:ta(e,Zo++)}function na(t){return ra(t,ea({}))}function ra(t,e){for(const n in t)e[n]=t[n];return e}function ia(t,e){return ta(e,Ko(t))}function oa(t,e){return t?e?(n,r)=>t(n,r)||Ko(e(n))-Ko(e(r)):(e,n)=>t(e,n)||Ko(e)-Ko(n):null}function aa(t){return t&&t.constructor===ua}function ua(){const t=[],e=[],n=[],r=[],i=[];let o=null,a=!1;return{constructor:ua,insert(e){const n=$(e),r=n.length;for(let e=0;e{p(t)&&(l[Ko(t)]=-1)}));for(f=0,h=t.length;f0&&(y(g,p,d.value),u.modifies(p));for(f=0,h=i.length;f{p(t)&&l[Ko(t)]>0&&y(t,d.field,d.value)})),u.modifies(d.field);if(a)u.mod=e.length||r.length?s.filter((t=>l[Ko(t)]>0)):s.slice();else for(m in c)u.mod.push(c[m]);return(o||null==o&&(e.length||r.length))&&u.clean(!0),u}}}const sa="_:mod:_";function la(){Object.defineProperty(this,sa,{writable:!0,value:{}})}la.prototype={set(t,e,n,r){const i=this,o=i[t],a=i[sa];return null!=e&&e>=0?(o[e]!==n||r)&&(o[e]=n,a[e+":"+t]=-1,a[t]=-1):(o!==n||r)&&(i[t]=n,a[t]=v(n)?1+n.length:-1),i},modified(t,e){const n=this[sa];if(!arguments.length){for(const t in n)if(n[t])return!0;return!1}if(v(t)){for(let e=0;e=0?e+1{a instanceof ha?(a!==this&&(e&&a.targets().add(this),o.push(a)),i.push({op:a,name:t,index:n})):r.set(t,n,a)};for(a in t)if(s=t[a],"pulse"===a)$(s).forEach((t=>{t instanceof ha?t!==this&&(t.targets().add(this),o.push(t)):u("Pulse parameters must be operator instances.")})),this.source=s;else if(v(s))for(r.set(a,-1,Array(l=s.length)),c=0;c{const n=Date.now();return n-e>t?(e=n,1):0}))},debounce(t){const e=ma();return this.targets().add(ma(null,null,Q(t,(t=>{const n=t.dataflow;e.receive(t),n&&n.run&&n.run()})))),e},between(t,e){let n=!1;return t.targets().add(ma(null,null,(()=>n=!0))),e.targets().add(ma(null,null,(()=>n=!1))),this.filter((()=>n))},detach(){this._filter=p,this._targets=null}};const ya={skip:!0};function va(t,e,n,r,i,o){const a=K({},o,ya);let u,s;H(n)||(n=Z(n)),void 0===r?u=e=>t.touch(n(e)):H(r)?(s=new ha(null,r,i,!1),u=e=>{s.evaluate(e);const r=n(e),i=s.value;aa(i)?t.pulse(r,i,o):t.update(r,i,a)}):u=e=>t.update(n(e),r,a),e.apply(u)}function _a(t,e,n,r,i,o){if(void 0===r)e.targets().add(n);else{const a=o||{},u=new ha(null,function(t,e){return e=H(e)?e:Z(e),t?function(n,r){const i=e(n,r);return t.skip()||(t.skip(i!==this.value).value=i),i}:e}(n,r),i,!1);u.modified(a.force),u.rank=e.rank,e.targets().add(u),n&&(u.skip(!0),u.value=n.value,u.targets().add(n),t.connect(n,[u]))}}const xa={};function ba(t,e,n){this.dataflow=t,this.stamp=null==e?-1:e,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function wa(t,e){const n=[];return Ft(t,e,(t=>n.push(t))),n}function ka(t,e){const n={};return t.visit(e,(t=>{n[Ko(t)]=1})),t=>n[Ko(t)]?null:t}function Aa(t,e){return t?(n,r)=>t(n,r)&&e(n,r):e}function Ma(t,e,n,r){const i=this;let o=0;this.dataflow=t,this.stamp=e,this.fields=null,this.encode=r||null,this.pulses=n;for(const t of n)if(t.stamp===e){if(t.fields){const e=i.fields||(i.fields={});for(const n in t.fields)e[n]=1}t.changed(i.ADD)&&(o|=i.ADD),t.changed(i.REM)&&(o|=i.REM),t.changed(i.MOD)&&(o|=i.MOD)}this.changes=o}function Ea(t){return t.error("Dataflow already running. Use runAsync() to chain invocations."),t}ba.prototype={StopPropagation:xa,ADD:1,REM:2,MOD:4,ADD_REM:3,ADD_MOD:5,ALL:7,REFLOW:8,SOURCE:16,NO_SOURCE:32,NO_FIELDS:64,fork(t){return new ba(this.dataflow).init(this,t)},clone(){const t=this.fork(7);return t.add=t.add.slice(),t.rem=t.rem.slice(),t.mod=t.mod.slice(),t.source&&(t.source=t.source.slice()),t.materialize(23)},addAll(){let t=this;return!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length||(t=new ba(this.dataflow).init(this),t.add=t.source,t.rem=[]),t},init(t,e){const n=this;return n.stamp=t.stamp,n.encode=t.encode,!t.fields||64&e||(n.fields=t.fields),1&e?(n.addF=t.addF,n.add=t.add):(n.addF=null,n.add=[]),2&e?(n.remF=t.remF,n.rem=t.rem):(n.remF=null,n.rem=[]),4&e?(n.modF=t.modF,n.mod=t.mod):(n.modF=null,n.mod=[]),32&e?(n.srcF=null,n.source=null):(n.srcF=t.srcF,n.source=t.source,t.cleans&&(n.cleans=t.cleans)),n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||7;return 1&e&&this.add.length||2&e&&this.rem.length||4&e&&this.mod.length},reflow(t){if(t)return this.fork(7).reflow();const e=this.add.length,n=this.source&&this.source.length;return n&&n!==e&&(this.mod=this.source,e&&this.filter(4,ka(this,1))),this},clean(t){return arguments.length?(this.cleans=!!t,this):this.cleans},modifies(t){const e=this.fields||(this.fields={});return v(t)?t.forEach((t=>e[t]=!0)):e[t]=!0,this},modified(t,e){const n=this.fields;return!(!e&&!this.mod.length||!n)&&(arguments.length?v(t)?t.some((t=>n[t])):n[t]:!!n)},filter(t,e){const n=this;return 1&t&&(n.addF=Aa(n.addF,e)),2&t&&(n.remF=Aa(n.remF,e)),4&t&&(n.modF=Aa(n.modF,e)),16&t&&(n.srcF=Aa(n.srcF,e)),n},materialize(t){const e=this;return 1&(t=t||7)&&e.addF&&(e.add=wa(e.add,e.addF),e.addF=null),2&t&&e.remF&&(e.rem=wa(e.rem,e.remF),e.remF=null),4&t&&e.modF&&(e.mod=wa(e.mod,e.modF),e.modF=null),16&t&&e.srcF&&(e.source=e.source.filter(e.srcF),e.srcF=null),e},visit(t,e){const n=this,r=e;if(16&t)return Ft(n.source,n.srcF,r),n;1&t&&Ft(n.add,n.addF,r),2&t&&Ft(n.rem,n.remF,r),4&t&&Ft(n.mod,n.modF,r);const i=n.source;if(8&t&&i){const t=n.add.length+n.mod.length;t===i.length||Ft(i,t?ka(n,5):n.srcF,r)}return n}},ut(Ma,ba,{fork(t){const e=new ba(this.dataflow).init(this,t&this.NO_FIELDS);return void 0!==t&&(t&e.ADD&&this.visit(e.ADD,(t=>e.add.push(t))),t&e.REM&&this.visit(e.REM,(t=>e.rem.push(t))),t&e.MOD&&this.visit(e.MOD,(t=>e.mod.push(t)))),e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return n&&e.changes&e.MOD?v(t)?t.some((t=>n[t])):n[t]:0},filter(){u("MultiPulse does not support filtering.")},materialize(){u("MultiPulse does not support materialization.")},visit(t,e){const n=this,r=n.pulses,i=r.length;let o=0;if(t&n.SOURCE)for(;oe&&(o=n-1>>1,i=t[o],r(a,i)<0);)t[n]=i,n=o;return t[n]=a}function Fa(){this.logger(y()),this.logLevel(1),this._clock=0,this._rank=0,this._locale=wo();try{this._loader=Go()}catch(t){}this._touched=Vo(c),this._input={},this._pulse=null,this._heap=function(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>(e.push(n),Ca(e,0,e.length-1,t)),pop:()=>{const n=e.pop();let r;return e.length?(r=e[0],e[0]=n,function(t,e,n){const r=e,i=t.length,o=t[e];let a,u=1+(e<<1);for(;u=0&&(u=a),t[e]=t[u],u=1+((e=u)<<1);t[e]=o,Ca(t,r,e,n)}(e,0,t)):r=n,r}}}(((t,e)=>t.qrank-e.qrank)),this._postrun=[]}function Sa(t){return function(){return this._log[t].apply(this,arguments)}}function Ba(t,e){ha.call(this,t,null,e)}Fa.prototype={stamp(){return this._clock},loader(t){return arguments.length?(this._loader=t,this):this._loader},locale(t){return arguments.length?(this._locale=t,this):this._locale},logger(t){return arguments.length?(this._log=t,this):this._log},error:Sa("error"),warn:Sa("warn"),info:Sa("info"),debug:Sa("debug"),logLevel:Sa("level"),cleanThreshold:1e4,add:function(t,e,n,r){let i,o=1;return t instanceof ha?i=t:t&&t.prototype instanceof ha?i=new t:H(t)?i=new ha(null,t):(o=0,i=new ha(t,e)),this.rank(i),o&&(r=n,n=e),n&&this.connect(i,i.parameters(n,r)),this.touch(i),i},connect:function(t,e){const n=t.rank,r=e.length;for(let i=0;i=0;)e.push(n=r[i]),n===t&&u("Cycle detected in dataflow graph.")},pulse:function(t,e,n){this.touch(t,n||Da);const r=new ba(this,this._clock+(this._pulse?0:1)),i=t.pulse&&t.pulse.source||[];return r.target=t,this._input[t.id]=e.pulse(r,i),this},touch:function(t,e){const n=e||Da;return this._pulse?this._enqueue(t):this._touched.add(t),n.skip&&t.skip(!0),this},update:function(t,e,n){const r=n||Da;return(t.set(e)||r.force)&&this.touch(t,r),this},changeset:ua,ingest:function(t,e,n){return e=this.parse(e,n),this.pulse(t,this.changeset().insert(e))},parse:function(t,e){const n=this.locale();return Yo(t,e,n.timeParse,n.utcParse)},preload:async function(t,e,n){const r=this,i=r._pending||function(t){let e;const n=new Promise((t=>e=t));return n.requests=0,n.done=()=>{0==--n.requests&&(t._pending=null,e(t))},t._pending=n}(r);i.requests+=1;const o=await r.request(e,n);return r.pulse(t,r.changeset().remove(p).insert(o.data||[])),i.done(),o},request:async function(t,e){const n=this;let r,i=0;try{r=await n.loader().load(t,{context:"dataflow",response:Ho(e&&e.type)});try{r=n.parse(r,e)}catch(e){i=-2,n.warn("Data ingestion failed",t,e)}}catch(e){i=-1,n.warn("Loading failed",t,e)}return{data:r,status:i}},events:function(t,e,n,r){const i=this,o=ma(n,r),a=function(t){t.dataflow=i;try{o.receive(t)}catch(t){i.error(t)}finally{i.run()}};let u;u="string"==typeof t&&"undefined"!=typeof document?document.querySelectorAll(t):$(t);const s=u.length;for(let t=0;tr._enqueue(t,!0))),r._touched=Vo(c);let a,u,s,l=0;try{for(;r._heap.size()>0;)a=r._heap.pop(),a.rank===a.qrank?(u=a.run(r._getPulse(a,t)),u.then?u=await u:u.async&&(i.push(u.async),u=xa),u!==xa&&a._targets&&a._targets.forEach((t=>r._enqueue(t))),++l):r._enqueue(a,!0)}catch(t){r._heap.clear(),s=t}if(r._input={},r._pulse=null,r.debug("Pulse ".concat(o,": ").concat(l," operators")),s&&(r._postrun=[],r.error(s)),r._postrun.length){const t=r._postrun.sort(((t,e)=>e.priority-t.priority));r._postrun=[];for(let e=0;er.runAsync(null,(()=>{t.forEach((t=>{try{t(r)}catch(t){r.error(t)}}))})))),r},run:function(t,e,n){return this._pulse?Ea(this):(this.evaluate(t,e,n),this)},runAsync:async function(t,e,n){for(;this._running;)await this._running;const r=()=>this._running=null;return(this._running=this.evaluate(t,e,n)).then(r,r),this._running},runAfter:function(t,e,n){if(this._pulse||e)this._postrun.push({priority:n||0,callback:t});else try{t(this)}catch(t){this.error(t)}},_enqueue:function(t,e){const n=t.stampt.pulse)),e):this._input[t.id]||function(t,e){return e&&e.stamp===t.stamp?e:(t=t.fork(),e&&e!==xa&&(t.source=e.source),t)}(this._pulse,n&&n.pulse)}},ut(Ba,ha,{run(t){if(t.stampthis.pulse=t)):e!==t.StopPropagation&&(this.pulse=e),e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);return e.clear(),n},transform(){}});const Ta={};function Na(t){const e=za(t);return e&&e.Definition||null}function za(t){return t=t&&t.toLowerCase(),rt(Ta,t)?Ta[t]:null}function*Oa(t,e){if(null==e)for(let e of t)null!=e&&""!==e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)r=e(r,++n,t),null!=r&&""!==r&&(r=+r)>=r&&(yield r)}}function Ra(t,e,n){const r=Float64Array.from(Oa(t,n));return r.sort(It),e.map((t=>pe(r,t)))}function La(t,e){return Ra(t,[.25,.5,.75],e)}function Ua(t,e){const n=t.length,r=function(t,e){const n=function(t,e){let n,r=0,i=0,o=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,o+=n*(e-i));else{let a=-1;for(let u of t)null!=(u=e(u,++a,t))&&(u=+u)>=u&&(n=u-i,i+=n/++r,o+=n*(u-i))}if(r>1)return o/(r-1)}(t,e);return n?Math.sqrt(n):n}(t,e),i=La(t,e),o=(i[2]-i[0])/1.34;return 1.06*(Math.min(r,o)||r||Math.abs(i[0])||1)*Math.pow(n,-.2)}function qa(t){const e=t.maxbins||20,n=t.base||10,r=Math.log(n),i=t.divide||[5,2];let o,a,u,s,l,c,f=t.extent[0],h=t.extent[1];const d=t.span||h-f||Math.abs(f)||1;if(t.step)o=t.step;else if(t.steps){for(s=d/e,l=0,c=t.steps.length;le;)o*=n;for(l=0,c=i.length;l=u&&d/s<=e&&(o=s)}s=Math.log(o);const p=s>=0?0:1+~~(-s/r),g=Math.pow(n,-p-1);return(t.nice||void 0===t.nice)&&(s=Math.floor(f/o+g)*o,f=ft);const i=t.length,o=new Float64Array(i);let a,u=0,s=1,l=r(t[0]),c=l,f=l+e;for(;s=f){for(c=(l+c)/2;u>1);ia;)t[i--]=t[o]}o=a,a=r}return t}(o,e+e/4):o}t.random=Math.random;const Ia=Math.sqrt(2*Math.PI),$a=Math.SQRT2;let Wa=NaN;function Ha(e,n){e=e||0,n=null==n?1:n;let r,i,o=0,a=0;if(Wa==Wa)o=Wa,Wa=NaN;else{do{o=2*t.random()-1,a=2*t.random()-1,r=o*o+a*a}while(0===r||r>1);i=Math.sqrt(-2*Math.log(r)/r),o*=i,Wa=a*i}return e+o*n}function Ya(t,e,n){const r=(t-(e||0))/(n=null==n?1:n);return Math.exp(-.5*r*r)/(n*Ia)}function Ga(t,e,n){const r=(t-(e=e||0))/(n=null==n?1:n),i=Math.abs(r);let o;if(i>37)o=0;else{const t=Math.exp(-i*i/2);let e;i<7.07106781186547?(e=.0352624965998911*i+.700383064443688,e=e*i+6.37396220353165,e=e*i+33.912866078383,e=e*i+112.079291497871,e=e*i+221.213596169931,e=e*i+220.206867912376,o=t*e,e=.0883883476483184*i+1.75566716318264,e=e*i+16.064177579207,e=e*i+86.7807322029461,e=e*i+296.564248779674,e=e*i+637.333633378831,e=e*i+793.826512519948,e=e*i+440.413735824752,o/=e):(e=i+.65,e=i+4/e,e=i+3/e,e=i+2/e,e=i+1/e,o=t/e/2.506628274631)}return r>0?1-o:o}function Va(t,e,n){return t<0||t>1?NaN:(e||0)+(null==n?1:n)*$a*function(t){let e,n=-Math.log((1-t)*(1+t));return n<6.25?(n-=3.125,e=-364441206401782e-35,e=e*n-16850591381820166e-35,e=128584807152564e-32+e*n,e=11157877678025181e-33+e*n,e=e*n-1333171662854621e-31,e=20972767875968562e-33+e*n,e=6637638134358324e-30+e*n,e=e*n-4054566272975207e-29,e=e*n-8151934197605472e-29,e=26335093153082323e-28+e*n,e=e*n-12975133253453532e-27,e=e*n-5415412054294628e-26,e=1.0512122733215323e-9+e*n,e=e*n-4.112633980346984e-9,e=e*n-2.9070369957882005e-8,e=4.2347877827932404e-7+e*n,e=e*n-13654692000834679e-22,e=e*n-13882523362786469e-21,e=.00018673420803405714+e*n,e=e*n-.000740702534166267,e=e*n-.006033670871430149,e=.24015818242558962+e*n,e=1.6536545626831027+e*n):n<16?(n=Math.sqrt(n)-3.25,e=2.2137376921775787e-9,e=9.075656193888539e-8+e*n,e=e*n-2.7517406297064545e-7,e=1.8239629214389228e-8+e*n,e=15027403968909828e-22+e*n,e=e*n-4013867526981546e-21,e=29234449089955446e-22+e*n,e=12475304481671779e-21+e*n,e=e*n-47318229009055734e-21,e=6828485145957318e-20+e*n,e=24031110387097894e-21+e*n,e=e*n-.0003550375203628475,e=.0009532893797373805+e*n,e=e*n-.0016882755560235047,e=.002491442096107851+e*n,e=e*n-.003751208507569241,e=.005370914553590064+e*n,e=1.0052589676941592+e*n,e=3.0838856104922208+e*n):Number.isFinite(n)?(n=Math.sqrt(n)-5,e=-27109920616438573e-27,e=e*n-2.555641816996525e-10,e=1.5076572693500548e-9+e*n,e=e*n-3.789465440126737e-9,e=7.61570120807834e-9+e*n,e=e*n-1.496002662714924e-8,e=2.914795345090108e-8+e*n,e=e*n-6.771199775845234e-8,e=2.2900482228026655e-7+e*n,e=e*n-9.9298272942317e-7,e=4526062597223154e-21+e*n,e=e*n-1968177810553167e-20,e=7599527703001776e-20+e*n,e=e*n-.00021503011930044477,e=e*n-.00013871931833623122,e=1.0103004648645344+e*n,e=4.849906401408584+e*n):e=1/0,e*t}(2*t-1)}function Xa(t,e){let n,r;const i={mean(t){return arguments.length?(n=t||0,i):n},stdev(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>Ha(n,r),pdf:t=>Ya(t,n,r),cdf:t=>Ga(t,n,r),icdf:t=>Va(t,n,r)};return i.mean(t).stdev(e)}function Ja(e,n){const r=Xa();let i=0;const o={data(t){return arguments.length?(e=t,i=t?t.length:0,o.bandwidth(n)):e},bandwidth(t){return arguments.length?(!(n=t)&&e&&(n=Ua(e)),o):n},sample:()=>e[~~(t.random()*i)]+n*r.sample(),pdf(t){let o=0,a=0;for(;aZa(n,r),pdf:t=>Qa(t,n,r),cdf:t=>Ka(t,n,r),icdf:t=>tu(t,n,r)};return i.mean(t).stdev(e)}function nu(e,n){let r,i=0;const o={weights(t){return arguments.length?(r=function(t){const e=[];let n,r=0;for(n=0;n=e&&t<=n?1/(n-e):0}function ou(t,e,n){return null==n&&(n=null==e?1:e,e=0),tn?1:(t-e)/(n-e)}function au(t,e,n){return null==n&&(n=null==e?1:e,e=0),t>=0&&t<=1?e+t*(n-e):NaN}function uu(t,e){let n,r;const i={min(t){return arguments.length?(n=t||0,i):n},max(t){return arguments.length?(r=null==t?1:t,i):r},sample:()=>ru(n,r),pdf:t=>iu(t,n,r),cdf:t=>ou(t,n,r),icdf:t=>au(t,n,r)};return null==e&&(e=null==t?1:t,t=0),i.min(t).max(e)}function su(t,e,n,r){const i=r-t*t,o=Math.abs(i)<1e-24?0:(n-t*e)/i;return[e-o*t,o]}function lu(t,e,n,r){t=t.filter((t=>{let r=e(t),i=n(t);return null!=r&&(r=+r)>=r&&null!=i&&(i=+i)>=i})),r&&t.sort(((t,n)=>e(t)-e(n)));const i=t.length,o=new Float64Array(i),a=new Float64Array(i);let u,s,l,c=0,f=0,h=0;for(l of t)o[c]=u=+e(l),a[c]=s=+n(l),++c,f+=(u-f)/c,h+=(s-h)/c;for(c=0;c=i&&null!=o&&(o=+o)>=o&&r(i,o,++a)}function fu(t,e,n,r,i){let o=0,a=0;return cu(t,e,n,((t,e)=>{const n=e-i(t),u=e-r;o+=n*n,a+=u*u})),1-o/a}function hu(t,e,n){let r=0,i=0,o=0,a=0,u=0;cu(t,e,n,((t,e)=>{++u,r+=(t-r)/u,i+=(e-i)/u,o+=(t*e-o)/u,a+=(t*t-a)/u}));const s=su(r,i,o,a),l=t=>s[0]+s[1]*t;return{coef:s,predict:l,rSquared:fu(t,e,n,i,l)}}function du(t,e,n){let r=0,i=0,o=0,a=0,u=0;cu(t,e,n,((t,e)=>{++u,t=Math.log(t),r+=(t-r)/u,i+=(e-i)/u,o+=(t*e-o)/u,a+=(t*t-a)/u}));const s=su(r,i,o,a),l=t=>s[0]+s[1]*Math.log(t);return{coef:s,predict:l,rSquared:fu(t,e,n,i,l)}}function pu(t,e,n){const[r,i,o,a]=lu(t,e,n);let u,s,l,c=0,f=0,h=0,d=0,p=0;cu(t,e,n,((t,e)=>{u=r[p++],s=Math.log(e),l=u*e,c+=(e*s-c)/p,f+=(l-f)/p,h+=(l*s-h)/p,d+=(u*l-d)/p}));const[g,m]=su(f/a,c/a,h/a,d/a),y=t=>Math.exp(g+m*(t-o));return{coef:[Math.exp(g-m*o),m],predict:y,rSquared:fu(t,e,n,a,y)}}function gu(t,e,n){let r=0,i=0,o=0,a=0,u=0,s=0;cu(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++s,r+=(n-r)/s,i+=(l-i)/s,o+=(n*l-o)/s,a+=(n*n-a)/s,u+=(e-u)/s}));const l=su(r,i,o,a),c=t=>l[0]*Math.pow(t,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:fu(t,e,n,u,c)}}function mu(t,e,n){const[r,i,o,a]=lu(t,e,n),u=r.length;let s,l,c,f,h=0,d=0,p=0,g=0,m=0;for(s=0;s_*(t-=o)*t+x*t+b+a;return{coef:[b-x*o+_*o*o+a,x-2*_*o,_],predict:w,rSquared:fu(t,e,n,a,w)}}function yu(t,e,n,r){if(1===r)return hu(t,e,n);if(2===r)return mu(t,e,n);const[i,o,a,u]=lu(t,e,n),s=i.length,l=[],c=[],f=r+1;let h,d,p,g,m;for(h=0;hMath.abs(t[r][a])&&(a=i);for(o=r;o=r;o--)t[o][i]-=t[o][r]*t[r][i]/t[r][r]}for(i=e-1;i>=0;--i){for(u=0,o=i+1;o{t-=a;let e=u+y[0]+y[1]*t+y[2]*t*t;for(h=3;h=0;--o)for(u=e[o],s=1,i[o]+=u,a=1;a<=o;++a)s*=(o+1-a)/a,i[o-a]+=u*Math.pow(n,a)*s;return i[0]+=r,i}function _u(t,e,n,r){const[i,o,a,u]=lu(t,e,n,!0),s=i.length,l=Math.max(2,~~(r*s)),c=new Float64Array(s),f=new Float64Array(s),h=new Float64Array(s).fill(1);for(let t=-1;++t<=2;){const e=[0,l-1];for(let t=0;ti[a]-n?r:a;let s=0,l=0,d=0,p=0,g=0;const m=1/Math.abs(i[u]-n||1);for(let t=r;t<=a;++t){const e=i[t],r=o[t],a=xu(Math.abs(n-e)*m)*h[t],u=e*a;s+=a,l+=u,d+=r*a,p+=r*u,g+=e*u}const[y,v]=su(l/s,d/s,p/s,g/s);c[t]=y+v*n,f[t]=Math.abs(o[t]-c[t]),bu(i,t+1,e)}if(2===t)break;const n=ge(f);if(Math.abs(n)<1e-12)break;for(let t,e,r=0;r=1?1e-12:(e=1-t*t)*e}return function(t,e,n,r){const i=t.length,o=[];let a,u=0,s=0,l=[];for(;u=t.length))for(;e>i&&t[o]-r<=r-t[i];)n[0]=++i,n[1]=o,++o}const wu=.5*Math.PI/180;function ku(t,e,n,r){n=n||25,r=Math.max(n,r||200);const i=e=>[e,t(e)],o=e[0],a=e[1],u=a-o,s=u/r,l=[i(o)],c=[];if(n===r){for(let t=1;t0;)c.push(i(o+t/n*u));let f=l[0],h=c[c.length-1];const d=1/u,p=function(t,e){let n=t,r=t;const i=e.length;for(let t=0;tr&&(r=i)}return 1/(r-n)}(f[1],c);for(;h;){const t=i((f[0]+h[0])/2);t[0]-f[0]>=s&&Au(f,t,h,d,p)>wu?c.push(t):(f=h,l.push(h),c.pop()),h=c[c.length-1]}return l}function Au(t,e,n,r,i){const o=Math.atan2(i*(n[1]-t[1]),r*(n[0]-t[0])),a=Math.atan2(i*(e[1]-t[1]),r*(e[0]-t[0]));return Math.abs(o-a)}function Mu(t){return t&&t.length?1===t.length?t[0]:(e=t,t=>{const n=e.length;let r=1,i=String(e[0](t));for(;r{},Cu={init:Du,add:Du,rem:Du,idx:0},Fu={values:{init:t=>t.cell.store=!0,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.sum,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:void 0,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:void 0,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:void 0,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):void 0,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:void 0,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):void 0,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=void 0,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{(e{e<=t.min&&(t.min=NaN)},req:["values"],idx:4},max:{init:t=>t.max=void 0,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{(e>t.max||void 0===t.max)&&(t.max=e)},rem:(t,e)=>{e>=t.max&&(t.max=NaN)},req:["values"],idx:4},argmin:{init:t=>t.argmin=void 0,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{e{e<=t.min&&(t.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=void 0,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{e>t.max&&(t.argmax=n)},rem:(t,e)=>{e>=t.max&&(t.argmax=void 0)},req:["max","values"],idx:3}},Su=Object.keys(Fu);function Bu(t,e){return Fu[t](e)}function Tu(t,e){return t.idx-e.idx}function Nu(){this.valid=0,this.missing=0,this._ops.forEach((t=>t.init(this)))}function zu(t,e){null!=t&&""!==t?t==t&&(++this.valid,this._ops.forEach((n=>n.add(this,t,e)))):++this.missing}function Ou(t,e){null!=t&&""!==t?t==t&&(--this.valid,this._ops.forEach((n=>n.rem(this,t,e)))):--this.missing}function Ru(t){return this._out.forEach((e=>t[e.out]=e.value(this))),t}function Lu(t,e){const n=e||f,r=function(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{t.req&&t.req.forEach((t=>{e[t]||n(e[t]=Fu[t]())}))};return t.forEach(n),Object.values(e).sort(Tu)}(t),i=t.slice().sort(Tu);function o(t){this._ops=r,this._out=i,this.cell=t,this.init()}return o.prototype.init=Nu,o.prototype.add=zu,o.prototype.rem=Ou,o.prototype.set=Ru,o.prototype.get=n,o.fields=t.map((t=>t.out)),o}function Uu(t){this._key=t?l(t):Ko,this.reset()}Su.forEach((t=>{Fu[t]=function(t,e){return n=>K({name:t,out:n||t},Cu,e)}(t,Fu[t])}));const qu=Uu.prototype;function Pu(t){Ba.call(this,null,t),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}function ju(t){Ba.call(this,null,t)}function Iu(t,e,n){const r=t;let i=e||[],o=n||[],a={},u=0;return{add:t=>o.push(t),remove:t=>a[r(t)]=++u,size:()=>i.length,data:(t,e)=>(u&&(i=i.filter((t=>!a[r(t)])),a={},u=0),e&&t&&i.sort(t),o.length&&(i=t?vt(t,i,o.sort(t)):i.concat(o),o=[]),i)}}function $u(t){Ba.call(this,[],t)}function Wu(t){ha.call(this,null,Hu,t)}function Hu(t){return this.value&&!t.modified()?this.value:Y(t.fields,t.orders)}function Yu(t){Ba.call(this,null,t)}function Gu(t){Ba.call(this,null,t)}qu.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},qu.add=function(t){this._add.push(t)},qu.rem=function(t){this._rem.push(t)},qu.values=function(){if(this._get=null,0===this._rem.length)return this._add;const t=this._add,e=this._rem,n=this._key,r=t.length,i=e.length,o=Array(r-i),a={};let u,s,l;for(u=0;u=0;)r=t(e[i])+"",rt(n,r)||(n[r]=1,++o);return o},qu.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=et(e,t);this._ext=[e[n[0]],e[n[1]]],this._get=t}return this._ext},qu.argmin=function(t){return this.extent(t)[0]||{}},qu.argmax=function(t){return this.extent(t)[1]||{}},qu.min=function(t){const e=this.extent(t)[0];return null!=e?t(e):void 0},qu.max=function(t){const e=this.extent(t)[1];return null!=e?t(e):void 0},qu.quartile=function(t){return this._get===t&&this._q||(this._q=La(this.values(),t),this._get=t),this._q},qu.q1=function(t){return this.quartile(t)[0]},qu.q2=function(t){return this.quartile(t)[1]},qu.q3=function(t){return this.quartile(t)[2]},qu.ci=function(t){return this._get===t&&this._ci||(this._ci=Pa(this.values(),1e3,.05,t),this._get=t),this._ci},qu.ci0=function(t){return this.ci(t)[0]},qu.ci1=function(t){return this.ci(t)[1]},Pu.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:Su},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},ut(Pu,Ba,{transform(t,e){const n=this,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.modified();return n.stamp=r.stamp,n.value&&(i||e.modified(n._inputs,!0))?(n._prev=n.value,n.value=i?n.init(t):{},e.visit(e.SOURCE,(t=>n.add(t)))):(n.value=n.value||n.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),r.modifies(n._outputs),n._drop=!1!==t.drop,t.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),e.clean()&&n._drop&&r.clean(!0).runAfter((()=>this.clean())),n.changes(r)},cross(){const t=this,e=t.value,n=t._dnames,r=n.map((()=>({}))),i=n.length;function o(t){let e,o,a,u;for(e in t)for(a=t[e].tuple,o=0;o{const e=n(t);return a(t),i.push(e),e})),this.cellkey=t.key?t.key:Mu(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=t.fields||[null],l=t.ops||["count"],c=t.as||[],f=s.length,h={};let d,p,g,m,y,v;for(f!==l.length&&u("Unmatched number of fields and aggregate ops."),v=0;vLu(t,t.field))),{}},cellkey:Mu(),cell(t,e){let n=this.value[t];return n?0===n.num&&this._drop&&n.stamp{const e=i(t);t[s]=e,t[l]=null==e?null:o+a*(1+(e-o)/a)}:t=>t[s]=i(t)),e.modifies(n?u:s)},_bins(t){if(this.value&&!t.modified())return this.value;const i=t.field,o=qa(t),a=o.step;let u,s,l=o.start,c=l+Math.ceil((o.stop-l)/a)*a;null!=(u=t.anchor)&&(s=u-(l+a*Math.floor((u-l)/a)),l+=s,c+=s);const f=function(t){let e=M(i(t));return null==e?null:ec?1/0:(e=Math.max(l,Math.min(e,c-a)),l+a*Math.floor(1e-14+(e-l)/a))};return f.start=l,f.stop=o.stop,f.step=a,this.value=e(f,r(i),t.name||"bin_"+n(i))}}),$u.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},ut($u,Ba,{transform(t,e){const n=e.fork(e.ALL),r=Iu(Ko,this.value,n.materialize(n.ADD).add),i=t.sort,o=e.changed()||i&&(t.modified("sort")||e.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(oa(i),o),e.source&&e.source.root&&(this.value.root=e.source.root),n}}),ut(Wu,ha),Yu.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},ut(Yu,Ba,{transform(t,e){const n=e=>n=>{for(var r,i=function(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase()}return t.match(n)}(u(n),t.case,o)||[],s=0,l=i.length;si[t]=1+(i[t]||0))),c=n((t=>i[t]-=1));return r?e.visit(e.SOURCE,l):(e.visit(e.ADD,l),e.visit(e.REM,c)),this._finish(e,s)},_parameterCheck(t,e){let n=!1;return!t.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(t.stopwords||"")+"$","i"),n=!0),!t.modified("pattern")&&this._match||(this._match=new RegExp(t.pattern||"[\\w']+","g"),n=!0),(t.modified("field")||e.modified(t.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(t,e){const n=this._counts,r=this._tuples||(this._tuples={}),i=e[0],o=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let u,s,l;for(u in n)s=r[u],l=n[u]||0,!s&&l?(r[u]=s=ea({}),s[i]=u,s[o]=l,a.add.push(s)):0===l?(s&&a.rem.push(s),n[u]=null,r[u]=null):s[o]!==l&&(s[o]=l,a.mod.push(s));return a.modifies(e)}}),Gu.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},ut(Gu,Ba,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.as||["a","b"],i=r[0],o=r[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let u=this.value;return a?(u&&(n.rem=u),u=e.materialize(e.SOURCE).source,n.add=this.value=function(t,e,n,r){for(var i,o,a=[],u={},s=t.length,l=0;lXu(t,e)))):"function"==typeof r[n]&&r[n](t[n]);return r}function Ju(t){Ba.call(this,null,t)}const Zu=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],Qu={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:Zu},{name:"weights",type:"number",array:!0}]};function Ku(t,e){return t?t.map(((t,r)=>e[r]||n(t))):null}function ts(t,e,n){const r=[],i=t=>t(s);let o,a,u,s,l,c;if(null==e)r.push(t.map(n));else for(o={},a=0,u=t.length;ai(e,t)),r(i),n(i))}function is(t){Ba.call(this,[void 0,void 0],t)}function os(t,e){ha.call(this,t),this.parent=e,this.count=0}function as(t){Ba.call(this,{},t),this._keys=ot();const e=this._targets=[];e.active=0,e.forEach=t=>{for(let n=0,r=e.active;nl(t))):l(t.name,t.as)}function ls(t){Ba.call(this,ot(),t)}function cs(t){Ba.call(this,[],t)}function fs(t){Ba.call(this,[],t)}function hs(t){Ba.call(this,null,t)}function ds(t){Ba.call(this,[],t)}Ju.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Zu.concat(Qu)},{name:"as",type:"string",array:!0,default:["value","density"]}]},ut(Ju,Ba,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const r=Xu(t.distribution,function(t){return()=>t.materialize(t.SOURCE).source}(e)),i=t.steps||t.minsteps||25,o=t.steps||t.maxsteps||200;let a=t.method||"pdf";"pdf"!==a&&"cdf"!==a&&u("Invalid density method: "+a),t.extent||r.data||u("Missing density extent parameter."),a=r[a];const s=t.as||["value","density"],l=ku(a,t.extent||tt(r.data()),i,o).map((t=>{const e={};return e[s[0]]=t[0],e[s[1]]=t[1],ea(e)}));this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}}),es.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]},ut(es,Ba,{transform(t,e){if(this.value&&!t.modified()&&!e.changed())return e;const n=e.materialize(e.SOURCE).source,r=ts(e.source,t.groupby,f),i=t.smooth||!1,o=t.field,a=t.step||((t,e)=>bt(tt(t,e))/30)(n,o),u=oa(((t,e)=>o(t)-o(e))),s=t.as||"bin",l=r.length;let c,h=1/0,d=-1/0,p=0;for(;pd&&(d=e),t[++c][s]=e}return this.value={start:h,stop:d,step:a},e.reflow(!0).modifies(s)}}),ut(ns,ha),is.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},ut(is,Ba,{transform(t,e){const r=this.value,i=t.field,o=e.changed()||e.modified(i.fields)||t.modified("field");let a=r[0],u=r[1];if((o||null==a)&&(a=1/0,u=-1/0),e.visit(o?e.SOURCE:e.ADD,(t=>{const e=M(i(t));null!=e&&(eu&&(u=e))})),!Number.isFinite(a)||!Number.isFinite(u)){let t=n(i);t&&(t=' for field "'.concat(t,'"')),e.dataflow.warn("Infinite extent".concat(t,": [").concat(a,", ").concat(u,"]")),a=u=void 0}this.value=[a,u]}}),ut(os,ha,{connect(t){return this.detachSubflow=t.detachSubflow,this.targets().add(t),t.source=this},add(t){this.count+=1,this.value.add.push(t)},rem(t){this.count-=1,this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}}),ut(as,Ba,{activate(t){this._targets[this._targets.active++]=t},subflow(t,e,n,r){const i=this.value;let o,a,u=rt(i,t)&&i[t];return u?u.value.stampt&&t.count>0));this.initTargets(t)}},initTargets(t){const e=this._targets,n=e.length,r=t?t.length:0;let i=0;for(;ithis.subflow(t,i,e);return this._group=t.group||{},this.initTargets(),e.visit(e.REM,(t=>{const e=Ko(t),n=o.get(e);void 0!==n&&(o.delete(e),u(n).rem(t))})),e.visit(e.ADD,(t=>{const e=r(t);o.set(Ko(t),e),u(e).add(t)})),a||e.modified(r.fields)?e.visit(e.MOD,(t=>{const e=Ko(t),n=o.get(e),i=r(t);n===i?u(i).mod(t):(o.set(e,i),u(n).rem(t),u(i).add(t))})):e.changed(e.MOD)&&e.visit(e.MOD,(t=>{u(o.get(Ko(t))).mod(t)})),a&&e.visit(e.REFLOW,(t=>{const e=Ko(t),n=o.get(e),i=r(t);n!==i&&(o.set(e,i),u(n).rem(t),u(i).add(t))})),e.clean()?n.runAfter((()=>{this.clean(),o.clean()})):o.empty>n.cleanThreshold&&n.runAfter(o.clean),e}}),ut(us,ha),ls.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},ut(ls,Ba,{transform(t,e){const n=e.dataflow,r=this.value,i=e.fork(),o=i.add,a=i.rem,u=i.mod,s=t.expr;let l=!0;function c(e){const n=Ko(e),i=s(e,t),c=r.get(n);i&&c?(r.delete(n),o.push(e)):i||c?l&&i&&!c&&u.push(e):(r.set(n,1),a.push(e))}return e.visit(e.REM,(t=>{const e=Ko(t);r.has(e)?r.delete(e):a.push(t)})),e.visit(e.ADD,(e=>{s(e,t)?o.push(e):r.set(Ko(e),1)})),e.visit(e.MOD,c),t.modified()&&(l=!1,e.visit(e.REFLOW,c)),r.empty>n.cleanThreshold&&n.runAfter(r.clean),i}}),cs.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},ut(cs,Ba,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=Ku(r,t.as||[]),o=t.index||null,a=i.length;return n.rem=this.value,e.visit(e.SOURCE,(t=>{const e=r.map((e=>e(t))),u=e.reduce(((t,e)=>Math.max(t,e.length)),0);let s,l,c,f=0;for(;f{for(let e,n=0;ne[r]=n(e,t)))}}),ut(ds,Ba,{transform(t,e){const n=e.fork(e.ALL),r=t.generator;let i,o,a,u=this.value,s=t.size-u.length;if(s>0){for(i=[];--s>=0;)i.push(a=ea(r(t))),u.push(a);n.add=n.add.length?n.materialize(n.ADD).add.concat(i):i}else o=u.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o,u=u.slice(-s);return n.source=this.value=u,n}});const ps={value:"value",median:ge,mean:function(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n},min:ce,max:le},gs=[];function ms(t){Ba.call(this,[],t)}function ys(t){Pu.call(this,t)}function vs(t){Ba.call(this,null,t)}function _s(t){ha.call(this,null,xs,t)}function xs(t){return this.value&&!t.modified()?this.value:gt(t.fields,t.flat)}function bs(t){Ba.call(this,[],t),this._pending=null}function ws(t,e,n){n.forEach(ea);const r=e.fork(e.NO_FIELDS&e.NO_SOURCE);return r.rem=t.value,t.value=r.source=r.add=n,t._pending=null,r.rem.length&&r.clean(!0),r}function ks(t){Ba.call(this,{},t)}function As(t){ha.call(this,null,Ms,t)}function Ms(t){if(this.value&&!t.modified())return this.value;const e=t.extents,n=e.length;let r,i,o=1/0,a=-1/0;for(r=0;ra&&(a=i[1]);return[o,a]}function Es(t){ha.call(this,null,Ds,t)}function Ds(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function Cs(t){Ba.call(this,null,t)}function Fs(t){Pu.call(this,t)}function Ss(t){as.call(this,t)}function Bs(t){Ba.call(this,null,t)}function Ts(t){Ba.call(this,null,t)}function Ns(t){Ba.call(this,null,t)}function zs(t){Ba.call(this,null,t)}function Os(t){Ba.call(this,[],t),this.count=0}function Rs(t){Ba.call(this,null,t)}function Ls(t){Ba.call(this,null,t),this.modified(!0)}function Us(t){Ba.call(this,null,t)}ms.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},ut(ms,Ba,{transform(t,e){var r,i,o,a,s,l,c,f,h,d,p=e.fork(e.ALL),g=function(t){var e,n=t.method||ps.value;if(null!=ps[n])return n===ps.value?(e=void 0!==t.value?t.value:0,()=>e):ps[n];u("Unrecognized imputation method: "+n)}(t),m=function(t){const e=t.field;return t=>t?e(t):NaN}(t),y=n(t.field),v=n(t.key),_=(t.groupby||[]).map(n),x=function(t,e,n,r){var i,o,a,u,s,l,c,f,h=t=>t(f),d=[],p=r?r.slice():[],g={},m={};for(p.forEach(((t,e)=>g[t]=e+1)),u=0,c=t.length;un.add(t)))):(i=n.value=n.value||this.init(t),e.visit(e.REM,(t=>n.rem(t))),e.visit(e.ADD,(t=>n.add(t)))),n.changes(),e.visit(e.SOURCE,(t=>{K(t,i[n.cellkey(t)].tuple)})),e.reflow(r).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,r;for(n=0,r=this._alen;n{const n=Ja(e,s)[l],r=t.counts?e.length:1;ku(n,h||tt(e),d,p).forEach((t=>{const n={};for(let t=0;t(this._pending=$(t.data),t=>t.touch(this))));return{async:e}}return n.request(t.url,t.format).then((t=>ws(this,e,$(t.data))))}}),ks.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},ut(ks,Ba,{transform(t,e){const r=t.fields,i=t.index,o=t.values,a=null==t.default?null:t.default,s=t.modified(),l=r.length;let c,f,h,d=s?e.SOURCE:e.ADD,p=e,g=t.as;return o?(f=o.length,l>1&&!g&&u('Multi-field lookup requires explicit "as" parameter.'),g&&g.length!==l*f&&u('The "as" parameter has too few output field names.'),g=g||o.map(n),c=function(t){for(var e,n,u=0,s=0;ue.modified(t.fields))),d|=h?e.MOD:0),e.visit(d,c),p.modifies(g)}}),ut(As,ha),ut(Es,ha),ut(Cs,Ba,{transform(t,e){return this.modified(t.modified()),this.value=t,e.fork(e.NO_SOURCE|e.NO_FIELDS)}}),Fs.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:Su,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},ut(Fs,Pu,{_transform:Pu.prototype.transform,transform(t,n){return this._transform(function(t,n){const i=t.field,o=t.value,a=("count"===t.op?"__count__":t.op)||"sum",u=r(i).concat(r(o)),s=function(t,e,n){const r={},i=[];return n.visit(n.SOURCE,(e=>{const n=t(e);r[n]||(r[n]=1,i.push(n))})),i.sort(G),e?i.slice(0,e):i}(i,t.limit||0,n);return n.changed()&&t.set("__pivot__",null,null,!0),{key:t.key,groupby:t.groupby,ops:s.map((()=>a)),fields:s.map((t=>function(t,n,r,i){return e((e=>n(e)===t?r(e):NaN),i,t+"")}(t,i,o,u))),as:s.map((t=>t+"")),modified:t.modified.bind(t)}}(t,n),n)}}),ut(Ss,as,{transform(t,e){const n=t.subflow,i=t.field,o=t=>this.subflow(Ko(t),n,e,t);return(t.modified("field")||i&&e.modified(r(i)))&&u("PreFacet does not support field modification."),this.initTargets(),i?(e.visit(e.MOD,(t=>{const e=o(t);i(t).forEach((t=>e.mod(t)))})),e.visit(e.ADD,(t=>{const e=o(t);i(t).forEach((t=>e.add(ea(t))))})),e.visit(e.REM,(t=>{const e=o(t);i(t).forEach((t=>e.rem(t)))}))):(e.visit(e.MOD,(t=>o(t).mod(t))),e.visit(e.ADD,(t=>o(t).add(t))),e.visit(e.REM,(t=>o(t).rem(t)))),e.clean()&&e.runAfter((()=>this.clean())),e}}),Bs.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},ut(Bs,Ba,{transform(t,e){const n=e.fork(e.NO_SOURCE),r=t.fields,i=Ku(t.fields,t.as||[]),o=r?(t,e)=>function(t,e,n,r){for(let i=0,o=n.length;i{const e=Ko(t);n.rem.push(a[e]),a[e]=null})),e.visit(e.ADD,(t=>{const e=o(t,ea({}));a[Ko(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{n.mod.push(o(t,a[Ko(t)]))})),n}}),ut(Ts,Ba,{transform(t,e){return this.value=t.value,t.modified("value")?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}}),Ns.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]},ut(Ns,Ba,{transform(t,e){const r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.as||["prob","value"];if(this.value&&!t.modified()&&!e.changed())return r.source=this.value,r;const o=ts(e.materialize(e.SOURCE).source,t.groupby,t.field),a=(t.groupby||[]).map(n),u=[],s=t.step||.01,l=t.probs||ye(s/2,1-1e-14,s),c=l.length;return o.forEach((t=>{const e=Ra(t,l);for(let n=0;n{const e=Ko(t);n.rem.push(r[e]),r[e]=null})),e.visit(e.ADD,(t=>{const e=na(t);r[Ko(t)]=e,n.add.push(e)})),e.visit(e.MOD,(t=>{const e=r[Ko(t)];for(const r in t)e[r]=t[r],n.modifies(r);n.mod.push(e)}))),n}}),Os.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},ut(Os,Ba,{transform(e,n){const r=n.fork(n.NO_SOURCE),i=e.modified("size"),o=e.size,a=this.value.reduce(((t,e)=>(t[Ko(e)]=1,t)),{});let u=this.value,s=this.count,l=0;function c(e){let n,i;u.length=l&&(n=u[i],a[Ko(n)]&&r.rem.push(n),u[i]=e)),++s}if(n.rem.length&&(n.visit(n.REM,(t=>{const e=Ko(t);a[e]&&(a[e]=-1,r.rem.push(t)),--s})),u=u.filter((t=>-1!==a[Ko(t)]))),(n.rem.length||i)&&u.length{a[Ko(t)]||c(t)})),l=-1),i&&u.length>o){const t=u.length-o;for(let e=0;e{a[Ko(t)]&&r.mod.push(t)})),n.add.length&&n.visit(n.ADD,c),(n.add.length||l<0)&&(r.add=u.filter((t=>!a[Ko(t)]))),this.count=s,this.value=r.source=u,r}}),Rs.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},ut(Rs,Ba,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),r=t.as||"data";return n.rem=this.value?e.rem.concat(this.value):e.rem,this.value=ye(t.start,t.stop,t.step||1).map((t=>{const e={};return e[r]=t,ea(e)})),n.add=e.add.concat(this.value),n}}),ut(Ls,Ba,{transform(t,e){return this.value=e.source,e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});const qs=["unit0","unit1"];function Ps(t){Ba.call(this,ot(),t)}function js(t){Ba.call(this,null,t)}Us.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:In,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:qs}]},ut(Us,Ba,{transform(t,e){const n=t.field,i=!1!==t.interval,o="utc"===t.timezone,a=this._floor(t,e),u=(o?vr:yr)(a.unit).offset,s=t.as||qs,l=s[0],c=s[1],f=a.step;let h=a.start||1/0,d=a.stop||-1/0,p=e.ADD;return(t.modified()||e.changed(e.REM)||e.modified(r(n)))&&(p=(e=e.reflow(!0)).SOURCE,h=1/0,d=-1/0),e.visit(p,(t=>{const e=n(t);let r,o;null==e?(t[l]=null,i&&(t[c]=null)):(t[l]=r=o=a(e),i&&(t[c]=o=u(r,f)),rd&&(d=o))})),a.start=h,a.stop=d,e.modifies(i?s:l)},_floor(t,e){const n="utc"===t.timezone,{units:r,step:i}=t.units?{units:t.units,step:t.step||1}:zr({extent:t.extent||tt(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins}),o=Wn(r),a=this.value||{},u=(n?pr:fr)(o,i);return u.unit=A(o),u.units=o,u.step=i,u.start=a.start,u.stop=a.stop,this.value=u}}),ut(Ps,Ba,{transform(t,e){const n=e.dataflow,r=t.field,i=this.value,o=t=>i.set(r(t),t);let a=!0;return t.modified("field")||e.modified(r.fields)?(i.clear(),e.visit(e.SOURCE,o)):e.changed()?(e.visit(e.REM,(t=>i.delete(r(t)))),e.visit(e.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),e.fork()}}),ut(js,Ba,{transform(t,e){(!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields))&&(this.value=(t.sort?e.source.slice().sort(oa(t.sort)):e.source).map(t.field))}});const Is={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,r=e.data;return n&&e.compare(r[n-1],r[n])?++t:t}}},percent_rank:function(){const t=Is.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,r=e.compare;let i=e.index;if(t0||u("ntile num must be greater than zero.");const n=Is.cume_dist(),r=n.next;return{init:n.init,next:t=>Math.ceil(e*r(t))}},lag:function(t,e){return e=+e||1,{next:n=>{const r=n.index-e;return r>=0?t(n.data[r]):null}}},lead:function(t,e){return e=+e||1,{next:n=>{const r=n.index+e,i=n.data;return rt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){return(e=+e)>0||u("nth_value nth must be greater than zero."),{next:n=>{const r=n.i0+(e-1);return re=null,next:n=>{const r=t(n.data[n.index]);return null!=r?e=r:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:r=>{const i=r.data;return r.index<=n?e:(n=function(t,e,n){for(let r=e.length;nc[t]=1))}m(t.sort),e.forEach(((t,e)=>{const r=i[e],c=n(r),y=Eu(t,c,a[e]);if(m(r),s.push(y),rt(Is,t))l.push(function(t,e,n,r){const i=Is[t](e,n);return{init:i.init||h,update:function(t,e){e[r]=i.next(t)}}}(t,i[e],o[e],y));else{if(null==r&&"count"!==t&&u("Null aggregate field specified."),"count"===t)return void d.push(y);g=!1;let e=f[c];e||(e=f[c]=[],e.field=r,p.push(e)),e.push(Bu(t,y))}})),(d.length||p.length)&&(this.cell=function(t,e,n){t=t.map((t=>Lu(t,t.field)));const r={num:0,agg:null,store:!1,count:e};if(!n)for(var i=t.length,o=r.agg=Array(i),a=0;a0&&!i(o[n],o[n-1])&&(t.i0=e.left(o,o[n])),rt.init())),this.cell&&this.cell.init()},Hs.update=function(t,e){const n=this.cell,r=this.windows,i=t.data,o=r&&r.length;let a;if(n){for(a=t.p0;athis.group(i(t));let a=this.state;a&&!n||(a=this.state=new Ws(t)),n||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,(t=>o(t).add(t)))):(e.visit(e.REM,(t=>o(t).remove(t))),e.visit(e.ADD,(t=>o(t).add(t))));for(let e=0,n=this._mlen;eKs)if(Math.abs(c*u-s*l)>Ks&&i){var h=n-o,d=r-a,p=u*u+s*s,g=h*h+d*d,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Zs-Math.acos((p+f-g)/(2*m*y)))/2),_=v/y,x=v/m;Math.abs(_-1)>Ks&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*h>l*d)+","+(this._x1=t+x*u)+","+(this._y1=e+x*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e)},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),u=n*Math.sin(r),s=t+a,l=e+u,c=1^o,f=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+l:(Math.abs(this._x1-s)>Ks||Math.abs(this._y1-l)>Ks)&&(this._+="L"+s+","+l),n&&(f<0&&(f=f%Qs+Qs),f>tl?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-u)+"A"+n+","+n+",0,1,"+c+","+(this._x1=s)+","+(this._y1=l):f>Ks&&(this._+="A"+n+","+n+",0,"+ +(f>=Zs)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};const il=Math.abs,ol=Math.atan2,al=Math.cos,ul=Math.max,sl=Math.min,ll=Math.sin,cl=Math.sqrt,fl=1e-12,hl=Math.PI,dl=hl/2,pl=2*hl;function gl(t){return t>=1?dl:t<=-1?-dl:Math.asin(t)}function ml(t){return t.innerRadius}function yl(t){return t.outerRadius}function vl(t){return t.startAngle}function _l(t){return t.endAngle}function xl(t){return t&&t.padAngle}function bl(t,e,n,r,i,o,a){var u=t-n,s=e-r,l=(a?o:-o)/cl(u*u+s*s),c=l*s,f=-l*u,h=t+c,d=e+f,p=n+c,g=r+f,m=(h+p)/2,y=(d+g)/2,v=p-h,_=g-d,x=v*v+_*_,b=i-o,w=h*g-p*d,k=(_<0?-1:1)*cl(ul(0,b*b*x-w*w)),A=(w*_-v*k)/x,M=(-w*v-_*k)/x,E=(w*_+v*k)/x,D=(-w*v+_*k)/x,C=A-m,F=M-y,S=E-m,B=D-y;return C*C+F*F>S*S+B*B&&(A=E,M=D),{cx:A,cy:M,x01:-c,y01:-f,x11:A*(i/b-1),y11:M*(i/b-1)}}function wl(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function kl(t){this._context=t}function Al(t){return new kl(t)}function Ml(t){return t[0]}function El(t){return t[1]}function Dl(t,e){var n=rl(!0),r=null,i=Al,o=null;function a(a){var u,s,l,c=(a=wl(a)).length,f=!1;for(null==r&&(o=i(l=nl())),u=0;u<=c;++u)!(u=c;--f)u.point(m[f],y[f]);u.lineEnd(),u.areaEnd()}g&&(m[l]=+t(h,l,s),y[l]=+e(h,l,s),u.point(r?+r(h,l,s):m[l],n?+n(h,l,s):y[l]))}if(d)return u=null,d+""||null}function l(){return Dl().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Ml:rl(+t),e="function"==typeof e?e:rl(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?El:rl(+n),s.x=function(e){return arguments.length?(t="function"==typeof e?e:rl(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"==typeof e?e:rl(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:rl(+t),s):r},s.y=function(t){return arguments.length?(e="function"==typeof t?t:rl(+t),n=null,s):e},s.y0=function(t){return arguments.length?(e="function"==typeof t?t:rl(+t),s):e},s.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:rl(+t),s):n},s.lineX0=s.lineY0=function(){return l().x(t).y(e)},s.lineY1=function(){return l().x(t).y(n)},s.lineX1=function(){return l().x(r).y(e)},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:rl(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s}kl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Fl={draw(t,e){const n=cl(e/hl);t.moveTo(n,0),t.arc(0,0,n,0,pl)}};function Sl(){}function Bl(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Tl(t){this._context=t}function Nl(t){this._context=t}function zl(t){this._context=t}function Ol(t,e){this._basis=new Tl(t),this._beta=e}Tl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Bl(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Bl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Nl.prototype={areaStart:Sl,areaEnd:Sl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Bl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},zl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Bl(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Ol.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*e[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var Rl=function t(e){function n(t){return 1===e?new Tl(t):new Ol(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function Ll(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Ul(t,e){this._context=t,this._k=(1-e)/6}Ul.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Ll(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Ll(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var ql=function t(e){function n(t){return new Ul(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Pl(t,e){this._context=t,this._k=(1-e)/6}Pl.prototype={areaStart:Sl,areaEnd:Sl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Ll(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var jl=function t(e){function n(t){return new Pl(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Il(t,e){this._context=t,this._k=(1-e)/6}Il.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Ll(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var $l=function t(e){function n(t){return new Il(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Wl(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>fl){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>fl){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,c=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/c,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/c}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Hl(t,e){this._context=t,this._alpha=e}Hl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:Wl(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Yl=function t(e){function n(t){return e?new Hl(t,e):new Ul(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Gl(t,e){this._context=t,this._alpha=e}Gl.prototype={areaStart:Sl,areaEnd:Sl,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:Wl(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Vl=function t(e){function n(t){return e?new Gl(t,e):new Pl(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Xl(t,e){this._context=t,this._alpha=e}Xl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Wl(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Jl=function t(e){function n(t){return e?new Xl(t,e):new Il(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Zl(t){this._context=t}function Ql(t){return t<0?-1:1}function Kl(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Ql(o)+Ql(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function tc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function ec(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function nc(t){this._context=t}function rc(t){this._context=new ic(t)}function ic(t){this._context=t}function oc(t){this._context=t}function ac(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};const fc=Symbol("implicit");function hc(){var t=new Jt,e=[],n=[],r=fc;function i(i){let o=t.get(i);if(void 0===o){if(r!==fc)return r;t.set(i,o=e.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Jt;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return hc(e,n).unknown(r)},lc.apply(i,arguments),i}function dc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function gc(){}var mc=.7,yc=1/mc,vc="\\s*([+-]?\\d+)\\s*",_c="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xc="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",bc=/^#([0-9a-f]{3,8})$/,wc=new RegExp("^rgb\\("+[vc,vc,vc]+"\\)$"),kc=new RegExp("^rgb\\("+[xc,xc,xc]+"\\)$"),Ac=new RegExp("^rgba\\("+[vc,vc,vc,_c]+"\\)$"),Mc=new RegExp("^rgba\\("+[xc,xc,xc,_c]+"\\)$"),Ec=new RegExp("^hsl\\("+[_c,xc,xc]+"\\)$"),Dc=new RegExp("^hsla\\("+[_c,xc,xc,_c]+"\\)$"),Cc={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Fc(){return this.rgb().formatHex()}function Sc(){return this.rgb().formatRgb()}function Bc(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=bc.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Tc(e):3===n?new Rc(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Nc(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Nc(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=wc.exec(t))?new Rc(e[1],e[2],e[3],1):(e=kc.exec(t))?new Rc(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ac.exec(t))?Nc(e[1],e[2],e[3],e[4]):(e=Mc.exec(t))?Nc(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ec.exec(t))?Pc(e[1],e[2]/100,e[3]/100,1):(e=Dc.exec(t))?Pc(e[1],e[2]/100,e[3]/100,e[4]):Cc.hasOwnProperty(t)?Tc(Cc[t]):"transparent"===t?new Rc(NaN,NaN,NaN,0):null}function Tc(t){return new Rc(t>>16&255,t>>8&255,255&t,1)}function Nc(t,e,n,r){return r<=0&&(t=e=n=NaN),new Rc(t,e,n,r)}function zc(t){return t instanceof gc||(t=Bc(t)),t?new Rc((t=t.rgb()).r,t.g,t.b,t.opacity):new Rc}function Oc(t,e,n,r){return 1===arguments.length?zc(t):new Rc(t,e,n,null==r?1:r)}function Rc(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Lc(){return"#"+qc(this.r)+qc(this.g)+qc(this.b)}function Uc(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function qc(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pc(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new $c(t,e,n,r)}function jc(t){if(t instanceof $c)return new $c(t.h,t.s,t.l,t.opacity);if(t instanceof gc||(t=Bc(t)),!t)return new $c;if(t instanceof $c)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n0&&s<1?0:a,new $c(a,u,s,t.opacity)}function Ic(t,e,n,r){return 1===arguments.length?jc(t):new $c(t,e,n,null==r?1:r)}function $c(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Wc(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}dc(gc,Bc,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Fc,formatHex:Fc,formatHsl:function(){return jc(this).formatHsl()},formatRgb:Sc,toString:Sc}),dc(Rc,Oc,pc(gc,{brighter:function(t){return t=null==t?yc:Math.pow(yc,t),new Rc(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?mc:Math.pow(mc,t),new Rc(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Lc,formatHex:Lc,formatRgb:Uc,toString:Uc})),dc($c,Ic,pc(gc,{brighter:function(t){return t=null==t?yc:Math.pow(yc,t),new $c(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?mc:Math.pow(mc,t),new $c(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Rc(Wc(t>=240?t-240:t+120,i,r),Wc(t,i,r),Wc(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));const Hc=Math.PI/180,Yc=180/Math.PI,Gc=.96422,Vc=.82521,Xc=4/29,Jc=6/29,Zc=3*Jc*Jc;function Qc(t){if(t instanceof tf)return new tf(t.l,t.a,t.b,t.opacity);if(t instanceof uf)return sf(t);t instanceof Rc||(t=zc(t));var e,n,r=of(t.r),i=of(t.g),o=of(t.b),a=ef((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=ef((.4360747*r+.3850649*i+.1430804*o)/Gc),n=ef((.0139322*r+.0971045*i+.7141733*o)/Vc)),new tf(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Kc(t,e,n,r){return 1===arguments.length?Qc(t):new tf(t,e,n,null==r?1:r)}function tf(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function ef(t){return t>.008856451679035631?Math.pow(t,1/3):t/Zc+Xc}function nf(t){return t>Jc?t*t*t:Zc*(t-Xc)}function rf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function of(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function af(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof uf)return new uf(t.h,t.c,t.l,t.opacity);if(t instanceof tf||(t=Qc(t)),0===t.a&&0===t.b)return new uf(NaN,0=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function kf(t,e){return function(n){return t+n*e}}function Af(t,e){var n=e-t;return n?kf(t,n>180||n<-180?n-360*Math.round(n/360):n):wf(isNaN(t)?e:t)}function Mf(t,e){var n=e-t;return n?kf(t,n):wf(isNaN(t)?e:t)}var Ef=function t(e){var n=function(t){return 1==(t=+t)?Mf:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):wf(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=Oc(t)).r,(e=Oc(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Mf(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Df(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;no&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:zf(n,r)})),o=Lf.lastIndex;return o180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:zf(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:zf(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:zf(t,n)},{i:u-2,x:zf(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++ne&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?hh:fh,i=o=null,f}function f(e){return null==e||isNaN(e=+e)?n:(i||(i=r(a.map(t),u,s)))(t(l(e)))}return f.invert=function(n){return l(e((o||(o=r(u,a.map(t),zf)))(n)))},f.domain=function(t){return arguments.length?(a=Array.from(t,uh),c()):a.slice()},f.range=function(t){return arguments.length?(u=Array.from(t),c()):u.slice()},f.rangeRound=function(t){return u=Array.from(t),s=Pf,c()},f.clamp=function(t){return arguments.length?(l=!!t||lh,c()):l!==lh},f.interpolate=function(t){return arguments.length?(s=t,c()):s},f.unknown=function(t){return arguments.length?(n=t,f):n},function(n,r){return t=n,e=r,c()}}function gh(){return ph()(lh,lh)}function mh(t,e,n,r){var i,o=se(t,e,n);switch((r=Ae(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=Re(o,a))||(r.precision=i),Be(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=Le(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=Oe(o))||(r.precision=i-2*("%"===r.type))}return Se(r)}function yh(t){var e=t.domain;return t.ticks=function(t){var n=e();return ae(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return mh(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,u=o.length-1,s=o[a],l=o[u],c=10;for(l0;){if((i=ue(s,l,n))===r)return o[a]=s,o[u]=l,e(o);if(i>0)s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i}r=i}return t},t}function vh(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-e,n)}function Mh(t){const e=t(_h,xh),n=e.domain;let r,i,o=10;function a(){return r=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}(o),i=function(t){return 10===t?kh:t===Math.E?Math.exp:e=>Math.pow(t,e)}(o),n()[0]<0?(r=Ah(r),i=Ah(i),t(bh,wh)):t(_h,xh),e}return e.base=function(t){return arguments.length?(o=+t,a()):o},e.domain=function(t){return arguments.length?(n(t),a()):n()},e.ticks=t=>{const e=n();let a=e[0],u=e[e.length-1];const s=u0){for(;f<=h;++f)for(l=1;lu)break;p.push(c)}}else for(;f<=h;++f)for(l=o-1;l>=1;--l)if(c=f>0?l/i(-f):l*i(f),!(cu)break;p.push(c)}2*p.length{if(null==t&&(t=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=Ae(n)).precision||(n.trim=!0),n=Se(n)),t===1/0)return n;const a=Math.max(1,o*t/e.ticks().length);return t=>{let e=t/i(Math.round(r(t)));return e*on(vh(n(),{floor:t=>i(Math.floor(r(t))),ceil:t=>i(Math.ceil(r(t)))})),e}function Eh(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Dh(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function Ch(t){var e=1,n=t(Eh(e),Dh(e));return n.constant=function(n){return arguments.length?t(Eh(e=+n),Dh(e)):e},yh(n)}function Fh(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function Sh(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Bh(t){return t<0?-t*t:t*t}function Th(t){var e=t(lh,lh),n=1;function r(){return 1===n?t(lh,lh):.5===n?t(Sh,Bh):t(Fh(n),Fh(1/n))}return e.exponent=function(t){return arguments.length?(n=+t,r()):n},yh(e)}function Nh(){var t=Th(ph());return t.copy=function(){return dh(t,Nh()).exponent(t.exponent())},lc.apply(t,arguments),t}function zh(t){return new Date(t)}function Oh(t){return t instanceof Date?+t:+new Date(+t)}function Rh(t,e,n,r,i,o,a,u,s,l){var c=gh(),f=c.invert,h=c.domain,d=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),v=l("%b %d"),_=l("%B"),x=l("%Y");function b(t){return(s(t)0?r:1:0}const Wh="linear",Hh="log",Yh="pow",Gh="sqrt",Vh="symlog",Xh="time",Jh="utc",Zh="sequential",Qh="diverging",Kh="quantile",td="quantize",ed="threshold",nd="ordinal",rd="point",id="band",od="bin-ordinal",ad="continuous",ud="discrete",sd="discretizing",ld="interpolating",cd="temporal";function fd(){const t=hc().unknown(void 0),e=t.domain,n=t.range;let r,i,o=[0,1],a=!1,u=0,s=0,l=.5;function c(){const t=e().length,c=o[1]d+r*t));return n(c?p.reverse():p)}return delete t.unknown,t.domain=function(t){return arguments.length?(e(t),c()):e()},t.range=function(t){return arguments.length?(o=[+t[0],+t[1]],c()):o.slice()},t.rangeRound=function(t){return o=[+t[0],+t[1]],a=!0,c()},t.bandwidth=function(){return i},t.step=function(){return r},t.round=function(t){return arguments.length?(a=!!t,c()):a},t.padding=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),u=s,c()):u},t.paddingInner=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),c()):u},t.paddingOuter=function(t){return arguments.length?(s=Math.max(0,Math.min(1,t)),c()):s},t.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),c()):l},t.invertRange=function(t){if(null==t[0]||null==t[1])return;const r=o[1]o[1-r])?void 0:(s=Math.max(0,Yt(a,f)-1),l=f===h?s:Yt(a,h)-1,f-a[s]>i+1e-10&&++s,r&&(c=s,s=u-l,l=u-c),s>l?void 0:e().slice(s,l+1))},t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n},t.copy=function(){return fd().domain(e()).range(o).round(a).paddingInner(u).paddingOuter(s).align(l)},c()}function hd(t){const e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,t.copy=function(){return hd(e())},t}var dd=Array.prototype.map;const pd=Array.prototype.slice,gd={};function md(t,e,n){return arguments.length>1?(gd[t]=function(t,e,n){const r=function(){const n=e();return n.invertRange||(n.invertRange=n.invert?function(t){return function(e){let n,r=e[0],i=e[1];return i=u&&n[o]<=s&&(l<0&&(l=o),r=o);if(!(l<0))return u=t.invertExtent(n[l]),s=t.invertExtent(n[r]),[void 0===u[0]?u[1]:u[0],void 0===s[1]?s[0]:s[1]]}}(n):void 0),n.type=t,n};return r.metadata=Dt($(n)),r}(t,e,n),this):yd(t)?gd[t]:void 0}function yd(t){return rt(gd,t)}function vd(t,e){const n=gd[t];return n&&n.metadata[e]}function _d(t){return vd(t,ad)}function xd(t){return vd(t,ud)}function bd(t){return vd(t,sd)}function wd(t){return vd(t,Hh)}function kd(t){return vd(t,ld)}function Ad(t){return vd(t,Kh)}md("identity",(function t(e){var n;function r(t){return null==t||isNaN(t=+t)?n:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,uh),r):e.slice()},r.unknown=function(t){return arguments.length?(n=t,r):n},r.copy=function(){return t(e).unknown(n)},e=arguments.length?Array.from(e,uh):[0,1],yh(r)})),md(Wh,(function t(){var e=gh();return e.copy=function(){return dh(e,t())},lc.apply(e,arguments),yh(e)}),ad),md(Hh,(function t(){const e=Mh(ph()).domain([1,10]);return e.copy=()=>dh(e,t()).base(e.base()),lc.apply(e,arguments),e}),[ad,Hh]),md(Yh,Nh,ad),md(Gh,(function(){return Nh.apply(null,arguments).exponent(.5)}),ad),md(Vh,(function t(){var e=Ch(ph());return e.copy=function(){return dh(e,t()).constant(e.constant())},lc.apply(e,arguments)}),ad),md(Xh,(function(){return lc.apply(Rh(Fn,Sn,fn,ln,on,nn,tn,Qe,Je,Pr).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}),[ad,cd]),md(Jh,(function(){return lc.apply(Rh(Dn,Cn,Mn,kn,_n,yn,gn,dn,Je,Ir).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}),[ad,cd]),md(Zh,qh,[ad,ld]),md("".concat(Zh,"-").concat(Wh),qh,[ad,ld]),md("".concat(Zh,"-").concat(Hh),(function t(){var e=Mh(Lh()).domain([1,10]);return e.copy=function(){return Uh(e,t()).base(e.base())},cc.apply(e,arguments)}),[ad,ld,Hh]),md("".concat(Zh,"-").concat(Yh),Ph,[ad,ld]),md("".concat(Zh,"-").concat(Gh),(function(){return Ph.apply(null,arguments).exponent(.5)}),[ad,ld]),md("".concat(Zh,"-").concat(Vh),(function t(){var e=Ch(Lh());return e.copy=function(){return Uh(e,t()).constant(e.constant())},cc.apply(e,arguments)}),[ad,ld]),md("".concat(Qh,"-").concat(Wh),(function t(){var e=yh(jh()(lh));return e.copy=function(){return Uh(e,t())},cc.apply(e,arguments)}),[ad,ld]),md("".concat(Qh,"-").concat(Hh),(function t(){var e=Mh(jh()).domain([.1,1,10]);return e.copy=function(){return Uh(e,t()).base(e.base())},cc.apply(e,arguments)}),[ad,ld,Hh]),md("".concat(Qh,"-").concat(Yh),Ih,[ad,ld]),md("".concat(Qh,"-").concat(Gh),(function(){return Ih.apply(null,arguments).exponent(.5)}),[ad,ld]),md("".concat(Qh,"-").concat(Vh),(function t(){var e=Ch(jh());return e.copy=function(){return Uh(e,t()).constant(e.constant())},cc.apply(e,arguments)}),[ad,ld]),md(Kh,(function t(){var e,n=[],r=[],i=[];function o(){var t=0,e=Math.max(1,r.length);for(i=new Array(e-1);++t0?i[e-1]:n[0],e=i?[o[i-1],r]:[o[e-1],o[e]]},u.unknown=function(t){return arguments.length?(e=t,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return t().domain([n,r]).range(a).unknown(e)},lc.apply(yh(u),arguments)}),sd),md(ed,(function t(){var e,n=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[Vt(n,t,0,i)]:e}return o.domain=function(t){return arguments.length?(n=Array.from(t),i=Math.min(n.length,r.length-1),o):n.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(n.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var e=r.indexOf(t);return[n[e-1],n[e]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return t().domain(n).range(r).unknown(e)},lc.apply(o,arguments)}),sd),md(od,(function t(){let e=[],n=[];function r(t){return null==t||t!=t?void 0:n[(Vt(e,t)-1)%n.length]}return r.domain=function(t){return arguments.length?(e=function(t){return dd.call(t,M)}(t),r):e.slice()},r.range=function(t){return arguments.length?(n=pd.call(t),r):n.slice()},r.tickFormat=function(t,n){return mh(e[0],A(e),null==t?10:t,n)},r.copy=function(){return t().domain(r.domain()).range(r.range())},r}),[ud,sd]),md(nd,hc,ud),md(id,fd,ud),md(rd,(function(){return hd(fd().paddingInner(1))}),ud);const Md=["clamp","base","constant","exponent"];function Ed(t,e){const n=e[0],r=A(e)-n;return function(e){return t(n+e*r)}}function Dd(t,e,n){return oh(Sd(e||"rgb",n),t)}function Cd(t,e){const n=new Array(e),r=e+1;for(let i=0;it[e]?a[e](t[e]()):0)),a):Z(.5)}function Sd(t,e){const n=ah[function(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}(t)];return null!=e&&n&&n.gamma?n.gamma(e):n}function Bd(t){const e=t.length/6|0,n=new Array(e);for(let r=0;r1?(Nd[t]=e,this):Nd[t]}Td({category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"},Bd),Td({blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},(t=>Dd(Bd(t))));const Od="symbol",Rd=t=>v(t)?t.map((t=>String(t))):String(t),Ld=(t,e)=>t[1]-e[1],Ud=(t,e)=>e[1]-t[1];function qd(t,e,n){let r;return ht(e)&&(t.bins&&(e=Math.max(e,t.bins.length)),null!=n&&(e=Math.min(e,Math.floor(bt(t.domain())/n||1)))),_(e)&&(r=e.step,e=e.interval),pt(e)&&(e=t.type===Xh?yr(e):t.type==Jh?vr(e):u("Only time and utc scales accept interval strings."),r&&(e=e.every(r))),e}function Pd(t,e,n){let r=t.range(),i=r[0],o=A(r),a=Ld;if(i>o&&(r=o,o=i,i=r,a=Ud),i=Math.floor(i),o=Math.ceil(o),e=e.map((e=>[e,t(e)])).filter((t=>i<=t[1]&&t[1]<=o)).sort(a).map((t=>t[0])),n>0&&e.length>1){const t=[e[0],A(e)];for(;e.length>n&&e.length>=3;)e=e.filter(((t,e)=>!(e%2)));e.length<3&&(e=t)}return e}function jd(t,e){return t.bins?Pd(t,t.bins):t.ticks?t.ticks(e):t.domain()}function Id(t,e,n,r,i,o){const a=e.type;let u=Rd;if(a===Xh||i===Xh)u=t.timeFormat(r);else if(a===Jh||i===Jh)u=t.utcFormat(r);else if(wd(a)){const i=t.formatFloat(r);if(o||e.bins)u=i;else{const t=$d(e,n,!1);u=e=>t(e)?i(e):""}}else if(e.tickFormat){const i=e.domain();u=t.formatSpan(i[0],i[i.length-1],n,r)}else r&&(u=t.format(r));return u}function $d(t,e,n){const r=jd(t,e),i=t.base(),o=Math.log(i),a=Math.max(1,i*e/r.length),u=t=>{let e=t/Math.pow(i,Math.round(Math.log(t)/o));return e*i1?r[1]-r[0]:r[0];for(o=1;oWd[t.type]||t.bins)(e)?Vd(u):"discrete"===r?Jd(u):Zd(u)}const Vd=t=>(e,n,r)=>{const i=Xd(r[n+1],Xd(r.max,1/0)),o=Qd(e,t),a=Qd(i,t);return o&&a?o+" – "+a:a?"< "+a:"≥ "+o},Xd=(t,e)=>null!=t?t:e,Jd=t=>(e,n)=>n?t(e):null,Zd=t=>e=>t(e),Qd=(t,e)=>Number.isFinite(t)?e(t):null;function Kd(t,e,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=function(t,e,n,r){const i=r||e.type;return pt(n)&&function(t){return vd(t,cd)}(i)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),n||i!==Xh?n||i!==Jh?Gd(t,e,5,null,n,r,!0):t.utcFormat("%A, %d %B %Y, %X UTC"):t.timeFormat("%A, %d %B %Y, %X")}(t,e,n.format,n.formatType);if(bd(e.type)){const t=Yd(e).slice(1).map(i),n=t.length;return"".concat(n," boundar").concat(1===n?"y":"ies",": ").concat(t.join(", "))}if(xd(e.type)){const t=e.domain(),n=t.length,o=n>r?t.slice(0,r-2).map(i).join(", ")+", ending with "+t.slice(-1).map(i):t.map(i).join(", ");return"".concat(n," value").concat(1===n?"":"s",": ").concat(o)}{const t=e.domain();return"values from ".concat(i(t[0])," to ").concat(i(A(t)))}}let tp=0;const ep="p_";function np(t){return t&&t.gradient}function rp(t,e,n){const r=t.gradient;let i=t.id,o="radial"===r?ep:"";return i||(i=t.id="gradient_"+tp++,"radial"===r?(t.x1=ip(t.x1,.5),t.y1=ip(t.y1,.5),t.r1=ip(t.r1,0),t.x2=ip(t.x2,.5),t.y2=ip(t.y2,.5),t.r2=ip(t.r2,.5),o=ep):(t.x1=ip(t.x1,0),t.y1=ip(t.y1,0),t.x2=ip(t.x2,1),t.y2=ip(t.y2,0))),e[i]=t,"url("+(n||"")+"#"+o+i+")"}function ip(t,e){return null!=t?t:e}function op(t,e){var n,r=[];return n={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:r,stop:function(t,e){return r.push({offset:t,color:e}),n}}}const ap={basis:{curve:function(t){return new Tl(t)}},"basis-closed":{curve:function(t){return new Nl(t)}},"basis-open":{curve:function(t){return new zl(t)}},bundle:{curve:Rl,tension:"beta",value:.85},cardinal:{curve:ql,tension:"tension",value:0},"cardinal-open":{curve:$l,tension:"tension",value:0},"cardinal-closed":{curve:jl,tension:"tension",value:0},"catmull-rom":{curve:Yl,tension:"alpha",value:.5},"catmull-rom-closed":{curve:Vl,tension:"alpha",value:.5},"catmull-rom-open":{curve:Jl,tension:"alpha",value:.5},linear:{curve:Al},"linear-closed":{curve:function(t){return new Zl(t)}},monotone:{horizontal:function(t){return new rc(t)},vertical:function(t){return new nc(t)}},natural:{curve:function(t){return new oc(t)}},step:{curve:function(t){return new uc(t,.5)}},"step-after":{curve:function(t){return new uc(t,1)}},"step-before":{curve:function(t){return new uc(t,0)}}};function up(t,e,n){var r=rt(ap,t)&&ap[t],i=null;return r&&(i=r.curve||r[e||"vertical"],r.tension&&null!=n&&(i=i[r.tension](n))),i}const sp={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},lp=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,cp=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,fp=/^((\s+,?\s*)|(,\s*))/,hp=/^[01]/;function dp(t){const e=[];return(t.match(lp)||[]).forEach((t=>{let n=t[0];const r=n.toLowerCase(),i=sp[r],o=function(t,e,n){const r=[];for(let i=0;e&&i1&&(g=Math.sqrt(g),n*=g,r*=g);const m=h/n,y=f/n,v=-f/r,_=h/r,x=m*u+y*s,b=v*u+_*s,w=m*t+y*e,k=v*t+_*e;let A=1/((w-x)*(w-x)+(k-b)*(k-b))-.25;A<0&&(A=0);let M=Math.sqrt(A);o==i&&(M=-M);const E=.5*(x+w)-M*(k-b),D=.5*(b+k)+M*(w-x),C=Math.atan2(b-D,x-E);let F=Math.atan2(k-D,w-E)-C;F<0&&1===o?F+=mp:F>0&&0===o&&(F-=mp);const S=Math.ceil(Math.abs(F/(gp+.001))),B=[];for(let t=0;t+t}function Rp(t,e,n){return Math.max(e,Math.min(t,n))}function Lp(){var t=Bp,e=Tp,n=Np,r=zp,i=Op(0),o=i,a=i,u=i,s=null;function l(l,c,f){var h,d=null!=c?c:+t.call(this,l),p=null!=f?f:+e.call(this,l),g=+n.call(this,l),m=+r.call(this,l),y=Math.min(g,m)/2,v=Rp(+i.call(this,l),0,y),_=Rp(+o.call(this,l),0,y),x=Rp(+a.call(this,l),0,y),b=Rp(+u.call(this,l),0,y);if(s||(s=h=nl()),v<=0&&_<=0&&x<=0&&b<=0)s.rect(d,p,g,m);else{var w=d+g,k=p+m;s.moveTo(d+v,p),s.lineTo(w-_,p),s.bezierCurveTo(w-Sp*_,p,w,p+Sp*_,w,p+_),s.lineTo(w,k-b),s.bezierCurveTo(w,k-Sp*b,w-Sp*b,k,w-b,k),s.lineTo(d+x,k),s.bezierCurveTo(d+Sp*x,k,d,k-Sp*x,d,k-x),s.lineTo(d,p+v),s.bezierCurveTo(d,p+Sp*v,d+Sp*v,p,d+v,p),s.closePath()}if(h)return s=null,h+""||null}return l.x=function(e){return arguments.length?(t=Op(e),l):t},l.y=function(t){return arguments.length?(e=Op(t),l):e},l.width=function(t){return arguments.length?(n=Op(t),l):n},l.height=function(t){return arguments.length?(r=Op(t),l):r},l.cornerRadius=function(t,e,n,r){return arguments.length?(i=Op(t),o=null!=e?Op(e):i,u=null!=n?Op(n):i,a=null!=r?Op(r):o,l):i},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function Up(){var t,e,n,r,i,o,a,u,s=null;function l(t,e,n){const r=n/2;if(i){var l=a-e,c=t-o;if(l||c){var f=Math.sqrt(l*l+c*c),h=(l/=f)*u,d=(c/=f)*u,p=Math.atan2(c,l);s.moveTo(o-h,a-d),s.lineTo(t-l*r,e-c*r),s.arc(t,e,r,p-Math.PI,p),s.lineTo(o+h,a+d),s.arc(o,a,u,p,p+Math.PI)}else s.arc(t,e,r,0,mp);s.closePath()}else i=1;o=t,a=e,u=r}function c(o){var a,u,c,f=o.length,h=!1;for(null==s&&(s=c=nl()),a=0;a<=f;++a)!(at.x||0,jp=t=>t.y||0,Ip=t=>!(!1===t.defined),$p=function(){var t=ml,e=yl,n=rl(0),r=null,i=vl,o=_l,a=xl,u=null;function s(){var s,l,c=+t.apply(this,arguments),f=+e.apply(this,arguments),h=i.apply(this,arguments)-dl,d=o.apply(this,arguments)-dl,p=il(d-h),g=d>h;if(u||(u=s=nl()),ffl)if(p>pl-fl)u.moveTo(f*al(h),f*ll(h)),u.arc(0,0,f,h,d,!g),c>fl&&(u.moveTo(c*al(d),c*ll(d)),u.arc(0,0,c,d,h,g));else{var m,y,v=h,_=d,x=h,b=d,w=p,k=p,A=a.apply(this,arguments)/2,M=A>fl&&(r?+r.apply(this,arguments):cl(c*c+f*f)),E=sl(il(f-c)/2,+n.apply(this,arguments)),D=E,C=E;if(M>fl){var F=gl(M/c*ll(A)),S=gl(M/f*ll(A));(w-=2*F)>fl?(x+=F*=g?1:-1,b-=F):(w=0,x=b=(h+d)/2),(k-=2*S)>fl?(v+=S*=g?1:-1,_-=S):(k=0,v=_=(h+d)/2)}var B=f*al(v),T=f*ll(v),N=c*al(b),z=c*ll(b);if(E>fl){var O,R=f*al(_),L=f*ll(_),U=c*al(x),q=c*ll(x);if(p1?0:t<-1?hl:Math.acos(t)}((P*I+j*$)/(cl(P*P+j*j)*cl(I*I+$*$)))/2),H=cl(O[0]*O[0]+O[1]*O[1]);D=sl(E,(c-H)/(W-1)),C=sl(E,(f-H)/(W+1))}}k>fl?C>fl?(m=bl(U,q,B,T,f,C,g),y=bl(R,L,N,z,f,C,g),u.moveTo(m.cx+m.x01,m.cy+m.y01),Cfl&&w>fl?D>fl?(m=bl(N,z,R,L,c,-D,g),y=bl(B,T,U,q,c,-D,g),u.lineTo(m.cx+m.x01,m.cy+m.y01),Dt.startAngle||0)).endAngle((t=>t.endAngle||0)).padAngle((t=>t.padAngle||0)).innerRadius((t=>t.innerRadius||0)).outerRadius((t=>t.outerRadius||0)).cornerRadius((t=>t.cornerRadius||0)),Wp=Cl().x(Pp).y1(jp).y0((t=>(t.y||0)+(t.height||0))).defined(Ip),Hp=Cl().y(jp).x1(Pp).x0((t=>(t.x||0)+(t.width||0))).defined(Ip),Yp=Dl().x(Pp).y(jp).defined(Ip),Gp=Lp().x(Pp).y(jp).width((t=>t.width||0)).height((t=>t.height||0)).cornerRadius((t=>qp(t.cornerRadiusTopLeft,t.cornerRadius)||0),(t=>qp(t.cornerRadiusTopRight,t.cornerRadius)||0),(t=>qp(t.cornerRadiusBottomRight,t.cornerRadius)||0),(t=>qp(t.cornerRadiusBottomLeft,t.cornerRadius)||0)),Vp=function(t,e){let n=null;function r(){let r;if(n||(n=r=nl()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"==typeof t?t:rl(t||Fl),e="function"==typeof e?e:rl(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"==typeof e?e:rl(e),r):t},r.size=function(t){return arguments.length?(e="function"==typeof t?t:rl(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r}().type((t=>Cp(t.shape||"circle"))).size((t=>qp(t.size,64))),Xp=Up().x(Pp).y(jp).defined(Ip).size((t=>t.size||1));function Jp(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function Zp(t,e,n,r){return Gp.context(t)(e,n,r)}var Qp=1;function Kp(){Qp=1}function tg(t,e,n){var r=e.clip,i=t._defs,o=e.clip_id||(e.clip_id="clip"+Qp++),a=i.clipping[o]||(i.clipping[o]={id:o});return H(r)?a.path=r(null):Jp(n)?a.path=Zp(null,n,0,0):(a.width=n.width||0,a.height=n.height||0),"url(#"+o+")"}function eg(t){this.clear(),t&&this.union(t)}function ng(t){this.mark=t,this.bounds=this.bounds||new eg}function rg(t){ng.call(this,t),this.items=this.items||[]}function ig(t){this._pending=0,this._loader=t||Go()}function og(t){t._pending+=1}function ag(t){t._pending-=1}function ug(t,e,n){if(e.stroke&&0!==e.opacity&&0!==e.strokeOpacity){const r=null!=e.strokeWidth?+e.strokeWidth:1;t.expand(r+(n?function(t,e){return t.strokeJoin&&"miter"!==t.strokeJoin?0:e}(e,r):0))}return t}eg.prototype={clone(){return new eg(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,r){return nthis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this},expand(t){return this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(t){return this.x1*=t,this.y1*=t,this.x2*=t,this.y2*=t,this},translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this},rotate(t,e,n){const r=this.rotatedPoints(t,e,n);return this.clear().add(r[0],r[1]).add(r[2],r[3]).add(r[4],r[5]).add(r[6],r[7])},rotatedPoints(t,e,n){var{x1:r,y1:i,x2:o,y2:a}=this,u=Math.cos(t),s=Math.sin(t),l=e-e*u+n*s,c=n-e*s-n*u;return[u*r-s*i+l,s*r+u*i+c,u*r-s*a+l,s*r+u*a+c,u*o-s*i+l,s*o+u*i+c,u*o-s*a+l,s*o+u*a+c]},union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this},intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},ut(rg,ng),ig.prototype={pending(){return this._pending},sanitizeURL(t){const e=this;return og(e),e._loader.sanitize(t,{context:"href"}).then((t=>(ag(e),t))).catch((()=>(ag(e),null)))},loadImage(t){const e=this,n="undefined"!=typeof Image?Image:null;return og(e),e._loader.sanitize(t,{context:"image"}).then((t=>{const r=t.href;if(!r||!n)throw{url:r};const i=new n,o=rt(t,"crossOrigin")?t.crossOrigin:"anonymous";return null!=o&&(i.crossOrigin=o),i.onload=()=>ag(e),i.onerror=()=>ag(e),i.src=r,i})).catch((t=>(ag(e),{complete:!1,width:0,height:0,src:t&&t.url||""})))},ready(){const t=this;return new Promise((e=>{!function n(r){t.pending()?setTimeout((()=>{n(!0)}),10):e(r)}(!1)}))}};const sg=mp-1e-8;let lg,cg,fg,hg,dg,pg,gg,mg;const yg=(t,e)=>lg.add(t,e),vg=(t,e)=>yg(cg=t,fg=e),_g=t=>yg(t,lg.y1),xg=t=>yg(lg.x1,t),bg=(t,e)=>dg*t+gg*e,wg=(t,e)=>pg*t+mg*e,kg=(t,e)=>yg(bg(t,e),wg(t,e)),Ag=(t,e)=>vg(bg(t,e),wg(t,e));function Mg(t,e){return lg=t,e?(hg=e*pp,dg=mg=Math.cos(hg),pg=Math.sin(hg),gg=-pg):(dg=mg=1,hg=pg=gg=0),Eg}const Eg={beginPath(){},closePath(){},moveTo:Ag,lineTo:Ag,rect(t,e,n,r){hg?(kg(t+n,e),kg(t+n,e+r),kg(t,e+r),Ag(t,e)):(yg(t+n,e+r),vg(t,e))},quadraticCurveTo(t,e,n,r){const i=bg(t,e),o=wg(t,e),a=bg(n,r),u=wg(n,r);Dg(cg,i,a,_g),Dg(fg,o,u,xg),vg(a,u)},bezierCurveTo(t,e,n,r,i,o){const a=bg(t,e),u=wg(t,e),s=bg(n,r),l=wg(n,r),c=bg(i,o),f=wg(i,o);Cg(cg,a,s,c,_g),Cg(fg,u,l,f,xg),vg(c,f)},arc(t,e,n,r,i,o){if(r+=hg,i+=hg,cg=n*Math.cos(i)+t,fg=n*Math.sin(i)+e,Math.abs(i-r)>sg)yg(t-n,e-n),yg(t+n,e+n);else{const a=r=>yg(n*Math.cos(r)+t,n*Math.sin(r)+e);let u,s;if(a(r),a(i),i!==r)if((r%=mp)<0&&(r+=mp),(i%=mp)<0&&(i+=mp),ii;++s,u-=gp)a(u);else for(u=r-r%gp+gp,s=0;s<4&&u1e-14?(s=a*a+u*o,s>=0&&(s=Math.sqrt(s),l=(-a+s)/o,c=(-a-s)/o)):l=.5*u/a,0m)return!1;d>g&&(g=d)}else if(f>0){if(d0&&(t.globalAlpha=n,t.fillStyle=Pg(t,e,e.fill),!0)}var Ig=[];function $g(t,e,n){var r=null!=(r=e.strokeWidth)?r:1;return!(r<=0)&&(n*=null==e.strokeOpacity?1:e.strokeOpacity)>0&&(t.globalAlpha=n,t.strokeStyle=Pg(t,e,e.stroke),t.lineWidth=r,t.lineCap=e.strokeCap||"butt",t.lineJoin=e.strokeJoin||"miter",t.miterLimit=e.strokeMiterLimit||10,t.setLineDash&&(t.setLineDash(e.strokeDash||Ig),t.lineDashOffset=e.strokeDashOffset||0),!0)}function Wg(t,e){return t.zindex-e.zindex||t.index-e.index}function Hg(t){if(!t.zdirty)return t.zitems;var e,n,r,i=t.items,o=[];for(n=0,r=i.length;n=0;)if(n=e(i[r]))return n;if(i===o)for(r=(i=t.items).length;--r>=0;)if(!i[r].zindex&&(n=e(i[r])))return n;return null}function Vg(t){return function(e,n,r){Yg(n,(n=>{r&&!r.intersects(n.bounds)||Jg(t,e,n,n)}))}}function Xg(t){return function(e,n,r){!n.items.length||r&&!r.intersects(n.bounds)||Jg(t,e,n.items[0],n.items)}}function Jg(t,e,n,r){var i=null==n.opacity?1:n.opacity;0!==i&&(t(e,r)||(Lg(e,n),n.fill&&jg(e,n,i)&&e.fill(),n.stroke&&$g(e,n,i)&&e.stroke()))}function Zg(t){return t=t||p,function(e,n,r,i,o,a){return r*=e.pixelRatio,i*=e.pixelRatio,Gg(n,(n=>{const u=n.bounds;if((!u||u.contains(o,a))&&u)return t(e,n,r,i,o,a)?n:void 0}))}}function Qg(t,e){return function(n,r,i,o){var a,u,s=Array.isArray(r)?r[0]:r,l=null==e?s.fill:e,c=s.stroke&&n.isPointInStroke;return c&&(a=s.strokeWidth,u=s.strokeCap,n.lineWidth=null!=a?a:1,n.lineCap=null!=u?u:"butt"),!t(n,r)&&(l&&n.isPointInPath(i,o)||c&&n.isPointInStroke(i,o))}}function Kg(t){return Zg(Qg(t))}function tm(t,e){return"translate("+t+","+e+")"}function em(t){return"rotate("+t+")"}function nm(t){return tm(t.x||0,t.y||0)}function rm(t,e,n){function r(t,n){var r=n.x||0,i=n.y||0,o=n.angle||0;t.translate(r,i),o&&t.rotate(o*=pp),t.beginPath(),e(t,n),o&&t.rotate(-o),t.translate(-r,-i)}return{type:t,tag:"path",nested:!1,attr:function(t,n){t("transform",function(t){return tm(t.x||0,t.y||0)+(t.angle?" "+em(t.angle):"")}(n)),t("d",e(null,n))},bound:function(t,n){return e(Mg(t,n.angle),n),ug(t,n).translate(n.x||0,n.y||0)},draw:Vg(r),pick:Kg(r),isect:n||Tg(r)}}var im=rm("arc",(function(t,e){return $p.context(t)(e)}));function om(t,e,n){function r(t,n){t.beginPath(),e(t,n)}const i=Qg(r);return{type:t,tag:"path",nested:!0,attr:function(t,n){var r=n.mark.items;r.length&&t("d",e(null,r))},bound:function(t,n){var r=n.items;return 0===r.length?t:(e(Mg(t),r),ug(t,r[0]))},draw:Xg(r),pick:function(t,e,n,r,o,a){var u=e.items,s=e.bounds;return!u||!u.length||s&&!s.contains(o,a)?null:(n*=t.pixelRatio,r*=t.pixelRatio,i(t,u,n,r)?u[0]:null)},isect:Ng,tip:n}}var am=om("area",(function(t,e){const n=e[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Hp:Wp).curve(up(r,n.orient,n.tension)).context(t)(e)}),(function(t,e){for(var n,r,i="horizontal"===t[0].orient?e[1]:e[0],o="horizontal"===t[0].orient?"y":"x",a=t.length,u=1/0;--a>=0;)!1!==t[a].defined&&(r=Math.abs(t[a][o]-i)).5&&e<1.5?.5-Math.abs(e-1):0}function lm(t,e){const n=sm(e);t("d",Zp(null,e,n,n))}function cm(t,e,n,r){const i=sm(e);t.beginPath(),Zp(t,e,(n||0)+i,(r||0)+i)}const fm=Qg(cm),hm=Qg(cm,!1),dm=Qg(cm,!0);var pm={type:"group",tag:"g",nested:!1,attr:function(t,e){t("transform",nm(e))},bound:function(t,e){if(!e.clip&&e.items){const n=e.items,r=n.length;for(let e=0;e{const r=e.x||0,i=e.y||0,o=e.strokeForeground,a=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&a&&(cm(t,e,r,i),Lg(t,e),e.fill&&jg(t,e,a)&&t.fill(),e.stroke&&!o&&$g(t,e,a)&&t.stroke()),t.save(),t.translate(r,i),e.clip&&um(t,e),n&&n.translate(-r,-i),Yg(e,(e=>{this.draw(t,e,n)})),n&&n.translate(r,i),t.restore(),o&&e.stroke&&a&&(cm(t,e,r,i),Lg(t,e),$g(t,e,a)&&t.stroke())}))},pick:function(t,e,n,r,i,o){if(e.bounds&&!e.bounds.contains(i,o)||!e.items)return null;const a=n*t.pixelRatio,u=r*t.pixelRatio;return Gg(e,(s=>{let l,c,f;const h=s.bounds;if(h&&!h.contains(i,o))return;c=s.x||0,f=s.y||0;const d=c+(s.width||0),p=f+(s.height||0),g=s.clip;if(g&&(id||op))return;if(t.save(),t.translate(c,f),c=i-c,f=o-f,g&&Jp(s)&&!dm(t,s,a,u))return t.restore(),null;const m=s.strokeForeground,y=!1!==e.interactive;return y&&m&&s.stroke&&hm(t,s,a,u)?(t.restore(),s):(l=Gg(s,(t=>function(t,e,n){return(!1!==t.interactive||"group"===t.marktype)&&t.bounds&&t.bounds.contains(e,n)}(t,c,f)?this.pick(t,n,r,c,f):null)),!l&&y&&(s.fill||!m&&s.stroke)&&fm(t,s,a,u)&&(l=s),t.restore(),l||null)}))},isect:zg,content:function(t,e,n){t("clip-path",e.clip?tg(n,e,e):null)},background:function(t,e){t("class","background"),t("aria-hidden",!0),lm(t,e)},foreground:function(t,e){t("class","foreground"),t("aria-hidden",!0),e.strokeForeground?lm(t,e):t("d","")}},gm={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function mm(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then((e=>{t.image=e,t.image.url=t.url}))),n}function ym(t,e){return null!=t.width?t.width:e&&e.width?!1!==t.aspect&&t.height?t.height*e.width/e.height:e.width:0}function vm(t,e){return null!=t.height?t.height:e&&e.height?!1!==t.aspect&&t.width?t.width*e.height/e.width:e.height:0}function _m(t,e){return"center"===t?e/2:"right"===t?e:0}function xm(t,e){return"middle"===t?e/2:"bottom"===t?e:0}var bm={type:"image",tag:"image",nested:!1,attr:function(t,e,n){const r=mm(e,n),i=ym(e,r),o=vm(e,r),a=(e.x||0)-_m(e.align,i),u=(e.y||0)-xm(e.baseline,o);t("href",!r.src&&r.toDataURL?r.toDataURL():r.src||"",gm["xmlns:xlink"],"xlink:href"),t("transform",tm(a,u)),t("width",i),t("height",o),t("preserveAspectRatio",!1===e.aspect?"none":"xMidYMid")},bound:function(t,e){const n=e.image,r=ym(e,n),i=vm(e,n),o=(e.x||0)-_m(e.align,r),a=(e.y||0)-xm(e.baseline,i);return t.set(o,a,o+r,a+i)},draw:function(t,e,n){Yg(e,(e=>{if(n&&!n.intersects(e.bounds))return;const r=mm(e,this);let i=ym(e,r),o=vm(e,r);if(0===i||0===o)return;let a,u,s,l,c=(e.x||0)-_m(e.align,i),f=(e.y||0)-xm(e.baseline,o);!1!==e.aspect&&(u=r.width/r.height,s=e.width/e.height,u==u&&s==s&&u!==s&&(s=0;)if(!1!==t[o].defined&&(n=t[o].x-e[0])*n+(r=t[o].y-e[1])*r{if(!n||n.intersects(e.bounds)){var r=null==e.opacity?1:e.opacity;r&&Dm(t,e,r)&&(Lg(t,e),t.stroke())}}))},pick:Zg((function(t,e,n,r){return!!t.isPointInStroke&&Dm(t,e,1)&&t.isPointInStroke(n,r)})),isect:Og},Fm=rm("shape",(function(t,e){return(e.mark.shape||e.shape).context(t)(e)})),Sm=rm("symbol",(function(t,e){return Vp.context(t)(e)}),Ng);const Bm=yt();var Tm={height:Um,measureWidth:Rm,estimateWidth:zm,width:zm,canvas:Nm};function Nm(t){Tm.width=t&&Sg?Rm:zm}function zm(t,e){return Om(Im(t,e),Um(t))}function Om(t,e){return~~(.8*t.length*e)}function Rm(t,e){return Um(t)<=0||!(e=Im(t,e))?0:Lm(e,Wm(t))}function Lm(t,e){const n="(".concat(e,") ").concat(t);let r=Bm.get(n);return void 0===r&&(Sg.font=e,r=Sg.measureText(t).width,Bm.set(n,r)),r}function Um(t){return null!=t.fontSize?+t.fontSize||0:11}function qm(t){return null!=t.lineHeight?t.lineHeight:Um(t)+2}function Pm(t){return e=t.lineBreak&&t.text&&!v(t.text)?t.text.split(t.lineBreak):t.text,v(e)?e.length>1?e:e[0]:e;var e}function jm(t){const e=Pm(t);return(v(e)?e.length-1:0)*qm(t)}function Im(t,e){const n=null==e?"":(e+"").trim();return t.limit>0&&n.length?function(t,e){var n=+t.limit,r=function(t){if(Tm.width===Rm){const e=Wm(t);return t=>Lm(t,e)}{const e=Um(t);return t=>Om(t,e)}}(t);if(r(e)>>1,r(e.slice(i))>n?u=i+1:s=i;return o+e.slice(u)}for(;u>>1),r(e.slice(0,i))Math.max(t,Tm.width(e,n))),0)):r=Tm.width(e,f),"center"===o?l-=r/2:"right"===o&&(l-=r),t.set(l+=u,c+=s,l+r,c+i),e.angle&&!n)t.rotate(e.angle*pp,u,s);else if(2===n)return t.rotatedPoints(e.angle*pp,u,s);return t}var Jm={type:"text",tag:"text",nested:!1,attr:function(t,e){var n,r=e.dx||0,i=(e.dy||0)+Hm(e),o=Vm(e),a=o.x1,u=o.y1,s=e.angle||0;t("text-anchor",Ym[e.align]||"start"),s?(n=tm(a,u)+" "+em(s),(r||i)&&(n+=" "+tm(r,i))):n=tm(a+r,u+i),t("transform",n)},bound:Xm,draw:function(t,e,n){Yg(e,(e=>{var r,i,o,a,u,s,l,c=null==e.opacity?1:e.opacity;if(!(n&&!n.intersects(e.bounds)||0===c||e.fontSize<=0||null==e.text||0===e.text.length)){if(t.font=Wm(e),t.textAlign=e.align||"left",i=(r=Vm(e)).x1,o=r.y1,e.angle&&(t.save(),t.translate(i,o),t.rotate(e.angle*pp),i=o=0),i+=e.dx||0,o+=(e.dy||0)+Hm(e),s=Pm(e),Lg(t,e),v(s))for(u=qm(e),a=0;a=0;)if(!1!==t[i].defined&&(n=t[i].x-e[0])*n+(r=t[i].y-e[1])*r<(n=t[i].size||1)*n)return t[i];return null})),Qm={arc:im,area:am,group:pm,image:bm,line:wm,path:Am,rect:Em,rule:Cm,shape:Fm,symbol:Sm,text:Jm,trail:Zm};function Km(t,e,n){var r=Qm[t.mark.marktype],i=e||r.bound;return r.nested&&(t=t.mark),i(t.bounds||(t.bounds=new eg),t,n)}var ty={mark:null};function ey(t,e,n){var r,i,o,a,u=Qm[t.marktype],s=u.bound,l=t.items,c=l&&l.length;if(u.nested)return c?o=l[0]:(ty.mark=t,o=ty),a=Km(o,s,n),e&&e.union(a)||a;if(e=e||t.bounds&&t.bounds.clear()||new eg,c)for(r=0,i=l.length;re;)t.removeChild(n[--r]);return t}function hy(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function dy(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function py(t,e){this._active=null,this._handlers={},this._loader=t||Go(),this._tooltip=e||gy}function gy(t,e,n,r){t.element().setAttribute("title",r||"")}function my(t){this._el=null,this._bgcolor=null,this._loader=new ig(t)}ay.prototype={toJSON(t){return ry(this.root,t||0)},mark(t,e,n){const r=uy(t,e=e||this.root.items[0]);return e.items[n]=r,r.zindex&&(r.group.zdirty=!0),r}},py.prototype={initialize(t,e,n){return this._el=t,this._obj=n||null,this.origin(e)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()},scene(t){return arguments.length?(this._scene=t,this):this._scene},on(){},off(){},_handlerIndex(t,e,n){for(let r=t?t.length:0;--r>=0;)if(t[r].type===e&&(!n||t[r].handler===n))return r;return-1},handlers(t){const e=this._handlers,n=[];if(t)n.push(...e[this.eventName(t)]);else for(const t in e)n.push(...e[t]);return n},eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)},handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),r=sy(null,"a");for(const t in e)r.setAttribute(t,e[t]);r.dispatchEvent(n)})).catch((()=>{}))},handleTooltip(t,e,n){if(e&&null!=e.tooltip){e=function(t,e,n,r){var i,o,a=t&&t.mark;if(a&&(i=Qm[a.marktype]).tip){for((o=dy(e,n))[0]-=r[0],o[1]-=r[1];t=t.mark.group;)o[0]-=t.x||0,o[1]-=t.y||0;t=i.tip(a.items,o)}return t}(e,t,this.canvas(),this._origin);const r=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,r)}},getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),r=this._origin,i=t.bounds,o=i.width(),a=i.height();let u=i.x1+r[0]+n.left,s=i.y1+r[1]+n.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,s+=t.y||0;return{x:u,y:s,width:o,height:a,left:u,top:s,right:u+o,bottom:s+a}}},my.prototype={initialize(t,e,n,r,i){return this._el=t,this.resize(e,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(t){return 0===arguments.length?this._bgcolor:(this._bgcolor=t,this)},resize(t,e,n,r){return this._width=t,this._height=e,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(t){const e=this;return e._call=function(){e._render(t)},e._call(),e._call=null,e},_render(){},renderAsync(t){const e=this.render(t);return this._ready?this._ready.then((()=>e)):Promise.resolve(e)},_load(t,e){var n=this,r=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{e&&t(),n._ready=null}))}return r},sanitizeURL(t){return this._load("sanitizeURL",t)},loadImage(t){return this._load("loadImage",t)}};const yy="dragenter",vy="dragleave",_y="dragover",xy="mousedown",by="mousemove",wy="mouseout",ky="mouseover",Ay="click",My="mousewheel",Ey="touchstart",Dy="touchmove",Cy="touchend",Fy=by,Sy=wy,By=Ay;function Ty(t,e){py.call(this,t,e),this._down=null,this._touch=null,this._first=!0,this._events={}}function Ny(t,e){(t=>t===Ey||t===Dy||t===Cy?[Ey,Dy,Cy]:[t])(e).forEach((e=>function(t,e){const n=t.canvas();n&&!t._events[e]&&(t._events[e]=1,n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n)))}(t,e)))}function zy(t,e,n){return function(r){const i=this._active,o=this.pickEvent(r);o===i||(i&&i.exit||this.fire(n,r),this._active=o,this.fire(e,r)),this.fire(t,r)}}function Oy(t){return function(e){this.fire(t,e),this._active=null}}ut(Ty,py,{initialize(t,e,n){return this._canvas=t&&ly(t,"canvas"),[Ay,xy,by,wy,vy].forEach((t=>Ny(this,t))),py.prototype.initialize.call(this,t,e,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:["keydown","keypress","keyup",yy,vy,_y,xy,"mouseup",by,wy,ky,Ay,"dblclick","wheel",My,Ey,Dy,Cy],DOMMouseScroll(t){this.fire(My,t)},mousemove:zy(by,ky,wy),dragover:zy(_y,yy,vy),mouseout:Oy(wy),dragleave:Oy(vy),mousedown(t){this._down=this._active,this.fire(xy,t)},click(t){this._down===this._active&&(this.fire(Ay,t),this._down=null)},touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Ey,t,!0)},touchmove(t){this.fire(Dy,t,!0)},touchend(t){this.fire(Cy,t,!0),this._touch=null},fire(t,e,n){const r=n?this._touch:this._active,i=this._handlers[t];if(e.vegaType=t,t===By&&r&&r.href?this.handleHref(e,r,r.href):t!==Fy&&t!==Sy||this.handleTooltip(e,r,t!==Sy),i)for(let t=0,n=i.length;t=0&&r.splice(i,1),this},pickEvent(t){const e=dy(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])},pick(t,e,n,r,i){const o=this.context();return Qm[t.marktype].pick.call(this,o,t,e,n,r,i)}});var Ry="undefined"!=typeof window&&window.devicePixelRatio||1;function Ly(t){my.call(this,t),this._options={},this._redraw=!1,this._dirty=new eg,this._tempb=new eg}const Uy=my.prototype;function qy(t,e){py.call(this,t,e);const n=this;n._hrefHandler=Py(n,((t,e)=>{e&&e.href&&n.handleHref(t,e,e.href)})),n._tooltipHandler=Py(n,((t,e)=>{n.handleTooltip(t,e,t.type!==Sy)}))}ut(Ly,my,{initialize(t,e,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:sc(1,1,this._options.type),t&&this._canvas&&(fy(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Uy.initialize.call(this,t,e,n,r,i)},resize(t,e,n,r){if(Uy.resize.call(this,t,e,n,r),this._canvas)!function(t,e,n,r,i,o){const a="undefined"!=typeof HTMLElement&&t instanceof HTMLElement&&null!=t.parentNode,u=t.getContext("2d"),s=a?Ry:i;t.width=e*s,t.height=n*s;for(const t in o)u[t]=o[t];a&&1!==s&&(t.style.width=e+"px",t.style.height=n+"px"),u.pixelRatio=s,u.setTransform(s,0,0,s,s*r[0],s*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const t=this._options.externalContext;t||u("CanvasRenderer is missing a valid canvas or context"),t.scale(this._scale,this._scale),t.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;for(;n;)e.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(e)},_render(t){const e=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=((t,e,n)=>(new eg).set(0,0,e,n).translate(-t[0],-t[1]))(n,r,i);e.save();const u=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function(t,e,n){return e.expand(1).round(),t.pixelRatio%1&&e.scale(t.pixelRatio).round().scale(1/t.pixelRatio),e.translate(-n[0]%1,-n[1]%1),t.beginPath(),t.rect(e.x1,e.y1,e.width(),e.height()),t.clip(),e}(e,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(e,t,u),e.restore(),o.clear(),this},draw(t,e,n){const r=Qm[e.marktype];e.clip&&function(t,e){var n=e.clip;t.save(),H(n)?(t.beginPath(),n(t),t.clip()):um(t,e.group)}(t,e),r.draw.call(this,t,e,n),e.clip&&t.restore()},clear(t,e,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(t,e,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(t,e,n,r))}});const Py=(t,e)=>n=>{let r=n.target.__data__;r=Array.isArray(r)?r[0]:r,n.vegaType=n.type,e.call(t._obj,n,r)};ut(qy,py,{initialize(t,e,n){let r=this._svg;return r&&(r.removeEventListener(By,this._hrefHandler),r.removeEventListener(Fy,this._tooltipHandler),r.removeEventListener(Sy,this._tooltipHandler)),this._svg=r=t&&ly(t,"svg"),r&&(r.addEventListener(By,this._hrefHandler),r.addEventListener(Fy,this._tooltipHandler),r.addEventListener(Sy,this._tooltipHandler)),py.prototype.initialize.call(this,t,e,n)},canvas(){return this._svg},on(t,e){const n=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[n],t,e)<0){const i={type:t,handler:e,listener:Py(this,e)};(r[n]||(r[n]=[])).push(i),this._svg&&this._svg.addEventListener(n,i.listener)}return this},off(t,e){const n=this.eventName(t),r=this._handlers[n],i=this._handlerIndex(r,t,e);return i>=0&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}});const jy="aria-hidden",Iy="aria-label",$y="role",Wy="aria-roledescription",Hy="graphics-object",Yy="graphics-symbol",Gy=(t,e,n)=>({[$y]:t,[Wy]:e,[Iy]:n||void 0}),Vy=Dt(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),Xy={axis:{desc:"axis",caption:function(t){const e=t.datum,n=t.orient,r=e.title?tv(t):null,i=t.context,o=i.scales[e.scale].value,a=i.dataflow.locale(),u=o.type;return"".concat("left"===n||"right"===n?"Y":"X","-axis")+(r?" titled '".concat(r,"'"):"")+" for a ".concat(xd(u)?"discrete":u," scale")+" with ".concat(Kd(a,o,t))}},legend:{desc:"legend",caption:function(t){const e=t.datum,n=e.title?tv(t):null,r="".concat(e.type||""," legend").trim(),i=e.scales,o=Object.keys(i),a=t.context,u=a.scales[i[o[0]]].value,s=a.dataflow.locale();return((l=r).length?l[0].toUpperCase()+l.slice(1):l)+(n?" titled '".concat(n,"'"):"")+" for ".concat(function(t){return(t=t.map((t=>t+("fill"===t||"stroke"===t?" color":"")))).length<2?t[0]:t.slice(0,-1).join(", ")+" and "+A(t)}(o))+" with ".concat(Kd(s,u,t));var l}},"title-text":{desc:"title",caption:t=>"Title text '".concat(Ky(t),"'")},"title-subtitle":{desc:"subtitle",caption:t=>"Subtitle text '".concat(Ky(t),"'")}},Jy={ariaRole:$y,ariaRoleDescription:Wy,description:Iy};function Zy(t,e){const n=!1===e.aria;if(t(jy,n||void 0),n||null==e.description)for(const e in Jy)t(Jy[e],void 0);else{const n=e.mark.marktype;t(Iy,e.description),t($y,e.ariaRole||("group"===n?Hy:Yy)),t(Wy,e.ariaRoleDescription||"".concat(n," mark"))}}function Qy(t){return!1===t.aria?{[jy]:!0}:Vy[t.role]?null:Xy[t.role]?function(t,e){try{const n=t.items[0],r=e.caption||(()=>"");return Gy(e.role||Yy,e.desc,n.description||r(n))}catch(t){return null}}(t,Xy[t.role]):function(t){const e=t.marktype,n="group"===e||"text"===e||t.items.some((t=>null!=t.description&&!1!==t.aria));return Gy(n?Hy:Yy,"".concat(e," mark container"),t.description)}(t)}function Ky(t){return $(t.text).join(" ")}function tv(t){try{return $(A(t.items).items[0].text).join(" ")}catch(t){return null}}const ev=t=>(t+"").replace(/&/g,"&").replace(//g,">");function nv(){let t="",e="",n="";const r=[],i=()=>e=n="",o=(t,n)=>(null!=n&&(e+=" ".concat(t,'="').concat(ev(n).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," "),'"')),a),a={open(u){(o=>{e&&(t+="".concat(e,">").concat(n),i()),r.push(o)})(u),e="<"+u;for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c".concat(n,""):"/>"):""),i(),a},attr:o,text:t=>(n+=ev(t),a),toString:()=>t};return a}const rv=t=>iv(nv(),t)+"";function iv(t,e){if(t.open(e.tagName),e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e1&&t.previousSibling!=e}(a,n))&&e.insertBefore(a,n?n.nextSibling:e.firstChild),a}ut(cv,my,{initialize(t,e,n,r,i){return this._defs={},this._clearDefs(),t&&(this._svg=cy(t,0,"svg",lv),this._svg.setAttributeNS(sv,"xmlns",lv),this._svg.setAttributeNS(sv,"xmlns:xlink",gm["xmlns:xlink"]),this._svg.setAttribute("version",gm.version),this._svg.setAttribute("class","marks"),fy(t,1),this._root=cy(this._svg,0,"g",lv),bv(this._root,uv),fy(this._svg,1)),this.background(this._bgcolor),fv.initialize.call(this,t,e,n,r,i)},background(t){return arguments.length&&this._svg&&this._svg.style.setProperty("background-color",t),fv.background.apply(this,arguments)},resize(t,e,n,r){return fv.resize.call(this,t,e,n,r),this._svg&&(bv(this._svg,{width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}),this._root.setAttribute("transform","translate(".concat(this._origin,")"))),this._dirty=[],this},canvas(){return this._svg},svg(){const t=this._svg,e=this._bgcolor;if(!t)return null;let n;e&&(t.removeAttribute("style"),n=cy(t,0,"rect",lv),bv(n,{width:this._width,height:this._height,fill:e}));const r=rv(t);return e&&(t.removeChild(n),this._svg.style.setProperty("background-color",e)),r},_render(t){return this._dirtyCheck()&&(this._dirtyAll&&this._clearDefs(),this.mark(this._root,t),fy(this._root,1)),this.defs(),this._dirty=[],++this._dirtyID,this},dirty(t){t.dirty!==this._dirtyID&&(t.dirty=this._dirtyID,this._dirty.push(t))},isDirty(t){return this._dirtyAll||!t._svg||!t._svg.ownerSVGElement||t.dirty===this._dirtyID},_dirtyCheck(){this._dirtyAll=!0;const t=this._dirty;if(!t.length||!this._dirtyID)return!0;const e=++this._dirtyID;let n,r,i,o,a,u,s;for(a=0,u=t.length;a{t.dirty=e}))),r.zdirty||(n.exit?(o.nested&&r.items.length?(s=r.items[0],s._svg&&this._update(o,s._svg,s)):n._svg&&(s=n._svg.parentNode,s&&s.removeChild(n._svg)),n._svg=null):(n=o.nested?r.items[0]:n,n._update!==e&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,hv(n,e)),n._update=e)));return!this._dirtyAll},mark(t,e,n){if(!this.isDirty(e))return e._svg;const r=this._svg,i=Qm[e.marktype],o=!1===e.interactive?"none":null,a="g"===i.tag,u=gv(e,t,n,"g",r);u.setAttribute("class",hy(e));const s=Qy(e);for(const t in s)wv(u,t,s[t]);a||wv(u,"pointer-events",o),wv(u,"clip-path",e.clip?tg(this,e,e.group):null);let l=null,c=0;const f=t=>{const e=this.isDirty(t),n=gv(t,u,l,i.tag,r);e&&(this._update(i,n,t),a&&function(t,e,n){e=e.lastChild.previousSibling;let r,i=0;Yg(n,(n=>{r=t.mark(e,n,r),++i})),fy(e,1+i)}(this,n,t)),l=n,++c};return i.nested?e.items.length&&f(e.items[0]):Yg(e,f),fy(u,c),u},_update(t,e,n){mv=e,yv=e.__values__,Zy(_v,n),t.attr(_v,n,this);const r=vv[t.type];r&&r.call(this,t,e,n),mv&&this.style(mv,n)},style(t,e){if(null!=e){for(const n in ov){let r="font"===n?$m(e):e[n];if(r===yv[n])continue;const i=ov[n];null==r?t.removeAttribute(i):(np(r)&&(r=rp(r,this._defs.gradient,kv())),t.setAttribute(i,r+"")),yv[n]=r}for(const n in av)xv(t,av[n],e[n])}},defs(){const t=this._svg,e=this._defs;let n=e.el,r=0;for(const i in e.gradient)n||(e.el=n=cy(t,1,"defs",lv)),r=dv(n,e.gradient[i],r);for(const i in e.clipping)n||(e.el=n=cy(t,1,"defs",lv)),r=pv(n,e.clipping[i],r);n&&(0===r?(t.removeChild(n),e.el=null):fy(n,r))},_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}});let mv=null,yv=null;const vv={group(t,e,n){const r=mv=e.childNodes[2];yv=r.__values__,t.foreground(_v,n,this),yv=e.__values__,mv=e.childNodes[1],t.content(_v,n,this);const i=mv=e.childNodes[0];t.background(_v,n,this);const o=!1===n.mark.interactive?"none":null;if(o!==yv.events&&(wv(r,"pointer-events",o),wv(i,"pointer-events",o),yv.events=o),n.strokeForeground&&n.stroke){const t=n.fill;wv(r,"display",null),this.style(i,n),wv(i,"stroke",null),t&&(n.fill=null),yv=r.__values__,this.style(r,n),t&&(n.fill=t),mv=null}else wv(r,"display","none")},image(t,e,n){!1===n.smooth?(xv(e,"image-rendering","optimizeSpeed"),xv(e,"image-rendering","pixelated")):xv(e,"image-rendering",null)},text(t,e,n){const r=Pm(n);let i,o,a,u;v(r)?(o=r.map((t=>Im(n,t))),i=o.join("\n"),i!==yv.text&&(fy(e,0),a=e.ownerDocument,u=qm(n),o.forEach(((t,r)=>{const i=sy(a,"tspan",lv);i.__data__=n,i.textContent=t,r&&(i.setAttribute("x",0),i.setAttribute("dy",u)),e.appendChild(i)})),yv.text=i)):(o=Im(n,r),o!==yv.text&&(e.textContent=o,yv.text=o)),wv(e,"font-family",$m(n)),wv(e,"font-size",Um(n)+"px"),wv(e,"font-style",n.fontStyle),wv(e,"font-variant",n.fontVariant),wv(e,"font-weight",n.fontWeight)}};function _v(t,e,n){e!==yv[t]&&(n?function(t,e,n,r){null!=n?t.setAttributeNS(r,e,n):t.removeAttributeNS(r,e)}(mv,t,e,n):wv(mv,t,e),yv[t]=e)}function xv(t,e,n){n!==yv[e]&&(null==n?t.style.removeProperty(e):t.style.setProperty(e,n+""),yv[e]=n)}function bv(t,e){for(const n in e)wv(t,n,e[n])}function wv(t,e,n){null!=n?t.setAttribute(e,n):t.removeAttribute(e)}function kv(){let t;return"undefined"==typeof window?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}function Av(t){my.call(this,t),this._text=null,this._defs={gradient:{},clipping:{}}}ut(Av,my,{svg(){return this._text},_render(t){const e=nv();e.open("svg",K({},gm,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:"0 0 ".concat(this._width," ").concat(this._height)}));const n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&e.open("rect",{width:this._width,height:this._height,fill:n}).close(),e.open("g",uv,{transform:"translate("+this._origin+")"}),this.mark(e,t),e.close(),this.defs(e),this._text=e.close()+"",this},mark(t,e){const n=Qm[e.marktype],r=n.tag,i=[Zy,n.attr];t.open("g",{class:hy(e),"clip-path":e.clip?tg(this,e,e.group):null},Qy(e),{"pointer-events":"g"!==r&&!1===e.interactive?"none":null});const o=o=>{const a=this.href(o);if(a&&t.open("a",a),t.open(r,this.attr(e,o,i,"g"!==r?r:null)),"text"===r){const e=Pm(o);if(v(e)){const n={x:0,dy:qm(o)};for(let r=0;rthis.mark(t,e))),t.close(),r&&a?(i&&(o.fill=null),o.stroke=a,t.open("path",this.attr(e,o,n.foreground,"bgrect")).close(),i&&(o.fill=i)):t.open("path",this.attr(e,o,n.foreground,"bgfore")).close()}t.close(),a&&t.close()};return n.nested?e.items&&e.items.length&&o(e.items[0]):Yg(e,o),t.close()},href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e])return n;this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href,t.href=null,(this._hrefs||(this._hrefs={}))[e]=t}))}return null},attr(t,e,n,r){const i={},o=(t,e,n,r)=>{i[r||t]=e};return Array.isArray(n)?n.forEach((t=>t(o,e,this))):n(o,e,this),r&&function(t,e,n,r,i){let o;if(null==e)return t;if("bgrect"===r&&!1===n.interactive&&(t["pointer-events"]="none"),"bgfore"===r&&(!1===n.interactive&&(t["pointer-events"]="none"),t.display="none",null!==e.fill))return t;"image"===r&&!1===e.smooth&&(o=["image-rendering: optimizeSpeed;","image-rendering: pixelated;"]),"text"===r&&(t["font-family"]=$m(e),t["font-size"]=Um(e)+"px",t["font-style"]=e.fontStyle,t["font-variant"]=e.fontVariant,t["font-weight"]=e.fontWeight);for(const n in ov){let r=e[n];const o=ov[n];("transparent"!==r||"fill"!==o&&"stroke"!==o)&&null!=r&&(np(r)&&(r=rp(r,i.gradient,"")),t[o]=r)}for(const t in av){const n=e[t];null!=n&&(o=o||[],o.push("".concat(av[t],": ").concat(n,";")))}o&&(t.style=o.join(" "))}(i,e,t,r,this._defs),i},defs(t){const e=this._defs.gradient,n=this._defs.clipping;if(0!==Object.keys(e).length+Object.keys(n).length){t.open("defs");for(const n in e){const r=e[n],i=r.stops;"radial"===r.gradient?(t.open("pattern",{id:ep+n,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+n+")"}).close(),t.close(),t.open("radialGradient",{id:n,fx:r.x1,fy:r.y1,fr:r.r1,cx:r.x2,cy:r.y2,r:r.r2})):t.open("linearGradient",{id:n,x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2});for(let e=0;e1?(Ev[t]=e,this):Ev[t]}function Cv(t,e,n){const r=[],i=(new eg).union(e),o=t.marktype;return o?Fv(t,i,n,r):"group"===o?Sv(t,i,n,r):u("Intersect scene must be mark node or group item.")}function Fv(t,e,n,r){if(function(t,e,n){return t.bounds&&e.intersects(t.bounds)&&("group"===t.marktype||!1!==t.interactive&&(!n||n(t)))}(t,e,n)){const i=t.items,o=t.marktype,a=i.length;let u=0;if("group"===o)for(;u=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(!zv(t[n=i[r]],e[n],n))return!1;return typeof t==typeof e}(t,e):t==e)}function Ov(t,e){return zv(dp(t),dp(e))}const Rv="top",Lv="left",Uv="right",qv="bottom",Pv="start",jv="middle",Iv="end",$v="group",Wv="axis",Hv="title",Yv="legend",Gv="row-header",Vv="row-footer",Xv="row-title",Jv="column-header",Zv="column-footer",Qv="column-title",Kv="none",t_="all",e_="each",n_="flush",r_="column",i_="row";function o_(t){Ba.call(this,null,t)}function a_(t,e,n){return e(t.bounds.clear(),t,n)}ut(o_,Ba,{transform(t,e){const n=e.dataflow,r=t.mark,i=r.marktype,o=Qm[i],a=o.bound;let u,s=r.bounds;if(o.nested)r.items.length&&n.dirty(r.items[0]),s=a_(r,a),r.items.forEach((t=>{t.bounds.clear().union(s)}));else if(i===$v||t.modified())switch(e.visit(e.MOD,(t=>n.dirty(t))),s.clear(),r.items.forEach((t=>s.union(a_(t,a)))),r.role){case Wv:case Yv:case Hv:e.reflow()}else u=e.changed(e.REM),e.visit(e.ADD,(t=>{s.union(a_(t,a))})),e.visit(e.MOD,(t=>{u=u||s.alignsWith(t.bounds),n.dirty(t),s.union(a_(t,a))})),u&&(s.clear(),r.items.forEach((t=>s.union(t.bounds))));return Nv(r),e.modifies("bounds")}});const u_=":vega_identifier:";function s_(t){Ba.call(this,0,t)}function l_(t){Ba.call(this,null,t)}function c_(t){Ba.call(this,null,t)}s_.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},ut(s_,Ba,{transform(t,e){const n=(i=e.dataflow)._signals[u_]||(i._signals[u_]=i.add(0)),r=t.as;var i;let o=n.value;return e.visit(e.ADD,(t=>t[r]=t[r]||++o)),n.set(this.value=o),e}}),ut(l_,Ba,{transform(t,e){let n=this.value;n||(n=e.dataflow.scenegraph().mark(t.markdef,function(t){const e=t.groups,n=t.parent;return e&&1===e.size?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}(t),t.index),n.group.context=t.context,t.context.group||(t.context.group=n.group),n.source=this.source,n.clip=t.clip,n.interactive=t.interactive,this.value=n);const r=n.marktype===$v?rg:ng;return e.visit(e.ADD,(t=>r.call(t,n))),(t.modified("clip")||t.modified("interactive"))&&(n.clip=t.clip,n.interactive=!!t.interactive,n.zdirty=!0,e.reflow()),n.items=e.source,e}});const f_={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,r)=>r&&h_(n.bounds,t.bounds,e)?t.opacity=0:(n=t,1)))}},h_=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2),d_=(t,e)=>{for(var n,r=1,i=t.length,o=t[0].bounds;r{const e=t.bounds;return e.width()>1&&e.height()>1},g_=t=>(t.forEach((t=>t.opacity=1)),t),m_=(t,e)=>t.reflow(e.modified()).modifies("opacity");function y_(t){Ba.call(this,null,t)}ut(c_,Ba,{transform(t,e){const n=f_[t.method]||f_.parity,r=t.separation||0;let i,o,a=e.materialize(e.SOURCE).source;if(!a||!a.length)return;if(!t.method)return t.modified("method")&&(g_(a),e=m_(e,t)),e;if(a=a.filter(p_),!a.length)return;if(t.sort&&(a=a.slice().sort(t.sort)),i=g_(a),e=m_(e,t),i.length>=3&&d_(i,r)){do{i=n(i,r)}while(i.length>=3&&d_(i,r));i.length<3&&!A(a).opacity&&(i.length>1&&(A(i).opacity=0),A(a).opacity=1)}t.boundScale&&t.boundTolerance>=0&&(o=((t,e,n)=>{var r=t.range(),i=new eg;return e===Rv||e===qv?i.set(r[0],-1/0,r[1],1/0):i.set(-1/0,r[0],1/0,r[1]),i.expand(n||1),t=>i.encloses(t.bounds)})(t.boundScale,t.boundOrient,+t.boundTolerance),a.forEach((t=>{o(t)||(t.opacity=0)})));const u=i[0].mark.bounds.clear();return a.forEach((t=>{t.opacity&&u.union(t.bounds)})),e}}),ut(y_,Ba,{transform(t,e){const n=e.dataflow;if(e.visit(e.ALL,(t=>n.dirty(t))),e.fields&&e.fields.zindex){const t=e.source&&e.source[0];t&&(t.mark.zdirty=!0)}}});const v_=new eg;function __(t,e,n){return t[e]===n?0:(t[e]=n,1)}function x_(t){var e=t.items[0].orient;return e===Lv||e===Uv}function b_(t,e,n,r){var i,o,a=e.items[0],u=a.datum,s=null!=a.translate?a.translate:.5,l=a.orient,c=function(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}(u),f=a.range,h=a.offset,d=a.position,p=a.minExtent,g=a.maxExtent,m=u.title&&a.items[c[2]].items[0],y=a.titlePadding,v=a.bounds,_=m&&jm(m),x=0,b=0;switch(v_.clear().union(v),v.clear(),(i=c[0])>-1&&v.union(a.items[i].bounds),(i=c[1])>-1&&v.union(a.items[i].bounds),l){case Rv:x=d||0,b=-h,o=Math.max(p,Math.min(g,-v.y1)),v.add(0,-o).add(f,0),m&&w_(t,m,o,y,_,0,-1,v);break;case Lv:x=-h,b=d||0,o=Math.max(p,Math.min(g,-v.x1)),v.add(-o,0).add(0,f),m&&w_(t,m,o,y,_,1,-1,v);break;case Uv:x=n+h,b=d||0,o=Math.max(p,Math.min(g,v.x2)),v.add(0,0).add(o,f),m&&w_(t,m,o,y,_,1,1,v);break;case qv:x=d||0,b=r+h,o=Math.max(p,Math.min(g,v.y2)),v.add(0,0).add(f,o),m&&w_(t,m,o,y,0,0,1,v);break;default:x=a.x,b=a.y}return ug(v.translate(x,b),a),__(a,"x",x+s)|__(a,"y",b+s)&&(a.bounds=v_,t.dirty(a),a.bounds=v,t.dirty(a)),a.mark.bounds.clear().union(v)}function w_(t,e,n,r,i,o,a,u){const s=e.bounds;if(e.auto){const u=a*(n+i+r);let l=0,c=0;t.dirty(e),o?l=(e.x||0)-(e.x=u):c=(e.y||0)-(e.y=u),e.mark.bounds.clear().union(s.translate(-l,-c)),t.dirty(e)}u.union(s)}const k_=(t,e)=>Math.floor(Math.min(t,e)),A_=(t,e)=>Math.ceil(Math.max(t,e));function M_(t){return(new eg).set(0,0,t.width||0,t.height||0)}function E_(t){const e=t.bounds.clone();return e.empty()?e.set(0,0,0,0):e.translate(-(t.x||0),-(t.y||0))}function D_(t,e,n){const r=_(t)?t[e]:t;return null!=r?r:void 0!==n?n:0}function C_(t){return t<0?Math.ceil(-t):0}function F_(t,e,n){var r,i,o,a,u,s,l,c,f,h,d,p=!n.nodirty,g=n.bounds===n_?M_:E_,m=v_.set(0,0,0,0),y=D_(n.align,r_),v=D_(n.align,i_),_=D_(n.padding,r_),x=D_(n.padding,i_),b=n.columns||e.length,w=b<=0?1:Math.ceil(e.length/b),k=e.length,A=Array(k),M=Array(b),E=0,D=Array(k),C=Array(w),F=0,S=Array(k),B=Array(k),T=Array(k);for(i=0;i1)for(i=0;i0&&(S[i]+=f/2);if(v&&D_(n.center,i_)&&1!==b)for(i=0;i0&&(B[i]+=h/2);for(i=0;ii&&(t.warn("Grid headers exceed limit: "+i),e=e.slice(0,i)),A+=o,g=0,y=e.length;g=0&&null==(x=n[m]);m-=h);u?(b=null==d?x.x:Math.round(x.bounds.x1+d*x.bounds.width()),w=A):(b=A,w=null==d?x.y:Math.round(x.bounds.y1+d*x.bounds.height())),v.union(_.bounds.translate(b-(_.x||0),w-(_.y||0))),_.x=b,_.y=w,t.dirty(_),M=a(M,v[l])}return M}function N_(t,e,n,r,i,o){if(e){t.dirty(e);var a=n,u=n;r?a=Math.round(i.x1+o*i.width()):u=Math.round(i.y1+o*i.height()),e.bounds.translate(a-(e.x||0),u-(e.y||0)),e.mark.bounds.clear().union(e.bounds),e.x=a,e.y=u,t.dirty(e)}}function z_(t,e,n,r,i,o,a){const u=function(t,e){const n=t[e]||{};return(e,r)=>null!=n[e]?n[e]:null!=t[e]?t[e]:r}(n,e),s=function(t,e){let n=-1/0;return t.forEach((t=>{null!=t.offset&&(n=Math.max(n,t.offset))})),n>-1/0?n:e}(t,u("offset",0)),l=u("anchor",Pv),c=l===Iv?1:l===jv?.5:0,f={align:e_,bounds:u("bounds",n_),columns:"vertical"===u("direction")?1:t.length,padding:u("margin",8),center:u("center"),nodirty:!0};switch(e){case Lv:f.anchor={x:Math.floor(r.x1)-s,column:Iv,y:c*(a||r.height()+2*r.y1),row:l};break;case Uv:f.anchor={x:Math.ceil(r.x2)+s,y:c*(a||r.height()+2*r.y1),row:l};break;case Rv:f.anchor={y:Math.floor(i.y1)-s,row:Iv,x:c*(o||i.width()+2*i.x1),column:l};break;case qv:f.anchor={y:Math.ceil(i.y2)+s,x:c*(o||i.width()+2*i.x1),column:l};break;case"top-left":f.anchor={x:s,y:s};break;case"top-right":f.anchor={x:o-s,y:s,column:Iv};break;case"bottom-left":f.anchor={x:s,y:a-s,row:Iv};break;case"bottom-right":f.anchor={x:o-s,y:a-s,column:Iv,row:Iv}}return f}function O_(t,e){var n,r,i=e.items[0],o=i.datum,a=i.orient,u=i.bounds,s=i.x,l=i.y;return i._bounds?i._bounds.clear().union(u):i._bounds=u.clone(),u.clear(),function(t,e,n){var r=e.padding,i=r-n.x,o=r-n.y;if(e.datum.title){var a=e.items[1].items[0],u=a.anchor,s=e.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case Lv:i+=Math.ceil(a.bounds.width())+s;break;case Uv:case qv:break;default:o+=a.bounds.height()+s}switch((i||o)&&L_(t,n,i,o),a.orient){case Lv:c+=R_(e,n,a,u,1,1);break;case Uv:l+=R_(e,n,a,Iv,0,0)+s,c+=R_(e,n,a,u,1,1);break;case qv:l+=R_(e,n,a,u,0,0),c+=R_(e,n,a,Iv,-1,0,1)+s;break;default:l+=R_(e,n,a,u,0,0)}(l||c)&&L_(t,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(L_(t,n,-l,0),L_(t,a,-l,0))}else(i||o)&&L_(t,n,i,o)}(t,i,i.items[0].items[0]),u=function(t,e){return t.items.forEach((t=>e.union(t.bounds))),e.x1=t.padding,e.y1=t.padding,e}(i,u),n=2*i.padding,r=2*i.padding,u.empty()||(n=Math.ceil(u.width()+n),r=Math.ceil(u.height()+r)),"symbol"===o.type&&function(t){const e=t.reduce(((t,e)=>(t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0),t)),{});t.forEach((t=>{t.width=e[t.column],t.height=t.bounds.y2-t.y}))}(i.items[0].items[0].items[0].items),a!==Kv&&(i.x=s=0,i.y=l=0),i.width=n,i.height=r,ug(u.set(s,l,s+n,l+r),i),i.mark.bounds.clear().union(u),i}function R_(t,e,n,r,i,o,a){const u="symbol"!==t.datum.type,s=n.datum.vgrad,l=(!u||!o&&s||a?e:e.items[0]).bounds[i?"y2":"x2"]-t.padding,c=s&&o?l:0,f=s&&o?0:l,h=i<=0?0:jm(n);return Math.round(r===Pv?c:r===Iv?f-h:.5*(l-h))}function L_(t,e,n,r){e.x+=n,e.y+=r,e.bounds.translate(n,r),e.mark.bounds.translate(n,r),t.dirty(e)}function U_(t){Ba.call(this,null,t)}ut(U_,Ba,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach((e=>{t.layout&&function(t,e,n){var r,i,o,a,u,s,l,c=function(t){var e,n,r=t.items,i=r.length,o=0;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;o{(o=t.orient||Uv)!==Kv&&(e[o]||(e[o]=[])).push(t)}));for(const r in e){const i=e[r];F_(t,i,z_(i,r,n.legends,h,d,l,c))}p.forEach((e=>{const r=e.bounds;if(r.equals(e._bounds)||(e.bounds=e._bounds,t.dirty(e),e.bounds=r,t.dirty(e)),n.autosize&&"fit"===n.autosize.type)switch(e.orient){case Lv:case Uv:f.add(r.x1,0).add(r.x2,0);break;case Rv:case qv:f.add(0,r.y1).add(0,r.y2)}else f.union(r)}))}f.union(h).union(d),r&&f.union(function(t,e,n,r,i){var o,a=e.items[0],u=a.frame,s=a.orient,l=a.anchor,c=a.offset,f=a.padding,h=a.items[0].items[0],d=a.items[1]&&a.items[1].items[0],p=s===Lv||s===Uv?r:n,g=0,m=0,y=0,v=0,_=0;if(u!==$v?s===Lv?(g=i.y2,p=i.y1):s===Uv?(g=i.y1,p=i.y2):(g=i.x1,p=i.x2):s===Lv&&(g=r,p=0),o=l===Pv?g:l===Iv?p:(g+p)/2,d&&d.text){switch(s){case Rv:case qv:_=h.bounds.height()+f;break;case Lv:v=h.bounds.width()+f;break;case Uv:v=-h.bounds.width()-f}v_.clear().union(d.bounds),v_.translate(v-(d.x||0),_-(d.y||0)),__(d,"x",v)|__(d,"y",_)&&(t.dirty(d),d.bounds.clear().union(v_),d.mark.bounds.clear().union(v_),t.dirty(d)),v_.clear().union(d.bounds)}else v_.clear();switch(v_.union(h.bounds),s){case Rv:m=o,y=i.y1-v_.height()-c;break;case Lv:m=i.x1-v_.width()-c,y=o;break;case Uv:m=i.x2+v_.width()+c,y=o;break;case qv:m=o,y=i.y2+c;break;default:m=a.x,y=a.y}return __(a,"x",m)|__(a,"y",y)&&(v_.translate(m,y),t.dirty(a),a.bounds.clear().union(v_),e.bounds.clear().union(v_),t.dirty(a)),a.bounds}(t,r,l,c,f)),e.clip&&f.set(0,0,e.width||0,e.height||0),function(t,e,n,r){const i=r.autosize||{},o=i.type;if(t._autosize<1||!o)return;let a=t._width,u=t._height,s=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const h=Math.max(0,Math.ceil(n.x2-s)),d=Math.max(0,Math.ceil(n.y2-c));if("padding"===i.contains){const e=t.padding();a-=e.left+e.right,u-=e.top+e.bottom}o===Kv?(l=0,f=0,s=a,c=u):"fit"===o?(s=Math.max(0,a-l-h),c=Math.max(0,u-f-d)):"fit-x"===o?(s=Math.max(0,a-l-h),u=c+f+d):"fit-y"===o?(a=s+l+h,c=Math.max(0,u-f-d)):"pad"===o&&(a=s+l+h,u=c+f+d),t._resizeView(a,u,s,c,[l,f],i.resize)}(t,e,f,n)}(n,e,t)})),function(t){return t&&"legend-entry"!==t.mark.role}(t.mark.group)?e.reflow():e}});var q_=Object.freeze({__proto__:null,bound:o_,identifier:s_,mark:l_,overlap:c_,render:y_,viewlayout:U_});function P_(t){Ba.call(this,null,t)}function j_(t){Ba.call(this,null,t)}function I_(){return ea({})}function $_(t){Ba.call(this,null,t)}function W_(t){Ba.call(this,[],t)}ut(P_,Ba,{transform(t,e){if(this.value&&!t.modified())return e.StopPropagation;var n=e.dataflow.locale(),r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=this.value,o=t.scale,a=qd(o,null==t.count?t.values?t.values.length:10:t.count,t.minstep),u=t.format||Id(n,o,a,t.formatSpecifier,t.formatType,!!t.values),s=t.values?Pd(o,t.values,a):jd(o,a);return i&&(r.rem=i),i=s.map(((t,e)=>ea({index:e/(s.length-1||1),value:t,label:u(t)}))),t.extra&&i.length&&i.push(ea({index:-1,extra:{value:i[0].value},label:""})),r.source=i,r.add=i,this.value=i,r}}),ut(j_,Ba,{transform(t,e){var n=e.dataflow,r=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=t.item||I_,o=t.key||Ko,a=this.value;return v(r.encode)&&(r.encode=null),a&&(t.modified("key")||e.modified(o))&&u("DataJoin does not support modified key function or fields."),a||(e=e.addAll(),this.value=a=function(t){const e=ot().test((t=>t.exit));return e.lookup=n=>e.get(t(n)),e}(o)),e.visit(e.ADD,(t=>{const e=o(t);let n=a.get(e);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(t),a.set(e,n),r.add.push(n)),n.datum=t,n.exit=!1})),e.visit(e.MOD,(t=>{const e=o(t),n=a.get(e);n&&(n.datum=t,r.mod.push(n))})),e.visit(e.REM,(t=>{const e=o(t),n=a.get(e);t!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)})),e.changed(e.ADD_MOD)&&r.modifies("datum"),(e.clean()||t.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),ut($_,Ba,{transform(t,e){var n=e.fork(e.ADD_REM),r=t.mod||!1,i=t.encoders,o=e.encode;if(v(o)){if(!n.changed()&&!o.every((t=>i[t])))return e.StopPropagation;o=o[0],n.encode=null}var a="enter"===o,u=i.update||g,s=i.enter||g,l=i.exit||g,c=(o&&!a?i[o]:u)||g;if(e.changed(e.ADD)&&(e.visit(e.ADD,(e=>{s(e,t),u(e,t)})),n.modifies(s.output),n.modifies(u.output),c!==g&&c!==u&&(e.visit(e.ADD,(e=>{c(e,t)})),n.modifies(c.output))),e.changed(e.REM)&&l!==g&&(e.visit(e.REM,(e=>{l(e,t)})),n.modifies(l.output)),a||c!==g){const i=e.MOD|(t.modified()?e.REFLOW:0);a?(e.visit(i,(e=>{const i=s(e,t)||r;(c(e,t)||i)&&n.mod.push(e)})),n.mod.length&&n.modifies(s.output)):e.visit(i,(e=>{(c(e,t)||r)&&n.mod.push(e)})),n.mod.length&&n.modifies(c.output)}return n.changed()?n:e.StopPropagation}}),ut(W_,Ba,{transform(t,e){if(null!=this.value&&!t.modified())return e.StopPropagation;var n,r,i,o,a,u=e.dataflow.locale(),s=e.fork(e.NO_SOURCE|e.NO_FIELDS),l=this.value,c=t.type||Od,f=t.scale,h=+t.limit,d=qd(f,null==t.count?5:t.count,t.minstep),p=!!t.values||c===Od,g=t.format||Gd(u,f,d,c,t.formatSpecifier,t.formatType,p),m=t.values||Yd(f,d);return l&&(s.rem=l),c===Od?(h&&m.length>h?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),l=m.slice(0,h-1),a=!0):l=m,H(i=t.size)?(t.values||0!==f(l[0])||(l=l.slice(1)),o=l.reduce(((e,n)=>Math.max(e,i(n,t))),0)):i=Z(o=i||8),l=l.map(((e,n)=>ea({index:n,label:g(e,n,l),value:e,offset:o,size:i(e,t)}))),a&&(a=m[l.length],l.push(ea({index:l.length,label:"…".concat(m.length-l.length," entries"),value:a,offset:o,size:i(a,t)})))):"gradient"===c?(n=f.domain(),r=Fd(f,n[0],A(n)),m.length<3&&!t.values&&n[0]!==A(n)&&(m=[n[0],A(n)]),l=m.map(((t,e)=>ea({index:e,label:g(t,e,m),value:t,perc:r(t)})))):(i=m.length-1,r=function(t){const e=t.domain(),n=e.length-1;let r=+e[0],i=+A(e),o=i-r;if(t.type===ed){const t=n?o/n:.1;r-=t,i+=t,o=i-r}return t=>(t-r)/o}(f),l=m.map(((t,e)=>ea({index:e,label:g(t,e,m),value:t,perc:e?r(t):0,perc2:e===i?1:r(m[e+1])})))),s.source=l,s.add=l,this.value=l,s}});const H_=t=>t.source.x,Y_=t=>t.source.y,G_=t=>t.target.x,V_=t=>t.target.y;function X_(t){Ba.call(this,{},t)}X_.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},ut(X_,Ba,{transform(t,e){var n=t.sourceX||H_,r=t.sourceY||Y_,i=t.targetX||G_,o=t.targetY||V_,a=t.as||"path",s=t.orient||"vertical",l=t.shape||"line",c=K_.get(l+"-"+s)||K_.get(l);return c||u("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:"")),e.visit(e.SOURCE,(t=>{t[a]=c(n(t),r(t),i(t),o(t))})),e.reflow(t.modified()).modifies(a)}});const J_=(t,e,n,r)=>"M"+t+","+e+"L"+n+","+r,Z_=(t,e,n,r)=>{var i=n-t,o=r-e,a=Math.sqrt(i*i+o*o)/2;return"M"+t+","+e+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r},Q_=(t,e,n,r)=>{const i=n-t,o=r-e,a=.2*(i+o),u=.2*(o-i);return"M"+t+","+e+"C"+(t+a)+","+(e+u)+" "+(n+u)+","+(r-a)+" "+n+","+r},K_=ot({line:J_,"line-radial":(t,e,n,r)=>J_(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),arc:Z_,"arc-radial":(t,e,n,r)=>Z_(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),curve:Q_,"curve-radial":(t,e,n,r)=>Q_(e*Math.cos(t),e*Math.sin(t),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(t,e,n,r)=>"M"+t+","+e+"V"+r+"H"+n,"orthogonal-vertical":(t,e,n,r)=>"M"+t+","+e+"H"+n+"V"+r,"orthogonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),u=Math.sin(n);return"M"+e*i+","+e*o+"A"+e+","+e+" 0 0,"+((Math.abs(n-t)>Math.PI?n<=t:n>t)?1:0)+" "+e*a+","+e*u+"L"+r*a+","+r*u},"diagonal-horizontal":(t,e,n,r)=>{const i=(t+n)/2;return"M"+t+","+e+"C"+i+","+e+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(t,e,n,r)=>{const i=(e+r)/2;return"M"+t+","+e+"C"+t+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(t,e,n,r)=>{const i=Math.cos(t),o=Math.sin(t),a=Math.cos(n),u=Math.sin(n),s=(e+r)/2;return"M"+e*i+","+e*o+"C"+s*i+","+s*o+" "+s*a+","+s*u+" "+r*a+","+r*u}});function tx(t){Ba.call(this,null,t)}function ex(t){return _d(t)&&t!==Zh}tx.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},ut(tx,Ba,{transform(t,e){var n,r,i,o=t.as||["startAngle","endAngle"],a=o[0],u=o[1],s=t.field||d,l=t.startAngle||0,c=null!=t.endAngle?t.endAngle:2*Math.PI,f=e.source,h=f.map(s),p=h.length,g=l,m=(c-l)/ve(h),y=ye(p);for(t.sort&&y.sort(((t,e)=>h[t]-h[e])),n=0;nt+(e<0?-1:e>0?1:0)),0))!==e.length&&n.warn("Log scale domain includes zero: "+wt(e)),e}function ox(t,e,n){return H(t)&&(e||n)?Ed(t,ax(e||[0,1],n)):t}function ax(t,e){return e?t.slice().reverse():t}function ux(t){Ba.call(this,null,t)}ut(rx,Ba,{transform(t,e){var n=e.dataflow,r=this.value,i=function(t){var e,n=t.type,r="";return n===Zh?"sequential-linear":(function(t){const e=t.type;return _d(e)&&e!==Xh&&e!==Jh&&(t.scheme||t.range&&t.range.length&&t.range.every(pt))}(t)&&(r=2===(e=t.rawDomain?t.rawDomain.length:t.domain?t.domain.length+ +(null!=t.domainMid):0)?"sequential-":3===e?"diverging-":""),(r+n||Wh).toLowerCase())}(t);for(i in r&&i===r.type||(this.value=r=md(i)()),t)if(!nx[i]){if("padding"===i&&ex(r.type))continue;H(r[i])?r[i](t[i]):n.warn("Unsupported scale property: "+i)}return function(t,e,n){var r=t.type,i=e.round||!1,o=e.range;if(null!=e.rangeStep)o=function(t,e,n){t!==id&&t!==rd&&u("Only band and point scales support rangeStep.");var r=(null!=e.paddingOuter?e.paddingOuter:e.padding)||0,i=t===rd?1:(null!=e.paddingInner?e.paddingInner:e.padding)||0;return[0,e.rangeStep*$h(n,i,r)]}(r,e,n);else if(e.scheme&&(o=function(t,e,n){var r,i=e.schemeExtent;return v(e.scheme)?r=Dd(e.scheme,e.interpolate,e.interpolateGamma):(r=zd(e.scheme.toLowerCase()))||u("Unrecognized scheme name: ".concat(e.scheme)),n=t===ed?n+1:t===od?n-1:t===Kh||t===td?+e.schemeCount||5:n,kd(t)?ox(r,i,e.reverse):H(r)?Cd(ox(r,i),n):t===nd?r:r.slice(0,n)}(r,e,n),H(o))){if(t.interpolator)return t.interpolator(o);u("Scale type ".concat(r," does not support interpolating color schemes."))}if(o&&kd(r))return t.interpolator(Dd(ax(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&t.interpolate?t.interpolate(Sd(e.interpolate,e.interpolateGamma)):H(t.round)?t.round(i):H(t.rangeRound)&&t.interpolate(i?Pf:qf),o&&t.range(ax(o,e.reverse))}(r,t,function(t,e,n){let r=e.bins;if(r&&!v(r)){const e=t.domain(),n=e[0],i=A(e),o=r.step;let a=null==r.start?n:r.start,s=null==r.stop?i:r.stop;o||u("Scale bins parameter missing step property."),ai&&(s=o*Math.floor(i/o)),r=ye(a,s+o/2,o)}return r?t.bins=r:t.bins&&delete t.bins,t.type===od&&(r?e.domain||e.domainRaw||(t.domain(r),n=r.length):t.bins=t.domain()),n}(r,t,function(t,e,n){const r=function(t,e,n){return e?(t.domain(ix(t.type,e,n)),e.length):-1}(t,e.domainRaw,n);if(r>-1)return r;var i,o,a=e.domain,u=t.type,s=e.zero||void 0===e.zero&&function(t){const e=t.type;return!t.bins&&(e===Wh||e===Yh||e===Gh)}(t);if(!a)return 0;if(ex(u)&&e.padding&&a[0]!==A(a)&&(a=function(t,e,n,r,i,o){var a=Math.abs(A(n)-n[0]),u=a/(a-2*r),s=t===Hh?U(e,null,u):t===Gh?q(e,null,u,.5):t===Yh?q(e,null,u,i||1):t===Vh?P(e,null,u,o||1):L(e,null,u);return(e=e.slice())[0]=s[0],e[e.length-1]=s[1],e}(u,a,e.range,e.padding,e.exponent,e.constant)),(s||null!=e.domainMin||null!=e.domainMax||null!=e.domainMid)&&(i=(a=a.slice()).length-1||1,s&&(a[0]>0&&(a[0]=0),a[i]<0&&(a[i]=0)),null!=e.domainMin&&(a[0]=e.domainMin),null!=e.domainMax&&(a[i]=e.domainMax),null!=e.domainMid)){const t=(o=e.domainMid)>a[i]?i+1:ot(s);if(null==e)d.push(t.slice());else for(i={},o=0,a=t.length;oh&&(h=f),n&&c.sort(n)}return d.max=h,d}(e.source,t.groupby,l,c),r=0,i=n.length,o=n.max;r0?1:t<0?-1:0},Rx=Math.sqrt,Lx=Math.tan;function Ux(t){return t>1?0:t<-1?_x:Math.acos(t)}function qx(t){return t>1?xx:t<-1?-xx:Math.asin(t)}function Px(){}function jx(t,e){t&&$x.hasOwnProperty(t.type)&&$x[t.type](t,e)}var Ix={Feature:function(t,e){jx(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=Cx(e=(e*=Ax)/2+bx),a=zx(e),u=Zx*a,s=Jx*o+u*Cx(i),l=u*r*zx(i);lb.add(Dx(l,s)),Xx=t,Jx=o,Zx=a}function mb(t){return[Dx(t[1],t[0]),qx(t[2])]}function yb(t){var e=t[0],n=t[1],r=Cx(n);return[r*Cx(e),r*zx(e),zx(n)]}function vb(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _b(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xb(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function bb(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function wb(t){var e=Rx(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var kb,Ab,Mb,Eb,Db,Cb,Fb,Sb,Bb,Tb,Nb,zb,Ob,Rb,Lb,Ub,qb={point:Pb,lineStart:Ib,lineEnd:$b,polygonStart:function(){qb.point=Wb,qb.lineStart=Hb,qb.lineEnd=Yb,ab=new Xt,fb.polygonStart()},polygonEnd:function(){fb.polygonEnd(),qb.point=Pb,qb.lineStart=Ib,qb.lineEnd=$b,lb<0?(Qx=-(tb=180),Kx=-(eb=90)):ab>yx?eb=90:ab<-1e-6&&(Kx=-90),sb[0]=Qx,sb[1]=tb},sphere:function(){Qx=-(tb=180),Kx=-(eb=90)}};function Pb(t,e){ub.push(sb=[Qx=t,tb=t]),eeb&&(eb=e)}function jb(t,e){var n=yb([t*Ax,e*Ax]);if(ob){var r=_b(ob,n),i=_b([r[1],-r[0],0],r);wb(i),i=mb(i);var o,a=t-nb,u=a>0?1:-1,s=i[0]*kx*u,l=Mx(a)>180;l^(u*nbeb&&(eb=o):l^(u*nb<(s=(s+360)%360-180)&&seb&&(eb=e)),l?tGb(Qx,tb)&&(tb=t):Gb(t,tb)>Gb(Qx,tb)&&(Qx=t):tb>=Qx?(ttb&&(tb=t)):t>nb?Gb(Qx,t)>Gb(Qx,tb)&&(tb=t):Gb(t,tb)>Gb(Qx,tb)&&(Qx=t)}else ub.push(sb=[Qx=t,tb=t]);eeb&&(eb=e),ob=n,nb=t}function Ib(){qb.point=jb}function $b(){sb[0]=Qx,sb[1]=tb,qb.point=Pb,ob=null}function Wb(t,e){if(ob){var n=t-nb;ab.add(Mx(n)>180?n+(n>0?360:-360):n)}else rb=t,ib=e;fb.point(t,e),jb(t,e)}function Hb(){fb.lineStart()}function Yb(){Wb(rb,ib),fb.lineEnd(),Mx(ab)>yx&&(Qx=-(tb=180)),sb[0]=Qx,sb[1]=tb,ob=null}function Gb(t,e){return(e-=t)<0?e+360:e}function Vb(t,e){return t[0]-e[0]}function Xb(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e_x?t+Math.round(-t/wx)*wx:t,e]}function lw(t,e,n){return(t%=wx)?e||n?uw(fw(t),hw(e,n)):fw(t):e||n?hw(e,n):sw}function cw(t){return function(e,n){return[(e+=t)>_x?e-wx:e<-_x?e+wx:e,n]}}function fw(t){var e=cw(t);return e.invert=cw(-t),e}function hw(t,e){var n=Cx(t),r=zx(t),i=Cx(e),o=zx(e);function a(t,e){var a=Cx(e),u=Cx(t)*a,s=zx(t)*a,l=zx(e),c=l*n+u*r;return[Dx(s*i-c*o,u*n-l*r),qx(c*i+s*o)]}return a.invert=function(t,e){var a=Cx(e),u=Cx(t)*a,s=zx(t)*a,l=zx(e),c=l*i-s*o;return[Dx(s*i+l*o,u*n+c*r),qx(c*n-u*r)]},a}function dw(t,e){(e=yb(e))[0]-=t,wb(e);var n=Ux(-e[1]);return((-e[2]<0?-n:n)+wx-yx)%wx}function pw(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:Px,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function gw(t,e){return Mx(t[0]-e[0])=0;--o)i.point((c=l[o])[0],c[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function vw(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,E=M*A,D=E>_x,C=m*w;if(s.add(Dx(C*M*zx(E),y*k+C*Cx(E))),a+=D?A+M*wx:A,D^p>=n^x>=n){var F=_b(yb(d),yb(_));wb(F);var S=_b(o,F);wb(S);var B=(D^A>=0?-1:1)*qx(S[2]);(r>B||r===B&&(F[0]||F[1]))&&(u+=D^A>=0?1:-1)}}return(a<-1e-6||a0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t1&&2&s&&h.push(h.pop().concat(h.shift())),a.push(h.filter(bw))}return h}}function bw(t){return t.length>1}function ww(t,e){return((t=t.x)[0]<0?t[1]-xx-yx:xx-t[1])-((e=e.x)[0]<0?e[1]-xx-yx:xx-e[1])}sw.invert=sw;var kw=xw((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?_x:-_x,s=Mx(o-n);Mx(s-_x)0?xx:-xx),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&s>=_x&&(Mx(n-i)yx?Ex((zx(e)*(o=Cx(r))*zx(n)-zx(r)*(i=Cx(e))*zx(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*xx,r.point(-_x,i),r.point(0,i),r.point(_x,i),r.point(_x,0),r.point(_x,-i),r.point(0,-i),r.point(-_x,-i),r.point(-_x,0),r.point(-_x,i);else if(Mx(t[0]-e[0])>yx){var o=t[0]0)do{l.point(0===c||3===c?t:n,c>1?r:e)}while((c=(c+u+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return Mx(r[0]-t)0?0:3:Mx(r[0]-n)0?2:1:Mx(r[1]-e)0?1:0:i>0?3:2}function u(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var s,l,c,f,h,d,p,g,m,y,v,_=a,x=pw(),b={point:w,lineStart:function(){b.point=k,l&&l.push(c=[]),y=!0,m=!1,p=g=NaN},lineEnd:function(){s&&(k(f,h),d&&m&&x.rejoin(),s.push(x.result())),b.point=w,m&&_.lineEnd()},polygonStart:function(){_=x,s=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;nr&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=v&&e,i=(s=me(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&yw(s,u,e,o,a),a.polygonEnd()),_=a,s=l=c=null}};function w(t,e){i(t,e)&&_.point(t,e)}function k(o,a){var u=i(o,a);if(l&&c.push([o,a]),y)f=o,h=a,d=u,y=!1,u&&(_.lineStart(),_.point(o,a));else if(u&&m)_.point(o,a);else{var s=[p=Math.max(Mw,Math.min(Aw,p)),g=Math.max(Mw,Math.min(Aw,g))],x=[o=Math.max(Mw,Math.min(Aw,o)),a=Math.max(Mw,Math.min(Aw,a))];!function(t,e,n,r,i,o){var a,u=t[0],s=t[1],l=0,c=1,f=e[0]-u,h=e[1]-s;if(a=n-u,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=i-u,f||!(a<0)){if(a/=f,f<0){if(a>c)return;a>l&&(l=a)}else if(f>0){if(a0)){if(a/=h,h<0){if(a0){if(a>c)return;a>l&&(l=a)}if(a=o-s,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>l&&(l=a)}else if(h>0){if(a0&&(t[0]=u+l*f,t[1]=s+l*h),c<1&&(e[0]=u+c*f,e[1]=s+c*h),!0}}}}}(s,x,t,e,n,r)?u&&(_.lineStart(),_.point(o,a),v=!1):(m||(_.lineStart(),_.point(s[0],s[1])),_.point(x[0],x[1]),u||_.lineEnd(),v=!1)}p=o,g=a,m=u}return b}}function Dw(t,e,n){var r=ye(t,e-yx,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Cw(t,e,n){var r=ye(t,e-yx,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}var Fw,Sw,Bw,Tw,Nw=t=>t,zw=new Xt,Ow=new Xt,Rw={point:Px,lineStart:Px,lineEnd:Px,polygonStart:function(){Rw.lineStart=Lw,Rw.lineEnd=Pw},polygonEnd:function(){Rw.lineStart=Rw.lineEnd=Rw.point=Px,zw.add(Mx(Ow)),Ow=new Xt},result:function(){var t=zw/2;return zw=new Xt,t}};function Lw(){Rw.point=Uw}function Uw(t,e){Rw.point=qw,Fw=Bw=t,Sw=Tw=e}function qw(t,e){Ow.add(Tw*t-Bw*e),Bw=t,Tw=e}function Pw(){qw(Fw,Sw)}var jw,Iw,$w,Ww,Hw=Rw,Yw=1/0,Gw=Yw,Vw=-Yw,Xw=Vw,Jw={point:function(t,e){tVw&&(Vw=t),eXw&&(Xw=e)},lineStart:Px,lineEnd:Px,polygonStart:Px,polygonEnd:Px,result:function(){var t=[[Yw,Gw],[Vw,Xw]];return Vw=Xw=-(Gw=Yw=1/0),t}},Zw=Jw,Qw=0,Kw=0,tk=0,ek=0,nk=0,rk=0,ik=0,ok=0,ak=0,uk={point:sk,lineStart:lk,lineEnd:hk,polygonStart:function(){uk.lineStart=dk,uk.lineEnd=pk},polygonEnd:function(){uk.point=sk,uk.lineStart=lk,uk.lineEnd=hk},result:function(){var t=ak?[ik/ak,ok/ak]:rk?[ek/rk,nk/rk]:tk?[Qw/tk,Kw/tk]:[NaN,NaN];return Qw=Kw=tk=ek=nk=rk=ik=ok=ak=0,t}};function sk(t,e){Qw+=t,Kw+=e,++tk}function lk(){uk.point=ck}function ck(t,e){uk.point=fk,sk($w=t,Ww=e)}function fk(t,e){var n=t-$w,r=e-Ww,i=Rx(n*n+r*r);ek+=i*($w+t)/2,nk+=i*(Ww+e)/2,rk+=i,sk($w=t,Ww=e)}function hk(){uk.point=sk}function dk(){uk.point=gk}function pk(){mk(jw,Iw)}function gk(t,e){uk.point=mk,sk(jw=$w=t,Iw=Ww=e)}function mk(t,e){var n=t-$w,r=e-Ww,i=Rx(n*n+r*r);ek+=i*($w+t)/2,nk+=i*(Ww+e)/2,rk+=i,ik+=(i=Ww*t-$w*e)*($w+t),ok+=i*(Ww+e),ak+=3*i,sk($w=t,Ww=e)}var yk=uk;function vk(t){this._context=t}vk.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,wx)}},result:Px};var _k,xk,bk,wk,kk,Ak=new Xt,Mk={point:Px,lineStart:function(){Mk.point=Ek},lineEnd:function(){_k&&Dk(xk,bk),Mk.point=Px},polygonStart:function(){_k=!0},polygonEnd:function(){_k=null},result:function(){var t=+Ak;return Ak=new Xt,t}};function Ek(t,e){Mk.point=Dk,xk=wk=t,bk=kk=e}function Dk(t,e){wk-=t,kk-=e,Ak.add(Rx(wk*wk+kk*kk)),wk=t,kk=e}var Ck=Mk;function Fk(){this._string=[]}function Sk(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Bk(t,e){var n,r,i=4.5;function o(t){return t&&("function"==typeof i&&r.pointRadius(+i.apply(this,arguments)),Yx(t,n(r))),r.result()}return o.area=function(t){return Yx(t,n(Hw)),Hw.result()},o.measure=function(t){return Yx(t,n(Ck)),Ck.result()},o.bounds=function(t){return Yx(t,n(Zw)),Zw.result()},o.centroid=function(t){return Yx(t,n(yk)),yk.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,Nw):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new Fk):new vk(e=t),"function"!=typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"==typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)}function Tk(t){return function(e){var n=new Nk;for(var r in t)n[r]=t[r];return n.stream=e,n}}function Nk(){}function zk(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),Yx(n,t.stream(Zw)),e(Zw.result()),null!=r&&t.clipExtent(r),t}function Ok(t,e,n){return zk(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])}),n)}function Rk(t,e,n){return Ok(t,[[0,0],e],n)}function Lk(t,e,n){return zk(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function Uk(t,e,n){return zk(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}Fk.prototype={_radius:4.5,_circle:Sk(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Sk(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Nk.prototype={constructor:Nk,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var qk=Cx(30*Ax);function Pk(t,e){return+e?function(t,e){function n(r,i,o,a,u,s,l,c,f,h,d,p,g,m){var y=l-r,v=c-i,_=y*y+v*v;if(_>4*e&&g--){var x=a+h,b=u+d,w=s+p,k=Rx(x*x+b*b+w*w),A=qx(w/=k),M=Mx(Mx(w)-1)e||Mx((y*F+v*S)/_-.5)>.3||a*h+u*d+s*p0,i=Mx(e)>yx;function o(t,n){return Cx(t)*Cx(n)>e}function a(t,n,r){var i=[1,0,0],o=_b(yb(t),yb(n)),a=vb(o,o),u=o[0],s=a-u*u;if(!s)return!r&&t;var l=e*a/s,c=-e*u/s,f=_b(i,o),h=bb(i,l);xb(h,bb(o,c));var d=f,p=vb(h,d),g=vb(d,d),m=p*p-g*(vb(h,h)-1);if(!(m<0)){var y=Rx(m),v=bb(d,(-p-y)/g);if(xb(v,h),v=mb(v),!r)return v;var _,x=t[0],b=n[0],w=t[1],k=n[1];b0^v[1]<(Mx(v[0]-x)_x^(x<=v[0]&&v[0]<=b)){var E=bb(d,(-p+y)/g);return xb(E,h),[v,mb(E)]}}}function u(e,n){var i=r?t:_x-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return xw(o,(function(t){var e,n,s,l,c;return{lineStart:function(){l=s=!1,c=1},point:function(f,h){var d,p=[f,h],g=o(f,h),m=r?g?0:u(f,h):g?u(f+(f<0?_x:-_x),h):0;if(!e&&(l=s=g)&&t.lineStart(),g!==s&&(!(d=a(e,p))||gw(e,d)||gw(p,d))&&(p[2]=1),g!==s)c=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var y;m&n||!(y=a(p,e,!0))||(c=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&gw(e,p)||t.point(p[0],p[1]),e=p,s=g,n=m},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return c|(l&&s)<<1}}}),(function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=Cx(e),u=zx(e),s=r*n;null==i?(i=e+r*wx,o=e-s/2):(i=dw(a,i),o=dw(a,o),(r>0?io)&&(i+=r*wx));for(var l,c=i;r>0?c>o:c2?t[2]%360*Ax:0,F()):[m*kx,y*kx,v*kx]},D.angle=function(t){return arguments.length?(_=t%360*Ax,F()):_*kx},D.reflectX=function(t){return arguments.length?(x=t?-1:1,F()):x<0},D.reflectY=function(t){return arguments.length?(b=t?-1:1,F()):b<0},D.precision=function(t){return arguments.length?(a=Pk(u,E=t*t),S()):Rx(E)},D.fitExtent=function(t,e){return Ok(D,t,e)},D.fitSize=function(t,e){return Rk(D,t,e)},D.fitWidth=function(t,e){return Lk(D,t,e)},D.fitHeight=function(t,e){return Uk(D,t,e)},function(){return e=t.apply(this,arguments),D.invert=e.invert&&C,F()}}function Hk(t){var e=0,n=_x/3,r=Wk(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*Ax,n=t[1]*Ax):[e*kx,n*kx]},i}function Yk(t,e){var n=zx(t),r=(n+zx(e))/2;if(Mx(r)2?t[2]*Ax:0),e.invert=function(e){return(e=t.invert(e[0]*Ax,e[1]*Ax))[0]*=kx,e[1]*=kx,e},e}(i.rotate()).invert([0,0]));return s(null==l?[[u[0]-o,u[1]-o],[u[0]+o,u[1]+o]]:t===Kk?[[Math.max(u[0]-o,l),e],[Math.min(u[0]+o,n),r]]:[[l,Math.max(u[1]-o,e)],[n,Math.min(u[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),c()):a()},i.translate=function(t){return arguments.length?(u(t),c()):u()},i.center=function(t){return arguments.length?(o(t),c()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),c()):null==l?null:[[l,e],[n,r]]},c()}function eA(t){return Lx((xx+t)/2)}function nA(t,e){var n=Cx(t),r=t===e?zx(t):Tx(n/Cx(e))/Tx(eA(e)/eA(t)),i=n*Nx(eA(t),r)/r;if(!r)return Kk;function o(t,e){i>0?e<-xx+yx&&(e=-xx+yx):e>xx-yx&&(e=xx-yx);var n=i/Nx(eA(e),r);return[n*zx(r*t),i-n*Cx(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ox(r)*Rx(t*t+n*n),a=Dx(t,Mx(n))*Ox(n);return n*r<0&&(a-=_x*Ox(t)*Ox(n)),[a/r,2*Ex(Nx(i/o,1/r))-xx]},o}function rA(t,e){return[t,e]}function iA(t,e){var n=Cx(t),r=t===e?zx(t):(n-Cx(e))/(e-t),i=n/r+t;if(Mx(r)yx&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},dA.invert=Jk(qx),pA.invert=Jk((function(t){return 2*Ex(t)})),gA.invert=function(t,e){return[-e,2*Ex(Sx(t))-xx]};var mA=Math.abs,yA=Math.cos,vA=Math.sin,_A=Math.PI,xA=_A/2,bA=Math.sqrt(2);function wA(t){return t>1?xA:t<-1?-xA:Math.asin(t)}function kA(t,e){var n,r=t*vA(e),i=30;do{e-=n=(e+vA(e)-r)/(1+yA(e))}while(mA(n)>1e-6&&--i>0);return e/2}var AA=function(t,e,n){function r(r,i){return[t*r*yA(i=kA(n,i)),e*vA(i)]}return r.invert=function(r,i){return i=wA(i/e),[r/(t*yA(i)),wA((2*i+vA(2*i))/n)]},r}(bA/xA,bA,_A);const MA=Bk(),EA=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function DA(t,e){if(!t||"string"!=typeof t)throw new Error("Projection type must be a name string.");return t=t.toLowerCase(),arguments.length>1?(FA[t]=function(t,e){return function n(){const r=e();return r.type=t,r.path=Bk().projection(r),r.copy=r.copy||function(){const t=n();return EA.forEach((e=>{r[e]&&t[e](r[e]())})),t.path.pointRadius(r.path.pointRadius()),t},r}}(t,e),this):FA[t]||null}function CA(t){return t&&t.path||MA}const FA={albers:Vk,albersusa:function(){var t,e,n,r,i,o,a=Vk(),u=Gk().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Gk().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function c(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,c}return c.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},c.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),u.stream(n),s.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}};for(const t in FA)DA(t,FA[t]);function SA(){}const BA=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function TA(){var t=1,e=1,n=a;function r(t,e){return e.map((e=>i(t,e)))}function i(r,i){var a=[],u=[];return function(n,r,i){var a,u,s,l,c,f,h=new Array,d=new Array;for(a=u=-1,l=n[0]>=r,BA[l<<1].forEach(p);++a=r,BA[s|l<<1].forEach(p);for(BA[l<<0].forEach(p);++u=r,c=n[u*t]>=r,BA[l<<1|c<<2].forEach(p);++a=r,f=c,c=n[u*t+a+1]>=r,BA[s|l<<1|c<<2|f<<3].forEach(p);BA[l|c<<3].forEach(p)}for(a=-1,c=n[u*t]>=r,BA[c<<2].forEach(p);++a=r,BA[c<<2|f<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+a,t[0][1]+u],s=[t[1][0]+a,t[1][1]+u],l=o(r),c=o(s);(e=d[l])?(n=h[c])?(delete d[e.end],delete h[n.start],e===n?(e.ring.push(s),i(e.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete d[e.end],e.ring.push(s),d[e.end=c]=e):(e=h[c])?(n=d[l])?(delete h[e.start],delete d[n.end],e===n?(e.ring.push(s),i(e.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete h[e.start],e.ring.unshift(r),h[e.start=l]=e):h[l]=d[c]={start:l,end:c,ring:[r,s]}}BA[c<<3].forEach(p)}(r,i,(t=>{n(t,r,i),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?a.push([t]):u.push(t)})),u.forEach((t=>{for(var e,n=0,r=a.length;n{var o,a=n[0],u=n[1],s=0|a,l=0|u,c=r[l*t+s];a>0&&a0&&u=0&&o>=0||u("invalid size"),t=i,e=o,r},r.smooth=function(t){return arguments.length?(n=t?a:SA,r):n===a},r}function NA(t,e){for(var n,r=-1,i=e.length;++rr!=d>r&&n<(h-l)*(r-c)/(d-c)+l&&(i=-i)}return i}function OA(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])==(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}function RA(t,e,n){return function(r){var i=tt(r),o=n?Math.min(i[0],0):i[0],a=i[1],u=a-o,s=e?se(o,a,t):u/(t+1);return ye(o+s,a,s)}}function LA(t){Ba.call(this,null,t)}function UA(t,e,n,r,i){const o=t.x1||0,a=t.y1||0,u=e*n<0;function s(t){t.forEach(l)}function l(t){u&&t.reverse(),t.forEach(c)}function c(t){t[0]=(t[0]-o)*e+r,t[1]=(t[1]-a)*n+i}return function(t){return t.coordinates.forEach(s),t}}function qA(t,e,n){const r=t>=0?t:Ua(e,n);return Math.round((Math.sqrt(4*r*r+1)-1)/2)}function PA(t){return H(t)?t:Z(+t)}function jA(){var t=t=>t[0],e=t=>t[1],n=d,r=[-1,-1],i=960,o=500,a=2;function s(u,s){const l=qA(r[0],u,t)>>a,c=qA(r[1],u,e)>>a,f=l?l+2:0,h=c?c+2:0,d=2*f+(i>>a),p=2*h+(o>>a),g=new Float32Array(d*p),m=new Float32Array(d*p);let y=g;u.forEach((r=>{const i=f+(+t(r)>>a),o=h+(+e(r)>>a);i>=0&&i=0&&o0&&c>0?(IA(d,p,g,m,l),$A(d,p,m,g,c),IA(d,p,g,m,l),$A(d,p,m,g,c),IA(d,p,g,m,l),$A(d,p,m,g,c)):l>0?(IA(d,p,g,m,l),IA(d,p,m,g,l),IA(d,p,g,m,l),y=m):c>0&&($A(d,p,g,m,c),$A(d,p,m,g,c),$A(d,p,g,m,c),y=m);const v=s?Math.pow(2,-2*a):1/ve(y);for(let t=0,e=d*p;t>a),y2:h+(o>>a)}}return s.x=function(e){return arguments.length?(t=PA(e),s):t},s.y=function(t){return arguments.length?(e=PA(t),s):e},s.weight=function(t){return arguments.length?(n=PA(t),s):n},s.size=function(t){if(!arguments.length)return[i,o];var e=+t[0],n=+t[1];return e>=0&&n>=0||u("invalid size"),i=e,o=n,s},s.cellSize=function(t){return arguments.length?((t=+t)>=1||u("invalid cell size"),a=Math.floor(Math.log(t)/Math.LN2),s):1<=i&&(e>=o&&(u-=n[e-o+a*t]),r[e-i+a*t]=u/Math.min(e+1,t-1+o-e,o))}function $A(t,e,n,r,i){const o=1+(i<<1);for(let a=0;a=i&&(u>=o&&(s-=n[a+(u-o)*t]),r[a+(u-i)*t]=s/Math.min(u+1,e-1+o-u,o))}function WA(t){Ba.call(this,null,t)}LA.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},ut(LA,Ba,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=e.materialize(e.SOURCE).source,i=t.field||f,o=TA().smooth(!1!==t.smooth),a=t.thresholds||function(t,e,n){const r=RA(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(t.map((t=>le(e(t).values))))}(r,i,t),u=null===t.as?null:t.as||"contour",s=[];return r.forEach((e=>{const n=i(e),r=o.size([n.width,n.height])(n.values,v(a)?a:a(n.values));!function(t,e,n,r){let i=r.scale||e.scale,o=r.translate||e.translate;if(H(i)&&(i=i(n,r)),H(o)&&(o=o(n,r)),(1===i||null==i)&&!o)return;const a=(ht(i)?i:i[0])||1,u=(ht(i)?i:i[1])||1,s=o&&o[0]||0,l=o&&o[1]||0;t.forEach(UA(e,a,u,s,l))}(r,n,e,t),r.forEach((t=>{s.push(ra(e,ea(null!=u?{[u]:t}:t)))}))})),this.value&&(n.rem=this.value),this.value=n.source=n.add=s,n}}),WA.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const HA=["x","y","weight","size","cellSize","bandwidth"];function YA(t,e){return HA.forEach((n=>null!=e[n]?t[n](e[n]):0)),t}function GA(t){Ba.call(this,null,t)}ut(WA,Ba,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var r,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),o=function(t,e){var n,r,i,o,a,u,s=[],l=t=>t(o);if(null==e)s.push(t);else for(n={},r=0,i=t.length;rea(function(t,e){for(let n=0;nyx})).map(s)).concat(ye(Fx(o/d)*d,i,d).filter((function(t){return Mx(t%g)>yx})).map(l))}return y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(f(a).slice(1),c(n).reverse().slice(1),f(u).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),u>a&&(t=u,u=a,a=t),y.precision(m)):[[r,u],[n,a]]},y.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),y.precision(m)):[[e,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(m=+h,s=Dw(o,i,90),l=Cw(e,t,m),c=Dw(u,a,90),f=Cw(r,n,m),y):m},y.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()}function eM(t){Ba.call(this,null,t)}function nM(t){if(!H(t))return!1;const e=Dt(r(t));return e.$x||e.$y||e.$value||e.$max}function rM(t){Ba.call(this,null,t),this.modified(!0)}function iM(t,e,n){H(t[e])&&t[e](n)}JA.Definition={type:"GeoJSON",metadata:{},params:[{name:"fields",type:"field",array:!0,length:2},{name:"geojson",type:"field"}]},ut(JA,Ba,{transform(t,e){var n,i=this._features,o=this._points,a=t.fields,u=a&&a[0],s=a&&a[1],l=t.geojson||!a&&f,c=e.ADD;n=t.modified()||e.changed(e.REM)||e.modified(r(l))||u&&e.modified(r(u))||s&&e.modified(r(s)),this.value&&!n||(c=e.SOURCE,this._features=i=[],this._points=o=[]),l&&e.visit(c,(t=>i.push(l(t)))),u&&s&&(e.visit(c,(t=>{var e=u(t),n=s(t);null!=e&&null!=n&&(e=+e)===e&&(n=+n)===n&&o.push([e,n])})),i=i.concat({type:VA,geometry:{type:"MultiPoint",coordinates:o}})),this.value={type:XA,features:i}}}),ZA.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},ut(ZA,Ba,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.field||f,o=t.as||"path",a=n.SOURCE;!r||t.modified()?(this.value=r=CA(t.projection),n.materialize().reflow()):a=i===f||e.modified(i.fields)?n.ADD_MOD:n.ADD;const u=function(t,e){const n=t.pointRadius();return t.context(null),null!=e&&t.pointRadius(e),n}(r,t.pointRadius);return n.visit(a,(t=>t[o]=r(i(t)))),r.pointRadius(u),n.modifies(o)}}),QA.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},ut(QA,Ba,{transform(t,e){var n,r=t.projection,i=t.fields[0],o=t.fields[1],a=t.as||["x","y"],u=a[0],s=a[1];function l(t){const e=r([i(t),o(t)]);e?(t[u]=e[0],t[s]=e[1]):(t[u]=void 0,t[s]=void 0)}return t.modified()?e=e.materialize().reflow(!0).visit(e.SOURCE,l):(n=e.modified(i.fields)||e.modified(o.fields),e.visit(n?e.ADD_MOD:e.ADD,l)),e.modifies(a)}}),KA.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},ut(KA,Ba,{transform(t,e){var n=e.fork(e.ALL),r=this.value,i=t.as||"shape",o=n.ADD;return r&&!t.modified()||(this.value=r=function(t,e,n){const r=null==n?n=>t(e(n)):r=>{var i=t.pointRadius(),o=t.pointRadius(n)(e(r));return t.pointRadius(i),o};return r.context=e=>(t.context(e),r),r}(CA(t.projection),t.field||l("datum"),t.pointRadius),n.materialize().reflow(),o=n.SOURCE),n.visit(o,(t=>t[i]=r)),n.modifies(i)}}),tM.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},ut(tM,Ba,{transform(t,e){var n,r=this.value,i=this.generator;if(!r.length||t.modified())for(const e in t)H(i[e])&&i[e](t[e]);return n=i(),r.length?e.mod.push(ia(r[0],n)):e.add.push(ea(n)),r[0]=n,e}}),eM.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},ut(eM,Ba,{transform(t,e){if(!e.changed()&&!t.modified())return e.StopPropagation;var n=e.materialize(e.SOURCE).source,r="shared"===t.resolve,i=t.field||f,o=function(t,e){let n;return H(t)?(n=n=>t(n,e),n.dep=nM(t)):t?n=Z(t):(n=t=>t.$value/t.$max||0,n.dep=!0),n}(t.opacity,t),a=function(t,e){let n;return H(t)?(n=n=>Oc(t(n,e)),n.dep=nM(t)):n=Z(Oc(t||"#888")),n}(t.color,t),u=t.as||"image",s={$x:0,$y:0,$value:0,$max:r?le(n.map((t=>le(i(t).values)))):0};return n.forEach((t=>{const e=i(t),n=K({},t,s);r||(n.$max=le(e.values||[])),t[u]=function(t,e,n,r){const i=t.width,o=t.height,a=t.x1||0,u=t.y1||0,s=t.x2||i,l=t.y2||o,c=t.values,f=c?t=>c[t]:h,d=sc(s-a,l-u),p=d.getContext("2d"),g=p.getImageData(0,0,s-a,l-u),m=g.data;for(let t=u,o=0;t{null!=t[e]&&iM(n,e,t[e])}))):EA.forEach((e=>{t.modified(e)&&iM(n,e,t[e])})),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function(t,e){const n=function(t){return 1===(t=$(t)).length?t[0]:{type:XA,features:t.reduce(((t,e)=>t.concat(function(t){return t.type===XA?t.features:$(t).filter((t=>null!=t)).map((t=>t.type===VA?t:{type:VA,geometry:t}))}(e))),[])}}(e.fit);e.extent?t.fitExtent(e.extent,n):e.size&&t.fitSize(e.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});var oM=Object.freeze({__proto__:null,contour:GA,geojson:JA,geopath:ZA,geopoint:QA,geoshape:KA,graticule:tM,heatmap:eM,isocontour:LA,kde2d:WA,projection:rM});function aM(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,u,s,l,c,f,h,d=t._root,p={data:r},g=t._x0,m=t._y0,y=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a,i=d,!(d=d[f=c<<1|l]))return i[f]=p,t;if(u=+t._x.call(null,d.data),s=+t._y.call(null,d.data),e===u&&n===s)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+y)/2))?g=o:y=o,(c=n>=(a=(m+v)/2))?m=a:v=a}while((f=c<<1|l)==(h=(s>=a)<<1|u>=o));return i[h]=d,i[f]=p,t}function uM(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function sM(t){return t[0]}function lM(t){return t[1]}function cM(t,e,n){var r=new fM(null==e?sM:e,null==n?lM:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function fM(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function hM(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var dM=cM.prototype=fM.prototype;function pM(t){return function(){return t}}function gM(t){return 1e-6*(t()-.5)}function mM(t){return t.x+t.vx}function yM(t){return t.y+t.vy}function vM(t){return t.index}function _M(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}dM.copy=function(){var t,e,n=new fM(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=hM(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=hM(e));return n},dM.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return aM(this.cover(e,n),e,n,t)},dM.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),if&&(f=i));if(s>c||l>f)return this;for(this.cover(s,l).cover(c,f),n=0;nt||t>=i||r>e||e>=o;)switch(u=(eh||(o=s.y0)>d||(a=s.x1)=y)<<1|t>=m)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=s)}else{var v=t-+this._x.call(null,g.data),_=e-+this._y.call(null,g.data),x=v*v+_*_;if(x=(u=(p+m)/2))?p=u:m=u,(c=a>=(s=(g+y)/2))?g=s:y=s,e=d,!(d=d[f=c<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},dM.removeAll=function(t){for(var e=0,n=t.length;e{}};function bM(){for(var t,e=0,n=arguments.length,r={};e=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var n,r,i=new Array(n),o=0;o=0&&e._call.call(void 0,t),e=e._next;--DM}()}finally{DM=0,function(){for(var t,e,n=MM,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:MM=e);EM=t,jM(r)}(),BM=0}}function PM(){var t=NM.now(),e=t-SM;e>1e3&&(TM-=e,SM=t)}function jM(t){DM||(CM&&(CM=clearTimeout(CM)),t-BM>24?(t<1/0&&(CM=setTimeout(qM,t-NM.now()-TM)),FM&&(FM=clearInterval(FM))):(FM||(SM=NM.now(),FM=setInterval(PM,1e3)),DM=1,zM(qM)))}LM.prototype=UM.prototype={constructor:LM,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?OM():+n)+(null==e?0:+e),this._next||EM===this||(EM?EM._next=this:MM=this,EM=this),this._call=t,this._time=n,jM()},stop:function(){this._call&&(this._call=null,this._time=1/0,jM())}};const IM=4294967296;function $M(t){return t.x}function WM(t){return t.y}var HM=Math.PI*(3-Math.sqrt(5));const YM={center:function(t,e){var n,r=1;function i(){var i,o,a=n.length,u=0,s=0;for(i=0;il+p||oc+p||as.index){var g=l-u.x-u.vx,m=c-u.y-u.vy,y=g*g+m*m;yt.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r=u)){(t.data!==e||t.next)&&(0===f&&(p+=(f=gM(n))*f),0===h&&(p+=(h=gM(n))*h),p[u(t,e,r),t])));for(a=0,i=new Array(l);ae(t,n):e)}ZM.Definition={type:"Force",metadata:{modifies:!0},params:[{name:"static",type:"boolean",default:!1},{name:"restart",type:"boolean",default:!1},{name:"iterations",type:"number",default:300},{name:"alpha",type:"number",default:1},{name:"alphaMin",type:"number",default:.001},{name:"alphaTarget",type:"number",default:0},{name:"velocityDecay",type:"number",default:.4},{name:"forces",type:"param",array:!0,params:[{key:{force:"center"},params:[{name:"x",type:"number",default:0},{name:"y",type:"number",default:0}]},{key:{force:"collide"},params:[{name:"radius",type:"number",expr:!0},{name:"strength",type:"number",default:.7},{name:"iterations",type:"number",default:1}]},{key:{force:"nbody"},params:[{name:"strength",type:"number",default:-30},{name:"theta",type:"number",default:.9},{name:"distanceMin",type:"number",default:1},{name:"distanceMax",type:"number"}]},{key:{force:"link"},params:[{name:"links",type:"data"},{name:"id",type:"field"},{name:"distance",type:"number",default:30,expr:!0},{name:"strength",type:"number",expr:!0},{name:"iterations",type:"number",default:1}]},{key:{force:"x"},params:[{name:"strength",type:"number",default:.1},{name:"x",type:"field"}]},{key:{force:"y"},params:[{name:"strength",type:"number",default:.1},{name:"y",type:"field"}]}]},{name:"as",type:"string",array:!0,modify:!1,default:JM}]},ut(ZM,Ba,{transform(t,e){var n,r,i=this.value,o=e.changed(e.ADD_REM),a=t.modified(VM),u=t.iterations||300;if(i?(o&&(e.modifies("index"),i.nodes(e.source)),(a||e.changed(e.MOD))&&QM(i,t,0,e)):(this.value=i=function(t,e){const n=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,u=new Map,s=UM(f),l=bM("tick","end"),c=function(){let t=1;return()=>(t=(1664525*t+1013904223)%IM)/IM}();function f(){h(),l.call("tick",e),n1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,l=0,c=t.length;for(null==r?r=1/0:r*=r,l=0;l1?(l.on(t,n),e):l.on(t)}}}(t),r=n.stop,i=n.restart;let o=!1;return n.stopped=()=>o,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),QM(n,e,!0).on("end",(()=>o=!0))}(e.source,t),i.on("tick",(n=e.dataflow,r=this,()=>n.touch(r).run())),t.static||(o=!0,i.tick()),e.modifies("index")),a||o||t.modified(XM)||e.changed()&&t.restart)if(i.alpha(Math.max(i.alpha(),t.alpha||1)).alphaDecay(1-Math.pow(i.alphaMin(),1/u)),t.static)for(i.stop();--u>=0;)i.tick();else if(i.stopped()&&i.restart(),!o)return e.StopPropagation;return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let t,e=this._argops,u=0,s=e.length;u=0;)e+=n[r].value;else e=1;t.value=e}function uE(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=lE)):void 0===e&&(e=sE);for(var n,r,i,o,a,u=new hE(t),s=[u];n=s.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)s.push(r=i[o]=new hE(i[o])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(fE)}function sE(t){return t.children}function lE(t){return Array.isArray(t)?t[1]:null}function cE(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function fE(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function hE(t){this.data=t,this.depth=this.height=0,this.parent=null}function dE(t,e){var n,r;if(mE(e,t))return[e];for(n=0;n0&&n*n>r*r+i*i}function mE(t,e){for(var n=0;n(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*u-o*s,n.y=t.y-r*s+o*u):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*u-o*s,n.y=e.y+r*s+o*u)):(n.x=e.x+n.r,n.y=e.y)}function bE(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function wE(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function kE(t){this._=t,this.next=null,this.previous=null}function AE(t){return null==t?null:ME(t)}function ME(t){if("function"!=typeof t)throw new Error;return t}function EE(){return 0}function DE(t){return function(){return t}}function CE(t){return Math.sqrt(t.value)}function FE(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function SE(t,e){return function(n){if(r=n.children){var r,i,o,a=r.length,u=t(n)*e||0;if(u)for(i=0;i1))return e.r;if(n=t[1],e.x=-n.r,n.x=e.r,n.y=0,!(i>2))return e.r+n.r;xE(n,e,r=t[2]),e=new kE(e),n=new kE(n),r=new kE(r),e.next=r.previous=n,n.next=e.previous=r,r.next=n.previous=e;t:for(u=3;u=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;for(t=n.pop(),e=r.pop();t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return uE(this).eachBefore(cE)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;nfunction(t){let e=(t="".concat(t)).length;return jE(t,e-1)&&!jE(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:"/".concat(t)}(t(e,n,r)))),n=e.map(PE),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(PE(t)),h.push(RE));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=h.length;a=0&&(l=h[t]).data===RE;--t)l.data=null}if(u.parent=zE,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(fE),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(e=AE(t),r):e},r.parentId=function(t){return arguments.length?(n=AE(t),r):n},r.path=function(e){return arguments.length?(t=AE(e),r):t},r}function PE(t){let e=t.length;if(e<2)return"";for(;--e>1&&!jE(t,e););return t.slice(0,e)}function jE(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0==(1&n))return!0}return!1}function IE(t,e){return t.parent===e.parent?1:2}function $E(t){var e=t.children;return e?e[0]:t.t}function WE(t){var e=t.children;return e?e[e.length-1]:t.t}function HE(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function YE(t,e,n){return t.a.parent===e.parent?t.a:n}function GE(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function VE(t,e,n,r,i){for(var o,a=t.children,u=-1,s=a.length,l=t.value&&(i-n)/t.value;++uh&&(h=u),m=c*c*g,(d=Math.max(h/m,m/f))>p){c-=u;break}p=d}y.push(a={value:c,dice:s1?e:1)},n}(XE),QE=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,s,l,c,f=-1,h=a.length,d=t.value;++f1?e:1)},n}(XE);function KE(t,e,n){const r={};return t.each((t=>{const i=t.data;n(i)&&(r[e(i)]=t)})),t.lookup=r,t}function tD(t){Ba.call(this,null,t)}tD.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const eD=t=>t.values;function nD(){const t=[],e={entries:t=>r(n(t,0),0),key:n=>(t.push(n),e)};function n(e,r){if(r>=t.length)return e;const i=e.length,o=t[r++],a={},u={};let s,l,c,f=-1;for(;++ft.length)return e;const i=[];for(const t in e)i.push({key:t,values:r(e[t],n)});return i}return e}function rD(t){Ba.call(this,null,t)}ut(tD,Ba,{transform(t,e){e.source||u("Nest transform requires an upstream data source.");var n=t.generate,r=t.modified(),i=e.clone(),o=this.value;return(!o||r||e.changed())&&(o&&o.each((t=>{t.children&&Qo(t.data)&&i.rem.push(t.data)})),this.value=o=uE({values:$(t.keys).reduce(((t,e)=>(t.key(e),t)),nD()).entries(i.source)},eD),n&&o.each((t=>{t.children&&(t=ea(t.data),i.add.push(t),i.source.push(t))})),KE(o,Ko,Ko)),i.source.root=o,i}});const iD=(t,e)=>t.parent===e.parent?1:2;ut(rD,Ba,{transform(t,e){e.source&&e.source.root||u(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(t.method),r=this.fields,i=e.source.root,o=t.as||r;t.field?i.sum(t.field):i.count(),t.sort&&i.sort(oa(t.sort,(t=>t.data))),function(t,e,n){for(let r,i=0,o=e.length;ifunction(t,e,n){const r=t.data,i=e.length-1;for(let o=0;o=0;--i)u.push(n=e.children[i]=new GE(r[i],i)),n.parent=e;return(a.parent=new GE(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(u);else{var l=i,c=i,f=i;i.eachBefore((function(t){t.xc.x&&(c=t),t.depth>f.depth&&(f=t)}));var h=l===c?1:t(l,c)/2,d=h-l.x,p=e/(c.x+h+d),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,s=o.parent.children[0],l=o.m,c=a.m,f=u.m,h=s.m;u=WE(u),o=$E(o),u&&o;)s=$E(s),(a=WE(a)).a=e,(i=u.z+f-o.z-l+t(u._,o._))>0&&(HE(YE(u,e,r),e,i),l+=i,c+=i),f+=u.m,l+=o.m,h+=s.m,c+=a.m;u&&!WE(a)&&(a.t=u,a.m+=f-c),o&&!$E(s)&&(s.t=o,s.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},cluster:function(){var t=rE,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(iE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(oE,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=u.x-t(u,s)/2,c=s.x+t(s,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}},fD=["x","y","depth","children"];function hD(t){rD.call(this,t)}function dD(t){Ba.call(this,[],t)}hD.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:fD.length,default:fD}]},ut(hD,rD,{layout(t){const e=t||"tidy";if(rt(cD,e))return cD[e]();u("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:fD}),dD.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},ut(dD,Ba,{transform(t,e){const n=this.value,r=e.source&&e.source.root,i=e.fork(e.NO_SOURCE),o={};return r||u("TreeLinks transform requires a tree data source."),e.changed(e.ADD_REM)?(i.rem=n,e.visit(e.SOURCE,(t=>o[Ko(t)]=1)),r.each((t=>{const e=t.data,n=t.parent&&t.parent.data;n&&o[Ko(e)]&&o[Ko(n)]&&i.add.push(ea({source:n,target:e}))})),this.value=i.add):e.changed(e.MOD)&&(e.visit(e.MOD,(t=>o[Ko(t)]=1)),n.forEach((t=>{(o[Ko(t.source)]||o[Ko(t.target)])&&i.mod.push(t)}))),i}});const pD={binary:function(t,e,n,r,i){var o,a,u=t.children,s=u.length,l=new Array(s+1);for(l[0]=a=o=0;o=n-1){var c=u[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=s)}for(var f=l[e],h=r/2+f,d=e+1,p=n-1;d>>1;l[g]s-o){var v=r?(i*y+a*m)/r:a;t(e,d,m,i,o,v,s),t(d,n,y,v,o,a,s)}else{var _=r?(o*y+s*m)/r:s;t(e,d,m,i,o,a,_),t(d,n,y,i,_,a,s)}}(0,s,t.value,e,n,r,i)},dice:NE,slice:VE,slicedice:function(t,e,n,r,i){(1&t.depth?VE:NE)(t,e,n,r,i)},squarify:ZE,resquarify:QE},gD=["x0","y0","x1","y1","depth","children"];function mD(t){rD.call(this,t)}mD.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:gD.length,default:gD}]},ut(mD,rD,{layout(){const t=function(){var t=ZE,e=!1,n=1,r=1,i=[0],o=EE,a=EE,u=EE,s=EE,l=EE;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(TE),t}function f(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,f=e.x1-n,h=e.y1-n;f{const n=t.tile();n.ratio&&t.tile(n.ratio(e))},t.method=e=>{rt(pD,e)?t.tile(pD[e]):u("Unrecognized Treemap layout method: "+e)},t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:gD});var yD=Object.freeze({__proto__:null,nest:tD,pack:aD,partition:sD,stratify:lD,tree:hD,treelinks:dD,treemap:mD});const vD=4278190080;function _D(t,e,n){return new Uint32Array(t.getImageData(0,0,e,n).data.buffer)}function xD(t,e,n){if(!e.length)return;const r=e[0].mark.marktype;"group"===r?e.forEach((e=>{e.items.forEach((e=>xD(t,e.items,n)))})):Qm[r].draw(t,{items:n?e.map(bD):e})}function bD(t){const e=ra(t,{});return e.stroke&&0!==e.strokeOpacity||e.fill&&0!==e.fillOpacity?{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}:e}const wD=31,kD=new Uint32Array(33),AD=new Uint32Array(33);AD[0]=0,kD[0]=~AD[0];for(let t=1;t<=32;++t)AD[t]=AD[t-1]<<1|1,kD[t]=~AD[t];function MD(t,e,n,r,i,o){let a=n/2;return t-a<0||t+a>i||e-(a=r/2)<0||e+a>o}function ED(t,e,n,r,i,o,a,u){const s=i*o/(2*r),l=t(e-s),c=t(e+s),f=t(n-(o/=2)),h=t(n+o);return a.outOfBounds(l,f,c,h)||a.getRange(l,f,c,h)||u&&u.getRange(l,f,c,h)}const DD=[-1,-1,1,1],CD=[-1,1,-1,1],FD=["right","center","left"],SD=["bottom","middle","top"];function BD(t,e,n,r,i,o,a,u,s,l,c,f){return!(i.outOfBounds(t,n,e,r)||(f&&o||i).getRange(t,n,e,r))}const TD={"top-left":0,top:1,"top-right":2,left:4,middle:5,right:6,"bottom-left":8,bottom:9,"bottom-right":10},ND={naive:function(t,e,n,r){const i=t.width,o=t.height;return function(t){const e=t.datum.datum.items[r].items,n=e.length,a=t.datum.fontSize,u=Tm.width(t.datum,t.datum.text);let s,l,c,f,h,d,p,g=0;for(let r=0;r=g&&(g=p,t.x=h,t.y=d);return h=u/2,d=a/2,s=t.x-h,l=t.x+h,c=t.y-d,f=t.y+d,t.align="center",s<0&&l<=i?t.align="left":0<=s&&i=1;)h=(d+p)/2,ED(t,c,f,l,s,h,a,u)?p=h:d=h;if(d>r)return[c,f,d,!0]}}return function(e){const u=e.datum.datum.items[r].items,l=u.length,c=e.datum.fontSize,f=Tm.width(e.datum,e.datum.text);let h,d,p,g,m,y,v,_,x,b,w,k,A,M,E,D,C,F=n?c:0,S=!1,B=!1,T=0;for(let r=0;rd&&(C=h,h=d,d=C),p>g&&(C=p,p=g,g=C),x=t(h),w=t(d),b=~~((x+w)/2),k=t(p),M=t(g),A=~~((k+M)/2),v=b;v>=x;--v)for(_=A;_>=k;--_)D=s(v,_,F,f,c),D&&([e.x,e.y,F,S]=D);for(v=b;v<=w;++v)for(_=A;_<=M;++_)D=s(v,_,F,f,c),D&&([e.x,e.y,F,S]=D);S||n||(E=Math.abs(d-h+g-p),m=(h+d)/2,y=(p+g)/2,E>=T&&!MD(m,y,f,c,i,o)&&!ED(t,m,y,c,f,c,a,null)&&(T=E,e.x=m,e.y=y,B=!0))}return!(!S&&!B||(m=f/2,y=c/2,a.setRange(t(e.x-m),t(e.y-y),t(e.x+m),t(e.y+y)),e.align="center",e.baseline="middle",0))}},floodfill:function(t,e,n,r){const i=t.width,o=t.height,a=e[0],u=e[1],s=t.bitmap();return function(e){const l=e.datum.datum.items[r].items,c=l.length,f=e.datum.fontSize,h=Tm.width(e.datum,e.datum.text),d=[];let p,g,m,y,v,_,x,b,w,k,A,M,E=n?f:0,D=!1,C=!1,F=0;for(let r=0;r=1;)A=(w+k)/2,ED(t,v,_,f,h,A,a,u)?k=A:w=A;w>E&&(e.x=v,e.y=_,E=w,D=!0)}}D||n||(M=Math.abs(g-p+y-m),v=(p+g)/2,_=(m+y)/2,M>=F&&!MD(v,_,h,f,i,o)&&!ED(t,v,_,f,h,f,a,null)&&(F=M,e.x=v,e.y=_,C=!0))}return!(!D&&!C||(v=h/2,_=f/2,a.setRange(t(e.x-v),t(e.y-_),t(e.x+v),t(e.y+_)),e.align="center",e.baseline="middle",0))}}};const zD=["x","y","opacity","align","baseline"],OD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function RD(t){Ba.call(this,null,t)}RD.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:OD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:zD.length,default:zD}]},ut(RD,Ba,{transform(t,e){const n=t.modified();if(!(n||e.changed(e.ADD_REM)||function(n){const r=t.sort;return H(r)&&e.modified(r.fields)}()))return;t.size&&2===t.size.length||u("Size parameter should be specified as a [width, height] array.");const r=t.as||zD;return function(t,e,n,r,i,o,a,u,s,l,c){if(!t.length)return t;const f=Math.max(r.length,i.length),h=function(t,e){const n=new Float64Array(e),r=t.length;for(let e=0;e[t.x,t.x,t.x,t.y,t.y,t.y];return t?"line"===t||"area"===t?t=>i(t.datum):"line"===e?t=>{const e=t.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(p,g,u,s),v=null===l||l===1/0,_=m&&"naive"===c;var x;let b=-1,w=-1;const k=t.map((t=>{const e=v?Tm.width(t,t.text):void 0;return b=Math.max(b,e),w=Math.max(w,t.fontSize),{datum:t,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(t),textWidth:e}}));l=null===l||l===1/0?Math.max(b,w)+Math.max(...r):l;const A=function(t,e,n){const r=Math.max(1,Math.sqrt(t*e/1e6)),i=~~((t+2*n+r)/r),o=~~((e+2*n+r)/r),a=t=>~~((t+n)/r);return a.invert=t=>t*r-n,a.bitmap=()=>function(t,e){const n=new Uint32Array(~~((t*e+32)/32));function r(t,e){n[t]|=e}function i(t,e){n[t]&=e}return{array:n,get:(e,r)=>{const i=r*t+e;return n[i>>>5]&1<<(i&wD)},set:(e,n)=>{const i=n*t+e;r(i>>>5,1<<(i&wD))},clear:(e,n)=>{const r=n*t+e;i(r>>>5,~(1<<(r&wD)))},getRange:(e,r,i,o)=>{let a,u,s,l,c=o;for(;c>=r;--c)if(a=c*t+e,u=c*t+i,s=a>>>5,l=u>>>5,s===l){if(n[s]&kD[a&wD]&AD[1+(u&wD)])return!0}else{if(n[s]&kD[a&wD])return!0;if(n[l]&AD[1+(u&wD)])return!0;for(let t=s+1;t{let a,u,s,l,c;for(;n<=o;++n)if(a=n*t+e,u=n*t+i,s=a>>>5,l=u>>>5,s===l)r(s,kD[a&wD]&AD[1+(u&wD)]);else for(r(s,kD[a&wD]),r(l,AD[1+(u&wD)]),c=s+1;c{let a,u,s,l,c;for(;n<=o;++n)if(a=n*t+e,u=n*t+r,s=a>>>5,l=u>>>5,s===l)i(s,AD[a&wD]|kD[1+(u&wD)]);else for(i(s,AD[a&wD]),i(l,kD[1+(u&wD)]),c=s+1;cn<0||r<0||o>=e||i>=t}}(i,o),a.ratio=r,a.padding=n,a.width=t,a.height=e,a}(e[0],e[1],l);let M;if(!_){n&&k.sort(((t,e)=>n(t.datum,e.datum)));let e=!1;for(let t=0;tt.datum));M=o.length||r?function(t,e,n,r,i){const o=t.width,a=t.height,u=r||i,s=sc(o,a).getContext("2d"),l=sc(o,a).getContext("2d"),c=u&&sc(o,a).getContext("2d");n.forEach((t=>xD(s,t,!1))),xD(l,e,!1),u&&xD(c,e,!0);const f=_D(s,o,a),h=_D(l,o,a),d=u&&_D(c,o,a),p=t.bitmap(),g=u&&t.bitmap();let m,y,v,_,x,b,w,k;for(y=0;yn.set(t(e.boundary[0]),t(e.boundary[3])))),[n,void 0]}(A,a&&k)}const E=m?ND[c](A,M,a,s):function(t,e,n,r){const i=t.width,o=t.height,a=e[0],u=e[1],s=r.length;return function(e){var l;const c=e.boundary,f=e.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>i||c[3]>o)return!1;let h,d,p,g,m,y,v,_,x,b,w,k,A,M,E,D=null!==(l=e.textWidth)&&void 0!==l?l:0;for(let i=0;i>>2&3)-1,p=0===h&&0===d||r[i]<0,g=h&&d?Math.SQRT1_2:1,m=r[i]<0?-1:1,y=c[1+h]+r[i]*h*g,w=c[4+d]+m*f*d/2+r[i]*d*g,_=w-f/2,x=w+f/2,k=t(y),M=t(_),E=t(x),!D){if(!BD(k,k,M,E,a,u,0,0,0,0,0,p))continue;D=Tm.width(e.datum,e.datum.text)}if(b=y+m*D*h/2,y=b-D/2,v=b+D/2,k=t(y),A=t(v),BD(k,A,M,E,a,u,0,0,0,0,0,p))return e.x=h?h*m<0?v:y:b,e.y=d?d*m<0?x:_:w,e.align=FD[h*m+1],e.baseline=SD[d*m+1],a.setRange(k,M,A,E),!0}return!1}}(A,M,d,h);return k.forEach((t=>t.opacity=+E(t))),k}(e.materialize(e.SOURCE).source||[],t.size,t.sort,$(null==t.offset?1:t.offset),$(t.anchor||OD),t.avoidMarks||[],!1!==t.avoidBaseMark,t.lineAnchor||"end",t.markIndex||0,void 0===t.padding?0:t.padding,t.method||"naive").forEach((t=>{const e=t.datum;e[r[0]]=t.x,e[r[1]]=t.y,e[r[2]]=t.opacity,e[r[3]]=t.align,e[r[4]]=t.baseline})),e.reflow(n).modifies(r)}});var LD=Object.freeze({__proto__:null,label:RD});function UD(t,e){var n,r,i,o,a,u,s=[],l=function(t){return t(o)};if(null==e)s.push(t);else for(n={},r=0,i=t.length;r{_u(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let t=0;t"poly"===t?e:"quad"===t?2:1)(a,s),c=t.as||[n(t.x),n(t.y)],f=PD[a],h=[];let d=t.extent;rt(PD,a)||u("Invalid regression method: "+a),null!=d&&"log"===a&&d[0]<=0&&(e.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),i.forEach((n=>{if(n.length<=l)return void e.dataflow.warn("Skipping regression with more parameters than data points.");const r=f(n,t.x,t.y,s);if(t.params)return void h.push(ea({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));const i=d||tt(n,t.x),u=t=>{const e={};for(let t=0;tu([t,r.predict(t)]))):ku(r.predict,i,25,200).forEach(u)})),this.value&&(r.rem=this.value),this.value=r.add=r.source=h}return r}});var ID=Object.freeze({__proto__:null,loess:qD,regression:jD});const $D=134217729;function WD(t,e,n,r,i){let o,a,u,s,l=e[0],c=r[0],f=0,h=0;c>l==c>-l?(o=l,l=e[++f]):(o=c,c=r[++h]);let d=0;if(fl==c>-l?(a=l+o,u=o-(a-l),l=e[++f]):(a=c+o,u=o-(a-c),c=r[++h]),o=a,0!==u&&(i[d++]=u);fl==c>-l?(a=o+l,s=a-o,u=o-(a-s)+(l-s),l=e[++f]):(a=o+c,s=a-o,u=o-(a-s)+(c-s),c=r[++h]),o=a,0!==u&&(i[d++]=u);for(;f0!=u>0)return s;const l=Math.abs(a+u);return Math.abs(s)>=33306690738754716e-32*l?s:-function(t,e,n,r,i,o,a){let u,s,l,c,f,h,d,p,g,m,y,v,_,x,b,w,k,A;const M=t-i,E=n-i,D=e-o,C=r-o;x=M*C,h=$D*M,d=h-(h-M),p=M-d,h=$D*C,g=h-(h-C),m=C-g,b=p*m-(x-d*g-p*g-d*m),w=D*E,h=$D*D,d=h-(h-D),p=D-d,h=$D*E,g=h-(h-E),m=E-g,k=p*m-(w-d*g-p*g-d*m),y=b-k,f=b-y,YD[0]=b-(y+f)+(f-k),v=x+y,f=v-x,_=x-(v-f)+(y-f),y=_-w,f=_-y,YD[1]=_-(y+f)+(f-w),A=v+y,f=A-v,YD[2]=v-(A-f)+(y-f),YD[3]=A;let F=function(t,e){let n=e[0];for(let t=1;t<4;t++)n+=e[t];return n}(0,YD),S=22204460492503146e-32*a;if(F>=S||-F>=S)return F;if(f=t-M,u=t-(M+f)+(f-i),f=n-E,l=n-(E+f)+(f-i),f=e-D,s=e-(D+f)+(f-o),f=r-C,c=r-(C+f)+(f-o),0===u&&0===s&&0===l&&0===c)return F;if(S=11093356479670487e-47*a+33306690738754706e-32*Math.abs(F),F+=M*c+C*u-(D*l+E*s),F>=S||-F>=S)return F;x=u*C,h=$D*u,d=h-(h-u),p=u-d,h=$D*C,g=h-(h-C),m=C-g,b=p*m-(x-d*g-p*g-d*m),w=s*E,h=$D*s,d=h-(h-s),p=s-d,h=$D*E,g=h-(h-E),m=E-g,k=p*m-(w-d*g-p*g-d*m),y=b-k,f=b-y,JD[0]=b-(y+f)+(f-k),v=x+y,f=v-x,_=x-(v-f)+(y-f),y=_-w,f=_-y,JD[1]=_-(y+f)+(f-w),A=v+y,f=A-v,JD[2]=v-(A-f)+(y-f),JD[3]=A;const B=WD(4,YD,4,JD,GD);x=M*c,h=$D*M,d=h-(h-M),p=M-d,h=$D*c,g=h-(h-c),m=c-g,b=p*m-(x-d*g-p*g-d*m),w=D*l,h=$D*D,d=h-(h-D),p=D-d,h=$D*l,g=h-(h-l),m=l-g,k=p*m-(w-d*g-p*g-d*m),y=b-k,f=b-y,JD[0]=b-(y+f)+(f-k),v=x+y,f=v-x,_=x-(v-f)+(y-f),y=_-w,f=_-y,JD[1]=_-(y+f)+(f-w),A=v+y,f=A-v,JD[2]=v-(A-f)+(y-f),JD[3]=A;const T=WD(B,GD,4,JD,VD);x=u*c,h=$D*u,d=h-(h-u),p=u-d,h=$D*c,g=h-(h-c),m=c-g,b=p*m-(x-d*g-p*g-d*m),w=s*l,h=$D*s,d=h-(h-s),p=s-d,h=$D*l,g=h-(h-l),m=l-g,k=p*m-(w-d*g-p*g-d*m),y=b-k,f=b-y,JD[0]=b-(y+f)+(f-k),v=x+y,f=v-x,_=x-(v-f)+(y-f),y=_-w,f=_-y,JD[1]=_-(y+f)+(f-w),A=v+y,f=A-v,JD[2]=v-(A-f)+(y-f),JD[3]=A;const N=WD(T,VD,4,JD,XD);return XD[N-1]}(t,e,n,r,i,o,l)}const QD=Math.pow(2,-52),KD=new Uint32Array(512);class tC{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:aC,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:uC;const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(e>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,s=-1/0,l=-1/0;for(let e=0;es&&(s=n),r>l&&(l=r),this._ids[e]=e}const c=(a+s)/2,f=(u+l)/2;let h,d,p,g=1/0;for(let e=0;e0&&(d=e,g=n)}let v=t[2*d],_=t[2*d+1],x=1/0;for(let e=0;er&&(e[n++]=i,r=this._dists[i])}return this.hull=e.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(ZD(m,y,v,_,b,w)<0){const t=d,e=v,n=_;d=p,v=b,_=w,p=t,b=e,w=n}const k=function(t,e,n,r,i,o){const a=n-t,u=r-e,s=i-t,l=o-e,c=a*a+u*u,f=s*s+l*l,h=.5/(a*l-u*s);return{x:t+(l*c-u*f)*h,y:e+(a*f-s*c)*h}}(m,y,v,_,b,w);this._cx=k.x,this._cy=k.y;for(let e=0;e0&&Math.abs(l-o)<=QD&&Math.abs(c-a)<=QD)continue;if(o=l,a=c,s===h||s===d||s===p)continue;let f=0;for(let t=0,e=this._hashKey(l,c);t=0;)if(m=g,m===f){m=-1;break}if(-1===m)continue;let y=this._addTriangle(m,s,n[m],-1,-1,r[m]);r[s]=this._legalize(y+2),r[m]=y,A++;let v=n[m];for(;g=n[v],ZD(l,c,t[2*v],t[2*v+1],t[2*g],t[2*g+1])<0;)y=this._addTriangle(v,s,g,r[s],-1,r[v]),r[s]=this._legalize(y+2),n[v]=v,A--,v=g;if(m===f)for(;g=e[m],ZD(l,c,t[2*g],t[2*g+1],t[2*m],t[2*m+1])<0;)y=this._addTriangle(g,s,m,-1,r[m],r[g]),this._legalize(y+2),r[g]=y,n[m]=m,A--,m=g;this._hullStart=e[s]=m,n[m]=e[v]=s,n[s]=v,i[this._hashKey(l,c)]=s,i[this._hashKey(t[2*m],t[2*m+1])]=m}this.hull=new Uint32Array(A);for(let t=0,e=this._hullStart;t0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:e,_halfedges:n,coords:r}=this;let i=0,o=0;for(;;){const a=n[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=KD[--i];continue}const s=a-a%3,l=u+(t+1)%3,c=s+(a+2)%3,f=e[o],h=e[t],d=e[l],p=e[c];if(nC(r[2*f],r[2*f+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=f;const r=n[c];if(-1===r){let e=this._hullStart;do{if(this._hullTri[e]===c){this._hullTri[e]=t;break}e=this._hullPrev[e]}while(e!==this._hullStart)}this._link(t,r),this._link(a,n[o]),this._link(o,c);const u=s+(a+1)%3;i=n&&e[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=n+1,o=r;oC(t,n+r>>1,i),e[t[n]]>e[t[r]]&&oC(t,n,r),e[t[i]]>e[t[r]]&&oC(t,i,r),e[t[n]]>e[t[i]]&&oC(t,n,i);const a=t[i],u=e[a];for(;;){do{i++}while(e[t[i]]u);if(o=o-n?(iC(t,e,i,r),iC(t,e,n,o-1)):(iC(t,e,n,o-1),iC(t,e,i,r))}}function oC(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function aC(t){return t[0]}function uC(t){return t[1]}const sC=1e-6;class lC{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,e){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,e){this._+="L".concat(this._x1=+t,",").concat(this._y1=+e)}arc(t,e,n){const r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(r,",").concat(i):(Math.abs(this._x1-r)>sC||Math.abs(this._y1-i)>sC)&&(this._+="L"+r+","+i),n&&(this._+="A".concat(n,",").concat(n,",0,1,1,").concat(t-n,",").concat(e,"A").concat(n,",").concat(n,",0,1,1,").concat(this._x1=r,",").concat(this._y1=i))}rect(t,e,n,r){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+r,"h").concat(-n,"Z")}value(){return this._||null}}class cC{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class fC{constructor(t){let[e,n,r,i]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500];if(!((r=+r)>=(e=+e)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=e,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:r}=this,i=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let e,r,o=0,a=0,u=n.length;o1;)i-=2;for(let t=2;t4)for(let t=0;t0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}}const hC=2*Math.PI,dC=Math.pow;function pC(t){return t[0]}function gC(t){return t[1]}function mC(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class yC{static from(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pC,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gC,r=arguments.length>3?arguments[3]:void 0;return new yC("length"in t?function(t,e,n,r){const i=t.length,o=new Float64Array(2*i);for(let a=0;a2&&function(t){const{triangles:e,coords:n}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,n=e.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new fC(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const e=a.indexOf(t);return e>0&&(yield a[e-1]),void(e2&&void 0!==arguments[2]?arguments[2]:0;if((t=+t)!=t||(e=+e)!=e)return-1;const r=n;let i;for(;(i=this._step(n,t,e))>=0&&i!==n&&i!==r;)n=i;return i}_step(t,e,n){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:s}=this;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);let l=t,c=dC(e-s[2*t],2)+dC(n-s[2*t+1],2);const f=r[t];let h=f;do{let r=u[h];const f=dC(e-s[2*r],2)+dC(n-s[2*r+1],2);if(f>5<<5,s=~~Math.max(Math.abs(v+_),Math.abs(v-_))}else a=a+31>>5<<5;if(s>d&&(d=s),f+a>=2048&&(f=0,h+=d,d=0),h+s>=kC)break;i.translate((f+(a>>1))/o,(h+(s>>1))/o),e.rotate&&i.rotate(e.rotate*wC),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=a,e.height=s,e.xoff=f,e.yoff=h,e.x1=a>>1,e.y1=s>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,f+=a}for(var b=i.getImageData(0,0,2048/o,kC/o).data,w=[];--r>=0;)if((e=n[r]).hasText){for(u=(a=e.width)>>5,s=e.y1-e.y0,l=0;l>5),E=b[2048*(h+c)+(f+l)<<2]?1<<31-l%32:0;w[M]|=E,k|=E}k?A=c:(e.y0++,s--,c--,h++)}e.y1=e.y0+A,e.sprite=w.slice(0,(e.y1-e.y0)*u)}}}function MC(t,e,n){n>>=5;for(var r,i=t.sprite,o=t.width>>5,a=t.x-(o<<4),u=127&a,s=32-u,l=t.y1-t.y0,c=(t.y+t.y0)*n+(a>>5),f=0;f>>u:0))&e[c+h])return!0;c+=n}return!1}function EC(t,e){var n=t[0],r=t[1];e.x+e.x0r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function DC(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0=f));)if(e.x=a+i,e.y=l+o,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>u[0]||e.y+e.y1>u[1])&&(!n||!MC(e,t,u[0]))&&(!n||DC(e,n))){for(var g,m=e.sprite,y=e.width>>5,v=u[0]>>5,_=e.x-(y<<4),x=127&_,b=32-x,w=e.y1-e.y0,k=(e.y+e.y0)*v+(_>>5),A=0;A>>x:0);k+=v}return e.sprite=null,!0}return!1}return f.layout=function(){for(var s=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=kC/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(sc()),f=function(t){for(var e=[],n=-1;++n>5)*u[1]),d=null,p=l.length,g=-1,m=[],y=l.map((u=>({text:t(u),font:e(u),style:r(u),weight:i(u),rotate:o(u),size:~~(n(u)+1e-14),padding:a(u),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:u}))).sort(((t,e)=>e.size-t.size));++g>1,v.y=u[1]*(c()+.5)>>1,AC(s,v,y,g),v.hasText&&h(f,v,d)&&(m.push(v),d?EC(d,v):d=[{x:v.x+v.x0,y:v.y+v.y0},{x:v.x+v.x1,y:v.y+v.y1}],v.x-=u[0]>>1,v.y-=u[1]>>1)}return m},f.words=function(t){return arguments.length?(l=t,f):l},f.size=function(t){return arguments.length?(u=[+t[0],+t[1]],f):u},f.font=function(t){return arguments.length?(e=FC(t),f):e},f.fontStyle=function(t){return arguments.length?(r=FC(t),f):r},f.fontWeight=function(t){return arguments.length?(i=FC(t),f):i},f.rotate=function(t){return arguments.length?(o=FC(t),f):o},f.text=function(e){return arguments.length?(t=FC(e),f):t},f.spiral=function(t){return arguments.length?(s=SC[t]||t,f):s},f.fontSize=function(t){return arguments.length?(n=FC(t),f):n},f.padding=function(t){return arguments.length?(a=FC(t),f):a},f.random=function(t){return arguments.length?(c=t,f):c},f}(),t)}NC.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:BC}]},ut(NC,Ba,{transform(e,n){!e.size||e.size[0]&&e.size[1]||u("Wordcloud size dimensions must be non-zero.");const r=e.modified();if(!(r||n.changed(n.ADD_REM)||TC.some((function(t){const r=e[t];return H(r)&&n.modified(r.fields)}))))return;const i=n.materialize(n.SOURCE).source,o=this.value,a=e.as||BC;let s,l=e.fontSize||14;if(H(l)?s=e.fontSizeRange:l=Z(l),s){const t=l,e=md("sqrt")().domain(tt(i,t)).range(s);l=n=>e(t(n))}i.forEach((t=>{t[a[0]]=NaN,t[a[1]]=NaN,t[a[3]]=0}));const c=o.words(i).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(l).random(t.random).layout(),f=o.size(),h=f[0]>>1,d=f[1]>>1,p=c.length;for(let t,e,n=0;nnew Uint8Array(t),RC=t=>new Uint16Array(t),LC=t=>new Uint32Array(t);function UC(t,e,n){const r=(e<257?OC:e<65537?RC:LC)(t);return n&&r.set(n),r}function qC(t,e,n){const r=1<{const r=t[e],i=t[n];return ri?1:0})),function(t,e){return Array.from(e,(e=>t[e]))}(t,e)}(h,s),a)l=e,c=t,e=Array(a+u),t=LC(a+u),function(t,e,n,r,i,o,a,u,s){let l,c=0,f=0;for(l=0;c0)for(f=0;ft,size:()=>n}}function jC(t){Ba.call(this,function(){let t=8,e=[],n=LC(0),r=UC(0,t),i=UC(0,t);return{data:()=>e,seen:()=>n=function(t,e,n){return t.length>=e?t:((n=n||new t.constructor(e)).set(t),n)}(n,e.length),add(t){for(let n,r=0,i=e.length,o=t.length;re.length,curr:()=>r,prev:()=>i,reset:t=>i[t]=r[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){r[t]|=e},clear(t,e){r[t]&=~e},resize(e,n){(e>r.length||n>t)&&(t=Math.max(n,t),r=UC(e,t,r),i=UC(e,t))}}}(),t),this._indices=null,this._dims=null}function IC(t){Ba.call(this,null,t)}jC.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},ut(jC,Ba,{transform(t,e){return this._dims?t.modified("fields")||t.fields.some((t=>e.modified(t.fields)))?this.reinit(t,e):this.eval(t,e):this.init(t,e)},init(t,e){const n=t.fields,r=t.query,i=this._indices={},o=this._dims=[],a=r.length;let u,s,l=0;for(;l{const t=i.remove(e,n);for(const e in r)r[e].reindex(t)}))},update(t,e,n){const r=this._dims,i=t.query,o=e.stamp,a=r.length;let u,s,l=0;for(n.filters=0,s=0;sd)for(m=d,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=h;mc)for(d=c,p=Math.min(s,f);df)for(d=Math.max(s,f),p=l;du[t]&n?null:a[t];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,(t=>{const e=u[t]&n;return!e&&e^s[t]&n?a[t]:null})),o.filter(o.REM,(t=>{const e=u[t]&n;return!e||e^e^s[t]&n?null:a[t]}))):(o.filter(o.ADD,l),o.filter(o.REM,(t=>(u[t]&n)===i?a[t]:null))),o.filter(o.SOURCE,(t=>l(t._index)))}});var $C=Object.freeze({__proto__:null,crossfilter:jC,resolvefilter:IC});const WC="Literal",HC="CallExpression";function YC(t){this.type=t}var GC,VC,XC,JC,ZC;YC.prototype.visit=function(t){let e,n,r;if(t(this))return 1;for(e=function(t){switch(t.type){case"ArrayExpression":return t.elements;case"BinaryExpression":case"LogicalExpression":return[t.left,t.right];case HC:return[t.callee].concat(t.arguments);case"ConditionalExpression":return[t.test,t.consequent,t.alternate];case"MemberExpression":return[t.object,t.property];case"ObjectExpression":return t.properties;case"Property":return[t.key,t.value];case"UnaryExpression":return[t.argument];default:return[]}}(this),n=0,r=e.length;n",GC[3]="Identifier",GC[4]="Keyword",GC[5]="Null",GC[6]="Numeric",GC[7]="Punctuator",GC[8]="String",GC[9]="RegularExpression";var QC="Identifier",KC="Unexpected token %0",tF="Invalid regular expression",eF="Invalid regular expression: missing /",nF="Octal literals are not allowed in strict mode.",rF="ILLEGAL",iF="Disabled.",oF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),aF=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function uF(t,e){if(!t)throw new Error("ASSERT: "+e)}function sF(t){return t>=48&&t<=57}function lF(t){return"0123456789abcdefABCDEF".indexOf(t)>=0}function cF(t){return"01234567".indexOf(t)>=0}function fF(t){return 32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(t)>=0}function hF(t){return 10===t||13===t||8232===t||8233===t}function dF(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||92===t||t>=128&&oF.test(String.fromCharCode(t))}function pF(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||92===t||t>=128&&aF.test(String.fromCharCode(t))}const gF={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function mF(){for(;XC1114111||"}"!==t)&&BF({},KC,rF),e<=65535?String.fromCharCode(e):(n=55296+(e-65536>>10),r=56320+(e-65536&1023),String.fromCharCode(n,r))}function _F(){var t,e;for(t=VC.charCodeAt(XC++),e=String.fromCharCode(t),92===t&&(117!==VC.charCodeAt(XC)&&BF({},KC,rF),++XC,(t=yF("u"))&&"\\"!==t&&dF(t.charCodeAt(0))||BF({},KC,rF),e=t);XC>>="===(r=VC.substr(XC,4))?{type:7,value:r,start:i,end:XC+=4}:">>>"===(n=r.substr(0,3))||"<<="===n||">>="===n?{type:7,value:n,start:i,end:XC+=3}:a===(e=n.substr(0,2))[1]&&"+-<>&|".indexOf(a)>=0||"=>"===e?{type:7,value:e,start:i,end:XC+=2}:("//"===e&&BF({},KC,rF),"<>=!+-*%&|^/".indexOf(a)>=0?{type:7,value:a,start:i,end:++XC}:void BF({},KC,rF))}function bF(){var t,e,n;if(uF(sF((n=VC[XC]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),e=XC,t="","."!==n){if(t=VC[XC++],n=VC[XC],"0"===t){if("x"===n||"X"===n)return++XC,function(t){let e="";for(;XC=JC)return{type:2,start:XC,end:XC};const t=VC.charCodeAt(XC);return dF(t)?function(){var t,e;return t=XC,e=92===VC.charCodeAt(XC)?_F():function(){var t,e;for(t=XC++;XC=0&&XC(uF(e=0&&BF({},tF,n),{value:n,literal:e}}(),r=function(t,e){let n=t;e.indexOf("u")>=0&&(n=n.replace(/\\u\{([0-9a-fA-F]+)\}/g,((t,e)=>{if(parseInt(e,16)<=1114111)return"x";BF({},tF)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(t){BF({},tF)}try{return new RegExp(t,e)}catch(t){return null}}(e.value,n.value),{literal:e.literal+n.literal,value:r,regex:{pattern:e.value,flags:n.value},start:t,end:XC}}()),AF()):TF(kF())}return n}();;)if(zF("."))t=FF(".",t,(NF("."),function(){XC=ZC.start;const t=kF();return function(t){return 3===t.type||4===t.type||1===t.type||5===t.type}(t)||TF(t),DF(t.value)}()));else if(zF("("))t=EF(t,qF());else{if(!zF("["))break;t=FF("[",t,PF())}return t}();if(7===ZC.type&&(zF("++")||zF("--")))throw new Error(iF);return t}function IF(){var t,e;if(7!==ZC.type&&4!==ZC.type)e=jF();else{if(zF("++")||zF("--"))throw new Error(iF);if(zF("+")||zF("-")||zF("~")||zF("!"))t=kF(),e=IF(),e=function(t,e){const n=new YC("UnaryExpression");return n.operator=t,n.argument=e,n.prefix=!0,n}(t.value,e);else{if(OF("delete")||OF("void")||OF("typeof"))throw new Error(iF);e=jF()}}return e}function $F(t){let e=0;if(7!==t.type&&4!==t.type)return 0;switch(t.value){case"||":e=1;break;case"&&":e=2;break;case"|":e=3;break;case"^":e=4;break;case"&":e=5;break;case"==":case"!=":case"===":case"!==":e=6;break;case"<":case">":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11}return e}function WF(){var t,e;return t=function(){var t,e,n,r,i,o,a,u,s,l;if(t=ZC,s=IF(),0===(i=$F(r=ZC)))return s;for(r.prec=i,kF(),e=[t,ZC],o=[s,r,a=IF()];(i=$F(ZC))>0;){for(;o.length>2&&i<=o[o.length-2].prec;)a=o.pop(),u=o.pop().value,s=o.pop(),e.pop(),n=MF(u,s,a),o.push(n);(r=kF()).prec=i,o.push(r),e.push(ZC),n=IF(),o.push(n)}for(n=o[l=o.length-1],e.pop();l>1;)e.pop(),n=MF(o[l-1].value,o[l-2],n),l-=2;return n}(),zF("?")&&(kF(),e=WF(),NF(":"),t=function(t,e,n){const r=new YC("ConditionalExpression");return r.test=t,r.consequent=e,r.alternate=n,r}(t,e,WF())),t}function HF(){const t=WF();if(zF(","))throw new Error(iF);return t}function YF(t){XC=0,JC=(VC=t).length,ZC=null,AF();const e=HF();if(2!==ZC.type)throw new Error("Unexpect token after expression.");return e}var GF={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function VF(t){function e(e,n,r){return i=>function(e,n,r,i){let o=t(n[0]);return r&&(o=r+"("+o+")",0===r.lastIndexOf("new ",0)&&(o="("+o+")")),o+"."+e+(i<0?"":0===i?"()":"("+n.slice(1).map(t).join(",")+")")}(e,i,n,r)}const n="new Date",r="String",i="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&u("Missing arguments to clamp function."),e.length>3&&u("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:n,date:e("getDate",n,0),day:e("getDay",n,0),year:e("getFullYear",n,0),month:e("getMonth",n,0),hours:e("getHours",n,0),minutes:e("getMinutes",n,0),seconds:e("getSeconds",n,0),milliseconds:e("getMilliseconds",n,0),time:e("getTime",n,0),timezoneoffset:e("getTimezoneOffset",n,0),utcdate:e("getUTCDate",n,0),utcday:e("getUTCDay",n,0),utcyear:e("getUTCFullYear",n,0),utcmonth:e("getUTCMonth",n,0),utchours:e("getUTCHours",n,0),utcminutes:e("getUTCMinutes",n,0),utcseconds:e("getUTCSeconds",n,0),utcmilliseconds:e("getUTCMilliseconds",n,0),length:e("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:e("toUpperCase",r,0),lower:e("toLowerCase",r,0),substring:e("substring",r),split:e("split",r),trim:e("trim",r,0),regexp:i,test:e("test",i),if:function(e){e.length<3&&u("Missing arguments to if function."),e.length>3&&u("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function XF(t){const e=(t=t||{}).allowed?Dt(t.allowed):{},n=t.forbidden?Dt(t.forbidden):{},r=t.constants||GF,i=(t.functions||VF)(h),o=t.globalvar,a=t.fieldvar,s=H(o)?o:t=>"".concat(o,'["').concat(t,'"]');let l={},c={},f=0;function h(t){if(pt(t))return t;const e=d[t.type];return null==e&&u("Unsupported type: "+t.type),e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const i=t.name;return f>0?i:rt(n,i)?u("Illegal identifier: "+i):rt(r,i)?r[i]:rt(e,i)?i:(l[i]=1,s(i))},MemberExpression:t=>{const e=!t.computed,n=h(t.object);e&&(f+=1);const r=h(t.property);return n===a&&(c[function(t){const e=t&&t.length-1;return e&&('"'===t[0]&&'"'===t[e]||"'"===t[0]&&"'"===t[e])?t.slice(1,-1):t}(r)]=1),e&&(f-=1),n+(e?"."+r:"["+r+"]")},CallExpression:t=>{"Identifier"!==t.callee.type&&u("Illegal callee type: "+t.callee.type);const e=t.callee.name,n=t.arguments,r=rt(i,e)&&i[e];return r||u("Unrecognized function: "+e),H(r)?r(n):r+"("+n.map(h).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(h).join(",")+"]",BinaryExpression:t=>"("+h(t.left)+" "+t.operator+" "+h(t.right)+")",UnaryExpression:t=>"("+t.operator+h(t.argument)+")",ConditionalExpression:t=>"("+h(t.test)+"?"+h(t.consequent)+":"+h(t.alternate)+")",LogicalExpression:t=>"("+h(t.left)+t.operator+h(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(h).join(",")+"}",Property:t=>{f+=1;const e=h(t.key);return f-=1,e+":"+h(t.value)}};function p(t){const e={code:h(t),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},e}return p.functions=i,p.constants=r,p}const JF="intersect",ZF="union",QF="_vgsid_",KF=l(QF),tS="index:unit";function eS(t,e){for(var n,r,i=e.fields,o=e.values,a=i.length,u=0;u1?e-1:0),r=1;re.indexOf(t)>=0)):e},R_union:function(t,e){var n=M(e[0]),r=M(e[1]);return n>r&&(n=e[1],r=e[0]),t.length?(t[0]>n&&(t[0]=n),t[1]r&&(n=e[1],r=e[0]),t.length?rr&&(t[1]=r),t):[n,r]}};function aS(t,e,n,r){e[0].type!==WC&&u("First argument to selection functions must be a string literal.");const i=e[0].value,o=":"+i;(e.length>=2&&A(e).value)!==JF||rt(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),rt(r,o)||(r[o]=n.getData(i).tuplesRef())}function uS(t){const e=this.context.data[t];return e?e.values.value:[]}const sS=t=>function(e,n){return this.context.dataflow.locale()[t](n)(e)},lS=sS("format"),cS=sS("timeFormat"),fS=sS("utcFormat"),hS=sS("timeParse"),dS=sS("utcParse"),pS=new Date(2e3,0,1);function gS(t,e,n){return Number.isInteger(t)&&Number.isInteger(e)?(pS.setYear(2e3),pS.setMonth(t),pS.setDate(e),cS.call(this,pS,n)):""}function mS(t,e,n,r){e[0].type!==WC&&u("First argument to data functions must be a string literal.");const i=e[0].value,o=":"+i;if(!rt(o,r))try{r[o]=n.getData(i).tuplesRef()}catch(t){}}function yS(t,e,n,r){if(e[0].type===WC)vS(n,r,e[0].value);else for(t in n.scales)vS(n,r,t)}function vS(t,e,n){const r="%"+n;if(!rt(e,r))try{e[r]=t.scaleRef(n)}catch(t){}}function _S(t,e){let n;return H(t)?t:pt(t)?(n=e.scales[t])&&n.value:void 0}function xS(t,e){return function(n,r,i){if(n){const e=_S(n,(i||this).context);return e&&e.path[t](r)}return e(r)}}const bS=xS("area",(function(t){return cb=new Xt,Yx(t,fb),2*cb})),wS=xS("bounds",(function(t){var e,n,r,i,o,a,u;if(eb=tb=-(Qx=Kx=1/0),ub=[],Yx(t,qb),n=ub.length){for(ub.sort(Vb),e=1,o=[r=ub[0]];eGb(r[0],r[1])&&(r[1]=i[1]),Gb(i[0],r[1])>Gb(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=Gb(r[1],i[0]))>a&&(a=u,Qx=i[0],tb=r[1])}return ub=sb=null,Qx===1/0||Kx===1/0?[[NaN,NaN],[NaN,NaN]]:[[Qx,Kx],[tb,eb]]})),kS=xS("centroid",(function(t){kb=Ab=Mb=Eb=Db=Cb=Fb=Sb=0,Bb=new Xt,Tb=new Xt,Nb=new Xt,Yx(t,Jb);var e=+Bb,n=+Tb,r=+Nb,i=Bx(e,n,r);return iCS(t,e)}const SS={};function BS(t){return v(t)||ArrayBuffer.isView(t)?t:null}function TS(t){return BS(t)||(pt(t)?t:null)}const NS=t=>t.data;function zS(t,e){const n=uS.call(e,t);return n.root&&n.root.lookup||{}}const OS=()=>"undefined"!=typeof window&&window||null;function RS(t,e,n){if(!t)return[];const[r,i]=t,o=(new eg).set(r[0],r[1],i[0],i[1]);return Cv(n||this.context.dataflow.scenegraph().root,o,function(t){let e=null;if(t){const n=$(t.marktype),r=$(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!r.length||r.some((e=>t.name===e)))}return e}(e))}const LS={random:()=>t.random(),cumulativeNormal:Ga,cumulativeLogNormal:Ka,cumulativeUniform:ou,densityNormal:Ya,densityLogNormal:Qa,densityUniform:iu,quantileNormal:Va,quantileLogNormal:tu,quantileUniform:au,sampleNormal:Ha,sampleLogNormal:Za,sampleUniform:ru,isArray:v,isBoolean:lt,isDate:ct,isDefined:t=>void 0!==t,isNumber:ht,isObject:_,isRegExp:dt,isString:pt,isTuple:Qo,isValid:t=>null!=t&&t==t,toBoolean:kt,toDate:t=>Mt(t),toNumber:M,toString:Et,indexof:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;r1?e-1:0),r=1;rtt(t),inScope:function(t){const e=this.context.group;let n=!1;if(e)for(;t;){if(t===e){n=!0;break}t=t.mark.group}return n},intersect:RS,clampRange:W,pinchDistance:function(t){const e=t.touches,n=e[0].clientX-e[1].clientX,r=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+r*r)},pinchAngle:function(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function(){const t=OS();return t?t.screen:{}},containerSize:function(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[void 0,void 0]},windowSize:function(){const t=OS();return t?[t.innerWidth,t.innerHeight]:[void 0,void 0]},bandspace:function(t,e,n){return $h(t||0,e||0,n||0)},setdata:function(t,e){const n=this.context.dataflow,r=this.context.data[t].input;return n.pulse(r,n.changeset().remove(p).insert(e)),1},pathShape:function(t){let e=null;return function(n){return n?Ap(n,e=e||dp(t)):t}},panLinear:T,panLog:N,panPow:z,panSymlog:O,zoomLinear:L,zoomLog:U,zoomPow:q,zoomSymlog:P,encode:function(t,e,n){if(t){const n=this.context.dataflow,r=t.mark.source;n.pulse(r,n.changeset().encode(t,e))}return void 0!==n?n:t},modify:function(t,e,n,r,i,o){const a=this.context.dataflow,u=this.context.data[t],s=u.input,l=a.stamp();let c,f,h=u.changes;if(!1===a._trigger||!(s.value.length||e||r))return 0;if((!h||h.stamp{u.modified=!0,a.pulse(s,h).run()}),!0,1)),n&&(c=!0===n?p:v(n)||Qo(n)?n:FS(n),h.remove(c)),e&&h.insert(e),r&&(c=FS(r),s.value.some(c)?h.remove(c):h.insert(r)),i)for(f in o)h.modify(i,f,o[f]);return 1},lassoAppend:function(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;const i=t[t.length-1];return void 0===i||Math.sqrt((i[0]-e)**2+(i[1]-n)**2)>r?(t.push([e,n]),[...t]):t},lassoPath:function(t){return(null!=t?t:[]).reduce(((e,n,r)=>{let[i,o]=n;return e+(0==r?"M ".concat(i,",").concat(o," "):r===t.length-1?" Z":"L ".concat(i,",").concat(o," "))}),"")},intersectLasso:function(t,e,n){const{x:r,y:i,mark:o}=n,a=(new eg).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[t,n]of e)ta.x2&&(a.x2=t),na.y2&&(a.y2=n);return a.translate(r,i),RS([[a.x1,a.y1],[a.x2,a.y2]],t,o).filter((t=>function(t,e,n){let r=0;for(let i=0,o=n.length-1;ie!=u>e&&t<(a-s)*(e-l)/(u-l)+s&&r++}return 1&r}(t.x,t.y,e)))}},US=["view","item","group","xy","x","y"],qS="this.",PS={},jS={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>"_[".concat(wt("$"+t),"]"),functions:function(t){const e=VF(t);US.forEach((t=>e[t]="event.vega."+t));for(const t in LS)e[t]=qS+t;return K(e,function(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0,n._bandwidth=yS,n._range=yS,n._scale=yS;const r=e=>"_["+(e.type===WC?wt("%"+e.value):wt("%")+"+"+t(e))+"]";return{_bandwidth:t=>"this.__bandwidth(".concat(r(t[0]),")"),_range:t=>"".concat(r(t[0]),".range()"),_scale:e=>"".concat(r(e[0]),"(").concat(t(e[1]),")")}}(t,LS,PS)),e},constants:GF,visitors:PS},IS=XF(jS);function $S(t,e,n){return 1===arguments.length?LS[t]:(LS[t]=e,n&&(PS[t]=n),IS&&(IS.functions[t]=qS+t),this)}function WS(t,e){const n={};let r;try{r=YF(t=pt(t)?t:wt(t)+"")}catch(e){u("Expression parse error: "+t)}r.visit((t=>{if(t.type!==HC)return;const r=t.callee.name,i=jS.visitors[r];i&&i(r,t.arguments,e,n)}));const i=IS(r);return i.globals.forEach((t=>{const r="$"+t;!rt(n,r)&&e.getSignal(t)&&(n[r]=e.signalRef(t))})),{$expr:K({code:i.code},e.options.ast?{ast:r}:null),$fields:i.fields,$params:n}}$S("bandwidth",(function(t,e){const n=_S(t,(e||this).context);return n&&n.bandwidth?n.bandwidth():0}),yS),$S("copy",(function(t,e){const n=_S(t,(e||this).context);return n?n.copy():void 0}),yS),$S("domain",(function(t,e){const n=_S(t,(e||this).context);return n?n.domain():[]}),yS),$S("range",(function(t,e){const n=_S(t,(e||this).context);return n&&n.range?n.range():[]}),yS),$S("invert",(function(t,e,n){const r=_S(t,(n||this).context);return r?v(e)?(r.invertRange||r.invert)(e):(r.invert||r.invertExtent)(e):void 0}),yS),$S("scale",(function(t,e,n){const r=_S(t,(n||this).context);return r?r(e):void 0}),yS),$S("gradient",(function(t,e,n,r,i){t=_S(t,(i||this).context);const o=op(e,n);let a=t.domain(),u=a[0],s=A(a),l=f;return s-u?l=Fd(t,u,s):t=(t.interpolator?md("sequential")().interpolator(t.interpolator()):md("linear")().interpolate(t.interpolate()).range(t.range())).domain([u=0,s=1]),t.ticks&&(a=t.ticks(+r||15),u!==a[0]&&a.unshift(u),s!==A(a)&&a.push(s)),a.forEach((e=>o.stop(l(e),t(e)))),o}),yS),$S("geoArea",bS,yS),$S("geoBounds",wS,yS),$S("geoCentroid",kS,yS),$S("geoShape",(function(t,e,n){const r=_S(t,(n||this).context);return function(t){return r?r.path.context(t)(e):""}}),yS),$S("indata",(function(t,e,n){const r=this.context.data[t]["index:"+e],i=r?r.value.get(n):void 0;return i?i.count:i}),(function(t,e,n,r){e[0].type!==WC&&u("First argument to indata must be a string literal."),e[1].type!==WC&&u("Second argument to indata must be a string literal.");const i=e[0].value,o=e[1].value,a="@"+o;rt(a,r)||(r[a]=n.getData(i).indataRef(n,o))})),$S("data",uS,mS),$S("treePath",(function(t,e,n){const r=zS(t,this),i=r[e],o=r[n];return i&&o?i.path(o).map(NS):void 0}),mS),$S("treeAncestors",(function(t,e){const n=zS(t,this)[e];return n?n.ancestors().map(NS):void 0}),mS),$S("vlSelectionTest",(function(t,e,n){for(var r,i,o,a,u,s=this.context.data[t],l=s?s.values.value:[],c=s?s[tS]&&s[tS].value:void 0,f=n===JF,h=l.length,d=0;d(t[o[n].field]=e,t)),{}))}else s=QF,l=KF(i),(f=(c=v[s]||(v[s]={}))[u]||(c[u]=[])).push(l),n&&(f=_[u]||(_[u]=[])).push({[QF]:l});return e=e||ZF,v._vgsid_?v._vgsid_=oS["".concat(QF,"_").concat(e)](...Object.values(v._vgsid_)):Object.keys(v).forEach((t=>{v[t]=Object.keys(v[t]).map((e=>v[t][e])).reduce(((n,r)=>void 0===n?r:oS["".concat(x[t],"_").concat(e)](n,r)))})),y=Object.keys(_),n&&y.length&&(v[r?"vlPoint":"vlMulti"]=e===ZF?{or:y.reduce(((t,e)=>(t.push(..._[e]),t)),[])}:{and:y.map((t=>({or:_[t]})))}),v}),aS),$S("vlSelectionTuples",(function(t,e){return t.map((t=>K(e.fields?{values:e.fields.map((e=>(e.getter||(e.getter=l(e.field)))(t.datum)))}:{[QF]:KF(t.datum)},e)))}));const HS=Dt(["rule"]),YS=Dt(["group","image","rect"]);function GS(t){return(t+"").toLowerCase()}function VS(t,e,n){n.endsWith(";")||(n="return("+n+");");const r=Function(...e.concat(n));return t&&t.functions?r.bind(t.functions):r}var XS={operator:(t,e)=>VS(t,["_"],e.code),parameter:(t,e)=>VS(t,["datum","_"],e.code),event:(t,e)=>VS(t,["event"],e.code),handler:(t,e)=>VS(t,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(e.code,";")),encode:(t,e)=>{const{marktype:n,channels:r}=e;let i="var o=item,datum=o.datum,m=0,$;";for(const t in r){const e="o["+wt(t)+"]";i+="$=".concat(r[t].code,";if(").concat(e,"!==$)").concat(e,"=$,m=1;")}return i+=function(t,e){let n="";return HS[e]||(t.x2&&(t.x?(YS[e]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),t.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),t.y2&&(t.y?(YS[e]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),t.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(r,n),i+="return m;",VS(t,["item","_"],i)},codegen:{get(t){const e="[".concat(t.map(wt).join("]["),"]"),n=Function("_","return _".concat(e,";"));return n.path=e,n},comparator(t,e){let n;const r=Function("a","b","var u, v; return "+t.map(((t,r)=>{const i=e[r];let o,a;return t.path?(o="a".concat(t.path),a="b".concat(t.path)):((n=n||{})["f"+r]=t,o="this.f".concat(r,"(a)"),a="this.f".concat(r,"(b)")),function(t,e,n,r){return"((u = ".concat(t,") < (v = ").concat(e,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(r,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(r," : ")}(o,a,-i,i)})).join("")+"0;");return n?r.bind(n):r}}};function JS(t,e,n){if(!t||!_(t))return t;for(let r,i=0,o=ZS.length;it&&t.$tupleid?Ko:t));return e.fn[n]||(e.fn[n]=Y(r,t.$order,e.expr.codegen))}},{key:"$context",parse:function(t,e){return e}},{key:"$subflow",parse:function(t,e){const n=t.$subflow;return function(t,r,i){const o=e.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(i),a.detachSubflow=()=>e.detach(o),a}}},{key:"$tupleid",parse:function(){return Ko}}];const QS={skip:!0};function KS(t,e,n,r){return new tB(t,e,n,r)}function tB(t,e,n,r){this.dataflow=t,this.transforms=e,this.events=t.events.bind(t),this.expr=r||XS,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function eB(t){this.dataflow=t.dataflow,this.transforms=t.transforms,this.events=t.events,this.expr=t.expr,this.signals=Object.create(t.signals),this.scales=Object.create(t.scales),this.nodes=Object.create(t.nodes),this.data=Object.create(t.data),this.fn=Object.create(t.fn),t.functions&&(this.functions=Object.create(t.functions),this.functions.context=this)}function nB(t,e){t&&(null==e?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e))}tB.prototype=eB.prototype={fork(){const t=new eB(this);return(this.subcontext||(this.subcontext=[])).push(t),t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,r=n.dataflow,i=t.value;if(n.set(t.id,e),function(t){return"collect"===GS(t)}(t.type)&&i&&(i.$ingest?r.ingest(e,i.$ingest,i.$format):i.$request?r.preload(e,i.$request,i.$format):r.pulse(e,r.changeset().insert(i))),t.root&&(n.root=e),t.parent){let i=n.get(t.parent.$ref);i?(r.connect(i,[e]),e.targets().add(i)):(n.unresolved=n.unresolved||[]).push((()=>{i=n.get(t.parent.$ref),r.connect(i,[e]),e.targets().add(i)}))}if(t.signal&&(n.signals[t.signal]=e),t.scale&&(n.scales[t.scale]=e),t.data)for(const r in t.data){const i=n.data[r]||(n.data[r]={});t.data[r].forEach((t=>i[t]=e))}},resolve(){return(this.unresolved||[]).forEach((t=>t())),delete this.unresolved,this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[GS(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,r,i){this.dataflow.on(e,n,r,i,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:function(t){const e=this,n=t.operators||[];return t.background&&(e.background=t.background),t.eventConfig&&(e.eventConfig=t.eventConfig),t.locale&&(e.locale=t.locale),n.forEach((t=>e.parseOperator(t))),n.forEach((t=>e.parseOperatorParameters(t))),(t.streams||[]).forEach((t=>e.parseStream(t))),(t.updates||[]).forEach((t=>e.parseUpdate(t))),e.resolve()},parseOperator:function(t){const e=this;!function(t){return"operator"===GS(t)}(t.type)&&t.type?e.transform(t,t.type):e.operator(t,t.update?e.operatorExpression(t.update):null)},parseOperatorParameters:function(t){const e=this;if(t.params){const n=e.get(t.id);n||u("Invalid operator id: "+t.id),e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}},parseParameters:function(t,e){e=e||{};const n=this;for(const r in t){const i=t[r];e[r]=v(i)?i.map((t=>JS(t,n,e))):JS(i,n,e)}return e},parseStream:function(t){var e,n=this,r=null!=t.filter?n.eventExpression(t.filter):void 0,i=null!=t.stream?n.get(t.stream):void 0;t.source?i=n.events(t.source,t.type,r):t.merge&&(i=(e=t.merge.map((t=>n.get(t))))[0].merge.apply(e[0],e.slice(1))),t.between&&(e=t.between.map((t=>n.get(t))),i=i.between(e[0],e[1])),t.filter&&(i=i.filter(r)),null!=t.throttle&&(i=i.throttle(+t.throttle)),null!=t.debounce&&(i=i.debounce(+t.debounce)),null==i&&u("Invalid stream definition: "+JSON.stringify(t)),t.consume&&i.consume(!0),n.stream(t,i)},parseUpdate:function(t){var e,n=this,r=_(r=t.source)?r.$ref:r,i=n.get(r),o=t.update,a=void 0;i||u("Source not defined: "+t.source),e=t.target&&t.target.$expr?n.eventExpression(t.target.$expr):n.get(t.target),o&&o.$expr&&(o.$params&&(a=n.parseParameters(o.$params)),o=n.handlerExpression(o.$expr)),n.update(t,i,e,o,a)},getState:function(t){var e=this,n={};if(t.signals){var r=n.signals={};Object.keys(e.signals).forEach((n=>{const i=e.signals[n];t.signals(n,i)&&(r[n]=i.value)}))}if(t.data){var i=n.data={};Object.keys(e.data).forEach((n=>{const r=e.data[n];t.data(n,r)&&(i[n]=r.input.value)}))}return e.subcontext&&!1!==t.recurse&&(n.subcontext=e.subcontext.map((e=>e.getState(t)))),n},setState:function(t){var e=this,n=e.dataflow,r=t.data,i=t.signals;Object.keys(i||{}).forEach((t=>{n.update(e.signals[t],i[t],QS)})),Object.keys(r||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(p).insert(r[t]))})),(t.subcontext||[]).forEach(((t,n)=>{const r=e.subcontext[n];r&&r.setState(t)}))}};const rB="default";function iB(t,e){const n=t.globalCursor()?"undefined"!=typeof document&&document.body:t.container();if(n)return null==e?n.style.removeProperty("cursor"):n.style.cursor=e}function oB(t,e){var n=t._runtime.data;return rt(n,e)||u("Unrecognized data set: "+e),n[e]}function aB(t,e){aa(e)||u("Second argument to changes must be a changeset.");const n=oB(this,t);return n.modified=!0,this.pulse(n.input,e)}function uB(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function sB(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function lB(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}const cB="view",fB={trap:!1};function hB(t,e,n,r){t._eventListeners.push({type:n,sources:$(e),handler:r})}function dB(t,e,n){const r=t._eventConfig&&t._eventConfig[e];return!(!1===r||_(r)&&!r[n])||(t.warn("Blocked ".concat(e," ").concat(n," event listener.")),!1)}function pB(t){return t.item}function gB(t){return t.item.mark.source}function mB(t){return function(e,n){return n.vega.view().changeset().encode(n.item,t)}}function yB(t,e,n){const r=document.createElement(t);for(const t in e)r.setAttribute(t,e[t]);return null!=n&&(r.textContent=n),r}function vB(t,e,n,r){const i=n.event||"input",o=()=>t.update(e.value);r.signal(n.signal,e.value),e.addEventListener(i,o),hB(r,e,i,o),t.set=t=>{e.value=t,e.dispatchEvent(function(t){return"undefined"!=typeof Event?new Event(t):{type:t}}(i))}}function _B(t,e,n,r){const i=r.signal(n.signal),o=yB("div",{class:"vega-bind"}),a="radio"===n.input?o:o.appendChild(yB("label"));a.appendChild(yB("span",{class:"vega-bind-name"},n.name||n.signal)),e.appendChild(o);let u=xB;switch(n.input){case"checkbox":u=bB;break;case"select":u=wB;break;case"radio":u=kB;break;case"range":u=AB}u(t,a,n,i)}function xB(t,e,n,r){const i=yB("input");for(const t in n)"signal"!==t&&"element"!==t&&i.setAttribute("input"===t?"type":t,n[t]);i.setAttribute("name",n.signal),i.value=r,e.appendChild(i),i.addEventListener("input",(()=>t.update(i.value))),t.elements=[i],t.set=t=>i.value=t}function bB(t,e,n,r){const i={type:"checkbox",name:n.signal};r&&(i.checked=!0);const o=yB("input",i);e.appendChild(o),o.addEventListener("change",(()=>t.update(o.checked))),t.elements=[o],t.set=t=>o.checked=!!t||null}function wB(t,e,n,r){const i=yB("select",{name:n.signal}),o=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};MB(t,r)&&(n.selected=!0),i.appendChild(yB("option",n,(o[e]||t)+""))})),e.appendChild(i),i.addEventListener("change",(()=>{t.update(n.options[i.selectedIndex])})),t.elements=[i],t.set=t=>{for(let e=0,r=n.options.length;e{const u={type:"radio",name:n.signal,value:e};MB(e,r)&&(u.checked=!0);const s=yB("input",u);s.addEventListener("change",(()=>t.update(e)));const l=yB("label",{},(o[a]||e)+"");return l.prepend(s),i.appendChild(l),s})),t.set=e=>{const n=t.elements,r=n.length;for(let t=0;t{s.textContent=u.value,t.update(+u.value)};u.addEventListener("input",l),u.addEventListener("change",l),t.elements=[u],t.set=t=>{u.value=t,s.textContent=t}}function MB(t,e){return t===e||t+""==e+""}function EB(t,e,n,r,i,o){return(e=e||new r(t.loader())).initialize(n,uB(t),sB(t),lB(t),i,o).background(t.background())}function DB(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function CB(t,e,n){if("string"==typeof e){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(e=document.querySelector(e)))return t.error("Signal bind element not found: "+e),null}if(e&&n)try{e.textContent=""}catch(n){e=null,t.error(n)}return e}const FB=t=>+t||0;function SB(t){return _(t)?{top:FB(t.top),bottom:FB(t.bottom),left:FB(t.left),right:FB(t.right)}:(t=>({top:t,bottom:t,left:t,right:t}))(FB(t))}async function BB(t,e,n,r){const i=Dv(e),o=i&&i.headless;return o||u("Unrecognized renderer type: "+e),await t.runAsync(),EB(t,null,null,o,n,r).renderAsync(t._scenegraph.root)}var TB="padding",NB={skip:!0};function zB(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===TB?r.left+r.right:0)}function OB(t,e){var n=t.autosize(),r=t.padding();return e-(n&&n.contains===TB?r.top+r.bottom:0)}function RB(t,e){return e.modified&&v(e.input.value)&&t.indexOf("_:vega:_")}function LB(t,e){return!("parent"===t||e instanceof Ta.proxy)}function UB(t,e,n,r){const i=t.element();i&&i.setAttribute("title",function(t){return null==t?"":v(t)?qB(t):_(t)&&!ct(t)?(e=t,Object.keys(e).map((t=>{const n=e[t];return t+": "+(v(n)?qB(n):PB(n))})).join("\n")):t+"";var e}(r))}function qB(t){return"["+t.map(PB).join(", ")+"]"}function PB(t){return v(t)?"[…]":_(t)&&!ct(t)?"{…}":t}function jB(t,e){const n=this;if(e=e||{},Fa.call(n),e.loader&&n.loader(e.loader),e.logger&&n.logger(e.logger),null!=e.logLevel&&n.logLevel(e.logLevel),e.locale||t.locale){const r=K({},t.locale,e.locale);n.locale(bo(r.number,r.time))}n._el=null,n._elBind=null,n._renderType=e.renderer||Mv.Canvas,n._scenegraph=new ay;const r=n._scenegraph.root;n._renderer=null,n._tooltip=e.tooltip||UB,n._redraw=!0,n._handler=(new Ty).scene(r),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=function(t){const e=K({defaults:{}},t),n=(t,e)=>{e.forEach((e=>{v(t[e])&&(t[e]=Dt(t[e]))}))};return n(e.defaults,["prevent","allow"]),n(e,["view","window","selector"]),e}(t.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const i=function(t,e,n){return KS(t,Ta,LS,n).parse(e)}(n,t,e.expr);n._runtime=i,n._signals=i.signals,n._bind=(t.bindings||[]).map((t=>({state:null,param:K({},t)}))),i.root&&i.root.set(r),r.source=i.data.root.input,n.pulse(i.data.root.input,n.changeset().insert(r.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=zB(n,n._width),n._viewHeight=OB(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,function(t){var e=t._signals,n=e.width,r=e.height,i=e.padding;function o(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size,t._viewWidth=zB(t,e.size),o()}),{size:n}),t._resizeHeight=t.add(null,(e=>{t._height=e.size,t._viewHeight=OB(t,e.size),o()}),{size:r});const a=t.add(null,o,{pad:i});t._resizeWidth.rank=n.rank+1,t._resizeHeight.rank=r.rank+1,a.rank=i.rank+1}(n),function(t){t.add(null,(e=>(t._background=e.bg,t._resize=1,e.bg)),{bg:t._signals.background})}(n),function(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:rB,item:null}));t.on(t.events("view","mousemove"),e,((t,n)=>{const r=e.value,i=r?pt(r)?r:r.user:rB,o=n.item&&n.item.cursor||null;return r&&i===r.user&&o==r.item?r:{user:i,item:o}})),t.add(null,(function(e){let n=e.cursor,r=this.value;return pt(n)||(r=n.item,n=n.user),iB(t,n&&n!==rB?n:r||n),r}),{cursor:e})}(n),n.description(t.description),e.hover&&n.hover(),e.container&&n.initialize(e.container,e.bind)}function IB(t,e){return rt(t._signals,e)?t._signals[e]:u("Unrecognized signal name: "+wt(e))}function $B(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function WB(t,e,n,r){let i=$B(n,r);return i||(i=DB(t,(()=>r(e,n.value))),i.handler=r,t.on(n,null,i)),t}function HB(t,e,n){const r=$B(e,n);return r&&e._targets.remove(r),t}ut(jB,Fa,{async evaluate(t,e,n){if(await Fa.prototype.evaluate.call(this,t,e),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function(t){var e=lB(t),n=uB(t),r=sB(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach((e=>{try{e(n,r)}catch(e){t.error(e)}}))}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(t){this.error(t)}return n&&Xo(this,n),this},dirty(t){this._redraw=!0,this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=null!=t?t+"":null;return e!==this._desc&&nB(this._el,this._desc=e),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const r=IB(this,t);return 1===arguments.length?r.value:this.update(r,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",SB(t)):SB(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){return arguments.length?(Dv(t)||u("Unrecognized renderer type: "+t),t!==this._renderType&&(this._renderType=t,this._resetRenderer()),this):this._renderType},tooltip(t){return arguments.length?(t!==this._tooltip&&(this._tooltip=t,this._resetRenderer()),this):this._tooltip},loader(t){return arguments.length?(t!==this._loader&&(Fa.prototype.loader.call(this,t),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(IB(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function(t,e,n,r,i,o){this.runAfter((a=>{let u=0;a._autosize=0,a.width()!==n&&(u=1,a.signal("width",n,NB),a._resizeWidth.skip(!0)),a.height()!==r&&(u=1,a.signal("height",r,NB),a._resizeHeight.skip(!0)),a._viewWidth!==t&&(a._resize=1,a._viewWidth=t),a._viewHeight!==e&&(a._resize=1,a._viewHeight=e),a._origin[0]===i[0]&&a._origin[1]===i[1]||(a._resize=1,a._origin=i),u&&a.run("enter"),o&&a.runAfter((t=>t.resize()))}),!1,1)},addEventListener(t,e,n){let r=e;return n&&!1===n.trap||(r=DB(this,e),r.raw=e),this._handler.on(t,r),this},removeEventListener(t,e){for(var n,r,i=this._handler.handlers(t),o=i.length;--o>=0;)if(r=i[o].type,n=i[o].handler,t===r&&(e===n||e===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(t){const e=this._resizeListeners;return e.indexOf(t)<0&&e.push(t),this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);return n>=0&&e.splice(n,1),this},addSignalListener(t,e){return WB(this,t,IB(this,t),e)},removeSignalListener(t,e){return HB(this,IB(this,t),e)},addDataListener(t,e){return WB(this,t,oB(this,t).values,e)},removeDataListener(t,e){return HB(this,oB(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=iB(this,null);this._globalCursor=!!t,e&&iB(this,e)}return this}return this._globalCursor},preventDefault(t){return arguments.length?(this._preventDefault=t,this):this._preventDefault},timer:function(t,e){this._timers.push(function(t,e,n){var r=new LM,i=e;return null==e?(r.restart(t,e,n),r):(r._restart=r.restart,r.restart=function(t,e,n){e=+e,n=null==n?OM():+n,r._restart((function o(a){a+=i,r._restart(o,i+=e,n),t(a)}),e,n)},r.restart(t,e,n),r)}((function(e){t({timestamp:Date.now(),elapsed:e})}),e))},events:function(t,e,n){var r,i=this,o=new ga(n),a=function(n,r){i.runAsync(null,(()=>{t===cB&&function(t,e){var n=t._eventConfig.defaults,r=n.prevent,i=n.allow;return!1!==r&&!0!==i&&(!0===r||!1===i||(r?r[e]:i?!i[e]:t.preventDefault()))}(i,e)&&n.preventDefault(),o.receive(function(t,e,n){var r,i,o=t._renderer,a=o&&o.canvas();return a&&(i=lB(t),(r=dy(e.changedTouches?e.changedTouches[0]:e,a))[0]-=i[0],r[1]-=i[1]),e.dataflow=t,e.item=n,e.vega=function(t,e,n){const r=e?"group"===e.mark.marktype?e:e.mark.group:null;function i(t){var n,i=r;if(t)for(n=e;n;n=n.mark.group)if(n.mark.name===t){i=n;break}return i&&i.mark&&i.mark.interactive?i:{}}function o(t){if(!t)return n;pt(t)&&(t=i(t));const e=n.slice();for(;t;)e[0]-=t.x||0,e[1]-=t.y||0,t=t.mark&&t.mark.group;return e}return{view:Z(t),item:Z(e||{}),group:i,xy:o,x:t=>o(t)[0],y:t=>o(t)[1]}}(t,n,r),e}(i,n,r))}))};if("timer"===t)dB(i,"timer",e)&&i.timer(a,e);else if(t===cB)dB(i,"view",e)&&i.addEventListener(e,a,fB);else if("window"===t?dB(i,"window",e)&&"undefined"!=typeof window&&(r=[window]):"undefined"!=typeof document&&dB(i,"selector",e)&&(r=document.querySelectorAll(t)),r){for(var u=0,s=r.length;u=0;)i[t].stop();for(t=o.length;--t>=0;)for(e=(n=o[t]).sources.length;--e>=0;)n.sources[e].removeEventListener(n.type,n.handler);return r&&r.call(this,this._handler,null,null,null),this},hover:function(t,e){return e=[e||"update",(t=[t||"hover"])[0]],this.on(this.events("view","mouseover",pB),gB,mB(t)),this.on(this.events("view","mouseout",pB),gB,mB(e)),this},data:function(t,e){return arguments.length<2?oB(this,t).values.value:aB.call(this,t,ua().remove(p).insert(e))},change:aB,insert:function(t,e){return aB.call(this,t,ua().insert(e))},remove:function(t,e){return aB.call(this,t,ua().remove(e))},scale:function(t){var e=this._runtime.scales;return rt(e,t)||u("Unrecognized scale or projection: "+t),e[t].value},initialize:function(t,e){const n=this,r=n._renderType,i=n._eventConfig.bind,o=Dv(r);t=n._el=t?CB(n,t,!0):null,function(t){const e=t.container();e&&(e.setAttribute("role","graphics-document"),e.setAttribute("aria-roleDescription","visualization"),nB(e,t.description()))}(n),o||n.error("Unrecognized renderer type: "+r);const a=o.handler||Ty,u=t?o.renderer:o.headless;return n._renderer=u?EB(n,n._renderer,t,u):null,n._handler=function(t,e,n,r){const i=new r(t.loader(),DB(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,lB(t),t);return e&&e.handlers().forEach((t=>{i.on(t.type,t.handler)})),i}(n,n._handler,t,a),n._redraw=!0,t&&"none"!==i&&(e=e?n._elBind=CB(n,e,!0):t.appendChild(yB("form",{class:"vega-bindings"})),n._bind.forEach((t=>{t.param.element&&"container"!==i&&(t.element=CB(n,t.param.element,!!t.param.input))})),n._bind.forEach((t=>{!function(t,e,n){if(!e)return;const r=n.param;let i=n.state;i||(i=n.state={elements:null,active:!1,set:null,update:e=>{e!=t.signal(r.signal)&&t.runAsync(null,(()=>{i.source=!0,t.signal(r.signal,e)}))}},r.debounce&&(i.update=Q(r.debounce,i.update))),(null==r.input&&r.element?vB:_B)(i,e,r,t),i.active||(t.on(t._signals[r.signal],null,(()=>{i.source?i.source=!1:i.set(t.signal(r.signal))})),i.active=!0)}(n,t.element||e,t)}))),n},toImageURL:async function(t,e){t!==Mv.Canvas&&t!==Mv.SVG&&t!==Mv.PNG&&u("Unrecognized image type: "+t);const n=await BB(this,t,e);return t===Mv.SVG?function(t,e){const n=new Blob([t],{type:"image/svg+xml"});return window.URL.createObjectURL(n)}(n.svg()):n.canvas().toDataURL("image/png")},toCanvas:async function(t,e){return(await BB(this,Mv.Canvas,t,e)).canvas()},toSVG:async function(t){return(await BB(this,Mv.SVG,t)).svg()},getState:function(t){return this._runtime.getState(t||{data:RB,signals:LB,recurse:!0})},setState:function(t){return this.runAsync(null,(e=>{e._trigger=!1,e._runtime.setState(t)}),(t=>{t._trigger=!0})),this}});const YB="[",GB="]",VB=/[[\]{}]/,XB={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let JB,ZB;function QB(t,e,n){return JB=e||"view",ZB=n||XB,tT(t.trim()).map(eT)}function KB(t,e,n,r,i){const o=t.length;let a,u=0;for(;e=0?--u:r&&r.indexOf(a)>=0&&++u}return e}function tT(t){const e=[],n=t.length;let r=0,i=0;for(;i"!==(t=t.slice(r+1).trim())[0])throw"Expected '>' after between selector: "+t;n=n.map(eT);const i=eT(t.slice(1).trim());return i.between?{between:n,stream:i}:(i.between=n,i)}(t):function(t){const e={source:JB},n=[];let r,i,o=[0,0],a=0,u=0,s=t.length,l=0;if("}"===t[s-1]){if(l=t.lastIndexOf("{"),!(l>=0))throw"Unmatched right brace: "+t;try{o=function(t){const e=t.split(",");if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!=n)throw t;return n}))}(t.substring(l+1,s-1))}catch(e){throw"Invalid throttle specification: "+t}s=(t=t.slice(0,l).trim()).length,l=0}if(!s)throw t;if("@"===t[0]&&(a=++l),r=KB(t,l,":"),r1?(e.type=n[1],a?e.markname=n[0].slice(1):function(t){return ZB[t]}(n[0])?e.marktype=n[0]:e.source=n[0]):e.type=n[0],"!"===e.type.slice(-1)&&(e.consume=!0,e.type=e.type.slice(0,-1)),null!=i&&(e.filter=i),o[0]&&(e.throttle=o[0]),o[1]&&(e.debounce=o[1]),e}(t)}function nT(t){return _(t)?t:{type:t||"pad"}}const rT=t=>+t||0;function iT(t){return _(t)?t.signal?t:{top:rT(t.top),bottom:rT(t.bottom),left:rT(t.left),right:rT(t.right)}:{top:e=rT(t),bottom:e,left:e,right:e};var e}const oT=t=>_(t)&&!v(t)?K({},t):{value:t};function aT(t,e,n,r){return null!=n?(_(n)&&!v(n)||v(n)&&n.length&&_(n[0])?t.update[e]=n:t[r||"enter"][e]={value:n},1):0}function uT(t,e,n){for(const n in e)aT(t,n,e[n]);for(const e in n)aT(t,e,n[e],"update")}function sT(t,e,n){for(const r in e)n&&rt(n,r)||(t[r]=K(t[r]||{},e[r]));return t}function lT(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const cT="mark",fT="frame",hT="scope",dT="legend-label";function pT(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const gT=t=>pt(t)?wt(t):t.signal?"(".concat(t.signal,")"):_T(t);function mT(t){if(null!=t.gradient)return function(t){const e=[t.start,t.stop,t.count].map((t=>null==t?null:wt(t)));for(;e.length&&null==A(e);)e.pop();return e.unshift(gT(t.gradient)),"gradient(".concat(e.join(","),")")}(t);let e=t.signal?"(".concat(t.signal,")"):t.color?function(t){return t.c?yT("hcl",t.h,t.c,t.l):t.h||t.s?yT("hsl",t.h,t.s,t.l):t.l||t.a?yT("lab",t.l,t.a,t.b):t.r||t.g||t.b?yT("rgb",t.r,t.g,t.b):null}(t.color):null!=t.field?_T(t.field):void 0!==t.value?wt(t.value):void 0;return null!=t.scale&&(e=function(t,e){const n=gT(t.scale);return null!=t.range?e="lerp(_range(".concat(n,"), ").concat(+t.range,")"):(void 0!==e&&(e="_scale(".concat(n,", ").concat(e,")")),t.band&&(e=(e?e+"+":"")+"_bandwidth(".concat(n,")")+(1==+t.band?"":"*"+vT(t.band)),t.extra&&(e="(datum.extra ? _scale(".concat(n,", datum.extra.value) : ").concat(e,")"))),null==e&&(e="0")),e}(t,e)),void 0===e&&(e=null),null!=t.exponent&&(e="pow(".concat(e,",").concat(vT(t.exponent),")")),null!=t.mult&&(e+="*".concat(vT(t.mult))),null!=t.offset&&(e+="+".concat(vT(t.offset))),t.round&&(e="round(".concat(e,")")),e}const yT=(t,e,n,r)=>"(".concat(t,"(").concat([e,n,r].map(mT).join(","),")+'')");function vT(t){return _(t)?"("+mT(t)+")":t}function _T(t){return xT(_(t)?t:{datum:t})}function xT(t){let e,n,r;if(t.signal)e="datum",r=t.signal;else if(t.group||t.parent){for(n=Math.max(1,t.level||1),e="item";n-- >0;)e+=".mark.group";t.parent?(r=t.parent,e+=".datum"):r=t.group}else t.datum?(e="datum",r=t.datum):u("Invalid field reference: "+wt(t));return t.signal||(r=pt(r)?s(r).map(wt).join("]["):xT(r)),e+"["+r+"]"}function bT(t,e,n,r,i,o){const a={};(o=o||{}).encoders={$encode:a},t=function(t,e,n,r,i){const o={},a={};let u,s,l,c;for(s in s="lineBreak","text"!==e||null==i[s]||lT(s,t)||pT(o,s,i[s]),("legend"==n||String(n).startsWith("axis"))&&(n=null),c=n===fT?i.group:n===cT?K({},i.mark,i[e]):null,c)l=lT(s,t)||("fill"===s||"stroke"===s)&&(lT("fill",t)||lT("stroke",t)),l||pT(o,s,c[s]);for(s in $(r).forEach((e=>{const n=i.style&&i.style[e];for(const e in n)lT(e,t)||pT(o,e,n[e])})),t=K({},t),o)c=o[s],c.signal?(u=u||{})[s]=c:a[s]=c;return t.enter=K(a,t.enter),u&&(t.update=K(u,t.update)),t}(t,e,n,r,i.config);for(const n in t)a[n]=wT(t[n],e,o,i);return o}function wT(t,e,n,r){const i={},o={};for(const e in t)null!=t[e]&&(i[e]=kT((a=t[e],v(a)?function(t){let e="";return t.forEach((t=>{const n=mT(t);e+=t.test?"(".concat(t.test,")?").concat(n,":"):n})),":"===A(e)&&(e+="null"),e}(a):mT(a)),r,n,o));var a;return{$expr:{marktype:e,channels:i},$fields:Object.keys(o),$output:Object.keys(t)}}function kT(t,e,n,r){const i=WS(t,e);return i.$fields.forEach((t=>r[t]=1)),K(n,i.$params),i.$expr}const AT=["value","update","init","react","bind"];function MT(t,e){u(t+' for "outer" push: '+wt(e))}function ET(t,e){const n=t.name;if("outer"===t.push)e.signals[n]||MT("No prior signal definition",n),AT.forEach((e=>{void 0!==t[e]&&MT("Invalid property ",e)}));else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function DT(t,e,n,r){this.id=-1,this.type=t,this.value=e,this.params=n,r&&(this.parent=r)}function CT(t,e,n,r){return new DT(t,e,n,r)}function FT(t,e){return CT("operator",t,e)}function ST(t){const e={$ref:t.id};return t.id<0&&(t.refs=t.refs||[]).push(e),e}function BT(t,e){return e?{$field:t,$name:e}:{$field:t}}const TT=BT("key");function NT(t,e){return{$compare:t,$order:e}}function zT(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const OT="scope",RT="view";function LT(t){return t&&t.signal}function UT(t){if(LT(t))return!0;if(_(t))for(const e in t)if(UT(t[e]))return!0;return!1}function qT(t,e){return null!=t?t:e}function PT(t){return t&&t.signal||t}const jT="timer";function IT(t,e){return(t.merge?$T:t.stream?WT:t.type?HT:u("Invalid stream specification: "+wt(t)))(t,e)}function $T(t,e){const n=YT({merge:t.merge.map((t=>IT(t,e)))},t,e);return e.addStream(n).id}function WT(t,e){const n=YT({stream:IT(t.stream,e)},t,e);return e.addStream(n).id}function HT(t,e){let n;t.type===jT?(n=e.event(jT,t.throttle),t={between:t.between,filter:t.filter}):n=e.event(function(t){return t===OT?RT:t||RT}(t.source),t.type);const r=YT({stream:n},t,e);return 1===Object.keys(r).length?n:e.addStream(r).id}function YT(t,e,n){let r=e.between;return r&&(2!==r.length&&u('Stream "between" parameter must have 2 entries: '+wt(e)),t.between=[IT(r[0],n),IT(r[1],n)]),r=e.filter?[].concat(e.filter):[],(e.marktype||e.markname||e.markrole)&&r.push(function(t,e,n){const r="event.item";return r+(t&&"*"!==t?"&&"+r+".mark.marktype==='"+t+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(e?"&&"+r+".mark.name==='"+e+"'":"")}(e.marktype,e.markname,e.markrole)),e.source===OT&&r.push("inScope(event.item)"),r.length&&(t.filter=WS("("+r.join(")&&(")+")",n).$expr),null!=(r=e.throttle)&&(t.throttle=+r),null!=(r=e.debounce)&&(t.debounce=+r),e.consume&&(t.consume=!0),t}const GT={code:"_.$value",ast:{type:"Identifier",value:"value"}};function VT(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}const XT=t=>(e,n,r)=>CT(t,n,e||void 0,r),JT=XT("aggregate"),ZT=XT("axisticks"),QT=XT("bound"),KT=XT("collect"),tN=XT("compare"),eN=XT("datajoin"),nN=XT("encode"),rN=XT("expression"),iN=XT("facet"),oN=XT("field"),aN=XT("key"),uN=XT("legendentries"),sN=XT("load"),lN=XT("mark"),cN=XT("multiextent"),fN=XT("multivalues"),hN=XT("overlap"),dN=XT("params"),pN=XT("prefacet"),gN=XT("projection"),mN=XT("proxy"),yN=XT("relay"),vN=XT("render"),_N=XT("scale"),xN=XT("sieve"),bN=XT("sortitems"),wN=XT("viewlayout"),kN=XT("values");let AN=0;const MN={min:"min",max:"max",count:"sum"};function EN(t,e){const n=e.getScale(t.name).params;let r;for(r in n.domain=SN(t.domain,t,e),null!=t.range&&(n.range=UN(t,e,n)),null!=t.interpolate&&function(t,e){e.interpolate=DN(t.type||t),null!=t.gamma&&(e.interpolateGamma=DN(t.gamma))}(t.interpolate,n),null!=t.nice&&(n.nice=function(t){return _(t)?{interval:DN(t.interval),step:DN(t.step)}:DN(t)}(t.nice)),null!=t.bins&&(n.bins=function(t,e){return t.signal||v(t)?CN(t,e):e.objectProperty(t)}(t.bins,e)),t)rt(n,r)||"name"===r||(n[r]=DN(t[r],e))}function DN(t,e){return _(t)?t.signal?e.signalRef(t.signal):u("Unsupported object: "+wt(t)):t}function CN(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>DN(t,e)))}function FN(t){u("Can not find data set: "+wt(t))}function SN(t,e,n){if(t)return t.signal?n.signalRef(t.signal):(v(t)?BN:t.fields?NN:TN)(t,e,n);null==e.domainMin&&null==e.domainMax||u("No scale domain defined for domainMin/domainMax to override.")}function BN(t,e,n){return t.map((t=>DN(t,n)))}function TN(t,e,n){const r=n.getData(t.data);return r||FN(t.data),xd(e.type)?r.valuesRef(n,t.field,ON(t.sort,!1)):Ad(e.type)?r.domainRef(n,t.field):r.extentRef(n,t.field)}function NN(t,e,n){const r=t.data,i=t.fields.reduce(((t,e)=>(e=pt(e)?{data:r,field:e}:v(e)||e.signal?function(t,e){const n="_:vega:_"+AN++,r=KT({});if(v(t))r.value={$ingest:t};else if(t.signal){const i="setdata("+wt(n)+","+t.signal+")";r.params.input=e.signalRef(i)}return e.addDataPipeline(n,[r,xN({})]),{data:n,field:"data"}}(e,n):e,t.push(e),t)),[]);return(xd(e.type)?zN:Ad(e.type)?RN:LN)(t,n,i)}function zN(t,e,n){const r=ON(t.sort,!0);let i,o;const a=n.map((t=>{const n=e.getData(t.data);return n||FN(t.data),n.countsRef(e,t.field,r)})),u={groupby:TT,pulse:a};r&&(i=r.op||"count",o=r.field?zT(i,r.field):"count",u.ops=[MN[i]],u.fields=[e.fieldRef(o)],u.as=[o]),i=e.add(JT(u));const s=e.add(KT({pulse:ST(i)}));return o=e.add(kN({field:TT,sort:e.sortRef(r),pulse:ST(s)})),ST(o)}function ON(t,e){return t&&(t.field||t.op?t.field||"count"===t.op?e&&t.field&&t.op&&!MN[t.op]&&u("Multiple domain scales can not be sorted using "+t.op):u("No field provided for sort aggregate op: "+t.op):_(t)?t.field="key":t={field:"key"}),t}function RN(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||FN(t.data),n.domainRef(e,t.field)}));return ST(e.add(fN({values:r})))}function LN(t,e,n){const r=n.map((t=>{const n=e.getData(t.data);return n||FN(t.data),n.extentRef(e,t.field)}));return ST(e.add(cN({extents:r})))}function UN(t,e,n){const r=e.config.range;let i=t.range;if(i.signal)return e.signalRef(i.signal);if(pt(i)){if(r&&rt(r,i))return UN(t=K({},t,{range:r[i]}),e,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=xd(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]:u("Unrecognized scale range value: "+wt(i))}else{if(i.scheme)return n.scheme=v(i.scheme)?CN(i.scheme,e):DN(i.scheme,e),i.extent&&(n.schemeExtent=CN(i.extent,e)),void(i.count&&(n.schemeCount=DN(i.count,e)));if(i.step)return void(n.rangeStep=DN(i.step,e));if(xd(t.type)&&!v(i))return SN(i,t,e);v(i)||u("Unsupported range type: "+wt(i))}return i.map((t=>(v(t)?CN:DN)(t,e)))}function qN(t,e,n){return v(t)?t.map((t=>qN(t,e,n))):_(t)?t.signal?n.signalRef(t.signal):"fit"===e?t:u("Unsupported parameter object: "+wt(t)):t}const PN="top",jN="left",IN="right",$N="bottom",WN="center",HN="index",YN="label",GN="perc",VN="value",XN="guide-label",JN="guide-title",ZN="symbol",QN="gradient",KN="discrete",tz="size",ez=[tz,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],nz={name:1,style:1,interactive:1},rz={value:0},iz={value:1},oz="group",az="rect",uz="rule",sz="text";function lz(t){return t.type=oz,t.interactive=t.interactive||!1,t}function cz(t,e){const n=(n,r)=>qT(t[n],qT(e[n],r));return n.isVertical=n=>"vertical"===qT(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection)),n.gradientLength=()=>qT(t.gradientLength,e.gradientLength||e.gradientWidth),n.gradientThickness=()=>qT(t.gradientThickness,e.gradientThickness||e.gradientHeight),n.entryColumns=()=>qT(t.columns,qT(e.columns,+n.isVertical(!0))),n}function fz(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function hz(t,e,n){return"item.anchor === '".concat("start","' ? ").concat(t," : item.anchor === '").concat("end","' ? ").concat(e," : ").concat(n)}const dz=hz(wt(jN),wt(IN),wt(WN));function pz(t,e){return e?t?_(t)?Object.assign({},t,{offset:pz(t.offset,e)}):{value:t,offset:e}:e:t}function gz(t,e){return e?(t.name=e.name,t.style=e.style||t.style,t.interactive=!!e.interactive,t.encode=sT(t.encode,e,nz)):t.interactive=!1,t}function mz(t,e,n,r){const i=cz(t,n),o=i.isVertical(),a=i.gradientThickness(),u=i.gradientLength();let s,l,c,f,h;o?(l=[0,1],c=[0,0],f=a,h=u):(l=[0,0],c=[1,0],f=u,h=a);const d={enter:s={opacity:rz,x:rz,y:rz,width:oT(f),height:oT(h)},update:K({},s,{opacity:iz,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:rz}};return uT(d,{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),gz({type:az,role:"legend-gradient",encode:d},r)}function yz(t,e,n,r,i){const o=cz(t,n),a=o.isVertical(),u=o.gradientThickness(),s=o.gradientLength();let l,c,f,h,d="";a?(l="y",f="y2",c="x",h="width",d="1-"):(l="x",f="x2",c="y",h="height");const p={opacity:rz,fill:{scale:e,field:VN}};p[l]={signal:d+"datum."+GN,mult:s},p[c]=rz,p[f]={signal:d+"datum.perc2",mult:s},p[h]=oT(u);const g={enter:p,update:K({},p,{opacity:iz}),exit:{opacity:rz}};return uT(g,{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),gz({type:az,role:"legend-band",key:VN,from:i,encode:g},r)}const vz="datum.".concat(GN,'<=0?"').concat(jN,'":datum.').concat(GN,'>=1?"').concat(IN,'":"').concat(WN,'"'),_z="datum.".concat(GN,'<=0?"').concat($N,'":datum.').concat(GN,'>=1?"').concat(PN,'":"').concat("middle",'"');function xz(t,e,n,r){const i=cz(t,e),o=i.isVertical(),a=oT(i.gradientThickness()),u=i.gradientLength();let s,l,c,f,h=i("labelOverlap"),d="";const p={enter:s={opacity:rz},update:l={opacity:iz,text:{field:YN}},exit:{opacity:rz}};return uT(p,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:qT(t.labelLimit,e.gradientLabelLimit)}),o?(s.align={value:"left"},s.baseline=l.baseline={signal:_z},c="y",f="x",d="1-"):(s.align=l.align={signal:vz},s.baseline={value:"top"},c="x",f="y"),s[c]=l[c]={signal:d+"datum."+GN,mult:u},s[f]=l[f]=a,a.offset=qT(t.labelOffset,e.gradientLabelOffset)||0,h=h?{separation:i("labelSeparation"),method:h,order:"datum.index"}:void 0,gz({type:sz,role:dT,style:XN,key:VN,from:r,encode:p,overlap:h},n)}function bz(t,e,n,r,i){const o=cz(t,e),a=n.entries,u=!(!a||!a.interactive),s=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),f={data:"value"},h="(".concat(i,") ? datum.").concat("offset"," : datum.").concat(tz),d=l?oT(l):{field:tz},p="datum.".concat(HN),g="max(1, ".concat(i,")");let m,y,v,_,x;d.mult=.5,m={enter:y={opacity:rz,x:{signal:h,mult:.5,offset:c},y:d},update:v={opacity:iz,x:y.x,y:y.y},exit:{opacity:rz}};let b=null,w=null;t.fill||(b=e.symbolBaseFillColor,w=e.symbolBaseStrokeColor),uT(m,{fill:o("symbolFillColor",b),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",w),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),ez.forEach((e=>{t[e]&&(v[e]=y[e]={scale:t[e],field:VN})}));const k=gz({type:"symbol",role:"legend-symbol",key:VN,from:f,clip:!!l||void 0,encode:m},n.symbols),A=oT(c);A.offset=o("labelOffset"),m={enter:y={opacity:rz,x:{signal:h,offset:A},y:d},update:v={opacity:iz,text:{field:YN},x:y.x,y:y.y},exit:{opacity:rz}},uT(m,{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")});const M=gz({type:sz,role:dT,style:XN,key:VN,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:rz,height:l?oT(l):rz,opacity:rz},exit:{opacity:rz},update:v={opacity:iz,row:{signal:null},column:{signal:null}}},o.isVertical(!0)?(_="ceil(item.mark.items.length / ".concat(g,")"),v.row.signal="".concat(p,"%").concat(_),v.column.signal="floor(".concat(p," / ").concat(_,")"),x={field:["row",p]}):(v.row.signal="floor(".concat(p," / ").concat(g,")"),v.column.signal="".concat(p," % ").concat(g),x={field:p}),v.column.signal="(".concat(i,")?").concat(v.column.signal,":").concat(p),lz({role:hT,from:r={facet:{data:r,name:"value",groupby:HN}},encode:sT(m,a,nz),marks:[k,M],name:s,interactive:u,sort:x})}const wz='item.orient === "left"',kz='item.orient === "right"',Az="(".concat(wz," || ").concat(kz,")"),Mz="datum.vgrad && ".concat(Az),Ez=hz('"top"','"bottom"','"middle"'),Dz=hz('"right"','"left"','"center"'),Cz="datum.vgrad && ".concat(kz," ? (").concat(Dz,") : (").concat(Az," && !(datum.vgrad && ").concat(wz,')) ? "left" : ').concat(dz),Fz="item._anchor || (".concat(Az,' ? "middle" : "start")'),Sz="".concat(Mz," ? (").concat(wz," ? -90 : 90) : 0"),Bz="".concat(Az," ? (datum.vgrad ? (").concat(kz,' ? "bottom" : "top") : ').concat(Ez,') : "top"');function Tz(t,e){let n;return _(t)&&(t.signal?n=t.signal:t.path?n="pathShape("+Nz(t.path)+")":t.sphere&&(n="geoShape("+Nz(t.sphere)+', {type: "Sphere"})')),n?e.signalRef(n):!!t}function Nz(t){return _(t)&&t.signal?t.signal:wt(t)}function zz(t){const e=t.role||"";return e.indexOf("axis")&&e.indexOf("legend")&&e.indexOf("title")?t.type===oz?hT:e||cT:e}function Oz(t){return{marktype:t.type,name:t.name||void 0,role:t.role||zz(t),zindex:+t.zindex||void 0,aria:t.aria,description:t.description}}function Rz(t,e){return t&&t.signal?e.signalRef(t.signal):!1!==t}function Lz(t,e){const n=Na(t.type);n||u("Unrecognized transform type: "+wt(t.type));const r=CT(n.type.toLowerCase(),null,Uz(n,t,e));return t.signal&&e.addSignal(t.signal,e.proxy(r)),r.metadata=n.metadata||{},r}function Uz(t,e,n){const r={},i=t.params.length;for(let o=0;ojz(t,e,n)))):jz(t,r,n)}(t,e,n):"projection"===r?n.projectionRef(e[t.name]):t.array&&!LT(i)?i.map((e=>Pz(t,e,n))):Pz(t,i,n):void(t.required&&u("Missing required "+wt(e.type)+" parameter: "+wt(t.name)))}function Pz(t,e,n){const r=t.type;if(LT(e))return Hz(r)?u("Expression references can not be signals."):Yz(r)?n.fieldRef(e):Gz(r)?n.compareRef(e):n.signalRef(e.signal);{const i=t.expr||Yz(r);return i&&Iz(e)?n.exprRef(e.expr,e.as):i&&$z(e)?BT(e.field,e.as):Hz(r)?WS(e,n):Wz(r)?ST(n.getData(e).values):Yz(r)?BT(e):Gz(r)?n.compareRef(e):e}}function jz(t,e,n){const r=t.params.length;let i;for(let n=0;nt&&t.expr,$z=t=>t&&t.field,Wz=t=>"data"===t,Hz=t=>"expr"===t,Yz=t=>"field"===t,Gz=t=>"compare"===t;function Vz(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:ST(e.getData(t.data).output)}function Xz(t,e,n,r,i){this.scope=t,this.input=e,this.output=n,this.values=r,this.aggregate=i,this.index={}}function Jz(t){return pt(t)?t:null}function Zz(t,e,n){const r=zT(n.op,n.field);let i;if(e.ops){for(let t=0,n=e.as.length;tnull==t?"null":t)).join(",")+"),0)",e);s.update=l.$expr,s.params=l.$params}function tO(t,e){const n=zz(t),r=t.type===oz,i=t.from&&t.from.facet,o=t.overlap;let a,s,l,c,f,h,d,p=t.layout||n===hT||n===fT;const g=n===cT||p||i,m=function(t,e,n){let r,i,o,a,s;return t?(r=t.facet)&&(e||u("Only group marks can be faceted."),null!=r.field?a=s=Vz(r,n):(t.data?s=ST(n.getData(t.data).aggregate):(o=Lz(K({type:"aggregate",groupby:$(r.groupby)},r.aggregate),n),o.params.key=n.keyRef(r.groupby),o.params.pulse=Vz(r,n),a=s=ST(n.add(o))),i=n.keyRef(r.groupby,!0))):a=ST(n.add(KT(null,[{}]))),a||(a=Vz(t,n)),{key:i,pulse:a,parent:s}}(t.from,r,e);s=e.add(eN({key:m.key||(t.key?BT(t.key):void 0),pulse:m.pulse,clean:!r}));const y=ST(s);s=l=e.add(KT({pulse:y})),s=e.add(lN({markdef:Oz(t),interactive:Rz(t.interactive,e),clip:Tz(t.clip,e),context:{$context:!0},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:ST(s)}));const v=ST(s);s=c=e.add(nN(bT(t.encode,t.type,n,t.style,e,{mod:!1,pulse:v}))),s.params.parent=e.encode(),t.transform&&t.transform.forEach((t=>{const n=Lz(t,e),r=n.metadata;(r.generates||r.changes)&&u("Mark transforms should not generate new data."),r.nomod||(c.params.mod=!0),n.params.pulse=ST(s),e.add(s=n)})),t.sort&&(s=e.add(bN({sort:e.compareRef(t.sort),pulse:ST(s)})));const _=ST(s);(i||p)&&(p=e.add(wN({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:_})),h=ST(p));const x=e.add(QT({mark:v,pulse:h||_}));d=ST(x),r&&(g&&(a=e.operators,a.pop(),p&&a.pop()),e.pushState(_,h||d,y),i?function(t,e,n){const r=t.from.facet,i=r.name,o=Vz(r,e);let a;r.name||u("Facet must have a name: "+wt(r)),r.data||u("Facet must reference a data set: "+wt(r)),r.field?a=e.add(pN({field:e.fieldRef(r.field),pulse:o})):r.groupby?a=e.add(iN({key:e.keyRef(r.groupby),group:ST(e.proxy(n.parent)),pulse:o})):u("Facet must specify groupby or field: "+wt(r));const s=e.fork(),l=s.add(KT()),c=s.add(xN({pulse:ST(l)}));s.addData(i,new Xz(s,l,l,c)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(t).toRuntime()}}(t,e,m):g?function(t,e,n){const r=e.add(pN({pulse:n.pulse})),i=e.fork();i.add(xN()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(t).toRuntime()}}(t,e,m):e.parse(t),e.popState(),g&&(p&&a.push(p),a.push(x))),o&&(d=function(t,e,n){const r=t.method,i=t.bound,o=t.separation,a={separation:LT(o)?n.signalRef(o.signal):o,method:LT(r)?n.signalRef(r.signal):r,pulse:e};if(t.order&&(a.sort=n.compareRef({field:t.order})),i){const t=i.tolerance;a.boundTolerance=LT(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient}return ST(n.add(hN(a)))}(o,d,e));const b=e.add(vN({pulse:d})),w=e.add(xN({pulse:ST(b)},void 0,e.parent()));null!=t.name&&(f=t.name,e.addData(f,new Xz(e,l,b,w)),t.on&&t.on.forEach((t=>{(t.insert||t.remove||t.toggle)&&u("Marks only support modify triggers."),Kz(t,e,f)})))}function eO(t,e,n){const r={enter:{},update:{}};return uT(r,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType}),r}function nO(t,e,n){return e[t]?'scale("'.concat(e[t],'",datum)'):fz(t,n[0].encode)}Xz.fromEntries=function(t,e){const n=e.length,r=e[n-1],i=e[n-2];let o=e[0],a=null,u=1;for(o&&"load"===o.type&&(o=e[1]),t.add(e[0]);ut===$N||t===PN,sO=(t,e,n)=>LT(t)?pO(t.signal,e,n):t===jN||t===PN?e:n,lO=(t,e,n)=>LT(t)?hO(t.signal,e,n):uO(t)?e:n,cO=(t,e,n)=>LT(t)?dO(t.signal,e,n):uO(t)?n:e,fO=(t,e,n)=>LT(t)?gO(t.signal,e,n):t===PN?{value:e}:{value:n},hO=(t,e,n)=>yO("".concat(t," === '").concat(PN,"' || ").concat(t," === '").concat($N,"'"),e,n),dO=(t,e,n)=>yO("".concat(t," !== '").concat(PN,"' && ").concat(t," !== '").concat($N,"'"),e,n),pO=(t,e,n)=>_O("".concat(t," === '").concat(jN,"' || ").concat(t," === '").concat(PN,"'"),e,n),gO=(t,e,n)=>_O("".concat(t," === '").concat(PN,"'"),e,n),mO=(t,e,n)=>_O("".concat(t," === '").concat(IN,"'"),e,n),yO=(t,e,n)=>(e=null!=e?oT(e):e,n=null!=n?oT(n):n,vO(e)&&vO(n)?(e=e?e.signal||wt(e.value):null,n=n?n.signal||wt(n.value):null,{signal:"".concat(t," ? (").concat(e,") : (").concat(n,")")}):[K({test:t},e)].concat(n||[])),vO=t=>null==t||1===Object.keys(t).length,_O=(t,e,n)=>({signal:"".concat(t," ? (").concat(bO(e),") : (").concat(bO(n),")")}),xO=(t,e,n,r,i)=>({signal:(null!=r?"".concat(t," === '").concat(jN,"' ? (").concat(bO(r),") : "):"")+(null!=n?"".concat(t," === '").concat($N,"' ? (").concat(bO(n),") : "):"")+(null!=i?"".concat(t," === '").concat(IN,"' ? (").concat(bO(i),") : "):"")+(null!=e?"".concat(t," === '").concat(PN,"' ? (").concat(bO(e),") : "):"")+"(null)"}),bO=t=>LT(t)?t.signal:null==t?null:wt(t),wO=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function kO(t,e,n,r){let i;if(e&&rt(e,t))return e[t];if(rt(n,t))return n[t];if(t.startsWith("title")){switch(t){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=t[5].toLowerCase()+t.slice(6)}return r["guide-title"][i]}if(t.startsWith("label")){switch(t){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=t[5].toLowerCase()+t.slice(6)}return r["guide-label"][i]}return null}function AO(t){const e={};for(const n of t)if(n)for(const t in n)e[t]=1;return Object.keys(e)}function MO(t,e){return{scale:t.scale,range:e}}function EO(t,e,n,r,i){return{signal:'flush(range("'+t+'"), scale("'+t+'", datum.value), '+e+","+n+","+r+","+i+")"}}function DO(t,e){const n={enter:{},update:{}};return uT(n,{orient:t("orient"),offset:t("offset")||0,position:qT(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:'abs(span(range("'.concat(e.scale,'")))')},translate:t("translate"),format:e.format,formatType:e.formatType}),n}function CO(t,e,n){const r=$(t.signals),i=$(t.scales);return n||r.forEach((t=>ET(t,e))),$(t.projections).forEach((t=>function(t,e){const n=e.config.projection||{},r={};for(const n in t)"name"!==n&&(r[n]=qN(t[n],n,e));for(const t in n)null==r[t]&&(r[t]=qN(n[t],t,e));e.addProjection(t.name,r)}(t,e))),i.forEach((t=>function(t,e){const n=t.type||"linear";yd(n)||u("Unrecognized scale type: "+wt(n)),e.addScale(t.name,{type:n,domain:void 0})}(t,e))),$(t.data).forEach((t=>function(t,e){const n=[];t.transform&&t.transform.forEach((t=>{n.push(Lz(t,e))})),t.on&&t.on.forEach((n=>{Kz(n,e,t.name)})),e.addDataPipeline(t.name,function(t,e,n){const r=[];let i,o,a,u,s,l=null,c=!1,f=!1;for(t.values?LT(t.values)||UT(t.format)?(r.push(aO(e,t)),r.push(l=oO())):r.push(l=oO({$ingest:t.values,$format:t.format})):t.url?UT(t.url)||UT(t.format)?(r.push(aO(e,t)),r.push(l=oO())):r.push(l=oO({$request:t.url,$format:t.format})):t.source&&(l=i=$(t.source).map((t=>ST(e.getData(t).output))),r.push(null)),o=0,a=n.length;oEN(t,e))),(n||r).forEach((t=>function(t,e){const n=e.getSignal(t.name);let r=t.update;t.init&&(r?u("Signals can not include both init and update expressions."):(r=t.init,n.initonly=!0)),r&&(r=WS(r,e),n.update=r.$expr,n.params=r.$params),t.on&&t.on.forEach((t=>function(t,e,n){const r=t.encode,i={target:n};let o=t.events,a=t.update,s=[];o||u("Signal update missing events specification."),pt(o)&&(o=QB(o,e.isSubscope()?OT:RT)),o=$(o).filter((t=>t.signal||t.scale?(s.push(t),0):1)),s.length>1&&(s=[VT(s)]),o.length&&s.push(o.length>1?{merge:o}:o[0]),null!=r&&(a&&u("Signal encode and update are mutually exclusive."),a="encode(item(),"+wt(r)+")"),i.update=pt(a)?WS(a,e):null!=a.expr?WS(a.expr,e):null!=a.value?a.value:null!=a.signal?{$expr:GT,$params:{$value:e.signalRef(a.signal)}}:u("Invalid signal update specification."),t.force&&(i.options={force:!0}),s.forEach((t=>e.addUpdate(K(function(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):IT(t,e)}}(t,e),i))))}(t,e,n.id)))}(t,e))),$(t.axes).forEach((t=>function(t,e){const n=function(t,e){var n,r,i,o=e.config,a=o.style,u=o.axis,s="band"===e.scaleType(t.scale)&&o.axisBand,l=t.orient;if(LT(l)){const t=AO([o.axisX,o.axisY]),e=AO([o.axisTop,o.axisBottom,o.axisLeft,o.axisRight]);for(i of(n={},t))n[i]=lO(l,kO(i,o.axisX,u,a),kO(i,o.axisY,u,a));for(i of(r={},e))r[i]=xO(l.signal,kO(i,o.axisTop,u,a),kO(i,o.axisBottom,u,a),kO(i,o.axisLeft,u,a),kO(i,o.axisRight,u,a))}else n=l===PN||l===$N?o.axisX:o.axisY,r=o["axis"+l[0].toUpperCase()+l.slice(1)];return n||r||s?K({},u,n,r,s):u}(t,e),r=t.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,u=i.style,s=cz(t,n),l=function(t){const e=t("tickBand");let n,r,i=t("tickOffset");return e?e.signal?(n={signal:"(".concat(e.signal,") === 'extent' ? 1 : 0.5")},r={signal:"(".concat(e.signal,") === 'extent'")},_(i)||(i={signal:"(".concat(e.signal,") === 'extent' ? 0 : ").concat(i)})):"extent"===e?(n=1,r=!0,i=0):(n=.5,r=!1):(n=t("bandPosition"),r=t("tickExtra")),{extra:r,band:n,offset:i}}(s),c={scale:t.scale,ticks:!!s("ticks"),labels:!!s("labels"),grid:!!s("grid"),domain:!!s("domain"),title:null!=t.title},f=ST(e.add(KT({},[c]))),h=ST(e.add(ZT({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)}))),d=[];let p;return c.grid&&d.push(function(t,e,n,r,i){const o=cz(t,e),a=t.orient,u=t.gridScale,s=sO(a,1,-1),l=function(t,e){if(1===e);else if(_(t)){let n=t=K({},t);for(;null!=n.mult;){if(!_(n.mult))return n.mult=LT(e)?{signal:"(".concat(n.mult,") * (").concat(e.signal,")")}:n.mult*e,t;n=n.mult=K({},n.mult)}n.mult=e}else t=LT(e)?{signal:"(".concat(e.signal,") * (").concat(t||0,")")}:e*(t||0);return t}(t.offset,s);let c,f,h;const d={enter:c={opacity:rz},update:h={opacity:iz},exit:f={opacity:rz}};uT(d,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")});const p={scale:t.scale,field:VN,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")},g=lO(a,{signal:"height"},{signal:"width"}),m=u?{scale:u,range:0,mult:s,offset:l}:{value:0,offset:l},y=u?{scale:u,range:1,mult:s,offset:l}:K(g,{mult:s,offset:l});return c.x=h.x=lO(a,p,m),c.y=h.y=cO(a,p,m),c.x2=h.x2=cO(a,y),c.y2=h.y2=lO(a,y),f.x=lO(a,p),f.y=cO(a,p),gz({type:uz,role:"axis-grid",key:VN,from:r,encode:d},n)}(t,n,r.grid,h,l)),c.ticks&&(p=s("tickSize"),d.push(function(t,e,n,r,i,o){const a=cz(t,e),u=t.orient,s=sO(u,-1,1);let l,c,f;const h={enter:l={opacity:rz},update:f={opacity:iz},exit:c={opacity:rz}};uT(h,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const d=oT(i);d.mult=s;const p={scale:t.scale,field:VN,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")};return f.y=l.y=lO(u,rz,p),f.y2=l.y2=lO(u,d),c.x=lO(u,p),f.x=l.x=cO(u,rz,p),f.x2=l.x2=cO(u,d),c.y=cO(u,p),gz({type:uz,role:"axis-tick",key:VN,from:r,encode:h},n)}(t,n,r.ticks,h,p,l))),c.labels&&(p=c.ticks?p:0,d.push(function(t,e,n,r,i,o){const a=cz(t,e),u=t.orient,s=t.scale,l=sO(u,-1,1),c=PT(a("labelFlush")),f=PT(a("labelFlushOffset")),h=a("labelAlign"),d=a("labelBaseline");let p,g=0===c||!!c;const m=oT(i);m.mult=l,m.offset=oT(a("labelPadding")||0),m.offset.mult=l;const y={scale:s,field:VN,band:.5,offset:pz(o.offset,a("labelOffset"))},v=lO(u,g?EO(s,c,'"left"','"right"','"center"'):{value:"center"},((t,e,n)=>LT(t)?mO(t.signal,e,n):t===IN?{value:e}:{value:n})(u,"left","right")),_=lO(u,fO(u,"bottom","top"),g?EO(s,c,'"top"','"bottom"','"middle"'):{value:"middle"}),x=EO(s,c,"-(".concat(f,")"),f,0);g=g&&f;const b={opacity:rz,x:lO(u,y,m),y:cO(u,y,m)},w={enter:b,update:p={opacity:iz,text:{field:YN},x:b.x,y:b.y,align:v,baseline:_},exit:{opacity:rz,x:b.x,y:b.y}};uT(w,{dx:!h&&g?lO(u,x):null,dy:!d&&g?cO(u,x):null}),uT(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:h,baseline:d});const k=a("labelBound");let A=a("labelOverlap");return A=A||k?{separation:a("labelSeparation"),method:A,order:"datum.index",bound:k?{scale:s,orient:u,tolerance:k}:null}:void 0,p.align!==v&&(p.align=wO(p.align,v)),p.baseline!==_&&(p.baseline=wO(p.baseline,_)),gz({type:sz,role:"axis-label",style:XN,key:VN,from:r,encode:w,overlap:A},n)}(t,n,r.labels,h,p,l))),c.domain&&d.push(function(t,e,n,r){const i=cz(t,e),o=t.orient;let a,u;const s={enter:a={opacity:rz},update:u={opacity:iz},exit:{opacity:rz}};uT(s,{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});const l=MO(t,0),c=MO(t,1);return a.x=u.x=lO(o,l,rz),a.x2=u.x2=lO(o,c),a.y=u.y=cO(o,l,rz),a.y2=u.y2=cO(o,c),gz({type:uz,role:"axis-domain",from:r,encode:s},n)}(t,n,r.domain,f)),c.title&&d.push(function(t,e,n,r){const i=cz(t,e),o=t.orient,a=sO(o,-1,1);let u,s;const l={enter:u={opacity:rz,anchor:oT(i("titleAnchor",null)),align:{signal:dz}},update:s=K({},u,{opacity:iz,text:oT(t.title)}),exit:{opacity:rz}},c={signal:'lerp(range("'.concat(t.scale,'"), ').concat(hz(0,1,.5),")")};return s.x=lO(o,c),s.y=cO(o,c),u.angle=lO(o,rz,((t,e)=>LT(t)?{signal:"(".concat(t.signal,") * ").concat(90)}:{value:90*t})(a)),u.baseline=lO(o,fO(o,$N,PN),{value:$N}),s.angle=u.angle,s.baseline=u.baseline,uT(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function(t,e,n,r){const i=(t,e)=>null!=t?(n.update[e]=wO(oT(t),n.update[e]),!1):!lT(e,r),o=i(t("titleX"),"x"),a=i(t("titleY"),"y");n.enter.auto=a===o?oT(a):lO(e,oT(a),oT(o))}(i,o,l,n),l.update.align=wO(l.update.align,u.align),l.update.angle=wO(l.update.angle,u.angle),l.update.baseline=wO(l.update.baseline,u.baseline),gz({type:sz,role:"axis-title",style:JN,from:r,encode:l},n)}(t,n,r.title,f)),tO(lz({role:"axis",from:f,encode:sT(DO(s,t),i,nz),marks:d,aria:s("aria"),description:s("description"),zindex:s("zindex"),name:o,interactive:a,style:u}),e)}(t,e))),$(t.marks).forEach((t=>tO(t,e))),$(t.legends).forEach((t=>function(t,e){const n=e.config.legend,r=t.encode||{},i=cz(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,l=o.style,c={};let f,h,d,p=0;ez.forEach((e=>t[e]?(c[e]=t[e],p=p||t[e]):0)),p||u("Missing valid scale for legend.");const g=function(t,e){let n=t.type||ZN;return t.type||1!==function(t){return ez.reduce(((e,n)=>e+(t[n]?1:0)),0)}(t)||!t.fill&&!t.stroke||(n=_d(e)?QN:bd(e)?KN:ZN),n!==QN?n:bd(e)?KN:QN}(t,e.scaleType(p)),m={title:null!=t.title,scales:c,type:g,vgrad:"symbol"!==g&&i.isVertical()},y=ST(e.add(KT(null,[m]))),v=ST(e.add(uN(h={type:g,scale:e.scaleRef(p),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return g===QN?(d=[mz(t,p,n,r.gradient),xz(t,n,r.labels,v)],h.count=h.count||e.signalRef("max(2,2*floor((".concat(PT(i.gradientLength()),")/100))"))):g===KN?d=[yz(t,p,n,r.gradient,v),xz(t,n,r.labels,v)]:(f=function(t,e){const n=cz(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[bz(t,n,r,v,PT(f.columns))],h.size=function(t,e,n){const r=PT(nO("size",t,n)),i=PT(nO("strokeWidth",t,n)),o=PT(function(t,e,n){return fz("fontSize",t)||function(t,e,n){const r=e.config.style[n];return r&&r.fontSize}(0,e,n)}(n[1].encode,e,XN));return WS("max(ceil(sqrt(".concat(r,")+").concat(i,"),").concat(o,")"),e)}(t,e,d[0].marks)),d=[lz({role:"legend-entry",from:y,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:f,interactive:s})],m.title&&d.push(function(t,e,n,r){const i=cz(t,e),o={enter:{opacity:rz},update:{opacity:iz,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:rz}};return uT(o,{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Fz},angle:{signal:Sz},align:{signal:Cz},baseline:{signal:Bz},text:t.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),gz({type:sz,role:"legend-title",style:JN,from:r,encode:o},n)}(t,n,r.title,y)),tO(lz({role:"legend",from:y,encode:sT(eO(i,t,n),o,nz),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:l}),e)}(t,e))),t.title&&function(t,e){const n=cz(t=pt(t)?{text:t}:t,e.config.title),r=t.encode||{},i=r.group||{},o=i.name||void 0,a=i.interactive,u=i.style,s=[],l=ST(e.add(KT(null,[{}])));s.push(function(t,e,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return uT(o,{text:t.text,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),gz({type:sz,role:"title-text",style:"group-title",from:r,encode:o},n)}(t,n,function(t){const e=t.encode;return e&&e.title||K({name:t.name,interactive:t.interactive,style:t.style},e)}(t),l)),t.subtitle&&s.push(function(t,e,n,r){const i={value:0},o={enter:{opacity:i},update:{opacity:{value:1}},exit:{opacity:i}};return uT(o,{text:t.subtitle,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")}),gz({type:sz,role:"title-subtitle",style:"group-subtitle",from:r,encode:o},n)}(t,n,r.subtitle,l)),tO(lz({role:"title",from:l,encode:iO(n,i),marks:s,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:o,interactive:a,style:u}),e)}(t.title,e),e.parseLambdas(),e}function FO(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function SO(t,e){this.config=t||{},this.options=e||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function BO(t){this.config=t.config,this.options=t.options,this.legends=t.legends,this.field=Object.create(t.field),this.signals=Object.create(t.signals),this.lambdas=Object.create(t.lambdas),this.scales=Object.create(t.scales),this.events=Object.create(t.events),this.data=Object.create(t.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++t._nextsub[0],this._nextsub=t._nextsub,this._parent=t._parent.slice(),this._encode=t._encode.slice(),this._lookup=t._lookup.slice(),this._markpath=t._markpath}function TO(t){return(v(t)?NO:zO)(t)}function NO(t){const e=t.length;let n="[";for(let r=0;r0?",":"")+(_(e)?e.signal||TO(e):wt(e))}return n+"]"}function zO(t){let e,n,r="{",i=0;for(e in t)n=t[e],r+=(++i>1?",":"")+wt(e)+":"+(_(n)?n.signal||TO(n):wt(n));return r+"}"}SO.prototype=BO.prototype={parse(t){return CO(t,this)},fork(){return new BO(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){return this.operators.push(t),t.id=this.id(),t.refs&&(t.refs.forEach((e=>{e.$ref=t.id})),t.refs=null),t},proxy(t){const e=t instanceof DT?ST(t):t;return this.add(mN({value:e}))},addStream(t){return this.streams.push(t),t.id=this.id(),t},addUpdate(t){return this.updates.push(t),t},finish(){let t,e;for(t in this.root&&(this.root.root=!0),this.signals)this.signals[t].signal=t;for(t in this.scales)this.scales[t].scale=t;function n(t,e,n){let r,i;t&&(r=t.data||(t.data={}),i=r[e]||(r[e]=[]),i.push(n))}for(t in this.data){e=this.data[t],n(e.input,t,"input"),n(e.output,t,"output"),n(e.values,t,"values");for(const r in e.index)n(e.index[r],t,"index:"+r)}return this},pushState(t,e,n){this._encode.push(ST(this.add(xN({pulse:t})))),this._parent.push(e),this._lookup.push(n?ST(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return A(this._parent)},encode(){return A(this._encode)},lookup(){return A(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if(pt(t))return BT(t,e);t.signal||u("Unsupported field reference: "+wt(t));const n=t.signal;let r=this.field[n];if(!r){const t={name:this.signalRef(n)};e&&(t.as=e),this.field[n]=r=ST(this.add(oN(t)))}return r},compareRef(t){let e=!1;const n=t=>LT(t)?(e=!0,this.signalRef(t.signal)):function(t){return t&&t.expr}(t)?(e=!0,this.exprRef(t.expr)):t,r=$(t.field).map(n),i=$(t.order).map(n);return e?ST(this.add(tN({fields:r,orders:i}))):NT(r,i)},keyRef(t,e){let n=!1;const r=this.signals;return t=$(t).map((t=>LT(t)?(n=!0,ST(r[t.signal])):t)),n?ST(this.add(aN({fields:t,flat:e}))):function(t,e){const n={$key:t};return e&&(n.$flat=!0),n}(t,e)},sortRef(t){if(!t)return t;const e=zT(t.op,t.field),n=t.order||"ascending";return n.signal?ST(this.add(tN({fields:e,orders:this.signalRef(n.signal)}))):NT(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const r=this.id();this.streams.push({id:r,source:t,type:e}),this.events[n]=r}return this.events[n]},hasOwnSignal(t){return rt(this.signals,t)},addSignal(t,e){this.hasOwnSignal(t)&&u("Duplicate signal name: "+wt(t));const n=e instanceof DT?e:this.add(FT(e));return this.signals[t]=n},getSignal(t){return this.signals[t]||u("Unrecognized signal name: "+wt(t)),this.signals[t]},signalRef(t){return this.signals[t]?ST(this.signals[t]):(rt(this.lambdas,t)||(this.lambdas[t]=this.add(FT(null))),ST(this.lambdas[t]))},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;eqT(t[n],e[n]),r=[FO("background",n("background")),FO("autosize",nT(n("autosize"))),FO("padding",iT(n("padding"))),FO("width",n("width")||0),FO("height",n("height")||0)],i=r.reduce(((t,e)=>(t[e.name]=e,t)),{}),o={};return $(t.signals).forEach((t=>{rt(i,t.name)?t=K(i[t.name],t):r.push(t),o[t.name]=t})),$(e.signals).forEach((t=>{rt(o,t.name)||rt(i,t.name)||r.push(t)})),r}(t,n);i.forEach((t=>ET(t,e))),e.description=t.description||n.description,e.eventConfig=n.events,e.legends=e.objectProperty(n.legend&&n.legend.layout),e.locale=n.locale;const o=e.add(KT()),a=e.add(nN(bT((t=>sT({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t))(t.encode),oz,fT,t.style,e,{pulse:ST(o)}))),u=e.add(wN({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:r,pulse:ST(a)}));e.operators.pop(),e.pushState(ST(a),ST(u),null),CO(t,e,i),e.operators.push(u);let s=e.add(QT({mark:r,pulse:ST(u)}));return s=e.add(vN({pulse:ST(s)})),s=e.add(xN({pulse:ST(s)})),e.addData("root",new Xz(e,o,o,s)),e}(t,new SO(e=b(function(){const t="sans-serif",e="#4c78a8",n="#000",r="#888",i="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:e},area:{fill:e},image:null,line:{stroke:e,strokeWidth:2},path:{stroke:e},rect:{fill:e},rule:{stroke:n},shape:{stroke:e},symbol:{fill:e,size:64},text:{fill:n,font:t,fontSize:11},trail:{fill:e,size:2},style:{"guide-label":{fill:n,font:t,fontSize:10},"guide-title":{fill:n,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:n,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:n,font:t,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:i}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:r,grid:!1,gridWidth:1,gridColor:i,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:r,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:i,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:r,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}(),e,t.config),n)).toRuntime()},t.parseExpression=YF,t.parseSelector=QB,t.path=nl,t.pathCurves=up,t.pathEqual=Ov,t.pathParse=dp,t.pathRectangle=Lp,t.pathRender=Ap,t.pathSymbols=Cp,t.pathTrail=Up,t.peek=A,t.point=dy,t.projection=DA,t.quantileLogNormal=tu,t.quantileNormal=Va,t.quantileUniform=au,t.quantiles=Ra,t.quantizeInterpolator=Cd,t.quarter=j,t.quartiles=La,t.randomInteger=function(e,n){let r,i,o;null==n&&(n=e,e=0);const a={min(t){return arguments.length?(r=t||0,o=i-r,a):r},max(t){return arguments.length?(i=t||0,o=i-r,a):i},sample:()=>r+Math.floor(o*t.random()),pdf:t=>t===Math.floor(t)&&t>=r&&t=i?1:(e-r+1)/o},icdf:t=>t>=0&&t<=1?r-1+Math.floor(t*o):NaN};return a.min(e).max(n)},t.randomKDE=Ja,t.randomLCG=function(t){return function(){return(t=(1103515245*t+12345)%2147483647)/2147483647}},t.randomLogNormal=eu,t.randomMixture=nu,t.randomNormal=Xa,t.randomUniform=uu,t.read=Yo,t.regressionExp=pu,t.regressionLinear=hu,t.regressionLoess=_u,t.regressionLog=du,t.regressionPoly=yu,t.regressionPow=gu,t.regressionQuad=mu,t.renderModule=Dv,t.repeat=_t,t.resetDefaultLocale=function(){return fo(),yo(),wo()},t.resetSVGClipId=Kp,t.resetSVGDefIds=function(){Kp(),tp=0},t.responseType=Ho,t.runtimeContext=KS,t.sampleCurve=ku,t.sampleLogNormal=Za,t.sampleNormal=Ha,t.sampleUniform=ru,t.scale=md,t.sceneEqual=zv,t.sceneFromJSON=iy,t.scenePickVisit=Gg,t.sceneToJSON=ry,t.sceneVisit=Yg,t.sceneZOrder=Hg,t.scheme=zd,t.serializeXML=rv,t.setRandom=function(e){t.random=e},t.span=bt,t.splitAccessPath=s,t.stringValue=wt,t.textMetrics=Tm,t.timeBin=zr,t.timeFloor=fr,t.timeFormatLocale=_o,t.timeInterval=yr,t.timeOffset=xr,t.timeSequence=kr,t.timeUnitSpecifier=Yn,t.timeUnits=Wn,t.toBoolean=kt,t.toDate=Mt,t.toNumber=M,t.toSet=Dt,t.toString=Et,t.transform=za,t.transforms=Ta,t.truncate=Ct,t.truthy=p,t.tupleid=Ko,t.typeParsers=No,t.utcFloor=pr,t.utcInterval=vr,t.utcOffset=br,t.utcSequence=Ar,t.utcdayofyear=er,t.utcquarter=I,t.utcweek=nr,t.version="5.22.1",t.visitArray=Ft,t.week=Jn,t.writeConfig=w,t.zero=h,t.zoomLinear=L,t.zoomLog=U,t.zoomPow=q,t.zoomSymlog=P,Object.defineProperty(t,"__esModule",{value:!0})})); \ No newline at end of file diff --git a/dist/synoptic/config_viewers_default.js b/dist/synoptic/config_viewers_default.js deleted file mode 100644 index 80fa081..0000000 --- a/dist/synoptic/config_viewers_default.js +++ /dev/null @@ -1 +0,0 @@ -var PBIColorTable=["#00B8F1","#DE3A15","#FF9A00","#3ACB35","#BBA8E8","#DD6952","#7FD5DB","#60AF89","#91A9D0","#C7F073","#5E69D8","#BD8E29"],PBIColorBackground="#FFFFFF",PBIColorForeground="#D6862D",PBIColorBad="red",PBIColorGood="green",PBIColorMaximum="red",PBIColorMinimum="green",ScreenViewer_SVGMaxWidth=3840,ScreenViewer_SVGMaxHeight=2160,ScreenViewer_Background="#DDDDDD",ScreenViewer_BackgroundSVG="black",ScreenViewer_ToolbarColor="none",ScreenViewer_BarBreakerSwColor="steelblue",ScreenViewer_ColorTable=new Array;ScreenViewer_ColorTable[0]="white",ScreenViewer_ColorTable[1]="white",ScreenViewer_ColorTable[2]="white",ScreenViewer_ColorTable[3]=ScreenViewer_Background,ScreenViewer_ColorTable[4]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[5]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[6]="cornsilk",ScreenViewer_ColorTable[7]="cornsilk",ScreenViewer_ColorTable[8]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[9]="#AAAAAA",ScreenViewer_ColorTable[10]="cadetblue",ScreenViewer_ColorTable[11]="red",ScreenViewer_ColorTable[12]="white",ScreenViewer_ColorTable[13]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[14]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[15]="#777777",ScreenViewer_ColorTable[16]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[17]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[18]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[19]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[20]="cadetblue",ScreenViewer_ColorTable[21]="cadetblue",ScreenViewer_ColorTable[22]="cadetblue",ScreenViewer_ColorTable[23]="cadetblue",ScreenViewer_ColorTable[24]="cadetblue",ScreenViewer_ColorTable[25]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[26]="gray",ScreenViewer_ColorTable[27]="gray",ScreenViewer_ColorTable[28]="darkgreen",ScreenViewer_ColorTable[29]="darkred",ScreenViewer_ColorTable[30]="red",ScreenViewer_ColorTable[31]="lightgray",ScreenViewer_ColorTable[32]="black",ScreenViewer_ColorTable[33]="#D7D7D7",ScreenViewer_ColorTable[34]="gray",ScreenViewer_ColorTable[35]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[36]="mediumvioletred",ScreenViewer_ColorTable[37]="red",ScreenViewer_ColorTable[38]="#999999",ScreenViewer_ColorTable[39]="#DDE8DD",ScreenViewer_ColorTable[40]="yellow",ScreenViewer_ColorTable[41]="deepskyblue",ScreenViewer_ColorTable[42]="red",ScreenViewer_ColorTable[43]="cadetblue",ScreenViewer_ColorTable[44]="red",ScreenViewer_ColorTable[45]="yellow",ScreenViewer_ColorTable[46]="orange",ScreenViewer_ColorTable[47]="fucsia",ScreenViewer_ColorTable[48]="#CCCCCC",ScreenViewer_ColorTable[49]="#CCCCCC",ScreenViewer_ColorTable[50]="#505050",ScreenViewer_ColorTable[51]="lightsteelblue",ScreenViewer_ColorTable[52]="tan",ScreenViewer_ColorTable[53]="#888888",ScreenViewer_ColorTable[54]="red",ScreenViewer_ColorTable[55]="lightsteelblue",ScreenViewer_ColorTable[56]="#777777",ScreenViewer_ColorTable[57]=ScreenViewer_BarBreakerSwColor,ScreenViewer_ColorTable[58]="crimson",ScreenViewer_ColorTable[59]="#CCCCCC"; \ No newline at end of file diff --git a/dist/synoptic/getjsondata.js b/dist/synoptic/getjsondata.js deleted file mode 100644 index e9ffefc..0000000 --- a/dist/synoptic/getjsondata.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";WebSAGE.getJSONData=function(){$.ajax({url:"jsondatasimul.php?KEYS="+WebSAGE.lstpnt+"&RAND="+Math.random(),dataType:"text",success:WebSAGE.getJSONData_onSuccess,headers:{"Content-Type":"application/json"}})},WebSAGE.getJSONData_onSuccess=function(e){let t,a,l,r,o,n,p,i,s,u,S,g,y,m,b,A,c,E,d,G,w,h;if("string"==typeof e?h=JSON.parse(e):"object"==typeof e&&(h=e),h.hasOwnProperty("data")&&(h=h.data),h.hasOwnProperty("tags"))for(t=0;t - - - - - - - - - - - image/svg+xml - - - - - - - diff --git a/dist/synoptic/images/scadavis.svg b/dist/synoptic/images/scadavis.svg deleted file mode 100644 index 3f7487a..0000000 --- a/dist/synoptic/images/scadavis.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - diff --git a/dist/synoptic/images/zoom-in.svg b/dist/synoptic/images/zoom-in.svg deleted file mode 100644 index 97fce59..0000000 --- a/dist/synoptic/images/zoom-in.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - -image/svg+xml - - - - - - \ No newline at end of file diff --git a/dist/synoptic/images/zoom-out.svg b/dist/synoptic/images/zoom-out.svg deleted file mode 100644 index 84d3bb6..0000000 --- a/dist/synoptic/images/zoom-out.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - -image/svg+xml - - - - - - \ No newline at end of file diff --git a/dist/synoptic/legacy_options.js b/dist/synoptic/legacy_options.js deleted file mode 100644 index c9bf186..0000000 --- a/dist/synoptic/legacy_options.js +++ /dev/null @@ -1 +0,0 @@ -var VisorTelas_DJ_Normal_Aberto_Borda="stroke:rgb(0%,85%,0%);stroke-width:2;stroke-opacity:1;",VisorTelas_DJ_Normal_Aberto_Preen="fill-opacity:0.1;",VisorTelas_DJ_Normal_Fechado_Borda="stroke:red;",VisorTelas_DJ_Normal_Fechado_Preen="fill:red;",VisorTelas_DJ_Falha_Aberto_Borda="stroke:rgb(80%,80%,80%);stroke-width:2;stroke-opacity:1;",VisorTelas_DJ_Falha_Aberto_Preen="fill-opacity:0.5;",VisorTelas_DJ_Falha_Fechado_Borda="",VisorTelas_DJ_Falha_Fechado_Preen="fill:rgb(80%,80%,80%);",VisorTelas_DJ_Manual_Aberto_Borda="stroke:rgb(60%,0%,71%);stroke-width:2;stroke-opacity:1;",VisorTelas_DJ_Manual_Aberto_Preen="fill-opacity:0.5;",VisorTelas_DJ_Manual_Fechado_Borda="",VisorTelas_DJ_Manual_Fechado_Preen="fill:rgb(60%,0%,71%);",VisorTelas_SC_Aberta="stroke-width:4;stroke:rgb(0%,85%,0%);",VisorTelas_SC_Fechada="stroke-width:4;stroke:red;",VisorTelas_SC_Falha="stroke-width:4;stroke:rgb(80%,80%,80%);",VisorTelas_SC_Manual="stroke-width:4;stroke:rgb(60%,0%,71%);",VisorTelas_Medidas_Cor_Falha="rgb(80%,80%,80%)",VisorTelas_CorAlarmeInibido="yellow",VisorTelas_BackgroundSVG="black"; \ No newline at end of file diff --git a/dist/synoptic/synoptic.html b/dist/synoptic/synoptic.html deleted file mode 100644 index f12ed9f..0000000 --- a/dist/synoptic/synoptic.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - - - - - - - - - SCADAvis.io Visualization Component - - - - - - - - - - - - - - - - - - - -
-
- - down - left - up - right - center - - - - - - - - - - -
- -
- -
-
- SCADAvis.io™ -
-
-
- -
- -
- -
-   -
-
- - -
- SCADAvis.io™ -
- - - diff --git a/dist/synoptic/vega_websage.js b/dist/synoptic/vega_websage.js deleted file mode 100644 index be3e72e..0000000 --- a/dist/synoptic/vega_websage.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";WebSAGE.g_vega_num=0,WebSAGE.SetIniExtended=function(e,t,a){var n;function i(e){void 0!==e.data[0].name?a.vgTableName[0]=e.data[0].name:a.vgTableName[0]="table";var t,n=vega.parse(e);WebSAGE.g_vega_num++,a.vgId="vega_"+WebSAGE.g_vega_num,$("#VEGACHARTS").append("
"),a.vw=new vega.View(n,{renderer:"svg"}).initialize().run(),a.vw.runAfter((function(){a.vw.toSVG().then((function(e){void 0!==a.vgFormat&&void 0!==a.vw._model&&(a.vw._model._defs.data[0].format=a.vgFormat);var n="layer1",i=SVGDoc.getElementById("base");i&&(n=i.attributes["inkscape:current-layer"].value),(t=d3.select(SVGDoc)).select("#vg_"+a.id).remove(),"g"==a.parentNode.nodeName?a.vg=t.select("#"+a.parentNode.id).append("g").html(e):a.vg=t.select("#"+n).append("g").html(e),a.vg._groups[0][0].id="vg_"+a.id,a.vg._groups[0][0].setAttributeNS(null,"transform",(a.getAttributeNS(null,"transform")||"")+" translate("+a.getAttributeNS(null,"x")+" "+a.getAttributeNS(null,"y")+") scale("+a.getAttributeNS(null,"width")/(a.vw._width||100)+" "+a.getAttributeNS(null,"height")/(a.vw._height||100)+") "),a.inittransform=a.vg._groups[0][0].getAttributeNS(null,"transform"),a.vgInitData=JSON.parse(JSON.stringify(a.vw._runtime.data[a.vgTableName[0]].values.value))}))}))}switch(e[t].tag){case"#arc":WebSAGE.addPointToList(e[t].src),a._d3arc_tag=e[t].src;var r=e[t].prompt.split(",");a._d3arc_min=parseFloat(r[0]||0),a._d3arc_max=parseFloat(r[1]||100),a._d3arc_innerRadius=parseFloat(r[2]||0),a._d3arc_duration=parseFloat(r[3]||750);var S=d3.arc().innerRadius(a._d3arc_innerRadius).outerRadius(100).startAngle(0).endAngle(0),s=window.d3.select(a.parentNode).append("path").style("fill","red").attr("d",S);a._d3arc=s,a._d3arc.datum({oldAngle:0}),s._groups[0][0].style.cssText=a.style.cssText;var g=a.getBBox();s._groups[0][0].setAttributeNS(null,"transform",a.getAttributeNS(null,"transform")||" translate( "+(g.x+g.width/2)+","+(g.y+g.height/2)+" ) scale( "+g.width/200+","+g.height/200+" ) "),a.style.display="none";break;case"#vega-lite":{for(a.vgTableName=[],a.style.display="none",a.pnts=e[t].src.split(","),n=0;n1){var l=p[1].split(",");0==l.length?a.timespan=a.width.baseVal.value:a.timespan=l[0]}else a.timespan=a.width.baseVal.value;for(a.pnts=p[0].split(","),n=0;n0&&void 0!==t.data[0].url&&void 0!==t.data[0].update_period&&setInterval((function(){$.get(t.data[0].url,(function(e){"string"==typeof e?a.vw.change(t.data[0].name,vega.changeset().remove((function(e){return!0})).insert(JSON.parse(e))).run():a.vw.change(t.data[0].name,vega.changeset().remove((function(e){return!0})).insert(e)).run(),a.vw.runAfter((function(){a.vw.toSVG().then((function(e){a.vg.html(e)}))}))}))}),1e3*t.data[0].update_period),t.data.length>1&&void 0!==t.data[1].url&&void 0!==t.data[1].update_period&&setInterval((function(){$.get(t.data[1].url,(function(e){"string"==typeof e?a.vw.change(t.data[1].name,vega.changeset().remove((function(e){return!0})).insert(JSON.parse(e))).run():a.vw.change(t.data[1].name,vega.changeset().remove((function(e){return!0})).insert(e)).run(),a.vw.runAfter((function(){a.vw.toSVG().then((function(e){a.vg.html(e)}))}))}))}),1e3*t.data[1].update_period)}a.vgTableName=[],a.style.display="none",0==e[t].prompt.indexOf("{")?b(e[t].prompt):$.get(e[t].prompt+"?"+(new Date).getTime(),b)}}},WebSAGE.SetExeExtended=function(e){var t,a,n;switch(WebSAGE.InkSage[e].tag){case"#arc":var i=(WebSAGE.valueResolveCoded(WebSAGE.InkSage[e].parent._d3arc_tag,WebSAGE.InkSage[e].parent)-WebSAGE.InkSage[e].parent._d3arc_min)/(WebSAGE.InkSage[e].parent._d3arc_max-WebSAGE.InkSage[e].parent._d3arc_min),r=d3.arc().innerRadius(WebSAGE.InkSage[e].parent._d3arc_innerRadius).outerRadius(100).startAngle(0);WebSAGE.InkSage[e].parent._d3arc.transition().duration(WebSAGE.InkSage[e].parent._d3arc_duration).attrTween("d",(n=2*i*Math.PI,function(e){var t=d3.interpolate(e.oldAngle,n);return function(a){return e.endAngle=t(a),r(e)}})).on("end",(function(){WebSAGE.InkSage[e].parent._d3arc.datum({oldAngle:2*i*Math.PI})}));break;case"#vega":void 0!==WebSAGE.InkSage[e].parent.vw&&void 0!==WebSAGE.InkSage[e].parent.vgInitData&&""!=WebSAGE.InkSage[e].parent.vgInitData&&(WebSAGE.InkSage[e].parent.vw.data(WebSAGE.InkSage[e].parent.vgTableName[0]).remove((function(e){return!0})),a=JSON.parse(JSON.stringify(WebSAGE.InkSage[e].parent.vgInitData)));var S=new Date,s=0;WebSAGE.InkSage[e].parent.hasOwnProperty("vgInitData")&&$.each(WebSAGE.InkSage[e].parent.vgInitData,(function(n,i){$.each(i,(function(i,r){try{if("string"==typeof r){if(r.indexOf("HIS#")>=0){s++;var g=WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1];if(1===s&&(a=[]),WebSAGE.InkSage[e].hasOwnProperty("valores")&&void 0!==WebSAGE.InkSage[e].valores[g]){for(t=0;t=0;p--)(S.getTime()-WebSAGE.InkSage[e].datas[g][p])/1e3>60*WebSAGE.InkSage[e].parent.timespan&&(WebSAGE.InkSage[e].valores[g].splice(p,1),WebSAGE.InkSage[e].datas[g].splice(p,1))}else{var l=(new Date).getTime()-60*WebSAGE.InkSage[e].parent.timespan*1e3;if(WebSAGE.InkSage[e].parent.hasOwnProperty("histCalls")||(WebSAGE.InkSage[e].parent.histCalls=[]),!WebSAGE.InkSage[e].parent.histCalls.hasOwnProperty(g)){var o='$.getScript( WebSAGE.g_timePntServer + "?P='+g+"&U="+l/1e3+"&F=S&B=histdata("+e+","+g+');histdata" );';WebSAGE.g_timeshift=WebSAGE.g_timeshift+2e3,setTimeout(o,WebSAGE.g_timeshift),WebSAGE.InkSage[e].parent.histCalls[g]=!0}}}if(r.indexOf("PNT#")>=0)WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&"????"!==(d=WebSAGE.valueResolveCoded(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1],WebSAGE.InkSage[e].parent))?a[n][i]=d:a.splice(-1,1);else if(r.indexOf("TAG#")>=0){var d;WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1?"????"!==(d=WebSAGE.valueResolveCoded(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1],WebSAGE.InkSage[e].parent))&&(a[n][i]=WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1]):a.splice(-1,1)}else r.indexOf("FLG#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getFlags(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("FLR#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=128&WebSAGE.getFlags(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])?1:0):r.indexOf("LMI#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getInfLim(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("LMS#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getSupLim(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("DCR#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getDescription(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("BAY#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getBay(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("SUB#")>=0&&WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getSubstation(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1]))}}catch(e){}}))})),void 0!==WebSAGE.InkSage[e].parent.vw&&(WebSAGE.InkSage[e].parent.vw.data(WebSAGE.InkSage[e].parent.vgTableName[0]).insert(a),WebSAGE.InkSage[e].parent.vw.update(),WebSAGE.InkSage[e].parent.vg.html($("#"+WebSAGE.InkSage[e].parent.vgId+" .vega")[0].childNodes[0].childNodes[0].innerHTML));break;case"#vega-lite":case"#vega3":case"#vega4":void 0!==WebSAGE.InkSage[e].parent.vw&&void 0!==WebSAGE.InkSage[e].parent.vgInitData&&""!=WebSAGE.InkSage[e].parent.vgInitData&&(a=JSON.parse(JSON.stringify(WebSAGE.InkSage[e].parent.vgInitData))),S=new Date,s=0,WebSAGE.InkSage[e].parent.hasOwnProperty("vgInitData")&&$.each(WebSAGE.InkSage[e].parent.vgInitData,(function(n,i){$.each(i,(function(i,r){try{if("string"==typeof r){if(r.indexOf("HIS#")>=0){s++;var g=WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1];if(1===s&&(a=[]),WebSAGE.InkSage[e].hasOwnProperty("valores")&&void 0!==WebSAGE.InkSage[e].valores[g]){for(t=0;t=0;p--){var l=(S.getTime()-WebSAGE.InkSage[e].datas[g][p])/1e3;WebSAGE.InkSage[e].parent.timespan>0?l>60*WebSAGE.InkSage[e].parent.timespan&&(WebSAGE.InkSage[e].valores[g].splice(p,1),WebSAGE.InkSage[e].datas[g].splice(p,1)):WebSAGE.InkSage[e].datas[g][p]>WebSAGE.InkSage[e].parent.datafim&&(WebSAGE.InkSage[e].valores.forEach((function(e,t,a){a[t]=[]})),WebSAGE.InkSage[e].datas.forEach((function(e,t,a){a[t]=[]})),WebSAGE.InkSage[e].parent.dataini=(new Date).getTime()-(new Date).getTime()%(1e3*Math.abs(60*WebSAGE.InkSage[e].parent.timespan))+60*(new Date).getTimezoneOffset()*1e3%(1e3*Math.abs(60*WebSAGE.InkSage[e].parent.timespan)),WebSAGE.InkSage[e].parent.datafim=WebSAGE.InkSage[e].parent.dataini+Math.abs(60*WebSAGE.InkSage[e].parent.timespan*1e3))}}else{WebSAGE.InkSage[e].parent.timespan<0&&(WebSAGE.InkSage[e].parent.dataini=(new Date).getTime()-(new Date).getTime()%(1e3*Math.abs(60*WebSAGE.InkSage[e].parent.timespan))+60*(new Date).getTimezoneOffset()*1e3%(1e3*Math.abs(60*WebSAGE.InkSage[e].parent.timespan)),WebSAGE.InkSage[e].parent.datafim=WebSAGE.InkSage[e].parent.dataini+Math.abs(60*WebSAGE.InkSage[e].parent.timespan*1e3));var o=WebSAGE.InkSage[e].parent.dataini;if(WebSAGE.InkSage[e].parent.hasOwnProperty("histCalls")||(WebSAGE.InkSage[e].parent.histCalls=[]),!WebSAGE.InkSage[e].parent.histCalls.hasOwnProperty(g)){var d='$.getScript( WebSAGE.g_timePntServer + "?P='+g+"&U="+o/1e3+"&F=S&B=histdata("+e+","+g+');histdata" );';WebSAGE.g_timeshift=WebSAGE.g_timeshift+2e3,setTimeout(d,WebSAGE.g_timeshift),WebSAGE.InkSage[e].parent.histCalls[g]=!0}}}if(r.indexOf("PNT#")>=0)WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&"????"!==(b=WebSAGE.valueResolveCoded(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1],WebSAGE.InkSage[e].parent))?a[n][i]=b:a.splice(-1,1);else if(r.indexOf("TAG#")>=0){var b;WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1?"????"!==(b=WebSAGE.valueResolveCoded(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1],WebSAGE.InkSage[e].parent))&&(a[n][i]=WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1]):a.splice(-1,1)}else r.indexOf("FLG#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getFlags(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("FLR#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=128&WebSAGE.getFlags(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])?1:0):r.indexOf("LMI#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getInfLim(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("LMS#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getSupLim(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("DCR#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getDescription(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("BAY#")>=0?WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getBay(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1])):r.indexOf("SUB#")>=0&&WebSAGE.InkSage[e].parent.pnts.length>r.split("#")[1]-1&&(a[n][i]=WebSAGE.getSubstation(WebSAGE.InkSage[e].parent.pnts[r.split("#")[1]-1]))}}catch(e){}}))})),void 0!==WebSAGE.InkSage[e].parent.vw&&(WebSAGE.InkSage[e].parent.vw.change(WebSAGE.InkSage[e].parent.vgTableName[0],vega.changeset().remove((function(e){return!0})).insert(a)).run(),WebSAGE.InkSage[e].parent.vw.runAfter((function(){WebSAGE.InkSage[e].parent.vw.toSVG().then((function(t){WebSAGE.InkSage[e].parent.vg.html(t)}))})))}},WebSAGE.alternate=function(e,t,a){WebSAGE.idalt1=t,WebSAGE.idalt2=a,window.setTimeout((function(e){window.WebSAGE.flipOut(e)}),500,a),window.setInterval((function e(t,a){var n=e.ida||t;e.ida=e.idb||a,e.idb=n,window.WebSAGE.flipOut(e.idb),window.WebSAGE.flipIn(e.ida)}),e,t,a)},WebSAGE.flipOut=function(e){var t=window.SVGDoc.getElementById(e);null!==t&&(void 0===t.inittransform&&(null===t.getAttributeNS(null,"transform")?t.inittransform="":t.inittransform=t.getAttributeNS(null,"transform")),window.d3.select(t).transition().duration(1250).attr("transform","translate( "+t.getBBox().x+",0) "+t.inittransform+" scale(0, 1)"))},WebSAGE.flipIn=function(e){var t=window.SVGDoc.getElementById(e);null!==t&&(void 0===t.inittransform&&(null===t.getAttributeNS(null,"transform")?t.inittransform="":t.inittransform=t.getAttributeNS(null,"transform")),window.d3.select(t).transition().duration(1250).attr("transform",t.inittransform+" scale(1, 1)"))}; \ No newline at end of file diff --git a/dist/synoptic/websage.js b/dist/synoptic/websage.js deleted file mode 100644 index c187f7c..0000000 --- a/dist/synoptic/websage.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";var V=[],F=[],T=[],TAGS=[],NPTS={},SUBS=[],BAYS=[],DCRS=[],ANOTS=[],STONS=[],STOFS=[],HAS_ALARMS=0,LIMSUPS=[],LIMINFS=[],INVTAGS={},SVGDoc=null,Color_BackgroundSVG="gray";function LoadImage(e,t){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t)}function sprintf(e){let t=function(e,t,i){let a="";for(let e=0;e0?e+a:a+e},i=function(e,i,a,n){let l=function(e,t,i){return t>=0?e.indexOf(" ")>=0?i=" "+i:e.indexOf("+")>=0&&(i="+"+i):i="-"+i,i},r=parseInt(i,10);if("0"==i.charAt(0)){let i=0;return(e.indexOf(" ")>=0||e.indexOf("+")>=0)&&i++,a.length=0&&(r=r.replace(/^(.*)(e.*)$/,"$1.$2")),i(e,t,r,n)},a.f=function(e,t,a,n){let l=parseInt(a);isNaN(l)&&(l=6);let r=Math.abs(n).toFixed(l);return r.indexOf(".")<0&&e.indexOf("#")>=0&&(r+="."),i(e,t,r,n)},a.G=function(e,t,i,n){return a.g(e,t,i,n).toUpperCase()},a.g=function(e,t,a,n){let l=parseInt(a),r=Math.abs(n),s=r.toExponential(),o=r.toFixed(6);if(!isNaN(l)){let e=r.toExponential(l);s=e.length=0&&(s=s.replace(/^(.*)(e.*)$/,"$1.$2")),o.indexOf(".")<0&&e.indexOf("#")>=0&&(o+=".");let b=s.length=0&&(s="0"+s),i(e,a,s,l)},a.X=function(e,t,i,n){return a.x(e,t,i,n).toUpperCase()},a.x=function(e,a,n,l){let r=parseInt(n);l=Math.abs(l);let s=Math.round(l).toString(16);return s.length=0&&(s="0x"+s),i(e,a,s,l)},a.s=function(e,t,a,n){let l=parseInt(a),r=n;return r.length>l&&(r=r.substring(0,l)),i(e,t,r,0)};let n=e.split("%"),l=n[0],r=/^([-+ #]*)(\d*)\.?(\d*)([cdieEfFgGosuxX])(.*)$/;for(let e=1;e0&&(e[0].textContent="TAG: "+tag+"\nKEY: "+NPTS[tag]+"\nVAL: "+V[NPTS[tag]])}return V[NPTS[tag]]}if(obj&&"collapse"===obj.style.visibility&&(obj.style.visibility="inherit"),void 0!==V[tag])return V[tag];if(0==tag.indexOf("#")||0==tag.indexOf("%"))return WebSAGE.g_retnok;let f=WebSAGE.getFlags(t);if(0===tag.indexOf("!SLIM"))return t=tag.substr(5).trim(),isNaN(t)&&(t=NPTS[t]),void 0===LIMSUPS[t]?999999:LIMSUPS[t];if(0===tag.indexOf("!ILIM"))return t=tag.substr(5).trim(),isNaN(t)&&(t=NPTS[t]),void 0===LIMINFS[t]?-999999:LIMINFS[t];if(0===tag.indexOf("!TAG"))return t=tag.substr(4).trim(),isNaN(t)&&(t=NPTS[t]),void 0===TAGS[t]?"":TAGS[t];if(0===tag.indexOf("!DCR"))return t=tag.substr(4).trim(),isNaN(t)&&(t=NPTS[t]),void 0===DCRS[t]?"":DCRS[t];if(0===tag.indexOf("!STON"))return t=tag.substr(5).trim(),isNaN(t)&&(t=NPTS[t]),void 0===STONS[t]?"":STONS[t];if(0===tag.indexOf("!STOFF"))return t=tag.substr(6).trim(),isNaN(t)&&(t=NPTS[t]),void 0===STOFS[t]?"":STOFS[t];if(0===tag.indexOf("!STVAL")){if(t=tag.substr(6).trim(),isNaN(t)&&(t=NPTS[t]),2==(3&f))return STONS[t];if(1==(3&f))return STOFS[t];if(0==(3&f))return"";if(3==(3&f))return""}if(0===tag.indexOf("!ALR"))return t=tag.substr(4).trim(),isNaN(t)&&(t=NPTS[t]),void 0===f?0:256&f?1:0;if(0===tag.indexOf("!ALM"))return t=tag.substr(3).trim(),isNaN(t)&&(t=NPTS[t]),void 0===f?0:2048&f||256&f?1:0;if(0===tag.indexOf("!TMP"))return t=tag.substr(3).trim(),isNaN(t)&&(t=NPTS[t]),getTime(t);if(0===tag.indexOf("!EVAL")){t=tag.substr(5).trim();try{return eval('var thisobj=window.SVGDoc.getElementById("'+obj.id+'"); '+t)}catch(e){return WebSAGE.processInvalidTagInElement(tag,obj),console.log(e),retnok}}return WebSAGE.processInvalidTagInElement(tag,obj),retnok},printCFormat:function(e,t,i){let a=WebSAGE.valueResolveCoded(t,i);if("????"===a)return a;if(void 0!==e&&""!==e||(e=isNaN(parseFloat(a))?"%s":"%1.1f"),e.search(/[udrla][\^▲▼△▽]/)>=0&&(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("u▲",a>0?"▲":a<0?"▼":" ")).replace("d▼",a>0?"▼":a<0?"▲":" ")).replace("u△",a>0?"△":a<0?"▽":" ")).replace("d▽",a>0?"▽":a<0?"△":" ")).replace("u^",String.fromCharCode(a>=0?8593:8595))).replace("d^",String.fromCharCode(a>=0?8595:8593))).replace("r^",String.fromCharCode(a>=0?8611:8610))).replace("l^",String.fromCharCode(a>=0?8610:8611))).replace("a^",""),a=Math.abs(a)),e.indexOf("%")<0){let t=e.split("`");return t[0]=t[0].replace("~","%"),d3.format(t[0])(a)+(t.length>1?t[1]:"")}return sprintf(e,a)},pegaTagClone:function(e,t){let i,a,n,l,r,s;if(void 0!==t.list){for(i=0;i0&&(void 0===e.children[t].inittransform&&(e.children[t].inittransform=e.children[t].getAttributeNS(null,"transform")),a=e.children[t].getBoundingClientRect(),void 0===e.children[t].lastXlate&&(e.children[t].lastXlate=0),"vertical"===e.groupDistribType?(l=parseFloat(n-a.top+e.groupDistribSpacing)+e.children[t].lastXlate,r=" translate(0 "+l+")"):(l=parseFloat(i-a.left+e.groupDistribSpacing)+e.children[t].lastXlate,r=" translate("+l+" 0)"),e.children[t].setAttributeNS(null,"transform",e.children[t].inittransform+r),e.children[t].lastXlate=l),a=e.children[t].getBoundingClientRect(),i=a.right,n=a.bottom,e.children[t].groupDistrib=1},processInkscapeSAGETags:function(item){let inksage_labeltxt=item.getAttributeNS(null,"inkscape:label")||item.getAttributeNS("http://www.inkscape.org/namespaces/inkscape","label"),lbv,pnt,inksage_labelvec,j,i,t,tspl,src,xsacsrc,arrcores,tooltip,tooltiptext,textNode,clone,nohs,bb,sep,tfm,auxobj,pospfx,aft,arr=[];if(null!==inksage_labeltxt&&""!=inksage_labeltxt&&void 0!==inksage_labeltxt){try{for(;(pospfx=inksage_labeltxt.indexOf("$$#"))>=0;)aft=inksage_labeltxt.substr(pospfx),inksage_labeltxt=inksage_labeltxt.substr(0,pospfx)+WebSAGE.g_idprefixes[parseInt(inksage_labeltxt.substr(pospfx+3))-1]+aft.substr(aft.indexOf("_")+1);inksage_labelvec=JSON.parse("["+inksage_labeltxt+"]")}catch(e){return}for(lbv=0;lbv=0?inksage_labelvec[lbv].txtOFFON=inksage_labelvec[lbv].parent.firstElementChild.textContent.split("|"):(inksage_labelvec[lbv].formatoC=inksage_labelvec[lbv].parent.firstElementChild.textContent,pnt=inksage_labelvec[lbv].tag);break;case"color":for(null!==item.style?(inksage_labelvec[lbv].initfill=item.style.fill,inksage_labelvec[lbv].initstroke=item.style.stroke):(inksage_labelvec[lbv].initfill="",inksage_labelvec[lbv].initstroke=""),j=0;j1&&(inksage_labelvec[lbv].list[j].cattrib=arr[0],inksage_labelvec[lbv].list[j].cattribval=arr[1])):0===inksage_labelvec[lbv].list[j].param.indexOf("script: ")?inksage_labelvec[lbv].list[j].cscript=inksage_labelvec[lbv].list[j].param.substr(8):(arrcores=[],arrcores=inksage_labelvec[lbv].list[j].param.split("|"),inksage_labelvec[lbv].list[j].cfill=WebSAGE.translateColor(arrcores[0]),arrcores.length>1?inksage_labelvec[lbv].list[j].cstroke=WebSAGE.translateColor(arrcores[1]):inksage_labelvec[lbv].list[j].cstroke=inksage_labelvec[lbv].list[j].cfill),99999!=pnt&&void 0===item.blockPopup&&void 0===item.pontoPopup&&0===j&&(WebSAGE.tooltipRelac(item,pnt),item.setAttributeNS(null,"onclick",WebSAGE.g_obj_onclick.replace(/PONTO/g,pnt)),null!==item.style&&(item.style.cursor="pointer"));break;case"bar":inksage_labelvec[lbv].initheight=item.getAttributeNS(null,"height");break;case"opac":case"text":default:break;case"open":0==inksage_labelvec[lbv].istag?0===inksage_labelvec[lbv].src.indexOf("new:")?(item.style.cursor="pointer",item.setAttributeNS(null,"onclick","window.open( '"+inksage_labelvec[lbv].src.substr(4)+"','','dependent=yes,height="+inksage_labelvec[lbv].height+",width="+inksage_labelvec[lbv].width+",toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes' );")):inksage_labelvec[lbv].src.indexOf("preview:"):"rect"===item.tagName&&(inksage_labelvec[lbv].grafico=document.createElementNS("http://www.w3.org/2000/svg","polyline"),item.parentNode.appendChild(inksage_labelvec[lbv].grafico),inksage_labelvec[lbv].grafico.setAttributeNS(null,"style","fill:none; stroke:white; stroke-width: 2"),tfm=item.getAttributeNS(null,"transform"),null!=tfm&&inksage_labelvec[lbv].grafico.setAttributeNS(null,"transform",tfm),null!=item.style&&(""!=item.style.strokeWidth&&(inksage_labelvec[lbv].grafico.style.strokeWidth=item.style.strokeWidth),""!=item.style.stroke&&(inksage_labelvec[lbv].grafico.style.stroke=item.style.stroke)),tspl=inksage_labelvec[lbv].src.split("|"),inksage_labelvec[lbv].tag=tspl[0],void 0!==tspl[1]&&""!=tspl[1].trim()&&inksage_labelvec[lbv].grafico.setAttributeNS(null,"style",tspl[1]),inksage_labelvec[lbv].valores=[],inksage_labelvec[lbv].datas=[],inksage_labelvec[lbv].bb=item.getBBox(),inksage_labelvec[lbv].bb.left=inksage_labelvec[lbv].bb.x,inksage_labelvec[lbv].bb.right=inksage_labelvec[lbv].bb.x+inksage_labelvec[lbv].bb.width,inksage_labelvec[lbv].bb.top=inksage_labelvec[lbv].bb.y,inksage_labelvec[lbv].bb.bottom=inksage_labelvec[lbv].bb.y+inksage_labelvec[lbv].bb.height,pnt=WebSAGE.addPointToList(inksage_labelvec[lbv].tag),void 0===item.blockPopup&&null==item.pontoPopup&&(WebSAGE.tooltipRelac(item,pnt),item.setAttributeNS(null,"onclick",WebSAGE.g_obj_onclick.replace(/PONTO/g,pnt)),null!=item.style&&(item.style.cursor="pointer")));break;case"rotate":null===item.getAttributeNS(null,"transform")?inksage_labelvec[lbv].inittransform="":inksage_labelvec[lbv].inittransform=item.getAttributeNS(null,"transform");break;case"tooltips":for(tooltiptext="",j=0;j0&&(tooltiptext+="\n"),tooltiptext+=inksage_labelvec[lbv].param[j];tooltip=document.createElementNS("http://www.w3.org/2000/svg","title"),textNode=document.createTextNode(tooltiptext),tooltip.appendChild(textNode),item.appendChild(tooltip),item.hasTooltip=1,-1!==tooltiptext.indexOf("!EVAL")&&(inksage_labelvec[lbv].hasActiveTooltip=1,inksage_labelvec[lbv].tooltipTitle=tooltip,inksage_labelvec[lbv].tooltipText=tooltiptext);break;case"slider":for(null===item.getAttributeNS(null,"transform")?inksage_labelvec[lbv].inittransform="":inksage_labelvec[lbv].inittransform=item.getAttributeNS(null,"transform"),inksage_labelvec[lbv].min=parseFloat(inksage_labelvec[lbv].min),inksage_labelvec[lbv].max=parseFloat(inksage_labelvec[lbv].max),clone=void 0,nohs=SVGDoc.getElementsByTagName("use"),i=0;i=0&&void 0===item.blockPopup&&null!==item.style&&(item.style.cursor="pointer");break;case"exec_once":try{function evalprot(src){var lbv=null,i=null;return eval(src)}evalprot('var thisobj=document.getElementById("'+item.id+'"); '+inksage_labelvec[lbv].list[i].param)}catch(s){$("#SP_STATUS").text(s.name+": "+s.message+" [8]"),document.getElementById("SP_STATUS").title=s.stack}break;case"exec_on_update":break;case"vega":case"vega-lite":case"vega4":inksage_labelvec[lbv].tag="#"+inksage_labelvec[lbv].list[i].evt,inksage_labelvec[lbv].src=inksage_labelvec[lbv].list[i].param.split("\n")[0],inksage_labelvec[lbv].prompt=inksage_labelvec[lbv].list[i].param.substring(inksage_labelvec[lbv].list[i].param.indexOf("\n")+1),WebSAGE.SetIniExtended(inksage_labelvec,lbv,item);break;case"vega-json":case"vega4-json":inksage_labelvec[lbv].tag="#"+inksage_labelvec[lbv].list[i].evt,inksage_labelvec[lbv].prompt=inksage_labelvec[lbv].list[i].param,WebSAGE.SetIniExtended(inksage_labelvec,lbv,item)}break;case"clone":if("map"in inksage_labelvec[lbv]&&inksage_labelvec[lbv].map.length>0){let o=inksage_labelvec[lbv].map[0].split("=");pnt=WebSAGE.addPointToList(o[1]),0!==pnt&&(item.setAttributeNS(null,"onclick",WebSAGE.g_obj_onclick.replace(/PONTO/g,pnt)),null===item.style&&void 0!==item.style||(item.style.cursor="pointer"),item.pontoPopup=pnt)}}WebSAGE.InkSage.push(inksage_labelvec[lbv])}}},preprocessSVGDisplay:function(){if(null===SVGDoc)return;let e,t,i=SVGDoc.getElementsByTagName("g");for(e=0;e0&&vt==WebSAGE.InkSage[i].valores[tag][WebSAGE.InkSage[i].valores[tag].length-1]&&(o.getTime()-WebSAGE.InkSage[i].datas[WebSAGE.InkSage[i].datas[tag].length-1])/1e3<30)break;if(WebSAGE.InkSage[i].hasOwnProperty("valores")&&void 0!==WebSAGE.InkSage[i].valores[tag]){if(WebSAGE.InkSage[i].valores[tag].push(vt),WebSAGE.InkSage[i].datas[tag].push(o.getTime()),bb=WebSAGE.InkSage[i].bb,WebSAGE.InkSage[i].width>0)for(a=WebSAGE.InkSage[i].valores[tag].length-1;a>=0;a--){let b=(o.getTime()-WebSAGE.InkSage[i].datas[tag][a])/1e3;b>Math.abs(WebSAGE.InkSage[i].width)?(WebSAGE.InkSage[i].valores[tag].splice(a,1),WebSAGE.InkSage[i].datas[tag].splice(a,1)):(n=bb.right-parseFloat(b/Math.abs(WebSAGE.InkSage[i].width)*bb.width),l=bb.bottom-parseFloat((WebSAGE.InkSage[i].valores[tag][a]-WebSAGE.InkSage[i].y)/WebSAGE.InkSage[i].height*bb.height),l>bb.bottom&&(l=bb.bottom),l=0;a--){let g=(WebSAGE.InkSage[i].datas[tag][a]-WebSAGE.InkSage[i].dataini)/1e3;if(WebSAGE.InkSage[i].datas[tag][a]>WebSAGE.InkSage[i].datafim){WebSAGE.InkSage[i].valores[tag]=[],WebSAGE.InkSage[i].datas[tag]=[];let S=new Date;WebSAGE.InkSage[i].dataini=S.getTime()-S.getTime()%(1e3*Math.abs(WebSAGE.InkSage[i].width))+60*S.getTimezoneOffset()*1e3%(1e3*Math.abs(WebSAGE.InkSage[i].width)),WebSAGE.InkSage[i].datafim=WebSAGE.InkSage[i].dataini+Math.abs(1e3*WebSAGE.InkSage[i].width)}else n=bb.left+parseFloat(g/Math.abs(WebSAGE.InkSage[i].width)*bb.width),l=bb.bottom-parseFloat((WebSAGE.InkSage[i].valores[tag][a]-WebSAGE.InkSage[i].y)/WebSAGE.InkSage[i].height*bb.height),l>bb.bottom&&(l=bb.bottom),l=val||!isNaN(val)&&(131&ft)>=(128|val)||"a"===ch&&256&ft||"f"===ch&&128&ft)&&(fill=WebSAGE.InkSage[i].list[j].cfill,stroke=WebSAGE.InkSage[i].list[j].cstroke,script=WebSAGE.InkSage[i].list[j].cscript,attrib=WebSAGE.InkSage[i].list[j].cattrib,attribval=WebSAGE.InkSage[i].list[j].cattribval);else if(val=parseFloat(ch),"n"===ch&&2048&ft||"c"===ch&&4096&ft||"a"===ch&&256&ft||"f"===ch&&128&ft||!isNaN(val)&&vt>=val){let c,p,d;void 0!==WebSAGE.InkSage[i].list[j+1]?(c=WebSAGE.InkSage[i].list[j+1].cfill,"@"===c[0]?(c=c.substring(1),p=WebSAGE.InkSage[i].list[j].cfill,"@"===p[0]&&(p=p.substring(1)),d=parseFloat(WebSAGE.InkSage[i].list[j+1].data),fill=chroma.mix(p,c,(vt-val)/(d-val),"hsl").toString()):fill=WebSAGE.InkSage[i].list[j].cfill,c=WebSAGE.InkSage[i].list[j+1].cstroke,"@"===c[0]?(c=c.substring(1),p=WebSAGE.InkSage[i].list[j].cstroke,"@"===p[0]&&(p=p.substring(1)),d=parseFloat(WebSAGE.InkSage[i].list[j+1].data),stroke=chroma.mix(p,c,(vt-val)/(d-val),"hsl").toString()):stroke=WebSAGE.InkSage[i].list[j].cstroke):(fill=WebSAGE.InkSage[i].list[j].cfill,"@"===fill[0]&&(fill=fill.substring(1)),stroke=WebSAGE.InkSage[i].list[j].cstroke,"@"===stroke[0]&&(stroke=stroke.substring(1))),script=WebSAGE.InkSage[i].list[j].cscript,attrib=WebSAGE.InkSage[i].list[j].cattrib,attribval=WebSAGE.InkSage[i].list[j].cattribval}WebSAGE.blinkAlarmed(tag,WebSAGE.InkSage[i].parent)}if(void 0!==WebSAGE.InkSage[i].parent.temAnimacao&&WebSAGE.InkSage[i].parent.temAnimacao&&RemoveAnimate(WebSAGE.InkSage[i].parent),""!==attrib)WebSAGE.InkSage[i].parent.setAttributeNS(null,attrib,attribval);else if(""!==script){WebSAGE.InkSage[i].parent.temAnimacao=1,WebSAGE.InkSage[i].parent.style.fill=WebSAGE.InkSage[i].initfill,WebSAGE.InkSage[i].parent.style.stroke=WebSAGE.InkSage[i].initstroke;try{eval('var thisobj=window.SVGDoc.getElementById("'+WebSAGE.InkSage[i].parent.id+'"); '+script)}catch(k){$("#SP_STATUS").text(k.name+": "+k.message+" [7]"),document.getElementById("SP_STATUS").title=k.stack}}else WebSAGE.InkSage[i].parent.style.fill=""!==fill?fill:WebSAGE.InkSage[i].initfill,WebSAGE.InkSage[i].parent.style.stroke=""!==stroke?stroke:WebSAGE.InkSage[i].initstroke;WebSAGE.InkSage[i].parent.groupDistrib&&WebSAGE.setGroupDistrib(WebSAGE.InkSage[i].parent.parentNode),99999==tag&&(WebSAGE.InkSage[i].xdone=1);break;case"bar":let heigth=WebSAGE.InkSage[i].initheight*(vt-WebSAGE.InkSage[i].min)/(WebSAGE.InkSage[i].max-WebSAGE.InkSage[i].min);heigth<0&&(heigth=0),heigth>WebSAGE.InkSage[i].initheight&&(heigth=WebSAGE.InkSage[i].initheight),WebSAGE.InkSage[i].parent.setAttributeNS(null,"height",heigth),WebSAGE.blinkAlarmed(tag,WebSAGE.InkSage[i].parent);break;case"opac":let opac=1;WebSAGE.InkSage[i].max===WebSAGE.InkSage[i].min?opac=1:(opac=(vt-WebSAGE.InkSage[i].min)/(WebSAGE.InkSage[i].max-WebSAGE.InkSage[i].min),opac<0&&(opac=0),opac>1&&(opac=1)),isNaN(opac)&&(opac=1),WebSAGE.InkSage[i].parent.style.opacity=opac,WebSAGE.blinkAlarmed(tag,WebSAGE.InkSage[i].parent);break;case"rotate":bb=WebSAGE.InkSage[i].parent.getBBox();let tcx=parseFloat(WebSAGE.InkSage[i].parent.getAttributeNS(null,"inkscape:transform-center-x")||WebSAGE.InkSage[i].parent.getAttributeNS("http://www.inkscape.org/namespaces/inkscape","transform-center-x")),tcy=parseFloat(WebSAGE.InkSage[i].parent.getAttributeNS(null,"inkscape:transform-center-y")||WebSAGE.InkSage[i].parent.getAttributeNS("http://www.inkscape.org/namespaces/inkscape","transform-center-y"));isNaN(tcx)&&(tcx=0),isNaN(tcy)&&(tcy=0);let xcen=bb.x+bb.width/2+tcx,ycen=bb.y+bb.height/2-tcy,ang=(vt-WebSAGE.InkSage[i].min)/(WebSAGE.InkSage[i].max-WebSAGE.InkSage[i].min)*360;WebSAGE.InkSage[i].parent.setAttributeNS(null,"transform",WebSAGE.InkSage[i].inittransform+" rotate("+ang+" "+xcen+" "+ycen+") "),WebSAGE.blinkAlarmed(tag,WebSAGE.InkSage[i].parent);break;case"tooltips":if(void 0!==WebSAGE.InkSage[i].hasActiveTooltip&&1===WebSAGE.InkSage[i].hasActiveTooltip){let pini,pend,ev,tc;tc=WebSAGE.InkSage[i].tooltipText;do{pini=tc.indexOf("!EVAL",0),pend=tc.indexOf("!END",1),-1===pend&&(pend=9999999),-1!==pini&&(ev=eval(tc.substring(pini+5,pend)),isNaN(Number(ev))||(ev=sprintf("%1.3f",ev)),tc=tc.substring(0,pini)+ev+tc.substring(pend+4))}while(-1!==pini);WebSAGE.InkSage[i].tooltipTitle.textContent=tc}break;case"slider":vt>WebSAGE.InkSage[i].max&&(vt=WebSAGE.InkSage[i].max),vt=val||(131&ft)>=(128|val)||"a"===ch&&256&ft||"f"===ch&&128&ft)&&(txt=WebSAGE.InkSage[i].map[j].substring(A+1))):(val=parseFloat(WebSAGE.InkSage[i].map[j].substring(0,A)),(vt>=val||"a"===ch&&256&ft||"f"===ch&&128&ft)&&(txt=WebSAGE.InkSage[i].map[j].substring(A+1)))}txt!=WebSAGE.InkSage[i].parent.textContent&&(WebSAGE.InkSage[i].parent.firstChild&&"tspan"===WebSAGE.InkSage[i].parent.firstChild.tagName?WebSAGE.InkSage[i].parent.firstChild.textContent=txt:WebSAGE.InkSage[i].parent.textContent=txt),WebSAGE.blinkAlarmed(tag,WebSAGE.InkSage[i].parent);break;case"clone":default:break;case"script":for(j=0;j0?t-1:0,e=PBIColorTable[t])):(t=parseInt(e.substr(5,3),10),e=isNaN(t)?"none":ScreenViewer_ColorTable[t])}return e},makeDraggable:function(e){e&&(e.style.cursor="crosshair",e.drgDragging=!1,e.drgX=0,e.drgY=0,void 0===e.inittransform&&(e.inittransform=e.getAttributeNS(null,"transform")),null===e.inittransform&&(e.inittransform=""),$(e).bind("mousedown",(function(t){if("none"==e.style.display)return e.style.cursor="crosshair",e.drgDragging=!1,e.drgMouseOffsetX=0,e.drgMouseOffsetY=0,void(window.drgObject=null);e.style.cursor="move",e.drgDragging=!0,window.drgObject=e;let i=SVGDoc.createSVGPoint();i.x=t.clientX,i.y=t.clientY,e.drgMouseOffsetX=i.x-e.drgX,e.drgMouseOffsetY=i.y-e.drgY})),$(e).bind("mouseup",(function(t){e.style.cursor="crosshair",e.drgDragging=!1,e.drgMouseOffsetX=0,e.drgMouseOffsetY=0,window.drgObject=null})),$(e).bind("mousemove",(function(t){if(!0===e.drgDragging){let i=SVGDoc.createSVGPoint();i.x=t.clientX,i.y=t.clientY;let a=e.parentNode.getScreenCTM();i.x-=e.drgMouseOffsetX,i.y-=e.drgMouseOffsetY,window.MOUSEX=t.clientX,window.MOUSEY=t.clientY,e.drgX=i.x,e.drgY=i.y,a.e=a.f=0,i=i.matrixTransform(a.inverse()),e.setAttributeNS(null,"transform","translate("+i.x+","+i.y+") "+e.inittransform),t.stopPropagation()}})))},init:function(){WebSAGE.g_loadtime=new Date;try{if(null==(SVGDoc=document.getElementById("svgdiv").children[0])&&""!==tela)return;WebSAGE.g_isInkscape=""!=(SVGDoc.getAttributeNS(null,"inkscape:version")||SVGDoc.getAttributeNS("http://www.inkscape.org/namespaces/inkscape","version")),WebSAGE.g_isInkscape&&(Color_BackgroundSVG=ScreenViewer_Background),null!=SVGDoc&&WebSAGE.setBgColor(Color_BackgroundSVG)}catch(e){}WebSAGE.g_blinktimerID=setInterval(WebSAGE.timerBlink,WebSAGE.g_blinkperiod),document.oncontextmenu=function(){return!1},$("html > head").append(""),void 0!==SVGDoc&&null!=SVGDoc&&(SVGDoc.oncontextmenu=function(){return!1}),document.body.style.overflowX="hidden",document.body.style.overflowY="hidden",void 0!==SVGDoc&&null!=SVGDoc&&(SVGDoc.setAttributeNS(null,"width",ScreenViewer_SVGMaxWidth),SVGDoc.setAttributeNS(null,"height",ScreenViewer_SVGMaxHeight),SVGDoc.onselectstart=new Function("return false;")),WebSAGE.g_zpW=ScreenViewer_SVGMaxWidth,WebSAGE.g_zpH=ScreenViewer_SVGMaxHeight;try{WebSAGE.preprocessSVGDisplay()}catch(e){$("#SP_STATUS").text("Error! [0]"),document.getElementById("SP_STATUS").title=e.stack}$(SVGDoc).bind("mousewheel wheel DOMMouseScroll",(function(e){!1===window.wheelBlock&&(e.originalEvent.wheelDelta>0||e.originalEvent.detail<0||e.originalEvent.deltaY<0?WebSAGE.zoomPan(!0===window.wheelDirBackOut?12:18,null,e.originalEvent):WebSAGE.zoomPan(!0===window.wheelDirBackOut?18:12,null,e.originalEvent),window.wheelBlockEventPropagation&&e.stopPropagation())})),$(SVGDoc).bind("mousedown",(function(e){(e.originalEvent.isTrusted||80!==e.clientX||20!==e.clientY)&&(window.MOUSEX=e.clientX,window.MOUSEY=e.clientY,window.SVGDoc.style.cursor="move")})),$(SVGDoc).bind("mouseup",(function(e){(e.originalEvent.isTrusted||80!==e.clientX||20!==e.clientY)&&(window.SVGDoc.style.cursor="default",void 0===window.drgBlock&&(window.MOUSEX>e.clientX?window.WebSAGE.zoomPan(3,(window.MOUSEX-e.clientX)/30):window.WebSAGE.zoomPan(5,(e.clientX-window.MOUSEX)/30),window.MOUSEY>e.clientY?window.WebSAGE.zoomPan(1,(window.MOUSEY-e.clientY)/20):window.WebSAGE.zoomPan(7,(e.clientY-window.MOUSEY)/20),window.drgObject&&(window.drgObject.drgDragging=!1,window.drgObject.drgMouseOffsetX=0,window.drgObject.drgMouseOffsetY=0,window.drgObject=null)))}))}},$V=WebSAGE.getValue,$F=WebSAGE.getFlags,$T=WebSAGE.getTime,$W=WebSAGE; \ No newline at end of file diff --git a/package.json b/package.json index c05bbac..26e91aa 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,8 @@ "@types/lodash": "^4.14.194", "react": "17.0.2", "react-dom": "^18.2.0", - "tslib": "2.5.0" + "tslib": "2.5.0", + "yarn": "^1.22.21" }, "packageManager": "npm@9.3.1" }