├── .gitignore ├── Corefile ├── LICENSE ├── README.md ├── content ├── posts │ ├── 2015-01-24-multiple-return-values-with-mockery.md │ └── 2021-08-17-serving-blog-content-over-dns.md └── scripts │ └── verifier.js ├── public ├── equilibrium-light.min.css ├── highlight.min.js └── index.html ├── publish-zones.php └── zones └── db.hod.experiments.jacobkiers.net /.gitignore: -------------------------------------------------------------------------------- 1 | zones 2 | -------------------------------------------------------------------------------- /Corefile: -------------------------------------------------------------------------------- 1 | hod.experiments.jacobkiers.net.:53 { 2 | log 3 | auto hod.experiments.jacobkiers.net. { 4 | directory /etc/coredns/zones/ 5 | reload 10s 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | 6 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. 11 | 12 | The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. 13 | 14 | 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. 15 | 16 | Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. 17 | 18 | A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. 19 | 20 | The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. 21 | 22 | An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. 23 | 24 | The precise terms and conditions for copying, distribution and modification follow. 25 | 26 | TERMS AND CONDITIONS 27 | 28 | 0. Definitions. 29 | 30 | "This License" refers to version 3 of the GNU Affero General Public License. 31 | 32 | "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. 33 | 34 | "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. 35 | 36 | 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. 37 | 38 | A "covered work" means either the unmodified Program or a work based on the Program. 39 | 40 | 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. 41 | 42 | 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. 43 | 44 | 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. 45 | 46 | 1. Source Code. 47 | 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. 48 | 49 | 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. 50 | 51 | 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. 52 | 53 | 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 54 | subprograms and other parts of the work. 55 | 56 | The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. 57 | 58 | The Corresponding Source for a work in source code form is that same work. 59 | 60 | 2. Basic Permissions. 61 | 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. 62 | 63 | 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. 64 | 65 | Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 66 | 67 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 68 | 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. 69 | 70 | 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. 71 | 72 | 4. Conveying Verbatim Copies. 73 | 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. 74 | 75 | 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. 76 | 77 | 5. Conveying Modified Source Versions. 78 | 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: 79 | 80 | a) The work must carry prominent notices stating that you modified it, and giving a relevant date. 81 | 82 | 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". 83 | 84 | 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. 85 | 86 | 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. 87 | 88 | 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. 89 | 90 | 6. Conveying Non-Source Forms. 91 | 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: 92 | 93 | 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. 94 | 95 | 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. 96 | 97 | 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. 98 | 99 | 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. 100 | 101 | 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. 102 | 103 | 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. 104 | 105 | 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. 106 | 107 | "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. 108 | 109 | 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). 110 | 111 | 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. 112 | 113 | 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. 114 | 115 | 7. Additional Terms. 116 | "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. 117 | 118 | 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. 119 | 120 | 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: 121 | 122 | a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or 123 | 124 | 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 125 | 126 | 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 127 | 128 | d) Limiting the use for publicity purposes of names of licensors or authors of the material; or 129 | 130 | e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or 131 | 132 | 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. 133 | 134 | 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. 135 | 136 | 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. 137 | 138 | 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. 139 | 140 | 8. Termination. 141 | 142 | 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). 143 | 144 | 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. 145 | 146 | 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. 147 | 148 | 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. 149 | 150 | 9. Acceptance Not Required for Having Copies. 151 | 152 | 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. 153 | 154 | 10. Automatic Licensing of Downstream Recipients. 155 | 156 | 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. 157 | 158 | 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. 159 | 160 | 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. 161 | 162 | 11. Patents. 163 | 164 | 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". 165 | 166 | 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. 167 | 168 | 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. 169 | 170 | 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. 171 | 172 | 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 173 | 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. 174 | 175 | 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. 176 | 177 | 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. 178 | 179 | 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. 180 | 181 | 12. No Surrender of Others' Freedom. 182 | 183 | 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 184 | 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. 185 | 186 | 13. Remote Network Interaction; Use with the GNU General Public License. 187 | 188 | Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. 189 | 190 | Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 191 | 192 | 14. Revised Versions of this License. 193 | 194 | The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. 195 | 196 | Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. 197 | 198 | If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. 199 | 200 | 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. 201 | 202 | 15. Disclaimer of Warranty. 203 | 204 | 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. 205 | 206 | 16. Limitation of Liability. 207 | 208 | 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. 209 | 210 | 17. Interpretation of Sections 15 and 16. 211 | 212 | 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. 213 | 214 | END OF TERMS AND CONDITIONS 215 | 216 | How to Apply These Terms to Your New Programs 217 | 218 | 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. 219 | 220 | 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. 221 | 222 | 223 | Copyright (C) 224 | 225 | This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. 226 | 227 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 228 | 229 | You should have received a copy of the GNU Affero General Public License along with this program. If not, see . 230 | 231 | Also add information on how to contact you by electronic and paper mail. 232 | 233 | If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. 234 | 235 | You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . 236 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # html-over-dns 2 | 3 | An experiment to host a website inside of DNS. Now visible at [https://jacobkiers.net/hod/index.html](https://jacobkiers.net/hod/index.html). 4 | 5 | To see what actually happens, use the Network tab of the Developer tools. 6 | -------------------------------------------------------------------------------- /content/posts/2015-01-24-multiple-return-values-with-mockery.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = Mockery: returning values and throwing exceptions 3 | date = 2015-04-24 4 | author = Jacob Kiers 5 | +++ 6 | 7 | Last week, I had to write a piece of code that contains retry logic. Naturally, I want to test it. That proved trickier than expected. 8 | 9 | The application code looks like this: 10 | 11 | ```php 12 | class Sender 13 | { 14 | protected $connection; 15 | 16 | public function send() 17 | { 18 | $success = false; 19 | 20 | $i = 0; 21 | do { 22 | $i++; 23 | 24 | try { 25 | $success = $this->doSend($i); 26 | } catch (SenderException $e) { 27 | $success = false; 28 | } 29 | 30 | } while (!$success && $i < 3); 31 | 32 | return $success; 33 | } 34 | 35 | protected function doSend($data) 36 | { 37 | // Can throw SenderException 38 | $response = $this->connection->send($data); 39 | 40 | if ('OK' === $response) { 41 | return true; 42 | } 43 | 44 | return false; 45 | } 46 | } 47 | ``` 48 | 49 | I specifically want to test the retry logic, so I have to mock the ::doSend() method. Then I can simulate the different outcomes (returning true or false, or throwing a SenderException). 50 | 51 | I use [Mockery] to do the real work. It is a great library. If you don't know it yet, please check it out. I will wait right here... 52 | 53 | Now, since ::doSend() is a protected method, Mockery must be instructed to allow that. 54 | 55 | So after the first try, I ended up with: 56 | 57 | ```php 58 | public function testItWillRetrySending() 59 | { 60 | $sender = M::mock('Sender'); 61 | $sender->shouldAllowMockingProtectedMethods() 62 | 63 | $sender->shouldReceive('doSend') 64 | ->andReturn(false, new Exception()); 65 | } 66 | ``` 67 | 68 | To my surprise, this did not work. Instead of throwing the exception, Mockery returns it. So my next try was this: 69 | 70 | ```php 71 | $sender->shouldReceive('doSend') 72 | ->andReturn(false) 73 | ->andThrow(new Exception()); 74 | ``` 75 | 76 | Another surprise: with this code, Mockery will always throw the exception, and ignore the first return value (false). After some debugging, I found out that Mockery just overwrites the return values in this case. 77 | 78 | Fortunately, there is another way to return multiple return values: the ::andReturnUsing() method. It gives full control over the return values. 79 | 80 | So I ended up with this testing code: 81 | 82 | ```php 83 | $return_value_generator = function () { 84 | static $counter = 0; 85 | 86 | $counter++; 87 | 88 | switch ($counter) { 89 | case 1: return false; 90 | case 2: throw new SenderException(); 91 | case 3: return true; 92 | default: throw new Exception("Should never reach this."); 93 | } 94 | }; 95 | 96 | $sender = M::mock('Sender'); 97 | 98 | $sender->shouldAllowMockingProtectedMethods() 99 | ->shouldReceive('doSend') 100 | ->andReturnUsing($return_value_generator); 101 | ``` 102 | 103 | This works perfectly. It feels a bit like a hack though. So if you know a better way or have any other remarks, please let me know. 104 | 105 | [Mockery]: https://github.com/mockery/mockery -------------------------------------------------------------------------------- /content/posts/2021-08-17-serving-blog-content-over-dns.md: -------------------------------------------------------------------------------- 1 | +++ 2 | title = HTML over DNS: Serving Blog Content Over DNS 3 | date = 2021-08-15 4 | author = Jacob Kiers 5 | +++ 6 | 7 | ## What's up? 8 | 9 | You might not be able to see it immediately, but the content of this page is served over DNS. 10 | 11 | This works because of [DNS over HTTPS] for which there is an [API from Cloudflare]. 12 | 13 | Comments at [Hacker News, apparently][HN]. 14 | 15 | ## How it works 16 | 17 | That API is used to load the contents of this page, essentially like this: 18 | 19 | ```js 20 | fetch("https://cloudflare-dns.com/dns-query?ct=application/dns-json&type=TXT&name=post.hod.experiments.jacobkiers.net"); 21 | ``` 22 | 23 | The content itself is served over DNS, using CoreDNS, with these contents: 24 | 25 | ```hcl 26 | hod.experiments.jacobkiers.net.:53 { 27 | log 28 | auto hod.experiments.jacobkiers.net. { 29 | directory /etc/coredns/zones/ 30 | reload 10s 31 | } 32 | } 33 | ``` 34 | 35 | This feeds into a zone file, which looks like this: 36 | 37 | ```dns 38 | $TTL 5m ; Default TTL 39 | @ IN SOA experiments.jacobkiers.net. postmaster.jacobkiers.net. ( 40 | 2021081612 ; serial 41 | 1h ; slave refresh interval 42 | 15m ; slave retry interval 43 | 1w ; slave copy expire time 44 | 1h ; NXDOMAIN cache time 45 | ) 46 | 47 | $ORIGIN hod.experiments.jacobkiers.net. 48 | 49 | ; 50 | ; domain name servers 51 | ; 52 | @ IN NS experiments.jacobkiers.net. 53 | 54 | 55 | ;; START BLOG RECORDS 56 | ; posts-2021-08-17-serving-blog-content-over-dns-md 57 | posts-2021-08-17-serving-blog-content-over-dns-md 60 IN TXT "t=text/markdown;c=3;h=2fd63f0f408ad1336283999d0487ced9;m=eyJ0aXRsZSI6IlNlcnZpbmcgYmxvZyBjb250ZW50IG92ZXIgRE5TIiwiZGF0ZSI6IjIwMjEtMDgtMTUiLCJhdXRob3IiOiJKYWNvYiBLaWVycyJ9" 58 | 0.2fd63f0f408ad1336283999d0487ced9 60 IN TXT "WW91IG1pZ2h0IG5vdCBiZSBhYmxlIHRvIHNlZSBpdCBpbW1lZGlhdGVseSwgYnV0IHRoZSBjb250ZW50IG9mIHRoaXMgcGFnZSBpcyB2ZXJ2ZWQgb3ZlciBETlMuCgpUaGlzIHdvcmtzIGJlY2F1c2Ugb2YgdGhlIG5ldyBETlMtb3Zlci1IVFRQIHN1cHBvcnQsIHdoaWNoLCBhdCBsZWFzdCBhdCBDbG91ZGZsYXJlLCBhbHNvIGhhcy" 59 | 1.2fd63f0f408ad1336283999d0487ced9 60 IN TXT "BhbiBBUEkuCgpUaGF0IEFQSSBpcyB1c2VkIHRvIGxvYWQgdGhlIGNvbnRlbnRzIG9mIHRoaXMgcGFnZSwgZXNzZW50aWFsbHkgbGlrZSB0aGlzOgoKYGBganMKZmV0Y2goImh0dHBzOi8vY2xvdWRmbGFyZS1kbnMuY29tL2Rucy1xdWVyeT9jdD1hcHBsaWNhdGlvbi9kbnMtanNvbiZ0eXBlPVRYVCZuYW1lPXBvc3QuaG9kLmV4cGVy" 60 | 2.2fd63f0f408ad1336283999d0487ced9 60 IN TXT "aW1lbnRzLmphY29ia2llcnMubmV0Iik7CmBgYAoKUGxlYXNlIHNlZSB0aGUgW3NvdXJjZSBjb2RlXSBmb3IgdGhlIGRldGFpbHMgb2YgaG93IGl0IHdvcmtzLgoKW3NvdXJjZSBjb2RlXTogaHR0cHM6Ly9naXRodWIuY29tL2phY29ia2llcnMvaHRtbC1vdmVyLWRucwo=" 61 | ``` 62 | 63 | These records are base64 encoded content, so when concatenated and decoded, they give the content of the posts. 64 | 65 | Please see the [source code] for the details. 66 | 67 | ## FAQ 68 | 69 | ### Why, though? 70 | 71 | In short: just because I could. It was one of those ideas I was wondering idly about, and I decided to just try it. 72 | 73 | ### Has it any practical use? 74 | 75 | It is not intended to have any. Since DNS records are fairly small, serving images or something would quickly start 76 | consuming 100s of requests per second. I wouldn't want to do that to Cloudflare. 77 | 78 | It would be an interesting experiment to see how feasible that is. 79 | 80 | [source code]: https://github.com/jacobkiers/html-over-dns "Yes, the title is a pun..." 81 | [DNS over HTTPS]: https://en.wikipedia.org/wiki/DNS_over_HTTPS 82 | [API from Cloudflare]: https://developers.cloudflare.com/1.1.1.1/dns-over-https/json-format 83 | [HN]: https://news.ycombinator.com/item?id=28218406 84 | -------------------------------------------------------------------------------- /content/scripts/verifier.js: -------------------------------------------------------------------------------- 1 | class Verifier { 2 | /*** 3 | * @param content Content 4 | */ 5 | async verify(content) { 6 | if (!window.isSecureContext) return; 7 | if (typeof TextEncoder === "undefined") return; 8 | if (typeof crypto === "undefined") return; 9 | const encoder = new TextEncoder(); 10 | const digestBuffer = await crypto.subtle.digest(content.index.hashAlgorithm, encoder.encode(content.content)); 11 | 12 | const hashArray = Array.from(new Uint8Array(digestBuffer)); // convert buffer to byte array 13 | const digest = hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); // convert bytes to hex string 14 | 15 | if (content.index.hash === digest) { 16 | document.getElementById("verification").innerHTML = 17 | "The hash of the content is verified to correspond with the hash" + 18 | " in the metadata. You are now reading exactly what was intended."; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /public/equilibrium-light.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | Theme: Equilibrium Light 3 | Author: Carlo Abelli 4 | License: ~ MIT (or more permissive) [via base16-schemes-source] 5 | Maintainer: @highlightjs/core-team 6 | Version: 2021.05.0 7 | */pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#43474e;background:#f5f0e7}.hljs ::selection{color:#d8d4cb}.hljs-comment{color:#73777f}.hljs-tag{color:#5a5f66}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#43474e}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#d02023}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#bf3e05}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#9d6f00}.hljs-strong{font-weight:700;color:#9d6f00}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#637200}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#007a72}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#0073b5}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#4e66b6}.hljs-emphasis{color:#4e66b6;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#c42775}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} -------------------------------------------------------------------------------- /public/highlight.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | Highlight.js v11.0.1 (git: 1cf31f015d) 3 | (c) 2006-2021 Ivan Sagalaev and other contributors 4 | License: BSD-3-Clause 5 | */ 6 | var hljs=function(){"use strict";var e={exports:{}};function t(e){ 7 | return e instanceof Map?e.clear=e.delete=e.set=()=>{ 8 | throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ 9 | throw Error("set is read-only") 10 | }),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((n=>{var i=e[n] 11 | ;"object"!=typeof i||Object.isFrozen(i)||t(i)})),e} 12 | e.exports=t,e.exports.default=t;var n=e.exports;class i{constructor(e){ 13 | void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} 14 | ignoreMatch(){this.isMatchIgnored=!0}}function r(e){ 15 | return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") 16 | }function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] 17 | ;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const o=e=>!!e.kind 18 | ;class a{constructor(e,t){ 19 | this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ 20 | this.buffer+=r(e)}openNode(e){if(!o(e))return;let t=e.kind 21 | ;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){ 22 | const n=e.split(".") 23 | ;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") 24 | }return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){ 25 | o(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ 26 | this.buffer+=``}}class l{constructor(){this.rootNode={ 27 | children:[]},this.stack=[this.rootNode]}get top(){ 28 | return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ 29 | this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} 30 | ;this.add(t),this.stack.push(t)}closeNode(){ 31 | if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ 32 | for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} 33 | walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ 34 | return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), 35 | t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ 36 | "string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ 37 | l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e} 38 | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())} 39 | addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root 40 | ;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ 41 | return new a(this,this.options).value()}finalize(){return!0}}function g(e){ 42 | return e?"string"==typeof e?e:e.source:null}function d(...e){ 43 | return e.map((e=>g(e))).join("")}function u(...e){return"("+((e=>{ 44 | const t=e[e.length-1] 45 | ;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} 46 | })(e).capture?"":"?:")+e.map((e=>g(e))).join("|")+")"}function h(e){ 47 | return RegExp(e.toString()+"|").exec("").length-1} 48 | const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ 49 | ;function p(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n 50 | ;let i=g(e),r="";for(;i.length>0;){const e=f.exec(i);if(!e){r+=i;break} 51 | r+=i.substring(0,e.index), 52 | i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0], 53 | "("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)} 54 | const b="[a-zA-Z]\\w*",m="[a-zA-Z_]\\w*",E="\\b\\d+(\\.\\d+)?",x="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",y="\\b(0b[01]+)",w={ 55 | begin:"\\\\[\\s\\S]",relevance:0},_={scope:"string",begin:"'",end:"'", 56 | illegal:"\\n",contains:[w]},v={scope:"string",begin:'"',end:'"',illegal:"\\n", 57 | contains:[w]},O=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t, 58 | contains:[]},n);i.contains.push({scope:"doctag", 59 | begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", 60 | end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) 61 | ;const r=u("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) 62 | ;return i.contains.push({begin:d(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i 63 | },k=O("//","$"),N=O("/\\*","\\*/"),S=O("#","$");var M=Object.freeze({ 64 | __proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:b,UNDERSCORE_IDENT_RE:m, 65 | NUMBER_RE:E,C_NUMBER_RE:x,BINARY_NUMBER_RE:y, 66 | RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", 67 | SHEBANG:(e={})=>{const t=/^#![ ]*\// 68 | ;return e.binary&&(e.begin=d(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t, 69 | end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, 70 | BACKSLASH_ESCAPE:w,APOS_STRING_MODE:_,QUOTE_STRING_MODE:v,PHRASAL_WORDS_MODE:{ 71 | begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ 72 | },COMMENT:O,C_LINE_COMMENT_MODE:k,C_BLOCK_COMMENT_MODE:N,HASH_COMMENT_MODE:S, 73 | NUMBER_MODE:{scope:"number",begin:E,relevance:0},C_NUMBER_MODE:{scope:"number", 74 | begin:x,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:y,relevance:0}, 75 | REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, 76 | end:/\/[gimuy]*/,illegal:/\n/,contains:[w,{begin:/\[/,end:/\]/,relevance:0, 77 | contains:[w]}]}]},TITLE_MODE:{scope:"title",begin:b,relevance:0}, 78 | UNDERSCORE_TITLE_MODE:{scope:"title",begin:m,relevance:0},METHOD_GUARD:{ 79 | begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ 80 | "on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ 81 | t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function R(e,t){ 82 | "."===e.input[e.index-1]&&t.ignoreMatch()}function j(e,t){ 83 | void 0!==e.className&&(e.scope=e.className,delete e.className)}function A(e,t){ 84 | t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", 85 | e.__beforeBegin=R,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, 86 | void 0===e.relevance&&(e.relevance=0))}function I(e,t){ 87 | Array.isArray(e.illegal)&&(e.illegal=u(...e.illegal))}function B(e,t){ 88 | if(e.match){ 89 | if(e.begin||e.end)throw Error("begin & end are not supported with match") 90 | ;e.begin=e.match,delete e.match}}function T(e,t){ 91 | void 0===e.relevance&&(e.relevance=1)}const L=(e,t)=>{if(!e.beforeMatch)return 92 | ;if(e.starts)throw Error("beforeMatch cannot be used with starts") 93 | ;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] 94 | })),e.keywords=n.keywords, 95 | e.begin=d(n.beforeMatch,d("(?=",n.begin,")")),e.starts={relevance:0, 96 | contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch 97 | },D=["of","and","for","in","not","or","if","then","parent","list","value"] 98 | ;function P(e,t,n="keyword"){const i=Object.create(null) 99 | ;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{ 100 | Object.assign(i,P(e[n],t,n))})),i;function r(e,n){ 101 | t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") 102 | ;i[n[0]]=[e,C(n[0],n[1])]}))}}function C(e,t){ 103 | return t?Number(t):(e=>D.includes(e.toLowerCase()))(e)?0:1}const H={},$=e=>{ 104 | console.error(e)},U=(e,...t)=>{console.log("WARN: "+e,...t)},z=(e,t)=>{ 105 | H[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),H[`${e}/${t}`]=!0) 106 | },K=Error();function W(e,t,{key:n}){let i=0;const r=e[n],s={},o={} 107 | ;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=h(t[e-1]) 108 | ;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function X(e){(e=>{ 109 | e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, 110 | delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ 111 | _wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope 112 | }),(e=>{if(Array.isArray(e.begin)){ 113 | if(e.skip||e.excludeBegin||e.returnBegin)throw $("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), 114 | K 115 | ;if("object"!=typeof e.beginScope||null===e.beginScope)throw $("beginScope must be object"), 116 | K;W(e,e.begin,{key:"beginScope"}),e.begin=p(e.begin,{joinWith:""})}})(e),(e=>{ 117 | if(Array.isArray(e.end)){ 118 | if(e.skip||e.excludeEnd||e.returnEnd)throw $("skip, excludeEnd, returnEnd not compatible with endScope: {}"), 119 | K 120 | ;if("object"!=typeof e.endScope||null===e.endScope)throw $("endScope must be object"), 121 | K;W(e,e.end,{key:"endScope"}),e.end=p(e.end,{joinWith:""})}})(e)}function G(e){ 122 | function t(t,n){return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(n?"g":""))} 123 | class n{constructor(){ 124 | this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} 125 | addRule(e,t){ 126 | t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), 127 | this.matchAt+=h(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) 128 | ;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(p(e,{joinWith:"|" 129 | }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex 130 | ;const t=this.matcherRe.exec(e);if(!t)return null 131 | ;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] 132 | ;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){ 133 | this.rules=[],this.multiRegexes=[], 134 | this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ 135 | if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n 136 | ;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), 137 | t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ 138 | return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ 139 | this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ 140 | const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex 141 | ;let n=t.exec(e) 142 | ;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ 143 | const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} 144 | return n&&(this.regexIndex+=n.position+1, 145 | this.regexIndex===this.count&&this.considerAll()),n}} 146 | if(e.compilerExtensions||(e.compilerExtensions=[]), 147 | e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") 148 | ;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r 149 | ;if(r.isCompiled)return a 150 | ;[j,B,X,L].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))), 151 | r.__beforeBegin=null,[A,I,T].forEach((e=>e(r,o))),r.isCompiled=!0;let l=null 152 | ;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), 153 | l=r.keywords.$pattern, 154 | delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=P(r.keywords,e.case_insensitive)), 155 | a.keywordPatternRe=t(l,!0), 156 | o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), 157 | r.end&&(a.endRe=t(r.end)), 158 | a.terminatorEnd=g(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)), 159 | r.illegal&&(a.illegalRe=t(r.illegal)), 160 | r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{ 161 | variants:null},t)))),e.cachedVariants?e.cachedVariants:Z(e)?s(e,{ 162 | starts:e.starts?s(e.starts):null 163 | }):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a) 164 | })),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i 165 | ;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" 166 | }))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" 167 | }),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function Z(e){ 168 | return!!e&&(e.endsWithParent||Z(e.starts))}const F=r,V=s,q=Symbol("nomatch") 169 | ;var J=(e=>{const t=Object.create(null),r=Object.create(null),s=[];let o=!0 170 | ;const a="Could not find the language '{}', did you forget to load/include a language module?",l={ 171 | disableAutodetect:!0,name:"Plain text",contains:[]};let g={ 172 | ignoreUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, 173 | languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", 174 | cssSelector:"pre code",languages:null,__emitter:c};function d(e){ 175 | return g.noHighlightRe.test(e)}function u(e,t,n,i){let r="",s="" 176 | ;"object"==typeof t?(r=e, 177 | n=t.ignoreIllegals,s=t.language,i=void 0):(z("10.7.0","highlight(lang, code, ...args) has been deprecated."), 178 | z("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), 179 | s=e,r=t),void 0===n&&(n=!0);const o={code:r,language:s};w("before:highlight",o) 180 | ;const a=o.result?o.result:h(o.language,o.code,n,i) 181 | ;return a.code=o.code,w("after:highlight",a),a}function h(e,n,r,s){ 182 | const l=Object.create(null);function c(){if(!k.keywords)return void S.addText(M) 183 | ;let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(M),n="" 184 | ;for(;t;){n+=M.substring(e,t.index) 185 | ;const r=_.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,k.keywords[i]);if(s){ 186 | const[e,i]=s 187 | ;if(S.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{ 188 | const n=_.classNameAliases[e]||e;S.addKeyword(t[0],n)}}else n+=t[0] 189 | ;e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(M)}var i 190 | ;n+=M.substr(e),S.addText(n)}function d(){null!=k.subLanguage?(()=>{ 191 | if(""===M)return;let e=null;if("string"==typeof k.subLanguage){ 192 | if(!t[k.subLanguage])return void S.addText(M) 193 | ;e=h(k.subLanguage,M,!0,N[k.subLanguage]),N[k.subLanguage]=e._top 194 | }else e=f(M,k.subLanguage.length?k.subLanguage:null) 195 | ;k.relevance>0&&(R+=e.relevance),S.addSublanguage(e._emitter,e.language) 196 | })():c(),M=""}function u(e,t){let n=1;for(;void 0!==t[n];){if(!e._emit[n]){n++ 197 | ;continue}const i=_.classNameAliases[e[n]]||e[n],r=t[n] 198 | ;i?S.addKeyword(r,i):(M=r,c(),M=""),n++}}function p(e,t){ 199 | return e.scope&&"string"==typeof e.scope&&S.openNode(_.classNameAliases[e.scope]||e.scope), 200 | e.beginScope&&(e.beginScope._wrap?(S.addKeyword(M,_.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), 201 | M=""):e.beginScope._multi&&(u(e.beginScope,t),M="")),k=Object.create(e,{parent:{ 202 | value:k}}),k}function b(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t) 203 | ;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e) 204 | ;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){ 205 | for(;e.endsParent&&e.parent;)e=e.parent;return e}} 206 | if(e.endsWithParent)return b(e.parent,t,n)}function m(e){ 207 | return 0===k.matcher.regexIndex?(M+=e[0],1):(I=!0,0)}function x(e){ 208 | const t=e[0],i=n.substr(e.index),r=b(k,e,i);if(!r)return q;const s=k 209 | ;k.endScope&&k.endScope._wrap?(d(), 210 | S.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(d(), 211 | u(k.endScope,e)):s.skip?M+=t:(s.returnEnd||s.excludeEnd||(M+=t), 212 | d(),s.excludeEnd&&(M=t));do{ 213 | k.scope&&!k.isMultiClass&&S.closeNode(),k.skip||k.subLanguage||(R+=k.relevance), 214 | k=k.parent}while(k!==r.parent) 215 | ;return r.starts&&p(r.starts,e),s.returnEnd?0:t.length}let y={};function w(t,s){ 216 | const a=s&&s[0];if(M+=t,null==a)return d(),0 217 | ;if("begin"===y.type&&"end"===s.type&&y.index===s.index&&""===a){ 218 | if(M+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`) 219 | ;throw t.languageName=e,t.badRule=y.rule,t}return 1} 220 | if(y=s,"begin"===s.type)return(e=>{ 221 | const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]] 222 | ;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return m(t) 223 | ;return n.skip?M+=t:(n.excludeBegin&&(M+=t), 224 | d(),n.returnBegin||n.excludeBegin||(M=t)),p(n,e),n.returnBegin?0:t.length})(s) 225 | ;if("illegal"===s.type&&!r){ 226 | const e=Error('Illegal lexeme "'+a+'" for mode "'+(k.scope||"")+'"') 227 | ;throw e.mode=k,e}if("end"===s.type){const e=x(s);if(e!==q)return e} 228 | if("illegal"===s.type&&""===a)return 1 229 | ;if(A>1e5&&A>3*s.index)throw Error("potential infinite loop, way more iterations than matches") 230 | ;return M+=a,a.length}const _=E(e) 231 | ;if(!_)throw $(a.replace("{}",e)),Error('Unknown language: "'+e+'"') 232 | ;const v=G(_);let O="",k=s||v;const N={},S=new g.__emitter(g);(()=>{const e=[] 233 | ;for(let t=k;t!==_;t=t.parent)t.scope&&e.unshift(t.scope) 234 | ;e.forEach((e=>S.openNode(e)))})();let M="",R=0,j=0,A=0,I=!1;try{ 235 | for(k.matcher.considerAll();;){ 236 | A++,I?I=!1:k.matcher.considerAll(),k.matcher.lastIndex=j 237 | ;const e=k.matcher.exec(n);if(!e)break;const t=w(n.substring(j,e.index),e) 238 | ;j=e.index+t}return w(n.substr(j)),S.closeAllNodes(),S.finalize(),O=S.toHTML(),{ 239 | language:e,value:O,relevance:R,illegal:!1,_emitter:S,_top:k}}catch(t){ 240 | if(t.message&&t.message.includes("Illegal"))return{language:e,value:F(n), 241 | illegal:!0,relevance:0,_illegalBy:{message:t.message,index:j, 242 | context:n.slice(j-100,j+100),mode:t.mode,resultSoFar:O},_emitter:S};if(o)return{ 243 | language:e,value:F(n),illegal:!1,relevance:0,errorRaised:t,_emitter:S,_top:k} 244 | ;throw t}}function f(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{ 245 | const t={value:F(e),illegal:!1,relevance:0,_top:l,_emitter:new g.__emitter(g)} 246 | ;return t._emitter.addText(e),t})(e),r=n.filter(E).filter(y).map((t=>h(t,e,!1))) 247 | ;r.unshift(i);const s=r.sort(((e,t)=>{ 248 | if(e.relevance!==t.relevance)return t.relevance-e.relevance 249 | ;if(e.language&&t.language){if(E(e.language).supersetOf===t.language)return 1 250 | ;if(E(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,c=o 251 | ;return c.secondBest=a,c}function p(e){let t=null;const n=(e=>{ 252 | let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" 253 | ;const n=g.languageDetectRe.exec(t);if(n){const t=E(n[1]) 254 | ;return t||(U(a.replace("{}",n[1])), 255 | U("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} 256 | return t.split(/\s+/).find((e=>d(e)||E(e)))})(e);if(d(n))return 257 | ;w("before:highlightElement",{el:e,language:n 258 | }),!g.ignoreUnescapedHTML&&e.children.length>0&&(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), 259 | console.warn("https://github.com/highlightjs/highlight.js/issues/2886"), 260 | console.warn(e)),t=e;const i=t.textContent,s=n?u(i,{language:n,ignoreIllegals:!0 261 | }):f(i);e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n 262 | ;e.classList.add("hljs"),e.classList.add("language-"+i) 263 | })(e,n,s.language),e.result={language:s.language,re:s.relevance, 264 | relevance:s.relevance},s.secondBest&&(e.secondBest={ 265 | language:s.secondBest.language,relevance:s.secondBest.relevance 266 | }),w("after:highlightElement",{el:e,result:s,text:i})}let b=!1;function m(){ 267 | "loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(p):b=!0 268 | }function E(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]} 269 | function x(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ 270 | r[e.toLowerCase()]=t}))}function y(e){const t=E(e) 271 | ;return t&&!t.disableAutodetect}function w(e,t){const n=e;s.forEach((e=>{ 272 | e[n]&&e[n](t)}))} 273 | "undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ 274 | b&&m()}),!1),Object.assign(e,{highlight:u,highlightAuto:f,highlightAll:m, 275 | highlightElement:p, 276 | highlightBlock:e=>(z("10.7.0","highlightBlock will be removed entirely in v12.0"), 277 | z("10.7.0","Please use highlightElement now."),p(e)),configure:e=>{g=V(g,e)}, 278 | initHighlighting:()=>{ 279 | m(),z("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, 280 | initHighlightingOnLoad:()=>{ 281 | m(),z("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") 282 | },registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){ 283 | if($("Language definition for '{}' could not be registered.".replace("{}",n)), 284 | !o)throw e;$(e),r=l} 285 | r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&x(r.aliases,{ 286 | languageName:n})},unregisterLanguage:e=>{delete t[e] 287 | ;for(const t of Object.keys(r))r[t]===e&&delete r[t]}, 288 | listLanguages:()=>Object.keys(t),getLanguage:E,registerAliases:x, 289 | autoDetection:y,inherit:V,addPlugin:e=>{(e=>{ 290 | e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ 291 | e["before:highlightBlock"](Object.assign({block:t.el},t)) 292 | }),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ 293 | e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} 294 | }),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0},e.versionString="11.0.1" 295 | ;for(const e in M)"object"==typeof M[e]&&n(M[e]);return Object.assign(e,M),e 296 | })({}),Y=Object.freeze({__proto__:null});const Q=J 297 | ;for(const e of Object.keys(Y)){const t=e.replace("grmr_","") 298 | ;Q.registerLanguage(t,Y[e])}return Q}() 299 | ;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);hljs.registerLanguage("http",(()=>{"use strict";function e(...e){ 300 | return e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null;var n 301 | })).join("")}return n=>{const a="HTTP/(2|1\\.[01])",s={className:"attribute", 302 | begin:e("^",/[A-Za-z][A-Za-z0-9-]*/,"(?=\\:\\s)"),starts:{contains:[{ 303 | className:"punctuation",begin:/: /,relevance:0,starts:{end:"$",relevance:0}}]} 304 | },t=[s,{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}];return{ 305 | name:"HTTP",aliases:["https"],illegal:/\S/,contains:[{begin:"^(?="+a+" \\d{3})", 306 | end:/$/,contains:[{className:"meta",begin:a},{className:"number", 307 | begin:"\\b\\d{3}\\b"}],starts:{end:/\b\B/,illegal:/\S/,contains:t}},{ 308 | begin:"(?=^[A-Z]+ (.*?) "+a+"$)",end:/$/,contains:[{className:"string", 309 | begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{className:"meta",begin:a},{ 310 | className:"keyword",begin:"[A-Z]+"}],starts:{end:/\b\B/,illegal:/\S/,contains:t} 311 | },n.inherit(s,{relevance:0})]}}})());hljs.registerLanguage("pgsql",(()=>{"use strict";return E=>{ 312 | const T=E.COMMENT("--","$"),N="\\$([a-zA-Z_]?|[a-zA-Z_][a-zA-Z_0-9]*)\\$",A="BIGINT INT8 BIGSERIAL SERIAL8 BIT VARYING VARBIT BOOLEAN BOOL BOX BYTEA CHARACTER CHAR VARCHAR CIDR CIRCLE DATE DOUBLE PRECISION FLOAT8 FLOAT INET INTEGER INT INT4 INTERVAL JSON JSONB LINE LSEG|10 MACADDR MACADDR8 MONEY NUMERIC DEC DECIMAL PATH POINT POLYGON REAL FLOAT4 SMALLINT INT2 SMALLSERIAL|10 SERIAL2|10 SERIAL|10 SERIAL4|10 TEXT TIME ZONE TIMETZ|10 TIMESTAMP TIMESTAMPTZ|10 TSQUERY|10 TSVECTOR|10 TXID_SNAPSHOT|10 UUID XML NATIONAL NCHAR INT4RANGE|10 INT8RANGE|10 NUMRANGE|10 TSRANGE|10 TSTZRANGE|10 DATERANGE|10 ANYELEMENT ANYARRAY ANYNONARRAY ANYENUM ANYRANGE CSTRING INTERNAL RECORD PG_DDL_COMMAND VOID UNKNOWN OPAQUE REFCURSOR NAME OID REGPROC|10 REGPROCEDURE|10 REGOPER|10 REGOPERATOR|10 REGCLASS|10 REGTYPE|10 REGROLE|10 REGNAMESPACE|10 REGCONFIG|10 REGDICTIONARY|10 ",R=A.trim().split(" ").map((E=>E.split("|")[0])).join("|"),I="ARRAY_AGG AVG BIT_AND BIT_OR BOOL_AND BOOL_OR COUNT EVERY JSON_AGG JSONB_AGG JSON_OBJECT_AGG JSONB_OBJECT_AGG MAX MIN MODE STRING_AGG SUM XMLAGG CORR COVAR_POP COVAR_SAMP REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 REGR_SLOPE REGR_SXX REGR_SXY REGR_SYY STDDEV STDDEV_POP STDDEV_SAMP VARIANCE VAR_POP VAR_SAMP PERCENTILE_CONT PERCENTILE_DISC ROW_NUMBER RANK DENSE_RANK PERCENT_RANK CUME_DIST NTILE LAG LEAD FIRST_VALUE LAST_VALUE NTH_VALUE NUM_NONNULLS NUM_NULLS ABS CBRT CEIL CEILING DEGREES DIV EXP FLOOR LN LOG MOD PI POWER RADIANS ROUND SCALE SIGN SQRT TRUNC WIDTH_BUCKET RANDOM SETSEED ACOS ACOSD ASIN ASIND ATAN ATAND ATAN2 ATAN2D COS COSD COT COTD SIN SIND TAN TAND BIT_LENGTH CHAR_LENGTH CHARACTER_LENGTH LOWER OCTET_LENGTH OVERLAY POSITION SUBSTRING TREAT TRIM UPPER ASCII BTRIM CHR CONCAT CONCAT_WS CONVERT CONVERT_FROM CONVERT_TO DECODE ENCODE INITCAP LEFT LENGTH LPAD LTRIM MD5 PARSE_IDENT PG_CLIENT_ENCODING QUOTE_IDENT|10 QUOTE_LITERAL|10 QUOTE_NULLABLE|10 REGEXP_MATCH REGEXP_MATCHES REGEXP_REPLACE REGEXP_SPLIT_TO_ARRAY REGEXP_SPLIT_TO_TABLE REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPLIT_PART STRPOS SUBSTR TO_ASCII TO_HEX TRANSLATE OCTET_LENGTH GET_BIT GET_BYTE SET_BIT SET_BYTE TO_CHAR TO_DATE TO_NUMBER TO_TIMESTAMP AGE CLOCK_TIMESTAMP|10 DATE_PART DATE_TRUNC ISFINITE JUSTIFY_DAYS JUSTIFY_HOURS JUSTIFY_INTERVAL MAKE_DATE MAKE_INTERVAL|10 MAKE_TIME MAKE_TIMESTAMP|10 MAKE_TIMESTAMPTZ|10 NOW STATEMENT_TIMESTAMP|10 TIMEOFDAY TRANSACTION_TIMESTAMP|10 ENUM_FIRST ENUM_LAST ENUM_RANGE AREA CENTER DIAMETER HEIGHT ISCLOSED ISOPEN NPOINTS PCLOSE POPEN RADIUS WIDTH BOX BOUND_BOX CIRCLE LINE LSEG PATH POLYGON ABBREV BROADCAST HOST HOSTMASK MASKLEN NETMASK NETWORK SET_MASKLEN TEXT INET_SAME_FAMILY INET_MERGE MACADDR8_SET7BIT ARRAY_TO_TSVECTOR GET_CURRENT_TS_CONFIG NUMNODE PLAINTO_TSQUERY PHRASETO_TSQUERY WEBSEARCH_TO_TSQUERY QUERYTREE SETWEIGHT STRIP TO_TSQUERY TO_TSVECTOR JSON_TO_TSVECTOR JSONB_TO_TSVECTOR TS_DELETE TS_FILTER TS_HEADLINE TS_RANK TS_RANK_CD TS_REWRITE TSQUERY_PHRASE TSVECTOR_TO_ARRAY TSVECTOR_UPDATE_TRIGGER TSVECTOR_UPDATE_TRIGGER_COLUMN XMLCOMMENT XMLCONCAT XMLELEMENT XMLFOREST XMLPI XMLROOT XMLEXISTS XML_IS_WELL_FORMED XML_IS_WELL_FORMED_DOCUMENT XML_IS_WELL_FORMED_CONTENT XPATH XPATH_EXISTS XMLTABLE XMLNAMESPACES TABLE_TO_XML TABLE_TO_XMLSCHEMA TABLE_TO_XML_AND_XMLSCHEMA QUERY_TO_XML QUERY_TO_XMLSCHEMA QUERY_TO_XML_AND_XMLSCHEMA CURSOR_TO_XML CURSOR_TO_XMLSCHEMA SCHEMA_TO_XML SCHEMA_TO_XMLSCHEMA SCHEMA_TO_XML_AND_XMLSCHEMA DATABASE_TO_XML DATABASE_TO_XMLSCHEMA DATABASE_TO_XML_AND_XMLSCHEMA XMLATTRIBUTES TO_JSON TO_JSONB ARRAY_TO_JSON ROW_TO_JSON JSON_BUILD_ARRAY JSONB_BUILD_ARRAY JSON_BUILD_OBJECT JSONB_BUILD_OBJECT JSON_OBJECT JSONB_OBJECT JSON_ARRAY_LENGTH JSONB_ARRAY_LENGTH JSON_EACH JSONB_EACH JSON_EACH_TEXT JSONB_EACH_TEXT JSON_EXTRACT_PATH JSONB_EXTRACT_PATH JSON_OBJECT_KEYS JSONB_OBJECT_KEYS JSON_POPULATE_RECORD JSONB_POPULATE_RECORD JSON_POPULATE_RECORDSET JSONB_POPULATE_RECORDSET JSON_ARRAY_ELEMENTS JSONB_ARRAY_ELEMENTS JSON_ARRAY_ELEMENTS_TEXT JSONB_ARRAY_ELEMENTS_TEXT JSON_TYPEOF JSONB_TYPEOF JSON_TO_RECORD JSONB_TO_RECORD JSON_TO_RECORDSET JSONB_TO_RECORDSET JSON_STRIP_NULLS JSONB_STRIP_NULLS JSONB_SET JSONB_INSERT JSONB_PRETTY CURRVAL LASTVAL NEXTVAL SETVAL COALESCE NULLIF GREATEST LEAST ARRAY_APPEND ARRAY_CAT ARRAY_NDIMS ARRAY_DIMS ARRAY_FILL ARRAY_LENGTH ARRAY_LOWER ARRAY_POSITION ARRAY_POSITIONS ARRAY_PREPEND ARRAY_REMOVE ARRAY_REPLACE ARRAY_TO_STRING ARRAY_UPPER CARDINALITY STRING_TO_ARRAY UNNEST ISEMPTY LOWER_INC UPPER_INC LOWER_INF UPPER_INF RANGE_MERGE GENERATE_SERIES GENERATE_SUBSCRIPTS CURRENT_DATABASE CURRENT_QUERY CURRENT_SCHEMA|10 CURRENT_SCHEMAS|10 INET_CLIENT_ADDR INET_CLIENT_PORT INET_SERVER_ADDR INET_SERVER_PORT ROW_SECURITY_ACTIVE FORMAT_TYPE TO_REGCLASS TO_REGPROC TO_REGPROCEDURE TO_REGOPER TO_REGOPERATOR TO_REGTYPE TO_REGNAMESPACE TO_REGROLE COL_DESCRIPTION OBJ_DESCRIPTION SHOBJ_DESCRIPTION TXID_CURRENT TXID_CURRENT_IF_ASSIGNED TXID_CURRENT_SNAPSHOT TXID_SNAPSHOT_XIP TXID_SNAPSHOT_XMAX TXID_SNAPSHOT_XMIN TXID_VISIBLE_IN_SNAPSHOT TXID_STATUS CURRENT_SETTING SET_CONFIG BRIN_SUMMARIZE_NEW_VALUES BRIN_SUMMARIZE_RANGE BRIN_DESUMMARIZE_RANGE GIN_CLEAN_PENDING_LIST SUPPRESS_REDUNDANT_UPDATES_TRIGGER LO_FROM_BYTEA LO_PUT LO_GET LO_CREAT LO_CREATE LO_UNLINK LO_IMPORT LO_EXPORT LOREAD LOWRITE GROUPING CAST".split(" ").map((E=>E.split("|")[0])).join("|") 313 | ;return{name:"PostgreSQL",aliases:["postgres","postgresql"],supersetOf:"sql", 314 | case_insensitive:!0,keywords:{ 315 | keyword:"ABORT ALTER ANALYZE BEGIN CALL CHECKPOINT|10 CLOSE CLUSTER COMMENT COMMIT COPY CREATE DEALLOCATE DECLARE DELETE DISCARD DO DROP END EXECUTE EXPLAIN FETCH GRANT IMPORT INSERT LISTEN LOAD LOCK MOVE NOTIFY PREPARE REASSIGN|10 REFRESH REINDEX RELEASE RESET REVOKE ROLLBACK SAVEPOINT SECURITY SELECT SET SHOW START TRUNCATE UNLISTEN|10 UPDATE VACUUM|10 VALUES AGGREGATE COLLATION CONVERSION|10 DATABASE DEFAULT PRIVILEGES DOMAIN TRIGGER EXTENSION FOREIGN WRAPPER|10 TABLE FUNCTION GROUP LANGUAGE LARGE OBJECT MATERIALIZED VIEW OPERATOR CLASS FAMILY POLICY PUBLICATION|10 ROLE RULE SCHEMA SEQUENCE SERVER STATISTICS SUBSCRIPTION SYSTEM TABLESPACE CONFIGURATION DICTIONARY PARSER TEMPLATE TYPE USER MAPPING PREPARED ACCESS METHOD CAST AS TRANSFORM TRANSACTION OWNED TO INTO SESSION AUTHORIZATION INDEX PROCEDURE ASSERTION ALL ANALYSE AND ANY ARRAY ASC ASYMMETRIC|10 BOTH CASE CHECK COLLATE COLUMN CONCURRENTLY|10 CONSTRAINT CROSS DEFERRABLE RANGE DESC DISTINCT ELSE EXCEPT FOR FREEZE|10 FROM FULL HAVING ILIKE IN INITIALLY INNER INTERSECT IS ISNULL JOIN LATERAL LEADING LIKE LIMIT NATURAL NOT NOTNULL NULL OFFSET ON ONLY OR ORDER OUTER OVERLAPS PLACING PRIMARY REFERENCES RETURNING SIMILAR SOME SYMMETRIC TABLESAMPLE THEN TRAILING UNION UNIQUE USING VARIADIC|10 VERBOSE WHEN WHERE WINDOW WITH BY RETURNS INOUT OUT SETOF|10 IF STRICT CURRENT CONTINUE OWNER LOCATION OVER PARTITION WITHIN BETWEEN ESCAPE EXTERNAL INVOKER DEFINER WORK RENAME VERSION CONNECTION CONNECT TABLES TEMP TEMPORARY FUNCTIONS SEQUENCES TYPES SCHEMAS OPTION CASCADE RESTRICT ADD ADMIN EXISTS VALID VALIDATE ENABLE DISABLE REPLICA|10 ALWAYS PASSING COLUMNS PATH REF VALUE OVERRIDING IMMUTABLE STABLE VOLATILE BEFORE AFTER EACH ROW PROCEDURAL ROUTINE NO HANDLER VALIDATOR OPTIONS STORAGE OIDS|10 WITHOUT INHERIT DEPENDS CALLED INPUT LEAKPROOF|10 COST ROWS NOWAIT SEARCH UNTIL ENCRYPTED|10 PASSWORD CONFLICT|10 INSTEAD INHERITS CHARACTERISTICS WRITE CURSOR ALSO STATEMENT SHARE EXCLUSIVE INLINE ISOLATION REPEATABLE READ COMMITTED SERIALIZABLE UNCOMMITTED LOCAL GLOBAL SQL PROCEDURES RECURSIVE SNAPSHOT ROLLUP CUBE TRUSTED|10 INCLUDE FOLLOWING PRECEDING UNBOUNDED RANGE GROUPS UNENCRYPTED|10 SYSID FORMAT DELIMITER HEADER QUOTE ENCODING FILTER OFF FORCE_QUOTE FORCE_NOT_NULL FORCE_NULL COSTS BUFFERS TIMING SUMMARY DISABLE_PAGE_SKIPPING RESTART CYCLE GENERATED IDENTITY DEFERRED IMMEDIATE LEVEL LOGGED UNLOGGED OF NOTHING NONE EXCLUDE ATTRIBUTE USAGE ROUTINES TRUE FALSE NAN INFINITY ALIAS BEGIN CONSTANT DECLARE END EXCEPTION RETURN PERFORM|10 RAISE GET DIAGNOSTICS STACKED|10 FOREACH LOOP ELSIF EXIT WHILE REVERSE SLICE DEBUG LOG INFO NOTICE WARNING ASSERT OPEN SUPERUSER NOSUPERUSER CREATEDB NOCREATEDB CREATEROLE NOCREATEROLE INHERIT NOINHERIT LOGIN NOLOGIN REPLICATION NOREPLICATION BYPASSRLS NOBYPASSRLS ", 316 | built_in:"CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURRENT_CATALOG|10 CURRENT_DATE LOCALTIME LOCALTIMESTAMP CURRENT_ROLE|10 CURRENT_SCHEMA|10 SESSION_USER PUBLIC FOUND NEW OLD TG_NAME|10 TG_WHEN|10 TG_LEVEL|10 TG_OP|10 TG_RELID|10 TG_RELNAME|10 TG_TABLE_NAME|10 TG_TABLE_SCHEMA|10 TG_NARGS|10 TG_ARGV|10 TG_EVENT|10 TG_TAG|10 ROW_COUNT RESULT_OID|10 PG_CONTEXT|10 RETURNED_SQLSTATE COLUMN_NAME CONSTRAINT_NAME PG_DATATYPE_NAME|10 MESSAGE_TEXT TABLE_NAME SCHEMA_NAME PG_EXCEPTION_DETAIL|10 PG_EXCEPTION_HINT|10 PG_EXCEPTION_CONTEXT|10 SQLSTATE SQLERRM|10 SUCCESSFUL_COMPLETION WARNING DYNAMIC_RESULT_SETS_RETURNED IMPLICIT_ZERO_BIT_PADDING NULL_VALUE_ELIMINATED_IN_SET_FUNCTION PRIVILEGE_NOT_GRANTED PRIVILEGE_NOT_REVOKED STRING_DATA_RIGHT_TRUNCATION DEPRECATED_FEATURE NO_DATA NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED SQL_STATEMENT_NOT_YET_COMPLETE CONNECTION_EXCEPTION CONNECTION_DOES_NOT_EXIST CONNECTION_FAILURE SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION TRANSACTION_RESOLUTION_UNKNOWN PROTOCOL_VIOLATION TRIGGERED_ACTION_EXCEPTION FEATURE_NOT_SUPPORTED INVALID_TRANSACTION_INITIATION LOCATOR_EXCEPTION INVALID_LOCATOR_SPECIFICATION INVALID_GRANTOR INVALID_GRANT_OPERATION INVALID_ROLE_SPECIFICATION DIAGNOSTICS_EXCEPTION STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER CASE_NOT_FOUND CARDINALITY_VIOLATION DATA_EXCEPTION ARRAY_SUBSCRIPT_ERROR CHARACTER_NOT_IN_REPERTOIRE DATETIME_FIELD_OVERFLOW DIVISION_BY_ZERO ERROR_IN_ASSIGNMENT ESCAPE_CHARACTER_CONFLICT INDICATOR_OVERFLOW INTERVAL_FIELD_OVERFLOW INVALID_ARGUMENT_FOR_LOGARITHM INVALID_ARGUMENT_FOR_NTILE_FUNCTION INVALID_ARGUMENT_FOR_NTH_VALUE_FUNCTION INVALID_ARGUMENT_FOR_POWER_FUNCTION INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION INVALID_CHARACTER_VALUE_FOR_CAST INVALID_DATETIME_FORMAT INVALID_ESCAPE_CHARACTER INVALID_ESCAPE_OCTET INVALID_ESCAPE_SEQUENCE NONSTANDARD_USE_OF_ESCAPE_CHARACTER INVALID_INDICATOR_PARAMETER_VALUE INVALID_PARAMETER_VALUE INVALID_REGULAR_EXPRESSION INVALID_ROW_COUNT_IN_LIMIT_CLAUSE INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE INVALID_TABLESAMPLE_ARGUMENT INVALID_TABLESAMPLE_REPEAT INVALID_TIME_ZONE_DISPLACEMENT_VALUE INVALID_USE_OF_ESCAPE_CHARACTER MOST_SPECIFIC_TYPE_MISMATCH NULL_VALUE_NOT_ALLOWED NULL_VALUE_NO_INDICATOR_PARAMETER NUMERIC_VALUE_OUT_OF_RANGE SEQUENCE_GENERATOR_LIMIT_EXCEEDED STRING_DATA_LENGTH_MISMATCH STRING_DATA_RIGHT_TRUNCATION SUBSTRING_ERROR TRIM_ERROR UNTERMINATED_C_STRING ZERO_LENGTH_CHARACTER_STRING FLOATING_POINT_EXCEPTION INVALID_TEXT_REPRESENTATION INVALID_BINARY_REPRESENTATION BAD_COPY_FILE_FORMAT UNTRANSLATABLE_CHARACTER NOT_AN_XML_DOCUMENT INVALID_XML_DOCUMENT INVALID_XML_CONTENT INVALID_XML_COMMENT INVALID_XML_PROCESSING_INSTRUCTION INTEGRITY_CONSTRAINT_VIOLATION RESTRICT_VIOLATION NOT_NULL_VIOLATION FOREIGN_KEY_VIOLATION UNIQUE_VIOLATION CHECK_VIOLATION EXCLUSION_VIOLATION INVALID_CURSOR_STATE INVALID_TRANSACTION_STATE ACTIVE_SQL_TRANSACTION BRANCH_TRANSACTION_ALREADY_ACTIVE HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION READ_ONLY_SQL_TRANSACTION SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED NO_ACTIVE_SQL_TRANSACTION IN_FAILED_SQL_TRANSACTION IDLE_IN_TRANSACTION_SESSION_TIMEOUT INVALID_SQL_STATEMENT_NAME TRIGGERED_DATA_CHANGE_VIOLATION INVALID_AUTHORIZATION_SPECIFICATION INVALID_PASSWORD DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST DEPENDENT_OBJECTS_STILL_EXIST INVALID_TRANSACTION_TERMINATION SQL_ROUTINE_EXCEPTION FUNCTION_EXECUTED_NO_RETURN_STATEMENT MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED INVALID_CURSOR_NAME EXTERNAL_ROUTINE_EXCEPTION CONTAINING_SQL_NOT_PERMITTED MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED EXTERNAL_ROUTINE_INVOCATION_EXCEPTION INVALID_SQLSTATE_RETURNED NULL_VALUE_NOT_ALLOWED TRIGGER_PROTOCOL_VIOLATED SRF_PROTOCOL_VIOLATED EVENT_TRIGGER_PROTOCOL_VIOLATED SAVEPOINT_EXCEPTION INVALID_SAVEPOINT_SPECIFICATION INVALID_CATALOG_NAME INVALID_SCHEMA_NAME TRANSACTION_ROLLBACK TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION SERIALIZATION_FAILURE STATEMENT_COMPLETION_UNKNOWN DEADLOCK_DETECTED SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION SYNTAX_ERROR INSUFFICIENT_PRIVILEGE CANNOT_COERCE GROUPING_ERROR WINDOWING_ERROR INVALID_RECURSION INVALID_FOREIGN_KEY INVALID_NAME NAME_TOO_LONG RESERVED_NAME DATATYPE_MISMATCH INDETERMINATE_DATATYPE COLLATION_MISMATCH INDETERMINATE_COLLATION WRONG_OBJECT_TYPE GENERATED_ALWAYS UNDEFINED_COLUMN UNDEFINED_FUNCTION UNDEFINED_TABLE UNDEFINED_PARAMETER UNDEFINED_OBJECT DUPLICATE_COLUMN DUPLICATE_CURSOR DUPLICATE_DATABASE DUPLICATE_FUNCTION DUPLICATE_PREPARED_STATEMENT DUPLICATE_SCHEMA DUPLICATE_TABLE DUPLICATE_ALIAS DUPLICATE_OBJECT AMBIGUOUS_COLUMN AMBIGUOUS_FUNCTION AMBIGUOUS_PARAMETER AMBIGUOUS_ALIAS INVALID_COLUMN_REFERENCE INVALID_COLUMN_DEFINITION INVALID_CURSOR_DEFINITION INVALID_DATABASE_DEFINITION INVALID_FUNCTION_DEFINITION INVALID_PREPARED_STATEMENT_DEFINITION INVALID_SCHEMA_DEFINITION INVALID_TABLE_DEFINITION INVALID_OBJECT_DEFINITION WITH_CHECK_OPTION_VIOLATION INSUFFICIENT_RESOURCES DISK_FULL OUT_OF_MEMORY TOO_MANY_CONNECTIONS CONFIGURATION_LIMIT_EXCEEDED PROGRAM_LIMIT_EXCEEDED STATEMENT_TOO_COMPLEX TOO_MANY_COLUMNS TOO_MANY_ARGUMENTS OBJECT_NOT_IN_PREREQUISITE_STATE OBJECT_IN_USE CANT_CHANGE_RUNTIME_PARAM LOCK_NOT_AVAILABLE OPERATOR_INTERVENTION QUERY_CANCELED ADMIN_SHUTDOWN CRASH_SHUTDOWN CANNOT_CONNECT_NOW DATABASE_DROPPED SYSTEM_ERROR IO_ERROR UNDEFINED_FILE DUPLICATE_FILE SNAPSHOT_TOO_OLD CONFIG_FILE_ERROR LOCK_FILE_EXISTS FDW_ERROR FDW_COLUMN_NAME_NOT_FOUND FDW_DYNAMIC_PARAMETER_VALUE_NEEDED FDW_FUNCTION_SEQUENCE_ERROR FDW_INCONSISTENT_DESCRIPTOR_INFORMATION FDW_INVALID_ATTRIBUTE_VALUE FDW_INVALID_COLUMN_NAME FDW_INVALID_COLUMN_NUMBER FDW_INVALID_DATA_TYPE FDW_INVALID_DATA_TYPE_DESCRIPTORS FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER FDW_INVALID_HANDLE FDW_INVALID_OPTION_INDEX FDW_INVALID_OPTION_NAME FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH FDW_INVALID_STRING_FORMAT FDW_INVALID_USE_OF_NULL_POINTER FDW_TOO_MANY_HANDLES FDW_OUT_OF_MEMORY FDW_NO_SCHEMAS FDW_OPTION_NAME_NOT_FOUND FDW_REPLY_HANDLE FDW_SCHEMA_NOT_FOUND FDW_TABLE_NOT_FOUND FDW_UNABLE_TO_CREATE_EXECUTION FDW_UNABLE_TO_CREATE_REPLY FDW_UNABLE_TO_ESTABLISH_CONNECTION PLPGSQL_ERROR RAISE_EXCEPTION NO_DATA_FOUND TOO_MANY_ROWS ASSERT_FAILURE INTERNAL_ERROR DATA_CORRUPTED INDEX_CORRUPTED " 317 | },illegal:/:==|\W\s*\(\*|(^|\s)\$[a-z]|\{\{|[a-z]:\s*$|\.\.\.|TO:|DO:/, 318 | contains:[{className:"keyword",variants:[{begin:/\bTEXT\s*SEARCH\b/},{ 319 | begin:/\b(PRIMARY|FOREIGN|FOR(\s+NO)?)\s+KEY\b/},{ 320 | begin:/\bPARALLEL\s+(UNSAFE|RESTRICTED|SAFE)\b/},{ 321 | begin:/\bSTORAGE\s+(PLAIN|EXTERNAL|EXTENDED|MAIN)\b/},{ 322 | begin:/\bMATCH\s+(FULL|PARTIAL|SIMPLE)\b/},{begin:/\bNULLS\s+(FIRST|LAST)\b/},{ 323 | begin:/\bEVENT\s+TRIGGER\b/},{begin:/\b(MAPPING|OR)\s+REPLACE\b/},{ 324 | begin:/\b(FROM|TO)\s+(PROGRAM|STDIN|STDOUT)\b/},{ 325 | begin:/\b(SHARE|EXCLUSIVE)\s+MODE\b/},{ 326 | begin:/\b(LEFT|RIGHT)\s+(OUTER\s+)?JOIN\b/},{ 327 | begin:/\b(FETCH|MOVE)\s+(NEXT|PRIOR|FIRST|LAST|ABSOLUTE|RELATIVE|FORWARD|BACKWARD)\b/ 328 | },{begin:/\bPRESERVE\s+ROWS\b/},{begin:/\bDISCARD\s+PLANS\b/},{ 329 | begin:/\bREFERENCING\s+(OLD|NEW)\b/},{begin:/\bSKIP\s+LOCKED\b/},{ 330 | begin:/\bGROUPING\s+SETS\b/},{ 331 | begin:/\b(BINARY|INSENSITIVE|SCROLL|NO\s+SCROLL)\s+(CURSOR|FOR)\b/},{ 332 | begin:/\b(WITH|WITHOUT)\s+HOLD\b/},{ 333 | begin:/\bWITH\s+(CASCADED|LOCAL)\s+CHECK\s+OPTION\b/},{ 334 | begin:/\bEXCLUDE\s+(TIES|NO\s+OTHERS)\b/},{ 335 | begin:/\bFORMAT\s+(TEXT|XML|JSON|YAML)\b/},{ 336 | begin:/\bSET\s+((SESSION|LOCAL)\s+)?NAMES\b/},{begin:/\bIS\s+(NOT\s+)?UNKNOWN\b/ 337 | },{begin:/\bSECURITY\s+LABEL\b/},{begin:/\bSTANDALONE\s+(YES|NO|NO\s+VALUE)\b/ 338 | },{begin:/\bWITH\s+(NO\s+)?DATA\b/},{begin:/\b(FOREIGN|SET)\s+DATA\b/},{ 339 | begin:/\bSET\s+(CATALOG|CONSTRAINTS)\b/},{begin:/\b(WITH|FOR)\s+ORDINALITY\b/},{ 340 | begin:/\bIS\s+(NOT\s+)?DOCUMENT\b/},{ 341 | begin:/\bXML\s+OPTION\s+(DOCUMENT|CONTENT)\b/},{ 342 | begin:/\b(STRIP|PRESERVE)\s+WHITESPACE\b/},{ 343 | begin:/\bNO\s+(ACTION|MAXVALUE|MINVALUE)\b/},{ 344 | begin:/\bPARTITION\s+BY\s+(RANGE|LIST|HASH)\b/},{begin:/\bAT\s+TIME\s+ZONE\b/},{ 345 | begin:/\bGRANTED\s+BY\b/},{begin:/\bRETURN\s+(QUERY|NEXT)\b/},{ 346 | begin:/\b(ATTACH|DETACH)\s+PARTITION\b/},{ 347 | begin:/\bFORCE\s+ROW\s+LEVEL\s+SECURITY\b/},{ 348 | begin:/\b(INCLUDING|EXCLUDING)\s+(COMMENTS|CONSTRAINTS|DEFAULTS|IDENTITY|INDEXES|STATISTICS|STORAGE|ALL)\b/ 349 | },{begin:/\bAS\s+(ASSIGNMENT|IMPLICIT|PERMISSIVE|RESTRICTIVE|ENUM|RANGE)\b/}]},{ 350 | begin:/\b(FORMAT|FAMILY|VERSION)\s*\(/},{begin:/\bINCLUDE\s*\(/, 351 | keywords:"INCLUDE"},{begin:/\bRANGE(?!\s*(BETWEEN|UNBOUNDED|CURRENT|[-0-9]+))/ 352 | },{ 353 | begin:/\b(VERSION|OWNER|TEMPLATE|TABLESPACE|CONNECTION\s+LIMIT|PROCEDURE|RESTRICT|JOIN|PARSER|COPY|START|END|COLLATION|INPUT|ANALYZE|STORAGE|LIKE|DEFAULT|DELIMITER|ENCODING|COLUMN|CONSTRAINT|TABLE|SCHEMA)\s*=/ 354 | },{begin:/\b(PG_\w+?|HAS_[A-Z_]+_PRIVILEGE)\b/,relevance:10},{ 355 | begin:/\bEXTRACT\s*\(/,end:/\bFROM\b/,returnEnd:!0,keywords:{ 356 | type:"CENTURY DAY DECADE DOW DOY EPOCH HOUR ISODOW ISOYEAR MICROSECONDS MILLENNIUM MILLISECONDS MINUTE MONTH QUARTER SECOND TIMEZONE TIMEZONE_HOUR TIMEZONE_MINUTE WEEK YEAR" 357 | }},{begin:/\b(XMLELEMENT|XMLPI)\s*\(\s*NAME/,keywords:{keyword:"NAME"}},{ 358 | begin:/\b(XMLPARSE|XMLSERIALIZE)\s*\(\s*(DOCUMENT|CONTENT)/,keywords:{ 359 | keyword:"DOCUMENT CONTENT"}},{beginKeywords:"CACHE INCREMENT MAXVALUE MINVALUE", 360 | end:E.C_NUMBER_RE,returnEnd:!0,keywords:"BY CACHE INCREMENT MAXVALUE MINVALUE" 361 | },{className:"type",begin:/\b(WITH|WITHOUT)\s+TIME\s+ZONE\b/},{className:"type", 362 | begin:/\bINTERVAL\s+(YEAR|MONTH|DAY|HOUR|MINUTE|SECOND)(\s+TO\s+(MONTH|HOUR|MINUTE|SECOND))?\b/ 363 | },{ 364 | begin:/\bRETURNS\s+(LANGUAGE_HANDLER|TRIGGER|EVENT_TRIGGER|FDW_HANDLER|INDEX_AM_HANDLER|TSM_HANDLER)\b/, 365 | keywords:{keyword:"RETURNS", 366 | type:"LANGUAGE_HANDLER TRIGGER EVENT_TRIGGER FDW_HANDLER INDEX_AM_HANDLER TSM_HANDLER" 367 | }},{begin:"\\b("+I+")\\s*\\("},{begin:"\\.("+R+")\\b"},{ 368 | begin:"\\b("+R+")\\s+PATH\\b",keywords:{keyword:"PATH", 369 | type:A.replace("PATH ","")}},{className:"type",begin:"\\b("+R+")\\b"},{ 370 | className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{ 371 | className:"string",begin:"(e|E|u&|U&)'",end:"'",contains:[{begin:"\\\\."}], 372 | relevance:10},E.END_SAME_AS_BEGIN({begin:N,end:N,contains:[{ 373 | subLanguage:["pgsql","perl","python","tcl","r","lua","java","php","ruby","bash","scheme","xml","json"], 374 | endsWithParent:!0}]}),{begin:'"',end:'"',contains:[{begin:'""'}] 375 | },E.C_NUMBER_MODE,E.C_BLOCK_COMMENT_MODE,T,{className:"meta",variants:[{ 376 | begin:"%(ROW)?TYPE",relevance:10},{begin:"\\$\\d+"},{begin:"^#\\w",end:"$"}]},{ 377 | className:"symbol",begin:"<<\\s*[a-zA-Z_][a-zA-Z_0-9$]*\\s*>>",relevance:10}]}} 378 | })());hljs.registerLanguage("ini",(()=>{"use strict";function e(e){ 379 | return e?"string"==typeof e?e:e.source:null}function n(...n){ 380 | return n.map((n=>e(n))).join("")}return s=>{const a={className:"number", 381 | relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:s.NUMBER_RE}] 382 | },t=s.COMMENT();t.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={ 383 | className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/ 384 | }]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},c={ 385 | className:"string",contains:[s.BACKSLASH_ESCAPE],variants:[{begin:"'''", 386 | end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"' 387 | },{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[t,r,i,c,a,"self"], 388 | relevance:0},o=function(...n){return"("+((e=>{const n=e[e.length-1] 389 | ;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} 390 | })(n).capture?"":"?:")+n.map((n=>e(n))).join("|")+")" 391 | }(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI", 392 | aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[t,{ 393 | className:"section",begin:/\[+/,end:/\]+/},{ 394 | begin:n(o,"(\\s*\\.\\s*",o,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr", 395 | starts:{end:/$/,contains:[t,l,r,i,c,a]}}]}}})());hljs.registerLanguage("ruby",(()=>{"use strict";function e(e){ 396 | return n("(?=",e,")")}function n(...e){return e.map((e=>{ 397 | return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return a=>{ 398 | const i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s={ 399 | keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__", 400 | built_in:"proc lambda",literal:"true false nil"},r={className:"doctag", 401 | begin:"@[A-Za-z]+"},b={begin:"#<",end:">"},c=[a.COMMENT("#","$",{contains:[r] 402 | }),a.COMMENT("^=begin","^=end",{contains:[r],relevance:10 403 | }),a.COMMENT("^__END__","\\n$")],t={className:"subst",begin:/#\{/,end:/\}/, 404 | keywords:s},g={className:"string",contains:[a.BACKSLASH_ESCAPE,t],variants:[{ 405 | begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/, 406 | end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{ 407 | begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/, 408 | end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{ 409 | begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{ 410 | begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ 411 | begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ 412 | begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ 413 | begin:n(/<<[-~]?'?/,e(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)), 414 | contains:[a.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, 415 | contains:[a.BACKSLASH_ESCAPE,t]})]}]},d="[0-9](_?[0-9])*",l={className:"number", 416 | relevance:0,variants:[{ 417 | begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{ 418 | begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" 419 | },{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ 420 | begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ 421 | begin:"\\b0(_?[0-7])+r?i?\\b"}]},o={className:"params",begin:"\\(",end:"\\)", 422 | endsParent:!0,keywords:s},_=[g,{className:"class",beginKeywords:"class module", 423 | end:"$|;",illegal:/=/,contains:[a.inherit(a.TITLE_MODE,{ 424 | begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{ 425 | begin:"("+a.IDENT_RE+"::)?"+a.IDENT_RE,relevance:0}]}].concat(c)},{ 426 | className:"function",begin:n(/def\s+/,e(i+"\\s*(\\(|;|$)")),relevance:0, 427 | keywords:"def",end:"$|;",contains:[a.inherit(a.TITLE_MODE,{begin:i 428 | }),o].concat(c)},{begin:a.IDENT_RE+"::"},{className:"symbol", 429 | begin:a.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", 430 | begin:":(?!\\s)",contains:[g,{begin:i}],relevance:0},l,{className:"variable", 431 | begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ 432 | className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:s},{ 433 | begin:"("+a.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{ 434 | className:"regexp",contains:[a.BACKSLASH_ESCAPE,t],illegal:/\n/,variants:[{ 435 | begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(", 436 | end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}] 437 | }].concat(b,c),relevance:0}].concat(b,c);t.contains=_,o.contains=_;const E=[{ 438 | begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta", 439 | begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", 440 | starts:{end:"$",contains:_}}];return c.unshift(b),{name:"Ruby", 441 | aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/, 442 | contains:[a.SHEBANG({binary:"ruby"})].concat(E).concat(c).concat(_)}}})());hljs.registerLanguage("yaml",(()=>{"use strict";return e=>{ 443 | const n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={ 444 | className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ 445 | },{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", 446 | variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(s,{ 447 | variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={ 448 | end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},t={begin:/\{/, 449 | end:/\}/,contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]", 450 | contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{ 451 | begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ 452 | begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", 453 | relevance:10},{className:"string", 454 | begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ 455 | begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, 456 | relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type", 457 | begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a 458 | },{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", 459 | begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", 460 | relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ 461 | className:"number", 462 | begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" 463 | },{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},t,g,s],c=[...b] 464 | ;return c.pop(),c.push(i),l.contains=c,{name:"YAML",case_insensitive:!0, 465 | aliases:["yml"],contains:b}}})());hljs.registerLanguage("nix",(()=>{"use strict";return e=>{const n={ 466 | keyword:["rec","with","let","in","inherit","assert","if","else","then"], 467 | literal:["true","false","or","and","null"], 468 | built_in:["import","abort","baseNameOf","dirOf","isNull","builtins","map","removeAttrs","throw","toString","derivation"] 469 | },i={className:"subst",begin:/\$\{/,end:/\}/,keywords:n},s={className:"string", 470 | contains:[i],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}] 471 | },t=[e.NUMBER_MODE,e.HASH_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,{ 472 | begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{ 473 | className:"attr",begin:/\S+/}]}];return i.contains=t,{name:"Nix", 474 | aliases:["nixos"],keywords:n,contains:t}}})());hljs.registerLanguage("sql",(()=>{"use strict";function e(e){ 475 | return e?"string"==typeof e?e:e.source:null}function r(...r){ 476 | return r.map((r=>e(r))).join("")}function t(...r){return"("+((e=>{ 477 | const r=e[e.length-1] 478 | ;return"object"==typeof r&&r.constructor===Object?(e.splice(e.length-1,1),r):{} 479 | })(r).capture?"":"?:")+r.map((r=>e(r))).join("|")+")"}return e=>{ 480 | const n=e.COMMENT("--","$"),a=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],s=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],o=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],c=s,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!s.includes(e))),u={ 481 | begin:r(/\b/,t(...c),/\s*\(/),relevance:0,keywords:{built_in:c}};return{ 482 | name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ 483 | $pattern:/\b[\w\.]+/,keyword:((e,{exceptions:r,when:t}={})=>{const n=t 484 | ;return r=r||[],e.map((e=>e.match(/\|\d+$/)||r.includes(e)?e:n(e)?e+"|0":e)) 485 | })(l,{when:e=>e.length<3}),literal:a,type:i, 486 | built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] 487 | },contains:[{begin:t(...o),relevance:0,keywords:{$pattern:/[\w\.]+/, 488 | keyword:l.concat(o),literal:a,type:i}},{className:"type", 489 | begin:t("double precision","large object","with timezone","without timezone") 490 | },u,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ 491 | begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ 492 | begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator", 493 | begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}})());hljs.registerLanguage("xml",(()=>{"use strict";function e(e){ 494 | return e?"string"==typeof e?e:e.source:null}function n(e){return a("(?=",e,")")} 495 | function a(...n){return n.map((n=>e(n))).join("")}function s(...n){ 496 | return"("+((e=>{const n=e[e.length-1] 497 | ;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} 498 | })(n).capture?"":"?:")+n.map((n=>e(n))).join("|")+")"}return e=>{ 499 | const t=a(/[A-Z_]/,a("(?:",/[A-Z0-9_.-]*:/,")?"),/[A-Z0-9_.-]*/),i={ 500 | className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/, 501 | contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] 502 | },r=e.inherit(c,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{ 503 | className:"string"}),g=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={ 504 | endsWithParent:!0,illegal:/`]+/}]}]}]};return{ 508 | name:"HTML, XML", 509 | aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], 510 | case_insensitive:!0,contains:[{className:"meta",begin://, 511 | relevance:10,contains:[c,g,l,r,{begin:/\[/,end:/\]/,contains:[{className:"meta", 512 | begin://,contains:[c,r,g,l]}]}]},e.COMMENT(//,{ 513 | relevance:10}),{begin://,relevance:10},i,{ 514 | className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag", 515 | begin:/)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{ 516 | end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", 517 | begin:/)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{ 518 | end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ 519 | className:"tag",begin:/<>|<\/>/},{className:"tag", 520 | begin:a(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name", 521 | begin:t,relevance:0,starts:m}]},{className:"tag",begin:a(/<\//,n(a(t,/>/))), 522 | contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0, 523 | endsParent:!0}]}]}}})());hljs.registerLanguage("php",(()=>{"use strict";return e=>{const r={ 524 | className:"variable", 525 | begin:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?![A-Za-z0-9])(?![$])"},t={ 526 | className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{ 527 | begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/, 528 | end:/\}/}]},n=e.inherit(e.APOS_STRING_MODE,{illegal:null 529 | }),i=e.inherit(e.QUOTE_STRING_MODE,{illegal:null, 530 | contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o=e.END_SAME_AS_BEGIN({ 531 | begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/, 532 | contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l={className:"string", 533 | contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(n,{begin:"b'",end:"'" 534 | }),e.inherit(i,{begin:'b"',end:'"'}),i,n,o]},s={className:"number",variants:[{ 535 | begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{ 536 | begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{ 537 | begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?" 538 | }],relevance:0},c={ 539 | keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield", 540 | literal:"false null true", 541 | built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass" 542 | };return{case_insensitive:!0,keywords:c, 543 | contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t] 544 | }),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}] 545 | }),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0, 546 | keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},r,{ 547 | begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function", 548 | relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0, 549 | illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{ 550 | begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)", 551 | excludeBegin:!0,excludeEnd:!0,keywords:c, 552 | contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s]}]},{className:"class",variants:[{ 553 | beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", 554 | illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ 555 | beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ 556 | beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, 557 | contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";", 558 | contains:[e.UNDERSCORE_TITLE_MODE]},l,s]}}})());hljs.registerLanguage("php-template",(()=>{"use strict";return n=>({ 559 | name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/, 560 | subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"', 561 | end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{ 562 | illegal:null,className:null,contains:null,skip:!0 563 | }),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null, 564 | skip:!0})]}]})})());hljs.registerLanguage("properties",(()=>{"use strict";return e=>{ 565 | const t="[ \\t\\f]*",n="([^\\\\:= \\t\\f\\n]|\\\\.)+";return{name:".properties", 566 | disableAutodetect:!0,case_insensitive:!0,illegal:/\S/, 567 | contains:[e.COMMENT("^\\s*[!#]","$"),{returnBegin:!0,variants:[{ 568 | begin:n+"[ \\t\\f]*[:=][ \\t\\f]*"},{begin:n+"[ \\t\\f]+"}],contains:[{ 569 | className:"attr",begin:n,endsParent:!0}],starts:{ 570 | end:"([ \\t\\f]*[:=][ \\t\\f]*|[ \\t\\f]+)",relevance:0,starts:{ 571 | className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\\\"},{ 572 | begin:"\\\\\\n"}]}}},{className:"attr",begin:n+t+"$"}]}}})());hljs.registerLanguage("erlang",(()=>{"use strict";return e=>{ 573 | const n="[a-z'][a-zA-Z0-9_']*",r="("+n+":"+n+"|"+n+")",a={ 574 | keyword:"after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor", 575 | literal:"false true"},i=e.COMMENT("%","$"),s={className:"number", 576 | begin:"\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)", 577 | relevance:0},c={begin:"fun\\s+"+n+"/\\d+"},t={begin:r+"\\(",end:"\\)", 578 | returnBegin:!0,relevance:0,contains:[{begin:r,relevance:0},{begin:"\\(", 579 | end:"\\)",endsWithParent:!0,returnEnd:!0,relevance:0}]},d={begin:/\{/,end:/\}/, 580 | relevance:0},o={begin:"\\b_([A-Z][A-Za-z0-9_]*)?",relevance:0},l={ 581 | begin:"[A-Z][a-zA-Z0-9_]*",relevance:0},b={begin:"#"+e.UNDERSCORE_IDENT_RE, 582 | relevance:0,returnBegin:!0,contains:[{begin:"#"+e.UNDERSCORE_IDENT_RE, 583 | relevance:0},{begin:/\{/,end:/\}/,relevance:0}]},g={ 584 | beginKeywords:"fun receive if try case",end:"end",keywords:a} 585 | ;g.contains=[i,c,e.inherit(e.APOS_STRING_MODE,{className:"" 586 | }),g,t,e.QUOTE_STRING_MODE,s,d,o,l,b] 587 | ;const E=[i,c,g,t,e.QUOTE_STRING_MODE,s,d,o,l,b] 588 | ;t.contains[1].contains=E,d.contains=E,b.contains[1].contains=E;const u={ 589 | className:"params",begin:"\\(",end:"\\)",contains:E};return{name:"Erlang", 590 | aliases:["erl"],keywords:a,illegal:"(",returnBegin:!0, 592 | illegal:"\\(|#|//|/\\*|\\\\|:|;",contains:[u,e.inherit(e.TITLE_MODE,{begin:n})], 593 | starts:{end:";|\\.",keywords:a,contains:E}},i,{begin:"^-",end:"\\.",relevance:0, 594 | excludeEnd:!0,returnBegin:!0,keywords:{$pattern:"-"+e.IDENT_RE, 595 | keyword:["-module","-record","-undef","-export","-ifdef","-ifndef","-author","-copyright","-doc","-vsn","-import","-include","-include_lib","-compile","-define","-else","-endif","-file","-behaviour","-behavior","-spec"].map((e=>e+"|1.5")).join(" ") 596 | },contains:[u]},s,e.QUOTE_STRING_MODE,b,o,l,d,{begin:/\.$/}]}}})());hljs.registerLanguage("less",(()=>{"use strict" 597 | ;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],n=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse(),r=i.concat(o) 598 | ;return a=>{const s=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},HEXCOLOR:{ 599 | scope:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, 600 | ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", 601 | contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ 602 | scope:"number", 603 | begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", 604 | relevance:0}}))(a),l=r,d="([\\w-]+|@\\{[\\w-]+\\})",c=[],g=[],b=e=>({ 605 | className:"string",begin:"~?"+e+".*?"+e}),m=(e,t,i)=>({className:e,begin:t, 606 | relevance:i}),p={$pattern:/[a-z-]+/,keyword:"and or not only", 607 | attribute:t.join(" ")},u={begin:"\\(",end:"\\)",contains:g,keywords:p, 608 | relevance:0} 609 | ;g.push(a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,b("'"),b('"'),s.CSS_NUMBER_MODE,{ 610 | begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", 611 | excludeEnd:!0} 612 | },s.HEXCOLOR,u,m("variable","@@?[\\w-]+",10),m("variable","@\\{[\\w-]+\\}"),m("built_in","~?`[^`]*?`"),{ 613 | className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0 614 | },s.IMPORTANT);const h=g.concat({begin:/\{/,end:/\}/,contains:c}),f={ 615 | beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not" 616 | }].concat(g)},w={begin:d+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0, 617 | contains:[{begin:/-(webkit|moz|ms|o)-/},{className:"attribute", 618 | begin:"\\b("+n.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0, 619 | illegal:"[<=$]",relevance:0,contains:g}}]},v={className:"keyword", 620 | begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", 621 | starts:{end:"[;{}]",keywords:p,returnEnd:!0,contains:g,relevance:0}},y={ 622 | className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{ 623 | begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:h}},k={variants:[{ 624 | begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:d,end:/\{/}],returnBegin:!0, 625 | returnEnd:!0,illegal:"[<='$\"]",relevance:0, 626 | contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,f,m("keyword","all\\b"),m("variable","@\\{[\\w-]+\\}"),{ 627 | begin:"\\b("+e.join("|")+")\\b",className:"selector-tag" 628 | },m("selector-tag",d+"%?",0),m("selector-id","#"+d),m("selector-class","\\."+d,0),m("selector-tag","&",0),s.ATTRIBUTE_SELECTOR_MODE,{ 629 | className:"selector-pseudo",begin:":("+i.join("|")+")"},{ 630 | className:"selector-pseudo",begin:"::("+o.join("|")+")"},{begin:/\(/,end:/\)/, 631 | relevance:0,contains:h},{begin:"!important"}]},E={ 632 | begin:`[\\w-]+:(:)?(${l.join("|")})`,returnBegin:!0,contains:[k]} 633 | ;return c.push(a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,v,y,E,w,k),{ 634 | name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:c}}})());hljs.registerLanguage("nginx",(()=>{"use strict";function e(e){ 635 | return n("(?=",e,")")}function n(...e){return e.map((e=>{ 636 | return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return a=>{ 637 | const s={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{\w+\}/},{ 638 | begin:n(/[$@]/,a.UNDERSCORE_IDENT_RE)}]},i={endsWithParent:!0,keywords:{ 639 | $pattern:/[a-z_]{2,}|\/dev\/poll/, 640 | literal:["on","off","yes","no","true","false","none","blocked","debug","info","notice","warn","error","crit","select","break","last","permanent","redirect","kqueue","rtsig","epoll","poll","/dev/poll"] 641 | },relevance:0,illegal:"=>",contains:[a.HASH_COMMENT_MODE,{className:"string", 642 | contains:[a.BACKSLASH_ESCAPE,s],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/ 643 | }]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[s] 644 | },{className:"regexp",contains:[a.BACKSLASH_ESCAPE,s],variants:[{begin:"\\s\\^", 645 | end:"\\s|\\{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|\\{|;",returnEnd:!0},{ 646 | begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number", 647 | begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{ 648 | className:"number",begin:"\\b\\d+[kKmMgGdshdwy]?\\b",relevance:0},s]};return{ 649 | name:"Nginx config",aliases:["nginxconf"],contains:[a.HASH_COMMENT_MODE,{ 650 | beginKeywords:"upstream location",end:/;|\{/,contains:i.contains,keywords:{ 651 | section:"upstream location"}},{className:"section", 652 | begin:n(a.UNDERSCORE_IDENT_RE+e(/\s+\{/)),relevance:0},{ 653 | begin:e(a.UNDERSCORE_IDENT_RE+"\\s"),end:";|\\{",contains:[{ 654 | className:"attribute",begin:a.UNDERSCORE_IDENT_RE,starts:i}],relevance:0}], 655 | illegal:"[^\\s\\}\\{]"}}})());hljs.registerLanguage("powershell",(()=>{"use strict";return e=>{const n={ 656 | $pattern:/-?[A-z\.\-]+\b/, 657 | keyword:"if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter", 658 | built_in:"ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write" 659 | },s={begin:"`[\\s\\S]",relevance:0},i={className:"variable",variants:[{ 660 | begin:/\$\B/},{className:"keyword",begin:/\$this/},{begin:/\$[\w\d][\w\d_:]*/}] 661 | },a={className:"string",variants:[{begin:/"/,end:/"/},{begin:/@"/,end:/^"@/}], 662 | contains:[s,i,{className:"variable",begin:/\$[A-z]/,end:/[^A-z]/}]},t={ 663 | className:"string",variants:[{begin:/'/,end:/'/},{begin:/@'/,end:/^'@/}] 664 | },r=e.inherit(e.COMMENT(null,null),{variants:[{begin:/#/,end:/$/},{begin:/<#/, 665 | end:/#>/}],contains:[{className:"doctag",variants:[{ 666 | begin:/\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/ 667 | },{ 668 | begin:/\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/ 669 | }]}]}),c={className:"class",beginKeywords:"class enum",end:/\s*[{]/, 670 | excludeEnd:!0,relevance:0,contains:[e.TITLE_MODE]},l={className:"function", 671 | begin:/function\s+/,end:/\s*\{|$/,excludeEnd:!0,returnBegin:!0,relevance:0, 672 | contains:[{begin:"function",relevance:0,className:"keyword"},{className:"title", 673 | begin:/\w[\w\d]*((-)[\w\d]+)*/,relevance:0},{begin:/\(/,end:/\)/, 674 | className:"params",relevance:0,contains:[i]}]},o={begin:/using\s/,end:/$/, 675 | returnBegin:!0,contains:[a,t,{className:"keyword", 676 | begin:/(using|assembly|command|module|namespace|type)/}]},p={ 677 | className:"function",begin:/\[.*\]\s*[\w]+[ ]??\(/,end:/$/,returnBegin:!0, 678 | relevance:0,contains:[{className:"keyword", 679 | begin:"(".concat(n.keyword.toString().replace(/\s/g,"|"),")\\b"),endsParent:!0, 680 | relevance:0},e.inherit(e.TITLE_MODE,{endsParent:!0})] 681 | },g=[p,r,s,e.NUMBER_MODE,a,t,{className:"built_in",variants:[{ 682 | begin:"(Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where)+(-)[\\w\\d]+" 683 | }]},i,{className:"literal",begin:/\$(null|true|false)\b/},{ 684 | className:"selector-tag",begin:/@\B/,relevance:0}],m={begin:/\[/,end:/\]/, 685 | excludeBegin:!0,excludeEnd:!0,relevance:0,contains:[].concat("self",g,{ 686 | begin:"(string|char|byte|int|long|bool|decimal|single|double|DateTime|xml|array|hashtable|void)", 687 | className:"built_in",relevance:0},{className:"type",begin:/[\.\w\d]+/, 688 | relevance:0})};return p.contains.unshift(m),{name:"PowerShell", 689 | aliases:["ps","ps1"],case_insensitive:!0,keywords:n,contains:g.concat(c,l,o,{ 690 | variants:[{className:"operator", 691 | begin:"(-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor)\\b" 692 | },{className:"literal",begin:/(-)[\w\d]+/,relevance:0}]},m)}}})());hljs.registerLanguage("twig",(()=>{"use strict";return e=>{ 693 | var a="attribute block constant cycle date dump include max min parent random range source template_from_string",n={ 694 | beginKeywords:a,keywords:{name:a},relevance:0,contains:[{className:"params", 695 | begin:"\\(",end:"\\)"}]},t={begin:/\|[A-Za-z_]+:?/, 696 | keywords:"abs batch capitalize column convert_encoding date date_modify default escape filter first format inky_to_html inline_css join json_encode keys last length lower map markdown merge nl2br number_format raw reduce replace reverse round slice sort spaceless split striptags title trim upper url_encode", 697 | contains:[n] 698 | },s="apply autoescape block deprecated do embed extends filter flush for from if import include macro sandbox set use verbatim with" 699 | ;return s=s+" "+s.split(" ").map((e=>"end"+e)).join(" "),{name:"Twig", 700 | aliases:["craftcms"],case_insensitive:!0,subLanguage:"xml", 701 | contains:[e.COMMENT(/\{#/,/#\}/),{className:"template-tag",begin:/\{%/, 702 | end:/%\}/,contains:[{className:"name",begin:/\w+/,keywords:s,starts:{ 703 | endsWithParent:!0,contains:[t,n],relevance:0}}]},{className:"template-variable", 704 | begin:/\{\{/,end:/\}\}/,contains:["self",t,n]}]}}})());hljs.registerLanguage("plaintext",(()=>{"use strict";return t=>({ 705 | name:"Plain text",aliases:["text","txt"],disableAutodetect:!0})})());hljs.registerLanguage("rust",(()=>{"use strict";function e(...e){ 706 | return e.map((e=>{return(t=e)?"string"==typeof t?t:t.source:null;var t 707 | })).join("")}return t=>{const n={className:"title.function.invoke",relevance:0, 708 | begin:e(/\b/,/(?!let\b)/,t.IDENT_RE,(a=/\s*\(/,e("(?=",a,")")))};var a 709 | ;const r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bin!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"] 710 | ;return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?", 711 | type:["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"], 712 | keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"], 713 | literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:""},n]}}})());hljs.registerLanguage("typescript",(()=>{"use strict" 733 | ;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],s=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","module","global"],i=[].concat(r,t,s) 734 | ;function o(e){return l("(?=",e,")")}function l(...e){return e.map((e=>{ 735 | return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return b=>{ 736 | const d={$pattern:e, 737 | keyword:n.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]), 738 | literal:a, 739 | built_in:i.concat(["any","void","number","boolean","string","object","never","enum"]), 740 | "variable.language":c},g={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*" 741 | },u=(e,n,a)=>{const t=e.contains.findIndex((e=>e.label===n)) 742 | ;if(-1===t)throw Error("can not find mode to replace");e.contains.splice(t,1,a) 743 | },m=function(b){const d=e,g={begin:/<[A-Za-z0-9\\._:-]+/, 744 | end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ 745 | const a=e[0].length+e.index,t=e.input[a];"<"!==t?">"===t&&(((e,{after:n})=>{ 746 | const a="",B={ 787 | match:[/const|var|let/,/\s+/,d,/\s*/,/=\s*/,o(C)],className:{1:"keyword", 788 | 3:"title.function"},contains:[S]};return{name:"Javascript", 789 | aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:w}, 790 | illegal:/#(?![$_A-z])/,contains:[b.SHEBANG({label:"shebang",binary:"node", 791 | relevance:5}),{label:"use_strict",className:"meta",relevance:10, 792 | begin:/^\s*['"]use (strict|asm)['"]/ 793 | },b.APOS_STRING_MODE,b.QUOTE_STRING_MODE,p,_,N,A,y,R,{className:"attr", 794 | begin:d+o(":"),relevance:0},B,{ 795 | begin:"("+b.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", 796 | keywords:"return throw case",relevance:0,contains:[A,b.REGEXP_MODE,{ 797 | className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{ 798 | className:"params",variants:[{begin:b.UNDERSCORE_IDENT_RE,relevance:0},{ 799 | className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, 800 | excludeEnd:!0,keywords:u,contains:w}]}]},{begin:/,/,relevance:0},{match:/\s+/, 801 | relevance:0},{variants:[{begin:"<>",end:""},{begin:g.begin, 802 | "on:begin":g.isTrulyOpeningTag,end:g.end}],subLanguage:"xml",contains:[{ 803 | begin:g.begin,end:g.end,skip:!0,contains:["self"]}]}]},I,{ 804 | beginKeywords:"while if switch catch for"},{ 805 | begin:"\\b(?!function)"+b.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", 806 | returnBegin:!0,label:"func.def",contains:[S,b.inherit(b.TITLE_MODE,{begin:d, 807 | className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+d, 808 | relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, 809 | contains:[S]},x,{relevance:0,match:/\b[A-Z][A-Z_]+\b/, 810 | className:"variable.constant"},O,M,{match:/\$[(.]/}]}}(b) 811 | ;return Object.assign(m.keywords,d), 812 | m.exports.PARAMS_CONTAINS.push(g),m.contains=m.contains.concat([g,{ 813 | beginKeywords:"namespace",end:/\{/,excludeEnd:!0},{beginKeywords:"interface", 814 | end:/\{/,excludeEnd:!0,keywords:"interface extends" 815 | }]),u(m,"shebang",b.SHEBANG()),u(m,"use_strict",{className:"meta",relevance:10, 816 | begin:/^\s*['"]use strict['"]/ 817 | }),m.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(m,{ 818 | name:"TypeScript",aliases:["ts","tsx"]}),m}})());hljs.registerLanguage("csp",(()=>{"use strict";return e=>({name:"CSP", 819 | case_insensitive:!1,keywords:{$pattern:"[a-zA-Z][a-zA-Z0-9_-]*", 820 | keyword:["base-uri","child-src","connect-src","default-src","font-src","form-action","frame-ancestors","frame-src","img-src","media-src","object-src","plugin-types","report-uri","sandbox","script-src","style-src"] 821 | },contains:[{className:"string",begin:"'",end:"'"},{className:"attribute", 822 | begin:"^Content",end:":",excludeEnd:!0}]})})());hljs.registerLanguage("csharp",(()=>{"use strict";return e=>{const n={ 823 | keyword:["abstract","as","base","break","case","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), 824 | built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], 825 | literal:["default","false","null","true"]},i=e.inherit(e.TITLE_MODE,{ 826 | begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{ 827 | begin:"\\b(0b[01']+)"},{ 828 | begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ 829 | begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" 830 | }],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] 831 | },t=e.inherit(s,{illegal:/\n/}),r={className:"subst",begin:/\{/,end:/\}/, 832 | keywords:n},l=e.inherit(r,{illegal:/\n/}),c={className:"string",begin:/\$"/, 833 | end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ 834 | },e.BACKSLASH_ESCAPE,l]},o={className:"string",begin:/\$@"/,end:'"',contains:[{ 835 | begin:/\{\{/},{begin:/\}\}/},{begin:'""'},r]},d=e.inherit(o,{illegal:/\n/, 836 | contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]}) 837 | ;r.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE], 838 | l.contains=[d,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{ 839 | illegal:/\n/})];const g={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] 840 | },E={begin:"<",end:">",contains:[{beginKeywords:"in out"},i] 841 | },_=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",b={ 842 | begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], 843 | keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, 844 | contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ 845 | begin:"\x3c!--|--\x3e"},{begin:""}]}] 846 | }),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", 847 | end:"$",keywords:{ 848 | keyword:"if else elif endif define undef warning error line region endregion pragma checksum" 849 | }},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, 850 | illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" 851 | },i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", 852 | relevance:0,end:/[{;=]/,illegal:/[^\s:]/, 853 | contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ 854 | beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, 855 | contains:[i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", 856 | begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ 857 | className:"string",begin:/"/,end:/"/}]},{ 858 | beginKeywords:"new return throw await else",relevance:0},{className:"function", 859 | begin:"("+_+"\\s+)+"+e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, 860 | end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ 861 | beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", 862 | relevance:0},{begin:e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, 863 | contains:[e.TITLE_MODE,E],relevance:0},{className:"params",begin:/\(/,end:/\)/, 864 | excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, 865 | contains:[g,a,e.C_BLOCK_COMMENT_MODE] 866 | },e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},b]}}})());hljs.registerLanguage("bash",(()=>{"use strict";function e(...e){ 867 | return e.map((e=>{return(s=e)?"string"==typeof s?s:s.source:null;var s 868 | })).join("")}return s=>{const n={},t={begin:/\$\{/,end:/\}/,contains:["self",{ 869 | begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{ 870 | begin:e(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},t]});const a={ 871 | className:"subst",begin:/\$\(/,end:/\)/,contains:[s.BACKSLASH_ESCAPE]},i={ 872 | begin:/<<-?\s*(?=\w+)/,starts:{contains:[s.END_SAME_AS_BEGIN({begin:/(\w+)/, 873 | end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/, 874 | contains:[s.BACKSLASH_ESCAPE,n,a]};a.contains.push(c);const o={begin:/\$\(\(/, 875 | end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},s.NUMBER_MODE,n] 876 | },r=s.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 877 | }),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, 878 | contains:[s.inherit(s.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ 879 | name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z._-]+\b/, 880 | keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"], 881 | literal:["true","false"], 882 | built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp" 883 | },contains:[r,s.SHEBANG(),l,o,s.HASH_COMMENT_MODE,i,c,{className:"",begin:/\\"/ 884 | },{className:"string",begin:/'/,end:/'/},n]}}})());hljs.registerLanguage("css",(()=>{"use strict" 885 | ;const e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],i=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse() 886 | ;return n=>{const a=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},HEXCOLOR:{ 887 | scope:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, 888 | ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", 889 | contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ 890 | scope:"number", 891 | begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", 892 | relevance:0}}))(n),l=[n.APOS_STRING_MODE,n.QUOTE_STRING_MODE];return{name:"CSS", 893 | case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"}, 894 | classNameAliases:{keyframePosition:"selector-tag"}, 895 | contains:[n.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ 896 | },a.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 897 | },{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 898 | },a.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ 899 | begin:":("+i.join("|")+")"},{begin:"::("+o.join("|")+")"}]},{ 900 | className:"attribute",begin:"\\b("+r.join("|")+")\\b"},{begin:":",end:"[;}]", 901 | contains:[a.HEXCOLOR,a.IMPORTANT,a.CSS_NUMBER_MODE,...l,{ 902 | begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" 903 | },contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}] 904 | },{className:"built_in",begin:/[\w-]+(?=\()/}]},{ 905 | begin:(s=/@/,((...e)=>e.map((e=>(e=>e?"string"==typeof e?e:e.source:null)(e))).join(""))("(?=",s,")")), 906 | end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword", 907 | begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0, 908 | relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only", 909 | attribute:t.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute" 910 | },...l,a.CSS_NUMBER_MODE]}]},{className:"selector-tag", 911 | begin:"\\b("+e.join("|")+")\\b"}]};var s}})());hljs.registerLanguage("makefile",(()=>{"use strict";return e=>{const i={ 912 | className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", 913 | contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{"use strict";return d=>({name:"DNS Zone", 923 | aliases:["bind","zone"], 924 | keywords:["IN","A","AAAA","AFSDB","APL","CAA","CDNSKEY","CDS","CERT","CNAME","DHCID","DLV","DNAME","DNSKEY","DS","HIP","IPSECKEY","KEY","KX","LOC","MX","NAPTR","NS","NSEC","NSEC3","NSEC3PARAM","PTR","RRSIG","RP","SIG","SOA","SRV","SSHFP","TA","TKEY","TLSA","TSIG","TXT"], 925 | contains:[d.COMMENT(";","$",{relevance:0}),{className:"meta", 926 | begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number", 927 | begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b" 928 | },{className:"number", 929 | begin:"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b" 930 | },d.inherit(d.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]})})());hljs.registerLanguage("vbnet",(()=>{"use strict";function e(e){ 931 | return e?"string"==typeof e?e:e.source:null}function n(...n){ 932 | return n.map((n=>e(n))).join("")}function t(...n){return"("+((e=>{ 933 | const n=e[e.length-1] 934 | ;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} 935 | })(n).capture?"":"?:")+n.map((n=>e(n))).join("|")+")"}return e=>{ 936 | const a=/\d{1,2}\/\d{1,2}\/\d{4}/,i=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,o={ 937 | className:"literal",variants:[{begin:n(/# */,t(i,a),/ *#/)},{ 938 | begin:n(/# */,r,/ *#/)},{begin:n(/# */,s,/ *#/)},{ 939 | begin:n(/# */,t(i,a),/ +/,t(s,r),/ *#/)}]},l=e.COMMENT(/'''/,/$/,{contains:[{ 940 | className:"doctag",begin:/<\/?/,end:/>/}]}),c=e.COMMENT(null,/$/,{variants:[{ 941 | begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET", 942 | aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{ 943 | keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", 944 | built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", 945 | type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", 946 | literal:"true false nothing"}, 947 | illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ 948 | className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, 949 | end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0, 950 | variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ 951 | },{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ 952 | begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ 953 | className:"label",begin:/^\w+:/},l,c,{className:"meta", 954 | begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, 955 | end:/$/,keywords:{ 956 | keyword:"const disable else elseif enable end externalsource if region then"}, 957 | contains:[c]}]}}})());hljs.registerLanguage("latex",(()=>{"use strict";function e(...e){ 958 | return"("+((e=>{const n=e[e.length-1] 959 | ;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} 960 | })(e).capture?"":"?:")+e.map((e=>{return(n=e)?"string"==typeof n?n:n.source:null 961 | ;var n})).join("|")+")"}return n=>{const a=[{begin:/\^{6}[0-9a-f]{6}/},{ 962 | begin:/\^{5}[0-9a-f]{5}/},{begin:/\^{4}[0-9a-f]{4}/},{begin:/\^{3}[0-9a-f]{3}/ 963 | },{begin:/\^{2}[0-9a-f]{2}/},{begin:/\^{2}[\u0000-\u007f]/}],t=[{ 964 | className:"keyword",begin:/\\/,relevance:0,contains:[{endsParent:!0, 965 | begin:e(...["(?:NeedsTeXFormat|RequirePackage|GetIdInfo)","Provides(?:Expl)?(?:Package|Class|File)","(?:DeclareOption|ProcessOptions)","(?:documentclass|usepackage|input|include)","makeat(?:letter|other)","ExplSyntax(?:On|Off)","(?:new|renew|provide)?command","(?:re)newenvironment","(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand","(?:New|Renew|Provide|Declare)DocumentEnvironment","(?:(?:e|g|x)?def|let)","(?:begin|end)","(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)","caption","(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)","(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)","(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)","(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)","(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)","(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"].map((e=>e+"(?![a-zA-Z@:_])"))) 966 | },{endsParent:!0, 967 | begin:RegExp(["(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*","[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}","[qs]__?[a-zA-Z](?:_?[a-zA-Z])+","use(?:_i)?:[a-zA-Z]*","(?:else|fi|or):","(?:if|cs|exp):w","(?:hbox|vbox):n","::[a-zA-Z]_unbraced","::[a-zA-Z:]"].map((e=>e+"(?![a-zA-Z:_])")).join("|")) 968 | },{endsParent:!0,variants:a},{endsParent:!0,relevance:0,variants:[{ 969 | begin:/[a-zA-Z@]+/},{begin:/[^a-zA-Z@]?/}]}]},{className:"params",relevance:0, 970 | begin:/#+\d?/},{variants:a},{className:"built_in",relevance:0,begin:/[$&^_]/},{ 971 | className:"meta",begin:"% !TeX",end:"$",relevance:10},n.COMMENT("%","$",{ 972 | relevance:0})],i={begin:/\{/,end:/\}/,relevance:0,contains:["self",...t] 973 | },r=n.inherit(i,{relevance:0,endsParent:!0,contains:[i,...t]}),s={begin:/\[/, 974 | end:/\]/,endsParent:!0,relevance:0,contains:[i,...t]},c={begin:/\s+/,relevance:0 975 | },l=[r],o=[s],d=(e,n)=>({contains:[c],starts:{relevance:0,contains:e,starts:n} 976 | }),g=(e,n)=>({begin:"\\\\"+e+"(?![a-zA-Z@:_])",keywords:{$pattern:/\\[a-zA-Z]+/, 977 | keyword:"\\"+e},relevance:0,contains:[c],starts:n}),m=(e,a)=>n.inherit({ 978 | begin:"\\\\begin(?=[ \t]*(\\r?\\n[ \t]*)?\\{"+e+"\\})",keywords:{ 979 | $pattern:/\\[a-zA-Z]+/,keyword:"\\begin"},relevance:0 980 | },d(l,a)),b=(e="string")=>n.END_SAME_AS_BEGIN({className:e,begin:/(.|\r?\n)/, 981 | end:/(.|\r?\n)/,excludeBegin:!0,excludeEnd:!0,endsParent:!0}),p=e=>({ 982 | className:"string",end:"(?=\\\\end\\{"+e+"\\})"}),v=(e="string")=>({relevance:0, 983 | begin:/\{/,starts:{endsParent:!0,contains:[{className:e,end:/(?=\})/, 984 | endsParent:!0,contains:[{begin:/\{/,end:/\}/,relevance:0,contains:["self"]}]}]} 985 | });return{name:"LaTeX",aliases:["tex"], 986 | contains:[...["verb","lstinline"].map((e=>g(e,{contains:[b()]}))),g("mint",d(l,{ 987 | contains:[b()]})),g("mintinline",d(l,{contains:[v(),b()]})),g("url",{ 988 | contains:[v("link"),v("link")]}),g("hyperref",{contains:[v("link")] 989 | }),g("href",d(o,{contains:[v("link")] 990 | })),...[].concat(...["","\\*"].map((e=>[m("verbatim"+e,p("verbatim"+e)),m("filecontents"+e,d(l,p("filecontents"+e))),...["","B","L"].map((n=>m(n+"Verbatim"+e,d(o,p(n+"Verbatim"+e)))))]))),m("minted",d(o,d(l,p("minted")))),...t] 991 | }}})());hljs.registerLanguage("elixir",(()=>{"use strict";return e=>{ 992 | const n="[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?",i={$pattern:n, 993 | keyword:"and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote require import with|0" 994 | },a={className:"subst",begin:/#\{/,end:/\}/,keywords:i},s={className:"number", 995 | begin:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)", 996 | relevance:0},b={className:"string",begin:"~[a-z](?=[/|([{<\"'])",contains:[{ 997 | endsParent:!0,contains:[{contains:[e.BACKSLASH_ESCAPE,a],variants:[{begin:/"/, 998 | end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{begin:/\|/,end:/\|/},{ 999 | begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/,end:/\}/},{begin://}]}]}]},d={className:"string",contains:[e.BACKSLASH_ESCAPE,a],variants:[{ 1001 | begin:/"""/,end:/"""/},{begin:/'''/,end:/'''/},{begin:/~S"""/,end:/"""/, 1002 | contains:[]},{begin:/~S"/,end:/"/,contains:[]},{begin:/~S'''/,end:/'''/, 1003 | contains:[]},{begin:/~S'/,end:/'/,contains:[]},{begin:/'/,end:/'/},{begin:/"/, 1004 | end:/"/}]},r={className:"function",beginKeywords:"def defp defmacro",end:/\B\b/, 1005 | contains:[e.inherit(e.TITLE_MODE,{begin:n,endsParent:!0})]},g=e.inherit(r,{ 1006 | className:"class",beginKeywords:"defimpl defmodule defprotocol defrecord", 1007 | end:/\bdo\b|$|;/}),t=[d,{className:"string",begin:"~[A-Z](?=[/|([{<\"'])", 1008 | contains:[{begin:/"/,end:/"/},{begin:/'/,end:/'/},{begin:/\//,end:/\//},{ 1009 | begin:/\|/,end:/\|/},{begin:/\(/,end:/\)/},{begin:/\[/,end:/\]/},{begin:/\{/, 1010 | end:/\}/},{begin://}]},b,e.HASH_COMMENT_MODE,g,r,{begin:"::"},{ 1011 | className:"symbol",begin:":(?![\\s:])",contains:[d,{ 1012 | begin:"[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?" 1013 | }],relevance:0},{className:"symbol",begin:n+":(?!:)",relevance:0},s,{ 1014 | className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))"},{begin:"->"},{ 1015 | begin:"("+e.RE_STARTERS_RE+")\\s*",contains:[e.HASH_COMMENT_MODE,{ 1016 | begin:/\/: (?=\d+\s*[,\]])/,relevance:0,contains:[s]},{className:"regexp", 1017 | illegal:"\\n",contains:[e.BACKSLASH_ESCAPE,a],variants:[{begin:"/",end:"/[a-z]*" 1018 | },{begin:"%r\\[",end:"\\][a-z]*"}]}],relevance:0}];return a.contains=t,{ 1019 | name:"Elixir",keywords:i,contains:t}}})());hljs.registerLanguage("markdown",(()=>{"use strict";function n(...n){ 1020 | return n.map((n=>{return(e=n)?"string"==typeof e?e:e.source:null;var e 1021 | })).join("")}return e=>{const a={begin:/<\/?[A-Za-z_]/,end:">", 1022 | subLanguage:"xml",relevance:0},i={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0 1023 | },{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, 1024 | relevance:2},{begin:n(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), 1025 | relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ 1026 | begin:/\[.+?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{ 1027 | className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, 1028 | returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", 1029 | excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", 1030 | end:"\\]",excludeBegin:!0,excludeEnd:!0}]},s={className:"strong",contains:[], 1031 | variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},c={ 1032 | className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{ 1033 | begin:/_(?!_)/,end:/_/,relevance:0}]};s.contains.push(c),c.contains.push(s) 1034 | ;let t=[a,i] 1035 | ;return s.contains=s.contains.concat(t),c.contains=c.contains.concat(t), 1036 | t=t.concat(s,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ 1037 | className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:t},{ 1038 | begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", 1039 | contains:t}]}]},a,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", 1040 | end:"\\s+",excludeEnd:!0},s,c,{className:"quote",begin:"^>\\s+",contains:t, 1041 | end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ 1042 | begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ 1043 | begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", 1044 | contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ 1045 | begin:"^[-\\*]{3,}",end:"$"},i,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ 1046 | className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ 1047 | className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})());hljs.registerLanguage("shell",(()=>{"use strict";return s=>({ 1048 | name:"Shell Session",aliases:["console","shellsession"],contains:[{ 1049 | className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{ 1050 | end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]})})());hljs.registerLanguage("dockerfile",(()=>{"use strict";return e=>({ 1051 | name:"Dockerfile",aliases:["docker"],case_insensitive:!0, 1052 | keywords:["from","maintainer","expose","env","arg","user","onbuild","stopsignal"], 1053 | contains:[e.HASH_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{ 1054 | beginKeywords:"run cmd entrypoint volume add copy workdir label healthcheck shell", 1055 | starts:{end:/[^\\]$/,subLanguage:"bash"}}],illegal:"{"use strict" 1056 | ;const e="[A-Za-z$_][0-9A-Za-z$_]*",n=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],a=["true","false","null","undefined","NaN","Infinity"],t=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],s=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],r=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],i=["arguments","this","super","console","window","document","localStorage","module","global"],c=[].concat(r,t,s) 1057 | ;function o(e){return l("(?=",e,")")}function l(...e){return e.map((e=>{ 1058 | return(n=e)?"string"==typeof n?n:n.source:null;var n})).join("")}return b=>{ 1059 | const g=e,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/, 1060 | isTrulyOpeningTag:(e,n)=>{const a=e[0].length+e.index,t=e.input[a] 1061 | ;"<"!==t?">"===t&&(((e,{after:n})=>{const a="",B={ 1103 | match:[/const|var|let/,/\s+/,g,/\s*/,/=\s*/,o(C)],className:{1:"keyword", 1104 | 3:"title.function"},contains:[w]};return{name:"Javascript", 1105 | aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:S}, 1106 | illegal:/#(?![$_A-z])/,contains:[b.SHEBANG({label:"shebang",binary:"node", 1107 | relevance:5}),{label:"use_strict",className:"meta",relevance:10, 1108 | begin:/^\s*['"]use (strict|asm)['"]/ 1109 | },b.APOS_STRING_MODE,b.QUOTE_STRING_MODE,N,f,A,v,y,O,{className:"attr", 1110 | begin:g+o(":"),relevance:0},B,{ 1111 | begin:"("+b.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", 1112 | keywords:"return throw case",relevance:0,contains:[v,b.REGEXP_MODE,{ 1113 | className:"function",begin:C,returnBegin:!0,end:"\\s*=>",contains:[{ 1114 | className:"params",variants:[{begin:b.UNDERSCORE_IDENT_RE,relevance:0},{ 1115 | className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, 1116 | excludeEnd:!0,keywords:u,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/, 1117 | relevance:0},{variants:[{begin:"<>",end:""},{begin:d.begin, 1118 | "on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{ 1119 | begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},I,{ 1120 | beginKeywords:"while if switch catch for"},{ 1121 | begin:"\\b(?!function)"+b.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", 1122 | returnBegin:!0,label:"func.def",contains:[w,b.inherit(b.TITLE_MODE,{begin:g, 1123 | className:"title.function"})]},{match:/\.\.\./,relevance:0},M,{match:"\\$"+g, 1124 | relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, 1125 | contains:[w]},T,{relevance:0,match:/\b[A-Z][A-Z_]+\b/, 1126 | className:"variable.constant"},R,k,{match:/\$[(.]/}]}}})());hljs.registerLanguage("json",(()=>{"use strict";return e=>({name:"JSON", 1127 | contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01 1128 | },{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{ 1129 | beginKeywords:"true false null" 1130 | },e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}) 1131 | })()); -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Blog over DNS 6 | 7 | 8 | 9 | 161 | 162 | 163 |
164 |
165 |
166 |

