/*!
* 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
* .
*
* Version: 2.6.2
* Release date: 15/02/2024 (built at 15/02/2024 12:03:43)
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("HyperFormula",[],t):"object"==typeof exports?exports.HyperFormula=t():e.HyperFormula=t()}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n=r(1);t.ArraySize=n.ArraySize;var o=r(73);t.CellError=o.CellError,t.CellType=o.CellType,t.CellValueDetailedType=o.CellValueDetailedType,t.CellValueType=o.CellValueType,t.ErrorType=o.ErrorType;var s=r(170);t.DetailedCellError=s.DetailedCellError;var i=r(171),a=r(175);t.AlwaysDense=a.AlwaysDense,t.AlwaysSparse=a.AlwaysSparse,t.DenseSparseChooseBasedOnThreshold=a.DenseSparseChooseBasedOnThreshold;var u=r(147);t.ConfigValueTooBigError=u.ConfigValueTooBigError,t.ConfigValueTooSmallError=u.ConfigValueTooSmallError,t.EvaluationSuspendedError=u.EvaluationSuspendedError,t.ExpectedOneOfValuesError=u.ExpectedOneOfValuesError,t.ExpectedValueOfTypeError=u.ExpectedValueOfTypeError,t.FunctionPluginValidationError=u.FunctionPluginValidationError,t.InvalidAddressError=u.InvalidAddressError,t.InvalidArgumentsError=u.InvalidArgumentsError,t.LanguageAlreadyRegisteredError=u.LanguageAlreadyRegisteredError,t.LanguageNotRegisteredError=u.LanguageNotRegisteredError,t.MissingTranslationError=u.MissingTranslationError,t.NamedExpressionDoesNotExistError=u.NamedExpressionDoesNotExistError,t.NamedExpressionNameIsAlreadyTakenError=u.NamedExpressionNameIsAlreadyTakenError,t.NamedExpressionNameIsInvalidError=u.NamedExpressionNameIsInvalidError,t.NoOperationToRedoError=u.NoOperationToRedoError,t.NoOperationToUndoError=u.NoOperationToUndoError,t.NoRelativeAddressesAllowedError=u.NoRelativeAddressesAllowedError,t.NoSheetWithIdError=u.NoSheetWithIdError,t.NoSheetWithNameError=u.NoSheetWithNameError,t.NotAFormulaError=u.NotAFormulaError,t.NothingToPasteError=u.NothingToPasteError,t.ProtectedFunctionTranslationError=u.ProtectedFunctionTranslationError,t.SheetNameAlreadyTakenError=u.SheetNameAlreadyTakenError,t.SheetSizeLimitExceededError=u.SheetSizeLimitExceededError,t.SourceLocationHasArrayError=u.SourceLocationHasArrayError,t.TargetLocationHasArrayError=u.TargetLocationHasArrayError,t.UnableToParseError=u.UnableToParseError;var c=r(198);t.ExportedCellChange=c.ExportedCellChange,t.ExportedNamedExpressionChange=c.ExportedNamedExpressionChange;var l=r(180);t.HyperFormula=l.HyperFormula;var h,d=(h=r(216))&&h.__esModule?h:{default:h},p=r(166);t.FunctionPlugin=p.FunctionPlugin,t.FunctionArgumentType=p.FunctionArgumentType,t.EmptyValue=p.EmptyValue;var m=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var i=o?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(n,s,i):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}(r(217)),g=r(139);function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}t.SimpleRangeValue=g.SimpleRangeValue;
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
class E extends l.HyperFormula{}E.HyperFormula=l.HyperFormula,E.ErrorType=o.ErrorType,E.CellError=o.CellError,E.CellType=o.CellType,E.CellValueType=o.CellValueType,E.CellValueDetailedType=o.CellValueDetailedType,E.DetailedCellError=s.DetailedCellError,E.ExportedCellChange=c.ExportedCellChange,E.ExportedNamedExpressionChange=c.ExportedNamedExpressionChange,E.ConfigValueTooBigError=u.ConfigValueTooBigError,E.ConfigValueTooSmallError=u.ConfigValueTooSmallError,E.EvaluationSuspendedError=u.EvaluationSuspendedError,E.ExpectedOneOfValuesError=u.ExpectedOneOfValuesError,E.ExpectedValueOfTypeError=u.ExpectedValueOfTypeError,E.ArraySize=n.ArraySize,E.SimpleRangeValue=g.SimpleRangeValue,E.EmptyValue=p.EmptyValue,E.FunctionPlugin=p.FunctionPlugin,E.FunctionArgumentType=p.FunctionArgumentType,E.FunctionPluginValidationError=u.FunctionPluginValidationError,E.InvalidAddressError=u.InvalidAddressError,E.InvalidArgumentsError=u.InvalidArgumentsError,E.LanguageNotRegisteredError=u.LanguageNotRegisteredError,E.LanguageAlreadyRegisteredError=u.LanguageAlreadyRegisteredError,E.MissingTranslationError=u.MissingTranslationError,E.NamedExpressionDoesNotExistError=u.NamedExpressionDoesNotExistError,E.NamedExpressionNameIsAlreadyTakenError=u.NamedExpressionNameIsAlreadyTakenError,E.NamedExpressionNameIsInvalidError=u.NamedExpressionNameIsInvalidError,E.NoOperationToRedoError=u.NoOperationToRedoError,E.NoOperationToUndoError=u.NoOperationToUndoError,E.NoRelativeAddressesAllowedError=u.NoRelativeAddressesAllowedError,E.NoSheetWithIdError=u.NoSheetWithIdError,E.NoSheetWithNameError=u.NoSheetWithNameError,E.NotAFormulaError=u.NotAFormulaError,E.NothingToPasteError=u.NothingToPasteError,E.ProtectedFunctionTranslationError=u.ProtectedFunctionTranslationError,E.SheetNameAlreadyTakenError=u.SheetNameAlreadyTakenError,E.SheetSizeLimitExceededError=u.SheetSizeLimitExceededError,E.SourceLocationHasArrayError=u.SourceLocationHasArrayError,E.TargetLocationHasArrayError=u.TargetLocationHasArrayError,E.UnableToParseError=u.UnableToParseError;const T=i.Config.defaultConfig.language;l.HyperFormula.registerLanguage(T,d.default),l.HyperFormula.languages[d.default.langCode]=d.default;for(const e of Object.getOwnPropertyNames(m))e.startsWith("_")||l.HyperFormula.registerFunctionPlugin(m[e]);t.default=E},function(e,t,r){"use strict";t.__esModule=!0,t.ArraySizePredictor=t.ArraySize=void 0,r(2);var n=r(72),o=r(165),s=r(166),i=r(77);
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
class a{constructor(e,t,r=!1){this.width=e,this.height=t,this.isRef=r}static error(){return new a(1,1,!0)}static scalar(){return new a(1,1,!1)}isScalar(){return 1===this.width&&1===this.height||this.isRef}}t.ArraySize=a;t.ArraySizePredictor=class{constructor(e,t){this.config=e,this.functionRegistry=t}checkArraySize(e,t){return this.checkArraySizeForAst(e,{formulaAddress:t,arraysFlag:this.config.useArrayArithmetic})}checkArraySizeForAst(e,t){switch(e.type){case i.AstNodeType.FUNCTION_CALL:return this.checkArraySizeForFunction(e,t);case i.AstNodeType.COLUMN_RANGE:case i.AstNodeType.ROW_RANGE:case i.AstNodeType.CELL_RANGE:{const r=n.AbsoluteCellRange.fromAstOrUndef(e,t.formulaAddress);return void 0===r?a.error():new a(r.width(),r.height(),!0)}case i.AstNodeType.ARRAY:{const r=[],n=[];for(const o of e.args){const e=o.map(e=>this.checkArraySizeForAst(e,t)),s=Math.min(...e.map(e=>e.height)),i=e.reduce((e,t)=>e+t.width,0);r.push(s),n.push(i)}const o=r.reduce((e,t)=>e+t,0),s=Math.min(...n);return new a(s,o)}case i.AstNodeType.STRING:case i.AstNodeType.NUMBER:return a.scalar();case i.AstNodeType.CELL_REFERENCE:return new a(1,1,!0);case i.AstNodeType.DIV_OP:case i.AstNodeType.CONCATENATE_OP:case i.AstNodeType.EQUALS_OP:case i.AstNodeType.GREATER_THAN_OP:case i.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case i.AstNodeType.LESS_THAN_OP:case i.AstNodeType.LESS_THAN_OR_EQUAL_OP:case i.AstNodeType.MINUS_OP:case i.AstNodeType.NOT_EQUAL_OP:case i.AstNodeType.PLUS_OP:case i.AstNodeType.POWER_OP:case i.AstNodeType.TIMES_OP:{const r=this.checkArraySizeForAst(e.left,t),n=this.checkArraySizeForAst(e.right,t);return!t.arraysFlag&&(r.height>1||r.width>1||n.height>1||n.width>1)?a.error():(o=r,s=n,new a(Math.max(o.width,s.width),Math.max(o.height,s.height)))}case i.AstNodeType.MINUS_UNARY_OP:case i.AstNodeType.PLUS_UNARY_OP:case i.AstNodeType.PERCENT_OP:{const n=this.checkArraySizeForAst(e.value,t);return!t.arraysFlag&&(n.height>1||n.width>1)?a.error():new a((r=n).width,r.height)}case i.AstNodeType.PARENTHESIS:return this.checkArraySizeForAst(e.expression,t);case i.AstNodeType.EMPTY:default:return a.error()}var r,o,s}checkArraySizeForFunction(e,t){const r=this.functionRegistry.getArraySizeFunction(e.procedureName);if(void 0!==r)return r(e,t);const n=this.functionRegistry.getMetadata(e.procedureName);if(void 0===n||n.expandRanges||!t.arraysFlag||n.vectorizationForbidden||void 0===n.parameters)return new a(1,1);const i=e.args.map(e=>{var r;return this.checkArraySizeForAst(e,new o.InterpreterState(t.formulaAddress,t.arraysFlag||null!==(r=null==n?void 0:n.arrayFunction)&&void 0!==r&&r))}),u=[...n.parameters];if(void 0!==n.repeatLastArgs&&u.length0&&n[0]<4?1:+(n[0]+n[1])),!o&&i&&(!(n=i.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=i.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},function(e,t,r){"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(e,t,r){"use strict";var n=r(31),o=r(18);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},function(e,t,r){"use strict";var n=r(22),o=r(32),s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(o(e)+" is not a function")}},function(e,t,r){"use strict";var n=String;e.exports=function(e){try{return n(e)}catch(e){return"Object"}}},function(e,t,r){"use strict";var n=r(9),o=r(22),s=r(21),i=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&o(r=e.toString)&&!s(a=n(r,e)))return a;if(o(r=e.valueOf)&&!s(a=n(r,e)))return a;if("string"!==t&&o(r=e.toString)&&!s(a=n(r,e)))return a;throw new i("Can't convert object to primitive value")}},function(e,t,r){"use strict";var n=r(4),o=r(35),s=r(39),i=r(41),a=r(27),u=r(26),c=n.Symbol,l=o("wks"),h=u?c.for||c:c&&c.withoutSetter||i;e.exports=function(e){return s(l,e)||(l[e]=a&&s(c,e)?c[e]:h("Symbol."+e)),l[e]}},function(e,t,r){"use strict";var n=r(36),o=r(37);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.35.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t,r){"use strict";e.exports=!1},function(e,t,r){"use strict";var n=r(4),o=r(38),s=n["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=s},function(e,t,r){"use strict";var n=r(4),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},function(e,t,r){"use strict";var n=r(15),o=r(40),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(o(e),t)}},function(e,t,r){"use strict";var n=r(17),o=Object;e.exports=function(e){return o(n(e))}},function(e,t,r){"use strict";var n=r(15),o=0,s=Math.random(),i=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++o+s,36)}},function(e,t,r){"use strict";var n=r(7),o=r(8),s=r(43);e.exports=!n&&!o((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},function(e,t,r){"use strict";var n=r(4),o=r(21),s=n.document,i=o(s)&&o(s.createElement);e.exports=function(e){return i?s.createElement(e):{}}},function(e,t,r){"use strict";var n=r(7),o=r(45),s=r(12);e.exports=n?function(e,t,r){return o.f(e,t,s(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){"use strict";var n=r(7),o=r(42),s=r(46),i=r(47),a=r(19),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor;t.f=n?s?function(e,t,r){if(i(e),t=a(t),i(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=l(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(i(e),t=a(t),i(r),o)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){"use strict";var n=r(7),o=r(8);e.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(e,t,r){"use strict";var n=r(21),o=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw new s(o(e)+" is not an object")}},function(e,t,r){"use strict";var n=r(22),o=r(45),s=r(49),i=r(38);e.exports=function(e,t,r,a){a||(a={});var u=a.enumerable,c=void 0!==a.name?a.name:t;if(n(r)&&s(r,c,a),a.global)u?e[t]=r:i(t,r);else{try{a.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},function(e,t,r){"use strict";var n=r(15),o=r(8),s=r(22),i=r(39),a=r(7),u=r(50).CONFIGURABLE,c=r(51),l=r(52),h=l.enforce,d=l.get,p=String,m=Object.defineProperty,g=n("".slice),f=n("".replace),E=n([].join),T=a&&!o((function(){return 8!==m((function(){}),"length",{value:8}).length})),y=String(String).split("String"),A=e.exports=function(e,t,r){"Symbol("===g(p(t),0,7)&&(t="["+f(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!i(e,"name")||u&&e.name!==t)&&(a?m(e,"name",{value:t,configurable:!0}):e.name=t),T&&r&&i(r,"arity")&&e.length!==r.arity&&m(e,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?a&&m(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=h(e);return i(n,"source")||(n.source=E(y,"string"==typeof t?t:"")),e};Function.prototype.toString=A((function(){return s(this)&&d(this).source||c(this)}),"toString")},function(e,t,r){"use strict";var n=r(7),o=r(39),s=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,a=o(s,"name"),u=a&&"something"===function(){}.name,c=a&&(!n||n&&i(s,"name").configurable);e.exports={EXISTS:a,PROPER:u,CONFIGURABLE:c}},function(e,t,r){"use strict";var n=r(15),o=r(22),s=r(37),i=n(Function.toString);o(s.inspectSource)||(s.inspectSource=function(e){return i(e)}),e.exports=s.inspectSource},function(e,t,r){"use strict";var n,o,s,i=r(53),a=r(4),u=r(21),c=r(44),l=r(39),h=r(37),d=r(54),p=r(55),m=a.TypeError,g=a.WeakMap;if(i||h.state){var f=h.state||(h.state=new g);f.get=f.get,f.has=f.has,f.set=f.set,n=function(e,t){if(f.has(e))throw new m("Object already initialized");return t.facade=e,f.set(e,t),t},o=function(e){return f.get(e)||{}},s=function(e){return f.has(e)}}else{var E=d("state");p[E]=!0,n=function(e,t){if(l(e,E))throw new m("Object already initialized");return t.facade=e,c(e,E,t),t},o=function(e){return l(e,E)?e[E]:{}},s=function(e){return l(e,E)}}e.exports={set:n,get:o,has:s,enforce:function(e){return s(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},function(e,t,r){"use strict";var n=r(4),o=r(22),s=n.WeakMap;e.exports=o(s)&&/native code/.test(String(s))},function(e,t,r){"use strict";var n=r(35),o=r(41),s=n("keys");e.exports=function(e){return s[e]||(s[e]=o(e))}},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";var n=r(39),o=r(57),s=r(6),i=r(45);e.exports=function(e,t,r){for(var a=o(t),u=i.f,c=s.f,l=0;lc;)o(n,r=t[c++])&&(~i(l,r)||u(l,r));return l}},function(e,t,r){"use strict";var n=r(13),o=r(61),s=r(64),i=function(e){return function(t,r,i){var a,u=n(t),c=s(u),l=o(i,c);if(e&&r!=r){for(;c>l;)if((a=u[l++])!=a)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,r){"use strict";var n=r(62),o=Math.max,s=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):s(r,t)}},function(e,t,r){"use strict";var n=r(63);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},function(e,t,r){"use strict";var n=Math.ceil,o=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?o:n)(t)}},function(e,t,r){"use strict";var n=r(65);e.exports=function(e){return n(e.length)}},function(e,t,r){"use strict";var n=r(62),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},function(e,t,r){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,r){"use strict";t.f=Object.getOwnPropertySymbols},function(e,t,r){"use strict";var n=r(8),o=r(22),s=/#|\.prototype\./,i=function(e,t){var r=u[a(e)];return r===l||r!==c&&(o(t)?n(t):!!t)},a=i.normalize=function(e){return String(e).replace(s,".").toLowerCase()},u=i.data={},c=i.NATIVE="N",l=i.POLYFILL="P";e.exports=i},function(e,t,r){"use strict";var n=r(7),o=r(70),s=TypeError,i=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(o(e)&&!i(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},function(e,t,r){"use strict";var n=r(16);e.exports=Array.isArray||function(e){return"Array"===n(e)}},function(e,t,r){"use strict";var n=TypeError;e.exports=function(e){if(e>9007199254740991)throw n("Maximum allowed index exceeded");return e}},function(e,t,r){"use strict";t.__esModule=!0,t.WRONG_RANGE_SIZE=t.AbsoluteRowRange=t.AbsoluteColumnRange=t.AbsoluteCellRange=void 0,t.isSimpleCellRange=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&("start"in e&&(0,n.isSimpleCellAddress)(e.start)&&"end"in e&&(0,n.isSimpleCellAddress)(e.end))},t.simpleCellRange=void 0,r(2);var n=r(73),o=r(147),s=r(77),i=r(141);
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
const a=t.WRONG_RANGE_SIZE="AbsoluteCellRange: Wrong range size";t.simpleCellRange=(e,t)=>({start:e,end:t});class u{constructor(e,t){if(e.sheet!==t.sheet)throw new o.SheetsNotEqual(e.sheet,t.sheet);this.start=(0,n.simpleCellAddress)(e.sheet,e.col,e.row),this.end=(0,n.simpleCellAddress)(t.sheet,t.col,t.row)}get sheet(){return this.start.sheet}static fromSimpleCellAddresses(e,t){if(e.sheet!==t.sheet)throw new o.SheetsNotEqual(e.sheet,t.sheet);const r=t.col-e.col,n=t.row-e.row;return Number.isFinite(n)&&Number.isFinite(r)?new u(e,t):Number.isFinite(n)?new l(e.sheet,e.row,t.row):new c(e.sheet,e.col,t.col)}static fromAst(e,t){return e.type===s.AstNodeType.CELL_RANGE?u.fromCellRange(e,t):e.type===s.AstNodeType.COLUMN_RANGE?c.fromColumnRange(e,t):l.fromRowRangeAst(e,t)}static fromAstOrUndef(e,t){try{return u.fromAst(e,t)}catch(e){return}}static fromCellRange(e,t){return new u(e.start.toSimpleCellAddress(t),e.end.toSimpleCellAddress(t))}static spanFrom(e,t,r){const n=u.spanFromOrUndef(e,t,r);if(void 0===n)throw new Error(a);return n}static spanFromOrUndef(e,t,r){if(!Number.isFinite(t)&&Number.isFinite(r)){if(0!==e.col)return;return new l(e.sheet,e.row,e.row+r-1)}if(!Number.isFinite(r)&&Number.isFinite(t)){if(0!==e.row)return;return new c(e.sheet,e.col,e.col+t-1)}if(Number.isFinite(r)&&Number.isFinite(t))return new u(e,(0,n.simpleCellAddress)(e.sheet,e.col+t-1,e.row+r-1))}static fromCoordinates(e,t,r,o,s){return new u((0,n.simpleCellAddress)(e,t,r),(0,n.simpleCellAddress)(e,o,s))}isFinite(){return Number.isFinite(this.size())}doesOverlap(e){return this.start.sheet==e.start.sheet&&(!(this.end.rowe.end.row)&&!(this.end.cole.end.col))}addressInRange(e){return this.sheet===e.sheet&&(this.start.row<=e.row&&this.end.row>=e.row&&this.start.col<=e.col&&this.end.col>=e.col)}columnInRange(e){return this.sheet===e.sheet&&(this.start.col<=e.col&&this.end.col>=e.col)}rowInRange(e){return this.sheet===e.sheet&&(this.start.row<=e.row&&this.end.row>=e.row)}containsRange(e){return this.addressInRange(e.start)&&this.addressInRange(e.end)}intersectionWith(e){if(this.sheet!==e.start.sheet)return;const t=Math.max(this.start.row,e.start.row),r=Math.min(this.end.row,e.end.row),o=Math.max(this.start.col,e.start.col),s=Math.min(this.end.col,e.end.col);return t>r||o>s?void 0:new u((0,n.simpleCellAddress)(this.sheet,o,t),(0,n.simpleCellAddress)(this.sheet,s,r))}includesRow(e){return this.start.row=e}includesColumn(e){return this.start.col=e}shiftByRows(e){this.start.row+=e,this.end.row+=e}expandByRows(e){this.end.row+=e}shiftByColumns(e){this.start.col+=e,this.end.col+=e}shifted(e,t){return u.spanFrom((0,n.simpleCellAddress)(this.sheet,this.start.col+e,this.start.row+t),this.width(),this.height())}expandByColumns(e){this.end.col+=e}moveToSheet(e){this.start.sheet=e,this.end.sheet=e}removeSpan(e){e instanceof i.RowsSpan?this.removeRows(e.start,e.end):this.removeColumns(e.start,e.end)}shouldBeRemoved(){return this.width()<=0||this.height()<=0}rangeWithSameWidth(e,t){return u.spanFrom((0,n.simpleCellAddress)(this.sheet,this.start.col,e),this.width(),t)}rangeWithSameHeight(e,t){return u.spanFrom((0,n.simpleCellAddress)(this.sheet,e,this.start.row),t,this.height())}toString(){return`${this.start.sheet},${this.start.col},${this.start.row},${this.end.col},${this.end.row}`}width(){return this.end.col-this.start.col+1}height(){return this.end.row-this.start.row+1}size(){return this.height()*this.width()}arrayOfAddressesInRange(){const e=[];for(let t=0;t0)if(t>0){let e=this.effectiveEndRow(r);for(;e>=this.start.row;){let t=this.effectiveEndColumn(r);for(;t>=this.start.col;)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t-=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(r);){let t=this.effectiveEndColumn(r);for(;t>=this.start.col;)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t-=1;e+=1}}else if(t>0){let e=this.effectiveEndRow(r);for(;e>=this.start.row;){let t=this.start.col;for(;t<=this.effectiveEndColumn(r);)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t+=1;e-=1}}else{let e=this.start.row;for(;e<=this.effectiveEndRow(r);){let t=this.start.col;for(;t<=this.effectiveEndColumn(r);)yield(0,n.simpleCellAddress)(this.start.sheet,t,e),t+=1;e+=1}}}getAddress(e,t){if(e<0||t<0||t>this.height()-1||e>this.width()-1)throw Error("Index out of bound");return(0,n.simpleCellAddress)(this.start.sheet,this.start.col+e,this.start.row+t)}exceedsSheetSizeLimits(e,t){return this.end.col>=e||this.end.row>=t}effectiveEndColumn(e){return this.end.col}effectiveEndRow(e){return this.end.row}effectiveWidth(e){return this.width()}effectiveHeight(e){return this.height()}removeRows(e,t){if(!(e>this.end.row)){if(tthis.end.col)){if(t=e}effectiveEndRow(e){return this.effectiveHeight(e)-1}effectiveHeight(e){return e.getSheetHeight(this.sheet)}removeRows(e,t){}}t.AbsoluteColumnRange=c;class l extends u{constructor(e,t,r){super((0,n.simpleCellAddress)(e,0,t),(0,n.simpleCellAddress)(e,Number.POSITIVE_INFINITY,r))}static fromRowRangeAst(e,t){const r=e.start.toSimpleRowAddress(t),n=e.end.toSimpleRowAddress(t);if(r.sheet!==n.sheet)throw new o.SheetsNotEqual(r.sheet,n.sheet);return new l(r.sheet,r.row,n.row)}shouldBeRemoved(){return this.height()<=0}shiftByColumns(e){}expandByColumns(e){}shifted(e,t){return new l(this.sheet,this.start.row+t,this.end.row+t)}rangeWithSameWidth(e,t){return new l(this.sheet,e,e+t-1)}exceedsSheetSizeLimits(e,t){return this.end.row>=t}effectiveEndColumn(e){return this.effectiveWidth(e)-1}effectiveWidth(e){return e.getSheetWidth(this.sheet)}removeColumns(e,t){}}t.AbsoluteRowRange=l},function(e,t,r){"use strict";t.__esModule=!0,t.invalidSimpleRowAddress=t.invalidSimpleColumnAddress=t.invalidSimpleCellAddress=t.getCellValueType=t.getCellValueFormat=t.getCellValueDetailedType=t.getCellType=t.equalSimpleCellAddress=t.addressKey=t.absoluteSheetReference=t.ErrorType=t.CellValueTypeOrd=t.CellValueType=t.CellValueNoNumber=t.CellValueJustNumber=t.CellValueDetailedType=t.CellType=t.CellError=void 0,t.isSimpleCellAddress=function(e){var t,r,n;return e&&("object"==typeof e||"function"==typeof e)&&"number"==typeof(null===(t=e)||void 0===t?void 0:t.sheet)&&"number"==typeof(null===(r=e)||void 0===r?void 0:r.col)&&"number"==typeof(null===(n=e)||void 0===n?void 0:n.row)},t.simpleRowAddress=t.simpleColumnAddress=t.simpleCellAddress=t.movedSimpleCellAddress=void 0;var n,o,s=r(74),i=r(131),a=r(140),u=r(139);!function(e){e.DIV_BY_ZERO="DIV_BY_ZERO",e.NAME="NAME",e.VALUE="VALUE",e.NUM="NUM",e.NA="NA",e.CYCLE="CYCLE",e.REF="REF",e.SPILL="SPILL",e.LIC="LIC",e.ERROR="ERROR"}(n||(t.ErrorType=n={})),function(e){e.FORMULA="FORMULA",e.VALUE="VALUE",e.ARRAY="ARRAY",e.EMPTY="EMPTY",e.ARRAYFORMULA="ARRAYFORMULA"}(o||(t.CellType=o={}));var c,l;t.getCellType=(e,t)=>e instanceof s.ArrayVertex?e.isLeftCorner(t)?o.ARRAYFORMULA:o.ARRAY:e instanceof s.FormulaCellVertex||e instanceof s.ParsingErrorVertex?o.FORMULA:e instanceof s.ValueCellVertex?o.VALUE:o.EMPTY,function(e){e.EMPTY="EMPTY",e.NUMBER="NUMBER",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.ERROR="ERROR"}(c||(t.CellValueNoNumber=c={})),function(e){e.NUMBER="NUMBER"}(l||(t.CellValueJustNumber=l={}));const h=t.CellValueType=Object.assign(Object.assign({},c),l);t.CellValueDetailedType=Object.assign(Object.assign({},c),a.NumberType);t.CellValueTypeOrd=e=>{switch(e){case h.EMPTY:return 0;case h.NUMBER:return 1;case h.STRING:return 2;case h.BOOLEAN:return 3;case h.ERROR:return 4}throw new Error("Cell value not computed")};const d=e=>{if(e===a.EmptyValue)return h.EMPTY;if(e instanceof p||e instanceof u.SimpleRangeValue)return h.ERROR;if("string"==typeof e)return h.STRING;if((0,a.isExtendedNumber)(e))return h.NUMBER;if("boolean"==typeof e)return h.BOOLEAN;throw new Error("Cell value not computed")};t.getCellValueType=d;t.getCellValueDetailedType=e=>(0,a.isExtendedNumber)(e)?(0,a.getTypeOfExtendedNumber)(e):d(e);t.getCellValueFormat=e=>(0,a.isExtendedNumber)(e)?(0,a.getFormatOfExtendedNumber)(e):void 0;class p{constructor(e,t,r){this.type=e,this.message=t,this.root=r}static parsingError(e){return new p(n.ERROR,`${i.ErrorMessage.ParseError}${e?" "+e:""}`)}attachRootVertex(e){return void 0===this.root?new p(this.type,this.message,e):this}}t.CellError=p;t.simpleRowAddress=(e,t)=>({sheet:e,row:t});t.invalidSimpleRowAddress=e=>e.row<0;t.simpleColumnAddress=(e,t)=>({sheet:e,col:t});t.invalidSimpleColumnAddress=e=>e.col<0;const m=(e,t,r)=>({sheet:e,col:t,row:r});t.simpleCellAddress=m;t.invalidSimpleCellAddress=e=>e.col<0||e.row<0;t.movedSimpleCellAddress=(e,t,r,n)=>m(t,e.col+r,e.row+n);t.addressKey=e=>`${e.sheet},${e.row},${e.col}`;t.absoluteSheetReference=(e,t)=>{var r;return null!==(r=e.sheet)&&void 0!==r?r:t.sheet};t.equalSimpleCellAddress=(e,t)=>e.sheet===t.sheet&&e.col===t.col&&e.row===t.row},function(e,t,r){"use strict";t.__esModule=!0,t.ValueCellVertex=t.TopSort=t.SparseStrategy=t.SheetMapping=t.RangeVertex=t.RangeMapping=t.ParsingErrorVertex=t.Graph=t.FormulaCellVertex=t.EmptyCellVertex=t.DependencyGraph=t.DenseStrategy=t.ArrayVertex=t.ArrayMapping=t.AddressMapping=void 0;var n=r(75);t.DependencyGraph=n.DependencyGraph;var o=r(146);t.AddressMapping=o.AddressMapping;var s=r(153);t.Graph=s.Graph;var i=r(154);t.TopSort=i.TopSort;var a=r(156);t.RangeMapping=a.RangeMapping;var u=r(157);t.SheetMapping=u.SheetMapping;var c=r(148);t.ArrayMapping=c.ArrayMapping;var l=r(150);t.FormulaCellVertex=l.FormulaCellVertex,t.ArrayVertex=l.ArrayVertex;var h=r(160);t.EmptyCellVertex=h.EmptyCellVertex;var d=r(161);t.ValueCellVertex=d.ValueCellVertex;var p=r(162);t.ParsingErrorVertex=p.ParsingErrorVertex;var m=r(152);t.RangeVertex=m.RangeVertex;var g=r(163);t.SparseStrategy=g.SparseStrategy;var f=r(164);t.DenseStrategy=f.DenseStrategy},function(e,t,r){"use strict";t.__esModule=!0,t.DependencyGraph=void 0,r(2);var n=r(72),o=r(76),s=r(73),i=r(138),a=r(131),u=r(140),c=r(139),l=r(77),h=r(141),d=r(142),p=r(74),m=r(146),g=r(148),f=r(149),E=r(150),T=r(153),y=r(156),A=r(157);
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
class R{constructor(e,t,r,a,u,c,h,d){this.addressMapping=e,this.rangeMapping=t,this.sheetMapping=r,this.arrayMapping=a,this.stats=u,this.lazilyTransformingAstService=c,this.functionRegistry=h,this.namedExpressions=d,this.changes=i.ContentChanges.empty(),this.dependencyQueryAddresses=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e).map(([e,t])=>e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map(t=>t instanceof l.NamedExpressionDependency?this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet).address:(0,s.isSimpleCellAddress)(t)?t:(0,n.simpleCellRange)(t.start,t.end))}return[]}},this.dependencyQueryVertices=e=>{if(e instanceof p.RangeVertex)return this.rangeDependencyQuery(e);{const t=this.formulaDependencyQuery(e);if(void 0!==t){const[e,r]=t;return r.map(t=>{if(t instanceof n.AbsoluteCellRange)return[t.start,this.rangeMapping.fetchRange(t.start,t.end)];if(t instanceof l.NamedExpressionDependency){const r=this.namedExpressions.namedExpressionOrPlaceholder(t.name,e.sheet);return[r.address,this.addressMapping.fetchCell(r.address)]}return[t,this.addressMapping.fetchCell(t)]})}return[]}},this.rangeDependencyQuery=e=>{const t=[],{smallerRangeVertex:r,restRange:o}=this.rangeMapping.findSmallerRange(e.range);let s;void 0!==r&&this.graph.adjacentNodes(r).has(e)?(s=o,t.push([new n.AbsoluteCellRange(r.start,r.end),r])):s=e.range;for(const e of s.addresses(this)){const r=this.addressMapping.getCell(e);void 0!==r&&t.push([e,r])}return t},this.formulaDependencyQuery=e=>{let t,r;if(!(e instanceof E.FormulaVertex))return;r=e.getAddress(this.lazilyTransformingAstService),t=e.getFormula(this.lazilyTransformingAstService);const n=(0,l.collectDependencies)(t,this.functionRegistry);return[r,(0,o.absolutizeDependencies)(n,r)]},this.graph=new T.Graph(this.dependencyQueryVertices)}static buildEmpty(e,t,r,n,o){return new R(new m.AddressMapping(t.chooseAddressMappingPolicy),new y.RangeMapping,new A.SheetMapping(t.translationPackage),new g.ArrayMapping,o,e,r,n)}setFormulaToCell(e,t,r,n,o,s){const i=E.FormulaVertex.fromAst(t,e,n,this.lazilyTransformingAstService.version());return this.exchangeOrAddFormulaVertex(i),this.processCellDependencies(r,i),this.graph.markNodeAsDirty(i),o&&this.markAsVolatile(i),s&&this.markAsDependentOnStructureChange(i),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setParsingErrorToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);return this.exchangeOrAddGraphNode(r,t),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t),this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setValueToCell(e,t){const r=this.shrinkPossibleArrayAndGetCell(e);if(r instanceof p.ArrayVertex&&this.arrayMapping.removeArray(r.getRange()),r instanceof p.ValueCellVertex){r.getValues().rawValue!==t.rawValue&&(r.setValues(t),this.graph.markNodeAsDirty(r))}else{const n=new p.ValueCellVertex(t.parsedValue,t.rawValue);this.exchangeOrAddGraphNode(r,n),this.addressMapping.setCell(e,n),this.graph.markNodeAsDirty(n)}return this.correctInfiniteRangesDependency(e),this.getAndClearContentChanges()}setCellEmpty(e){const t=this.shrinkPossibleArrayAndGetCell(e);if(void 0===t)return i.ContentChanges.empty();if(this.graph.adjacentNodes(t).size>0){const r=new p.EmptyCellVertex;this.exchangeGraphNode(t,r),0===this.graph.adjacentNodesCount(r)?(this.removeVertex(r),this.addressMapping.removeCell(e)):(this.graph.markNodeAsDirty(r),this.addressMapping.setCell(e,r))}else this.removeVertex(t),this.addressMapping.removeCell(e);return this.getAndClearContentChanges()}clearDirtyVertices(){this.graph.clearDirtyNodes()}verticesToRecompute(){return this.graph.getDirtyAndVolatileNodes()}processCellDependencies(e,t){const r=this.graph.getNodeId(t);e.forEach(e=>{if(e instanceof n.AbsoluteCellRange){const t=e;let n=this.getRange(t.start,t.end);void 0===n&&(n=new p.RangeVertex(t),this.rangeMapping.setRange(n)),this.graph.addNodeAndReturnId(n);const o=this.graph.getNodeId(n);t.isFinite()||this.graph.markNodeAsInfiniteRange(o);const{smallerRangeVertex:s,restRange:i}=this.rangeMapping.findSmallerRange(t);if(void 0!==s){if(this.graph.addEdge(s,o),n.bruteForce){n.bruteForce=!1;for(const e of t.addresses(this))this.graph.removeEdge(this.fetchCell(e),o)}}else n.bruteForce=!0;const a=this.arrayMapping.getArray(i);if(void 0!==a)this.graph.addEdge(a,o);else for(const e of i.addresses(this)){const{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:t,o)}this.graph.addEdge(o,r),t.isFinite()&&this.correctInfiniteRangesDependenciesByRangeVertex(n)}else if(e instanceof l.NamedExpressionDependency){const n=t.getAddress(this.lazilyTransformingAstService).sheet,{vertex:o,id:s}=this.fetchNamedExpressionVertex(e.name,n);this.graph.addEdge(null!=s?s:o,r)}else{const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=n?n:t,r)}})}fetchNamedExpressionVertex(e,t){const r=this.namedExpressions.namedExpressionOrPlaceholder(e,t);return this.fetchCellOrCreateEmpty(r.address)}exchangeNode(e,t){const r=this.fetchCellOrCreateEmpty(e).vertex,n=this.fetchCellOrCreateEmpty(t).vertex;this.addressMapping.removeCell(e),this.exchangeGraphNode(r,n)}fetchCellOrCreateEmpty(e){const t=this.addressMapping.getCell(e);if(void 0!==t)return{vertex:t,id:void 0};const r=new p.EmptyCellVertex,n=this.graph.addNodeAndReturnId(r);return this.addressMapping.setCell(e,r),{vertex:r,id:n}}removeRows(e){this.stats.measure(d.StatType.ADJUSTING_GRAPH,()=>{for(const[t,r]of this.addressMapping.entriesFromRowsSpan(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsDirty(e);if(r instanceof p.ArrayVertex){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}}),this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeRows(e)});const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,()=>{const t=this.truncateRanges(e,e=>e.row);return this.getArrayVerticesRelatedToRanges(t)});return this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,()=>{this.fixArraysAfterRemovingRows(e.sheet,e.rowStart,e.numberOfRows)}),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}removeSheet(e){this.clearSheet(e);for(const[t,r]of this.addressMapping.sheetEntries(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsDirty(e);this.removeVertex(r),this.addressMapping.removeCell(t)}this.stats.measure(d.StatType.ADJUSTING_RANGES,()=>{const t=this.rangeMapping.removeRangesInSheet(e);for(const e of t)this.removeVertex(e);this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeSheet(e)})})}clearSheet(e){const t=new Set;for(const[r,n]of this.addressMapping.sheetEntries(e))n instanceof p.ArrayVertex?t.add(n):this.setCellEmpty(r);for(const e of t.values())this.setArrayEmpty(e);this.addStructuralNodesToChangeSet()}removeColumns(e){this.stats.measure(d.StatType.ADJUSTING_GRAPH,()=>{for(const[t,r]of this.addressMapping.entriesFromColumnsSpan(e)){for(const e of this.graph.adjacentNodes(r))this.graph.markNodeAsDirty(e);if(r instanceof p.ArrayVertex){if(!r.isLeftCorner(t))continue;this.shrinkArrayToCorner(r),this.arrayMapping.removeArray(r.getRange())}this.removeVertex(r)}}),this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.removeColumns(e)});const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,()=>{const t=this.truncateRanges(e,e=>e.col);return this.getArrayVerticesRelatedToRanges(t)});return this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,()=>this.fixArraysAfterRemovingColumns(e.sheet,e.columnStart,e.numberOfColumns)),this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}addRows(e){this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.addRows(e.sheet,e.rowStart,e.numberOfRows)});const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterRowByRows(e.sheet,e.rowStart,e.numberOfRows);return this.fixRangesWhenAddingRows(e.sheet,e.rowStart,e.numberOfRows),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)});this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,()=>{this.fixArraysAfterAddingRow(e.sheet,e.rowStart,e.numberOfRows)});for(const t of this.addressMapping.verticesFromRowsSpan(e))this.graph.markNodeAsDirty(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t}}addColumns(e){this.stats.measure(d.StatType.ADJUSTING_ADDRESS_MAPPING,()=>{this.addressMapping.addColumns(e.sheet,e.columnStart,e.numberOfColumns)});const t=this.stats.measure(d.StatType.ADJUSTING_RANGES,()=>{const t=this.rangeMapping.moveAllRangesInSheetAfterColumnByColumns(e.sheet,e.columnStart,e.numberOfColumns);return this.fixRangesWhenAddingColumns(e.sheet,e.columnStart,e.numberOfColumns),this.getArrayVerticesRelatedToRanges(t.verticesWithChangedSize)});this.stats.measure(d.StatType.ADJUSTING_ARRAY_MAPPING,()=>this.fixArraysAfterAddingColumn(e.sheet,e.columnStart,e.numberOfColumns));for(const t of this.addressMapping.verticesFromColumnsSpan(e))this.graph.markNodeAsDirty(t);return this.addStructuralNodesToChangeSet(),{affectedArrays:t,contentChanges:this.getAndClearContentChanges()}}isThereSpaceForArray(e){const t=e.getRangeOrUndef();if(void 0===t)return!1;for(const r of t.addresses(this)){const t=this.addressMapping.getCell(r);if(void 0!==t&&!(t instanceof p.EmptyCellVertex)&&t!==e)return!1}return!0}moveCells(e,t,r,n){for(const o of e.addressesWithDirection(t,r,this)){const i=(0,s.simpleCellAddress)(n,o.col+t,o.row+r);let a=this.addressMapping.getCell(o);const u=this.addressMapping.getCell(i);if(this.addressMapping.removeCell(o),void 0!==a){this.graph.markNodeAsDirty(a),this.addressMapping.setCell(i,a);let t=void 0;for(const r of this.graph.adjacentNodes(a))r instanceof p.RangeVertex&&!e.containsRange(r.range)&&(t=null!=t?t:this.fetchCellOrCreateEmpty(o).vertex,this.graph.addEdge(t,r),this.graph.removeEdge(a,r));t&&(this.graph.markNodeAsDirty(t),this.addressMapping.setCell(o,t))}if(void 0!==u){void 0===a&&this.addressMapping.removeCell(i);for(const e of this.graph.adjacentNodes(u))a=null!=a?a:this.fetchCellOrCreateEmpty(i).vertex,this.graph.addEdge(a,e),this.graph.markNodeAsDirty(a);this.removeVertex(u)}}for(const t of this.rangeMapping.rangeVerticesContainedInRange(e))for(const r of this.graph.adjacentNodes(t))if(r instanceof p.RangeVertex&&!e.containsRange(r.range)){this.graph.removeEdge(t,r);for(const e of t.range.addresses(this)){const{vertex:t,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=n?n:t,r),this.addressMapping.setCell(e,t),this.graph.markNodeAsDirty(t)}}this.rangeMapping.moveRangesInsideSourceRange(e,t,r,n)}setArrayEmpty(e){const t=n.AbsoluteCellRange.spanFrom(e.getAddress(this.lazilyTransformingAstService),e.width,e.height),r=this.graph.adjacentNodes(e);for(const e of t.addresses(this))this.addressMapping.removeCell(e);for(const t of r.values()){const r=(0,f.collectAddressesDependentToRange)(this.functionRegistry,t,e.getRange(),this.lazilyTransformingAstService,this);for(const e of r){const{vertex:r,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=n?n:r,t)}r.length>0&&this.graph.markNodeAsDirty(t)}this.removeVertex(e),this.arrayMapping.removeArray(e.getRange())}addVertex(e,t){this.graph.addNodeAndReturnId(t),this.addressMapping.setCell(e,t)}addArrayVertex(e,t){this.graph.addNodeAndReturnId(t),this.setAddressMappingForArrayVertex(t,e)}*arrayFormulaNodes(){for(const e of this.graph.getNodes())e instanceof p.ArrayVertex&&(yield e)}*entriesFromRowsSpan(e){yield*this.addressMapping.entriesFromRowsSpan(e)}*entriesFromColumnsSpan(e){yield*this.addressMapping.entriesFromColumnsSpan(e)}fetchCell(e){return this.addressMapping.fetchCell(e)}getCell(e){return this.addressMapping.getCell(e)}getCellValue(e){return this.addressMapping.getCellValue(e)}getRawValue(e){return this.addressMapping.getRawValue(e)}getScalarValue(e){const t=this.addressMapping.getCellValue(e);return t instanceof c.SimpleRangeValue?new s.CellError(s.ErrorType.VALUE,a.ErrorMessage.ScalarExpected):t}existsEdge(e,t){return this.graph.existsEdge(e,t)}getSheetId(e){return this.sheetMapping.fetch(e)}getSheetHeight(e){return this.addressMapping.getHeight(e)}getSheetWidth(e){return this.addressMapping.getWidth(e)}getArray(e){return this.arrayMapping.getArray(e)}getRange(e,t){return this.rangeMapping.getRange(e,t)}topSortWithScc(){return this.graph.topSortWithScc()}markAsVolatile(e){this.graph.markNodeAsVolatile(e)}markAsDependentOnStructureChange(e){this.graph.markNodeAsChangingWithStructure(e)}forceApplyPostponedTransformations(){for(const e of this.graph.getNodes())e instanceof p.FormulaCellVertex&&e.ensureRecentData(this.lazilyTransformingAstService)}*rawValuesFromRange(e){for(const t of e.addresses(this)){const e=this.getScalarValue(t);e!==u.EmptyValue&&(yield[(0,u.getRawValue)(e),t])}}computeListOfValuesInRange(e){const t=[];for(const r of e.addresses(this)){const e=this.getScalarValue(r);t.push(e)}return t}shrinkArrayToCorner(e){this.cleanAddressMappingUnderArray(e);for(const t of this.adjacentArrayVertices(e)){let r;r=t instanceof E.FormulaVertex?this.formulaDirectDependenciesToArray(t,e):this.rangeDirectDependenciesToArray(t,e);let n=!1;for(const[o,s]of r)e.isLeftCorner(o)&&(n=!0),this.graph.addEdge(s,t),this.graph.markNodeAsDirty(s);n||this.graph.removeEdge(e,t)}this.graph.markNodeAsDirty(e)}isArrayInternalCell(e){const t=this.getCell(e);return t instanceof p.ArrayVertex&&!t.isLeftCorner(e)}getAndClearContentChanges(){const e=this.changes;return this.changes=i.ContentChanges.empty(),e}getAdjacentNodesAddresses(e){const t=this.graph.adjacentNodes(e),r=[];return t.forEach(e=>{const t=e;t instanceof p.RangeVertex?r.push((0,n.simpleCellRange)(t.start,t.end)):r.push(t.getAddress(this.lazilyTransformingAstService))}),r}exchangeGraphNode(e,t){this.graph.addNodeAndReturnId(t);const r=this.graph.adjacentNodes(e);this.removeVertex(e),r.forEach(e=>{this.graph.hasNode(e)&&this.graph.addEdge(t,e)})}setArray(e,t){this.arrayMapping.setArray(e,t)}correctInfiniteRangesDependency(e){const t=this.graph.getInfiniteRanges().filter(({node:t})=>t.range.addressInRange(e));if(t.length<=0)return;const{vertex:r,id:n}=this.fetchCellOrCreateEmpty(e),o=null!=n?n:this.graph.getNodeId(r);t.forEach(({id:e})=>{this.graph.addEdge(o,e)})}exchangeOrAddGraphNode(e,t){e?this.exchangeGraphNode(e,t):this.graph.addNodeAndReturnId(t)}getArrayVerticesRelatedToRanges(e){const t=new Set;return e.forEach(e=>{this.graph.hasNode(e)&&this.graph.adjacentNodes(e).forEach(e=>{e instanceof p.ArrayVertex&&t.add(e)})}),t}correctInfiniteRangesDependenciesByRangeVertex(e){this.graph.getInfiniteRanges().forEach(({id:t,node:r})=>{const n=e.range.intersectionWith(r.range);void 0!==n&&n.addresses(this).forEach(e=>{const{vertex:r,id:n}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=n?n:r,t)})})}cleanAddressMappingUnderArray(e){const t=e.getRange();for(const r of t.addresses(this)){const t=e.getArrayCellValue(r);this.getCell(r)===e?e.isLeftCorner(r)?this.changes.addChange(new s.CellError(s.ErrorType.REF),r,t):(this.addressMapping.removeCell(r),this.changes.addChange(u.EmptyValue,r,t)):this.changes.addChange(u.EmptyValue,r,t)}}*formulaDirectDependenciesToArray(e,t){var r;const[,o]=null!==(r=this.formulaDependencyQuery(e))&&void 0!==r?r:[];if(void 0!==o)for(const e of o)if(!(e instanceof l.NamedExpressionDependency||e instanceof n.AbsoluteCellRange)&&t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e).vertex;yield[e,t]}}*rangeDirectDependenciesToArray(e,t){const{restRange:r}=this.rangeMapping.findSmallerRange(e.range);for(const e of r.addresses(this))if(t.getRange().addressInRange(e)){const t=this.fetchCellOrCreateEmpty(e).vertex;yield[e,t]}}*adjacentArrayVertices(e){const t=this.graph.adjacentNodes(e);for(const e of t)(e instanceof E.FormulaVertex||e instanceof p.RangeVertex)&&(yield e)}addStructuralNodesToChangeSet(){this.graph.markChangingWithStructureNodesAsDirty()}fixRangesWhenAddingRows(e,t,r){const o=Array.from(this.rangeMapping.rangesInSheet(e));for(const e of o)if(e.range.includesRow(t+r))if(e.bruteForce){const n=e.range.rangeWithSameWidth(t,r);for(const t of n.addresses(this)){const{vertex:r,id:n}=this.fetchCellOrCreateEmpty(t);this.graph.addEdge(null!=n?n:r,e)}}else{let t=e,r=this.rangeMapping.findSmallerRange(t.range);if(void 0!==r.smallerRangeVertex)continue;for(;void 0===r.smallerRangeVertex;){const e=new p.RangeVertex(n.AbsoluteCellRange.spanFrom(t.range.start,t.range.width(),t.range.height()-1));this.rangeMapping.setRange(e),this.graph.addNodeAndReturnId(e);const o=new n.AbsoluteCellRange((0,s.simpleCellAddress)(t.range.start.sheet,t.range.start.col,t.range.end.row),t.range.end);this.addAllFromRange(o,t),this.graph.addEdge(e,t),t=e,r=this.rangeMapping.findSmallerRange(t.range)}this.graph.addEdge(r.smallerRangeVertex,t),this.addAllFromRange(r.restRange,t),this.graph.removeEdge(r.smallerRangeVertex,e)}}addAllFromRange(e,t){for(const r of e.addresses(this)){const{vertex:e,id:n}=this.fetchCellOrCreateEmpty(r);this.graph.addEdge(null!=n?n:e,t)}}fixRangesWhenAddingColumns(e,t,r){for(const o of this.rangeMapping.rangesInSheet(e))if(o.range.includesColumn(t+r)){let i;i=o.bruteForce?o.range.rangeWithSameHeight(t,r):n.AbsoluteCellRange.spanFrom((0,s.simpleCellAddress)(e,t,o.range.end.row),r,1);for(const e of i.addresses(this)){const{vertex:t,id:r}=this.fetchCellOrCreateEmpty(e);this.graph.addEdge(null!=r?r:t,o)}}}exchangeOrAddFormulaVertex(e){const t=e.getAddress(this.lazilyTransformingAstService),r=n.AbsoluteCellRange.spanFrom(t,e.width,e.height),o=this.shrinkPossibleArrayAndGetCell(t);if(e instanceof p.ArrayVertex&&this.setArray(r,e),this.exchangeOrAddGraphNode(o,e),this.addressMapping.setCell(t,e),e instanceof p.ArrayVertex){if(!this.isThereSpaceForArray(e))return;for(const t of r.addresses(this)){if(e.isLeftCorner(t))continue;const r=this.getCell(t);this.exchangeOrAddGraphNode(r,e)}}for(const t of r.addresses(this))this.addressMapping.setCell(t,e)}setAddressMappingForArrayVertex(e,t){if(this.addressMapping.setCell(t,e),!(e instanceof p.ArrayVertex))return;const r=n.AbsoluteCellRange.spanFromOrUndef(t,e.width,e.height);if(void 0!==r&&(this.setArray(r,e),this.isThereSpaceForArray(e)))for(const t of r.addresses(this))this.addressMapping.setCell(t,e)}truncateRanges(e,t){const{verticesToRemove:r,verticesToMerge:n,verticesWithChangedSize:o}=this.rangeMapping.truncateRanges(e,t);for(const[e,t]of n)this.mergeRangeVertices(e,t);for(const e of r)this.removeVertexAndCleanupDependencies(e);return o}fixArraysAfterAddingRow(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,r),!(t<=0))for(const[,n]of this.arrayMapping.arraysInRows(h.RowsSpan.fromRowStartAndEnd(e,t-1,t-1))){const o=n.getRange();for(let i=o.start.col;i<=o.end.col;++i)for(let a=t;a<=o.end.row;++a){const t=(0,s.simpleCellAddress)(e,i,a),o=(0,s.simpleCellAddress)(e,i,a+r),c=n.getArrayCellValue(t);this.addressMapping.moveCell(o,t),this.changes.addChange(u.EmptyValue,o,c)}}}fixArraysAfterRemovingRows(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterRowByRows(e,t,-r),!(t<=0))for(const[,r]of this.arrayMapping.arraysInRows(h.RowsSpan.fromRowStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}fixArraysAfterAddingColumn(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,r),!(t<=0))for(const[,n]of this.arrayMapping.arraysInCols(h.ColumnsSpan.fromColumnStartAndEnd(e,t-1,t-1))){const o=n.getRange();for(let i=o.start.row;i<=o.end.row;++i)for(let a=t;a<=o.end.col;++a){const t=(0,s.simpleCellAddress)(e,a,i),o=(0,s.simpleCellAddress)(e,a+r,i),c=n.getArrayCellValue(t);this.addressMapping.moveCell(o,t),this.changes.addChange(u.EmptyValue,o,c)}}}fixArraysAfterRemovingColumns(e,t,r){if(this.arrayMapping.moveArrayVerticesAfterColumnByColumns(e,t,-r),!(t<=0))for(const[,r]of this.arrayMapping.arraysInCols(h.ColumnsSpan.fromColumnStartAndEnd(e,t-1,t-1)))if(this.isThereSpaceForArray(r))for(const e of r.getRange().addresses(this))this.addressMapping.setCell(e,r);else this.setNoSpaceIfArray(r)}shrinkPossibleArrayAndGetCell(e){const t=this.getCell(e);return t instanceof p.ArrayVertex?(this.setNoSpaceIfArray(t),this.getCell(e)):t}setNoSpaceIfArray(e){e instanceof p.ArrayVertex&&(this.shrinkArrayToCorner(e),e.setNoSpace())}removeVertex(e){this.removeVertexAndCleanupDependencies(e),e instanceof p.RangeVertex&&this.rangeMapping.removeRange(e)}mergeRangeVertices(e,t){const r=this.graph.adjacentNodes(t);this.removeVertexAndCleanupDependencies(t),this.graph.removeEdgeIfExists(e,t),r.forEach(t=>{this.graph.hasNode(t)&&this.graph.addEdge(e,t)})}removeVertexAndCleanupDependencies(e){const t=new Set(this.graph.removeNode(e));for(;t.size>0;){const e=t.values().next().value;t.delete(e);const[r,n]=e;this.graph.hasNode(n)&&0===this.graph.adjacentNodesCount(n)&&((n instanceof p.RangeVertex||n instanceof p.EmptyCellVertex)&&this.graph.removeNode(n).forEach(e=>t.add(e)),n instanceof p.RangeVertex?this.rangeMapping.removeRange(n):n instanceof p.EmptyCellVertex&&this.addressMapping.removeCell(r))}}}t.DependencyGraph=R},function(e,t,r){"use strict";t.__esModule=!0,t.filterDependenciesOutOfScope=t.absolutizeDependencies=void 0;var n=r(72),o=r(73),s=r(77);t.absolutizeDependencies=(e,t)=>e.map(e=>e.absolutize(t));t.filterDependenciesOutOfScope=e=>e.filter(e=>e instanceof s.NamedExpressionDependency||(e instanceof n.AbsoluteCellRange?!((0,o.invalidSimpleCellAddress)(e.start)||(0,o.invalidSimpleCellAddress)(e.end)):!(0,o.invalidSimpleCellAddress)(e)))},function(e,t,r){"use strict";t.__esModule=!0,t.simpleCellRangeToString=t.simpleCellRangeFromString=t.simpleCellAddressToString=t.simpleCellAddressFromString=t.collectDependencies=t.cellAddressFromString=t.buildProcedureAst=t.buildParsingErrorAst=t.buildLexerConfig=t.buildCellRangeAst=t.buildCellErrorAst=t.Unparser=t.RowRangeDependency=t.ParsingErrorType=t.ParserWithCaching=t.NamedExpressionDependency=t.FormulaLexer=t.ColumnRangeDependency=t.CellRangeDependency=t.CellAddress=t.AstNodeType=t.AddressDependency=void 0;var n=r(78);t.cellAddressFromString=n.cellAddressFromString,t.simpleCellAddressFromString=n.simpleCellAddressFromString,t.simpleCellAddressToString=n.simpleCellAddressToString,t.simpleCellRangeFromString=n.simpleCellRangeFromString,t.simpleCellRangeToString=n.simpleCellRangeToString;var o=r(79);t.CellAddress=o.CellAddress;var s=r(83);t.ParserWithCaching=s.ParserWithCaching;var i=r(136);t.collectDependencies=i.collectDependencies;var a=r(132);t.buildLexerConfig=a.buildLexerConfig;var u=r(130);t.FormulaLexer=u.FormulaLexer;var c=r(127);t.AstNodeType=c.AstNodeType,t.ParsingErrorType=c.ParsingErrorType,t.buildProcedureAst=c.buildProcedureAst,t.buildCellRangeAst=c.buildCellRangeAst,t.buildParsingErrorAst=c.buildParsingErrorAst,t.buildCellErrorAst=c.buildCellErrorAst;var l=r(135);t.Unparser=l.Unparser;var h=r(137);t.AddressDependency=h.AddressDependency,t.CellRangeDependency=h.CellRangeDependency,t.ColumnRangeDependency=h.ColumnRangeDependency,t.RowRangeDependency=h.RowRangeDependency,t.NamedExpressionDependency=h.NamedExpressionDependency},function(e,t,r){"use strict";t.__esModule=!0,t.columnAddressFromString=t.cellAddressFromString=void 0,t.columnIndexToLabel=f,t.rowAddressFromString=void 0,t.sheetIndexToString=E,t.simpleCellRangeToString=t.simpleCellRangeFromString=t.simpleCellAddressToString=t.simpleCellAddressFromString=void 0;var n=r(72),o=r(73),s=r(79),i=r(80),a=r(82),u=r(81);
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
const c=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([A-Za-z]+)(\\${a.ABSOLUTE_OPERATOR}?)([0-9]+)$`),l=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([A-Za-z]+)$`),h=new RegExp(`^(${a.SHEET_NAME_PATTERN})?(\\${a.ABSOLUTE_OPERATOR}?)([0-9]+)$`),d=new RegExp(`^${a.UNQUOTED_SHEET_NAME_PATTERN}$`);t.cellAddressFromString=(e,t,r)=>{const n=c.exec(t),o=g(n[6]);let i=T(n,e);if(void 0===i)return;null===i&&(i=void 0);const u=Number(n[8])-1;return n[5]===a.ABSOLUTE_OPERATOR&&n[7]===a.ABSOLUTE_OPERATOR?s.CellAddress.absolute(o,u,i):n[5]===a.ABSOLUTE_OPERATOR?s.CellAddress.absoluteCol(o,u-r.row,i):n[7]===a.ABSOLUTE_OPERATOR?s.CellAddress.absoluteRow(o-r.col,u,i):s.CellAddress.relative(o-r.col,u-r.row,i)};t.columnAddressFromString=(e,t,r)=>{const n=l.exec(t);let o=T(n,e);if(void 0===o)return;null===o&&(o=void 0);const s=g(n[6]);return n[5]===a.ABSOLUTE_OPERATOR?i.ColumnAddress.absolute(s,o):i.ColumnAddress.relative(s-r.col,o)};t.rowAddressFromString=(e,t,r)=>{const n=h.exec(t);let o=T(n,e);if(void 0===o)return;null===o&&(o=void 0);const s=Number(n[6])-1;return n[5]===a.ABSOLUTE_OPERATOR?u.RowAddress.absolute(s,o):u.RowAddress.relative(s-r.row,o)};const p=(e,t,r)=>{const n=c.exec(t);if(!n)return;const s=g(n[6]);let i=T(n,e);if(void 0===i)return;null===i&&(i=r);const a=Number(n[8])-1;return(0,o.simpleCellAddress)(i,s,a)};t.simpleCellAddressFromString=p;t.simpleCellRangeFromString=(e,t,r)=>{const o=t.split(a.RANGE_OPERATOR);if(2!==o.length)return;const[s,i]=o,u=p(e,s,r);if(void 0===u)return;const c=p(e,i,u.sheet);return void 0!==c&&u.sheet===c.sheet?(0,n.simpleCellRange)(u,c):void 0};const m=(e,t,r)=>{const n=f(t.col),o=E(t.sheet,e);if(void 0!==o)return r!==t.sheet?`${o}!${n}${t.row+1}`:`${n}${t.row+1}`};t.simpleCellAddressToString=m;function g(e){return 1===e.length?e.toUpperCase().charCodeAt(0)-65:e.split("").reduce((e,t)=>26*e+(t.toUpperCase().charCodeAt(0)-64),0)-1}function f(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+97)+t,e=Math.floor(e/26)-1;return t.toUpperCase()}function E(e,t){let r=t(e);if(void 0!==r)return d.test(r)?r:(r=r.replace(/'/g,"''"),`'${r}'`)}function T(e,t){var r;let n=null!==(r=e[3])&&void 0!==r?r:e[2];return n?(n=n.replace(/''/g,"'"),t(n)):null}t.simpleCellRangeToString=(e,t,r)=>{const n=m(e,t.start,r),o=m(e,t.end,t.start.sheet);return void 0===n||void 0===o?void 0:`${n}${a.RANGE_OPERATOR}${o}`}},function(e,t,r){"use strict";t.__esModule=!0,t.CellReferenceType=t.CellAddress=void 0;var n,o=r(73),s=r(78),i=r(80),a=r(81);!function(e){e.CELL_REFERENCE_RELATIVE="CELL_REFERENCE",e.CELL_REFERENCE_ABSOLUTE="CELL_REFERENCE_ABSOLUTE",e.CELL_REFERENCE_ABSOLUTE_COL="CELL_REFERENCE_ABSOLUTE_COL",e.CELL_REFERENCE_ABSOLUTE_ROW="CELL_REFERENCE_ABSOLUTE_ROW"}(n||(t.CellReferenceType=n={}));class u{constructor(e,t,r,n){this.col=e,this.row=t,this.type=r,this.sheet=n}static fromColAndRow(e,t,r){return(e.isColumnAbsolute()&&t.isRowAbsolute()?u.absolute.bind(this):e.isColumnAbsolute()?u.absoluteCol.bind(this):t.isRowAbsolute()?u.absoluteRow.bind(this):u.relative.bind(this))(e.col,t.row,r)}static relative(e,t,r){return new u(e,t,n.CELL_REFERENCE_RELATIVE,r)}static absolute(e,t,r){return new u(e,t,n.CELL_REFERENCE_ABSOLUTE,r)}static absoluteCol(e,t,r){return new u(e,t,n.CELL_REFERENCE_ABSOLUTE_COL,r)}static absoluteRow(e,t,r){return new u(e,t,n.CELL_REFERENCE_ABSOLUTE_ROW,r)}toSimpleCellAddress(e){const t=(0,o.absoluteSheetReference)(this,e);return this.type===n.CELL_REFERENCE_ABSOLUTE?(0,o.simpleCellAddress)(t,this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?(0,o.simpleCellAddress)(t,e.col+this.col,this.row):this.type===n.CELL_REFERENCE_ABSOLUTE_COL?(0,o.simpleCellAddress)(t,this.col,e.row+this.row):(0,o.simpleCellAddress)(t,e.col+this.col,e.row+this.row)}toColumnAddress(){const e=this.isColumnRelative()?i.ReferenceType.RELATIVE:i.ReferenceType.ABSOLUTE;return new i.ColumnAddress(e,this.col,this.sheet)}toRowAddress(){const e=this.isRowRelative()?i.ReferenceType.RELATIVE:i.ReferenceType.ABSOLUTE;return new a.RowAddress(e,this.row,this.sheet)}toSimpleColumnAddress(e){const t=(0,o.absoluteSheetReference)(this,e);let r=this.col;return this.isColumnRelative()&&(r+=e.col),(0,o.simpleColumnAddress)(t,r)}toSimpleRowAddress(e){const t=(0,o.absoluteSheetReference)(this,e);let r=this.row;return this.isRowRelative()&&(r+=e.row),(0,o.simpleRowAddress)(t,r)}isRowAbsolute(){return this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW}isColumnAbsolute(){return this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL}isColumnRelative(){return this.type===n.CELL_REFERENCE_RELATIVE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW}isRowRelative(){return this.type===n.CELL_REFERENCE_RELATIVE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL}isAbsolute(){return this.type===n.CELL_REFERENCE_ABSOLUTE&&void 0!==this.sheet}shiftedByRows(e){return new u(this.col,this.row+e,this.type,this.sheet)}shiftedByColumns(e){return new u(this.col+e,this.row,this.type,this.sheet)}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new u(this.col+t,this.row+r,this.type,n)}withSheet(e){return new u(this.col,this.row,this.type,e)}isInvalid(e){return(0,o.invalidSimpleCellAddress)(this.toSimpleCellAddress(e))}shiftRelativeDimensions(e,t){const r=this.isColumnAbsolute()?this.col:this.col+e,n=this.isRowAbsolute()?this.row:this.row+t;return new u(r,n,this.type,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isColumnRelative()?this.col:this.col+e,n=this.isRowRelative()?this.row:this.row+t;return new u(r,n,this.type,this.sheet)}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case n.CELL_REFERENCE_RELATIVE:return`${t}#${this.row}R${this.col}`;case n.CELL_REFERENCE_ABSOLUTE:return`${t}#${this.row}A${this.col}`;case n.CELL_REFERENCE_ABSOLUTE_COL:return`${t}#${this.row}AC${this.col}`;case n.CELL_REFERENCE_ABSOLUTE_ROW:return`${t}#${this.row}AR${this.col}`}}unparse(e){const t=this.toSimpleCellAddress(e);if((0,o.invalidSimpleCellAddress)(t))return;const r=(0,s.columnIndexToLabel)(t.col),i=this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_ROW?"$":"";return`${this.type===n.CELL_REFERENCE_ABSOLUTE||this.type===n.CELL_REFERENCE_ABSOLUTE_COL?"$":""}${r}${i}${t.row+1}`}exceedsSheetSizeLimits(e,t){return this.row>=t||this.col>=e}}t.CellAddress=u},function(e,t,r){"use strict";t.__esModule=!0,t.ReferenceType=t.ColumnAddress=void 0;var n,o=r(73),s=r(78);!function(e){e.RELATIVE="RELATIVE",e.ABSOLUTE="ABSOLUTE"}(n||(t.ReferenceType=n={}));class i{constructor(e,t,r){this.type=e,this.col=t,this.sheet=r}static absolute(e,t){return new i(n.ABSOLUTE,e,t)}static relative(e,t){return new i(n.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,r)=>t.toSimpleColumnAddress(e).col-r.toSimpleColumnAddress(e).col}isColumnAbsolute(){return this.type===n.ABSOLUTE}isColumnRelative(){return this.type===n.RELATIVE}isAbsolute(){return this.type===n.ABSOLUTE&&void 0!==this.sheet}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new i(this.type,this.col+t,n)}shiftedByColumns(e){return new i(this.type,this.col+e,this.sheet)}toSimpleColumnAddress(e){const t=(0,o.absoluteSheetReference)(this,e);let r=this.col;return this.isColumnRelative()&&(r=e.col+this.col),(0,o.simpleColumnAddress)(t,r)}shiftRelativeDimensions(e,t){const r=this.isColumnRelative()?this.col+e:this.col;return new i(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isColumnAbsolute()?this.col+e:this.col;return new i(this.type,r,this.sheet)}withSheet(e){return new i(this.type,this.col,e)}isInvalid(e){return this.toSimpleColumnAddress(e).col<0}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case n.RELATIVE:return`${t}#COLR${this.col}`;case n.ABSOLUTE:return`${t}#COLA${this.col}`}}unparse(e){const t=this.toSimpleColumnAddress(e);if((0,o.invalidSimpleColumnAddress)(t))return;const r=(0,s.columnIndexToLabel)(t.col);return`${this.type===n.ABSOLUTE?"$":""}${r}`}exceedsSheetSizeLimits(e){return this.col>=e}}t.ColumnAddress=i},function(e,t,r){"use strict";t.__esModule=!0,t.RowAddress=void 0;var n=r(73),o=r(80);
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
class s{constructor(e,t,r){this.type=e,this.row=t,this.sheet=r}static absolute(e,t){return new s(o.ReferenceType.ABSOLUTE,e,t)}static relative(e,t){return new s(o.ReferenceType.RELATIVE,e,t)}static compareByAbsoluteAddress(e){return(t,r)=>t.toSimpleRowAddress(e).row-r.toSimpleRowAddress(e).row}isRowAbsolute(){return this.type===o.ReferenceType.ABSOLUTE}isRowRelative(){return this.type===o.ReferenceType.RELATIVE}isAbsolute(){return this.type===o.ReferenceType.ABSOLUTE&&void 0!==this.sheet}moved(e,t,r){const n=void 0===this.sheet?void 0:e;return new s(this.type,this.row+r,n)}shiftedByRows(e){return new s(this.type,this.row+e,this.sheet)}toSimpleRowAddress(e){const t=(0,n.absoluteSheetReference)(this,e);let r=this.row;return this.isRowRelative()&&(r=e.row+this.row),(0,n.simpleRowAddress)(t,r)}shiftRelativeDimensions(e,t){const r=this.isRowRelative()?this.row+t:this.row;return new s(this.type,r,this.sheet)}shiftAbsoluteDimensions(e,t){const r=this.isRowAbsolute()?this.row+t:this.row;return new s(this.type,r,this.sheet)}withSheet(e){return new s(this.type,this.row,e)}isInvalid(e){return this.toSimpleRowAddress(e).row<0}hash(e){const t=e&&void 0!==this.sheet?"#"+this.sheet:"";switch(this.type){case o.ReferenceType.RELATIVE:return`${t}#ROWR${this.row}`;case o.ReferenceType.ABSOLUTE:return`${t}#ROWA${this.row}`}}unparse(e){const t=this.toSimpleRowAddress(e);if((0,n.invalidSimpleRowAddress)(t))return;return`${this.type===o.ReferenceType.ABSOLUTE?"$":""}${t.row+1}`}exceedsSheetSizeLimits(e){return this.row>=e}}t.RowAddress=s},function(e,t,r){"use strict";t.__esModule=!0,t.UNQUOTED_SHEET_NAME_PATTERN=t.UNICODE_LETTER_PATTERN=t.SHEET_NAME_PATTERN=t.ROW_REFERENCE_PATTERN=t.RANGE_OPERATOR=t.R1C1_CELL_REFERENCE_PATTERN=t.QUOTED_SHEET_NAME_PATTERN=t.ODFF_WHITESPACE_PATTERN=t.NON_RESERVED_CHARACTER_PATTERN=t.NAMED_EXPRESSION_PATTERN=t.COLUMN_REFERENCE_PATTERN=t.CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN=t.CELL_REFERENCE_PATTERN=t.ALL_WHITESPACE_PATTERN=t.ALL_UNICODE_LETTERS_ARRAY=t.ALL_DIGITS_ARRAY=t.ABSOLUTE_OPERATOR=void 0;
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
t.RANGE_OPERATOR=":";const n=t.ABSOLUTE_OPERATOR="$",o=(t.ALL_WHITESPACE_PATTERN="\\s+",t.ODFF_WHITESPACE_PATTERN="[ \\t\\n\\r]+",t.UNICODE_LETTER_PATTERN="A-Za-zÀ-ʯ"),s=t.NON_RESERVED_CHARACTER_PATTERN=o+"0-9_.",i=t.UNQUOTED_SHEET_NAME_PATTERN=`[${o}0-9_]+`,a=t.QUOTED_SHEET_NAME_PATTERN="'(((?!').|'')*)'",u=t.SHEET_NAME_PATTERN=`(${i}|${a})!`,c=t.CELL_REFERENCE_PATTERN=`(${u})?\\${n}?[A-Za-z]+\\${n}?[0-9]+`;t.COLUMN_REFERENCE_PATTERN=`(${u})?\\${n}?[A-Za-z]+`,t.ROW_REFERENCE_PATTERN=`(${u})?\\${n}?[0-9]+`,t.R1C1_CELL_REFERENCE_PATTERN="[rR][0-9]*[cC][0-9]*",t.CELL_REFERENCE_WITH_NEXT_CHARACTER_PATTERN=`(${c})[^${s}]`,t.NAMED_EXPRESSION_PATTERN=`[${o}_][${s}]*`,t.ALL_DIGITS_ARRAY=["0","1","2","3","4","5","6","7","8","9"],t.ALL_UNICODE_LETTERS_ARRAY=[...Array.from(Array(26)).map((e,t)=>t+"A".charCodeAt(0)),...Array.from(Array(26)).map((e,t)=>t+"a".charCodeAt(0)),...Array.from(Array(496)).map((e,t)=>t+192)].map(e=>String.fromCharCode(e))},function(e,t,r){"use strict";t.__esModule=!0,t.ParserWithCaching=void 0,r(2);var n=r(84),o=r(73),s=r(77),i=r(78),a=r(127),u=r(128),c=r(129),l=r(130),h=r(132),d=r(135),p=r(80),m=r(81);
/**
* @license
* Copyright (c) 2024 Handsoncode. All rights reserved.
*/
class g{constructor(e,t,r){this.config=e,this.functionRegistry=t,this.sheetMapping=r,this.statsCacheUsed=0,this.lexerConfig=(0,h.buildLexerConfig)(e),this.lexer=new l.FormulaLexer(this.lexerConfig),this.formulaParser=new l.FormulaParser(this.lexerConfig,this.sheetMapping),this.cache=new c.Cache(this.functionRegistry)}parse(e,t){this.formulaAddress=t;const r=this.tokenizeFormula(e);if(r.errors.length>0){const e=r.errors.map(e=>({type:a.ParsingErrorType.LexingError,message:e.message}));return{ast:(0,s.buildParsingErrorAst)(),errors:e,hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]}}const n=this.computeHashFromTokens(r.tokens,t);let o=this.cache.get(n);if(void 0!==o)++this.statsCacheUsed;else{const e=this.bindWhitespacesToTokens(r.tokens),s=this.formulaParser.parseFromTokens(e,t);if(s.errors.length>0)return Object.assign(Object.assign({},s),{hasVolatileFunction:!1,hasStructuralChangeFunction:!1,dependencies:[]});o=this.cache.set(n,s.ast)}const{ast:i,hasVolatileFunction:u,hasStructuralChangeFunction:c}=o,l=this.convertReversedRangesToRegularRanges(i);return{ast:l,errors:[],hasVolatileFunction:u,hasStructuralChangeFunction:c,dependencies:(0,s.collectDependencies)(l,this.functionRegistry)}}convertReversedRangesToRegularRanges(e){switch(e.type){case s.AstNodeType.EMPTY:case s.AstNodeType.NUMBER:case s.AstNodeType.STRING:case s.AstNodeType.ERROR:case s.AstNodeType.ERROR_WITH_RAW_INPUT:case s.AstNodeType.CELL_REFERENCE:case s.AstNodeType.NAMED_EXPRESSION:return e;case s.AstNodeType.CELL_RANGE:{const{start:t,end:r}=e,n=this.orderCellRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case s.AstNodeType.COLUMN_RANGE:{const{start:t,end:r}=e,n=this.orderColumnRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case s.AstNodeType.ROW_RANGE:{const{start:t,end:r}=e,n=this.orderRowRangeEnds(t,r);return Object.assign(Object.assign({},e),{start:n.start,end:n.end})}case s.AstNodeType.PERCENT_OP:case s.AstNodeType.PLUS_UNARY_OP:case s.AstNodeType.MINUS_UNARY_OP:{const t=this.convertReversedRangesToRegularRanges(e.value);return Object.assign(Object.assign({},e),{value:t})}case s.AstNodeType.CONCATENATE_OP:case s.AstNodeType.EQUALS_OP:case s.AstNodeType.NOT_EQUAL_OP:case s.AstNodeType.LESS_THAN_OP:case s.AstNodeType.GREATER_THAN_OP:case s.AstNodeType.LESS_THAN_OR_EQUAL_OP:case s.AstNodeType.GREATER_THAN_OR_EQUAL_OP:case s.AstNodeType.MINUS_OP:case s.AstNodeType.PLUS_OP:case s.AstNodeType.TIMES_OP:case s.AstNodeType.DIV_OP:case s.AstNodeType.POWER_OP:{const t=this.convertReversedRangesToRegularRanges(e.left),r=this.convertReversedRangesToRegularRanges(e.right);return Object.assign(Object.assign({},e),{left:t,right:r})}case s.AstNodeType.PARENTHESIS:{const t=this.convertReversedRangesToRegularRanges(e.expression);return Object.assign(Object.assign({},e),{expression:t})}case s.AstNodeType.FUNCTION_CALL:{const t=e.args.map(e=>this.convertReversedRangesToRegularRanges(e));return Object.assign(Object.assign({},e),{args:t})}case s.AstNodeType.ARRAY:{const t=e.args.map(e=>e.map(e=>this.convertReversedRangesToRegularRanges(e)));return Object.assign(Object.assign({},e),{args:t})}}}orderCellRangeEnds(e,t){const r=[e,t],[n,o]=r.map(e=>e.toColumnAddress()).sort(p.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[i,a]=r.map(e=>e.toRowAddress()).sort(m.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[u,c]=r.map(e=>e.sheet).sort(g.compareSheetIds.bind(this));return{start:s.CellAddress.fromColAndRow(n,i,u),end:s.CellAddress.fromColAndRow(o,a,c)}}orderColumnRangeEnds(e,t){const r=[e,t],[n,o]=r.sort(p.ColumnAddress.compareByAbsoluteAddress(this.formulaAddress)),[s,i]=r.map(e=>e.sheet).sort(g.compareSheetIds.bind(this));return{start:new p.ColumnAddress(n.type,n.col,s),end:new p.ColumnAddress(o.type,o.col,i)}}orderRowRangeEnds(e,t){const r=[e,t],[n,o]=r.sort(m.RowAddress.compareByAbsoluteAddress(this.formulaAddress)),[s,i]=r.map(e=>e.sheet).sort(g.compareSheetIds.bind(this));return{start:new m.RowAddress(n.type,n.row,s),end:new m.RowAddress(o.type,o.row,i)}}static compareSheetIds(e,t){return(e=null!=e?e:1/0)-(t=null!=t?t:1/0)}fetchCachedResultForAst(e){const t=this.computeHashFromAst(e);return this.fetchCachedResult(t)}fetchCachedResult(e){const t=this.cache.get(e);if(void 0===t)throw new Error("There is no AST with such key in the cache");{const{ast:e,hasVolatileFunction:r,hasStructuralChangeFunction:n,relativeDependencies:o}=t;return{ast:e,errors:[],hasVolatileFunction:r,hasStructuralChangeFunction:n,dependencies:o}}}computeHashFromTokens(e,t){var r;let o="",s=0;for(;sthis.computeHashOfAstNode(e)).join(this.config.functionArgSeparator),r=e.procedureName+"("+t+(0,a.imageWithWhitespace)(")",e.internalWhitespace);return(0,a.imageWithWhitespace)(r,e.leadingWhitespace)}case s.AstNodeType.CELL_REFERENCE:return(0,a.imageWithWhitespace)(e.reference.hash(!0),e.leadingWhitespace);case s.AstNodeType.COLUMN_RANGE:case s.AstNodeType.ROW_RANGE:case s.AstNodeType.CELL_RANGE:{const t=e.start.hash(e.sheetReferenceType!==a.RangeSheetReferenceType.RELATIVE),r=e.end.hash(e.sheetReferenceType===a.RangeSheetReferenceType.BOTH_ABSOLUTE);return(0,a.imageWithWhitespace)(t+":"+r,e.leadingWhitespace)}case s.AstNodeType.MINUS_UNARY_OP:return(0,a.imageWithWhitespace)("-"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case s.AstNodeType.PLUS_UNARY_OP:return(0,a.imageWithWhitespace)("+"+this.computeHashOfAstNode(e.value),e.leadingWhitespace);case s.AstNodeType.PERCENT_OP:return this.computeHashOfAstNode(e.value)+(0,a.imageWithWhitespace)("%",e.leadingWhitespace);case s.AstNodeType.ERROR:{const t=this.config.translationPackage.getErrorTranslation(e.error?e.error.type:o.ErrorType.ERROR);return(0,a.imageWithWhitespace)(t,e.leadingWhitespace)}case s.AstNodeType.ERROR_WITH_RAW_INPUT:return(0,a.imageWithWhitespace)(e.rawInput,e.leadingWhitespace);case s.AstNodeType.ARRAY:{const t=e.args.map(e=>e.map(e=>this.computeHashOfAstNode(e)).join(",")).join(";");return(0,a.imageWithWhitespace)("{"+t+(0,a.imageWithWhitespace)("}",e.internalWhitespace),e.leadingWhitespace)}case s.AstNodeType.PARENTHESIS:{const t="("+this.computeHashOfAstNode(e.expression)+(0,a.imageWithWhitespace)(")",e.internalWhitespace);return(0,a.imageWithWhitespace)(t,e.leadingWhitespace)}default:return this.computeHashOfAstNode(e.left)+(0,a.imageWithWhitespace)(u.binaryOpTokenMap[e.type],e.leadingWhitespace)+this.computeHashOfAstNode(e.right)}}bindWhitespacesToTokens(e){const t=[],r=e[0];(0,n.tokenMatcher)(r,this.lexerConfig.WhiteSpace)||t.push(r);for(let r=1;r IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the flag on the relevant DSL method instead."),this.ignoredIssues=Object(o.has)(t,"ignoredIssues")?t.ignoredIssues:S.ignoredIssues,this.skipValidations=Object(o.has)(t,"skipValidations")?t.skipValidations:S.skipValidations}return e.performSelfAnalysis=function(e){e.performSelfAnalysis()},e.prototype.performSelfAnalysis=function(){var t=this;this.TRACE_INIT("performSelfAnalysis",(function(){var r;t.selfAnalysisDone=!0;var n=t.className;t.TRACE_INIT("toFastProps",(function(){Object(o.toFastProperties)(t)})),t.TRACE_INIT("Grammar Recording",(function(){try{t.enableRecording(),Object(o.forEach)(t.definedRulesNames,(function(e){var r=t[e].originalGrammarAction,n=void 0;t.TRACE_INIT(e+" Rule",(function(){n=t.topLevelRuleRecord(e,r)})),t.gastProductionsCache[e]=n}))}finally{t.disableRecording()}}));var i=[];if(t.TRACE_INIT("Grammar Resolving",(function(){i=Object(c.resolveGrammar)({rules:Object(o.values)(t.gastProductionsCache)}),t.definitionErrors.push.apply(t.definitionErrors,i)})),t.TRACE_INIT("Grammar Validations",(function(){if(Object(o.isEmpty)(i)&&!1===t.skipValidations){var e=Object(c.validateGrammar)({rules:Object(o.values)(t.gastProductionsCache),maxLookahead:t.maxLookahead,tokenTypes:Object(o.values)(t.tokensMap),ignoredIssues:t.ignoredIssues,errMsgProvider:u.defaultGrammarValidatorErrorProvider,grammarName:n});t.definitionErrors.push.apply(t.definitionErrors,e)}})),Object(o.isEmpty)(t.definitionErrors)&&(t.recoveryEnabled&&t.TRACE_INIT("computeAllProdsFollows",(function(){var e=Object(s.computeAllProdsFollows)(Object(o.values)(t.gastProductionsCache));t.resyncFollows=e})),t.TRACE_INIT("ComputeLookaheadFunctions",(function(){t.preComputeLookaheadFunctions(Object(o.values)(t.gastProductionsCache))}))),t.TRACE_INIT("expandAllNestedRuleNames",(function(){var e=Object(a.expandAllNestedRuleNames)(Object(o.values)(t.gastProductionsCache),t.fullRuleNameToShort);t.allRuleNames=e.allRuleNames})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&!Object(o.isEmpty)(t.definitionErrors))throw r=Object(o.map)(t.definitionErrors,(function(e){return e.message})),new Error("Parser Definition Errors detected:\n "+r.join("\n-------------------------------\n"))}))},e.DEFER_DEFINITION_ERRORS_HANDLING=!1,e}();Object(o.applyMixins)(O,[l.Recoverable,h.LooksAhead,d.TreeBuilder,p.LexerAdapter,g.RecognizerEngine,m.RecognizerApi,f.ErrorHandler,E.ContentAssist,T.GastRecorder,y.PerformanceTracer]);var I=function(e){function t(t,r){void 0===r&&(r=S);var n=Object(o.cloneObj)(r);return n.outputCst=!0,e.call(this,t,n)||this}return A(t,e),t}(O),M=function(e){function t(t,r){void 0===r&&(r=S);var n=Object(o.cloneObj)(r);return n.outputCst=!1,e.call(this,t,n)||this}return A(t,e),t}(O)},function(e,t,r){"use strict";function n(e){return e&&0===e.length}function o(e){return null==e?[]:Object.keys(e)}function s(e){for(var t=[],r=Object.keys(e),n=0;n property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(t.safeMode&&t.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),Object(s.isArray)(e)?((n={modes:{}}).modes[o.DEFAULT_MODE]=Object(s.cloneArr)(e),n[o.DEFAULT_MODE]=o.DEFAULT_MODE):(a=!1,n=Object(s.cloneObj)(e))})),!1===r.config.skipValidations&&(r.TRACE_INIT("performRuntimeChecks",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(Object(o.performRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))})),r.TRACE_INIT("performWarningRuntimeChecks",(function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat(Object(o.performWarningRuntimeChecks)(n,r.trackStartLines,r.config.lineTerminatorCharacters))}))),n.modes=n.modes?n.modes:{},Object(s.forEach)(n.modes,(function(e,t){n.modes[t]=Object(s.reject)(e,(function(e){return Object(s.isUndefined)(e)}))}));var l=Object(s.keys)(n.modes);if(Object(s.forEach)(n.modes,(function(e,n){r.TRACE_INIT("Mode: <"+n+"> processing",(function(){var a;(r.modes.push(n),!1===r.config.skipValidations&&r.TRACE_INIT("validatePatterns",(function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(Object(o.validatePatterns)(e,l))})),Object(s.isEmpty)(r.lexerDefinitionErrors))&&(Object(i.augmentTokenTypes)(e),r.TRACE_INIT("analyzeTokenTypes",(function(){a=Object(o.analyzeTokenTypes)(e,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:r.TRACE_INIT.bind(r)})})),r.patternIdxToConfig[n]=a.patternIdxToConfig,r.charCodeToPatternIdxToConfig[n]=a.charCodeToPatternIdxToConfig,r.emptyGroups=Object(s.merge)(r.emptyGroups,a.emptyGroups),r.hasCustom=a.hasCustom||r.hasCustom,r.canModeBeOptimized[n]=a.canBeOptimized)}))})),r.defaultMode=n.defaultMode,!Object(s.isEmpty)(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var h=Object(s.map)(r.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+h)}Object(s.forEach)(r.lexerDefinitionWarning,(function(e){Object(s.PRINT_WARNING)(e.message)})),r.TRACE_INIT("Choosing sub-methods implementations",(function(){if(o.SUPPORT_STICKY?(r.chopInput=s.IDENTITY,r.match=r.matchWithTest):(r.updateLastIndex=s.NOOP,r.match=r.matchWithExec),a&&(r.handleModes=s.NOOP),!1===r.trackStartLines&&(r.computeNewColumn=s.IDENTITY),!1===r.trackEndLines&&(r.updateTokenEndLineColumnLocation=s.NOOP),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else{if(!/onlyOffset/i.test(r.config.positionTracking))throw Error('Invalid config option: "'+r.config.positionTracking+'"');r.createTokenInstance=r.createOffsetOnlyToken}r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)})),r.TRACE_INIT("Failed Optimization Warnings",(function(){var e=Object(s.reduce)(r.canModeBeOptimized,(function(e,t,r){return!1===t&&e.push(r),e}),[]);if(t.ensureOptimizations&&!Object(s.isEmpty)(e))throw Error("Lexer Modes: < "+e.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')})),r.TRACE_INIT("clearRegExpParserCache",(function(){Object(u.clearRegExpParserCache)()})),r.TRACE_INIT("toFastProperties",(function(){Object(s.toFastProperties)(r)}))}))}return e.prototype.tokenize=function(e,t){if(void 0===t&&(t=this.defaultMode),!Object(s.isEmpty)(this.lexerDefinitionErrors)){var r=Object(s.map)(this.lexerDefinitionErrors,(function(e){return e.message})).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,t){var r,n,i,a,u,c,l,h,d,p,m,g,f,E,T=this,y=e,A=y.length,R=0,N=0,S=this.hasCustom?0:Math.floor(e.length/10),C=new Array(S),v=[],O=this.trackStartLines?1:void 0,I=this.trackStartLines?1:void 0,M=Object(o.cloneEmptyGroups)(this.emptyGroups),b=this.trackStartLines,F=this.config.lineTerminatorsPattern,w=0,_=[],L=[],x=[],P=[];Object.freeze(P);var U=void 0;function V(){return _}function D(e){var t=Object(o.charCodeToOptimizedIndex)(e),r=L[t];return void 0===r?P:r}var B,k=function(e){if(1===x.length&&void 0===e.tokenType.PUSH_MODE){var t=T.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);v.push({offset:e.startOffset,line:void 0!==e.startLine?e.startLine:void 0,column:void 0!==e.startColumn?e.startColumn:void 0,length:e.image.length,message:t})}else{x.pop();var r=Object(s.last)(x);_=T.patternIdxToConfig[r],L=T.charCodeToPatternIdxToConfig[r],w=_.length;var n=T.canModeBeOptimized[r]&&!1===T.config.safeMode;U=L&&n?D:V}};function G(e){x.push(e),L=this.charCodeToPatternIdxToConfig[e],_=this.patternIdxToConfig[e],w=_.length,w=_.length;var t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;U=L&&t?D:V}for(G.call(this,t);Ru.length&&(u=i,c=l,B=Y)}break}}if(null!==u){if(h=u.length,void 0!==(d=B.group)&&(p=B.tokenTypeIdx,m=this.createTokenInstance(u,R,p,B.tokenType,O,I,h),this.handlePayload(m,c),!1===d?N=this.addToken(C,N,m):M[d].push(m)),e=this.chopInput(e,h),R+=h,I=this.computeNewColumn(I,h),!0===b&&!0===B.canLineTerminator){var K=0,$=void 0,q=void 0;F.lastIndex=0;do{!0===($=F.test(u))&&(q=F.lastIndex-1,K++)}while(!0===$);0!==K&&(O+=K,I=h-q,this.updateTokenEndLineColumnLocation(m,d,q,K,O,I,h))}this.handleModes(B,k,G,m)}else{for(var Q=R,Z=O,J=I,ee=!1;!ee&&R");var n=Object(s.timer)(t),o=n.time,i=n.value,a=o>10?console.warn:console.log;return this.traceInitIndent time: "+o+"ms"),this.traceInitIndent--,i}return t()},e.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",e.NA=/NOT_APPLICABLE/,e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"DEFAULT_MODE",(function(){return h})),r.d(t,"MODES",(function(){return d})),r.d(t,"SUPPORT_STICKY",(function(){return p})),r.d(t,"disableSticky",(function(){return m})),r.d(t,"enableSticky",(function(){return g})),r.d(t,"analyzeTokenTypes",(function(){return f})),r.d(t,"validatePatterns",(function(){return E})),r.d(t,"findMissingPatterns",(function(){return T})),r.d(t,"findInvalidPatterns",(function(){return y})),r.d(t,"findEndOfInputAnchor",(function(){return R})),r.d(t,"findEmptyMatchRegExps",(function(){return N})),r.d(t,"findStartOfInputAnchor",(function(){return C})),r.d(t,"findUnsupportedFlags",(function(){return v})),r.d(t,"findDuplicatePatterns",(function(){return O})),r.d(t,"findInvalidGroupType",(function(){return I})),r.d(t,"findModesThatDoNotExist",(function(){return M})),r.d(t,"findUnreachablePatterns",(function(){return b})),r.d(t,"addStartOfInput",(function(){return F})),r.d(t,"addStickyFlag",(function(){return w})),r.d(t,"performRuntimeChecks",(function(){return _})),r.d(t,"performWarningRuntimeChecks",(function(){return L})),r.d(t,"cloneEmptyGroups",(function(){return x})),r.d(t,"isCustomPattern",(function(){return P})),r.d(t,"isShortPattern",(function(){return U})),r.d(t,"LineTerminatorOptimizedTester",(function(){return V})),r.d(t,"buildLineBreakIssueMessage",(function(){return B})),r.d(t,"minOptimizationVal",(function(){return j})),r.d(t,"charCodeToOptimizedIndex",(function(){return W}));var n,o=r(94),s=r(92),i=r(87),a=r(95),u=r(96),c=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),l="PATTERN",h="defaultMode",d="modes",p="boolean"==typeof new RegExp("(?:)").sticky;function m(){p=!1}function g(){p=!0}function f(e,t){var r,n=(t=Object(i.defaults)(t,{useSticky:p,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(e,t){return t()}})).tracer;n("initCharCodeToOptimizedIndexMap",(function(){!function(){if(Object(i.isEmpty)(H)){H=new Array(65536);for(var e=0;e<65536;e++)H[e]=e>255?255+~~(e/255):e}}()})),n("Reject Lexer.NA",(function(){r=Object(i.reject)(e,(function(e){return e[l]===s.Lexer.NA}))}));var o,u,c,h,d,m,g,f,E,T,y,A=!1;n("Transform Patterns",(function(){A=!1,o=Object(i.map)(r,(function(e){var r=e[l];if(Object(i.isRegExp)(r)){var n=r.source;return 1===n.length&&"^"!==n&&"$"!==n&&"."!==n?n:2!==n.length||"\\"!==n[0]||Object(i.contains)(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],n[1])?t.useSticky?w(r):F(r):n[1]}if(Object(i.isFunction)(r))return A=!0,{exec:r};if(Object(i.has)(r,"exec"))return A=!0,r;if("string"==typeof r){if(1===r.length)return r;var o=r.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),s=new RegExp(o);return t.useSticky?w(s):F(s)}throw Error("non exhaustive match")}))})),n("misc mapping",(function(){u=Object(i.map)(r,(function(e){return e.tokenTypeIdx})),c=Object(i.map)(r,(function(e){var t=e.GROUP;if(t!==s.Lexer.SKIPPED){if(Object(i.isString)(t))return t;if(Object(i.isUndefined)(t))return!1;throw Error("non exhaustive match")}})),h=Object(i.map)(r,(function(e){var t=e.LONGER_ALT;if(t)return Object(i.indexOf)(r,t)})),d=Object(i.map)(r,(function(e){return e.PUSH_MODE})),m=Object(i.map)(r,(function(e){return Object(i.has)(e,"POP_MODE")}))})),n("Line Terminator Handling",(function(){var e=k(t.lineTerminatorCharacters);g=Object(i.map)(r,(function(e){return!1})),"onlyOffset"!==t.positionTracking&&(g=Object(i.map)(r,(function(t){return Object(i.has)(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===D(t,e)?Object(a.canMatchCharCode)(e,t.PATTERN):void 0})))})),n("Misc Mapping #2",(function(){f=Object(i.map)(r,P),E=Object(i.map)(o,U),T=Object(i.reduce)(r,(function(e,t){var r=t.GROUP;return Object(i.isString)(r)&&r!==s.Lexer.SKIPPED&&(e[r]=[]),e}),{}),y=Object(i.map)(o,(function(e,t){return{pattern:o[t],longerAlt:h[t],canLineTerminator:g[t],isCustom:f[t],short:E[t],group:c[t],push:d[t],pop:m[t],tokenTypeIdx:u[t],tokenType:r[t]}}))}));var R=!0,N=[];return t.safeMode||n("First Char Optimization",(function(){N=Object(i.reduce)(r,(function(e,r,n){if("string"==typeof r.PATTERN){var o=W(r.PATTERN.charCodeAt(0));G(e,o,y[n])}else if(Object(i.isArray)(r.START_CHARS_HINT)){var s;Object(i.forEach)(r.START_CHARS_HINT,(function(t){var r=W("string"==typeof t?t.charCodeAt(0):t);s!==r&&(s=r,G(e,r,y[n]))}))}else if(Object(i.isRegExp)(r.PATTERN))if(r.PATTERN.unicode)R=!1,t.ensureOptimizations&&Object(i.PRINT_ERROR)(a.failedOptimizationPrefixMsg+"\tUnable to analyze < "+r.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var u=Object(a.getOptimizedStartCodesIndices)(r.PATTERN,t.ensureOptimizations);Object(i.isEmpty)(u)&&(R=!1),Object(i.forEach)(u,(function(t){G(e,t,y[n])}))}else t.ensureOptimizations&&Object(i.PRINT_ERROR)(a.failedOptimizationPrefixMsg+"\tTokenType: <"+r.name+"> is using a custom token pattern without providing parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),R=!1;return e}),[])})),n("ArrayPacking",(function(){N=Object(i.packArray)(N)})),{emptyGroups:T,patternIdxToConfig:y,charCodeToPatternIdxToConfig:N,hasCustom:A,canBeOptimized:R}}function E(e,t){var r=[],n=T(e);r=r.concat(n.errors);var o=y(n.valid),s=o.valid;return r=(r=(r=(r=(r=r.concat(o.errors)).concat(function(e){var t=[],r=Object(i.filter)(e,(function(e){return Object(i.isRegExp)(e[l])}));return t=(t=(t=(t=(t=t.concat(R(r))).concat(C(r))).concat(v(r))).concat(O(r))).concat(N(r))}(s))).concat(I(s))).concat(M(s,t))).concat(b(s))}function T(e){var t=Object(i.filter)(e,(function(e){return!Object(i.has)(e,l)}));return{errors:Object(i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- missing static 'PATTERN' property",type:s.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}})),valid:Object(i.difference)(e,t)}}function y(e){var t=Object(i.filter)(e,(function(e){var t=e[l];return!(Object(i.isRegExp)(t)||Object(i.isFunction)(t)||Object(i.has)(t,"exec")||Object(i.isString)(t))}));return{errors:Object(i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:s.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}})),valid:Object(i.difference)(e,t)}}var A=/[^\\][\$]/;function R(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return c(t,e),t.prototype.visitEndAnchor=function(e){this.found=!0},t}(o.BaseRegExpVisitor),r=Object(i.filter)(e,(function(e){var r=e[l];try{var n=Object(u.getRegExpAst)(r),o=new t;return o.visit(n),o.found}catch(e){return A.test(r.source)}}));return Object(i.map)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:s.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function N(e){var t=Object(i.filter)(e,(function(e){return e[l].test("")}));return Object(i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' must not match an empty string",type:s.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}}))}var S=/[^\\[][\^]|^\^/;function C(e){var t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.found=!1,t}return c(t,e),t.prototype.visitStartAnchor=function(e){this.found=!0},t}(o.BaseRegExpVisitor),r=Object(i.filter)(e,(function(e){var r=e[l];try{var n=Object(u.getRegExpAst)(r),o=new t;return o.visit(n),o.found}catch(e){return S.test(r.source)}}));return Object(i.map)(r,(function(e){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+e.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:s.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}}))}function v(e){var t=Object(i.filter)(e,(function(e){var t=e[l];return t instanceof RegExp&&(t.multiline||t.global)}));return Object(i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:s.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}}))}function O(e){var t=[],r=Object(i.map)(e,(function(r){return Object(i.reduce)(e,(function(e,n){return r.PATTERN.source!==n.PATTERN.source||Object(i.contains)(t,n)||n.PATTERN===s.Lexer.NA||(t.push(n),e.push(n)),e}),[])}));r=Object(i.compact)(r);var n=Object(i.filter)(r,(function(e){return e.length>1}));return Object(i.map)(n,(function(e){var t=Object(i.map)(e,(function(e){return e.name}));return{message:"The same RegExp pattern ->"+Object(i.first)(e).PATTERN+"<-has been used in all of the following Token Types: "+t.join(", ")+" <-",type:s.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}}))}function I(e){var t=Object(i.filter)(e,(function(e){if(!Object(i.has)(e,"GROUP"))return!1;var t=e.GROUP;return t!==s.Lexer.SKIPPED&&t!==s.Lexer.NA&&!Object(i.isString)(t)}));return Object(i.map)(t,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:s.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}}))}function M(e,t){var r=Object(i.filter)(e,(function(e){return void 0!==e.PUSH_MODE&&!Object(i.contains)(t,e.PUSH_MODE)}));return Object(i.map)(r,(function(e){return{message:"Token Type: ->"+e.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+e.PUSH_MODE+"<-which does not exist",type:s.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}}))}function b(e){var t=[],r=Object(i.reduce)(e,(function(e,t,r){var n,o=t.PATTERN;return o===s.Lexer.NA||(Object(i.isString)(o)?e.push({str:o,idx:r,tokenType:t}):Object(i.isRegExp)(o)&&(n=o,void 0===Object(i.find)([".","\\","[","]","|","^","$","(",")","?","*","+","{"],(function(e){return-1!==n.source.indexOf(e)})))&&e.push({str:o.source,idx:r,tokenType:t})),e}),[]);return Object(i.forEach)(e,(function(e,n){Object(i.forEach)(r,(function(r){var o=r.str,a=r.idx,u=r.tokenType;if(n"+e.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";t.push({message:c,type:s.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,u]})}}))})),t}function F(e){var t=e.ignoreCase?"i":"";return new RegExp("^(?:"+e.source+")",t)}function w(e){var t=e.ignoreCase?"iy":"y";return new RegExp(""+e.source,t)}function _(e,t,r){var n=[];return Object(i.has)(e,h)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+h+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object(i.has)(e,d)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+d+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object(i.has)(e,d)&&Object(i.has)(e,h)&&!Object(i.has)(e.modes,e.defaultMode)&&n.push({message:"A MultiMode Lexer cannot be initialized with a "+h+": <"+e.defaultMode+">which does not exist\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object(i.has)(e,d)&&Object(i.forEach)(e.modes,(function(e,t){Object(i.forEach)(e,(function(e,r){Object(i.isUndefined)(e)&&n.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+t+"> at index: <"+r+">\n",type:s.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})}))})),n}function L(e,t,r){var n=[],o=!1,u=Object(i.compact)(Object(i.flatten)(Object(i.mapValues)(e.modes,(function(e){return e})))),c=Object(i.reject)(u,(function(e){return e[l]===s.Lexer.NA})),h=k(r);return t&&Object(i.forEach)(c,(function(e){var t=D(e,h);if(!1!==t){var r={message:B(e,t),type:t.issue,tokenType:e};n.push(r)}else Object(i.has)(e,"LINE_BREAKS")?!0===e.LINE_BREAKS&&(o=!0):Object(a.canMatchCharCode)(h,e.PATTERN)&&(o=!0)})),t&&!o&&n.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:s.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),n}function x(e){var t={},r=Object(i.keys)(e);return Object(i.forEach)(r,(function(r){var n=e[r];if(!Object(i.isArray)(n))throw Error("non exhaustive match");t[r]=[]})),t}function P(e){var t=e.PATTERN;if(Object(i.isRegExp)(t))return!1;if(Object(i.isFunction)(t))return!0;if(Object(i.has)(t,"exec"))return!0;if(Object(i.isString)(t))return!1;throw Error("non exhaustive match")}function U(e){return!(!Object(i.isString)(e)||1!==e.length)&&e.charCodeAt(0)}var V={test:function(e){for(var t=e.length,r=this.lastIndex;r Token Type\n\t Root cause: "+t.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(t.issue===s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the option.\n\tThe problem is in the <"+e.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function k(e){return Object(i.map)(e,(function(e){return Object(i.isString)(e)&&e.length>0?e.charCodeAt(0):e}))}function G(e,t,r){void 0===e[t]?e[t]=[r]:e[t].push(r)}var j=256;function W(e){return e=this.input.length)throw Error("Unexpected end of input");this.idx++};var t,r=/[0-9a-fA-F]/,n=/[0-9]/,o=/[1-9]/;function s(e){return e.charCodeAt(0)}function i(e,t){void 0!==e.length?e.forEach((function(e){t.push(e)})):t.push(e)}function a(e,t){if(!0===e[t])throw"duplicate flag "+t;e[t]=!0}function u(e){if(void 0===e)throw Error("Internal Error - Should never get here!")}var c=[];for(t=s("0");t<=s("9");t++)c.push(t);var l=[s("_")].concat(c);for(t=s("a");t<=s("z");t++)l.push(t);for(t=s("A");t<=s("Z");t++)l.push(t);var h=[s(" "),s("\f"),s("\n"),s("\r"),s("\t"),s("\v"),s("\t"),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s(" "),s("\u2028"),s("\u2029"),s(" "),s(" "),s(" "),s("\ufeff")];function d(){}return d.prototype.visitChildren=function(e){for(var t in e){var r=e[t];e.hasOwnProperty(t)&&(void 0!==r.type?this.visit(r):Array.isArray(r)&&r.forEach((function(e){this.visit(e)}),this))}},d.prototype.visit=function(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)},d.prototype.visitPattern=function(e){},d.prototype.visitFlags=function(e){},d.prototype.visitDisjunction=function(e){},d.prototype.visitAlternative=function(e){},d.prototype.visitStartAnchor=function(e){},d.prototype.visitEndAnchor=function(e){},d.prototype.visitWordBoundary=function(e){},d.prototype.visitNonWordBoundary=function(e){},d.prototype.visitLookahead=function(e){},d.prototype.visitNegativeLookahead=function(e){},d.prototype.visitCharacter=function(e){},d.prototype.visitSet=function(e){},d.prototype.visitGroup=function(e){},d.prototype.visitGroupBackReference=function(e){},d.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:d,VERSION:"0.4.0"}})?n.apply(t,o):n)||(e.exports=s)},function(e,t,r){"use strict";r.r(t),r.d(t,"failedOptimizationPrefixMsg",(function(){return c})),r.d(t,"getOptimizedStartCodesIndices",(function(){return l})),r.d(t,"firstCharOptimizedIndices",(function(){return h})),r.d(t,"canMatchCharCode",(function(){return f}));var n,o=r(94),s=r(87),i=r(96),a=r(93),u=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),c='Unable to use "first char" lexer optimizations:\n';function l(e,t){void 0===t&&(t=!1);try{var r=Object(i.getRegExpAst)(e);return h(r.value,{},r.flags.ignoreCase)}catch(r){if("Complement Sets are not supported for first char optimization"===r.message)t&&Object(s.PRINT_WARNING)(c+"\tUnable to optimize: < "+e.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var n="";t&&(n="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),Object(s.PRINT_ERROR)(c+"\n\tFailed parsing: < "+e.toString()+" >\n\tUsing the regexp-to-ast library version: "+o.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+n)}}return[]}function h(e,t,r){switch(e.type){case"Disjunction":for(var n=0;n=a.minOptimizationVal)for(var s=n.from>=a.minOptimizationVal?n.from:a.minOptimizationVal,i=n.to,u=Object(a.charCodeToOptimizedIndex)(s),c=Object(a.charCodeToOptimizedIndex)(i),l=u;l<=c;l++)t[l]=l}}}));break;case"Group":h(u.value,t,r);break;default:throw Error("Non Exhaustive Match")}var c=void 0!==u.quantifier&&0===u.quantifier.atLeast;if("Group"===u.type&&!1===m(u)||"Group"!==u.type&&!1===c)break}break;default:throw Error("non exhaustive match!")}return Object(s.values)(t)}function d(e,t,r){var n=Object(a.charCodeToOptimizedIndex)(e);t[n]=n,!0===r&&function(e,t){var r=String.fromCharCode(e),n=r.toUpperCase();if(n!==r){var o=Object(a.charCodeToOptimizedIndex)(n.charCodeAt(0));t[o]=o}else{var s=r.toLowerCase();if(s!==r){o=Object(a.charCodeToOptimizedIndex)(s.charCodeAt(0));t[o]=o}}}(e,t)}function p(e,t){return Object(s.find)(e.value,(function(e){if("number"==typeof e)return Object(s.contains)(t,e);var r=e;return void 0!==Object(s.find)(t,(function(e){return r.from<=e&&e<=r.to}))}))}function m(e){return!(!e.quantifier||0!==e.quantifier.atLeast)||!!e.value&&(Object(s.isArray)(e.value)?Object(s.every)(e.value,m):m(e.value))}var g=function(e){function t(t){var r=e.call(this)||this;return r.targetCharCodes=t,r.found=!1,r}return u(t,e),t.prototype.visitChildren=function(t){if(!0!==this.found){switch(t.type){case"Lookahead":return void this.visitLookahead(t);case"NegativeLookahead":return void this.visitNegativeLookahead(t)}e.prototype.visitChildren.call(this,t)}},t.prototype.visitCharacter=function(e){Object(s.contains)(this.targetCharCodes,e.value)&&(this.found=!0)},t.prototype.visitSet=function(e){e.complement?void 0===p(e,this.targetCharCodes)&&(this.found=!0):void 0!==p(e,this.targetCharCodes)&&(this.found=!0)},t}(o.BaseRegExpVisitor);function f(e,t){if(t instanceof RegExp){var r=Object(i.getRegExpAst)(t),n=new g(e);return n.visit(r),n.found}return void 0!==Object(s.find)(t,(function(t){return Object(s.contains)(e,t.charCodeAt(0))}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"getRegExpAst",(function(){return i})),r.d(t,"clearRegExpParserCache",(function(){return a}));var n=r(94),o={},s=new n.RegExpParser;function i(e){var t=e.toString();if(o.hasOwnProperty(t))return o[t];var r=s.pattern(t);return o[t]=r,r}function a(){o={}}},function(e,t,r){"use strict";r.r(t),r.d(t,"tokenStructuredMatcher",(function(){return o})),r.d(t,"tokenStructuredMatcherNoCategories",(function(){return s})),r.d(t,"tokenShortNameIdx",(function(){return i})),r.d(t,"tokenIdxToClass",(function(){return a})),r.d(t,"augmentTokenTypes",(function(){return u})),r.d(t,"expandCategories",(function(){return c})),r.d(t,"assignTokenDefaultProps",(function(){return l})),r.d(t,"assignCategoriesTokensProp",(function(){return h})),r.d(t,"assignCategoriesMapProp",(function(){return d})),r.d(t,"singleAssignCategoriesToksMap",(function(){return p})),r.d(t,"hasShortKeyProperty",(function(){return m})),r.d(t,"hasCategoriesProperty",(function(){return g})),r.d(t,"hasExtendingTokensTypesProperty",(function(){return f})),r.d(t,"hasExtendingTokensTypesMapProperty",(function(){return E})),r.d(t,"isTokenType",(function(){return T}));var n=r(87);function o(e,t){var r=e.tokenTypeIdx;return r===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[r]}function s(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var i=1,a={};function u(e){var t=c(e);l(t),d(t),h(t),Object(n.forEach)(t,(function(e){e.isParent=e.categoryMatches.length>0}))}function c(e){for(var t=Object(n.cloneArr)(e),r=e,o=!0;o;){r=Object(n.compact)(Object(n.flatten)(Object(n.map)(r,(function(e){return e.CATEGORIES}))));var s=Object(n.difference)(r,t);t=t.concat(s),Object(n.isEmpty)(s)?o=!1:r=s}return t}function l(e){Object(n.forEach)(e,(function(e){m(e)||(a[i]=e,e.tokenTypeIdx=i++),g(e)&&!Object(n.isArray)(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),g(e)||(e.CATEGORIES=[]),f(e)||(e.categoryMatches=[]),E(e)||(e.categoryMatchesMap={})}))}function h(e){Object(n.forEach)(e,(function(e){e.categoryMatches=[],Object(n.forEach)(e.categoryMatchesMap,(function(t,r){e.categoryMatches.push(a[r].tokenTypeIdx)}))}))}function d(e){Object(n.forEach)(e,(function(e){p([],e)}))}function p(e,t){Object(n.forEach)(e,(function(e){t.categoryMatchesMap[e.tokenTypeIdx]=!0})),Object(n.forEach)(t.CATEGORIES,(function(r){var o=e.concat(t);Object(n.contains)(o,r)||p(o,r)}))}function m(e){return Object(n.has)(e,"tokenTypeIdx")}function g(e){return Object(n.has)(e,"CATEGORIES")}function f(e){return Object(n.has)(e,"categoryMatches")}function E(e){return Object(n.has)(e,"categoryMatchesMap")}function T(e){return Object(n.has)(e,"tokenTypeIdx")}},function(e,t,r){"use strict";r.r(t),r.d(t,"defaultLexerErrorProvider",(function(){return n}));var n={buildUnableToPopLexerModeMessage:function(e){return"Unable to pop Lexer Mode after encountering Token ->"+e.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(e,t,r,n,o){return"unexpected character: ->"+e.charAt(t)+"<- at offset: "+t+", skipped "+r+" characters."}}},function(e,t,r){"use strict";r.r(t),r.d(t,"first",(function(){return i})),r.d(t,"firstForSequence",(function(){return a})),r.d(t,"firstForBranching",(function(){return u})),r.d(t,"firstForTerminal",(function(){return c}));var n=r(87),o=r(90),s=r(100);function i(e){if(e instanceof o.NonTerminal)return i(e.referencedRule);if(e instanceof o.Terminal)return c(e);if(Object(s.isSequenceProd)(e))return a(e);if(Object(s.isBranchingProd)(e))return u(e);throw Error("non exhaustive match")}function a(e){for(var t,r=[],o=e.definition,a=0,u=o.length>a,c=!0;u&&c;)t=o[a],c=Object(s.isOptionalProd)(t),r=r.concat(i(t)),a+=1,u=o.length>a;return Object(n.uniq)(r)}function u(e){var t=Object(n.map)(e.definition,(function(e){return i(e)}));return Object(n.uniq)(Object(n.flatten)(t))}function c(e){return[e.terminalType]}},function(e,t,r){"use strict";r.r(t),r.d(t,"isSequenceProd",(function(){return u})),r.d(t,"isOptionalProd",(function(){return c})),r.d(t,"isBranchingProd",(function(){return l})),r.d(t,"getProductionDslName",(function(){return h})),r.d(t,"DslMethodsCollectorVisitor",(function(){return d})),r.d(t,"collectMethods",(function(){return m}));var n,o=r(87),s=r(90),i=r(101),a=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function u(e){return e instanceof s.Flat||e instanceof s.Option||e instanceof s.Repetition||e instanceof s.RepetitionMandatory||e instanceof s.RepetitionMandatoryWithSeparator||e instanceof s.RepetitionWithSeparator||e instanceof s.Terminal||e instanceof s.Rule}function c(e,t){return void 0===t&&(t=[]),!!(e instanceof s.Option||e instanceof s.Repetition||e instanceof s.RepetitionWithSeparator)||(e instanceof s.Alternation?Object(o.some)(e.definition,(function(e){return c(e,t)})):!(e instanceof s.NonTerminal&&Object(o.contains)(t,e))&&(e instanceof s.AbstractProduction&&(e instanceof s.NonTerminal&&t.push(e),Object(o.every)(e.definition,(function(e){return c(e,t)})))))}function l(e){return e instanceof s.Alternation}function h(e){if(e instanceof s.NonTerminal)return"SUBRULE";if(e instanceof s.Option)return"OPTION";if(e instanceof s.Alternation)return"OR";if(e instanceof s.RepetitionMandatory)return"AT_LEAST_ONE";if(e instanceof s.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(e instanceof s.RepetitionWithSeparator)return"MANY_SEP";if(e instanceof s.Repetition)return"MANY";if(e instanceof s.Terminal)return"CONSUME";throw Error("non exhaustive match")}var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.separator="-",t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return a(t,e),t.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},t.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+"Terminal";Object(o.has)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+"Terminal";Object(o.has)(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},t.prototype.visitOption=function(e){this.dslMethods.option.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},t.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},t.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},t}(i.GAstVisitor),p=new d;function m(e){p.reset(),e.accept(p);var t=p.dslMethods;return p.reset(),t}},function(e,t,r){"use strict";r.r(t),r.d(t,"GAstVisitor",(function(){return o}));var n=r(90),o=function(){function e(){}return e.prototype.visit=function(e){var t=e;switch(t.constructor){case n.NonTerminal:return this.visitNonTerminal(t);case n.Flat:return this.visitFlat(t);case n.Option:return this.visitOption(t);case n.RepetitionMandatory:return this.visitRepetitionMandatory(t);case n.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(t);case n.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(t);case n.Repetition:return this.visitRepetition(t);case n.Alternation:return this.visitAlternation(t);case n.Terminal:return this.visitTerminal(t);case n.Rule:return this.visitRule(t);default:throw Error("non exhaustive match")}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitFlat=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"IN",(function(){return n}));var n="_~IN~_"},function(e,t,r){"use strict";r.r(t),r.d(t,"setNodeLocationOnlyOffset",(function(){return c})),r.d(t,"setNodeLocationFull",(function(){return l})),r.d(t,"addTerminalToCst",(function(){return h})),r.d(t,"addNoneTerminalToCst",(function(){return d})),r.d(t,"NamedDSLMethodsCollectorVisitor",(function(){return p})),r.d(t,"expandAllNestedRuleNames",(function(){return m}));var n,o=r(87),s=r(104),i=r(90),a=r(101),u=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function c(e,t){!0===isNaN(e.startOffset)?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset1;Object(o.forEach)(e.definition,(function(n,a){if(!Object(o.isUndefined)(n.name)){var u=n.definition;u=r?[new i.Option({definition:n.definition})]:n.definition;var c=Object(s.getKeyForAltIndex)(t.ruleIdx,s.OR_IDX,e.idx,a);t.result.push({def:u,key:c,name:n.name,orgProd:n})}}))},t}(a.GAstVisitor);function m(e,t){var r={allRuleNames:[]};return Object(o.forEach)(e,(function(e){var n=t[e.name];r.allRuleNames.push(e.name);var s=new p(n);e.accept(s),Object(o.forEach)(s.result,(function(t){t.def,t.key;var n=t.name;r.allRuleNames.push(e.name+n)}))})),r}},function(e,t,r){"use strict";r.r(t),r.d(t,"BITS_FOR_METHOD_TYPE",(function(){return n})),r.d(t,"BITS_FOR_OCCURRENCE_IDX",(function(){return o})),r.d(t,"BITS_FOR_RULE_IDX",(function(){return s})),r.d(t,"BITS_FOR_ALT_IDX",(function(){return i})),r.d(t,"OR_IDX",(function(){return a})),r.d(t,"OPTION_IDX",(function(){return u})),r.d(t,"MANY_IDX",(function(){return c})),r.d(t,"AT_LEAST_ONE_IDX",(function(){return l})),r.d(t,"MANY_SEP_IDX",(function(){return h})),r.d(t,"AT_LEAST_ONE_SEP_IDX",(function(){return d})),r.d(t,"getKeyForAutomaticLookahead",(function(){return p})),r.d(t,"getKeyForAltIndex",(function(){return g}));var n=4,o=8,s=12,i=8,a=1<")+i}};Object.freeze(u);var c={buildRuleNotFoundError:function(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+"<-\ninside top level rule: ->"+e.name+"<-"}},l={buildDuplicateFoundError:function(e,t){var r,n=e.name,a=Object(o.first)(t),u=a.idx,c=Object(i.getProductionDslName)(a),l=(r=a)instanceof s.Terminal?r.terminalType.name:r instanceof s.NonTerminal?r.nonTerminalName:"",h="->"+c+(u>0?u:"")+"<- "+(l?"with argument: ->"+l+"<-":"")+"\n appears more than once ("+t.length+" times) in the top level rule: ->"+n+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return h=(h=h.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(e,t){return"Invalid nested rule name: ->"+t.name+"<- inside rule: ->"+e.name+"<-\nit must match the pattern: ->"+a.validNestedRuleName.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(e,t){return"Duplicate nested rule name: ->"+Object(o.first)(t).name+"<- inside rule: ->"+e.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(e){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+e.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(e){var t=Object(o.map)(e.prefixPath,(function(e){return Object(n.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx;return"Ambiguous alternatives: <"+e.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(e){var t=Object(o.map)(e.prefixPath,(function(e){return Object(n.tokenLabel)(e)})).join(", "),r=0===e.alternation.idx?"":e.alternation.idx,s="Ambiguous Alternatives Detected: <"+e.ambiguityIndices.join(" ,")+"> in inside <"+e.topLevelRule.name+"> Rule,\n<"+t+"> may appears as a prefix path in all these alternatives.\n";return s+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(e){var t=Object(i.getProductionDslName)(e.repetition);return 0!==e.repetition.idx&&(t+=e.repetition.idx),"The repetition <"+t+"> within Rule <"+e.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(e){return"Invalid Grammar Token name: ->"+e.tokenType.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(e){return"Ambiguous empty alternative: <"+(e.emptyChoiceIdx+1)+"> in inside <"+e.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(e){return"An Alternation cannot have more than 256 alternatives:\n inside <"+e.topLevelRule.name+"> Rule.\n has "+(e.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(e){var t=e.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+t+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(t+" --\x3e "+o.map(e.leftRecursionPath,(function(e){return e.name})).concat([t]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(e){return"Invalid grammar rule name: ->"+e.topLevelRule.name+"<- it must match the pattern: ->"+e.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(e){return"Duplicate definition, rule: ->"+(e.topLevelRule instanceof s.Rule?e.topLevelRule.name:e.topLevelRule)+"<- is already defined in the grammar: ->"+e.grammarName+"<-"}}},function(e,t,r){"use strict";r.r(t),r.d(t,"validateGrammar",(function(){return p})),r.d(t,"identifyProductionForDuplicates",(function(){return m})),r.d(t,"OccurrenceValidationCollector",(function(){return f})),r.d(t,"validTermsPattern",(function(){return E})),r.d(t,"validNestedRuleName",(function(){return T})),r.d(t,"validateRuleName",(function(){return y})),r.d(t,"validateNestedRuleName",(function(){return A})),r.d(t,"validateTokenName",(function(){return R})),r.d(t,"validateRuleDoesNotAlreadyExist",(function(){return N})),r.d(t,"validateRuleIsOverridden",(function(){return S})),r.d(t,"validateNoLeftRecursion",(function(){return C})),r.d(t,"getFirstNoneTerminal",(function(){return v})),r.d(t,"validateEmptyOrAlternative",(function(){return I})),r.d(t,"validateAmbiguousAlternationAlternatives",(function(){return M})),r.d(t,"RepetionCollector",(function(){return b})),r.d(t,"validateTooManyAlts",(function(){return F})),r.d(t,"validateSomeNonEmptyLookaheadPath",(function(){return w})),r.d(t,"checkPrefixAlternativesAmbiguities",(function(){return _}));var n,o=r(87),s=r(86),i=r(100),a=r(107),u=r(103),c=r(108),l=r(90),h=r(101),d=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function p(e,t,r,n,a,c){var l=o.map(e,(function(e){return function(e,t){var r=new f;e.accept(r);var n=r.allProductions,a=o.groupBy(n,m),u=o.pick(a,(function(e){return e.length>1}));return o.map(o.values(u),(function(r){var n=o.first(r),a=t.buildDuplicateFoundError(e,r),u=Object(i.getProductionDslName)(n),c={message:a,type:s.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:u,occurrence:n.idx},l=g(n);return l&&(c.parameter=l),c}))}(e,a)})),h=o.map(e,(function(e){return C(e,e,a)})),d=[],p=[],E=[];Object(o.every)(h,o.isEmpty)&&(d=Object(o.map)(e,(function(e){return I(e,a)})),p=Object(o.map)(e,(function(e){return M(e,t,n,a)})),E=w(e,t,a));var T=function(e,t,r){var n=[],i=Object(o.map)(t,(function(e){return e.name}));return Object(o.forEach)(e,(function(e){var t=e.name;if(Object(o.contains)(i,t)){var a=r.buildNamespaceConflictError(e);n.push({message:a,type:s.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}})),n}(e,r,a),S=o.map(r,(function(e){return R(e,a)})),v=function(e,t){var r=[];return Object(o.forEach)(e,(function(e){var n=new u.NamedDSLMethodsCollectorVisitor("");e.accept(n);var s=Object(o.map)(n.result,(function(e){return e.orgProd}));r.push(Object(o.map)(s,(function(r){return A(e,r,t)})))})),Object(o.flatten)(r)}(e,a),O=function(e,t){var r=[];return Object(o.forEach)(e,(function(e){var n=new u.NamedDSLMethodsCollectorVisitor("");e.accept(n);var i=Object(o.groupBy)(n.result,(function(e){return e.name})),a=Object(o.pick)(i,(function(e){return e.length>1}));Object(o.forEach)(Object(o.values)(a),(function(n){var i=Object(o.map)(n,(function(e){return e.orgProd})),a=t.buildDuplicateNestedRuleNameError(e,i);r.push({message:a,type:s.ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,ruleName:e.name})}))})),r}(e,a),b=Object(o.map)(e,(function(e){return F(e,a)})),_=Object(o.map)(e,(function(e){return y(e,a)})),L=Object(o.map)(e,(function(t){return N(t,e,c,a)}));return o.flatten(l.concat(S,v,O,E,h,d,p,T,b,_,L))}function m(e){return Object(i.getProductionDslName)(e)+"_#_"+e.idx+"_#_"+g(e)}function g(e){return e instanceof l.Terminal?e.terminalType.name:e instanceof l.NonTerminal?e.nonTerminalName:""}var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return d(t,e),t.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},t.prototype.visitOption=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t.prototype.visitAlternation=function(e){this.allProductions.push(e)},t.prototype.visitTerminal=function(e){this.allProductions.push(e)},t}(h.GAstVisitor),E=/^[a-zA-Z_]\w*$/,T=new RegExp(E.source.replace("^","^\\$"));function y(e,t){var r=[],n=e.name;return n.match(E)||r.push({message:t.buildInvalidRuleNameError({topLevelRule:e,expectedPattern:E}),type:s.ParserDefinitionErrorType.INVALID_RULE_NAME,ruleName:n}),r}function A(e,t,r){var n,o=[];return t.name.match(T)||(n=r.buildInvalidNestedRuleNameError(e,t),o.push({message:n,type:s.ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,ruleName:e.name})),o}function R(e,t){var r=[];return e.name.match(E)||r.push({message:t.buildTokenNameError({tokenType:e,expectedPattern:E}),type:s.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function N(e,t,r,n){var i=[];if(Object(o.reduce)(t,(function(t,r){return r.name===e.name?t+1:t}),0)>1){var a=n.buildDuplicateRuleNameError({topLevelRule:e,grammarName:r});i.push({message:a,type:s.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function S(e,t,r){var n,i=[];return o.contains(t,e)||(n="Invalid rule override, rule: ->"+e+"<- cannot be overridden in the grammar: ->"+r+"<-as it is not defined in any of the super grammars ",i.push({message:n,type:s.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),i}function C(e,t,r,n){void 0===n&&(n=[]);var i=[],a=v(t.definition);if(o.isEmpty(a))return[];var u=e.name;o.contains(a,e)&&i.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:n}),type:s.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:u});var c=o.difference(a,n.concat([e])),l=o.map(c,(function(t){var s=o.cloneArr(n);return s.push(t),C(e,t,r,s)}));return i.concat(o.flatten(l))}function v(e){var t=[];if(o.isEmpty(e))return t;var r=o.first(e);if(r instanceof l.NonTerminal)t.push(r.referencedRule);else if(r instanceof l.Flat||r instanceof l.Option||r instanceof l.RepetitionMandatory||r instanceof l.RepetitionMandatoryWithSeparator||r instanceof l.RepetitionWithSeparator||r instanceof l.Repetition)t=t.concat(v(r.definition));else if(r instanceof l.Alternation)t=o.flatten(o.map(r.definition,(function(e){return v(e.definition)})));else if(!(r instanceof l.Terminal))throw Error("non exhaustive match");var n=Object(i.isOptionalProd)(r),s=e.length>1;if(n&&s){var a=o.drop(e);return t.concat(v(a))}return t}var O=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.alternations=[],t}return d(t,e),t.prototype.visitAlternation=function(e){this.alternations.push(e)},t}(h.GAstVisitor);function I(e,t){var r=new O;e.accept(r);var n=r.alternations;return o.reduce(n,(function(r,n){var i=o.dropRight(n.definition),a=o.map(i,(function(r,i){var a=Object(c.nextPossibleTokensAfter)([r],[],null,1);return o.isEmpty(a)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:s.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}:null}));return r.concat(o.compact(a))}),[])}function M(e,t,r,n){var u=new O;e.accept(u);var c=u.alternations,l=r[e.name];return l&&(c=Object(o.reject)(c,(function(e){return l[Object(i.getProductionDslName)(e)+(0===e.idx?"":e.idx)]}))),c=Object(o.reject)(c,(function(e){return!0===e.ignoreAmbiguities})),o.reduce(c,(function(r,i){var u=i.idx,c=i.maxLookahead||t,l=Object(a.getLookaheadPathsForOr)(u,e,c,i),h=function(e,t,r,n){var i=[],u=Object(o.reduce)(e,(function(r,n,s){return!0===t.definition[s].ignoreAmbiguities||Object(o.forEach)(n,(function(n){var u=[s];Object(o.forEach)(e,(function(e,r){s!==r&&Object(a.containsPath)(e,n)&&!0!==t.definition[r].ignoreAmbiguities&&u.push(r)})),u.length>1&&!Object(a.containsPath)(i,n)&&(i.push(n),r.push({alts:u,path:n}))})),r}),[]);return o.map(u,(function(e){var i=Object(o.map)(e.alts,(function(e){return e+1}));return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:s.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:t.idx,alternatives:[e.alts]}}))}(l,i,e,n),d=_(l,i,e,n);return r.concat(h,d)}),[])}var b=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.allProductions=[],t}return d(t,e),t.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},t.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},t.prototype.visitRepetition=function(e){this.allProductions.push(e)},t}(h.GAstVisitor);function F(e,t){var r=new O;e.accept(r);var n=r.alternations;return o.reduce(n,(function(r,n){return n.definition.length>255&&r.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:s.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}),r}),[])}function w(e,t,r){var n=[];return Object(o.forEach)(e,(function(e){var i=new b;e.accept(i);var u=i.allProductions;Object(o.forEach)(u,(function(i){var u=Object(a.getProdType)(i),c=i.maxLookahead||t,l=i.idx,h=Object(a.getLookaheadPathsForOptionalProd)(l,e,u,c)[0];if(Object(o.isEmpty)(Object(o.flatten)(h))){var d=r.buildEmptyRepetitionError({topLevelRule:e,repetition:i});n.push({message:d,type:s.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}}))})),n}function _(e,t,r,n){var i=[],u=Object(o.reduce)(e,(function(e,t,r){var n=Object(o.map)(t,(function(e){return{idx:r,path:e}}));return e.concat(n)}),[]);return Object(o.forEach)(u,(function(e){if(!0!==t.definition[e.idx].ignoreAmbiguities){var c=e.idx,l=e.path,h=Object(o.findAll)(u,(function(e){return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx=0;M--){var b={idx:m,def:E.definition[M].definition.concat(Object(s.drop)(p)),ruleStack:g,occurrenceStack:f};h.push(b),h.push("EXIT_ALTERNATIVE")}else if(E instanceof a.Flat)h.push({idx:m,def:E.definition.concat(Object(s.drop)(p)),ruleStack:g,occurrenceStack:f});else{if(!(E instanceof a.Rule))throw Error("non exhaustive match");h.push(T(E,m,g,f))}}}else i&&Object(s.last)(h).idx<=c&&h.pop()}return l}function T(e,t,r,n){var o=Object(s.cloneArr)(r);o.push(e.name);var i=Object(s.cloneArr)(n);return i.push(1),{idx:t,def:e.definition,ruleStack:o,occurrenceStack:i}}},function(e,t,r){"use strict";r.r(t),r.d(t,"resolveGrammar",(function(){return u})),r.d(t,"validateGrammar",(function(){return c})),r.d(t,"assignOccurrenceIndices",(function(){return l}));var n=r(87),o=r(110),s=r(106),i=r(105),a=r(100);function u(e){e=Object(n.defaults)(e,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var t={};return Object(n.forEach)(e.rules,(function(e){t[e.name]=e})),Object(o.resolveGrammar)(t,e.errMsgProvider)}function c(e){return e=Object(n.defaults)(e,{errMsgProvider:i.defaultGrammarValidatorErrorProvider,ignoredIssues:{}}),Object(s.validateGrammar)(e.rules,e.maxLookahead,e.tokenTypes,e.ignoredIssues,e.errMsgProvider,e.grammarName)}function l(e){Object(n.forEach)(e.rules,(function(e){var t=new a.DslMethodsCollectorVisitor;e.accept(t),Object(n.forEach)(t.dslMethods,(function(e){Object(n.forEach)(e,(function(e,t){e.idx=t+1}))}))}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"resolveGrammar",(function(){return u})),r.d(t,"GastRefResolverVisitor",(function(){return c}));var n,o=r(86),s=r(87),i=r(101),a=(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});function u(e,t){var r=new c(e,t);return r.resolveRefs(),r.errors}var c=function(e){function t(t,r){var n=e.call(this)||this;return n.nameToTopRule=t,n.errMsgProvider=r,n.errors=[],n}return a(t,e),t.prototype.resolveRefs=function(){var e=this;Object(s.forEach)(Object(s.values)(this.nameToTopRule),(function(t){e.currTopLevel=t,t.accept(e)}))},t.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:o.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},t}(i.GAstVisitor)},function(e,t,r){"use strict";r.r(t),r.d(t,"EOF_FOLLOW_KEY",(function(){return u})),r.d(t,"IN_RULE_RECOVERY_EXCEPTION",(function(){return c})),r.d(t,"InRuleRecoveryException",(function(){return l})),r.d(t,"Recoverable",(function(){return h})),r.d(t,"attemptInRepetitionRecovery",(function(){return d}));var n=r(91),o=r(87),s=r(112),i=r(102),a=r(86),u={},c="InRuleRecoveryException";function l(e){this.name=c,this.message=e}l.prototype=Error.prototype;var h=function(){function e(){}return e.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Object(o.has)(e,"recoveryEnabled")?e.recoveryEnabled:a.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=d)},e.prototype.getTokenToInsert=function(e){var t=Object(n.createTokenInstance)(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return t.isInsertedInRecovery=!0,t},e.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},e.prototype.tryInRepetitionRecovery=function(e,t,r,n){for(var i=this,a=this.findReSyncTokenType(),u=this.exportLexerState(),c=[],l=!1,h=this.LA(1),d=this.LA(1),p=function(){var e=i.LA(0),t=i.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:h,previous:e,ruleName:i.getCurrRuleFullName()}),r=new s.MismatchedTokenException(t,h,i.LA(0));r.resyncedTokens=Object(o.dropRight)(c),i.SAVE_ERROR(r)};!l;){if(this.tokenMatcher(d,n))return void p();if(r.call(this))return p(),void e.apply(this,t);this.tokenMatcher(d,a)?l=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,c))}this.importLexerState(u)},e.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,r){return!1!==r&&(void 0!==e&&void 0!==t&&(!this.tokenMatcher(this.LA(1),e)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))))},e.prototype.getFollowsForInRuleRecovery=function(e,t){var r=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(r)},e.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new l("sad sad panda")},e.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},e.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e))return!1;if(Object(o.isEmpty)(t))return!1;var n=this.LA(1);return void 0!==Object(o.find)(t,(function(e){return r.tokenMatcher(n,e)}))},e.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},e.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return Object(o.contains)(r,e)},e.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var n=t.tokenType;if(Object(o.contains)(e,n))return n;t=this.LA(r),r++}},e.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return u;var e=this.getLastExplicitRuleShortName(),t=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(r)}},e.prototype.buildFullFollowKeyStack=function(){var e=this,t=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return Object(o.isEmpty)(this.LAST_EXPLICIT_RULE_STACK)||(t=Object(o.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_STACK[t]})),r=Object(o.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.RULE_OCCURRENCE_STACK[t]}))),Object(o.map)(t,(function(n,o){return 0===o?u:{ruleName:e.shortRuleNameToFullName(n),idxInCallingRule:r[o],inRule:e.shortRuleNameToFullName(t[o-1])}}))},e.prototype.flattenFollowSet=function(){var e=this,t=Object(o.map)(this.buildFullFollowKeyStack(),(function(t){return e.getFollowSetFromFollowKey(t)}));return Object(o.flatten)(t)},e.prototype.getFollowSetFromFollowKey=function(e){if(e===u)return[n.EOF];var t=e.ruleName+e.idxInCallingRule+i.IN+e.inRule;return this.resyncFollows[t]},e.prototype.addToResyncTokens=function(e,t){return this.tokenMatcher(e,n.EOF)||t.push(e),t},e.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);!1===this.tokenMatcher(r,e);)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return Object(o.dropRight)(t)},e.prototype.attemptInRepetitionRecovery=function(e,t,r,n,o,s,i){},e.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:Object(o.cloneArr)(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},e.prototype.getHumanReadableRuleStack=function(){var e=this;return Object(o.isEmpty)(this.LAST_EXPLICIT_RULE_STACK)?Object(o.map)(this.RULE_STACK,(function(t){return e.shortRuleNameToFullName(t)})):Object(o.map)(this.LAST_EXPLICIT_RULE_STACK,(function(t){return e.shortRuleNameToFullName(e.RULE_STACK[t])}))},e}();function d(e,t,r,o,s,i,a){var u=this.getKeyForAutomaticLookahead(o,s),c=this.firstAfterRepMap[u];if(void 0===c){var l=this.getCurrRuleFullName();c=new i(this.getGAstProductions()[l],s).startWalking(),this.firstAfterRepMap[u]=c}var h=c.token,d=c.occurrence,p=c.isEndOfRule;1===this.RULE_STACK.length&&p&&void 0===h&&(h=n.EOF,d=1),this.shouldInRepetitionRecoveryBeTried(h,d,a)&&this.tryInRepetitionRecovery(e,t,r,h)}},function(e,t,r){"use strict";r.r(t),r.d(t,"isRecognitionException",(function(){return s})),r.d(t,"MismatchedTokenException",(function(){return i})),r.d(t,"NoViableAltException",(function(){return a})),r.d(t,"NotAllInputParsedException",(function(){return u})),r.d(t,"EarlyExitException",(function(){return c}));var n=r(87),o=["MismatchedTokenException","NoViableAltException","EarlyExitException","NotAllInputParsedException"];function s(e){return Object(n.contains)(o,e.name)}function i(e,t,r){this.name="MismatchedTokenException",this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function a(e,t,r){this.name="NoViableAltException",this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}function u(e,t){this.name="NotAllInputParsedException",this.message=e,this.token=t,this.resyncedTokens=[]}function c(e,t,r){this.name="EarlyExitException",this.message=e,this.token=t,this.previousToken=r,this.resyncedTokens=[]}Object.freeze(o),i.prototype=Error.prototype,a.prototype=Error.prototype,u.prototype=Error.prototype,c.prototype=Error.prototype},function(e,t,r){"use strict";r.r(t),r.d(t,"LooksAhead",(function(){return u}));var n=r(107),o=r(87),s=r(86),i=r(104),a=r(100),u=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=Object(o.has)(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:s.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=Object(o.has)(e,"maxLookahead")?e.maxLookahead:s.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=Object(o.isES2015MapSupported)()?new Map:[],Object(o.isES2015MapSupported)()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var t=this;Object(o.forEach)(e,(function(e){t.TRACE_INIT(e.name+" Rule Lookahead",(function(){var r=Object(a.collectMethods)(e),s=r.alternation,u=r.repetition,c=r.option,l=r.repetitionMandatory,h=r.repetitionMandatoryWithSeparator,d=r.repetitionWithSeparator;Object(o.forEach)(s,(function(r){var o=0===r.idx?"":r.idx;t.TRACE_INIT(""+Object(a.getProductionDslName)(r)+o,(function(){var o=Object(n.buildLookaheadFuncForOr)(r.idx,e,r.maxLookahead||t.maxLookahead,r.hasPredicates,t.dynamicTokensEnabled,t.lookAheadBuilderForAlternatives),s=Object(i.getKeyForAutomaticLookahead)(t.fullRuleNameToShort[e.name],i.OR_IDX,r.idx);t.setLaFuncCache(s,o)}))})),Object(o.forEach)(u,(function(r){t.computeLookaheadFunc(e,r.idx,i.MANY_IDX,n.PROD_TYPE.REPETITION,r.maxLookahead,Object(a.getProductionDslName)(r))})),Object(o.forEach)(c,(function(r){t.computeLookaheadFunc(e,r.idx,i.OPTION_IDX,n.PROD_TYPE.OPTION,r.maxLookahead,Object(a.getProductionDslName)(r))})),Object(o.forEach)(l,(function(r){t.computeLookaheadFunc(e,r.idx,i.AT_LEAST_ONE_IDX,n.PROD_TYPE.REPETITION_MANDATORY,r.maxLookahead,Object(a.getProductionDslName)(r))})),Object(o.forEach)(h,(function(r){t.computeLookaheadFunc(e,r.idx,i.AT_LEAST_ONE_SEP_IDX,n.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,r.maxLookahead,Object(a.getProductionDslName)(r))})),Object(o.forEach)(d,(function(r){t.computeLookaheadFunc(e,r.idx,i.MANY_SEP_IDX,n.PROD_TYPE.REPETITION_WITH_SEPARATOR,r.maxLookahead,Object(a.getProductionDslName)(r))}))}))}))},e.prototype.computeLookaheadFunc=function(e,t,r,o,s,a){var u=this;this.TRACE_INIT(""+a+(0===t?"":t),(function(){var a=Object(n.buildLookaheadFuncForOptionalProd)(t,e,s||u.maxLookahead,u.dynamicTokensEnabled,o,u.lookAheadBuilderForOptional),c=Object(i.getKeyForAutomaticLookahead)(u.fullRuleNameToShort[e.name],r,t);u.setLaFuncCache(c,a)}))},e.prototype.lookAheadBuilderForOptional=function(e,t,r){return Object(n.buildSingleAlternativeLookaheadFunction)(e,t,r)},e.prototype.lookAheadBuilderForAlternatives=function(e,t,r,o){return Object(n.buildAlternativesLookAheadFunc)(e,t,r,o)},e.prototype.getKeyForAutomaticLookahead=function(e,t){var r=this.getLastExplicitRuleShortName();return Object(i.getKeyForAutomaticLookahead)(r,e,t)},e.prototype.getLaFuncFromCache=function(e){},e.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},e.prototype.setLaFuncCache=function(e,t){},e.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},e.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"TreeBuilder",(function(){return u}));var n=r(103),o=r(87),s=r(115),i=r(104),a=r(86),u=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=Object(o.has)(e,"outputCst")?e.outputCst:a.DEFAULT_PARSER_CONFIG.outputCst,this.nodeLocationTracking=Object(o.has)(e,"nodeLocationTracking")?e.nodeLocationTracking:a.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=n.setNodeLocationFull,this.setNodeLocationFromNode=n.setNodeLocationFull,this.cstPostRule=o.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=o.NOOP,this.setNodeLocationFromNode=o.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=n.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=n.setNodeLocationOnlyOffset,this.cstPostRule=o.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=o.NOOP,this.setNodeLocationFromNode=o.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid config option: "'+e.nodeLocationTracking+'"');this.setNodeLocationFromToken=o.NOOP,this.setNodeLocationFromNode=o.NOOP,this.cstPostRule=o.NOOP,this.setInitialNodeLocation=o.NOOP}else this.cstInvocationStateUpdate=o.NOOP,this.cstFinallyStateUpdate=o.NOOP,this.cstPostTerminal=o.NOOP,this.cstPostNonTerminal=o.NOOP,this.cstPostRule=o.NOOP,this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstNestedInvocationStateUpdate=function(e,t){var r={name:e,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+e,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstInvocationStateUpdate=function(e,t){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var r={name:e,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},e.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},e.prototype.cstNestedFinallyStateUpdate=function(){var e=this.CST_STACK.pop();this.cstPostRule(e)},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?(r.endOffset=t.endOffset,r.endLine=t.endLine,r.endColumn=t.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),r=e.location;r.startOffset<=t.startOffset==!0?r.endOffset=t.endOffset:r.startOffset=NaN},e.prototype.cstPostTerminal=function(e,t){var r=this.CST_STACK[this.CST_STACK.length-1];Object(n.addTerminalToCst)(r,t,e),this.setNodeLocationFromToken(r.location,t)},e.prototype.cstPostNonTerminal=function(e,t){if(!0!==this.isBackTracking()){var r=this.CST_STACK[this.CST_STACK.length-1];Object(n.addNoneTerminalToCst)(r,t,e),this.setNodeLocationFromNode(r.location,e.location)}},e.prototype.getBaseCstVisitorConstructor=function(){if(Object(o.isUndefined)(this.baseCstVisitorConstructor)){var e=Object(s.createBaseSemanticVisitorConstructor)(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(Object(o.isUndefined)(this.baseCstVisitorWithDefaultsConstructor)){var e=Object(s.createBaseVisitorConstructorWithDefaults)(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.nestedRuleBeforeClause=function(e,t){var r;return void 0!==e.NAME?(r=e.NAME,this.nestedRuleInvocationStateUpdate(r,t),r):void 0},e.prototype.nestedAltBeforeClause=function(e,t,r,n){var o,s=this.getLastExplicitRuleShortName(),a=Object(i.getKeyForAltIndex)(s,r,t,n);return void 0!==e.NAME?(o=e.NAME,this.nestedRuleInvocationStateUpdate(o,a),{shortName:a,nestedName:o}):void 0},e.prototype.nestedRuleFinallyClause=function(e,t){var r=this.CST_STACK,o=r[r.length-1];this.nestedRuleFinallyStateUpdate();var s=r[r.length-1];Object(n.addNoneTerminalToCst)(s,t,o),this.setNodeLocationFromNode(s.location,o.location)},e.prototype.getLastExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[e]},e.prototype.getLastExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[e]},e.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[e]},e.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e.prototype.nestedRuleInvocationStateUpdate=function(e,t){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(t),this.cstNestedInvocationStateUpdate(e,t)},e.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"defaultVisit",(function(){return a})),r.d(t,"createBaseSemanticVisitorConstructor",(function(){return u})),r.d(t,"createBaseVisitorConstructorWithDefaults",(function(){return c})),r.d(t,"CstVisitorDefinitionError",(function(){return n})),r.d(t,"validateVisitor",(function(){return l})),r.d(t,"validateMissingCstMethods",(function(){return h})),r.d(t,"validateRedundantMethods",(function(){return p}));var n,o=r(87),s=r(116),i=r(106);function a(e,t){for(var r=Object(o.keys)(e),n=r.length,s=0;s:\n\t"+r.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=r,r._RULE_NAMES=t,r}function c(e,t,r){var n=function(){};Object(s.defineNameProp)(n,e+"BaseSemanticsWithDefaults");var i=Object.create(r.prototype);return Object(o.forEach)(t,(function(e){i[e]=a})),(n.prototype=i).constructor=n,n}function l(e,t){var r=h(e,t),n=p(e,t);return r.concat(n)}function h(e,t){var r=Object(o.map)(t,(function(t){if(!Object(o.isFunction)(e[t]))return{msg:"Missing visitor method: <"+t+"> on "+Object(s.functionName)(e.constructor)+" CST Visitor.",type:n.MISSING_METHOD,methodName:t}}));return Object(o.compact)(r)}!function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"}(n||(n={}));var d=["constructor","visit","validateVisitor"];function p(e,t){var r=[];for(var a in e)i.validTermsPattern.test(a)&&Object(o.isFunction)(e[a])&&!Object(o.contains)(d,a)&&!Object(o.contains)(t,a)&&r.push({msg:"Redundant visitor method: <"+a+"> on "+Object(s.functionName)(e.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+i.validTermsPattern.source+"/.",type:n.REDUNDANT_METHOD,methodName:a});return r}},function(e,t,r){"use strict";r.r(t),r.d(t,"classNameFromInstance",(function(){return o})),r.d(t,"functionName",(function(){return i})),r.d(t,"defineNameProp",(function(){return a}));var n=r(87);function o(e){return i(e.constructor)}var s=/^\s*function\s*(\S*)\s*\(/;function i(e){var t=e.name;return t||e.toString().match(s)[1]}function a(e,t){var r=Object.getOwnPropertyDescriptor(e,"name");return!(!Object(n.isUndefined)(r)&&!r.configurable)&&(Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t}),!0)}},function(e,t,r){"use strict";r.r(t),r.d(t,"LexerAdapter",(function(){return o}));var n=r(86),o=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(!0!==this.selfAnalysisDone)throw Error("Missing invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!0,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):n.END_OF_FILE},e.prototype.LA=function(e){var t=this.currIdx+e;return t<0||this.tokVectorLength<=t?n.END_OF_FILE:this.tokVector[t]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"RecognizerApi",(function(){return c}));var n=r(87),o=r(112),s=r(86),i=r(105),a=r(106),u=r(90),c=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,r){return this.consumeInternal(t,e,r)},e.prototype.subrule=function(e,t,r){return this.subruleInternal(t,e,r)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,t,r){if(void 0===r&&(r=s.DEFAULT_RULE_CONFIG),Object(n.contains)(this.definedRulesNames,e)){var o={message:i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:s.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);var a=this.defineRule(e,t,r);return this[e]=a,a},e.prototype.OVERRIDE_RULE=function(e,t,r){void 0===r&&(r=s.DEFAULT_RULE_CONFIG);var n=[];n=n.concat(Object(a.validateRuleIsOverridden)(e,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,n);var o=this.defineRule(e,t,r);return this[e]=o,o},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(Object(o.isRecognitionException)(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return Object(u.serializeGrammar)(Object(n.values)(this.gastProductionsCache))},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"RecognizerEngine",(function(){return p}));var n=r(87),o=r(104),s=r(112),i=r(107),a=r(108),u=r(86),c=r(111),l=r(91),h=r(97),d=r(116),p=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,t){if(this.className=Object(d.classNameFromInstance)(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=h.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Object(n.has)(t,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(Object(n.isArray)(e)){if(Object(n.isEmpty)(e))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof e[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(Object(n.isArray)(e))this.tokensMap=Object(n.reduce)(e,(function(e,t){return e[t.name]=t,e}),{});else if(Object(n.has)(e,"modes")&&Object(n.every)(Object(n.flatten)(Object(n.values)(e.modes)),h.isTokenType)){var r=Object(n.flatten)(Object(n.values)(e.modes)),o=Object(n.uniq)(r);this.tokensMap=Object(n.reduce)(o,(function(e,t){return e[t.name]=t,e}),{})}else{if(!Object(n.isObject)(e))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=Object(n.cloneObj)(e)}this.tokensMap.EOF=l.EOF;var s=Object(n.every)(Object(n.values)(e),(function(e){return Object(n.isEmpty)(e.categoryMatches)}));this.tokenMatcher=s?h.tokenStructuredMatcherNoCategories:h.tokenStructuredMatcher,Object(h.augmentTokenTypes)(Object(n.values)(this.tokensMap))},e.prototype.defineRule=function(e,t,r){if(this.selfAnalysisDone)throw Error("Grammar rule <"+e+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var s,i=Object(n.has)(r,"resyncEnabled")?r.resyncEnabled:u.DEFAULT_RULE_CONFIG.resyncEnabled,a=Object(n.has)(r,"recoveryValueFunc")?r.recoveryValueFunc:u.DEFAULT_RULE_CONFIG.recoveryValueFunc,c=this.ruleShortNameIdx<t},e.prototype.orInternalNoCst=function(e,t){var r=Object(n.isArray)(e)?e:e.DEF,s=this.getKeyForAutomaticLookahead(o.OR_IDX,t),i=this.getLaFuncFromCache(s).call(this,r);if(void 0!==i)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)},e.prototype.orInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(o.OR_IDX,t),s=this.nestedRuleBeforeClause(e,r);try{var i=Object(n.isArray)(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(void 0!==a){var u=i[a],c=this.nestedAltBeforeClause(u,t,o.OR_IDX,a);try{return u.ALT.call(this)}finally{void 0!==c&&this.nestedRuleFinallyClause(c.shortName,c.nestedName)}}this.raiseNoAltException(t,e.ERR_MSG)}finally{void 0!==s&&this.nestedRuleFinallyClause(r,s)}},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new s.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,r){var n;try{var o=void 0!==r?r.ARGS:void 0;return n=e.call(this,t,o),this.cstPostNonTerminal(n,void 0!==r&&void 0!==r.LABEL?r.LABEL:e.ruleName),n}catch(t){this.subruleInternalError(t,r,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,r){throw Object(s.isRecognitionException)(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==t&&void 0!==t.LABEL?t.LABEL:r),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,r){var n;try{var o=this.LA(1);!0===this.tokenMatcher(o,e)?(this.consumeToken(),n=o):this.consumeInternalError(e,o,r)}catch(r){n=this.consumeInternalRecovery(e,t,r)}return this.cstPostTerminal(void 0!==r&&void 0!==r.LABEL?r.LABEL:e.name,n),n},e.prototype.consumeInternalError=function(e,t,r){var n,o=this.LA(0);throw n=void 0!==r&&r.ERR_MSG?r.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new s.MismatchedTokenException(n,t,o))},e.prototype.consumeInternalRecovery=function(e,t,r){if(!this.recoveryEnabled||"MismatchedTokenException"!==r.name||this.isBackTracking())throw r;var n=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,n)}catch(e){throw e.name===c.IN_RULE_RECOVERY_EXCEPTION?r:e}},e.prototype.saveRecogState=function(){var e=this.errors,t=Object(n.cloneArr)(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),l.EOF)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"ErrorHandler",(function(){return a}));var n=r(112),o=r(87),s=r(107),i=r(86),a=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=Object(o.defaults)(e.errorMessageProvider,i.DEFAULT_PARSER_CONFIG.errorMessageProvider)},e.prototype.SAVE_ERROR=function(e){if(Object(n.isRecognitionException)(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Object(o.cloneArr)(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(e.prototype,"errors",{get:function(){return Object(o.cloneArr)(this._errors)},set:function(e){this._errors=e},enumerable:!0,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,t,r){for(var o=this.getCurrRuleFullName(),i=this.getGAstProductions()[o],a=Object(s.getLookaheadPathsForOptionalProd)(e,i,t,this.maxLookahead)[0],u=[],c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:r,ruleName:o});throw this.SAVE_ERROR(new n.EarlyExitException(l,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,t){for(var r=this.getCurrRuleFullName(),o=this.getGAstProductions()[r],i=Object(s.getLookaheadPathsForOr)(e,o,this.maxLookahead),a=[],u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));var c=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:i,actual:a,previous:c,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new n.NoViableAltException(l,this.LA(1),c))},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"ContentAssist",(function(){return s}));var n=r(108),o=r(87),s=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,t){var r=this.gastProductionsCache[e];if(Object(o.isUndefined)(r))throw Error("Rule ->"+e+"<- does not exist in this grammar.");return Object(n.nextPossibleTokensAfter)([r],t,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var t=Object(o.first)(e.ruleStack),r=this.getGAstProductions()[t];return new n.NextAfterTokenWalker(r,e).startWalking()},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"GastRecorder",(function(){return g}));var n=r(87),o=r(90),s=r(92),i=r(97),a=r(91),u=r(86),c=r(104),l={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(l);var h=Math.pow(2,c.BITS_FOR_OCCURRENCE_IDX)-1,d=Object(a.createToken)({name:"RECORDING_PHASE_TOKEN",pattern:s.Lexer.NA});Object(i.augmentTokenTypes)([d]);var p=Object(a.createTokenInstance)(d,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(p);var m={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},g=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",(function(){for(var t=function(t){var r=t>0?t:"";e["CONSUME"+r]=function(e,r){return this.consumeInternalRecord(e,t,r)},e["SUBRULE"+r]=function(e,r){return this.subruleInternalRecord(e,t,r)},e["OPTION"+r]=function(e){return this.optionInternalRecord(e,t)},e["OR"+r]=function(e){return this.orInternalRecord(e,t)},e["MANY"+r]=function(e){this.manyInternalRecord(t,e)},e["MANY_SEP"+r]=function(e){this.manySepFirstInternalRecord(t,e)},e["AT_LEAST_ONE"+r]=function(e){this.atLeastOneInternalRecord(t,e)},e["AT_LEAST_ONE_SEP"+r]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},r=0;r<10;r++)t(r);e.consume=function(e,t,r){return this.consumeInternalRecord(t,e,r)},e.subrule=function(e,t,r){return this.subruleInternalRecord(t,e,r)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD}))},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",(function(){for(var t=0;t<10;t++){var r=t>0?t:"";delete e["CONSUME"+r],delete e["SUBRULE"+r],delete e["OPTION"+r],delete e["OR"+r],delete e["MANY"+r],delete e["MANY_SEP"+r],delete e["AT_LEAST_ONE"+r],delete e["AT_LEAST_ONE_SEP"+r]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA}))},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return u.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new o.Rule({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message=e.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(t){throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return f.call(this,o.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){f.call(this,o.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){f.call(this,o.RepetitionMandatoryWithSeparator,t,e,!0)},e.prototype.manyInternalRecord=function(e,t){f.call(this,o.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){f.call(this,o.RepetitionWithSeparator,t,e,!0)},e.prototype.orInternalRecord=function(e,t){return E.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,t,r){if(y(t),!e||!1===Object(n.has)(e,"ruleName")){var s=new Error(" argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw s.KNOWN_RECORDER_ERROR=!0,s}var i=Object(n.peek)(this.recordingProdStack),a=e.ruleName,u=new o.NonTerminal({idx:t,nonTerminalName:a,referencedRule:void 0});return i.definition.push(u),this.outputCst?m:l},e.prototype.consumeInternalRecord=function(e,t,r){if(y(t),!Object(i.hasShortKeyProperty)(e)){var s=new Error(" argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(e)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw s.KNOWN_RECORDER_ERROR=!0,s}var a=Object(n.peek)(this.recordingProdStack),u=new o.Terminal({idx:t,terminalType:e});return a.definition.push(u),p},e}();function f(e,t,r,o){void 0===o&&(o=!1),y(r);var s=Object(n.peek)(this.recordingProdStack),i=Object(n.isFunction)(t)?t:t.DEF,a=new e({definition:[],idx:r});return Object(n.has)(t,"NAME")&&(a.name=t.NAME),o&&(a.separator=t.SEP),Object(n.has)(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(a),i.call(this),s.definition.push(a),this.recordingProdStack.pop(),l}function E(e,t){var r=this;y(t);var s=Object(n.peek)(this.recordingProdStack),i=!1===Object(n.isArray)(e),a=!1===i?e:e.DEF,u=new o.Alternation({definition:[],idx:t,ignoreAmbiguities:i&&!0===e.IGNORE_AMBIGUITIES});Object(n.has)(e,"NAME")&&(u.name=e.NAME),Object(n.has)(e,"MAX_LOOKAHEAD")&&(u.maxLookahead=e.MAX_LOOKAHEAD);var c=Object(n.some)(a,(function(e){return Object(n.isFunction)(e.GATE)}));return u.hasPredicates=c,s.definition.push(u),Object(n.forEach)(a,(function(e){var t=new o.Flat({definition:[]});u.definition.push(t),Object(n.has)(e,"NAME")&&(t.name=e.NAME),Object(n.has)(e,"IGNORE_AMBIGUITIES")?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object(n.has)(e,"GATE")&&(t.ignoreAmbiguities=!0),r.recordingProdStack.push(t),e.ALT.call(r),r.recordingProdStack.pop()})),l}function T(e){return 0===e?"":""+e}function y(e){if(e<0||e>h){var t=new Error("Invalid DSL Method idx value: <"+e+">\n\tIdx value must be a none negative value smaller than "+(h+1));throw t.KNOWN_RECORDER_ERROR=!0,t}}},function(e,t,r){"use strict";r.r(t),r.d(t,"PerformanceTracer",(function(){return s}));var n=r(87),o=r(86),s=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if(Object(n.has)(e,"traceInitPerf")){var t=e.traceInitPerf,r="number"==typeof t;this.traceInitMaxIdent=r?t:1/0,this.traceInitPerf=r?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=o.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent");var o=Object(n.timer)(t),s=o.time,i=o.value,a=s>10?console.warn:console.log;return this.traceInitIndent time: "+s+"ms"),this.traceInitIndent--,i}return t()},e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"createSyntaxDiagramsCode",(function(){return o}));var n=r(85);function o(e,t){var r=void 0===t?{}:t,o=r.resourceBase,s=void 0===o?"https://unpkg.com/chevrotain@"+n.VERSION+"/diagrams/":o,i=r.css;return'\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n'+("\n\n")+("\n