HTML over DNS

167 |

The content of this page is fetched using DNS over HTTP. Since that requires Javascript, please enable that to see the content.

168 |
169 |
170 | 175 |
176 | 177 | 178 | -------------------------------------------------------------------------------- /publish-zones.php: -------------------------------------------------------------------------------- 1 | filePath = $file; 21 | $this->fileName = basename(dirname($file)).'/'.basename($file); 22 | $this->data = file_get_contents($file); 23 | 24 | $this->parseMetadata(); 25 | } 26 | 27 | /** 28 | * @return Record[] 29 | */ 30 | private function toRecords(): array 31 | { 32 | $chunks = $this->calculateChunks(); 33 | $hash = $this->calculateHash(); 34 | 35 | $records = [$this->buildMetadataRecord(count($chunks), $hash)]; 36 | foreach ($chunks as $id => $chunk) { 37 | $records[] = $this->buildRecord($id, $chunk); 38 | } 39 | 40 | return $records; 41 | } 42 | 43 | public function __toString(): string 44 | { 45 | $result = ""; 46 | 47 | foreach ($this->toRecords() as $record) { 48 | $result .= $record.EOL; 49 | } 50 | 51 | return $result; 52 | } 53 | 54 | public function getDnsName(): string 55 | { 56 | return str_replace(['/', '\\', '.'], '-', $this->fileName); 57 | } 58 | 59 | private function buildMetadataRecord(int $chunkCount, string $hash): Record 60 | { 61 | return (new Record()) 62 | ->setDnsName($this->getDnsName()) 63 | ->setTtl(self::METADATA_TTL) 64 | ->setContent($this->buildIndexString($chunkCount, $hash)); 65 | } 66 | 67 | private function buildIndexString(int $chunkCount, $hash): string 68 | { 69 | $metadata = base64_encode(json_encode($this->metadata)); 70 | 71 | return '"'."t={$this->mimeType()};c={$chunkCount};ha=sha-1;h={$hash};m={$metadata}".'"'; 72 | } 73 | 74 | private function buildRecord(int $id, string $data): Record 75 | { 76 | $name = "$id.{$this->calculateHash()}"; 77 | 78 | return (new Record()) 79 | ->setContent($data) 80 | ->setDnsName($name) 81 | ->setTtl(self::RECORD_TTL); 82 | } 83 | 84 | private function mimeType(): string 85 | { 86 | $extension = pathinfo($this->fileName, PATHINFO_EXTENSION); 87 | 88 | switch ($extension) { 89 | case "js": 90 | return "text/javascript"; 91 | case "md": 92 | return "text/markdown"; 93 | 94 | default: 95 | return mime_content_type($this->filePath); 96 | } 97 | } 98 | 99 | private function parseMetadata(): void 100 | { 101 | if ($this->mimeType() != "text/markdown") { 102 | return; 103 | } 104 | 105 | $front_matter_chars = "+++"; 106 | 107 | $front_matter_end = strpos($this->data, $front_matter_chars, 2); 108 | if (false === $front_matter_end) { 109 | return; 110 | } 111 | 112 | $front_matter = substr( 113 | $this->data, 114 | strlen($front_matter_chars) + 1, 115 | $front_matter_end - strlen($front_matter_chars) - 2 116 | ); 117 | 118 | $this->data = trim(substr($this->data, $front_matter_end + strlen($front_matter_chars))).EOL; 119 | 120 | $lines = explode(EOL, $front_matter); 121 | foreach ($lines as $line) { 122 | $eq_pos = strpos($line, "="); 123 | $key = trim(substr($line, 0, $eq_pos - 1)); 124 | $value = trim(substr($line, $eq_pos + 1)); 125 | $this->metadata[$key] = $value; 126 | } 127 | } 128 | 129 | private function calculateHash(): string 130 | { 131 | return sha1($this->data); 132 | } 133 | 134 | private function calculateChunks(): array 135 | { 136 | return str_split(base64_encode($this->data), self::RECORD_LENGTH); 137 | } 138 | } 139 | 140 | class Record 141 | { 142 | private string $dnsName; 143 | private int $ttl; 144 | private string $content; 145 | 146 | public function setDnsName(string $dnsName): self 147 | { 148 | $this->dnsName = $dnsName; 149 | 150 | return $this; 151 | } 152 | 153 | public function setTtl(int $ttl): self 154 | { 155 | $this->ttl = $ttl; 156 | 157 | return $this; 158 | } 159 | 160 | public function setContent(string $content): self 161 | { 162 | $this->content = $content; 163 | 164 | return $this; 165 | } 166 | 167 | public function getRecord(): string 168 | { 169 | return $this->dnsName 170 | ."\t".$this->ttl 171 | ."\tIN" 172 | ."\tTXT\t" 173 | .$this->content; 174 | } 175 | 176 | public function __toString(): string 177 | { 178 | return $this->getRecord(); 179 | } 180 | } 181 | 182 | class StartOfAuthority 183 | { 184 | public function __construct( 185 | private string $origin, 186 | private string $serial, 187 | private string $masterDnsServer, 188 | private string $domainContact, 189 | private int $slaveRefreshInterval, 190 | private int $slaveRetryInterval, 191 | private int $slaveCopyExpireTime, 192 | private int $nxDomainCacheTime 193 | ) { 194 | } 195 | 196 | public function doNotUserMasterDnsServer(): self 197 | { 198 | $servers = $this->dnsServers; 199 | $this->dnsServers = array_filter( 200 | $servers, 201 | function ($server) { 202 | return $server !== $this->masterDnsServer; 203 | } 204 | ); 205 | 206 | return $this; 207 | } 208 | 209 | public function increaseSerial(): self 210 | { 211 | $matches = []; 212 | preg_match('#(\d{8})(\d{2})#', $this->serial, $matches); 213 | list (, $day, $count) = $matches; 214 | 215 | $today = date("Ymd"); 216 | if ($today === $day) { 217 | $count++; 218 | } else { 219 | $count = 0; 220 | } 221 | 222 | $this->serial = sprintf('%1$s%2$02d', $today, $count);; 223 | 224 | return $this; 225 | } 226 | 227 | public function __toString(): string 228 | { 229 | return <<origin ; The zone of this zone file 231 | @ IN SOA $this->masterDnsServer $this->domainContact ( 232 | $this->serial ; serial 233 | $this->slaveRefreshInterval ; slave refresh interval 234 | $this->slaveRetryInterval ; slave retry interval 235 | $this->slaveCopyExpireTime ; slave copy expire time 236 | $this->nxDomainCacheTime ; NXDOMAIN cache time 237 | ) 238 | 239 | ; 240 | ; domain name servers 241 | ; 242 | @ IN NS $this->masterDnsServer 243 | EOF; 244 | } 245 | 246 | public static function fromString(string $zonefile): self 247 | { 248 | $matches = []; 249 | $found = 1 === preg_match( 250 | '#\$ORIGIN\s+(?P[a-z.]+)[^@]+@\s+IN\s+SOA\s+(?P[a-z.]+)\s+(?P[a-z.]+)\s+\(\D+\s+(?P\d+)\D+(?P\d+)\D+(?P\d+)\D+(?P\d+)\D+(?P\d+)[^\)]+\)#im', 251 | $zonefile, 252 | $matches 253 | ); 254 | 255 | if (!$found) { 256 | throw new \Exception("Could not find the SOA record."); 257 | } 258 | 259 | return new self( 260 | $matches['origin'], 261 | $matches['serial'], 262 | $matches['dns'], 263 | $matches['contact'], 264 | (int)$matches['srefresh'], 265 | (int)$matches['sretry'], 266 | (int)$matches['sexpire'], 267 | (int)$matches['nxcache'] 268 | ); 269 | } 270 | 271 | } 272 | 273 | class ZoneFile 274 | { 275 | private StartOfAuthority $soa; 276 | /** @var ContentFile[] */ 277 | private array $files = []; 278 | private int $defaultTTL = 300; 279 | 280 | public function __construct( 281 | private string $file 282 | ) { 283 | $this->soa = StartOfAuthority::fromString(file_get_contents($this->file)); 284 | } 285 | 286 | public function addFile(ContentFile ...$files): self 287 | { 288 | foreach ($files as $file) { 289 | $this->files[] = $file; 290 | } 291 | 292 | return $this; 293 | } 294 | 295 | public function setDefaultTTL(int $defaultTTL): self 296 | { 297 | $this->defaultTTL = $defaultTTL; 298 | 299 | return $this; 300 | } 301 | 302 | public function __toString(): string 303 | { 304 | $this->soa->increaseSerial(); 305 | 306 | $zone_file = "\$TTL\t{$this->defaultTTL}\t; Default TTL".EOL.EOL; 307 | $zone_file .= $this->soa->__toString().EOL.EOL.EOL; 308 | $zone_file .= ";;; START BLOG RECORDS"; 309 | 310 | foreach ($this->files as $file) { 311 | $zone_file .= EOL.EOL.EOL; 312 | $zone_file .= '; '.$file->getDnsName().EOL; 313 | $zone_file .= $file; 314 | } 315 | 316 | $zone_file .= EOL; 317 | 318 | return $zone_file; 319 | } 320 | } 321 | 322 | function update_serial_line(string $line): string 323 | { 324 | $matches = []; 325 | preg_match("#(\s+)(\d{10})(.*)#", $line, $matches); 326 | list($_, $start, $serial, $last) = $matches; 327 | 328 | $today = date("Ymd"); 329 | $day = substr($serial, 0, 8); 330 | $nr = (int)substr($serial, -2); 331 | 332 | if ($day === $today) { 333 | $nr++; 334 | } else { 335 | $day = $today; 336 | $nr = 1; 337 | } 338 | 339 | $new_serial = sprintf('%1$s%2$02d', $day, $nr); 340 | 341 | return $start.$new_serial.$last; 342 | } 343 | 344 | $zone_file_path = "zones/db.hod.experiments.jacobkiers.net"; 345 | if (!file_exists($zone_file_path)) { 346 | fwrite(STDERR, "The zone file {$zone_file_path} does not exist!"); 347 | exit(1); 348 | } 349 | /* 350 | $lines = file($zone_file); 351 | 352 | $index = 0; 353 | foreach ($lines as $index => &$line) { 354 | if (str_contains($line, "; serial")) { 355 | $matches = []; 356 | preg_match("#(\s+)(\d{10})(.*)#", $line, $matches); 357 | list($_, $start, $serial, $last) = $matches; 358 | $line = update_serial_line($line).EOL; 359 | } 360 | if (str_starts_with($line, ";; START BLOG RECORDS")) { 361 | break; 362 | } 363 | } 364 | 365 | 366 | 367 | $zone_file_contents = implode("", array_slice($lines, 0, $index + 1)); 368 | 369 | echo $zone_file_contents; 370 | 371 | $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__."/content")); 372 | foreach ($it as $file) { 373 | if ($file->isDir()) { 374 | continue; 375 | } 376 | if (str_contains($file->getPathname(), "ignore")) { 377 | continue; 378 | } 379 | 380 | $content = new ContentFile($file->getPathname()); 381 | $zone_file_contents .= EOL.$content->__toString().EOL; 382 | } 383 | 384 | $zone_file_contents .= EOL; 385 | 386 | echo $zone_file_contents; 387 | 388 | #file_put_contents($zone_file, $zone_file_contents); 389 | */ 390 | 391 | $zone_file = new ZoneFile($zone_file_path); 392 | 393 | $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__."/content")); 394 | foreach ($it as $file) { 395 | if ($file->isDir()) { 396 | continue; 397 | } 398 | if (str_contains($file->getPathname(), "ignore")) { 399 | continue; 400 | } 401 | 402 | $content = new ContentFile($file->getPathname()); 403 | $zone_file->addFile($content); 404 | } 405 | 406 | $zone_file_contents = $zone_file->__toString(); 407 | echo $zone_file_contents; 408 | file_put_contents($zone_file_path, $zone_file_contents); -------------------------------------------------------------------------------- /zones/db.hod.experiments.jacobkiers.net: -------------------------------------------------------------------------------- 1 | $TTL 300 ; Default TTL 2 | 3 | $ORIGIN hod.experiments.jacobkiers.net. ; The zone of this zone file 4 | @ IN SOA experiments.jacobkiers.net. postmaster.jacobkiers.net. ( 5 | 2021082109 ; serial 6 | 3600 ; slave refresh interval 7 | 900 ; slave retry interval 8 | 604800 ; slave copy expire time 9 | 3600 ; NXDOMAIN cache time 10 | ) 11 | 12 | ; 13 | ; domain name servers 14 | ; 15 | @ IN NS experiments.jacobkiers.net. 16 | 17 | 18 | ;; START BLOG RECORDS 19 | --------------------------------------------------------------------------------