diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..86b8425 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,194 @@ +# Contributing to WP Capsule + +Looking to contribute something to WP Capsule Server? **Here's how you can help.** + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + + +## Using the issue tracker + +The [issue tracker](https://github.com/crowdfavorite/wp-capsule-server/issues) is +the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) +and [submitting pull requests](#pull-requests), but please respect the following +restrictions: + +* Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + +* Please **do not** post comments consisting solely of "+1" or ":thumbsup:". + Use [GitHub's "reactions" feature](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) + instead. We reserve the right to delete comments which violate this rule. + +* Please **do not** open issues regarding [WP Capsule](https://github.com/crowdfavorite/wp-capsule/). + + +## Issues and labels + +Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them: + +- `good first issue` - GitHub will help potential first-time contributors discover issues that have this label. +- `bug` - Issues that have been confirmed with a reduced test case and identify a bug in WP Capsule Server. +- `css` - Issues stemming from our compiled CSS or source Sass files. +- `docs` - Issues for improving or updating our documentation. +- `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified. +- `help wanted` - Issues we need or would love help from the community to resolve. +- `js` - Issues stemming from our compiled or source JavaScript files. +- `meta` - Issues with the project itself or our GitHub repository. +- `duplicate` - This issue or pull request already exists. +- `question` - General support/questions issue bucket. + +For a complete look at our labels, see the [project labels page](https://github.com/crowdfavorite/wp-capsule-server/labels). + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful, so thanks! + +Guidelines for bug reports: + +0. **Validate your code** to ensure your + problem isn't caused by a simple error in your own code. + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `master` or `develop` branch in the repository. + +3. **Isolate the problem** — ideally create or record a live example. + + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment(installed plugins, WordPress version, WP Capsule Server version)? What steps will reproduce the issue? What browser(s) and serverstack +experience the problem? What +would you expect to be the outcome? All these details will help people to fix +any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/serverstack/WordPress environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + + +## Pull requests + +Good pull requests—patches, improvements, new features—are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code), otherwise you risk spending +a lot of time working on something that the project's developers +might not want to merge into the project. + +Please adhere to the [coding guidelines](#code-guidelines) used throughout the +project (indentation, accurate comments, etc.) and any other requirements +(such as test coverage). + +**Do not edit compiled assets or vendor dependencies directly!** +Those files are either automatically generated in the case of js or css assets +or ignored from the repo codebase in the case of dependencies(`vendor` AND `ui` folder). +You should edit the source files for assets or extend vendor dependencies. + +Adhering to the following process is the best way to get your work +included in the project: + +1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, + and configure the remotes: + + ```bash + # Clone your fork of the repo into the current directory + git clone https://github.com//wp-capsule-server.git + # Navigate to the newly cloned directory + cd wp-capsule + # Assign the original repo to a remote called "upstream" + git remote add upstream https://github.com/crowdfavorite/wp-capsule-server.git + ``` + +2. If you cloned a while ago, get the latest changes from upstream: + + ```bash + git checkout develop + git pull upstream develop + ``` + +3. Create a new topic branch (off the main project `develop` branch) to + contain your feature, change, or fix: + + ```bash + git checkout -b + ``` + +4. Commit your changes in logical chunks. Please adhere to these [git commit + message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) + or your code is unlikely be merged into the main project. Use Git's + [interactive rebase](https://help.github.com/articles/about-git-rebase/) + feature to tidy up your commits before making them public. + +5. Locally merge (or rebase) the upstream `develop` branch into your topic branch: + + ```bash + git pull [--rebase] upstream develop + ``` + +6. Push your topic branch up to your fork: + + ```bash + git push origin + ``` + +7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/) + with a clear title and description against the `develop` branch. + +**IMPORTANT**: By submitting a patch, you agree to allow the project owners to +license your work under the terms of the [GPLv2 License](../LICENSE). + + +## Code guidelines + +### PHP +WP Capsule repos follow an extended [PSR12 ruleset](../phpcs.xml) that includes WordPress Security sniffs with the added change of preffering tabs instead of spaces for indentation. +**You code should adhere to this ruleset.** + +### CSS +- Classes should be named following the [BEM conventions](http://getbem.com/naming/). +- Your compiled CSS should nest no more than 4 levels deep, preferably no more than 3 levels. +- Follow [ITCSS](https://www.creativebloq.com/web-design/manage-large-css-projects-itcss-101517528) principles for organizing styles. + +### JS +We adhere to the [AirBnB JavaScript Style Guide](https://github.com/airbnb/javascript) for project JavaScript code. [All rules apply](https://github.com/airbnb/javascript/blob/master/README.md#table-of-contents) with the following exceptions: +- Ignore rules related to IE8 support. We don't generally do it, and sometimes it can be useful to use a normal property overridden into a different one (such as a CSS styles object to pass to jQuery). +- Put all functions at the end of scope, possibly after a return. Doing this comes from the Angular guide, and makes it easier to follow a narrative flow of the code. We see the behaviors, then can quickly dig into the implementation if we wish to. (Credit to [John Papa's Angular Style guide](https://github.com/johnpapa/angular-styleguide) for this idea) + +### Checking coding style +Run `phpcs --standard=phpcs.xml` before committing to ensure your changes follow our coding standards. + +## License +By contributing your code, you agree to license your contribution under the [GPLv2 License](../LICENSE). \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..a25a8f7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,18 @@ +--- +name: Bug report +about: Tell us about a bug you may have identified in WP Capsule Server. +labels: bug +--- + +Before opening: + +- [Search for duplicate or closed issues](https://github.com/crowdfavorite/wp-capsule-server/issues?utf8=%E2%9C%93&q=is%3Aissue) +- Validate and [lint](https://github.com/crowdfavorite/wp-capsule-server/blob/master/phpcs.xml) any PHP code to avoid common problems +- Read the [contributing guidelines](https://github.com/crowdfavorite/wp-capsule-server/blob/master/.github/CONTRIBUTING.md) + +Bug reports must include: + +- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile) +- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) +- Serverstack(with versions) and WordPress environment(WP Capsule version, WordPress version, installed plugins, multi or single site) +- Ideally create or record a live example of the bug \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..47782e5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,15 @@ +--- +name: Feature request +about: Suggest an idea for a new feature in WP Capsule Server. +labels: feature +--- + +Before opening: + +- [Search for duplicate or closed issues](https://github.com/crowdfavorite/wp-capsule-server/issues?utf8=%E2%9C%93&q=is%3Aissue) +- Read the [contributing guidelines](https://github.com/crowdfavorite/wp-capsule-server/blob/master/.github/CONTRIBUTING.md) + +Feature requests must include: + +- As much detail as possible for what we should add and why it's important to WP Capsule Server +- Relevant resources wherever possible \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..fc7a5b4 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Description + + + +## Testing instructions + + + +## Screenshots + + +## Checklist: +- [ ] I've tested the code. +- [ ] My code follows the WP Capsule Server custom PSR12 code style. +- [ ] My code follows the accessibility standards. +- [ ] My code follows the PHP DocBlock documentation standards. \ No newline at end of file diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md new file mode 100644 index 0000000..c9258ad --- /dev/null +++ b/.github/SUPPORT.md @@ -0,0 +1,7 @@ +### Bug reports + +See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports. + +### How-to + +For general troubleshooting or help getting started please open an issue in this repo and label it as "Question". \ No newline at end of file diff --git a/CHANDELOG.md b/CHANDELOG.md new file mode 100644 index 0000000..dc73b2e --- /dev/null +++ b/CHANDELOG.md @@ -0,0 +1,48 @@ +## Version 1.3.0 +- fixed warning when editing posts in the backend +- replace icon +- rewrite URLs to SSL variants(https) +- PSR-12 code style enforce +- fixed a bug where projects and tags were being registered from codeblocks or docblocks +- fixed a bug where `` $` `` or `$'` broke the codeblock interface +- Added "open in new" icon to webfont files. Updated how icons are added. Improved accessibility of main menu and articles utility menu items. +- update issue templates to add labels +- update php-markdown lib to ignore parsing of heading tags without a space eg: #test +- added phpcs ruleset, license file, security policy, code of conduct, contributing guidelines, changelog file, templates for pull requests and issues, support information +- Replaced wp_redirect with wp_safe_redirect +- Replaced wp_remote_* with wp_safe_remote_* +- updated documentation +- added wp-capsule-ui as a git subtree, removing 3rd-party git subrepo usage + +## Version 1.2 +- remove the git submodules structure +- update libraries, code cleanup +- fix various PHP notices + +## Version 1.1.1 +- include jQuery Hotkeys in the optimized.js file + +## Version 1.1 +- add keyboard shortcuts for Home, New Post, focus to Search field +- background queue for sending posts to Capsule Server (saves are now non-blocking UI actions, also supports offline usage) +- add favicon and icon for use with Fluid app +- add default styling for tables +- show which servers a post has been pushed to, with link to post on server +- allow mapping of multiple local projects to a single server project +- fix issues with syntax highlighting markdown emphasis in editor versus display +- fix double-encoding of ampersands on display +- fix fenced code blocks not being entity-encoded in some cases +- don't allow the same Capsule Server to be added twice +- fix auth check (prevent direct access to posts) +- remove persistent horizontal scrollbar from code blocks (now only appears when needed) +- add hooks in Capsule's controllers for extensibility (capsule_controller_action_get, capsule_controller_action_post) +- add filter to allow overriding of Capsule's access restrictions (capsule_gatekeeper_enabled) +- add before and after actions to post menu (capsule_post_menu_before, capsule_post_menu_after) +- add before and after actions to main nav (capsule_main_nav_before, capsule_main_nav_after) +- update WP permalinks when pretty premalinks are detected and our custom taxonomies are not present +- explicitly remove post formats support +- fix various PHP notices + +## Version 1.0 + +- initial release diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..442cf0a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at security@crowdfavorite.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md new file mode 100644 index 0000000..52ac94b --- /dev/null +++ b/DOCUMENTATION.md @@ -0,0 +1,58 @@ +Capsule Server +============== + +Turning the developer's code journal into a collaboration hub. + +![](docs/hero.jpg) + +### Overview + +Capsule Server is a collaboration hub. Developers do their independent journaling in their Capsule installs, then can choose to selectively send that content to the Capsule Server. Content is not created on the Capsule Server, it is replicated from developer's Capsule installations. + +Capsule Server can serve as a shared memory for a developement team - a home for decisions, failed approaches, ideas and notes that might not make it into code comments or other documentation. + +### Developers, Get Your API Key + +Contributors to this Capsule Server can get their API key on their Profile page. + +### Manage Projects + +Create projects to determine what content the Capsule Server will accept. Each developer can then opt-in to the projects they like, and any posts in their Capsule for that project will be replicated to the Capsule Server. + +### Manage Users + +Add user accounts for developers who you want to contribute and/or to have access to contributed content. These developers are given the Capsule Server API URL and an API key on their Profile page. They each enter this information into their Capsule install which allows them to contribute content back to the Capsule Server. + +The recommended role for Capsule API users is `subscriber`. Only give accounts to trusted users (see Security below). + +### Security + +_Capsule Server is designed to be used with trusted users._ + +For this reason, and to retain fidelity of post content, posts from Capsule instances are replicated verbatim on the Capsule Server. No KSES filtering or content sanitization is performed (regardless of user role). + +To revoke a developer\\'s access, you can delete the user account. If you prefer to disable their account rather than deleting it, you can change their API key, password and email address. + +As Capsule Server is expected to be used with technical teams that may use self-signed SSL certificates, Capsule is configured to automatically accept self-signed certificates when talking to a Capsule Server. + +### Browse by Projects & Tags + +![Project List](docs/projects.jpg) + +You can quickly access Capsule Server content by project or tag using the **@** and **#** menu items. + +### Search + +![Search](docs/search.jpg) + +Capsule supports both keyword search and filtering by projects, tags, code languages, developer and date range, whew! When using keyword search you can auto-complete projects, tags, and code languages by using their syntax prefix. + +When filtering, multiple projects/tags/developers/etc. can be selected and are all populated with auto-complete. + +### Using dnsmasq + +Many local development environments take advantage of dnsmasq to have pretty links for their local projects. However, please be aware that there is a common issue affecting cURL usage on environments with dnsmasq running as a service. + +As WP Capsule uses cURL to sync capsules, you might find that your local instance is not able to properly send information over to your defined WP Capsule Server. + +To check if your local domain properly resolves, use the terminal command dig, followed by your local URL (eg: dig mywebsite.localhost). In the response section of the output you should see an A record pointing to 127.0.0.1. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md index b104070..85fed8d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,100 @@ -# Capsule Server +

+ + Capsule Server logo + +

-_A collaboration hub for [Capsule](http://crowdfavorite.com/capsule/) content._ +

WP Capsule Server

---- +

+ Turning the developer's code journal into a collaboration hub. +
+ Explore WP Capsule Server docs » +
+
+ Report bug + · + Request feature + · + Check out WP Capsule +

-This is a WordPress theme. Install it as usual to turn a WordPress instance into a Capsule Server. [Learn more.](http://crowdfavorite.com/capsule/) -Minimum required WordPress version: 4.1 +## Table of contents -Target browser compatibility: +- [Quick start](#quick-start) +- [Requirements](#requirements) +- [Status](#status) +- [Bugs and feature requests](#bugs-and-feature-requests) +- [Documentation](#documentation) +- [Contributing](#contributing) +- [Community](#community) +- [Versioning](#versioning) +- [Changelog](#changelog) +- [License](#license) -- Chrome -- Safari -- Firefox -- IE9 (functional) -- IE10 (functional) +## Quick start -License: [GPL v2](http://opensource.org/licenses/GPL-2.0) +This is a WordPress theme. Install it as usual to turn a WordPress instance into a Capsule code journal server. -Developers, contribute on [GitHub](https://github.com/crowdfavorite/wp-capsule-server). +- [Download the latest release.](https://github.com/crowdfavorite/wp-capsule-server/releases/) ---- +or -**Repository Structure** +- Clone the repo: `git clone https://github.com/crowdfavorite/wp-capsule-server.git` in your `wp-content/themes` folder -- Capsule: https://github.com/crowdfavorite/wp-capsule -- Capsule Server: https://github.com/crowdfavorite/wp-capsule-server -- Capsule UI: https://github.com/crowdfavorite/wp-capsule-ui +Read the _Welcome_ page (available in your WordPress dashboard at `wp-admin/admin.php?page=capsule`) for more information. -Capsule UI is a subrepo of both Capsule and Capsule Server, delivering the UI for both packages. -Read more about Git subrepo at https://github.com/ingydotnet/git-subrepo ---- +## Requirements + +WP Capsule Server is dependent on: + +- Minimum **PHP** version **5.6** +- Minimum **WordPress** version **4.1** + + +## Status + +[![Latest Release](https://img.shields.io/github/v/release/crowdfavorite/wp-capsule-server)](https://github.com/crowdfavorite/wp-capsule-server/releases) +[![GitHub forks](https://img.shields.io/github/forks/crowdfavorite/wp-capsule-server)](https://github.com/crowdfavorite/wp-capsule-server/network) +[![GitHub stars](https://img.shields.io/github/stars/crowdfavorite/wp-capsule-server)](https://github.com/crowdfavorite/wp-capsule-server/stargazers) +[![GitHub issues](https://img.shields.io/github/issues/crowdfavorite/wp-capsule-server)](https://github.com/crowdfavorite/wp-capsule-server/issues) +[![GitHub license](https://img.shields.io/github/license/crowdfavorite/wp-capsule-server)](https://github.com/crowdfavorite/wp-capsule-server/blob/develop/LICENSE) + +## Bugs and feature requests + +Have a bug or a feature request? Please first read the [issue guidelines](https://github.com/crowdfavorite/wp-capsule-server/blob/master/.github/CONTRIBUTING.md#using-the-issue-tracker) and search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/crowdfavorite/wp-capsule-server/issues/new). + + +## Documentation + +WP Capsule Server's documentation is available in your WordPress dashboard, at `wp-admin/admin.php?page=capsule`. It is also included in the repo, [here](DOCUMENTATION.md). + + +## Contributing + +Please read through our [contributing guidelines](https://github.com/crowdfavorite/wp-capsule-server/blob/master/.github/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development. + + +## Community + +Get updates on WP Capsule Server's development and chat with the project maintainers and community members. + +- Follow [@crowdfavorite on Twitter](https://twitter.com/crowdfavorite). +- Reach out to us on our [website](https://crowdfavorite.com) + +## Versioning + +For transparency into our release cycle and in striving to maintain backward compatibility, WP Capsule Server is maintained under [the Semantic Versioning guidelines](http://semver.org/). Sometimes we screw up, but we adhere to those rules whenever possible. + ## Changelog +See [the Releases section of our GitHub project](https://github.com/crowdfavorite/wp-capsule-server/releases) for changelogs for each release version of WP Capsule Server, +or a historical changelog can be found in the repo, [here](https://github.com/crowdfavorite/wp-capsule-server/blob/master/CHANGELOG.md). + + +## License -View the [combined changelog](https://github.com/crowdfavorite/wp-capsule-ui/blob/master/CHANGELOG.txt) for Capsule and Capsule Server. \ No newline at end of file +WP Capsule is released under the [GPLv2 License](https://github.com/crowdfavorite/wp-capsule-server/blob/master/LICENSE). \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..f6e02e8 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting Security Issues + +The WP Capsule Server team and community take security issues in WP Capsule seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, email [security@crowdfavorite.com](mailto:security@crowdfavorite.com) and include the word "SECURITY" in the subject line. + +We'll endeavor to respond quickly, and will keep you updated throughout the process. \ No newline at end of file diff --git a/assets/css/admin.css b/assets/css/admin.css index 764c6c9..0de2de7 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -65,4 +65,3 @@ max-width: 500px; width: 45%; } - diff --git a/capsule-server-import-export.php b/capsule-server-import-export.php index d7810ff..13c3369 100644 --- a/capsule-server-import-export.php +++ b/capsule-server-import-export.php @@ -1,4 +1,6 @@ - 'error', ); // Cannot use nonce here as they're salted with unique keys, going to have to rely on api key. - if ( isset( $_POST['capsule_client_post_data'] ) ) { + if (isset($_POST['capsule_client_post_data'])) { $data = $_POST['capsule_client_post_data']; - if ( isset( $data['post'], $data['tax'], $data['api_key'] ) ) { - $user_id = capsule_server_validate_user( $data['api_key'] ); - if ( $user_id > 0 ) { - $capsule_import = new Capsule_Server_Import_Post( $user_id, $data['post'], $data['tax'] ); + if (isset($data['post'], $data['tax'], $data['api_key'])) { + $user_id = capsule_server_validate_user($data['api_key']); + if ($user_id > 0) { + $capsule_import = new CrowdFavorite\Capsule\CapsuleServerImportPost( + $user_id, + $data['post'], + $data['tax'] + ); $post_id = $capsule_import->import(); - if ( $capsule_import->local_post_id > 0 ) { + if ($capsule_import->local_post_id > 0) { $response = array( 'result' => 'success', 'data' => array( - 'permalink' => get_permalink( $capsule_import->local_post_id ), + 'permalink' => get_permalink($capsule_import->local_post_id), ), ); } } else { - header( 'HTTP/1.1 401 Unauthorized' ); + header('HTTP/1.1 401 Unauthorized'); die(); } } } - wp_send_json( $response ); + wp_send_json($response); break; case 'get_terms': - if ( isset( $_POST['capsule_client_post_data']['api_key'] ) && capsule_server_validate_user( $_POST['capsule_client_post_data']['api_key'] ) ) { - $taxonomies = isset( $_POST['capsule_client_post_data']['taxonomies'] ) ? $_POST['capsule_client_post_data']['taxonomies'] : array(); - $term_exporter = new Capsule_Server_Export_Terms( $taxonomies ); - echo wp_json_encode( $term_exporter->get_terms() ); + if ( + isset($_POST['capsule_client_post_data']['api_key']) && + capsule_server_validate_user($_POST['capsule_client_post_data']['api_key']) + ) { + $taxonomies = isset($_POST['capsule_client_post_data']['taxonomies']) + ? $_POST['capsule_client_post_data']['taxonomies'] + : []; + $term_exporter = new CrowdFavorite\Capsule\CapsuleServerExportTerms($taxonomies); + echo wp_json_encode($term_exporter->getTerms()); } else { - header( 'HTTP/1.1 401 Unauthorized' ); + header('HTTP/1.1 401 Unauthorized'); } die(); break; case 'test_credentials': - if ( isset( $_POST['capsule_client_post_data']['api_key'] ) && capsule_server_validate_user( $_POST['capsule_client_post_data']['api_key'] ) ) { + if ( + isset($_POST['capsule_client_post_data']['api_key']) && + capsule_server_validate_user($_POST['capsule_client_post_data']['api_key']) + ) { echo 'authorized'; } else { - header( 'HTTP/1.1 401 Unauthorized' ); + header('HTTP/1.1 401 Unauthorized'); } die(); break; @@ -72,5 +87,4 @@ function capsule_server_controller() { } } // Come in after taxonomies are typically registered but before the wp-gatekeeper plugin. -add_action( 'init', 'capsule_server_controller', 11 ); - +add_action('init', 'capsule_server_controller', 11); diff --git a/functions.php b/functions.php index 6b0265b..0e270bf 100644 --- a/functions.php +++ b/functions.php @@ -1,4 +1,5 @@ -generate_api_key(); - $cap->set_api_key( $key ); - echo esc_html( $key ); + $cap->set_api_key($key); + echo esc_html($key); } die(); } -add_action( 'wp_ajax_cap_new_api_key', 'capsule_server_ajax_new_api' ); +add_action('wp_ajax_cap_new_api_key', 'capsule_server_ajax_new_api'); /** * Generate the user meta key for the api key value. @@ -37,8 +41,9 @@ function capsule_server_ajax_new_api() { * * @return string meta key **/ -function capsule_server_api_meta_key() { - if ( is_multisite() ) { +function capsule_server_api_meta_key() +{ + if (is_multisite()) { $blog_id = get_current_blog_id(); $api_meta_key = ( 1 === $blog_id ) ? '_capsule_api_key' : '_capsule_api_key_' . $blog_id; } else { @@ -54,13 +59,15 @@ function capsule_server_api_meta_key() { * @param string $api_key The api key to use for the validation. * @return integer User ID or 0 if none can be found. */ -function capsule_server_validate_user( $api_key ) { +function capsule_server_validate_user($api_key) +{ global $wpdb; $meta_key = capsule_server_api_meta_key(); return (int) $wpdb->get_var( - $wpdb->prepare( ' + $wpdb->prepare( + ' SELECT `user_id` FROM ' . $wpdb->usermeta . ' WHERE `meta_key` = %s @@ -76,39 +83,55 @@ function capsule_server_validate_user( $api_key ) { * * @return void */ -function capsule_server_admin_notice() { - if ( empty( $_GET['page'] ) || false !== strpos( $_GET['page'], 'capsule' ) ) { +function capsule_server_admin_notice() +{ + if (empty($_GET['page']) || false !== strpos($_GET['page'], 'capsule')) { //phpcs:ignore return; } -?> + ?>
-

+

how Capsule Server works.', 'capsule-server' ), esc_url( admin_url( 'admin.php?page=capsule' ) ) ); + printf( + esc_html__( + 'Please read the overview, FAQs and more about how Capsule Server works.', + 'capsule-server' + ), + esc_url(admin_url('admin.php?page=capsule')) + ); ?>

-taxonomies = $taxonomies; } @@ -33,17 +38,18 @@ public function __construct( $taxonomies = array() ) { * ), * 'taxonomy_2' ... */ - public function get_terms() { + public function getTerms() + { $taxonomy_array = array(); - $terms = get_terms( $this->taxonomies, array( + $terms = get_terms($this->taxonomies, array( 'hide_empty' => false, 'orderby' => 'slug', 'order' => 'ASC', )); - if ( is_array( $terms ) ) { - foreach ( $terms as $term ) { + if (is_array($terms)) { + foreach ($terms as $term) { $taxonomy_array[ $term->taxonomy ][ $term->slug ] = array( 'id' => $term->term_id, 'name' => $term->name, diff --git a/inc/class-capsule-server-import-post.php b/inc/class-capsule-server-import-post.php index a0fa246..5ef7445 100644 --- a/inc/class-capsule-server-import-post.php +++ b/inc/class-capsule-server-import-post.php @@ -1,14 +1,18 @@ post = $post; $this->tax_data = $tax_data; $this->local_post_id = 0; @@ -31,9 +36,10 @@ public function __construct( $user_id, $post, $tax_data ) { * * @return void */ - public function import() { - $this->import_post(); - $this->import_terms(); + public function import() + { + $this->importPost(); + $this->importTerms(); } /** @@ -42,26 +48,29 @@ public function import() { * @throws Exception If cannot insert post. * @return void */ - private function import_post() { + private function importPost() + { $this->post['guid'] = $this->post['guid'] . '_user_' . $this->post['post_author']; // Update post if it already exists on the server. - $local_id = self::get_post_id_by_guid( $this->post['guid'] ); - if ( $local_id > 0 ) { + $local_id = self::getPostIdByGuid($this->post['guid']); + if ($local_id > 0) { $this->post['ID'] = $local_id; } else { - unset( $this->post['ID'] ); + unset($this->post['ID']); } - remove_filter( 'content_save_pre', 'wp_filter_post_kses' ); - remove_filter( 'excerpt_save_pre', 'wp_filter_post_kses' ); - remove_filter( 'content_filtered_save_pre', 'wp_filter_post_kses' ); + remove_filter('content_save_pre', 'wp_filter_post_kses'); + remove_filter('excerpt_save_pre', 'wp_filter_post_kses'); + remove_filter('content_filtered_save_pre', 'wp_filter_post_kses'); - $this->local_post_id = wp_insert_post( $this->post ); - if ( is_wp_error( $this->local_post_id ) ) { + $this->local_post_id = wp_insert_post($this->post); + if (is_wp_error($this->local_post_id)) { $this->local_post_id = 0; // Translators: %s is the post guid. - throw new Exception( sprintf( __( 'Unable to import post with guid: %s', 'capsule-server' ), $this->post['guid'] ) ); + throw new \Exception( + sprintf(esc_html__('Unable to import post with guid: %s', 'capsule-server'), $this->post['guid']) + ); } } @@ -70,7 +79,8 @@ private function import_post() { * * @return void */ - private function import_terms() { + private function importTerms() + { // All the taxonomies sent from the client. $taxonomies = $this->tax_data['taxonomies']; // The term mappings for each taxonomy. @@ -78,39 +88,39 @@ private function import_terms() { // The taxonomies which had a local mapping. $mapped_taxonomies = $this->tax_data['mapped_taxonomies']; - if ( empty( $taxonomies ) ) { + if (empty($taxonomies)) { return; } - foreach ( $taxonomies as $taxonomy ) { - if ( isset( $tax_input[ $taxonomy ] ) ) { + foreach ($taxonomies as $taxonomy) { + if (isset($tax_input[ $taxonomy ])) { $terms = (array) $tax_input[ $taxonomy ]; // wp_set_post_terms will use the integers as names if not the correct type. - if ( in_array( $taxonomy, $mapped_taxonomies, true ) ) { + if (in_array($taxonomy, $mapped_taxonomies, true)) { // This handles forcing hierarchial taxonomies to be have terms as integers. - wp_set_post_terms( $this->local_post_id, $terms, $taxonomy ); + wp_set_post_terms($this->local_post_id, $terms, $taxonomy); } else { // Check if hierarchical, need to pass IDs. - if ( is_taxonomy_hierarchical( $taxonomy ) ) { + if (is_taxonomy_hierarchical($taxonomy)) { $terms_as_id = array(); - foreach ( $terms as $term ) { + foreach ($terms as $term) { // Get term, create if not exists. - $term_id = capsule_create_term( $term, $taxonomy ); + $term_id = capsule_create_term($term, $taxonomy); - if ( $term_id ) { + if ($term_id) { $terms_as_id[] = $term_id; } } - wp_set_post_terms( $this->local_post_id, $terms_as_id, $taxonomy ); + wp_set_post_terms($this->local_post_id, $terms_as_id, $taxonomy); } else { - wp_set_post_terms( $this->local_post_id, $terms, $taxonomy ); + wp_set_post_terms($this->local_post_id, $terms, $taxonomy); } } } else { // There were no terms passed, so unset the current terms. - wp_set_post_terms( $this->local_post_id, array(), $taxonomy ); + wp_set_post_terms($this->local_post_id, array(), $taxonomy); } } } @@ -121,11 +131,13 @@ private function import_terms() { * @param string $guid Post guid. * @return integer Post id, 0 if no post was found. */ - public static function get_post_id_by_guid( $guid ) { + public static function getPostIdByGuid($guid) + { global $wpdb; $post_id = (int) $wpdb->get_var( - $wpdb->prepare( ' + $wpdb->prepare( + ' SELECT ID FROM ' . $wpdb->posts . ' WHERE guid = %s', @@ -141,7 +153,7 @@ public static function get_post_id_by_guid( $guid ) { * * @return void */ - function cap_server_remove_user() { - + private function capServerRemoveUser() + { } } diff --git a/inc/class-capsule-server.php b/inc/class-capsule-server.php index 76438b8..9a5ef8f 100644 --- a/inc/class-capsule-server.php +++ b/inc/class-capsule-server.php @@ -1,14 +1,18 @@ user_id = ( null === $user_id ) ? get_current_user_id() : $user_id; $this->api_endpoint = home_url(); $this->api_meta_key = capsule_server_api_meta_key(); - $this->user_api_key = get_user_meta( $this->user_id, $this->api_meta_key, true ); + $this->user_api_key = get_user_meta($this->user_id, $this->api_meta_key, true); } /** @@ -50,11 +55,12 @@ public function __construct( $user_id = null ) { * * @return void */ - public function add_actions() { - add_action( 'user_register', array( $this, 'user_register' ) ); - add_action( 'show_user_profile', array( $this, 'user_profile' ) ); - add_action( 'edit_user_profile', array( $this, 'user_profile' ) ); - add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); + public function add_actions() + { + add_action('user_register', array( $this, 'user_register' )); + add_action('show_user_profile', array( $this, 'user_profile' )); + add_action('edit_user_profile', array( $this, 'user_profile' )); + add_action('admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' )); } /** @@ -63,8 +69,9 @@ public function add_actions() { * @param integer $user_id User id. * @return void */ - public function user_register( $user_id ) { - $cap_server = new Capsule_Server( $user_id ); + public function user_register($user_id) + { + $cap_server = new Capsule_Server($user_id); // This sets a new api key. $cap_server->user_api_key(); } @@ -75,9 +82,10 @@ public function user_register( $user_id ) { * @param object $user_data User data. * @return void */ - public function user_profile( $user_data ) { + public function user_profile($user_data) + { // Add API Key to User's Profile. - $cap_server = new Capsule_Server( $user_data->ID ); + $cap_server = new Capsule_Server($user_data->ID); $api_key = $cap_server->user_api_key(); // Just a request handler. @@ -91,13 +99,14 @@ public function user_profile( $user_data ) { * @param string $hook Current page hook. * @return void */ - public function admin_enqueue_scripts( $hook ) { - if ( 'profile.php' === $hook ) { - wp_enqueue_script( 'capsule-admin-profile', get_stylesheet_directory_uri() . '/assets/js/admin-profile.js', array( 'jquery' ), '20180213.1245' ); + public function admin_enqueue_scripts($hook) + { + if ('profile.php' === $hook) { + wp_enqueue_script('capsule-admin-profile', get_stylesheet_directory_uri() . '/assets/js/admin-profile.js', array( 'jquery' ), '20180213.1245'); } - wp_enqueue_script( 'capsule-admin', get_stylesheet_directory_uri() . '/assets/js/admin.js', array( 'jquery' ), '20180213.1245' ); + wp_enqueue_script('capsule-admin', get_stylesheet_directory_uri() . '/assets/js/admin.js', array( 'jquery' ), '20180213.1245'); - wp_enqueue_style( 'capsule-admin', get_stylesheet_directory_uri() . '/assets/css/admin.css', array(), '20180309.1630' ); + wp_enqueue_style('capsule-admin', get_stylesheet_directory_uri() . '/assets/css/admin.css', array(), '20180309.1630'); } /** @@ -105,15 +114,16 @@ public function admin_enqueue_scripts( $hook ) { * * @return string API key. */ - public function generate_api_key() { + public function generate_api_key() + { // Generate unique keys on a per blog basis. - if ( is_multisite() ) { + if (is_multisite()) { $key = AUTH_KEY . get_current_blog_id(); } else { $key = AUTH_KEY; } - return sha1( $this->user_id . $key . microtime() ); + return sha1($this->user_id . $key . microtime()); } /** @@ -122,11 +132,12 @@ public function generate_api_key() { * @param string $key API key. * @return void */ - public function set_api_key( $key = null ) { - if ( null === $key ) { + public function set_api_key($key = null) + { + if (null === $key) { $key = $this->user_api_key; } - update_user_meta( $this->user_id, $this->api_meta_key, $key ); + update_user_meta($this->user_id, $this->api_meta_key, $key); } /** @@ -134,8 +145,9 @@ public function set_api_key( $key = null ) { * * @return string API key. */ - public function user_api_key() { - if ( empty( $this->user_api_key ) ) { + public function user_api_key() + { + if (empty($this->user_api_key)) { $this->user_api_key = $this->generate_api_key(); $this->set_api_key(); } diff --git a/inc/profile.php b/inc/profile.php index d7c1331..c983eb8 100644 --- a/inc/profile.php +++ b/inc/profile.php @@ -1,23 +1,38 @@
-

- - - - - - - - - - - - - - - - - -
- -
+

+ + + + + + + + + + + + + + + + + +
+ +
+ + + +
diff --git a/inc/server-help.php b/inc/server-help.php index 1c1097f..cd10f9b 100644 --- a/inc/server-help.php +++ b/inc/server-help.php @@ -1,78 +1,89 @@ +
-

-

+

+

- +
-

+

' . esc_html__( 'Capsule', 'capsule-server' ) . '' + esc_html__('Capsule Server is a collaboration hub. Developers do their independent journaling in their %s installs, then can choose to selectively send that content to the Capsule Server. Content is not created on the Capsule Server, it is replicated from developer\'s Capsule installations.', 'capsule-server'), + '' . esc_html__('Capsule', 'capsule-server') . '' ); - ?> + ?>

-

+

-

+

' . esc_html__( 'Profile page', 'capsule-server' ) . '' + esc_html('Contributors to this Capsule Server can get their API key on their %s.', 'capsule-server'), + '' . esc_html__('Profile page', 'capsule-server') . '' ); - ?> + ?>

-

+

- +

-

-

-

subscriber. Only give accounts to trusted users (see Security below).', 'capsule-server' ) ); ?>

+

+

+

subscriber. Only give accounts to trusted users (see Security below).', 'capsule-server')); ?>

-

-

-

-

-

+

+

+

+

+

-

-

<?php esc_html_e( 'Project List', 'capsule-server' ); ?>

-

@ and # menu items', 'capsule-server' ) ); ?>

- -

-

<?php esc_html_e( 'Search', 'capsule-server' ); ?>

-

-

+

+

<?php esc_html_e('Project List', 'capsule-server'); ?>

+

@ and # menu items', 'capsule-server')); ?>

+

+

<?php esc_html_e('Search', 'capsule-server'); ?>

+

+

+

+

+

+



-

+

' . esc_html__( 'Crowd Favorite', 'capsule-server' ) . '' + esc_html__('Capsule was conceived and executed by the brilliant and devastatingly good-looking men and women at %s.', 'capsule-server'), + '' . esc_html__('Crowd Favorite', 'capsule-server') . '' ); - ?> + ?>

-

+

 

-

+

diff --git a/index.php b/index.php index ef78ae9..66fbd1d 100644 --- a/index.php +++ b/index.php @@ -1,14 +1,15 @@ - + + Custom variant of PSR12 with WordPress security checks for PHP development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */node_modules/* + */vendor/* + */dependencies/* + */lib/* + */ui/* + + + . + + + + + + + + + + + + diff --git a/style.css b/style.css index 3503c5a..b255fcd 100644 --- a/style.css +++ b/style.css @@ -1,8 +1,8 @@ /* Theme Name: Capsule Server -Theme URI: http://crowdfavorite.com/capsule/ -Description: A collaboration hub for Capsule content. +Theme URI: https://crowdfavorite.com/capsule/ +Description: A collaboration hub for Capsule content. Author: Crowd Favorite -Author URI: http://crowdfavorite.com/ -Version: 1.2 +Author URI: https://crowdfavorite.com/ +Version: 1.3.0 */ \ No newline at end of file diff --git a/ui/.github/CONTRIBUTING.md b/ui/.github/CONTRIBUTING.md new file mode 100644 index 0000000..3c2a3c1 --- /dev/null +++ b/ui/.github/CONTRIBUTING.md @@ -0,0 +1,194 @@ +# Contributing to WP Capsule + +Looking to contribute something to WP Capsule UI? **Here's how you can help.** + +Please take a moment to review this document in order to make the contribution +process easy and effective for everyone involved. + +Following these guidelines helps to communicate that you respect the time of +the developers managing and developing this open source project. In return, +they should reciprocate that respect in addressing your issue or assessing +patches and features. + + +## Using the issue tracker + +The [issue tracker](https://github.com/crowdfavorite/wp-capsule-ui/issues) is +the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) +and [submitting pull requests](#pull-requests), but please respect the following +restrictions: + +* Please **do not** derail or troll issues. Keep the discussion on topic and + respect the opinions of others. + +* Please **do not** post comments consisting solely of "+1" or ":thumbsup:". + Use [GitHub's "reactions" feature](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) + instead. We reserve the right to delete comments which violate this rule. + +* Please **do not** open issues regarding [WP Capsule](https://github.com/crowdfavorite/wp-capsule/) or [WP Capsule Server](https://github.com/crowdfavorite/wp-capsule-server/). + + +## Issues and labels + +Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them: + +- `good first issue` - GitHub will help potential first-time contributors discover issues that have this label. +- `bug` - Issues that have been confirmed with a reduced test case and identify a bug in WP Capsule UI. +- `css` - Issues stemming from our compiled CSS or source Sass files. +- `docs` - Issues for improving or updating our documentation. +- `feature` - Issues asking for a new feature to be added, or an existing one to be extended or modified. +- `help wanted` - Issues we need or would love help from the community to resolve. +- `js` - Issues stemming from our compiled or source JavaScript files. +- `meta` - Issues with the project itself or our GitHub repository. +- `duplicate` - This issue or pull request already exists. +- `question` - General support/questions issue bucket. + +For a complete look at our labels, see the [project labels page](https://github.com/crowdfavorite/wp-capsule-ui/labels). + + +## Bug reports + +A bug is a _demonstrable problem_ that is caused by the code in the repository. +Good bug reports are extremely helpful, so thanks! + +Guidelines for bug reports: + +0. **Validate your code** to ensure your + problem isn't caused by a simple error in your own code. + +1. **Use the GitHub issue search** — check if the issue has already been + reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the + latest `master` or `develop` branch in the repository. + +3. **Isolate the problem** — ideally create or record a live example. + + +A good bug report shouldn't leave others needing to chase you up for more +information. Please try to be as detailed as possible in your report. What is +your environment(installed plugins, WordPress version, WP Capsule Server version)? What steps will reproduce the issue? What browser(s) and serverstack +experience the problem? What +would you expect to be the outcome? All these details will help people to fix +any potential bugs. + +Example: + +> Short and descriptive example bug report title +> +> A summary of the issue and the browser/serverstack/WordPress environment in which it occurs. If +> suitable, include the steps required to reproduce the bug. +> +> 1. This is the first step +> 2. This is the second step +> 3. Further steps, etc. +> +> +> Any other information you want to share that is relevant to the issue being +> reported. This might include the lines of code that you have identified as +> causing the bug, and potential solutions (and your opinions on their +> merits). + +## Feature requests + +Feature requests are welcome. But take a moment to find out whether your idea +fits with the scope and aims of the project. It's up to *you* to make a strong +case to convince the project's developers of the merits of this feature. Please +provide as much detail and context as possible. + + +## Pull requests + +Good pull requests—patches, improvements, new features—are a fantastic +help. They should remain focused in scope and avoid containing unrelated +commits. + +**Please ask first** before embarking on any significant pull request (e.g. +implementing features, refactoring code), otherwise you risk spending +a lot of time working on something that the project's developers +might not want to merge into the project. + +Please adhere to the [coding guidelines](#code-guidelines) used throughout the +project (indentation, accurate comments, etc.) and any other requirements +(such as test coverage). + +**Do not edit compiled assets or vendor dependencies directly!** +Those files are either automatically generated in the case of js or css assets +or ignored from the repo codebase in the case of dependencies(`vendor` AND `ui` folder). +You should edit the source files for assets or extend vendor dependencies. + +Adhering to the following process is the best way to get your work +included in the project: + +1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, + and configure the remotes: + + ```bash + # Clone your fork of the repo into the current directory + git clone https://github.com//wp-capsule-ui.git + # Navigate to the newly cloned directory + cd wp-capsule + # Assign the original repo to a remote called "upstream" + git remote add upstream https://github.com/crowdfavorite/wp-capsule-ui.git + ``` + +2. If you cloned a while ago, get the latest changes from upstream: + + ```bash + git checkout develop + git pull upstream develop + ``` + +3. Create a new topic branch (off the main project `develop` branch) to + contain your feature, change, or fix: + + ```bash + git checkout -b + ``` + +4. Commit your changes in logical chunks. Please adhere to these [git commit + message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) + or your code is unlikely be merged into the main project. Use Git's + [interactive rebase](https://help.github.com/articles/about-git-rebase/) + feature to tidy up your commits before making them public. + +5. Locally merge (or rebase) the upstream `develop` branch into your topic branch: + + ```bash + git pull [--rebase] upstream develop + ``` + +6. Push your topic branch up to your fork: + + ```bash + git push origin + ``` + +7. [Open a Pull Request](https://help.github.com/articles/about-pull-requests/) + with a clear title and description against the `develop` branch. + +**IMPORTANT**: By submitting a patch, you agree to allow the project owners to +license your work under the terms of the [GPLv2 License](../LICENSE). + + +## Code guidelines + +### PHP +WP Capsule repos follow an extended [PSR12 ruleset](../phpcs.xml) that includes WordPress Security sniffs with the added change of preffering tabs instead of spaces for indentation. +**You code should adhere to this ruleset.** + +### CSS +- Classes should be named following the [BEM conventions](http://getbem.com/naming/). +- Your compiled CSS should nest no more than 4 levels deep, preferably no more than 3 levels. +- Follow [ITCSS](https://www.creativebloq.com/web-design/manage-large-css-projects-itcss-101517528) principles for organizing styles. + +### JS +We adhere to the [AirBnB JavaScript Style Guide](https://github.com/airbnb/javascript) for project JavaScript code. [All rules apply](https://github.com/airbnb/javascript/blob/master/README.md#table-of-contents) with the following exceptions: +- Ignore rules related to IE8 support. We don't generally do it, and sometimes it can be useful to use a normal property overridden into a different one (such as a CSS styles object to pass to jQuery). +- Put all functions at the end of scope, possibly after a return. Doing this comes from the Angular guide, and makes it easier to follow a narrative flow of the code. We see the behaviors, then can quickly dig into the implementation if we wish to. (Credit to [John Papa's Angular Style guide](https://github.com/johnpapa/angular-styleguide) for this idea) + +### Checking coding style +Run `phpcs --standard=phpcs.xml` before committing to ensure your changes follow our coding standards. + +## License +By contributing your code, you agree to license your contribution under the [GPLv2 License](../LICENSE). \ No newline at end of file diff --git a/ui/.github/ISSUE_TEMPLATE/bug_report.md b/ui/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f0db3b7 --- /dev/null +++ b/ui/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,17 @@ +--- +name: Bug report +about: Tell us about a bug you may have identified in WP Capsule UI. +labels: bug +--- +Before opening: + +- [Search for duplicate or closed issues](https://github.com/crowdfavorite/wp-capsule-ui/issues?utf8=%E2%9C%93&q=is%3Aissue) +- Validate and [lint](https://github.com/crowdfavorite/wp-capsule-ui/blob/master/phpcs.xml) any PHP code to avoid common problems +- Read the [contributing guidelines](https://github.com/crowdfavorite/wp-capsule-ui/blob/master/.github/CONTRIBUTING.md) + +Bug reports must include: + +- Operating system and version (Windows, macOS, Android, iOS, Win10 Mobile) +- Browser and version (Chrome, Firefox, Safari, IE, MS Edge, Opera 15+, Android Browser) +- Serverstack(with versions) and WordPress environment(WP Capsule version, WordPress version, installed plugins, multi or single site) +- Ideally create or record a live example of the bug \ No newline at end of file diff --git a/ui/.github/ISSUE_TEMPLATE/feature_request.md b/ui/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..abd99ed --- /dev/null +++ b/ui/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,15 @@ +--- +name: Feature request +about: Suggest an idea for a new feature in WP Capsule UI. +labels: feature +--- + +Before opening: + +- [Search for duplicate or closed issues](https://github.com/crowdfavorite/wp-capsule-ui/issues?utf8=%E2%9C%93&q=is%3Aissue) +- Read the [contributing guidelines](https://github.com/crowdfavorite/wp-capsule-ui/blob/master/.github/CONTRIBUTING.md) + +Feature requests must include: + +- As much detail as possible for what we should add and why it's important to WP Capsule UI +- Relevant resources wherever possible \ No newline at end of file diff --git a/ui/.github/PULL_REQUEST_TEMPLATE.md b/ui/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..4e9dc60 --- /dev/null +++ b/ui/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Description + + + +## Testing instructions + + + +## Screenshots + + +## Checklist: +- [ ] I've tested the code. +- [ ] My code follows the WP Capsule UI custom PSR12 code style. +- [ ] My code follows the accessibility standards. +- [ ] My code follows the PHP DocBlock documentation standards. \ No newline at end of file diff --git a/ui/.github/SUPPORT.md b/ui/.github/SUPPORT.md new file mode 100644 index 0000000..c9258ad --- /dev/null +++ b/ui/.github/SUPPORT.md @@ -0,0 +1,7 @@ +### Bug reports + +See the [contributing guidelines](CONTRIBUTING.md) for sharing bug reports. + +### How-to + +For general troubleshooting or help getting started please open an issue in this repo and label it as "Question". \ No newline at end of file diff --git a/ui/.gitignore b/ui/.gitignore index c4e0f2a..e75903c 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -2,4 +2,5 @@ node_modules/ build/ composer/ composer.lock +package-lock.json !lib/ace/build/ \ No newline at end of file diff --git a/ui/CHANGELOG.txt b/ui/CHANGELOG.md similarity index 65% rename from ui/CHANGELOG.txt rename to ui/CHANGELOG.md index 2be89c8..d0ed3bd 100644 --- a/ui/CHANGELOG.txt +++ b/ui/CHANGELOG.md @@ -1,3 +1,17 @@ +## Version 1.3.0 +- fixed warning when editing posts in the backend +- replace icon +- rewrite URLs to SSL variants(https) +- PSR-12 code style enforce +- fixed a bug where projects and tags were being registered from codeblocks or docblocks +- fixed a bug where `` $` `` or `$'` broke the codeblock interface +- Added "open in new" icon to webfont files. Updated how icons are added. Improved accessibility of main menu and articles utility menu items. +- update issue templates to add labels +- update php-markdown lib to ignore parsing of heading tags without a space eg: #test +- added phpcs ruleset, license file, security policy, code of conduct, contributing guidelines, changelog file, templates for pull requests and issues, support information +- Replaced wp_redirect with wp_safe_redirect +- Replaced wp_remote_* with wp_safe_remote_* + ## Version 1.2 - remove the git submodules structure diff --git a/ui/CODE_OF_CONDUCT.md b/ui/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..442cf0a --- /dev/null +++ b/ui/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at security@crowdfavorite.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/ui/LICENSE b/ui/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/ui/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/ui/README.md b/ui/README.md index e4f18a9..faa5f54 100644 --- a/ui/README.md +++ b/ui/README.md @@ -4,6 +4,6 @@ The shared interface code for [Capsule](https://github.com/crowdfavorite/wp-caps ## Building for distribution -- Make sure [node.js and npm](http://nodejs.org/) are installed (tested with node.js 0.10.5). +- Make sure [node.js and npm](https://nodejs.org/) are installed (tested with node.js 0.10.5). - Run `npm install` from the top level directory (containing `package.json`) to install required node modules. - Run `npm run-script build` to minify and concatenate resources \ No newline at end of file diff --git a/ui/SECURITY.md b/ui/SECURITY.md new file mode 100644 index 0000000..f6e02e8 --- /dev/null +++ b/ui/SECURITY.md @@ -0,0 +1,7 @@ +# Reporting Security Issues + +The WP Capsule Server team and community take security issues in WP Capsule seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions. + +To report a security issue, email [security@crowdfavorite.com](mailto:security@crowdfavorite.com) and include the word "SECURITY" in the subject line. + +We'll endeavor to respond quickly, and will keep you updated throughout the process. \ No newline at end of file diff --git a/ui/assets/css/style.css b/ui/assets/css/style.css index acee9b2..81fa815 100644 --- a/ui/assets/css/style.css +++ b/ui/assets/css/style.css @@ -31,7 +31,7 @@ font-style: normal; font-weight: normal; src: url("../fonts/fontello/fontello.eot"); - src: url("../fonts/fontello/fontello.eot?#iefix") format("embedded-opentype"), url("../fonts/fontello/fontello.woff") format("woff"), url("../fonts/fontello/fontello.ttf") format("truetype"), url("../fonts/fontello/fontello.svg") format("svg"); } + src: url("../fonts/fontello/fontello.eot?#iefix") format("embedded-opentype"), url("../fonts/fontello/fontello.woff") format("woff"), url('../fonts/fontello/fontello.woff2') format('woff2'), url("../fonts/fontello/fontello.ttf") format("truetype"), url("../fonts/fontello/fontello.svg") format("svg"); } /* * HTML5 Boilerplate @@ -533,6 +533,61 @@ w height: 100%; width: 100%; } +.sr-only { + border: 0; + clip: rect(0, 0, 0, 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + width: auto; +} + +/* -------------------------------------------------- + * Icons +-------------------------------------------------- */ +[class^="capsule-icon-"]:before, [class*=" capsule-icon-"]:before { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: inline-block; + font-family: "Fontello"; + font-style: normal; + font-variant: normal; + font-weight: normal; + margin-left: .2em; + margin-right: .2em; + speak: none; + text-align: center; + text-decoration: inherit; + text-transform: none; + width: 1em; +} + +.capsule-icon-numbersign:before { content: '\e801'; } +.capsule-icon-star-empty:before { content: '\e802'; } +.capsule-icon-star-full:before { content: '\e803'; } +.capsule-icon-drive:before { content: '\e804'; } +.capsule-icon-edit:before { content: '\e805'; } +.capsule-icon-trash:before { content: '\e806'; } +.capsule-icon-globe:before { content: '\e807'; } +.capsule-icon-home:before { content: '\e808'; } +.capsule-icon-x-circle:before { content: '\e809'; } +.capsule-icon-plus-circle:before { content: '\e80a'; } +.capsule-icon-cog-wheel:before { content: '\e80b'; } +.capsule-icon-magnifying-glass:before { content: '\e80c'; } +.capsule-icon-open-in-new:before { content: '\e80e'; } +.capsule-icon-circle:before { content: '\e831'; } + #header { font-family: 'SourceSansProRegular'; margin: 0; } @@ -614,7 +669,7 @@ w /* Standard. IE9+ */ /** * @bugfix border-radius background bleed - * @see http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed + * @see https://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed */ -webkit-background-clip: padding-box; } #header .filter .chzn-container-active .chzn-single, @@ -777,7 +832,6 @@ ul.search_results { .main-nav a:hover, .main-nav a:visited { color: white; } .main-nav a.icon { - font-family: "Fontello"; font-size: 23px; -webkit-font-smoothing: subpixel-antialiased; } .main-nav a.projects { @@ -1028,7 +1082,6 @@ article { .post-menu span { display: none; height: 30px; - font-family: "Fontello"; font-size: 18px; text-align: center; text-decoration: none; @@ -1121,7 +1174,6 @@ nav.post-menu span.post-sticky-loading { article.edit header .post-close-link { color: white; - font-family: "Fontello"; font-size: 18px; height: 30px; overflow: hidden; @@ -1390,7 +1442,6 @@ article.edit header .post-close-link { .content .push-server-meta .trigger { cursor: pointer; display: block; - font-family: "Fontello"; font-size: 18px; height: 23px; position: relative; } diff --git a/ui/assets/fonts/fontello/config.json b/ui/assets/fonts/fontello/config.json new file mode 100755 index 0000000..0199925 --- /dev/null +++ b/ui/assets/fonts/fontello/config.json @@ -0,0 +1,220 @@ +{ + "name": "fontello", + "css_prefix_text": "icon-", + "css_use_suffix": false, + "hinting": true, + "units_per_em": 1000, + "ascent": 850, + "glyphs": [ + { + "uid": "9457d2e1407ae5e8d29a9d16555f0625", + "css": ".notdef", + "code": 59392, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M33 850V184H298V850H33ZM66 817H265V217H66V817Z", + "width": 364 + }, + "search": [ + ".notdef" + ] + }, + { + "uid": "0ad8d64031a583e031314aa6f1fd25f7", + "css": "numbersign", + "code": 59393, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M799 344H646L618 567H799V679H604L576 902H464L492 679H269L241 902H130L157 679H18V567H172L199 344H18V232H214L241 9H353L325 232H548L576 9H688L660 232H799V344ZM506 567L534 344H311L283 567H506Z", + "width": 817 + }, + "search": [ + "numbersign" + ] + }, + { + "uid": "1a55ca0667fe77d4960534150d33978a", + "css": "uniE02F", + "code": 59394, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M94 379L379 381 475 111 504 21Q543 143 621 385 684 386 810.5 388.5T1000 393Q948 430 845 503T691 613Q709 674 746 796T801 979Q742 934 629.5 852.5T494 754Q237 934 184 969 223 849 303 609 37 406 0 379H94ZM189 443L357 572 377 586Q362 629 336.5 708.5T303 811Q327 794 393 747.5T496 676Q532 704 602 754L686 814 625 611 619 590Q656 563 811 451L596 447 574 445Q563 413 551 376T524.5 293.5 502 223Q476 297 424 443H189Z", + "width": 1000 + }, + "search": [ + "uniE02F" + ] + }, + { + "uid": "b0a46319a7f9c2542421c0f6411fa779", + "css": "uniE031", + "code": 59395, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M0 379L379 381 504 21 621 385 1000 393 691 613 801 979 494 754 184 969 303 609Z", + "width": 1000 + }, + "search": [ + "uniE031" + ] + }, + { + "uid": "f7004ffa3b1a4778bc453ac4f3855700", + "css": "uniE0B4", + "code": 59396, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M0 611L199 74H801L1000 611 920 926H80ZM133 875H867L922 662H78ZM732 769Q732 752 744 740.5T772 729 800 740.5 812 769 800 797.5 772 809 744 797.5 732 769Z", + "width": 1000 + }, + "search": [ + "uniE0B4" + ] + }, + { + "uid": "008f1c6598ff8e5a966e8f44db512227", + "css": "uniE0BF", + "code": 59397, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M0 182L188 0H709V227L740 195 902 355 521 736 283 814 359 576 621 314V88H252V244H88V912H621V770L709 682V1000H0V182ZM361 736L480 697 400 615Z", + "width": 902 + }, + "search": [ + "uniE0BF" + ] + }, + { + "uid": "2af12bde980e58ae49c1ce7e109b7341", + "css": "uniE729", + "code": 59398, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M65 392Q186 462 395 462T725 392L671 878Q670 891 636 914 604 936 536 957T395 978Q331 978 262.5 959T155 914Q120 892 119 878ZM553 92Q647 110 711 147T775 218V228Q775 287 663 327 549 368 395 368T127 327Q15 287 15 228V218Q15 184 79 147T237 92L279 44Q302 18 349 18H441Q493 18 511 44ZM499 204H583Q488 90 479 78 466 62 447 62H345Q323 62 313 78L207 204H291L355 138H437Z", + "width": 790 + }, + "search": [ + "uniE729" + ] + }, + { + "uid": "c038e60221b3e6866cd53b14d38e98b6", + "css": "uniE776", + "code": 59399, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M197 356Q146 300 105 228 160 153 233 110 322 147 385 192 379 208 379 224 379 231 383 246 321 294 267 350 252 346 239 346 216 346 197 356ZM161 504Q100 620 81 736 15 630 15 500 15 391 65 294 104 358 149 406 141 432 141 444 141 478 161 504ZM427 140Q371 100 313 70 397 40 475 40 595 40 705 102 631 115 543 152 517 126 477 126 450 126 427 140ZM333 474Q337 457 337 444 337 422 323 392 359 350 421 302 447 322 477 322 489 322 515 314 608 420 649 554 635 565 623 586 463 562 333 474ZM753 774Q753 768 752 746T751 718Q788 704 805 658 864 654 913 640 866 787 747 872 753 824 753 774ZM297 924Q207 888 139 814 151 672 219 540 227 542 239 542 268 542 291 528 436 627 601 652 412 747 297 924ZM935 500Q935 527 931 566 866 584 801 590 777 534 713 530 665 384 565 266 575 247 575 224V214Q676 172 785 160 935 296 935 500ZM649 704Q662 714 681 722 683 746 683 774 683 851 669 918 584 960 475 960 417 960 363 948 472 789 649 704Z", + "width": 950 + }, + "search": [ + "uniE776" + ] + }, + { + "uid": "ea429838338fb7a0d4f8ca963385f76a", + "css": "uniE800", + "code": 59400, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M903 514Q918 529 914 540.5T887 552H803V862Q803 884 797 893T771 902H567V592H363V902H169Q144 902 135.5 894T127 862V552H43Q20 552 16 540.5T27 514L427 112Q443 96 465 96T503 112Z", + "width": 930 + }, + "search": [ + "uniE800" + ] + }, + { + "uid": "ee7977150cfc6c79973da9d264d7673e", + "css": "uniE801", + "code": 59401, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M464.5 9Q649 9 780 140T911 455.5 780 771 464.5 902 149 771 18 455.5 149 140 464.5 9ZM685 597L544 455 685 314 606 235 464 376 323 235 244 314 385 455 244 597 323 676 464 535 606 676Z", + "width": 928 + }, + "search": [ + "uniE801" + ] + }, + { + "uid": "447e16575c1e6c9678667a2dbef5705f", + "css": "uniE804", + "code": 59402, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M914 450Q914 580 851 681T689 840Q586 900 464 900 334 900 232.5 837T74 676Q14 572 14 450 14 320 77 219T238 60Q341 0 464 0 593 0 694.5 63T853 224Q914 328 914 450ZM518 502H729V396H518V184H411V396H199V502H411V715H518V502Z", + "width": 927 + }, + "search": [ + "uniE804" + ] + }, + { + "uid": "d119e19b55653d965b415defbd7204fc", + "css": "uniE808", + "code": 59403, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M911 511L778 567Q770 589 766 598L821 731 742 809 607 757Q598 761 576 769L521 902H409L353 770Q342 766 320 757L188 811 110 733 163 599Q162 596 158.5 589.5T152.5 577.5 149 567L18 512V400L149 344 163 311 109 179 187 100 320 154Q342 145 353 141L408 9H520L576 141Q590 146 607 154L740 99 820 178 766 313Q772 325 778 343L911 399V511ZM463.5 622Q533 622 582 573.5T631 455.5 582 336.5 463.5 287 345 336.5 296 455.5 345 573.5 463.5 622Z", + "width": 928 + }, + "search": [ + "uniE808" + ] + }, + { + "uid": "723f4e83397d1998f3487712e780a29b", + "css": "uniE831", + "code": 59441, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M78 710Q74 713 67.5 711.5T60 705Q36 655 24 593-6 437 59 294 64 282 76 290L156 349Q165 354 160 363 135 426 135 498.5T161 641Q164 649 158 654ZM180 131Q225 91 278 62 420-16 575 2 588 4 584 17L553 111Q550 121 540 119 502 116 460 123 353 140 274 206 267 211 260 206L181 149Q170 141 180 131ZM769 66Q861 118 926.5 205T1014 398Q1016 411 1003 411V412L903 411Q894 411 892 401 855 259 726 177 718 172 721 164L752 73Q754 68 759 65.5T769 66ZM1013 601Q999 664 976 713 908 858 771 935 766 938 761 935.5T754 928Q749 913 739 881T724 834Q721 825 730 820 789 783 832 724T893 595Q895 586 904 586L1002 587Q1013 587 1013 599V601ZM575 996Q513 1002 456 995 295 976 180 871 176 867 176.5 861.5T181 853L262 796Q271 790 278 797 311 824 344 840 437 887 544 881 553 881 556 889L585 981Q589 994 575 996Z", + "width": 1030 + }, + "search": [ + "uniE831" + ] + }, + { + "uid": "b927480caa860f0b27a4c5a61bbef9ae", + "css": "u1F50D", + "code": 59404, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M914 806L819 900 590 671Q495 736 382 736 230 736 122 628T14 368 122 108 382 0 642 108 750 368Q750 482 685 576ZM626 368Q626 266 554 194T382 122Q280 122 208 194T136 368 208 542Q279 613 382 613 483 613 554 542 626 470 626 368Z", + "width": 927 + }, + "search": [ + "u1F50D" + ] + }, + { + "uid": "8f7d5a1d4529c8e830b549a7ad403207", + "css": "open-in-new", + "code": 59406, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M583.3 125V208.3H732.9L323.3 617.9 382.1 676.7 791.7 267.1V416.7H875V125M791.7 791.7H208.3V208.3H500V125H208.3C162.1 125 125 162.5 125 208.3V791.7C125 837.5 162.5 875 208.3 875H791.7C837.5 875 875 837.5 875 791.7V500H791.7V791.7Z", + "width": 1000 + }, + "search": [ + "open-in-new" + ] + } + ] +} \ No newline at end of file diff --git a/ui/assets/fonts/fontello/fontello.eot b/ui/assets/fonts/fontello/fontello.eot index bdc0df9..e69de29 100644 Binary files a/ui/assets/fonts/fontello/fontello.eot and b/ui/assets/fonts/fontello/fontello.eot differ diff --git a/ui/assets/fonts/fontello/fontello.svg b/ui/assets/fonts/fontello/fontello.svg index 8d6c320..3fae53a 100644 --- a/ui/assets/fonts/fontello/fontello.svg +++ b/ui/assets/fonts/fontello/fontello.svg @@ -1,67 +1,40 @@ - + - -Created by FontForge 20110222 at Tue Apr 16 19:09:37 2013 - By root -Copyright (C) 2012 by original authors @ fontello.com - +Copyright (C) 2020 by original authors @ fontello.com - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ui/assets/fonts/fontello/fontello.ttf b/ui/assets/fonts/fontello/fontello.ttf index 55d6b9d..40e1cc3 100644 Binary files a/ui/assets/fonts/fontello/fontello.ttf and b/ui/assets/fonts/fontello/fontello.ttf differ diff --git a/ui/assets/fonts/fontello/fontello.woff b/ui/assets/fonts/fontello/fontello.woff index a7e8db0..e69de29 100644 Binary files a/ui/assets/fonts/fontello/fontello.woff and b/ui/assets/fonts/fontello/fontello.woff differ diff --git a/ui/assets/fonts/fontello/fontello.woff2 b/ui/assets/fonts/fontello/fontello.woff2 new file mode 100644 index 0000000..e69de29 diff --git a/ui/assets/icon/capsule-128.png b/ui/assets/icon/capsule-128.png index 6f20f1b..6584786 100644 Binary files a/ui/assets/icon/capsule-128.png and b/ui/assets/icon/capsule-128.png differ diff --git a/ui/assets/icon/capsule-128@2x.png b/ui/assets/icon/capsule-128@2x.png deleted file mode 100644 index 6be3122..0000000 Binary files a/ui/assets/icon/capsule-128@2x.png and /dev/null differ diff --git a/ui/assets/icon/capsule-16.png b/ui/assets/icon/capsule-16.png index b827628..9686003 100644 Binary files a/ui/assets/icon/capsule-16.png and b/ui/assets/icon/capsule-16.png differ diff --git a/ui/assets/icon/capsule-16@2x.png b/ui/assets/icon/capsule-16@2x.png deleted file mode 100644 index 9a38b91..0000000 Binary files a/ui/assets/icon/capsule-16@2x.png and /dev/null differ diff --git a/ui/assets/icon/capsule-256.png b/ui/assets/icon/capsule-256.png index 6be3122..775f036 100644 Binary files a/ui/assets/icon/capsule-256.png and b/ui/assets/icon/capsule-256.png differ diff --git a/ui/assets/icon/capsule-256@2x.png b/ui/assets/icon/capsule-256@2x.png deleted file mode 100644 index 45efc81..0000000 Binary files a/ui/assets/icon/capsule-256@2x.png and /dev/null differ diff --git a/ui/assets/icon/capsule-32.png b/ui/assets/icon/capsule-32.png index 9a38b91..c7ece1b 100644 Binary files a/ui/assets/icon/capsule-32.png and b/ui/assets/icon/capsule-32.png differ diff --git a/ui/assets/icon/capsule-32@2x.png b/ui/assets/icon/capsule-32@2x.png deleted file mode 100644 index f915c44..0000000 Binary files a/ui/assets/icon/capsule-32@2x.png and /dev/null differ diff --git a/ui/assets/icon/capsule-48.png b/ui/assets/icon/capsule-48.png index 1346172..2aaea76 100644 Binary files a/ui/assets/icon/capsule-48.png and b/ui/assets/icon/capsule-48.png differ diff --git a/ui/assets/icon/capsule-512.png b/ui/assets/icon/capsule-512.png deleted file mode 100644 index 45efc81..0000000 Binary files a/ui/assets/icon/capsule-512.png and /dev/null differ diff --git a/ui/assets/icon/capsule.icns b/ui/assets/icon/capsule.icns deleted file mode 100644 index 21391e2..0000000 Binary files a/ui/assets/icon/capsule.icns and /dev/null differ diff --git a/ui/assets/icon/capsule.ico b/ui/assets/icon/capsule.ico deleted file mode 100644 index 873d59a..0000000 Binary files a/ui/assets/icon/capsule.ico and /dev/null differ diff --git a/ui/assets/js/capsule.js b/ui/assets/js/capsule.js index 01703a2..c9becbe 100644 --- a/ui/assets/js/capsule.js +++ b/ui/assets/js/capsule.js @@ -1,14 +1,15 @@ -define('cf/js/capsule', ['require', 'exports', 'module', +define('cf/js/capsule', ['require', 'exports', 'module', 'jquery', - 'ace/ace', - 'ace/mode/text', 'ace/lib/dom', 'ace/tokenizer', - 'cf/js/syntax/cf_php_highlight_rules', 'cf/js/syntax/cfmarkdown', + 'ace/ace', + 'ace/mode/text', 'ace/lib/dom', 'ace/tokenizer', + 'cf/js/syntax/cf_php_highlight_rules', 'cf/js/syntax/cfmarkdown', 'cf/js/syntax/cfsh', 'cf/js/static_highlight', 'ace/theme/textmate' - ], + ], function(require, exports, module, $) { "use strict"; var ace = require('ace/ace'); var aceconfig = require('ace/config'); + aceconfig.set('packaged', true); aceconfig.set('basePath', requirejsL10n.ace + '/build/src-min'); window.editors = {}, @@ -21,7 +22,7 @@ function(require, exports, module, $) { } return '
' + text + '
'; }; - + Capsule.authCheck = function(response) { if (typeof response.result != 'undefined' && response.result == 'unauthorized') { alert(response.msg); @@ -30,7 +31,7 @@ function(require, exports, module, $) { } return true; }; - + Capsule.get = function(url, args, callback, type) { $.get(url, args, function(response) { if (Capsule.authCheck(response)) { @@ -38,7 +39,7 @@ function(require, exports, module, $) { } }, type); }; - + Capsule.post = function(url, args, callback, type) { $.post(url, args, function(response) { if (Capsule.authCheck(response)) { @@ -46,7 +47,7 @@ function(require, exports, module, $) { } }, type); }; - + Capsule.loadExcerpt = function($article, postId) { $article.addClass('unstyled').children().addClass('transparent').end() .append(Capsule.spinner()); @@ -96,7 +97,7 @@ function(require, exports, module, $) { 'json' ); }; - + Capsule.createPost = function($article) { $article.addClass('unstyled').children().addClass('transparent').end() .append(Capsule.spinner()); @@ -116,7 +117,7 @@ function(require, exports, module, $) { 'json' ); }; - + Capsule.watchForEditorChanges = function(postId, $article, suppress_time_display) { if (typeof $article == 'undefined') { $article = $('#post-edit-' + postId); @@ -167,7 +168,8 @@ function(require, exports, module, $) { $article.addClass('saving'); } // strip code blocks before extracting projects and tags - var prose = content.replace(/^```([^]+?)^```/mg, '') + var prose = content.replace(/^```([\s\S]+)^```/mg, '') + .replace(/^\/\*([\s\S]+)^\*\//mg, '') .replace(/
([^]+?)<\/pre>/mg, '')
 				.replace(/([^]+?)<\/code>/mg, ''),
 			projects = twttr.txt.extractMentions(prose),
@@ -225,7 +227,7 @@ function(require, exports, module, $) {
 			'json'
 		);
 	};
-	
+
 	Capsule.undeletePost = function(postId, $article) {
 		$article.addClass('unstyled').children().addClass('transparent').end()
 			.append(Capsule.spinner());
@@ -250,7 +252,7 @@ function(require, exports, module, $) {
 			'json'
 		);
 	};
-	
+
 	Capsule.stickPost = function(postId, $article) {
 		$article.addClass('sticky-loading');
 		Capsule.post(
@@ -270,7 +272,7 @@ function(require, exports, module, $) {
 			'json'
 		);
 	};
-	
+
 	Capsule.unstickPost = function(postId, $article) {
 		$article.addClass('sticky-loading');
 		Capsule.post(
@@ -292,7 +294,7 @@ function(require, exports, module, $) {
 			'json'
 		);
 	};
-	
+
 	Capsule.initEditor = function(postId, content) {
 		window.Capsule.CFMarkdownMode = require("cf/js/syntax/cfmarkdown").Mode;
 		window.editors[postId] = ace.edit('ace-editor-' + postId);
@@ -360,7 +362,7 @@ function(require, exports, module, $) {
 		Capsule.watchForEditorChanges(postId, undefined, true);
 		window.editors[postId].focus();
 	};
-	
+
 	Capsule.sizeEditor = function() {
 		$('.ace-editor:not(.resized)').each(function() {
 			$(this).height(
@@ -378,7 +380,7 @@ function(require, exports, module, $) {
 			}
 		});
 	};
-	
+
 	Capsule.extractCodeLanguages = function(content) {
 		var block = new RegExp("^```[a-zA-Z]+\\s*$", "gm"),
 			tag = new RegExp("[a-zA-Z]+", ""),
@@ -391,13 +393,13 @@ function(require, exports, module, $) {
 		}
 		return tags;
 	};
-	
+
 	Capsule.postExpandable = function($article) {
 		if ($article.find('.post-content:first')[0].scrollHeight > $article[0].scrollHeight) {
 			$article.addClass('toggleable');
 		}
 	};
-	
+
 	Capsule.highlightCodeSyntax = function($elem) {
 		if (typeof $elem == 'undefined') {
 			$elem = $('article:not(.edit) .post-content');
@@ -405,7 +407,7 @@ function(require, exports, module, $) {
 		$elem.each(function() {
 			var block = $(this);
 			block.find("pre>code").each(function(i) {
-				var el = $(this), 
+				var el = $(this),
 					data, lang, requirelang,
 					newlines = [""];
 				// markdown uses 
for leading blank @@ -419,7 +421,7 @@ function(require, exports, module, $) { if (data.substr(-1) === "\n") { data = data.substr(0, data.length - 1); } - + lang = el.attr('class'); if (lang) { lang = lang.match(/language-([-_a-z0-9]+)/i); @@ -434,7 +436,7 @@ function(require, exports, module, $) { lang = "code"; } if (lang === "code" || lang === "bash") { - requirelang = "text"; + requirelang = "cfsh"; } else { requirelang = lang; @@ -453,12 +455,12 @@ function(require, exports, module, $) { } highlighted = highlighter.render(data, mode, theme, 1, lang); el.closest("pre").replaceWith(highlighted.html); - } + } }; - + var namespacedLang = ('cfsh' === requirelang) ? 'cf/js/syntax/cfsh' : 'ace/mode/' + requirelang; var requirements = [ - 'cf/js/static_highlight', 'ace/theme/textmate', - 'ace/mode/' + requirelang, 'ace/lib/dom', 'ace/tokenizer', + 'cf/js/static_highlight', 'ace/theme/textmate', + namespacedLang, 'ace/lib/dom', 'ace/tokenizer', 'cf/js/syntax/cf_php_highlight_rules' ]; require(requirements, @@ -613,6 +615,7 @@ function(require, exports, module, $) { source: '#tags' }).end().find('.servers').sidr({ name: 'sidr-servers', + renaming: false, source: '#servers' }); $(':not(.edit) .post-content').linkify(); diff --git a/ui/assets/js/optimized.js b/ui/assets/js/optimized.js index 7b244e9..c1e9b98 100644 --- a/ui/assets/js/optimized.js +++ b/ui/assets/js/optimized.js @@ -20,15 +20,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA */ /*** lib/require.js ***/ -var requirejs,require,define;!function(global){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.1.1",commentRegExp=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,ap=Array.prototype,aps=ap.slice,apsp=ap.splice,isBrowser=!("undefined"==typeof window||!navigator||!document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i":">","<":"<",'"':""","'":"'"};function t(t,e){return e=e||"","string"!=typeof t&&(t.global&&e.indexOf("g")<0&&(e+="g"),t.ignoreCase&&e.indexOf("i")<0&&(e+="i"),t.multiline&&e.indexOf("m")<0&&(e+="m"),t=t.source),new RegExp(t.replace(/#\{(\w+)\}/g,function(t,e){var r=twttr.txt.regexen[e]||"";return"string"!=typeof r&&(r=r.source),r}),e)}function s(t,r){return t.replace(/#\{(\w+)\}/g,function(t,e){return r[e]||""})}function r(t,e,r){var a=String.fromCharCode(e);return r!==e&&(a+="-"+String.fromCharCode(r)),t.push(a),t}twttr.txt.htmlEscape=function(t){return t&&t.replace(/[&"'><]/g,function(t){return e[t]})},twttr.txt.regexSupplant=t,twttr.txt.stringSupplant=s,twttr.txt.addCharsToCharClass=r;var a=String.fromCharCode,n=[a(32),a(133),a(160),a(5760),a(6158),a(8232),a(8233),a(8239),a(8287),a(12288)];r(n,9,13),r(n,8192,8202);var i=[a(65534),a(65279),a(65535)];r(i,8234,8238),twttr.txt.regexen.spaces_group=t(n.join("")),twttr.txt.regexen.spaces=t("["+n.join("")+"]"),twttr.txt.regexen.invalid_chars_group=t(i.join("")),twttr.txt.regexen.punct=/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$/;var l=[];r(l,1024,1279),r(l,1280,1319),r(l,11744,11775),r(l,42560,42655),r(l,1425,1471),r(l,1473,1474),r(l,1476,1477),r(l,1479,1479),r(l,1488,1514),r(l,1520,1524),r(l,64274,64296),r(l,64298,64310),r(l,64312,64316),r(l,64318,64318),r(l,64320,64321),r(l,64323,64324),r(l,64326,64335),r(l,1552,1562),r(l,1568,1631),r(l,1646,1747),r(l,1749,1756),r(l,1758,1768),r(l,1770,1775),r(l,1786,1788),r(l,1791,1791),r(l,1872,1919),r(l,2208,2208),r(l,2210,2220),r(l,2276,2302),r(l,64336,64433),r(l,64467,64829),r(l,64848,64911),r(l,64914,64967),r(l,65008,65019),r(l,65136,65140),r(l,65142,65276),r(l,8204,8204),r(l,3585,3642),r(l,3648,3662),r(l,4352,4607),r(l,12592,12677),r(l,43360,43391),r(l,44032,55215),r(l,55216,55295),r(l,65441,65500),r(l,12449,12538),r(l,12540,12542),r(l,65382,65439),r(l,65392,65392),r(l,65296,65305),r(l,65313,65338),r(l,65345,65370),r(l,12353,12438),r(l,12441,12446),r(l,13312,19903),r(l,19968,40959),r(l,173824,177983),r(l,177984,178207),r(l,194560,195103),r(l,12291,12291),r(l,12293,12293),r(l,12347,12347),twttr.txt.regexen.nonLatinHashtagChars=t(l.join(""));var o=[];r(o,192,214),r(o,216,246),r(o,248,255),r(o,256,591),r(o,595,596),r(o,598,599),r(o,601,601),r(o,603,603),r(o,611,611),r(o,616,616),r(o,623,623),r(o,626,626),r(o,649,649),r(o,651,651),r(o,699,699),r(o,768,879),r(o,7680,7935),twttr.txt.regexen.latinAccentChars=t(o.join("")),twttr.txt.regexen.hashSigns=/[##]/,twttr.txt.regexen.hashtagAlpha=t(/[a-z_#{latinAccentChars}#{nonLatinHashtagChars}]/i),twttr.txt.regexen.hashtagAlphaNumeric=t(/[a-z0-9_#.\-{latinAccentChars}#{nonLatinHashtagChars}]/i),twttr.txt.regexen.endHashtagMatch=t(/^(?:#{hashSigns}|:\/\/)/),twttr.txt.regexen.hashtagBoundary=t(/(?:^|$|[^&a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}])/),twttr.txt.regexen.validHashtag=t(/(#{hashtagBoundary})(#{hashSigns})(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)/gi),twttr.txt.regexen.validMentionPrecedingChars=/(?:^|[^a-zA-Z0-9_!#$%&*@@]|RT:?)/,twttr.txt.regexen.atSigns=/[@@]/,twttr.txt.regexen.validMentionOrList=t("(#{validMentionPrecedingChars})(#{atSigns})([a-zA-Z0-9_.-]{1,20})(/[a-zA-Z][a-zA-Z0-9_]{0,24})?","g"),twttr.txt.regexen.validReply=t(/^(?:#{spaces})*#{atSigns}([a-zA-Z0-9_.\-]{1,20})/),twttr.txt.regexen.endMentionMatch=t(/^(?:#{atSigns}|[#{latinAccentChars}]|:\/\/)/),twttr.txt.regexen.validUrlPrecedingChars=t(/(?:[^A-Za-z0-9@@$###{invalid_chars_group}]|^)/),twttr.txt.regexen.invalidUrlWithoutProtocolPrecedingChars=/[-_.\/]$/,twttr.txt.regexen.invalidDomainChars=s("#{punct}#{spaces_group}#{invalid_chars_group}",twttr.txt.regexen),twttr.txt.regexen.validDomainChars=t(/[^#{invalidDomainChars}]/),twttr.txt.regexen.validSubdomain=t(/(?:(?:#{validDomainChars}(?:[_-]|#{validDomainChars})*)?#{validDomainChars}\.)/),twttr.txt.regexen.validDomainName=t(/(?:(?:#{validDomainChars}(?:-|#{validDomainChars})*)?#{validDomainChars}\.)/),twttr.txt.regexen.validGTLD=t(/(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx)(?=[^0-9a-zA-Z]|$))/),twttr.txt.regexen.validCCTLD=t(/(?:(?:ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)(?=[^0-9a-zA-Z]|$))/),twttr.txt.regexen.validPunycode=t(/(?:xn--[0-9a-z]+)/),twttr.txt.regexen.validDomain=t(/(?:#{validSubdomain}*#{validDomainName}(?:#{validGTLD}|#{validCCTLD}|#{validPunycode}))/),twttr.txt.regexen.validAsciiDomain=t(/(?:(?:[a-z0-9#{latinAccentChars}]+)\.)+(?:#{validGTLD}|#{validCCTLD}|#{validPunycode})/gi),twttr.txt.regexen.invalidShortDomain=t(/^#{validDomainName}#{validCCTLD}$/),twttr.txt.regexen.validPortNumber=t(/[0-9]+/),twttr.txt.regexen.validGeneralUrlPathChars=t(/[a-z0-9!\*';:=\+,\.\$\/%#\[\]\-_~|&#{latinAccentChars}]/i),twttr.txt.regexen.validUrlBalancedParens=t(/\(#{validGeneralUrlPathChars}+\)/i),twttr.txt.regexen.validUrlPathEndingChars=t(/[\+\-a-z0-9=_#\/#{latinAccentChars}]|(?:#{validUrlBalancedParens})/i),twttr.txt.regexen.validUrlPath=t("(?:(?:#{validGeneralUrlPathChars}*(?:#{validUrlBalancedParens}#{validGeneralUrlPathChars}*)*#{validUrlPathEndingChars})|(?:@#{validGeneralUrlPathChars}+/))","i"),twttr.txt.regexen.validUrlQueryChars=/[a-z0-9!?\*'\(\);:&=\+\$\/%#\[\]\-_\.,~|]/i,twttr.txt.regexen.validUrlQueryEndingChars=/[a-z0-9_&=#\/]/i,twttr.txt.regexen.extractUrl=t("((#{validUrlPrecedingChars})((https?:\\/\\/)?(#{validDomain})(?::(#{validPortNumber}))?(\\/#{validUrlPath}*)?(\\?#{validUrlQueryChars}*#{validUrlQueryEndingChars})?))","gi"),twttr.txt.regexen.validTcoUrl=/^https?:\/\/t\.co\/[a-z0-9]+/i,twttr.txt.regexen.validateUrlUnreserved=/[a-z0-9\-._~]/i,twttr.txt.regexen.validateUrlPctEncoded=/(?:%[0-9a-f]{2})/i,twttr.txt.regexen.validateUrlSubDelims=/[!$&'()*+,;=]/i,twttr.txt.regexen.validateUrlPchar=t("(?:#{validateUrlUnreserved}|#{validateUrlPctEncoded}|#{validateUrlSubDelims}|[:|@])","i"),twttr.txt.regexen.validateUrlScheme=/(?:[a-z][a-z0-9+\-.]*)/i,twttr.txt.regexen.validateUrlUserinfo=t("(?:#{validateUrlUnreserved}|#{validateUrlPctEncoded}|#{validateUrlSubDelims}|:)*","i"),twttr.txt.regexen.validateUrlDecOctet=/(?:[0-9]|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5]))/i,twttr.txt.regexen.validateUrlIpv4=t(/(?:#{validateUrlDecOctet}(?:\.#{validateUrlDecOctet}){3})/i),twttr.txt.regexen.validateUrlIpv6=/(?:\[[a-f0-9:\.]+\])/i,twttr.txt.regexen.validateUrlIp=t("(?:#{validateUrlIpv4}|#{validateUrlIpv6})","i"),twttr.txt.regexen.validateUrlSubDomainSegment=/(?:[a-z0-9](?:[a-z0-9_\-]*[a-z0-9])?)/i,twttr.txt.regexen.validateUrlDomainSegment=/(?:[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?)/i,twttr.txt.regexen.validateUrlDomainTld=/(?:[a-z](?:[a-z0-9\-]*[a-z0-9])?)/i,twttr.txt.regexen.validateUrlDomain=t(/(?:(?:#{validateUrlSubDomainSegment]}\.)*(?:#{validateUrlDomainSegment]}\.)#{validateUrlDomainTld})/i),twttr.txt.regexen.validateUrlHost=t("(?:#{validateUrlIp}|#{validateUrlDomain})","i"),twttr.txt.regexen.validateUrlUnicodeSubDomainSegment=/(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9_\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,twttr.txt.regexen.validateUrlUnicodeDomainSegment=/(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,twttr.txt.regexen.validateUrlUnicodeDomainTld=/(?:(?:[a-z]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,twttr.txt.regexen.validateUrlUnicodeDomain=t(/(?:(?:#{validateUrlUnicodeSubDomainSegment}\.)*(?:#{validateUrlUnicodeDomainSegment}\.)#{validateUrlUnicodeDomainTld})/i),twttr.txt.regexen.validateUrlUnicodeHost=t("(?:#{validateUrlIp}|#{validateUrlUnicodeDomain})","i"),twttr.txt.regexen.validateUrlPort=/[0-9]{1,5}/,twttr.txt.regexen.validateUrlUnicodeAuthority=t("(?:(#{validateUrlUserinfo})@)?(#{validateUrlUnicodeHost})(?::(#{validateUrlPort}))?","i"),twttr.txt.regexen.validateUrlAuthority=t("(?:(#{validateUrlUserinfo})@)?(#{validateUrlHost})(?::(#{validateUrlPort}))?","i"),twttr.txt.regexen.validateUrlPath=t(/(\/#{validateUrlPchar}*)*/i),twttr.txt.regexen.validateUrlQuery=t(/(#{validateUrlPchar}|\/|\?)*/i),twttr.txt.regexen.validateUrlFragment=t(/(#{validateUrlPchar}|\/|\?)*/i),twttr.txt.regexen.validateUrlUnencoded=t("^(?:([^:/?#]+):\\/\\/)?([^/?#]*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$","i");var c=' rel="nofollow"',x={urlClass:!0,listClass:!0,usernameClass:!0,hashtagClass:!0,usernameUrlBase:!0,listUrlBase:!0,hashtagUrlBase:!0,usernameUrlBlock:!0,listUrlBlock:!0,hashtagUrlBlock:!0,linkUrlBlock:!0,usernameIncludeSymbol:!0,suppressLists:!0,suppressNoFollow:!0,suppressDataScreenName:!0,urlEntities:!0,before:!0},h={disabled:!0,readonly:!0,multiple:!0,checked:!0};twttr.txt.linkToHashtag=function(t,e,r){var a={hash:e.substring(t.indices[0],t.indices[0]+1),preText:"",text:twttr.txt.htmlEscape(t.hashtag),postText:"",extraHtml:r.suppressNoFollow?"":c};for(var n in r)r.hasOwnProperty(n)&&(a[n]=r[n]);return s('#{before}#{hash}#{preText}#{text}#{postText}',a)},twttr.txt.linkToMentionAndList=function(t,e,r){var a=e.substring(t.indices[0],t.indices[0]+1),n={at:r.usernameIncludeSymbol?"":a,at_before_user:r.usernameIncludeSymbol?a:"",user:twttr.txt.htmlEscape(t.screenName),slashListname:twttr.txt.htmlEscape(t.listSlug),extraHtml:r.suppressNoFollow?"":c,preChunk:"",postChunk:""};for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);if(t.listSlug&&!r.suppressLists){var l=n.chunk=s("#{user}#{slashListname}",n);return n.list=twttr.txt.htmlEscape(l.toLowerCase()),s('#{before}#{at}#{preChunk}#{at_before_user}#{chunk}#{postChunk}',n)}return n.chunk=n.user,n.dataScreenName=r.suppressDataScreenName?"":s('data-screen-name="#{chunk}" ',n),s('#{before}#{at}#{preChunk}#{at_before_user}#{chunk}#{postChunk}',n)},twttr.txt.linkToUrl=function(t,e,r){var a=t.url,n=a,i=twttr.txt.htmlEscape(n),l=r.urlEntities&&r.urlEntities[a]||t;return l.display_url&&(r.title||(r.htmlAttrs=(r.htmlAttrs||"")+' title="'+l.expanded_url+'"'),i=twttr.txt.linkTextWithEntity(l,r)),s('#{linkText}',{htmlAttrs:r.htmlAttrs,url:twttr.txt.htmlEscape(a),linkText:i})},twttr.txt.linkTextWithEntity=function(t,e){var r=t.display_url,a=t.expanded_url,n=r.replace(/…/g,"");if(-1!=a.indexOf(n)){var i=a.indexOf(n),l={displayUrlSansEllipses:n,beforeDisplayUrl:a.substr(0,i),afterDisplayUrl:a.substr(i+n.length),precedingEllipsis:r.match(/^…/)?"…":"",followingEllipsis:r.match(/…$/)?"…":""};return $.each(l,function(t,e){l[t]=twttr.txt.htmlEscape(e)}),l.invisible=e.invisibleTagAttrs,s("#{precedingEllipsis} #{beforeDisplayUrl}#{displayUrlSansEllipses}#{afterDisplayUrl} #{followingEllipsis}",l)}return r},twttr.txt.autoLinkEntities=function(t,e,r){var a,n;if((r=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(r||{})).suppressNoFollow||(r.rel="nofollow"),r.urlClass&&(r.class=r.urlClass),r.urlClass=r.urlClass||"tweet-url",r.hashtagClass=r.hashtagClass||"hashtag",r.hashtagUrlBase=r.hashtagUrlBase||"https://twitter.com/#!/search?q=%23",r.listClass=r.listClass||"list-slug",r.usernameClass=r.usernameClass||"username",r.usernameUrlBase=r.usernameUrlBase||"https://twitter.com/",r.listUrlBase=r.listUrlBase||"https://twitter.com/",r.before=r.before||"",r.htmlAttrs=twttr.txt.extractHtmlAttrsFromOptions(r),r.invisibleTagAttrs=r.invisibleTagAttrs||"style='position:absolute;left:-9999px;'",r.urlEntities){for(a={},s=0,n=r.urlEntities.length;st[r].indices[0]?(t.splice(r,1),r--):e=t[r]},twttr.txt.extractEntitiesWithIndices=function(t,e){var r=twttr.txt.extractUrlsWithIndices(t,e).concat(twttr.txt.extractMentionsOrListsWithIndices(t)).concat(twttr.txt.extractHashtagsWithIndices(t,{checkUrlOverlap:!1}));return 0==r.length?[]:(twttr.txt.removeOverlappingEntities(r),r)},twttr.txt.extractMentions=function(t){for(var e=[],r=twttr.txt.extractMentionsWithIndices(t),a=0;a");for(var l=0;l",""],u=twttr.txt.splitTags(t),d="",g=0,v=u[0],w=0,m=0,p=!1,f=v,U=[];for(a=0;a=w+v.length;)d+=f.slice(m),p&&l===w+f.length&&(d+=s,o=!0),u[g+1]&&(d+="<"+u[g+1]+">"),w+=f.length,m=0,f=v=u[g+=2],p=!1;o||null==v?o||(o=!0,d+=s):(c=l-w,d+=f.slice(m,c)+s,m=c,p=i%2==0)}if(null!=v)for(m";return d};var u=[a(65534),a(65279),a(65535),a(8234),a(8235),a(8236),a(8237),a(8238)];twttr.txt.isInvalidTweet=function(t){if(!t)return"empty";if(140":">","<":"<",'"':""","'":"'"};function t(t,e){return e=e||"","string"!=typeof t&&(t.global&&e.indexOf("g")<0&&(e+="g"),t.ignoreCase&&e.indexOf("i")<0&&(e+="i"),t.multiline&&e.indexOf("m")<0&&(e+="m"),t=t.source),new RegExp(t.replace(/#\{(\w+)\}/g,function(t,e){var r=twttr.txt.regexen[e]||"";return"string"!=typeof r&&(r=r.source),r}),e)}function s(t,r){return t.replace(/#\{(\w+)\}/g,function(t,e){return r[e]||""})}function r(t,e,r){var a=String.fromCharCode(e);return r!==e&&(a+="-"+String.fromCharCode(r)),t.push(a),t}twttr.txt.htmlEscape=function(t){return t&&t.replace(/[&"'><]/g,function(t){return e[t]})},twttr.txt.regexSupplant=t,twttr.txt.stringSupplant=s,twttr.txt.addCharsToCharClass=r;var a=String.fromCharCode,n=[a(32),a(133),a(160),a(5760),a(6158),a(8232),a(8233),a(8239),a(8287),a(12288)];r(n,9,13),r(n,8192,8202);var i=[a(65534),a(65279),a(65535)];r(i,8234,8238),twttr.txt.regexen.spaces_group=t(n.join("")),twttr.txt.regexen.spaces=t("["+n.join("")+"]"),twttr.txt.regexen.invalid_chars_group=t(i.join("")),twttr.txt.regexen.punct=/\!'#%&'\(\)*\+,\\\-\.\/:;<=>\?@\[\]\^_{|}~\$/;var l=[];r(l,1024,1279),r(l,1280,1319),r(l,11744,11775),r(l,42560,42655),r(l,1425,1471),r(l,1473,1474),r(l,1476,1477),r(l,1479,1479),r(l,1488,1514),r(l,1520,1524),r(l,64274,64296),r(l,64298,64310),r(l,64312,64316),r(l,64318,64318),r(l,64320,64321),r(l,64323,64324),r(l,64326,64335),r(l,1552,1562),r(l,1568,1631),r(l,1646,1747),r(l,1749,1756),r(l,1758,1768),r(l,1770,1775),r(l,1786,1788),r(l,1791,1791),r(l,1872,1919),r(l,2208,2208),r(l,2210,2220),r(l,2276,2302),r(l,64336,64433),r(l,64467,64829),r(l,64848,64911),r(l,64914,64967),r(l,65008,65019),r(l,65136,65140),r(l,65142,65276),r(l,8204,8204),r(l,3585,3642),r(l,3648,3662),r(l,4352,4607),r(l,12592,12677),r(l,43360,43391),r(l,44032,55215),r(l,55216,55295),r(l,65441,65500),r(l,12449,12538),r(l,12540,12542),r(l,65382,65439),r(l,65392,65392),r(l,65296,65305),r(l,65313,65338),r(l,65345,65370),r(l,12353,12438),r(l,12441,12446),r(l,13312,19903),r(l,19968,40959),r(l,173824,177983),r(l,177984,178207),r(l,194560,195103),r(l,12291,12291),r(l,12293,12293),r(l,12347,12347),twttr.txt.regexen.nonLatinHashtagChars=t(l.join(""));var o=[];r(o,192,214),r(o,216,246),r(o,248,255),r(o,256,591),r(o,595,596),r(o,598,599),r(o,601,601),r(o,603,603),r(o,611,611),r(o,616,616),r(o,623,623),r(o,626,626),r(o,649,649),r(o,651,651),r(o,699,699),r(o,768,879),r(o,7680,7935),twttr.txt.regexen.latinAccentChars=t(o.join("")),twttr.txt.regexen.hashSigns=/[##]/,twttr.txt.regexen.hashtagAlpha=t(/[a-z_#{latinAccentChars}#{nonLatinHashtagChars}]/i),twttr.txt.regexen.hashtagAlphaNumeric=t(/[a-z0-9_#.\-{latinAccentChars}#{nonLatinHashtagChars}]/i),twttr.txt.regexen.endHashtagMatch=t(/^(?:#{hashSigns}|:\/\/)/),twttr.txt.regexen.hashtagBoundary=t(/(?:^|$|[^&a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}])/),twttr.txt.regexen.validHashtag=t(/(#{hashtagBoundary})(#{hashSigns})(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)/gi),twttr.txt.regexen.validMentionPrecedingChars=/(?:^|[^a-zA-Z0-9_!#$%&*@@]|RT:?)/,twttr.txt.regexen.atSigns=/[@@]/,twttr.txt.regexen.validMentionOrList=t("(#{validMentionPrecedingChars})(#{atSigns})([a-zA-Z0-9_.-]{1,20})(/[a-zA-Z][a-zA-Z0-9_]{0,24})?","g"),twttr.txt.regexen.validReply=t(/^(?:#{spaces})*#{atSigns}([a-zA-Z0-9_.\-]{1,20})/),twttr.txt.regexen.endMentionMatch=t(/^(?:#{atSigns}|[#{latinAccentChars}]|:\/\/)/),twttr.txt.regexen.validUrlPrecedingChars=t(/(?:[^A-Za-z0-9@@$###{invalid_chars_group}]|^)/),twttr.txt.regexen.invalidUrlWithoutProtocolPrecedingChars=/[-_.\/]$/,twttr.txt.regexen.invalidDomainChars=s("#{punct}#{spaces_group}#{invalid_chars_group}",twttr.txt.regexen),twttr.txt.regexen.validDomainChars=t(/[^#{invalidDomainChars}]/),twttr.txt.regexen.validSubdomain=t(/(?:(?:#{validDomainChars}(?:[_-]|#{validDomainChars})*)?#{validDomainChars}\.)/),twttr.txt.regexen.validDomainName=t(/(?:(?:#{validDomainChars}(?:-|#{validDomainChars})*)?#{validDomainChars}\.)/),twttr.txt.regexen.validGTLD=t(/(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx)(?=[^0-9a-zA-Z]|$))/),twttr.txt.regexen.validCCTLD=t(/(?:(?:ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)(?=[^0-9a-zA-Z]|$))/),twttr.txt.regexen.validPunycode=t(/(?:xn--[0-9a-z]+)/),twttr.txt.regexen.validDomain=t(/(?:#{validSubdomain}*#{validDomainName}(?:#{validGTLD}|#{validCCTLD}|#{validPunycode}))/),twttr.txt.regexen.validAsciiDomain=t(/(?:(?:[a-z0-9#{latinAccentChars}]+)\.)+(?:#{validGTLD}|#{validCCTLD}|#{validPunycode})/gi),twttr.txt.regexen.invalidShortDomain=t(/^#{validDomainName}#{validCCTLD}$/),twttr.txt.regexen.validPortNumber=t(/[0-9]+/),twttr.txt.regexen.validGeneralUrlPathChars=t(/[a-z0-9!\*';:=\+,\.\$\/%#\[\]\-_~|&#{latinAccentChars}]/i),twttr.txt.regexen.validUrlBalancedParens=t(/\(#{validGeneralUrlPathChars}+\)/i),twttr.txt.regexen.validUrlPathEndingChars=t(/[\+\-a-z0-9=_#\/#{latinAccentChars}]|(?:#{validUrlBalancedParens})/i),twttr.txt.regexen.validUrlPath=t("(?:(?:#{validGeneralUrlPathChars}*(?:#{validUrlBalancedParens}#{validGeneralUrlPathChars}*)*#{validUrlPathEndingChars})|(?:@#{validGeneralUrlPathChars}+/))","i"),twttr.txt.regexen.validUrlQueryChars=/[a-z0-9!?\*'\(\);:&=\+\$\/%#\[\]\-_\.,~|]/i,twttr.txt.regexen.validUrlQueryEndingChars=/[a-z0-9_&=#\/]/i,twttr.txt.regexen.extractUrl=t("((#{validUrlPrecedingChars})((https?:\\/\\/)?(#{validDomain})(?::(#{validPortNumber}))?(\\/#{validUrlPath}*)?(\\?#{validUrlQueryChars}*#{validUrlQueryEndingChars})?))","gi"),twttr.txt.regexen.validTcoUrl=/^https?:\/\/t\.co\/[a-z0-9]+/i,twttr.txt.regexen.validateUrlUnreserved=/[a-z0-9\-._~]/i,twttr.txt.regexen.validateUrlPctEncoded=/(?:%[0-9a-f]{2})/i,twttr.txt.regexen.validateUrlSubDelims=/[!$&'()*+,;=]/i,twttr.txt.regexen.validateUrlPchar=t("(?:#{validateUrlUnreserved}|#{validateUrlPctEncoded}|#{validateUrlSubDelims}|[:|@])","i"),twttr.txt.regexen.validateUrlScheme=/(?:[a-z][a-z0-9+\-.]*)/i,twttr.txt.regexen.validateUrlUserinfo=t("(?:#{validateUrlUnreserved}|#{validateUrlPctEncoded}|#{validateUrlSubDelims}|:)*","i"),twttr.txt.regexen.validateUrlDecOctet=/(?:[0-9]|(?:[1-9][0-9])|(?:1[0-9]{2})|(?:2[0-4][0-9])|(?:25[0-5]))/i,twttr.txt.regexen.validateUrlIpv4=t(/(?:#{validateUrlDecOctet}(?:\.#{validateUrlDecOctet}){3})/i),twttr.txt.regexen.validateUrlIpv6=/(?:\[[a-f0-9:\.]+\])/i,twttr.txt.regexen.validateUrlIp=t("(?:#{validateUrlIpv4}|#{validateUrlIpv6})","i"),twttr.txt.regexen.validateUrlSubDomainSegment=/(?:[a-z0-9](?:[a-z0-9_\-]*[a-z0-9])?)/i,twttr.txt.regexen.validateUrlDomainSegment=/(?:[a-z0-9](?:[a-z0-9\-]*[a-z0-9])?)/i,twttr.txt.regexen.validateUrlDomainTld=/(?:[a-z](?:[a-z0-9\-]*[a-z0-9])?)/i,twttr.txt.regexen.validateUrlDomain=t(/(?:(?:#{validateUrlSubDomainSegment]}\.)*(?:#{validateUrlDomainSegment]}\.)#{validateUrlDomainTld})/i),twttr.txt.regexen.validateUrlHost=t("(?:#{validateUrlIp}|#{validateUrlDomain})","i"),twttr.txt.regexen.validateUrlUnicodeSubDomainSegment=/(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9_\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,twttr.txt.regexen.validateUrlUnicodeDomainSegment=/(?:(?:[a-z0-9]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,twttr.txt.regexen.validateUrlUnicodeDomainTld=/(?:(?:[a-z]|[^\u0000-\u007f])(?:(?:[a-z0-9\-]|[^\u0000-\u007f])*(?:[a-z0-9]|[^\u0000-\u007f]))?)/i,twttr.txt.regexen.validateUrlUnicodeDomain=t(/(?:(?:#{validateUrlUnicodeSubDomainSegment}\.)*(?:#{validateUrlUnicodeDomainSegment}\.)#{validateUrlUnicodeDomainTld})/i),twttr.txt.regexen.validateUrlUnicodeHost=t("(?:#{validateUrlIp}|#{validateUrlUnicodeDomain})","i"),twttr.txt.regexen.validateUrlPort=/[0-9]{1,5}/,twttr.txt.regexen.validateUrlUnicodeAuthority=t("(?:(#{validateUrlUserinfo})@)?(#{validateUrlUnicodeHost})(?::(#{validateUrlPort}))?","i"),twttr.txt.regexen.validateUrlAuthority=t("(?:(#{validateUrlUserinfo})@)?(#{validateUrlHost})(?::(#{validateUrlPort}))?","i"),twttr.txt.regexen.validateUrlPath=t(/(\/#{validateUrlPchar}*)*/i),twttr.txt.regexen.validateUrlQuery=t(/(#{validateUrlPchar}|\/|\?)*/i),twttr.txt.regexen.validateUrlFragment=t(/(#{validateUrlPchar}|\/|\?)*/i),twttr.txt.regexen.validateUrlUnencoded=t("^(?:([^:/?#]+):\\/\\/)?([^/?#]*)([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$","i");var c=' rel="nofollow"',x={urlClass:!0,listClass:!0,usernameClass:!0,hashtagClass:!0,usernameUrlBase:!0,listUrlBase:!0,hashtagUrlBase:!0,usernameUrlBlock:!0,listUrlBlock:!0,hashtagUrlBlock:!0,linkUrlBlock:!0,usernameIncludeSymbol:!0,suppressLists:!0,suppressNoFollow:!0,suppressDataScreenName:!0,urlEntities:!0,before:!0},h={disabled:!0,readonly:!0,multiple:!0,checked:!0};twttr.txt.linkToHashtag=function(t,e,r){var a={hash:e.substring(t.indices[0],t.indices[0]+1),preText:"",text:twttr.txt.htmlEscape(t.hashtag),postText:"",extraHtml:r.suppressNoFollow?"":c};for(var n in r)r.hasOwnProperty(n)&&(a[n]=r[n]);return s('#{before}#{hash}#{preText}#{text}#{postText}',a)},twttr.txt.linkToMentionAndList=function(t,e,r){var a=e.substring(t.indices[0],t.indices[0]+1),n={at:r.usernameIncludeSymbol?"":a,at_before_user:r.usernameIncludeSymbol?a:"",user:twttr.txt.htmlEscape(t.screenName),slashListname:twttr.txt.htmlEscape(t.listSlug),extraHtml:r.suppressNoFollow?"":c,preChunk:"",postChunk:""};for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);if(!t.listSlug||r.suppressLists)return n.chunk=n.user,n.dataScreenName=r.suppressDataScreenName?"":s('data-screen-name="#{chunk}" ',n),s('#{before}#{at}#{preChunk}#{at_before_user}#{chunk}#{postChunk}',n);var l=n.chunk=s("#{user}#{slashListname}",n);return n.list=twttr.txt.htmlEscape(l.toLowerCase()),s('#{before}#{at}#{preChunk}#{at_before_user}#{chunk}#{postChunk}',n)},twttr.txt.linkToUrl=function(t,e,r){var a=t.url,n=twttr.txt.htmlEscape(a),i=r.urlEntities&&r.urlEntities[a]||t;return i.display_url&&(r.title||(r.htmlAttrs=(r.htmlAttrs||"")+' title="'+i.expanded_url+'"'),n=twttr.txt.linkTextWithEntity(i,r)),s('#{linkText}',{htmlAttrs:r.htmlAttrs,url:twttr.txt.htmlEscape(a),linkText:n})},twttr.txt.linkTextWithEntity=function(t,e){var r=t.display_url,a=t.expanded_url,n=r.replace(/…/g,"");if(-1==a.indexOf(n))return r;var i=a.indexOf(n),l={displayUrlSansEllipses:n,beforeDisplayUrl:a.substr(0,i),afterDisplayUrl:a.substr(i+n.length),precedingEllipsis:r.match(/^…/)?"…":"",followingEllipsis:r.match(/…$/)?"…":""};return $.each(l,function(t,e){l[t]=twttr.txt.htmlEscape(e)}),l.invisible=e.invisibleTagAttrs,s("#{precedingEllipsis} #{beforeDisplayUrl}#{displayUrlSansEllipses}#{afterDisplayUrl} #{followingEllipsis}",l)},twttr.txt.autoLinkEntities=function(t,e,r){var a,n;if((r=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(r||{})).suppressNoFollow||(r.rel="nofollow"),r.urlClass&&(r.class=r.urlClass),r.urlClass=r.urlClass||"tweet-url",r.hashtagClass=r.hashtagClass||"hashtag",r.hashtagUrlBase=r.hashtagUrlBase||"https://twitter.com/#!/search?q=%23",r.listClass=r.listClass||"list-slug",r.usernameClass=r.usernameClass||"username",r.usernameUrlBase=r.usernameUrlBase||"https://twitter.com/",r.listUrlBase=r.listUrlBase||"https://twitter.com/",r.before=r.before||"",r.htmlAttrs=twttr.txt.extractHtmlAttrsFromOptions(r),r.invisibleTagAttrs=r.invisibleTagAttrs||"style='position:absolute;left:-9999px;'",r.urlEntities){for(a={},s=0,n=r.urlEntities.length;st[r].indices[0]?(t.splice(r,1),r--):e=t[r]},twttr.txt.extractEntitiesWithIndices=function(t,e){var r=twttr.txt.extractUrlsWithIndices(t,e).concat(twttr.txt.extractMentionsOrListsWithIndices(t)).concat(twttr.txt.extractHashtagsWithIndices(t,{checkUrlOverlap:!1}));return 0==r.length?[]:(twttr.txt.removeOverlappingEntities(r),r)},twttr.txt.extractMentions=function(t){for(var e=[],r=twttr.txt.extractMentionsWithIndices(t),a=0;a");for(var l=0;l",""],h=twttr.txt.splitTags(t),u="",d=0,g=h[0],v=0,w=0,m=!1,p=g,f=[],U=0;U=v+g.length;)u+=p.slice(w),m&&i===v+p.length&&(u+=l,s=!0),h[d+1]&&(u+="<"+h[d+1]+">"),v+=p.length,w=0,p=g=h[d+=2],m=!1;s||null==g?s||(s=!0,u+=l):(o=i-v,u+=p.slice(w,o)+l,w=o,m=n%2==0)}if(null!=g)for(w";return u};var u=[a(65534),a(65279),a(65535),a(8234),a(8235),a(8236),a(8237),a(8238)];twttr.txt.isInvalidTweet=function(t){if(!t)return"empty";if(140this.width.client},scrollableY:function(){return(d||f)&&this.height.scroll>this.height.client}};return b.y&&a.scrollableY()||b.x&&a.scrollableX()}})})(jQuery); /*** lib/sidr/dist/jquery.sidr.js ***/ -!function(u){var v=!1,y=!1,d=function(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)},l=function(e,t){e.html(t)},c=function(e){var t=e.attr("id"),i=e.attr("class");"string"==typeof t&&""!==t&&e.attr("id",t.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&e.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),e.removeAttr("style")},i=function(e,t,i){"function"==typeof t?(i=t,t="sidr"):t||(t="sidr");var s,o,r,n=u("#"+t),a=u(n.data("body")),d=u("html"),l=n.outerWidth(!0),c=n.data("speed"),f=n.data("side"),p="sidr"==t?"sidr-open":"sidr-open "+t+"-open";if("open"===e||"toogle"===e&&!n.is(":visible")){if(n.is(":visible")||v)return;if(!1!==y)return void m.close(y,function(){m.open(t)});v=!0,"left"===f?(s={left:l+"px"},o={left:"0px"}):(s={right:l+"px"},o={right:"0px"}),r=d.scrollTop(),d.css("overflow-x","hidden").scrollTop(r),a.addClass("sidr-animating").css({width:a.width(),position:"absolute"}).animate(s,c,function(){u(this).addClass(p)}),n.css("display","block").animate(o,c,function(){v=!1,y=t,"function"==typeof i&&i(t),a.removeClass("sidr-animating")})}else{if(!n.is(":visible")||v)return;v=!0,"left"===f?(s={left:0},o={left:"-"+l+"px"}):(s={right:0},o={right:"-"+l+"px"}),r=d.scrollTop(),d.removeAttr("style").scrollTop(r),a.addClass("sidr-animating").animate(s,c).removeClass(p),n.animate(o,c,function(){n.removeAttr("style"),a.removeAttr("style"),u("html").removeAttr("style"),y=v=!1,"function"==typeof i&&i(t),a.removeClass("sidr-animating")})}},m={open:function(e,t){i("open",e,t)},close:function(e,t){i("close",e,t)},toogle:function(e,t){i("toogle",e,t)}};u.sidr=function(e){return m[e]?m[e].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof e&&"string"!=typeof e&&e?void u.error("Method "+e+" does not exist on jQuery.sidr"):m.toogle.apply(this,arguments)},u.fn.sidr=function(e){var t=u.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body"},e),i=t.name,s=u("#"+i);if(0===s.length&&(s=u("
").attr("id",i).appendTo(u("body"))),s.addClass("sidr").addClass(t.side).data({speed:t.speed,side:t.side,body:t.body}),"function"==typeof t.source){var o=t.source(i);l(s,o)}else if("string"==typeof t.source&&d(t.source))u.get(t.source,function(e){l(s,e)});else if("string"==typeof t.source){var r="",n=t.source.split(",");if(u.each(n,function(e,t){r+='
'+u(t).html()+"
"}),t.renaming){var a=u("
").html(r);a.find("*").each(function(e,t){var i=u(t);c(i)}),r=a.html()}l(s,r)}else null!==t.source&&u.error("Invalid Sidr Source");return this.each(function(){var e=u(this);e.data("sidr")||(e.data("sidr",i),e.click(function(e){e.preventDefault(),m.toogle(i)}))})}}(jQuery); +!function(u){var y=!1,m=!1,d=function(t){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(t)},l=function(t,e){t.html(e)},c=function(t){var e=t.attr("id"),i=t.attr("class");"string"==typeof e&&""!==e&&t.attr("id",e.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-id-$1")),"string"==typeof i&&""!==i&&"sidr-inner"!==i&&t.attr("class",i.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-class-$1")),t.removeAttr("style")},i=function(t,e,i){e="function"==typeof e?(i=e,"sidr"):e||"sidr";var s,o,n,r=u("#"+e),a=u(r.data("body")),d=u("html"),l=r.outerWidth(!0),c=r.data("speed"),f=r.data("side"),p="sidr"==e?"sidr-open":"sidr-open "+e+"-open";if("open"===t||"toogle"===t&&!r.is(":visible")){if(r.is(":visible")||y)return;if(!1!==m)return void v.close(m,function(){v.open(e)});y=!0,o="left"===f?(s={left:l+"px"},{left:"0px"}):(s={right:l+"px"},{right:"0px"}),n=d.scrollTop(),d.css("overflow-x","hidden").scrollTop(n),a.addClass("sidr-animating").css({width:a.width(),position:"absolute"}).animate(s,c,function(){u(this).addClass(p)}),r.css("display","block").animate(o,c,function(){y=!1,m=e,"function"==typeof i&&i(e),a.removeClass("sidr-animating")})}else{if(!r.is(":visible")||y)return;y=!0,o="left"===f?(s={left:0},{left:"-"+l+"px"}):(s={right:0},{right:"-"+l+"px"}),n=d.scrollTop(),d.removeAttr("style").scrollTop(n),a.addClass("sidr-animating").animate(s,c).removeClass(p),r.animate(o,c,function(){r.removeAttr("style"),a.removeAttr("style"),u("html").removeAttr("style"),m=y=!1,"function"==typeof i&&i(e),a.removeClass("sidr-animating")})}},v={open:function(t,e){i("open",t,e)},close:function(t,e){i("close",t,e)},toogle:function(t,e){i("toogle",t,e)}};u.sidr=function(t){return v[t]?v[t].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof t&&"string"!=typeof t&&t?void u.error("Method "+t+" does not exist on jQuery.sidr"):v.toogle.apply(this,arguments)},u.fn.sidr=function(t){var e,i,s,o,n=u.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body"},t),r=n.name,a=u("#"+r);return 0===a.length&&(a=u("
").attr("id",r).appendTo(u("body"))),a.addClass("sidr").addClass(n.side).data({speed:n.speed,side:n.side,body:n.body}),"function"==typeof n.source?(e=n.source(r),l(a,e)):"string"==typeof n.source&&d(n.source)?u.get(n.source,function(t){l(a,t)}):"string"==typeof n.source?(i="",s=n.source.split(","),u.each(s,function(t,e){i+='
'+u(e).html()+"
"}),n.renaming&&((o=u("
").html(i)).find("*").each(function(t,e){var i=u(e);c(i)}),i=o.html()),l(a,i)):null!==n.source&&u.error("Invalid Sidr Source"),this.each(function(){var t=u(this);t.data("sidr")||(t.data("sidr",r),t.click(function(t){t.preventDefault(),v.toogle(r)}))})}}(jQuery); /*** lib/linkify/1.0/jquery.linkify-1.0-min.js ***/ // encoding: utf-8 // $.fn.linkify 1.0 - MIT/GPL Licensed - More info: http://github.com/maranomynet/linkify/ (function(b){var x=/(^|["'(\s]|<)(www\..+?\..+?)((?:[:?]|\.+)?(?:\s|$)|>|[)"',])/g,y=/(^|["'(\s]|<)((?:(?:https?|ftp):\/\/|mailto:).+?)((?:[:?]|\.+)?(?:\s|$)|>|[)"',])/g,z=function(h){return h.replace(x,'$1$2$3').replace(y,'$1$2$3').replace(/"<``>/g,'"http')},s=b.fn.linkify=function(c){if(!b.isPlainObject(c)){c={use:(typeof c=='string')?c:undefined,handleLinks:b.isFunction(c)?c:arguments[1]}}var d=c.use,k=s.plugins||{},l=[z],f,m=[],n=c.handleLinks;if(d==undefined||d=='*'){for(var i in k){l.push(k[i])}}else{d=b.isArray(d)?d:b.trim(d).split(/ *, */);var o,i;for(var p=0,A=d.length;p1&&/\S/.test(a)){var q,r;f=f||b('
')[0];f.innerHTML='';f.appendChild(e.cloneNode(false));var u=f.childNodes;for(var v=0,g;(g=l[v]);v++){var w=u.length,j;while(w--){j=u[w];if(j.nodeType==3){a=j.nodeValue;if(a.length>1&&/\S/.test(a)){r=a;a=a.replace(/&/g,'&').replace(//g,'>');a=b.isFunction(g)?g(a):a.replace(g.re,g.tmpl);q=q||r!=a;r!=a&&b(j).after(a).remove()}}}}a=f.innerHTML;if(n){a=b('
').html(a);m=m.concat(a.find('a').toArray().reverse());a=a.contents()}q&&b(e).after(a).remove()}}else if(e.nodeType==1&&!/^(a|button|textarea)$/i.test(e.tagName)){arguments.callee.call(e)}}});n&&n(b(m.reverse()));return this};s.plugins={mailto:{re:/(^|["'(\s]|<)([^"'(\s&]+?@.+\.[a-z]{2,7})(([:?]|\.+)?(\s|$)|>|[)"',])/gi,tmpl:'$1$2$3'}}})(jQuery); /*** lib/jquery.hotkeys/jquery.hotkeys.js ***/ -!function(l){function t(t){if("string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys){var o=t.handler,p=t.data.keys.toLowerCase().split(" ");t.handler=function(a){if(this===a.target||!(l.hotkeys.options.filterInputAcceptingElements&&l.hotkeys.textInputTypes.test(a.target.nodeName)||l.hotkeys.options.filterContentEditable&&l(a.target).attr("contenteditable")||l.hotkeys.options.filterTextInputs&&-1","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},l.each(["keydown","keyup","keypress"],function(){l.event.special[this]={add:t}})}(jQuery||this.jQuery||window.jQuery); +!function(l){function t(t){var o,p;"string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys&&(o=t.handler,p=t.data.keys.toLowerCase().split(" "),t.handler=function(a){if(this===a.target||!(l.hotkeys.options.filterInputAcceptingElements&&l.hotkeys.textInputTypes.test(a.target.nodeName)||l.hotkeys.options.filterContentEditable&&l(a.target).attr("contenteditable")||l.hotkeys.options.filterTextInputs&&-1","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},l.each(["keydown","keyup","keypress"],function(){l.event.special[this]={add:t}})}(jQuery||this.jQuery||window.jQuery); /*** r.js built ***/ /* * Based on code from: @@ -303,7 +303,7 @@ Example usage: * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * https://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License @@ -358,6 +358,46 @@ Example usage: * the Initial Developer. All Rights Reserved. * * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * https://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): * Jan Jongboom * Fabian Jakobs * @@ -375,9 +415,9 @@ Example usage: * * ***** END LICENSE BLOCK ***** */ -define("ace/lib/regexp",["require","exports","module"],function(e,t,r){"use strict";function i(e){return(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":"")}function s(e,t,r){if(Array.prototype.indexOf)return e.indexOf(t,r);for(var i=r||0;i1&&s(l,"")>-1&&(r=RegExp(this.source,n.replace.call(i(this),"g","")),n.replace.call(e.slice(l.index),r,function(){for(var e=1;el.index&&this.lastIndex--}return l},a||(RegExp.prototype.test=function(e){var t=n.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,r){function i(){}function s(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function n(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var r=g.call(arguments,1),s=function(){if(this instanceof s){var i=t.apply(this,r.concat(g.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(g.call(arguments)))};return t.prototype&&(i.prototype=t.prototype,s.prototype=new i,i.prototype=null),s});var o,a,l,c,_,d=Function.prototype.call,u=Array.prototype,m=Object.prototype,g=u.slice,h=d.bind(m.toString),p=d.bind(m.hasOwnProperty);if((_=p(m,"__defineGetter__"))&&(o=d.bind(m.__defineGetter__),a=d.bind(m.__defineSetter__),l=d.bind(m.__lookupGetter__),c=d.bind(m.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,r=[];if(r.splice.apply(r,e(20)),r.splice.apply(r,e(26)),t=r.length,r.splice(5,0,"XXX"),r.length,t+1==r.length)return!0}()){var f=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?f.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(g.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var r=this.length;e>0?e>r&&(e=r):void 0==e?e=0:e<0&&(e=Math.max(r+e,0)),e+ta)for(d=c;d--;)this[l+d]=this[a+d];if(n&&e===_)this.length=_,this.push.apply(this,s);else for(this.length=_+n,d=0;d>>0;if("[object Function]"!=h(e))throw new TypeError;for(;++s>>0,s=Array(i),n=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,n=[],o=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,s=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var n=0;n>>0,s=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var n=0;n>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var s,n=0;if(arguments.length>=2)s=arguments[1];else for(;;){if(n in r){s=r[n++];break}if(++n>=i)throw new TypeError("reduce of empty array with no initial value")}for(;n>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var s,n=i-1;if(arguments.length>=2)s=arguments[1];else for(;;){if(n in r){s=r[n--];break}if(--n<0)throw new TypeError("reduceRight of empty array with no initial value")}do{n in this&&(s=e.call(void 0,s,r[n],n,t))}while(n--);return s}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=y&&"[object String]"==h(this)?this.split(""):q(this),r=t.length>>>0;if(!r)return-1;var i=0;for(arguments.length>1&&(i=n(arguments[1])),i=i>=0?i:Math.max(0,r+i);i>>0;if(!r)return-1;var i=r-1;for(arguments.length>1&&(i=Math.min(i,n(arguments[1]))),i=i>=0?i:r-Math.abs(i);i>=0;i--)if(i in t&&e===t[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:m)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var r,i,s;if(r={enumerable:!0,configurable:!0},_){var n=e.__proto__;e.__proto__=m;var i=l(e,t),s=c(e,t);if(e.__proto__=n,i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=e[t],r}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var w;w=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var r;if(null===e)r=w();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var i=function(){};i.prototype=e,r=new i,r.__proto__=e}return void 0!==t&&Object.defineProperties(r,t),r}}if(Object.defineProperty){var v=s({}),x="undefined"==typeof document||s(document.createElement("div"));if(!v||!x)var k=Object.defineProperty}if(!Object.defineProperty||k){Object.defineProperty=function(e,t,r){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof r&&"function"!=typeof r||null===r)throw new TypeError("Property description must be an object: "+r);if(k)try{return k.call(Object,e,t,r)}catch(e){}if(p(r,"value"))if(_&&(l(e,t)||c(e,t))){var i=e.__proto__;e.__proto__=m,delete e[t],e[t]=r.value,e.__proto__=i}else e[t]=r.value;else{if(!_)throw new TypeError("getters & setters can not be defined on this javascript engine");p(r,"get")&&o(e,t,r.get),p(r,"set")&&a(e,t,r.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var r in t)p(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var r=p(e,t);return delete e[t],r}),!Object.keys){var C=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],F=A.length;for(var E in{toString:null})C=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var r in e)p(e,r)&&t.push(r);if(C)for(var i=0,s=F;i=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=(window.Controllers||window.controllers)&&"Gecko"===window.navigator.product,t.isOldGecko=t.isGecko&&parseInt((s.match(/rv:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isIPad=s.indexOf("iPad")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0)}}),define("ace/lib/event",["require","exports","module","./keys","./useragent"],function(e,t,r){"use strict";function i(e,t,r){var i=c(t);if(!o.isMac&&a){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),a.altGr){if(3==(3&i))return;a.altGr=0}if(18===r||17===r){var s="location"in t?t.location:t.keyLocation;if(17===r&&1===s)1==a[r]&&(l=t.timeStamp);else if(18===r&&3===i&&2===s){var _=t.timeStamp-l;_<50&&(a.altGr=!0)}}}if(r in n.MODIFIER_KEYS&&(r=-1),8&i&&r>=91&&r<=93&&(r=-1),!i&&13===r){var s="location"in t?t.location:t.keyLocation;if(3===s&&(e(t,i,-r),t.defaultPrevented))return}if(o.isChromeOS&&8&i){if(e(t,i,r),t.defaultPrevented)return;i&=-9}return!!(i||r in n.FUNCTION_KEYS||r in n.PRINTABLE_KEYS)&&e(t,i,r)}function s(){a=Object.create(null)}var n=e("./keys"),o=e("./useragent"),a=null,l=0;t.addListener=function(e,t,r){if(e.addEventListener)return e.addEventListener(t,r,!1);if(e.attachEvent){var i=function(){r.call(e,window.event)};r._wrapper=i,e.attachEvent("on"+t,i)}},t.removeListener=function(e,t,r){if(e.removeEventListener)return e.removeEventListener(t,r,!1);e.detachEvent&&e.detachEvent("on"+t,r._wrapper||r)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,r,i){function s(e){r&&r(e),i&&i(e),t.removeListener(document,"mousemove",r,!0),t.removeListener(document,"mouseup",s,!0),t.removeListener(document,"dragstart",s,!0)}return t.addListener(document,"mousemove",r,!0),t.addListener(document,"mouseup",s,!0),t.addListener(document,"dragstart",s,!0),s},t.addTouchMoveListener=function(e,r){var i,s;t.addListener(e,"touchstart",function(e){var t=e.touches,r=t[0];i=r.clientX,s=r.clientY}),t.addListener(e,"touchmove",function(e){var t=e.touches;if(!(t.length>1)){var n=t[0];e.wheelX=i-n.clientX,e.wheelY=s-n.clientY,i=n.clientX,s=n.clientY,r(e)}})},t.addMouseWheelListener=function(e,r){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),r(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}r(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),r(e)})},t.addMultiMouseDownListener=function(e,r,i,s){function n(e){if(0!==t.getButton(e)?d=0:e.detail>1?++d>4&&(d=1):d=1,o.isIE){var n=Math.abs(e.clientX-l)>5||Math.abs(e.clientY-c)>5;_&&!n||(d=1),_&&clearTimeout(_),_=setTimeout(function(){_=null},r[d-1]||600),1==d&&(l=e.clientX,c=e.clientY)}if(e._clicks=d,i[s]("mousedown",e),d>4)d=0;else if(d>1)return i[s](u[d],e)}function a(e){d=2,_&&clearTimeout(_),_=setTimeout(function(){_=null},r[d-1]||600),i[s]("mousedown",e),i[s](u[d],e)}var l,c,_,d=0,u={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",n),o.isOldIE&&t.addListener(e,"dblclick",a)})};var c=!o.isMac||!o.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(t.getModifierString=function(e){return n.KEY_MODS[c(e)]},t.addCommandKeyListener=function(e,r){var n=t.addListener;if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var l=null;n(e,"keydown",function(e){l=e.keyCode}),n(e,"keypress",function(e){return i(r,e,l)})}else{var c=null;n(e,"keydown",function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=i(r,e,e.keyCode);return c=e.defaultPrevented,t}),n(e,"keypress",function(e){c&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),c=null)}),n(e,"keyup",function(e){a[e.keyCode]=null}),a||(s(),n(window,"focus",s))}},"object"==typeof window&&window.postMessage&&!o.isOldIE){t.nextTick=function(e,r){r=r||window;t.addListener(r,"message",function i(s){"zero-timeout-message-1"==s.data&&(t.stopPropagation(s),t.removeListener(r,"message",i),e())}),r.postMessage("zero-timeout-message-1","*")}}t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/lib/lang",["require","exports","module"],function(e,t,r){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>=1)&&(e+=e);return r};var i=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var r in e)t[r]=e[r];return t},t.copyArray=function(e){for(var t=[],r=0,i=e.length;rg.length?e=e.substr(9):e.substr(0,4)==g.substr(0,4)?e=e.substr(4,e.length-g.length+1):e.charAt(e.length-1)==g.charAt(0)&&(e=e.slice(0,-1)),e==g.charAt(0)||e.charAt(e.length-1)==g.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),h&&(h=!1),E&&(E=!1))},R=function(e){if(!b){var t=m.value;S(t),d()}},D=function(e,t,r){var i=e.clipboardData||window.clipboardData;if(i&&!c){var s=_||r?"Text":"text/plain";try{return t?!1!==i.setData(s,t):i.getData(s)}catch(e){if(!r)return D(e,t,!0)}}},q=function(e,n){var o=t.getCopyText();if(!o)return i.preventDefault(e);D(e,o)?(s.isIOS&&(p=n,m.value="\n aa"+o+"a a\n",m.setSelectionRange(4,4+o.length),h={value:o}),n?t.onCut():t.onCopy(),s.isIOS||i.preventDefault(e)):(h=!0,m.value=o,m.select(),setTimeout(function(){h=!1,d(),r(),n?t.onCut():t.onCopy()}))},L=function(e){q(e,!0)},$=function(e){q(e,!1)},T=function(e){var n=D(e);"string"==typeof n?(n&&t.onPaste(n,e),s.isIE&&setTimeout(r),i.preventDefault(e)):(m.value="",f=!0)};i.addCommandKeyListener(m,t.onCommandKey.bind(t)),i.addListener(m,"select",A),i.addListener(m,"input",R),i.addListener(m,"cut",L),i.addListener(m,"copy",$),i.addListener(m,"paste",T);var B=function(e){b||!t.onCompositionStart||t.$readOnly||(b={},b.canUndo=t.session.$undoManager,t.onCompositionStart(),setTimeout(M,0),t.on("mousedown",O),b.canUndo&&!t.selection.isEmpty()&&(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},M=function(){if(b&&t.onCompositionUpdate&&!t.$readOnly){var e=m.value.replace(/\x01/g,"");if(b.lastValue!==e&&(t.onCompositionUpdate(e),b.lastValue&&t.undo(),b.canUndo&&(b.lastValue=e),b.lastValue)){var r=t.selection.getRange();t.insert(b.lastValue),t.session.markUndoGroup(),b.range=t.selection.getRange(),t.selection.setRange(r),t.selection.clearSelection()}}},O=function(e){if(t.onCompositionEnd&&!t.$readOnly){var r=b;b=!1;var i=setTimeout(function(){i=null;var e=m.value.replace(/\x01/g,"");b||(e==r.lastValue?d():!r.lastValue&&e&&(d(),S(e)))});F=function(e){return i&&clearTimeout(i),(e=e.replace(/\x01/g,""))==r.lastValue?"":(r.lastValue&&i&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",O),"compositionend"==e.type&&r.range&&t.selection.setRange(r.range);(!!s.isChrome&&s.isChrome>=53||!!s.isWebKit&&s.isWebKit>=603)&&R()}},I=o.delayedCall(M,50);i.addListener(m,"compositionstart",B),s.isGecko?i.addListener(m,"text",function(){I.schedule()}):(i.addListener(m,"keyup",function(){I.schedule()}),i.addListener(m,"keydown",function(){I.schedule()})),i.addListener(m,"compositionend",O),this.getElement=function(){return m},this.setReadOnly=function(e){m.readOnly=e},this.onContextMenu=function(e){E=!0,r(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){y||(y=m.style.cssText),m.style.cssText=(r?"z-index:100000;":"")+"height:"+m.style.height+";"+(s.isIE?"opacity:0.1;":"");var o=t.container.getBoundingClientRect(),a=n.computedStyle(t.container),l=o.top+(parseInt(a.borderTopWidth)||0),c=o.left+(parseInt(o.borderLeftWidth)||0),_=o.bottom-l-m.clientHeight-2,d=function(e){m.style.left=e.clientX-c-2+"px",m.style.top=Math.min(e.clientY-l-2,_)+"px"};d(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(z),s.isWin&&i.capture(t.container,d,u))},this.onContextMenuClose=u;var z,P=function(e){t.textInput.onContextMenu(e),u()};if(i.addListener(m,"mouseup",P),i.addListener(m,"mousedown",function(e){e.preventDefault(),u()}),i.addListener(t.renderer.scroller,"contextmenu",P),i.addListener(m,"contextmenu",P),s.isIOS){var j=null,N=!1;e.addEventListener("keydown",function(e){j&&clearTimeout(j),N=!0}),e.addEventListener("keyup",function(e){j=setTimeout(function(){N=!1},100)});var W=function(e){if(document.activeElement===m&&!N){if(p)return setTimeout(function(){p=!1},100);var r=m.selectionStart,i=m.selectionEnd;if(m.setSelectionRange(4,5),r==i)switch(r){case 0:t.onCommandKey(null,0,a.up);break;case 1:t.onCommandKey(null,0,a.home);break;case 2:t.onCommandKey(null,l.option,a.left);break;case 4:t.onCommandKey(null,0,a.left);break;case 5:t.onCommandKey(null,0,a.right);break;case 7:t.onCommandKey(null,l.option,a.right);break;case 8:t.onCommandKey(null,0,a.end);break;case 9:t.onCommandKey(null,0,a.down)}else{switch(i){case 6:t.onCommandKey(null,l.shift,a.right);break;case 7:t.onCommandKey(null,l.shift|l.option,a.right);break;case 8:t.onCommandKey(null,l.shift,a.end);break;case 9:t.onCommandKey(null,l.shift,a.down)}switch(r){case 0:t.onCommandKey(null,l.shift,a.up);break;case 1:t.onCommandKey(null,l.shift,a.home);break;case 2:t.onCommandKey(null,l.shift|l.option,a.left);break;case 3:t.onCommandKey(null,l.shift,a.left)}}}};document.addEventListener("selectionchange",W),t.on("destroy",function(){document.removeEventListener("selectionchange",W)})}};t.TextInput=d}),define("ace/keyboard/textinput",["require","exports","module","../lib/event","../lib/useragent","../lib/dom","../lib/lang","./textinput_ios"],function(e,t,r){"use strict";var i=e("../lib/event"),s=e("../lib/useragent"),n=e("../lib/dom"),o=e("../lib/lang"),a=s.isChrome<18,l=s.isIE,c=e("./textinput_ios").TextInput,_=function(e,t){function r(e){if(!p){if(p=!0,C)var t=0,r=e?0:u.value.length-1;else var t=e?2:1,r=2;try{u.setSelectionRange(t,r)}catch(e){}p=!1}}function _(){p||(u.value=m,s.isWebKit&&v.schedule())}function d(){clearTimeout(O),O=setTimeout(function(){f&&(u.style.cssText=f,f=""),null==t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}if(s.isIOS)return c.call(this,e,t);var u=n.createElement("textarea");u.className="ace_text-input",u.setAttribute("wrap","off"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),u.setAttribute("spellcheck",!1),u.style.opacity="0",e.insertBefore(u,e.firstChild);var m="\u2028\u2028",g=!1,h=!1,p=!1,f="",b=!0;try{var y=document.activeElement===u}catch(e){}i.addListener(u,"blur",function(e){t.onBlur(e),y=!1}),i.addListener(u,"focus",function(e){y=!0,t.onFocus(e),r()}),this.focus=function(){if(f)return u.focus() -;var e=u.style.top;u.style.position="fixed",u.style.top="0px",u.focus(),setTimeout(function(){u.style.position="","0px"==u.style.top&&(u.style.top=e)},0)},this.blur=function(){u.blur()},this.isFocused=function(){return y};var w=o.delayedCall(function(){y&&r(b)}),v=o.delayedCall(function(){p||(u.value=m,y&&r())});s.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=b&&(b=!b,w.schedule())}),_(),y&&t.onFocus();var x=function(e){return 0===e.selectionStart&&e.selectionEnd===e.value.length},k=function(e){g?g=!1:x(u)?(t.selectAll(),r()):C&&r(t.selection.isEmpty())},C=null;this.setInputHandler=function(e){C=e},this.getInputHandler=function(){return C};var A=!1,F=function(e){C&&(e=C(e),C=null),h?(r(),e&&t.onPaste(e),h=!1):e==m.charAt(0)?A?t.execCommand("del",{source:"ace"}):t.execCommand("backspace",{source:"ace"}):(e.substring(0,2)==m?e=e.substr(2):e.charAt(0)==m.charAt(0)?e=e.substr(1):e.charAt(e.length-1)==m.charAt(0)&&(e=e.slice(0,-1)),e.charAt(e.length-1)==m.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),A&&(A=!1)},E=function(e){if(!p){var t=u.value;F(t),_()}},S=function(e,t,r){var i=e.clipboardData||window.clipboardData;if(i&&!a){var s=l||r?"Text":"text/plain";try{return t?!1!==i.setData(s,t):i.getData(s)}catch(e){if(!r)return S(e,t,!0)}}},R=function(e,s){var n=t.getCopyText();if(!n)return i.preventDefault(e);S(e,n)?(s?t.onCut():t.onCopy(),i.preventDefault(e)):(g=!0,u.value=n,u.select(),setTimeout(function(){g=!1,_(),r(),s?t.onCut():t.onCopy()}))},D=function(e){R(e,!0)},q=function(e){R(e,!1)},L=function(e){var n=S(e);"string"==typeof n?(n&&t.onPaste(n,e),s.isIE&&setTimeout(r),i.preventDefault(e)):(u.value="",h=!0)};i.addCommandKeyListener(u,t.onCommandKey.bind(t)),i.addListener(u,"select",k),i.addListener(u,"input",E),i.addListener(u,"cut",D),i.addListener(u,"copy",q),i.addListener(u,"paste",L),"oncut"in u&&"oncopy"in u&&"onpaste"in u||i.addListener(e,"keydown",function(e){if((!s.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:q(e);break;case 86:L(e);break;case 88:D(e)}});var $=function(e){p||!t.onCompositionStart||t.$readOnly||(p={},p.canUndo=t.session.$undoManager,t.onCompositionStart(),setTimeout(T,0),t.on("mousedown",B),p.canUndo&&!t.selection.isEmpty()&&(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},T=function(){if(p&&t.onCompositionUpdate&&!t.$readOnly){var e=u.value.replace(/\u2028/g,"");if(p.lastValue!==e&&(t.onCompositionUpdate(e),p.lastValue&&t.undo(),p.canUndo&&(p.lastValue=e),p.lastValue)){var r=t.selection.getRange();t.insert(p.lastValue),t.session.markUndoGroup(),p.range=t.selection.getRange(),t.selection.setRange(r),t.selection.clearSelection()}}},B=function(e){if(t.onCompositionEnd&&!t.$readOnly){var r=p;p=!1;var i=setTimeout(function(){i=null;var e=u.value.replace(/\u2028/g,"");p||(e==r.lastValue?_():!r.lastValue&&e&&(_(),F(e)))});C=function(e){return i&&clearTimeout(i),(e=e.replace(/\u2028/g,""))==r.lastValue?"":(r.lastValue&&i&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",B),"compositionend"==e.type&&r.range&&t.selection.setRange(r.range);(!!s.isChrome&&s.isChrome>=53||!!s.isWebKit&&s.isWebKit>=603)&&E()}},M=o.delayedCall(T,50);i.addListener(u,"compositionstart",$),s.isGecko?i.addListener(u,"text",function(){M.schedule()}):(i.addListener(u,"keyup",function(){M.schedule()}),i.addListener(u,"keydown",function(){M.schedule()})),i.addListener(u,"compositionend",B),this.getElement=function(){return u},this.setReadOnly=function(e){u.readOnly=e},this.onContextMenu=function(e){A=!0,r(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){f||(f=u.style.cssText),u.style.cssText=(r?"z-index:100000;":"")+"height:"+u.style.height+";"+(s.isIE?"opacity:0.1;":"");var o=t.container.getBoundingClientRect(),a=n.computedStyle(t.container),l=o.top+(parseInt(a.borderTopWidth)||0),c=o.left+(parseInt(o.borderLeftWidth)||0),_=o.bottom-l-u.clientHeight-2,m=function(e){u.style.left=e.clientX-c-2+"px",u.style.top=Math.min(e.clientY-l-2,_)+"px"};m(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(O),s.isWin&&i.capture(t.container,m,d))},this.onContextMenuClose=d;var O,I=function(e){t.textInput.onContextMenu(e),d()};i.addListener(u,"mouseup",I),i.addListener(u,"mousedown",function(e){e.preventDefault(),d()}),i.addListener(t.renderer.scroller,"contextmenu",I),i.addListener(u,"contextmenu",I)};t.TextInput=_}),define("ace/mouse/default_handlers",["require","exports","module","../lib/dom","../lib/event","../lib/useragent"],function(e,t,r){"use strict";function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),t.setDefaultHandler("touchmove",this.onTouchMove.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t,r,i){return Math.sqrt(Math.pow(r-e,2)+Math.pow(i-t,2))}function n(e,t){if(e.start.row==e.end.row)var r=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var r=2*t.row-e.start.row-e.end.row;else var r=t.column-4;return r<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var o=(e("../lib/dom"),e("../lib/event"),e("../lib/useragent"));(function(){this.onMouseDown=function(e){var t=e.inSelection(),r=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();if(0!==s){var n=i.getSelectionRange(),a=n.isEmpty();return i.$blockScrolling++,(a||1==s)&&i.selection.moveToPosition(r),i.$blockScrolling--,void(2==s&&(i.textInput.onContextMenu(e.domEvent),o.isMozilla||e.preventDefault()))}return this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(r,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var r=this.editor;r.$blockScrolling++,this.mousedownEvent.getShiftKey()?r.selection.selectToPosition(e):t||r.selection.moveToPosition(e),t||this.select(),r.renderer.scroller.setCapture&&r.renderer.scroller.setCapture(),r.setStyle("ace_selecting"),this.setState("select"),r.$blockScrolling--},this.select=function(){var e,t=this.editor,r=t.renderer.screenToTextCoordinates(this.x,this.y);if(t.$blockScrolling++,this.$clickSelection){var i=this.$clickSelection.comparePoint(r);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var s=n(this.$clickSelection,r);r=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(r),t.$blockScrolling--,t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,r=this.editor,i=r.renderer.screenToTextCoordinates(this.x,this.y),s=r.selection[e](i.row,i.column);if(r.$blockScrolling++,this.$clickSelection){var o=this.$clickSelection.comparePoint(s.start),a=this.$clickSelection.comparePoint(s.end);if(-1==o&&a<=0)t=this.$clickSelection.end,s.end.row==i.row&&s.end.column==i.column||(i=s.start);else if(1==a&&o>=0)t=this.$clickSelection.start,s.start.row==i.row&&s.start.column==i.column||(i=s.end);else if(-1==o&&1==a)i=s.end,t=s.start;else{var l=n(this.$clickSelection,i);i=l.cursor,t=l.anchor}r.selection.setSelectionAnchor(t.row,t.column)}r.selection.selectToPosition(i),r.$blockScrolling--,r.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>0||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),r=this.editor,i=r.session,s=i.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=r.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),r=this.editor;this.setState("selectByLines");var i=r.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=r.selection.getLineRange(i.start.row),this.$clickSelection.end=r.selection.getLineRange(i.end.row).end):this.$clickSelection=r.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var r=this.$lastScroll,i=e.domEvent.timeStamp,s=i-r.t,n=e.wheelX/s,o=e.wheelY/s;s<250&&(n=(n+r.vx)/2,o=(o+r.vy)/2);var a=Math.abs(n/o),l=!1;if(a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)r.allowed=i;else if(i-r.allowed<250){var c=Math.abs(n)<=1.1*Math.abs(r.vx)&&Math.abs(o)<=1.1*Math.abs(r.vy);c?(l=!0,r.allowed=i):r.allowed=0}return r.t=i,r.vx=n,r.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},this.onTouchMove=function(e){this.editor._emit("mousewheel",e)}}).call(i.prototype),t.DefaultHandlers=i}),define("ace/tooltip",["require","exports","module","./lib/oop","./lib/dom"],function(e,t,r){"use strict";function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var s=(e("./lib/oop"),e("./lib/dom"));(function(){this.$init=function(){return this.$element=s.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){s.setInnerText(this.getElement(),e)},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){s.addCssClass(this.getElement(),e)},this.show=function(e,t,r){null!=e&&this.setText(e),null!=t&&null!=r&&this.setPosition(t,r),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),define("ace/mouse/default_gutter_handler",["require","exports","module","../lib/dom","../lib/oop","../lib/event","../tooltip"],function(e,t,r){"use strict";function i(e){function t(){var t=d.getDocumentPosition().row,s=l.$annotations[t];if(!s)return r();if(t==o.session.getLength()){var n=o.renderer.pixelToScreenCoordinates(0,d.y).row,a=d.$pos;if(n>o.session.documentToScreenRow(a.row,a.column))return r()}if(u!=s)if(u=s.text.join("
"),c.setHtml(u),c.show(),o._signal("showGutterTooltip",c),o.on("mousewheel",r),e.$tooltipFollowsMouse)i(d);else{var _=d.domEvent.target,m=_.getBoundingClientRect(),g=c.getElement().style;g.left=m.right+"px",g.top=m.bottom+"px"}}function r(){_&&(_=clearTimeout(_)),u&&(c.hide(),u=null,o._signal("hideGutterTooltip",c),o.removeEventListener("mousewheel",r))}function i(e){c.setPosition(e.x,e.y)}var o=e.editor,l=o.renderer.$gutterLayer,c=new s(o.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()){if("foldWidgets"!=l.getRegion(t)){var r=t.getDocumentPosition().row,i=o.session.selection;if(t.getShiftKey())i.selectTo(r,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(r)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var _,d,u;e.editor.setDefaultHandler("guttermousemove",function(s){var o=s.domEvent.target||s.domEvent.srcElement;if(n.hasCssClass(o,"ace_fold-widget"))return r();u&&e.$tooltipFollowsMouse&&i(s),d=s,_||(_=setTimeout(function(){_=null,d&&!e.isMousePressed?t():r()},50))}),a.addListener(o.renderer.$gutter,"mouseout",function(e){d=null,u&&!_&&(_=setTimeout(function(){_=null,r()},50))}),o.on("changeSession",r)}function s(e){l.call(this,e)}var n=e("../lib/dom"),o=e("../lib/oop"),a=e("../lib/event"),l=e("../tooltip").Tooltip;o.inherits(s,l),function(){this.setPosition=function(e,t){var r=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),n=this.getHeight();e+=15,t+=15,e+s>r&&(e-=e+s-r),t+n>i&&(t-=20+n),l.prototype.setPosition.call(this,e,t)}}.call(s.prototype),t.GutterHandler=i}),define("ace/mouse/mouse_event",["require","exports","module","../lib/event","../lib/useragent"],function(e,t,r){"use strict";var i=e("../lib/event"),s=e("../lib/useragent"),n=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var r=this.getDocumentPosition();this.$inSelection=t.contains(r.row,r.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=s.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(n.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","../lib/dom","../lib/event","../lib/useragent"],function(e,t,r){"use strict";function i(e){function t(e,t){var r=Date.now(),i=!t||e.row!=t.row,n=!t||e.column!=t.column;if(!E||i||n)p.$blockScrolling+=1,p.moveCursorToPosition(e),p.$blockScrolling-=1,E=r,S={x:y,y:w};else{s(S.x,S.y,y,w)>_?E=null:r-E>=c&&(p.renderer.scrollCursorIntoView(),E=null)}}function r(e,t){var r=Date.now(),i=p.renderer.layerConfig.lineHeight,s=p.renderer.layerConfig.characterWidth,n=p.renderer.scroller.getBoundingClientRect(),o={x:{left:y-n.left,right:n.right-y},y:{top:w-n.top,bottom:n.bottom-w}},a=Math.min(o.x.left,o.x.right),c=Math.min(o.y.top,o.y.bottom),_={row:e.row,column:e.column};a/s<=2&&(_.column+=o.x.left=l&&p.renderer.scrollCursorIntoView(_):F=r:F=null}function i(){var e=k;k=p.renderer.screenToTextCoordinates(y,w),t(k,e),r(k,e)}function d(){x=p.selection.toOrientedRange(),b=p.session.addMarker(x,"ace_selection",p.getSelectionStyle()),p.clearSelection(),p.isFocused()&&p.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),i(),v=setInterval(i,20),D=0,o.addListener(document,"mousemove",m)}function u(){clearInterval(v),p.session.removeMarker(b),b=null,p.$blockScrolling+=1,p.selection.fromOrientedRange(x),p.$blockScrolling-=1,p.isFocused()&&!A&&p.renderer.$cursorLayer.setBlinking(!p.getReadOnly()),x=null,k=null,D=0,F=null,E=null,o.removeListener(document,"mousemove",m)}function m(){null==q&&(q=setTimeout(function(){null!=q&&b&&u()},20))}function g(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function h(e){var t=["copy","copymove","all","uninitialized"],r=["move","copymove","linkmove","all","uninitialized"],i=a.isMac?e.altKey:e.ctrlKey,s="uninitialized";try{s=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var n="none";return i&&t.indexOf(s)>=0?n="copy":r.indexOf(s)>=0?n="move":t.indexOf(s)>=0&&(n="copy"),n}var p=e.editor,f=n.createElement("img");f.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.isOpera&&(f.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),p.addEventListener("mousedown",this.onMouseDown.bind(e));var b,y,w,v,x,k,C,A,F,E,S,R=p.container,D=0;this.onDragStart=function(e){if(this.cancelDrag||!R.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}x=p.getSelectionRange();var r=e.dataTransfer;r.effectAllowed=p.getReadOnly()?"copy":"copyMove",a.isOpera&&(p.container.appendChild(f),f.scrollTop=0),r.setDragImage&&r.setDragImage(f,0,0),a.isOpera&&p.container.removeChild(f),r.clearData(),r.setData("Text",p.session.getTextRange()),A=!0,this.setState("drag")},this.onDragEnd=function(e){if(R.draggable=!1,A=!1,this.setState(null),!p.getReadOnly()){var t=e.dataTransfer.dropEffect;C||"move"!=t||p.session.remove(p.getSelectionRange()),p.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!p.getReadOnly()&&g(e.dataTransfer))return y=e.clientX,w=e.clientY,b||d(),D++,e.dataTransfer.dropEffect=C=h(e),o.preventDefault(e)},this.onDragOver=function(e){if(!p.getReadOnly()&&g(e.dataTransfer))return y=e.clientX,w=e.clientY,b||(d(),D++),null!==q&&(q=null),e.dataTransfer.dropEffect=C=h(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--D<=0&&b)return u(),C=null,o.preventDefault(e)},this.onDrop=function(e){if(k){var t=e.dataTransfer;if(A)switch(C){case"move":x=x.contains(k.row,k.column)?{start:k,end:k}:p.moveText(x,k);break;case"copy":x=p.moveText(x,k,!0)}else{var r=t.getData("Text");x={start:k,end:p.session.insert(k,r)},p.focus(),C=null}return u(),o.preventDefault(e)}},o.addListener(R,"dragstart",this.onDragStart.bind(e)),o.addListener(R,"dragend",this.onDragEnd.bind(e)),o.addListener(R,"dragenter",this.onDragEnter.bind(e)),o.addListener(R,"dragover",this.onDragOver.bind(e)),o.addListener(R,"dragleave",this.onDragLeave.bind(e)),o.addListener(R,"drop",this.onDrop.bind(e));var q=null}function s(e,t,r,i){return Math.sqrt(Math.pow(r-e,2)+Math.pow(i-t,2))}var n=e("../lib/dom"),o=e("../lib/event"),a=e("../lib/useragent"),l=200,c=200,_=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=a.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&"dragReady"==this.state){var r=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>3&&t.dragDrop()}if("dragWait"===this.state){var r=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,r=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&r){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s&&(s.unselectable="on"),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;t.container.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(i.prototype),t.DragdropHandler=i}),define("ace/lib/net",["require","exports","module","./dom"],function(e,t,r){"use strict";var i=e("./dom");t.get=function(e,t){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&t(r.responseText)},r.send(null)},t.loadScript=function(e,t){var r=i.getDocumentHead(),s=document.createElement("script");s.src=e,r.appendChild(s),s.onload=s.onreadystatechange=function(e,r){!r&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,r||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,r){"use strict";var i={},s=function(){this.propagationStopped=!0},n=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[e]||[],i=this._defaultHandlers[e];if(r.length||i){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=n),r=r.slice();for(var o=0;o1&&(s=r[r.length-2]);var o=c[t+"Path"];return null==o?o=c.basePath:"/"==i&&(t=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+i+s+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(r,i){var s,n;Array.isArray(r)&&(n=r[0],r=r[1]);try{s=e(r)}catch(e){}if(s&&!t.$loading[r])return i&&i(s);if(t.$loading[r]||(t.$loading[r]=[]),t.$loading[r].push(i),!(t.$loading[r].length>1)){var a=function(){e([r],function(e){t._emit("load.module",{name:r,module:e});var i=t.$loading[r];t.$loading[r]=null,i.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();o.loadScript(t.moduleUrl(r,n),a)}},t.init=i}),define("ace/mouse/mouse_handler",["require","exports","module","../lib/event","../lib/useragent","./default_handlers","./default_gutter_handler","./mouse_event","./dragdrop_handler","../config"],function(e,t,r){"use strict";var i=e("../lib/event"),s=e("../lib/useragent"),n=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("../config"),_=function(e){var t=this;this.editor=e,new n(this),new o(this),new l(this);var r=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},a=e.renderer.getMouseEventTarget();i.addListener(a,"click",this.onMouseEvent.bind(this,"click")),i.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove")),i.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),i.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),i.addTouchMoveListener(e.container,this.onTouchMove.bind(this,"touchmove"));var c=e.renderer.$gutter;i.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),i.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),i.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),i.addListener(c,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),i.addListener(a,"mousedown",r),i.addListener(c,"mousedown",r),s.isIE&&e.renderer.scrollBarV&&(i.addListener(e.renderer.scrollBarV.element,"mousedown",r),i.addListener(e.renderer.scrollBarH.element,"mousedown",r)),e.on("mousemove",function(r){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var i=e.renderer.screenToTextCoordinates(r.x,r.y),s=e.session.selection.getRange(),n=e.renderer;!s.isEmpty()&&s.insideStart(i.row,i.column)?n.setCursorStyle("default"):n.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var r=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;r&&r.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var r=new a(t,this.editor);r.speed=2*this.$scrollSpeed,r.wheelX=t.wheelX,r.wheelY=t.wheelY,this.editor._emit(e,r)},this.onTouchMove=function(e,t){var r=new a(t,this.editor);r.speed=1,r.wheelX=t.wheelX,r.wheelY=t.wheelY,this.editor._emit(e,r)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var r=this.editor.renderer;r.$keepTextAreaAtCursor&&(r.$keepTextAreaAtCursor=null);var n=this,o=function(e){if(e){if(s.isWebKit&&!e.which&&n.releaseMouse)return n.releaseMouse();n.x=e.clientX,n.y=e.clientY,t&&t(e),n.mouseEvent=new a(e,n.editor),n.$mouseMoved=!0}},l=function(e){clearInterval(_),c(),n[n.state+"End"]&&n[n.state+"End"](e),n.state="",null==r.$keepTextAreaAtCursor&&(r.$keepTextAreaAtCursor=!0,r.$moveTextAreaToCursor()),n.isMousePressed=!1,n.$onCaptureMouseMove=n.releaseMouse=null,e&&n.onMouseEvent("mouseup",e)},c=function(){n[n.state]&&n[n.state](),n.$mouseMoved=!1};if(s.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){l(e)});n.$onCaptureMouseMove=o,n.releaseMouse=i.capture(this.editor.container,o,l);var _=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&i.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(_.prototype),c.defineOptions(_.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:s.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=_}),define("ace/mouse/fold_handler",["require","exports","module"],function(e,t,r){"use strict";function i(e){e.on("click",function(t){var r=t.getDocumentPosition(),i=e.session,s=i.getFoldAt(r.row,r.column,1);s&&(t.getAccelKey()?i.removeFold(s):i.expandFold(s),t.stop())}),e.on("gutterclick",function(t){ -if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),n=s.range||s.firstRange;if(n){r=n.start.row;var o=i.getFoldAt(r,i.getLine(r).length,1);o?i.removeFold(o):(i.addFold("...",n),e.renderer.scrollCursorIntoView({row:n.start.row,column:0}))}t.stop()}})}t.FoldHandler=i}),define("ace/keyboard/keybinding",["require","exports","module","../lib/keys","../lib/event"],function(e,t,r){"use strict";var i=e("../lib/keys"),s=e("../lib/event"),n=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var r=this.$handlers.indexOf(e);-1!=r&&this.$handlers.splice(r,1),void 0==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==r&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(r){return r.getStatusText&&r.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,r,i){for(var n,o=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((n=this.$handlers[l].handleKeyboard(this.$data,e,t,r,i))&&n.command&&(o="null"==n.command||a.exec(n.command,this.$editor,n.args,i),o&&i&&-1!=e&&1!=n.passEvent&&1!=n.command.passEvent&&s.stopEvent(i),o)););return o||-1!=e||(n={command:"insertstring"},o=a.exec("insertstring",this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal("keyboardActivity",n),o},this.onCommandKey=function(e,t,r){var s=i.keyCodeToString(r);this.$callKeyboardHandlers(t,s,r,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(n.prototype),t.KeyBinding=n}),define("ace/lib/bidiutil",["require","exports","module"],function(e,t,r){"use strict";function i(e,t,r,i){var s=a?g:m,h=null,p=null,f=null,b=0,y=null,w=-1,k=null,A=null,F=[];if(!i)for(k=0,i=[];k0)if(16==y){for(k=w;k-1){for(k=w;k=0&&i[E]==C;E--)t[E]=a}}function s(e,t,r){if(!(l=e){for(i=_+1;i=e;)i++;for(s=_,n=i-1;s=t.length||(s=r[i-1])!=b&&s!=y||(n=t[i+1])!=b&&n!=y?w:(c&&(n=y),n==s?n:w);case F:return s=i>0?r[i-1]:v,s==b&&i+10&&r[i-1]==b)return b;if(c)return w;for(l=i+1,o=t.length;l=1425&&g<=2303||64286==g;if(s=t[l],h&&(s==f||s==k))return f}return i<1||(s=t[i-1])==v?w:r[i-1];case v:return c=!1,d=!0,a;case x:return u=!0,w;case R:case D:case L:case $:case q:c=!1;case T:return w}}function o(e){var t=e.charCodeAt(0),r=t>>8;return 0==r?t>191?p:B[t]:5==r?/[\u0591-\u05f4]/.test(e)?f:p:6==r?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?S:/[\u0660-\u0669\u066b-\u066c]/.test(e)?y:1642==t?E:/[\u06f0-\u06f9]/.test(e)?b:k:32==r&&t<=8287?M[255&t]:254==r&&t>=65136?k:w}var a=0,l=0,c=!1,_=!1,d=!1,u=!1,m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],g=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h=1,p=0,f=1,b=2,y=3,w=4,v=5,x=6,k=7,C=8,A=9,F=10,E=11,S=12,R=13,D=14,q=15,L=16,$=17,T=18,B=[T,T,T,T,T,T,T,T,T,x,v,x,C,v,T,T,T,T,T,T,T,T,T,T,T,T,T,T,v,v,v,x,C,w,w,E,E,E,w,w,w,w,w,F,A,F,A,A,b,b,b,b,b,b,b,b,b,b,A,w,w,w,w,w,w,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,w,w,w,w,w,w,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,w,w,w,w,T,T,T,T,T,T,v,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,A,w,E,E,E,E,w,w,w,w,p,w,w,T,w,w,E,E,b,b,w,p,w,w,w,b,p,w,w,w,w,w],M=[C,C,C,C,C,C,C,C,C,C,C,T,T,T,p,f,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,C,v,R,D,q,L,$,A,E,E,E,E,E,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,A,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,C];t.L=p,t.R=f,t.EN=b,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.DOT="·",t.doBidiReorder=function(e,r,n){if(e.length<2)return{};var o=e.split(""),l=new Array(o.length),c=new Array(o.length),_=[];a=n?h:0,i(o,_,o.length,r);for(var d=0;dk&&r[d]0&&"ل"===o[d-1]&&/\u0622|\u0623|\u0625|\u0627/.test(o[d])&&(_[d-1]=_[d]=t.R_H,d++);o[o.length-1]===t.DOT&&(_[o.length-1]=t.B);for(var d=0;d=0&&(e=this.session.$docRowCache[r])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var r,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(r=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=r,e++;return e},this.updateRowLine=function(e,t){if(void 0===e&&(e=this.getDocumentRow()),this.wrapIndent=0,this.isLastRow=e===this.session.getLength()-1,this.line=this.session.getLine(e),this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(void 0===t&&(t=this.getSplitIndex()),t>0&&r.length?(this.wrapIndent=r.indent,this.line=t0?e-1:0,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;0===e&&r[t]%2!=0&&t++;for(var n=0;n=c&&s<_,d&&!u?m=a:!d&&u&&l.push({left:m,width:a-m}),a+=this.charWidths[r],u=d;return d&&g===o.length&&l.push({left:m,width:a-m}),l},this.offsetToCol=function(e){var t=0,e=Math.max(e,0),r=0,s=0,n=this.bidiMap.bidiLevels,o=this.charWidths[n[s]];for(this.wrapIndent&&(e-=this.wrapIndent*this.charWidths[i.L]);e>r+o/2;){if(r+=o,s===n.length-1){o=0;break}o=this.charWidths[n[++s]]}return s>0&&n[s-1]%2!=0&&n[s]%2==0?(e0&&n[s-1]%2==0&&n[s]%2!=0?t=1+(e>r?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===n.length-1&&0===o&&n[s-1]%2==0||!this.isRtlDir&&0===s&&n[s]%2!=0?t=1+this.bidiMap.logicalFromVisual[s]:(s>0&&n[s-1]%2!=0&&0!==o&&s--,t=this.bidiMap.logicalFromVisual[s]),t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),define("ace/range",["require","exports","module"],function(e,t,r){"use strict";var i=function(e,t){return e.row-t.row||e.column-t.column},s=function(e,t,r,i){this.start={row:e,column:t},this.end={row:r,column:i}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,r=e.end,i=e.start;return t=this.compare(r.row,r.column),1==t?(t=this.compare(i.row,i.column),1==t?2:0==t?1:0):-1==t?-2:(t=this.compare(i.row,i.column),-1==t?-1:1==t?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var r={row:t+1,column:0};else if(this.end.rowt)var i={row:t+1,column:0};else if(this.start.rowt.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var r=e||this.lead;e=r.row,t=r.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var r,i="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(i);return s?(i=s.start.row,r=s.end.row):r=i,!0===t?new o(i,0,r,this.session.getLine(r).length):new o(i,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,r){var i=e.column,s=e.column+t;return r<0&&(i=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,s).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var r=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,r,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-r):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=i)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,r=this.doc.getLine(e),i=r.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);return s?void this.moveCursorTo(s.end.row,s.end.column):(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=r.substring(t)),t>=r.length?(this.moveCursorTo(e,r.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(n)&&(r-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,r)},this.$shortWordEndIndex=function(e){var t,r=0,i=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))r=this.session.tokenRe.lastIndex;else{for(;(t=e[r])&&i.test(t);)r++;if(r<1)for(s.lastIndex=0;(t=e[r])&&!s.test(t);)if(s.lastIndex=0,r++,i.test(t)){if(r>2){r--;break}for(;(t=e[r])&&i.test(t);)r++;if(r>2)break}}return s.lastIndex=0,r},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,r=this.doc.getLine(e),i=r.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==r.length){var n=this.doc.getLength();do{e++,i=this.doc.getLine(e)}while(e0&&/^\s*$/.test(i));r=i.length,/\s+$/.test(i)||(i="")}var n=s.stringReverse(i),o=this.$shortWordEndIndex(n);return this.moveCursorTo(t,r-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var r,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column);var s=this.session.screenToDocumentPosition(i.row+e,i.column,r);0!==e&&0===t&&s.row===this.lead.row&&s.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[s.row]&&(s.row>0||e>0)&&s.row++,this.moveCursorTo(s.row,s.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,r){var i=this.session.getFoldAt(e,t,1);i&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,r||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,r){var i=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(i.row,i.column,r)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var r=this.getCursor();return o.fromPoints(t,r)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(void 0==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var r=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(r.cursor=r.start),this.addRange(r,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),define("ace/tokenizer",["require","exports","module","./config"],function(e,t,r){"use strict";var i=e("./config"),s=2e3,n=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){for(var r=this.states[t],i=[],s=0,n=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:c.token),d>1&&(/\\\d/.test(c.regex)?_=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(d=1,_=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),n[s]=l,s+=d,i.push(_),c.onMatch||(c.onMatch=null)}}i.length||(n[0]=0,i.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){s=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),r=this.token.apply(this,t);if("string"==typeof r)return[{type:r,value:e}];for(var i=[],s=0,n=r.length;s_){var f=e.substring(_,p-h.length);u.type==m?u.value+=f:(u.type&&c.push(u),u={type:m,value:f})}for(var b=0;bs){for(d>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});_1&&r[0]!==i&&r.unshift("#tmp",i),{tokens:c,state:r.length?r:i}},this.reportError=i.reportError}).call(n.prototype),t.Tokenizer=n}),define("ace/mode/text_highlight_rules",["require","exports","module","../lib/lang"],function(e,t,r){"use strict";var i=e("../lib/lang"),s=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var r in e){for(var i=e[r],s=0;s1&&s(l,"")>-1&&(r=RegExp(this.source,n.replace.call(i(this),"g","")),n.replace.call(e.slice(l.index),r,function(){for(var e=1;el.index&&this.lastIndex--}return l},a||(RegExp.prototype.test=function(e){var t=n.exec.call(this,e);return t&&this.global&&!t[0].length&&this.lastIndex>t.index&&this.lastIndex--,!!t}))}),define("ace/lib/es5-shim",["require","exports","module"],function(e,t,r){function i(){}function s(e){try{return Object.defineProperty(e,"sentinel",{}),"sentinel"in e}catch(e){}}function n(e){return e=+e,e!==e?e=0:0!==e&&e!==1/0&&e!==-1/0&&(e=(e>0||-1)*Math.floor(Math.abs(e))),e}Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if("function"!=typeof t)throw new TypeError("Function.prototype.bind called on incompatible "+t);var r=g.call(arguments,1),s=function(){if(this instanceof s){var i=t.apply(this,r.concat(g.call(arguments)));return Object(i)===i?i:this}return t.apply(e,r.concat(g.call(arguments)))};return t.prototype&&(i.prototype=t.prototype,s.prototype=new i,i.prototype=null),s});var o,a,l,c,_,d=Function.prototype.call,u=Array.prototype,m=Object.prototype,g=u.slice,h=d.bind(m.toString),p=d.bind(m.hasOwnProperty);if((_=p(m,"__defineGetter__"))&&(o=d.bind(m.__defineGetter__),a=d.bind(m.__defineSetter__),l=d.bind(m.__lookupGetter__),c=d.bind(m.__lookupSetter__)),2!=[1,2].splice(0).length)if(function(){function e(e){var t=new Array(e+2);return t[0]=t[1]=0,t}var t,r=[];if(r.splice.apply(r,e(20)),r.splice.apply(r,e(26)),t=r.length,r.splice(5,0,"XXX"),r.length,t+1==r.length)return!0}()){var f=Array.prototype.splice;Array.prototype.splice=function(e,t){return arguments.length?f.apply(this,[void 0===e?0:e,void 0===t?this.length-e:t].concat(g.call(arguments,2))):[]}}else Array.prototype.splice=function(e,t){var r=this.length;e>0?e>r&&(e=r):void 0==e?e=0:e<0&&(e=Math.max(r+e,0)),e+ta)for(d=c;d--;)this[l+d]=this[a+d];if(n&&e===_)this.length=_,this.push.apply(this,s);else for(this.length=_+n,d=0;d>>0;if("[object Function]"!=h(e))throw new TypeError;for(;++s>>0,s=Array(i),n=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var o=0;o>>0,n=[],o=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var a=0;a>>0,s=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var n=0;n>>0,s=arguments[1];if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");for(var n=0;n>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduce of empty array with no initial value");var s,n=0;if(arguments.length>=2)s=arguments[1];else for(;;){if(n in r){s=r[n++];break}if(++n>=i)throw new TypeError("reduce of empty array with no initial value")}for(;n>>0;if("[object Function]"!=h(e))throw new TypeError(e+" is not a function");if(!i&&1==arguments.length)throw new TypeError("reduceRight of empty array with no initial value");var s,n=i-1;if(arguments.length>=2)s=arguments[1];else for(;;){if(n in r){s=r[n--];break}if(--n<0)throw new TypeError("reduceRight of empty array with no initial value")}do{n in this&&(s=e.call(void 0,s,r[n],n,t))}while(n--);return s}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(e){var t=y&&"[object String]"==h(this)?this.split(""):q(this),r=t.length>>>0;if(!r)return-1;var i=0;for(arguments.length>1&&(i=n(arguments[1])),i=i>=0?i:Math.max(0,r+i);i>>0;if(!r)return-1;var i=r-1;for(arguments.length>1&&(i=Math.min(i,n(arguments[1]))),i=i>=0?i:r-Math.abs(i);i>=0;i--)if(i in t&&e===t[i])return i;return-1}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__||(e.constructor?e.constructor.prototype:m)}),!Object.getOwnPropertyDescriptor){Object.getOwnPropertyDescriptor=function(e,t){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.getOwnPropertyDescriptor called on a non-object: "+e);if(p(e,t)){var r,i,s;if(r={enumerable:!0,configurable:!0},_){var n=e.__proto__;e.__proto__=m;var i=l(e,t),s=c(e,t);if(e.__proto__=n,i||s)return i&&(r.get=i),s&&(r.set=s),r}return r.value=e[t],r}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(e){return Object.keys(e)}),!Object.create){var w;w=null===Object.prototype.__proto__?function(){return{__proto__:null}}:function(){var e={};for(var t in e)e[t]=null;return e.constructor=e.hasOwnProperty=e.propertyIsEnumerable=e.isPrototypeOf=e.toLocaleString=e.toString=e.valueOf=e.__proto__=null,e},Object.create=function(e,t){var r;if(null===e)r=w();else{if("object"!=typeof e)throw new TypeError("typeof prototype["+typeof e+"] != 'object'");var i=function(){};i.prototype=e,r=new i,r.__proto__=e}return void 0!==t&&Object.defineProperties(r,t),r}}if(Object.defineProperty){var v=s({}),x="undefined"==typeof document||s(document.createElement("div"));if(!v||!x)var k=Object.defineProperty}if(!Object.defineProperty||k){Object.defineProperty=function(e,t,r){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.defineProperty called on non-object: "+e);if("object"!=typeof r&&"function"!=typeof r||null===r)throw new TypeError("Property description must be an object: "+r);if(k)try{return k.call(Object,e,t,r)}catch(e){}if(p(r,"value"))if(_&&(l(e,t)||c(e,t))){var i=e.__proto__;e.__proto__=m,delete e[t],e[t]=r.value,e.__proto__=i}else e[t]=r.value;else{if(!_)throw new TypeError("getters & setters can not be defined on this javascript engine");p(r,"get")&&o(e,t,r.get),p(r,"set")&&a(e,t,r.set)}return e}}Object.defineProperties||(Object.defineProperties=function(e,t){for(var r in t)p(t,r)&&Object.defineProperty(e,r,t[r]);return e}),Object.seal||(Object.seal=function(e){return e}),Object.freeze||(Object.freeze=function(e){return e});try{Object.freeze(function(){})}catch(e){Object.freeze=function(e){return function(t){return"function"==typeof t?t:e(t)}}(Object.freeze)}if(Object.preventExtensions||(Object.preventExtensions=function(e){return e}),Object.isSealed||(Object.isSealed=function(e){return!1}),Object.isFrozen||(Object.isFrozen=function(e){return!1}),Object.isExtensible||(Object.isExtensible=function(e){if(Object(e)===e)throw new TypeError;for(var t="";p(e,t);)t+="?";e[t]=!0;var r=p(e,t);return delete e[t],r}),!Object.keys){var C=!0,A=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],F=A.length;for(var E in{toString:null})C=!1;Object.keys=function(e){if("object"!=typeof e&&"function"!=typeof e||null===e)throw new TypeError("Object.keys called on a non-object");var t=[];for(var r in e)p(e,r)&&t.push(r);if(C)for(var i=0,s=F;i=0?parseFloat((s.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((s.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=(window.Controllers||window.controllers)&&"Gecko"===window.navigator.product,t.isOldGecko=t.isGecko&&parseInt((s.match(/rv:(\d+)/)||[])[1],10)<4,t.isOpera=window.opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(s.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(s.split(" Chrome/")[1])||void 0,t.isAIR=s.indexOf("AdobeAIR")>=0,t.isIPad=s.indexOf("iPad")>=0,t.isChromeOS=s.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(s)&&!window.MSStream,t.isIOS&&(t.isMac=!0)}}),define("ace/lib/event",["require","exports","module","./keys","./useragent"],function(e,t,r){"use strict";function i(e,t,r){var i=c(t);if(!o.isMac&&a){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),a.altGr){if(3==(3&i))return;a.altGr=0}if(18===r||17===r){var s="location"in t?t.location:t.keyLocation;if(17===r&&1===s)1==a[r]&&(l=t.timeStamp);else if(18===r&&3===i&&2===s){var _=t.timeStamp-l;_<50&&(a.altGr=!0)}}}if(r in n.MODIFIER_KEYS&&(r=-1),8&i&&r>=91&&r<=93&&(r=-1),!i&&13===r){var s="location"in t?t.location:t.keyLocation;if(3===s&&(e(t,i,-r),t.defaultPrevented))return}if(o.isChromeOS&&8&i){if(e(t,i,r),t.defaultPrevented)return;i&=-9}return!!(i||r in n.FUNCTION_KEYS||r in n.PRINTABLE_KEYS)&&e(t,i,r)}function s(){a=Object.create(null)}var n=e("./keys"),o=e("./useragent"),a=null,l=0;t.addListener=function(e,t,r){if(e.addEventListener)return e.addEventListener(t,r,!1);if(e.attachEvent){var i=function(){r.call(e,window.event)};r._wrapper=i,e.attachEvent("on"+t,i)}},t.removeListener=function(e,t,r){if(e.removeEventListener)return e.removeEventListener(t,r,!1);e.detachEvent&&e.detachEvent("on"+t,r._wrapper||r)},t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},t.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||o.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.preventDefault?e.button:{1:0,2:2,4:1}[e.button]},t.capture=function(e,r,i){function s(e){r&&r(e),i&&i(e),t.removeListener(document,"mousemove",r,!0),t.removeListener(document,"mouseup",s,!0),t.removeListener(document,"dragstart",s,!0)}return t.addListener(document,"mousemove",r,!0),t.addListener(document,"mouseup",s,!0),t.addListener(document,"dragstart",s,!0),s},t.addTouchMoveListener=function(e,r){var i,s;t.addListener(e,"touchstart",function(e){var t=e.touches,r=t[0];i=r.clientX,s=r.clientY}),t.addListener(e,"touchmove",function(e){var t=e.touches;if(!(t.length>1)){var n=t[0];e.wheelX=i-n.clientX,e.wheelY=s-n.clientY,i=n.clientX,s=n.clientY,r(e)}})},t.addMouseWheelListener=function(e,r){"onmousewheel"in e?t.addListener(e,"mousewheel",function(e){void 0!==e.wheelDeltaX?(e.wheelX=-e.wheelDeltaX/8,e.wheelY=-e.wheelDeltaY/8):(e.wheelX=0,e.wheelY=-e.wheelDelta/8),r(e)}):"onwheel"in e?t.addListener(e,"wheel",function(e){switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.35*e.deltaX||0,e.wheelY=.35*e.deltaY||0;break;case e.DOM_DELTA_LINE:case e.DOM_DELTA_PAGE:e.wheelX=5*(e.deltaX||0),e.wheelY=5*(e.deltaY||0)}r(e)}):t.addListener(e,"DOMMouseScroll",function(e){e.axis&&e.axis==e.HORIZONTAL_AXIS?(e.wheelX=5*(e.detail||0),e.wheelY=0):(e.wheelX=0,e.wheelY=5*(e.detail||0)),r(e)})},t.addMultiMouseDownListener=function(e,r,i,s){function n(e){if(0!==t.getButton(e)?d=0:e.detail>1?++d>4&&(d=1):d=1,o.isIE){var n=Math.abs(e.clientX-l)>5||Math.abs(e.clientY-c)>5;_&&!n||(d=1),_&&clearTimeout(_),_=setTimeout(function(){_=null},r[d-1]||600),1==d&&(l=e.clientX,c=e.clientY)}if(e._clicks=d,i[s]("mousedown",e),d>4)d=0;else if(d>1)return i[s](u[d],e)}function a(e){d=2,_&&clearTimeout(_),_=setTimeout(function(){_=null},r[d-1]||600),i[s]("mousedown",e),i[s](u[d],e)}var l,c,_,d=0,u={2:"dblclick",3:"tripleclick",4:"quadclick"};Array.isArray(e)||(e=[e]),e.forEach(function(e){t.addListener(e,"mousedown",n),o.isOldIE&&t.addListener(e,"dblclick",a)})};var c=!o.isMac||!o.isOpera||"KeyboardEvent"in window?function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)}:function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0)};if(t.getModifierString=function(e){return n.KEY_MODS[c(e)]},t.addCommandKeyListener=function(e,r){var n=t.addListener;if(o.isOldGecko||o.isOpera&&!("KeyboardEvent"in window)){var l=null;n(e,"keydown",function(e){l=e.keyCode}),n(e,"keypress",function(e){return i(r,e,l)})}else{var c=null;n(e,"keydown",function(e){a[e.keyCode]=(a[e.keyCode]||0)+1;var t=i(r,e,e.keyCode);return c=e.defaultPrevented,t}),n(e,"keypress",function(e){c&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),c=null)}),n(e,"keyup",function(e){a[e.keyCode]=null}),a||(s(),n(window,"focus",s))}},"object"==typeof window&&window.postMessage&&!o.isOldIE){t.nextTick=function(e,r){r=r||window;t.addListener(r,"message",function i(s){"zero-timeout-message-1"==s.data&&(t.stopPropagation(s),t.removeListener(r,"message",i),e())}),r.postMessage("zero-timeout-message-1","*")}}t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}}),define("ace/lib/lang",["require","exports","module"],function(e,t,r){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>=1)&&(e+=e);return r};var i=/^\s\s*/,s=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(s,"")},t.copyObject=function(e){var t={};for(var r in e)t[r]=e[r];return t},t.copyArray=function(e){for(var t=[],r=0,i=e.length;rg.length?e=e.substr(9):e.substr(0,4)==g.substr(0,4)?e=e.substr(4,e.length-g.length+1):e.charAt(e.length-1)==g.charAt(0)&&(e=e.slice(0,-1)),e==g.charAt(0)||e.charAt(e.length-1)==g.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),h&&(h=!1),E&&(E=!1))},R=function(e){if(!b){var t=m.value;S(t),d()}},D=function(e,t,r){var i=e.clipboardData||window.clipboardData;if(i&&!c){var s=_||r?"Text":"text/plain";try{return t?!1!==i.setData(s,t):i.getData(s)}catch(e){if(!r)return D(e,t,!0)}}},q=function(e,n){var o=t.getCopyText();if(!o)return i.preventDefault(e);D(e,o)?(s.isIOS&&(p=n,m.value="\n aa"+o+"a a\n",m.setSelectionRange(4,4+o.length),h={value:o}),n?t.onCut():t.onCopy(),s.isIOS||i.preventDefault(e)):(h=!0,m.value=o,m.select(),setTimeout(function(){h=!1,d(),r(),n?t.onCut():t.onCopy()}))},$=function(e){q(e,!0)},L=function(e){q(e,!1)},T=function(e){var n=D(e);"string"==typeof n?(n&&t.onPaste(n,e),s.isIE&&setTimeout(r),i.preventDefault(e)):(m.value="",f=!0)};i.addCommandKeyListener(m,t.onCommandKey.bind(t)),i.addListener(m,"select",A),i.addListener(m,"input",R),i.addListener(m,"cut",$),i.addListener(m,"copy",L),i.addListener(m,"paste",T);var B=function(e){b||!t.onCompositionStart||t.$readOnly||(b={},b.canUndo=t.session.$undoManager,t.onCompositionStart(),setTimeout(M,0),t.on("mousedown",O),b.canUndo&&!t.selection.isEmpty()&&(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},M=function(){if(b&&t.onCompositionUpdate&&!t.$readOnly){var e=m.value.replace(/\x01/g,"");if(b.lastValue!==e&&(t.onCompositionUpdate(e),b.lastValue&&t.undo(),b.canUndo&&(b.lastValue=e),b.lastValue)){var r=t.selection.getRange();t.insert(b.lastValue),t.session.markUndoGroup(),b.range=t.selection.getRange(),t.selection.setRange(r),t.selection.clearSelection()}}},O=function(e){if(t.onCompositionEnd&&!t.$readOnly){var r=b;b=!1;var i=setTimeout(function(){i=null;var e=m.value.replace(/\x01/g,"");b||(e==r.lastValue?d():!r.lastValue&&e&&(d(),S(e)))});F=function(e){return i&&clearTimeout(i),(e=e.replace(/\x01/g,""))==r.lastValue?"":(r.lastValue&&i&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",O),"compositionend"==e.type&&r.range&&t.selection.setRange(r.range);(!!s.isChrome&&s.isChrome>=53||!!s.isWebKit&&s.isWebKit>=603)&&R()}},I=o.delayedCall(M,50);i.addListener(m,"compositionstart",B),s.isGecko?i.addListener(m,"text",function(){I.schedule()}):(i.addListener(m,"keyup",function(){I.schedule()}),i.addListener(m,"keydown",function(){I.schedule()})),i.addListener(m,"compositionend",O),this.getElement=function(){return m},this.setReadOnly=function(e){m.readOnly=e},this.onContextMenu=function(e){E=!0,r(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){y||(y=m.style.cssText),m.style.cssText=(r?"z-index:100000;":"")+"height:"+m.style.height+";"+(s.isIE?"opacity:0.1;":"");var o=t.container.getBoundingClientRect(),a=n.computedStyle(t.container),l=o.top+(parseInt(a.borderTopWidth)||0),c=o.left+(parseInt(o.borderLeftWidth)||0),_=o.bottom-l-m.clientHeight-2,d=function(e){m.style.left=e.clientX-c-2+"px",m.style.top=Math.min(e.clientY-l-2,_)+"px"};d(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(z),s.isWin&&i.capture(t.container,d,u))},this.onContextMenuClose=u;var z,P=function(e){t.textInput.onContextMenu(e),u()};if(i.addListener(m,"mouseup",P),i.addListener(m,"mousedown",function(e){e.preventDefault(),u()}),i.addListener(t.renderer.scroller,"contextmenu",P),i.addListener(m,"contextmenu",P),s.isIOS){var j=null,N=!1;e.addEventListener("keydown",function(e){j&&clearTimeout(j),N=!0}),e.addEventListener("keyup",function(e){j=setTimeout(function(){N=!1},100)});var W=function(e){if(document.activeElement===m&&!N){if(p)return setTimeout(function(){p=!1},100);var r=m.selectionStart,i=m.selectionEnd;if(m.setSelectionRange(4,5),r==i)switch(r){case 0:t.onCommandKey(null,0,a.up);break;case 1:t.onCommandKey(null,0,a.home);break;case 2:t.onCommandKey(null,l.option,a.left);break;case 4:t.onCommandKey(null,0,a.left);break;case 5:t.onCommandKey(null,0,a.right);break;case 7:t.onCommandKey(null,l.option,a.right);break;case 8:t.onCommandKey(null,0,a.end);break;case 9:t.onCommandKey(null,0,a.down)}else{switch(i){case 6:t.onCommandKey(null,l.shift,a.right);break;case 7:t.onCommandKey(null,l.shift|l.option,a.right);break;case 8:t.onCommandKey(null,l.shift,a.end);break;case 9:t.onCommandKey(null,l.shift,a.down)}switch(r){case 0:t.onCommandKey(null,l.shift,a.up);break;case 1:t.onCommandKey(null,l.shift,a.home);break;case 2:t.onCommandKey(null,l.shift|l.option,a.left);break;case 3:t.onCommandKey(null,l.shift,a.left)}}}};document.addEventListener("selectionchange",W),t.on("destroy",function(){document.removeEventListener("selectionchange",W)})}};t.TextInput=d}),define("ace/keyboard/textinput",["require","exports","module","../lib/event","../lib/useragent","../lib/dom","../lib/lang","./textinput_ios"],function(e,t,r){"use strict";var i=e("../lib/event"),s=e("../lib/useragent"),n=e("../lib/dom"),o=e("../lib/lang"),a=s.isChrome<18,l=s.isIE,c=e("./textinput_ios").TextInput,_=function(e,t){function r(e){if(!p){if(p=!0,C)var t=0,r=e?0:u.value.length-1;else var t=e?2:1,r=2;try{u.setSelectionRange(t,r)}catch(e){}p=!1}}function _(){p||(u.value=m,s.isWebKit&&v.schedule())}function d(){clearTimeout(O),O=setTimeout(function(){f&&(u.style.cssText=f,f=""),null==t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=!0,t.renderer.$moveTextAreaToCursor())},0)}if(s.isIOS)return c.call(this,e,t);var u=n.createElement("textarea");u.className="ace_text-input",u.setAttribute("wrap","off"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),u.setAttribute("spellcheck",!1),u.style.opacity="0",e.insertBefore(u,e.firstChild);var m="\u2028\u2028",g=!1,h=!1,p=!1,f="",b=!0;try{var y=document.activeElement===u}catch(e){}i.addListener(u,"blur",function(e){t.onBlur(e),y=!1}),i.addListener(u,"focus",function(e){y=!0,t.onFocus(e),r()}),this.focus=function(){if(f)return u.focus() +;var e=u.style.top;u.style.position="fixed",u.style.top="0px",u.focus(),setTimeout(function(){u.style.position="","0px"==u.style.top&&(u.style.top=e)},0)},this.blur=function(){u.blur()},this.isFocused=function(){return y};var w=o.delayedCall(function(){y&&r(b)}),v=o.delayedCall(function(){p||(u.value=m,y&&r())});s.isWebKit||t.addEventListener("changeSelection",function(){t.selection.isEmpty()!=b&&(b=!b,w.schedule())}),_(),y&&t.onFocus();var x=function(e){return 0===e.selectionStart&&e.selectionEnd===e.value.length},k=function(e){g?g=!1:x(u)?(t.selectAll(),r()):C&&r(t.selection.isEmpty())},C=null;this.setInputHandler=function(e){C=e},this.getInputHandler=function(){return C};var A=!1,F=function(e){C&&(e=C(e),C=null),h?(r(),e&&t.onPaste(e),h=!1):e==m.charAt(0)?A?t.execCommand("del",{source:"ace"}):t.execCommand("backspace",{source:"ace"}):(e.substring(0,2)==m?e=e.substr(2):e.charAt(0)==m.charAt(0)?e=e.substr(1):e.charAt(e.length-1)==m.charAt(0)&&(e=e.slice(0,-1)),e.charAt(e.length-1)==m.charAt(0)&&(e=e.slice(0,-1)),e&&t.onTextInput(e)),A&&(A=!1)},E=function(e){if(!p){var t=u.value;F(t),_()}},S=function(e,t,r){var i=e.clipboardData||window.clipboardData;if(i&&!a){var s=l||r?"Text":"text/plain";try{return t?!1!==i.setData(s,t):i.getData(s)}catch(e){if(!r)return S(e,t,!0)}}},R=function(e,s){var n=t.getCopyText();if(!n)return i.preventDefault(e);S(e,n)?(s?t.onCut():t.onCopy(),i.preventDefault(e)):(g=!0,u.value=n,u.select(),setTimeout(function(){g=!1,_(),r(),s?t.onCut():t.onCopy()}))},D=function(e){R(e,!0)},q=function(e){R(e,!1)},$=function(e){var n=S(e);"string"==typeof n?(n&&t.onPaste(n,e),s.isIE&&setTimeout(r),i.preventDefault(e)):(u.value="",h=!0)};i.addCommandKeyListener(u,t.onCommandKey.bind(t)),i.addListener(u,"select",k),i.addListener(u,"input",E),i.addListener(u,"cut",D),i.addListener(u,"copy",q),i.addListener(u,"paste",$),"oncut"in u&&"oncopy"in u&&"onpaste"in u||i.addListener(e,"keydown",function(e){if((!s.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:q(e);break;case 86:$(e);break;case 88:D(e)}});var L=function(e){p||!t.onCompositionStart||t.$readOnly||(p={},p.canUndo=t.session.$undoManager,t.onCompositionStart(),setTimeout(T,0),t.on("mousedown",B),p.canUndo&&!t.selection.isEmpty()&&(t.insert(""),t.session.markUndoGroup(),t.selection.clearSelection()),t.session.markUndoGroup())},T=function(){if(p&&t.onCompositionUpdate&&!t.$readOnly){var e=u.value.replace(/\u2028/g,"");if(p.lastValue!==e&&(t.onCompositionUpdate(e),p.lastValue&&t.undo(),p.canUndo&&(p.lastValue=e),p.lastValue)){var r=t.selection.getRange();t.insert(p.lastValue),t.session.markUndoGroup(),p.range=t.selection.getRange(),t.selection.setRange(r),t.selection.clearSelection()}}},B=function(e){if(t.onCompositionEnd&&!t.$readOnly){var r=p;p=!1;var i=setTimeout(function(){i=null;var e=u.value.replace(/\u2028/g,"");p||(e==r.lastValue?_():!r.lastValue&&e&&(_(),F(e)))});C=function(e){return i&&clearTimeout(i),(e=e.replace(/\u2028/g,""))==r.lastValue?"":(r.lastValue&&i&&t.undo(),e)},t.onCompositionEnd(),t.removeListener("mousedown",B),"compositionend"==e.type&&r.range&&t.selection.setRange(r.range);(!!s.isChrome&&s.isChrome>=53||!!s.isWebKit&&s.isWebKit>=603)&&E()}},M=o.delayedCall(T,50);i.addListener(u,"compositionstart",L),s.isGecko?i.addListener(u,"text",function(){M.schedule()}):(i.addListener(u,"keyup",function(){M.schedule()}),i.addListener(u,"keydown",function(){M.schedule()})),i.addListener(u,"compositionend",B),this.getElement=function(){return u},this.setReadOnly=function(e){u.readOnly=e},this.onContextMenu=function(e){A=!0,r(t.selection.isEmpty()),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,r){f||(f=u.style.cssText),u.style.cssText=(r?"z-index:100000;":"")+"height:"+u.style.height+";"+(s.isIE?"opacity:0.1;":"");var o=t.container.getBoundingClientRect(),a=n.computedStyle(t.container),l=o.top+(parseInt(a.borderTopWidth)||0),c=o.left+(parseInt(o.borderLeftWidth)||0),_=o.bottom-l-u.clientHeight-2,m=function(e){u.style.left=e.clientX-c-2+"px",u.style.top=Math.min(e.clientY-l-2,_)+"px"};m(e),"mousedown"==e.type&&(t.renderer.$keepTextAreaAtCursor&&(t.renderer.$keepTextAreaAtCursor=null),clearTimeout(O),s.isWin&&i.capture(t.container,m,d))},this.onContextMenuClose=d;var O,I=function(e){t.textInput.onContextMenu(e),d()};i.addListener(u,"mouseup",I),i.addListener(u,"mousedown",function(e){e.preventDefault(),d()}),i.addListener(t.renderer.scroller,"contextmenu",I),i.addListener(u,"contextmenu",I)};t.TextInput=_}),define("ace/mouse/default_handlers",["require","exports","module","../lib/dom","../lib/event","../lib/useragent"],function(e,t,r){"use strict";function i(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),t.setDefaultHandler("touchmove",this.onTouchMove.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach(function(t){e[t]=this[t]},this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}function s(e,t,r,i){return Math.sqrt(Math.pow(r-e,2)+Math.pow(i-t,2))}function n(e,t){if(e.start.row==e.end.row)var r=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)var r=2*t.row-e.start.row-e.end.row;else var r=t.column-4;return r<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}var o=(e("../lib/dom"),e("../lib/event"),e("../lib/useragent"));(function(){this.onMouseDown=function(e){var t=e.inSelection(),r=e.getDocumentPosition();this.mousedownEvent=e;var i=this.editor,s=e.getButton();if(0!==s){var n=i.getSelectionRange(),a=n.isEmpty();return i.$blockScrolling++,(a||1==s)&&i.selection.moveToPosition(r),i.$blockScrolling--,void(2==s&&(i.textInput.onContextMenu(e.domEvent),o.isMozilla||e.preventDefault()))}return this.mousedownEvent.time=Date.now(),!t||i.isFocused()||(i.focus(),!this.$focusTimout||this.$clickSelection||i.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(r,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e))},this.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var r=this.editor;r.$blockScrolling++,this.mousedownEvent.getShiftKey()?r.selection.selectToPosition(e):t||r.selection.moveToPosition(e),t||this.select(),r.renderer.scroller.setCapture&&r.renderer.scroller.setCapture(),r.setStyle("ace_selecting"),this.setState("select"),r.$blockScrolling--},this.select=function(){var e,t=this.editor,r=t.renderer.screenToTextCoordinates(this.x,this.y);if(t.$blockScrolling++,this.$clickSelection){var i=this.$clickSelection.comparePoint(r);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var s=n(this.$clickSelection,r);r=s.cursor,e=s.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(r),t.$blockScrolling--,t.renderer.scrollCursorIntoView()},this.extendSelectionBy=function(e){var t,r=this.editor,i=r.renderer.screenToTextCoordinates(this.x,this.y),s=r.selection[e](i.row,i.column);if(r.$blockScrolling++,this.$clickSelection){var o=this.$clickSelection.comparePoint(s.start),a=this.$clickSelection.comparePoint(s.end);if(-1==o&&a<=0)t=this.$clickSelection.end,s.end.row==i.row&&s.end.column==i.column||(i=s.start);else if(1==a&&o>=0)t=this.$clickSelection.start,s.start.row==i.row&&s.start.column==i.column||(i=s.end);else if(-1==o&&1==a)i=s.end,t=s.start;else{var l=n(this.$clickSelection,i);i=l.cursor,t=l.anchor}r.selection.setSelectionAnchor(t.row,t.column)}r.selection.selectToPosition(i),r.$blockScrolling--,r.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting"),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var e=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y),t=Date.now();(e>0||t-this.mousedownEvent.time>this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(e){var t=e.getDocumentPosition(),r=this.editor,i=r.session,s=i.getBracketRange(t);s?(s.isEmpty()&&(s.start.column--,s.end.column++),this.setState("select")):(s=r.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=s,this.select()},this.onTripleClick=function(e){var t=e.getDocumentPosition(),r=this.editor;this.setState("selectByLines");var i=r.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=r.selection.getLineRange(i.start.row),this.$clickSelection.end=r.selection.getLineRange(i.end.row).end):this.$clickSelection=r.selection.getLineRange(t.row),this.select()},this.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},this.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var r=this.$lastScroll,i=e.domEvent.timeStamp,s=i-r.t,n=e.wheelX/s,o=e.wheelY/s;s<250&&(n=(n+r.vx)/2,o=(o+r.vy)/2);var a=Math.abs(n/o),l=!1;if(a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l)r.allowed=i;else if(i-r.allowed<250){var c=Math.abs(n)<=1.1*Math.abs(r.vx)&&Math.abs(o)<=1.1*Math.abs(r.vy);c?(l=!0,r.allowed=i):r.allowed=0}return r.t=i,r.vx=n,r.vy=o,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},this.onTouchMove=function(e){this.editor._emit("mousewheel",e)}}).call(i.prototype),t.DefaultHandlers=i}),define("ace/tooltip",["require","exports","module","./lib/oop","./lib/dom"],function(e,t,r){"use strict";function i(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}var s=(e("./lib/oop"),e("./lib/dom"));(function(){this.$init=function(){return this.$element=s.createElement("div"),this.$element.className="ace_tooltip",this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(e){s.setInnerText(this.getElement(),e)},this.setHtml=function(e){this.getElement().innerHTML=e},this.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},this.setClassName=function(e){s.addCssClass(this.getElement(),e)},this.show=function(e,t,r){null!=e&&this.setText(e),null!=t&&null!=r&&this.setPosition(t,r),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(i.prototype),t.Tooltip=i}),define("ace/mouse/default_gutter_handler",["require","exports","module","../lib/dom","../lib/oop","../lib/event","../tooltip"],function(e,t,r){"use strict";function i(e){function t(){var t=d.getDocumentPosition().row,s=l.$annotations[t];if(!s)return r();if(t==o.session.getLength()){var n=o.renderer.pixelToScreenCoordinates(0,d.y).row,a=d.$pos;if(n>o.session.documentToScreenRow(a.row,a.column))return r()}if(u!=s)if(u=s.text.join("
"),c.setHtml(u),c.show(),o._signal("showGutterTooltip",c),o.on("mousewheel",r),e.$tooltipFollowsMouse)i(d);else{var _=d.domEvent.target,m=_.getBoundingClientRect(),g=c.getElement().style;g.left=m.right+"px",g.top=m.bottom+"px"}}function r(){_&&(_=clearTimeout(_)),u&&(c.hide(),u=null,o._signal("hideGutterTooltip",c),o.removeEventListener("mousewheel",r))}function i(e){c.setPosition(e.x,e.y)}var o=e.editor,l=o.renderer.$gutterLayer,c=new s(o.container);e.editor.setDefaultHandler("guttermousedown",function(t){if(o.isFocused()&&0==t.getButton()){if("foldWidgets"!=l.getRegion(t)){var r=t.getDocumentPosition().row,i=o.session.selection;if(t.getShiftKey())i.selectTo(r,0);else{if(2==t.domEvent.detail)return o.selectAll(),t.preventDefault();e.$clickSelection=o.selection.getLineRange(r)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}}});var _,d,u;e.editor.setDefaultHandler("guttermousemove",function(s){var o=s.domEvent.target||s.domEvent.srcElement;if(n.hasCssClass(o,"ace_fold-widget"))return r();u&&e.$tooltipFollowsMouse&&i(s),d=s,_||(_=setTimeout(function(){_=null,d&&!e.isMousePressed?t():r()},50))}),a.addListener(o.renderer.$gutter,"mouseout",function(e){d=null,u&&!_&&(_=setTimeout(function(){_=null,r()},50))}),o.on("changeSession",r)}function s(e){l.call(this,e)}var n=e("../lib/dom"),o=e("../lib/oop"),a=e("../lib/event"),l=e("../tooltip").Tooltip;o.inherits(s,l),function(){this.setPosition=function(e,t){var r=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,s=this.getWidth(),n=this.getHeight();e+=15,t+=15,e+s>r&&(e-=e+s-r),t+n>i&&(t-=20+n),l.prototype.setPosition.call(this,e,t)}}.call(s.prototype),t.GutterHandler=i}),define("ace/mouse/mouse_event",["require","exports","module","../lib/event","../lib/useragent"],function(e,t,r){"use strict";var i=e("../lib/event"),s=e("../lib/useragent"),n=t.MouseEvent=function(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor,t=e.getSelectionRange();if(t.isEmpty())this.$inSelection=!1;else{var r=this.getDocumentPosition();this.$inSelection=t.contains(r.row,r.column)}return this.$inSelection},this.getButton=function(){return i.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=s.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(n.prototype)}),define("ace/mouse/dragdrop_handler",["require","exports","module","../lib/dom","../lib/event","../lib/useragent"],function(e,t,r){"use strict";function i(e){function t(e,t){var r=Date.now(),i=!t||e.row!=t.row,n=!t||e.column!=t.column;if(!E||i||n)p.$blockScrolling+=1,p.moveCursorToPosition(e),p.$blockScrolling-=1,E=r,S={x:y,y:w};else{s(S.x,S.y,y,w)>_?E=null:r-E>=c&&(p.renderer.scrollCursorIntoView(),E=null)}}function r(e,t){var r=Date.now(),i=p.renderer.layerConfig.lineHeight,s=p.renderer.layerConfig.characterWidth,n=p.renderer.scroller.getBoundingClientRect(),o={x:{left:y-n.left,right:n.right-y},y:{top:w-n.top,bottom:n.bottom-w}},a=Math.min(o.x.left,o.x.right),c=Math.min(o.y.top,o.y.bottom),_={row:e.row,column:e.column};a/s<=2&&(_.column+=o.x.left=l&&p.renderer.scrollCursorIntoView(_):F=r:F=null}function i(){var e=k;k=p.renderer.screenToTextCoordinates(y,w),t(k,e),r(k,e)}function d(){x=p.selection.toOrientedRange(),b=p.session.addMarker(x,"ace_selection",p.getSelectionStyle()),p.clearSelection(),p.isFocused()&&p.renderer.$cursorLayer.setBlinking(!1),clearInterval(v),i(),v=setInterval(i,20),D=0,o.addListener(document,"mousemove",m)}function u(){clearInterval(v),p.session.removeMarker(b),b=null,p.$blockScrolling+=1,p.selection.fromOrientedRange(x),p.$blockScrolling-=1,p.isFocused()&&!A&&p.renderer.$cursorLayer.setBlinking(!p.getReadOnly()),x=null,k=null,D=0,F=null,E=null,o.removeListener(document,"mousemove",m)}function m(){null==q&&(q=setTimeout(function(){null!=q&&b&&u()},20))}function g(e){var t=e.types;return!t||Array.prototype.some.call(t,function(e){return"text/plain"==e||"Text"==e})}function h(e){var t=["copy","copymove","all","uninitialized"],r=["move","copymove","linkmove","all","uninitialized"],i=a.isMac?e.altKey:e.ctrlKey,s="uninitialized";try{s=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var n="none";return i&&t.indexOf(s)>=0?n="copy":r.indexOf(s)>=0?n="move":t.indexOf(s)>=0&&(n="copy"),n}var p=e.editor,f=n.createElement("img");f.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",a.isOpera&&(f.style.cssText="width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;"),["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach(function(t){e[t]=this[t]},this),p.addEventListener("mousedown",this.onMouseDown.bind(e));var b,y,w,v,x,k,C,A,F,E,S,R=p.container,D=0;this.onDragStart=function(e){if(this.cancelDrag||!R.draggable){var t=this;return setTimeout(function(){t.startSelect(),t.captureMouse(e)},0),e.preventDefault()}x=p.getSelectionRange();var r=e.dataTransfer;r.effectAllowed=p.getReadOnly()?"copy":"copyMove",a.isOpera&&(p.container.appendChild(f),f.scrollTop=0),r.setDragImage&&r.setDragImage(f,0,0),a.isOpera&&p.container.removeChild(f),r.clearData(),r.setData("Text",p.session.getTextRange()),A=!0,this.setState("drag")},this.onDragEnd=function(e){if(R.draggable=!1,A=!1,this.setState(null),!p.getReadOnly()){var t=e.dataTransfer.dropEffect;C||"move"!=t||p.session.remove(p.getSelectionRange()),p.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!p.getReadOnly()&&g(e.dataTransfer))return y=e.clientX,w=e.clientY,b||d(),D++,e.dataTransfer.dropEffect=C=h(e),o.preventDefault(e)},this.onDragOver=function(e){if(!p.getReadOnly()&&g(e.dataTransfer))return y=e.clientX,w=e.clientY,b||(d(),D++),null!==q&&(q=null),e.dataTransfer.dropEffect=C=h(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--D<=0&&b)return u(),C=null,o.preventDefault(e)},this.onDrop=function(e){if(k){var t=e.dataTransfer;if(A)switch(C){case"move":x=x.contains(k.row,k.column)?{start:k,end:k}:p.moveText(x,k);break;case"copy":x=p.moveText(x,k,!0)}else{var r=t.getData("Text");x={start:k,end:p.session.insert(k,r)},p.focus(),C=null}return u(),o.preventDefault(e)}},o.addListener(R,"dragstart",this.onDragStart.bind(e)),o.addListener(R,"dragend",this.onDragEnd.bind(e)),o.addListener(R,"dragenter",this.onDragEnter.bind(e)),o.addListener(R,"dragover",this.onDragOver.bind(e)),o.addListener(R,"dragleave",this.onDragLeave.bind(e)),o.addListener(R,"drop",this.onDrop.bind(e));var q=null}function s(e,t,r,i){return Math.sqrt(Math.pow(r-e,2)+Math.pow(i-t,2))}var n=e("../lib/dom"),o=e("../lib/event"),a=e("../lib/useragent"),l=200,c=200,_=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=a.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;if(a.isIE&&"dragReady"==this.state){var r=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>3&&t.dragDrop()}if("dragWait"===this.state){var r=s(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y);r>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))}},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,r=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&r){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var s=e.domEvent.target||e.domEvent.srcElement;if("unselectable"in s&&(s.unselectable="on"),t.getDragDelay()){if(a.isWebKit){this.cancelDrag=!0;t.container.draggable=!0}this.setState("dragWait")}else this.startDrag();this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(i.prototype),t.DragdropHandler=i}),define("ace/lib/net",["require","exports","module","./dom"],function(e,t,r){"use strict";var i=e("./dom");t.get=function(e,t){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&t(r.responseText)},r.send(null)},t.loadScript=function(e,t){var r=i.getDocumentHead(),s=document.createElement("script");s.src=e,r.appendChild(s),s.onload=s.onreadystatechange=function(e,r){!r&&s.readyState&&"loaded"!=s.readyState&&"complete"!=s.readyState||(s=s.onload=s.onreadystatechange=null,r||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}}),define("ace/lib/event_emitter",["require","exports","module"],function(e,t,r){"use strict";var i={},s=function(){this.propagationStopped=!0},n=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var r=this._eventRegistry[e]||[],i=this._defaultHandlers[e];if(r.length||i){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=s),t.preventDefault||(t.preventDefault=n),r=r.slice();for(var o=0;o1&&(s=r[r.length-2]);var o=c[t+"Path"];return null==o?o=c.basePath:"/"==i&&(t=i=""),o&&"/"!=o.slice(-1)&&(o+="/"),o+t+i+s+this.get("suffix")},t.setModuleUrl=function(e,t){return c.$moduleUrls[e]=t},t.$loading={},t.loadModule=function(r,i){var s,n;Array.isArray(r)&&(n=r[0],r=r[1]);try{s=e(r)}catch(e){}if(s&&!t.$loading[r])return i&&i(s);if(t.$loading[r]||(t.$loading[r]=[]),t.$loading[r].push(i),!(t.$loading[r].length>1)){var a=function(){e([r],function(e){t._emit("load.module",{name:r,module:e});var i=t.$loading[r];t.$loading[r]=null,i.forEach(function(t){t&&t(e)})})};if(!t.get("packaged"))return a();o.loadScript(t.moduleUrl(r,n),a)}},t.init=i}),define("ace/mouse/mouse_handler",["require","exports","module","../lib/event","../lib/useragent","./default_handlers","./default_gutter_handler","./mouse_event","./dragdrop_handler","../config"],function(e,t,r){"use strict";var i=e("../lib/event"),s=e("../lib/useragent"),n=e("./default_handlers").DefaultHandlers,o=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("../config"),_=function(e){var t=this;this.editor=e,new n(this),new o(this),new l(this);var r=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus()},a=e.renderer.getMouseEventTarget();i.addListener(a,"click",this.onMouseEvent.bind(this,"click")),i.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove")),i.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent"),i.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel")),i.addTouchMoveListener(e.container,this.onTouchMove.bind(this,"touchmove"));var c=e.renderer.$gutter;i.addListener(c,"mousedown",this.onMouseEvent.bind(this,"guttermousedown")),i.addListener(c,"click",this.onMouseEvent.bind(this,"gutterclick")),i.addListener(c,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick")),i.addListener(c,"mousemove",this.onMouseEvent.bind(this,"guttermousemove")),i.addListener(a,"mousedown",r),i.addListener(c,"mousedown",r),s.isIE&&e.renderer.scrollBarV&&(i.addListener(e.renderer.scrollBarV.element,"mousedown",r),i.addListener(e.renderer.scrollBarH.element,"mousedown",r)),e.on("mousemove",function(r){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var i=e.renderer.screenToTextCoordinates(r.x,r.y),s=e.session.selection.getRange(),n=e.renderer;!s.isEmpty()&&s.insideStart(i.row,i.column)?n.setCursorStyle("default"):n.setCursorStyle("")}})};(function(){this.onMouseEvent=function(e,t){this.editor._emit(e,new a(t,this.editor))},this.onMouseMove=function(e,t){var r=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;r&&r.length&&this.editor._emit(e,new a(t,this.editor))},this.onMouseWheel=function(e,t){var r=new a(t,this.editor);r.speed=2*this.$scrollSpeed,r.wheelX=t.wheelX,r.wheelY=t.wheelY,this.editor._emit(e,r)},this.onTouchMove=function(e,t){var r=new a(t,this.editor);r.speed=1,r.wheelX=t.wheelX,r.wheelY=t.wheelY,this.editor._emit(e,r)},this.setState=function(e){this.state=e},this.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var r=this.editor.renderer;r.$keepTextAreaAtCursor&&(r.$keepTextAreaAtCursor=null);var n=this,o=function(e){if(e){if(s.isWebKit&&!e.which&&n.releaseMouse)return n.releaseMouse();n.x=e.clientX,n.y=e.clientY,t&&t(e),n.mouseEvent=new a(e,n.editor),n.$mouseMoved=!0}},l=function(e){clearInterval(_),c(),n[n.state+"End"]&&n[n.state+"End"](e),n.state="",null==r.$keepTextAreaAtCursor&&(r.$keepTextAreaAtCursor=!0,r.$moveTextAreaToCursor()),n.isMousePressed=!1,n.$onCaptureMouseMove=n.releaseMouse=null,e&&n.onMouseEvent("mouseup",e)},c=function(){n[n.state]&&n[n.state](),n.$mouseMoved=!1};if(s.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout(function(){l(e)});n.$onCaptureMouseMove=o,n.releaseMouse=i.capture(this.editor.container,o,l);var _=setInterval(c,20)},this.releaseMouse=null,this.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&i.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)}}).call(_.prototype),c.defineOptions(_.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:s.isMac?150:0},dragEnabled:{initialValue:!0},focusTimout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=_}),define("ace/mouse/fold_handler",["require","exports","module"],function(e,t,r){"use strict";function i(e){e.on("click",function(t){var r=t.getDocumentPosition(),i=e.session,s=i.getFoldAt(r.row,r.column,1);s&&(t.getAccelKey()?i.removeFold(s):i.expandFold(s),t.stop())}),e.on("gutterclick",function(t){ +if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var r=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[r]&&e.session.onFoldWidgetClick(r,t),e.isFocused()||e.focus(),t.stop()}}),e.on("gutterdblclick",function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var r=t.getDocumentPosition().row,i=e.session,s=i.getParentFoldRangeData(r,!0),n=s.range||s.firstRange;if(n){r=n.start.row;var o=i.getFoldAt(r,i.getLine(r).length,1);o?i.removeFold(o):(i.addFold("...",n),e.renderer.scrollCursorIntoView({row:n.start.row,column:0}))}t.stop()}})}t.FoldHandler=i}),define("ace/keyboard/keybinding",["require","exports","module","../lib/keys","../lib/event"],function(e,t,r){"use strict";var i=e("../lib/keys"),s=e("../lib/event"),n=function(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)};(function(){this.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},this.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},this.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var r=this.$handlers.indexOf(e);-1!=r&&this.$handlers.splice(r,1),void 0==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==r&&e.attach&&e.attach(this.$editor)}},this.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},this.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},this.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map(function(r){return r.getStatusText&&r.getStatusText(t,e)||""}).filter(Boolean).join(" ")},this.$callKeyboardHandlers=function(e,t,r,i){for(var n,o=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((n=this.$handlers[l].handleKeyboard(this.$data,e,t,r,i))&&n.command&&(o="null"==n.command||a.exec(n.command,this.$editor,n.args,i),o&&i&&-1!=e&&1!=n.passEvent&&1!=n.command.passEvent&&s.stopEvent(i),o)););return o||-1!=e||(n={command:"insertstring"},o=a.exec("insertstring",this.$editor,t)),o&&this.$editor._signal&&this.$editor._signal("keyboardActivity",n),o},this.onCommandKey=function(e,t,r){var s=i.keyCodeToString(r);this.$callKeyboardHandlers(t,s,r,e)},this.onTextInput=function(e){this.$callKeyboardHandlers(-1,e)}}).call(n.prototype),t.KeyBinding=n}),define("ace/lib/bidiutil",["require","exports","module"],function(e,t,r){"use strict";function i(e,t,r,i){var s=a?g:m,h=null,p=null,f=null,b=0,y=null,w=-1,k=null,A=null,F=[];if(!i)for(k=0,i=[];k0)if(16==y){for(k=w;k-1){for(k=w;k=0&&i[E]==C;E--)t[E]=a}}function s(e,t,r){if(!(l=e){for(i=_+1;i=e;)i++;for(s=_,n=i-1;s=t.length||(s=r[i-1])!=b&&s!=y||(n=t[i+1])!=b&&n!=y?w:(c&&(n=y),n==s?n:w);case F:return s=i>0?r[i-1]:v,s==b&&i+10&&r[i-1]==b)return b;if(c)return w;for(l=i+1,o=t.length;l=1425&&g<=2303||64286==g;if(s=t[l],h&&(s==f||s==k))return f}return i<1||(s=t[i-1])==v?w:r[i-1];case v:return c=!1,d=!0,a;case x:return u=!0,w;case R:case D:case $:case L:case q:c=!1;case T:return w}}function o(e){var t=e.charCodeAt(0),r=t>>8;return 0==r?t>191?p:B[t]:5==r?/[\u0591-\u05f4]/.test(e)?f:p:6==r?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?S:/[\u0660-\u0669\u066b-\u066c]/.test(e)?y:1642==t?E:/[\u06f0-\u06f9]/.test(e)?b:k:32==r&&t<=8287?M[255&t]:254==r&&t>=65136?k:w}var a=0,l=0,c=!1,_=!1,d=!1,u=!1,m=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],g=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h=1,p=0,f=1,b=2,y=3,w=4,v=5,x=6,k=7,C=8,A=9,F=10,E=11,S=12,R=13,D=14,q=15,$=16,L=17,T=18,B=[T,T,T,T,T,T,T,T,T,x,v,x,C,v,T,T,T,T,T,T,T,T,T,T,T,T,T,T,v,v,v,x,C,w,w,E,E,E,w,w,w,w,w,F,A,F,A,A,b,b,b,b,b,b,b,b,b,b,A,w,w,w,w,w,w,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,w,w,w,w,w,w,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,w,w,w,w,T,T,T,T,T,T,v,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,T,A,w,E,E,E,E,w,w,w,w,p,w,w,T,w,w,E,E,b,b,w,p,w,w,w,b,p,w,w,w,w,w],M=[C,C,C,C,C,C,C,C,C,C,C,T,T,T,p,f,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,C,v,R,D,q,$,L,A,E,E,E,E,E,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,A,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,w,C];t.L=p,t.R=f,t.EN=b,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.DOT="·",t.doBidiReorder=function(e,r,n){if(e.length<2)return{};var o=e.split(""),l=new Array(o.length),c=new Array(o.length),_=[];a=n?h:0,i(o,_,o.length,r);for(var d=0;dk&&r[d]0&&"ل"===o[d-1]&&/\u0622|\u0623|\u0625|\u0627/.test(o[d])&&(_[d-1]=_[d]=t.R_H,d++);o[o.length-1]===t.DOT&&(_[o.length-1]=t.B);for(var d=0;d=0&&(e=this.session.$docRowCache[r])}return e},this.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var r,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(r=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=r,e++;return e},this.updateRowLine=function(e,t){if(void 0===e&&(e=this.getDocumentRow()),this.wrapIndent=0,this.isLastRow=e===this.session.getLength()-1,this.line=this.session.getLine(e),this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(void 0===t&&(t=this.getSplitIndex()),t>0&&r.length?(this.wrapIndent=r.indent,this.line=t0?e-1:0,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;0===e&&r[t]%2!=0&&t++;for(var n=0;n=c&&s<_,d&&!u?m=a:!d&&u&&l.push({left:m,width:a-m}),a+=this.charWidths[r],u=d;return d&&g===o.length&&l.push({left:m,width:a-m}),l},this.offsetToCol=function(e){var t=0,e=Math.max(e,0),r=0,s=0,n=this.bidiMap.bidiLevels,o=this.charWidths[n[s]];for(this.wrapIndent&&(e-=this.wrapIndent*this.charWidths[i.L]);e>r+o/2;){if(r+=o,s===n.length-1){o=0;break}o=this.charWidths[n[++s]]}return s>0&&n[s-1]%2!=0&&n[s]%2==0?(e0&&n[s-1]%2==0&&n[s]%2!=0?t=1+(e>r?this.bidiMap.logicalFromVisual[s]:this.bidiMap.logicalFromVisual[s-1]):this.isRtlDir&&s===n.length-1&&0===o&&n[s-1]%2==0||!this.isRtlDir&&0===s&&n[s]%2!=0?t=1+this.bidiMap.logicalFromVisual[s]:(s>0&&n[s-1]%2!=0&&0!==o&&s--,t=this.bidiMap.logicalFromVisual[s]),t+this.wrapIndent}}).call(o.prototype),t.BidiHandler=o}),define("ace/range",["require","exports","module"],function(e,t,r){"use strict";var i=function(e,t){return e.row-t.row||e.column-t.column},s=function(e,t,r,i){this.start={row:e,column:t},this.end={row:r,column:i}};(function(){this.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},this.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},this.contains=function(e,t){return 0==this.compare(e,t)},this.compareRange=function(e){var t,r=e.end,i=e.start;return t=this.compare(r.row,r.column),1==t?(t=this.compare(i.row,i.column),1==t?2:0==t?1:0):-1==t?-2:(t=this.compare(i.row,i.column),-1==t?-1:1==t?42:0)},this.comparePoint=function(e){return this.compare(e.row,e.column)},this.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},this.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},this.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},this.isStart=function(e,t){return this.start.row==e&&this.start.column==t},this.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},this.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},this.inside=function(e,t){return 0==this.compare(e,t)&&(!this.isEnd(e,t)&&!this.isStart(e,t))},this.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},this.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},this.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?ethis.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:tthis.end.column?1:0},this.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},this.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},this.clipRows=function(e,t){if(this.end.row>t)var r={row:t+1,column:0};else if(this.end.rowt)var i={row:t+1,column:0};else if(this.start.rowt.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.isEmpty()?o.fromPoints(t,t):this.isBackwards()?o.fromPoints(t,e):o.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){var e=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(e,this.doc.getLine(e).length)},this.setRange=this.setSelectionRange=function(e,t){t?(this.setSelectionAnchor(e.end.row,e.end.column),this.selectTo(e.start.row,e.start.column)):(this.setSelectionAnchor(e.start.row,e.start.column),this.selectTo(e.end.row,e.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection(function(){this.moveCursorTo(e,t)})},this.selectToPosition=function(e){this.$moveSelection(function(){this.moveCursorToPosition(e)})},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var r=e||this.lead;e=r.row,t=r.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var r,i="number"==typeof e?e:this.lead.row,s=this.session.getFoldLine(i);return s?(i=s.start.row,r=s.end.row):r=i,!0===t?new o(i,0,r,this.session.getLine(r).length):new o(i,0,r+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,r){var i=e.column,s=e.column+t;return r<0&&(i=e.column-t,s=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,s).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var r=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,r,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-r):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row0&&(t.column=i)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,r=this.doc.getLine(e),i=r.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var s=this.session.getFoldAt(e,t,1);return s?void this.moveCursorTo(s.end.row,s.end.column):(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=r.substring(t)),t>=r.length?(this.moveCursorTo(e,r.length),this.moveCursorRight(),void(e0&&this.moveCursorWordLeft());this.session.tokenRe.exec(n)&&(r-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,r)},this.$shortWordEndIndex=function(e){var t,r=0,i=/\s/,s=this.session.tokenRe;if(s.lastIndex=0,this.session.tokenRe.exec(e))r=this.session.tokenRe.lastIndex;else{for(;(t=e[r])&&i.test(t);)r++;if(r<1)for(s.lastIndex=0;(t=e[r])&&!s.test(t);)if(s.lastIndex=0,r++,i.test(t)){if(r>2){r--;break}for(;(t=e[r])&&i.test(t);)r++;if(r>2)break}}return s.lastIndex=0,r},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,r=this.doc.getLine(e),i=r.substring(t),s=this.session.getFoldAt(e,t,1);if(s)return this.moveCursorTo(s.end.row,s.end.column);if(t==r.length){var n=this.doc.getLength();do{e++,i=this.doc.getLine(e)}while(e0&&/^\s*$/.test(i));r=i.length,/\s+$/.test(i)||(i="")}var n=s.stringReverse(i),o=this.$shortWordEndIndex(n);return this.moveCursorTo(t,r-o)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var r,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(r=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(r/this.session.$bidiHandler.charWidths[0])):r=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column);var s=this.session.screenToDocumentPosition(i.row+e,i.column,r);0!==e&&0===t&&s.row===this.lead.row&&s.column===this.lead.column&&this.session.lineWidgets&&this.session.lineWidgets[s.row]&&(s.row>0||e>0)&&s.row++,this.moveCursorTo(s.row,s.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,r){var i=this.session.getFoldAt(e,t,1);i&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0;var s=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(s.charAt(t))&&s.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,r||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,r){var i=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(i.row,i.column,r)},this.detach=function(){this.lead.detach(),this.anchor.detach(),this.session=this.doc=null},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var r=this.getCursor();return o.fromPoints(t,r)}catch(e){return o.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map(function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t});else{var e=this.getRange();e.isBackwards=this.isBackwards()}return e},this.fromJSON=function(e){if(void 0==e.start){if(this.rangeList){this.toSingleRange(e[0]);for(var t=e.length;t--;){var r=o.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(r.cursor=r.start),this.addRange(r,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a}),define("ace/tokenizer",["require","exports","module","./config"],function(e,t,r){"use strict";var i=e("./config"),s=2e3,n=function(e){this.states=e,this.regExps={},this.matchMappings={};for(var t in this.states){for(var r=this.states[t],i=[],s=0,n=this.matchMappings[t]={defaultToken:"text"},o="g",a=[],l=0;l1?this.$applyToken:c.token),d>1&&(/\\\d/.test(c.regex)?_=c.regex.replace(/\\([0-9]+)/g,function(e,t){return"\\"+(parseInt(t,10)+s+1)}):(d=1,_=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),n[s]=l,s+=d,i.push(_),c.onMatch||(c.onMatch=null)}}i.length||(n[0]=0,i.push("$")),a.forEach(function(e){e.splitRegex=this.createSplitterRegexp(e.regex,o)},this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",o)}};(function(){this.$setMaxTokenCount=function(e){s=0|e},this.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),r=this.token.apply(this,t);if("string"==typeof r)return[{type:r,value:e}];for(var i=[],s=0,n=r.length;s_){var f=e.substring(_,p-h.length);u.type==m?u.value+=f:(u.type&&c.push(u),u={type:m,value:f})}for(var b=0;bs){for(d>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});_1&&r[0]!==i&&r.unshift("#tmp",i),{tokens:c,state:r.length?r:i}},this.reportError=i.reportError}).call(n.prototype),t.Tokenizer=n}),define("ace/mode/text_highlight_rules",["require","exports","module","../lib/lang"],function(e,t,r){"use strict";var i=e("../lib/lang"),s=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var r in e){for(var i=e[r],s=0;s=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,r=e[t].start;if(void 0!==r)return r;for(r=0;t>0;)t-=1,r+=e[t].value.length;return r},this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},this.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new i(this.$row,t,this.$row,t+e.value.length)}}).call(s.prototype),t.TokenIterator=s}),define("ace/mode/behaviour/cstyle",["require","exports","module","../../lib/oop","../behaviour","../../token_iterator","../../lib/lang"],function(e,t,r){"use strict";var i,s=e("../../lib/oop"),n=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","punctuation.operator"],c=["text","paren.rparen","punctuation.operator","comment"],_={},d={'"':'"',"'":"'"},u=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,_.rangeCount!=e.multiSelect.rangeCount&&(_={rangeCount:e.multiSelect.rangeCount})),_[t])return i=_[t];i=_[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},m=function(e,t,r,i){var s=e.end.row-e.start.row;return{text:r+t+i,selection:[0,e.start.column+1,s,e.end.column+(s?0:1)]}},g=function(e){this.add("braces","insertion",function(t,r,s,n,o){var l=s.getCursorPosition(),c=n.doc.getLine(l.row);if("{"==o){u(s);var _=s.getSelectionRange(),d=n.doc.getTextRange(_);if(""!==d&&"{"!==d&&s.getWrapBehavioursEnabled())return m(_,d,"{","}");if(g.isSaneInsertion(s,n))return/[\]\}\)]/.test(c[l.column])||s.inMultiSelectMode||e&&e.braces?(g.recordAutoInsert(s,n,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(s,n,"{"),{text:"{",selection:[1,1]})}else if("}"==o){u(s);var h=c.substring(l.column,l.column+1);if("}"==h){var p=n.$findOpeningBracket("}",{column:l.column+1,row:l.row});if(null!==p&&g.isAutoInsertedClosing(l,c,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if("\n"==o||"\r\n"==o){u(s);var f="";g.isMaybeInsertedClosing(l,c)&&(f=a.stringRepeat("}",i.maybeInsertedBrackets),g.clearMaybeInsertedClosing());var h=c.substring(l.column,l.column+1);if("}"===h){var b=n.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!b)return null;var y=this.$getIndent(n.getLine(b.row))}else{if(!f)return void g.clearMaybeInsertedClosing();var y=this.$getIndent(c)}var w=y+n.getTabString();return{text:"\n"+w+"\n"+y+f,selection:[1,w.length,1,w.length]}}g.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,r,s,n){var o=s.doc.getTextRange(n);if(!n.isMultiLine()&&"{"==o){u(r);if("}"==s.doc.getLine(n.start.row).substring(n.end.column,n.end.column+1))return n.end.column++,n;i.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,r,i,s){if("("==s){u(r);var n=r.getSelectionRange(),o=i.doc.getTextRange(n);if(""!==o&&r.getWrapBehavioursEnabled())return m(n,o,"(",")");if(g.isSaneInsertion(r,i))return g.recordAutoInsert(r,i,")"),{text:"()",selection:[1,1]}}else if(")"==s){u(r);var a=r.getCursorPosition(),l=i.doc.getLine(a.row),c=l.substring(a.column,a.column+1);if(")"==c){var _=i.$findOpeningBracket(")",{column:a.column+1,row:a.row});if(null!==_&&g.isAutoInsertedClosing(a,l,s))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,r,i,s){var n=i.doc.getTextRange(s);if(!s.isMultiLine()&&"("==n){u(r);if(")"==i.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2))return s.end.column++,s}}),this.add("brackets","insertion",function(e,t,r,i,s){if("["==s){u(r);var n=r.getSelectionRange(),o=i.doc.getTextRange(n);if(""!==o&&r.getWrapBehavioursEnabled())return m(n,o,"[","]");if(g.isSaneInsertion(r,i))return g.recordAutoInsert(r,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==s){u(r);var a=r.getCursorPosition(),l=i.doc.getLine(a.row),c=l.substring(a.column,a.column+1);if("]"==c){var _=i.$findOpeningBracket("]",{column:a.column+1,row:a.row});if(null!==_&&g.isAutoInsertedClosing(a,l,s))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,r,i,s){var n=i.doc.getTextRange(s);if(!s.isMultiLine()&&"["==n){u(r);if("]"==i.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2))return s.end.column++,s}}),this.add("string_dquotes","insertion",function(e,t,r,i,s){var n=i.$mode.$quotes||d;if(1==s.length&&n[s]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(s))return;u(r);var o=s,a=r.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&n[l])&&r.getWrapBehavioursEnabled())return m(a,l,o,o);if(!l){var c=r.getCursorPosition(),_=i.doc.getLine(c.row),g=_.substring(c.column-1,c.column),h=_.substring(c.column,c.column+1),p=i.getTokenAt(c.row,c.column),f=i.getTokenAt(c.row,c.column+1);if("\\"==g&&p&&/escape/.test(p.type))return null;var b,y=p&&/string|escape/.test(p.type),w=!f||/string|escape/.test(f.type);if(h==o)(b=y!==w)&&/string\.end/.test(f.type)&&(b=!1);else{if(y&&!w)return null;if(y&&w)return null;var v=i.$mode.tokenRe;v.lastIndex=0;var x=v.test(g);v.lastIndex=0;var k=v.test(g);if(x||k)return null;if(h&&!/[\s;,.})\]\\]/.test(h))return null;b=!0}return{text:b?o+o:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,r,i,s){var n=i.doc.getTextRange(s);if(!s.isMultiLine()&&('"'==n||"'"==n)){u(r);if(i.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==n)return s.end.column++,s}})};g.isSaneInsertion=function(e,t){var r=e.getCursorPosition(),i=new o(t,r.row,r.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){var s=new o(t,r.row,r.column+1);if(!this.$matchTokenType(s.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==r.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},g.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},g.recordAutoInsert=function(e,t,r){var s=e.getCursorPosition(),n=t.doc.getLine(s.row);this.isAutoInsertedClosing(s,n,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=s.row,i.autoInsertedLineEnd=r+n.substr(s.column),i.autoInsertedBrackets++},g.recordMaybeInsert=function(e,t,r){var s=e.getCursorPosition(),n=t.doc.getLine(s.row);this.isMaybeInsertedClosing(s,n)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=s.row,i.maybeInsertedLineStart=n.substr(0,s.column)+r,i.maybeInsertedLineEnd=n.substr(s.column),i.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(e,t,r){return i.autoInsertedBrackets>0&&e.row===i.autoInsertedRow&&r===i.autoInsertedLineEnd[0]&&t.substr(e.column)===i.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(e,t){return i.maybeInsertedBrackets>0&&e.row===i.maybeInsertedRow&&t.substr(e.column)===i.maybeInsertedLineEnd&&t.substr(0,e.column)==i.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},s.inherits(g,n),t.CstyleBehaviour=g}),define("ace/unicode",["require","exports","module"],function(e,t,r){"use strict";t.packages={},function(e){var r=/\w{4}/g;for(var i in e)t.packages[i]=e[i].replace(r,"\\u$&")}({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",Ll:"0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",Lu:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",Lo:"01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",M:"0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",Mn:"0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",Mc:"0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",Me:"0488048906DE20DD-20E020E2-20E4A670-A672",N:"0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nd:"0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",P:"0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",Pd:"002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",Po:"0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",S:"0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",Sm:"002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",Sc:"002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",So:"00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",C:"0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",Cc:"0000-001F007F-009F",Cf:"00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF", Cn:"03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"})}),define("ace/mode/text",["require","exports","module","../tokenizer","./text_highlight_rules","./behaviour/cstyle","../unicode","../lib/lang","../token_iterator","../range"],function(e,t,r){"use strict";var i=e("../tokenizer").Tokenizer,s=e("./text_highlight_rules").TextHighlightRules,n=e("./behaviour/cstyle").CstyleBehaviour,o=e("../unicode"),a=e("../lib/lang"),l=e("../token_iterator").TokenIterator,c=e("../range").Range,_=function(){this.HighlightRules=s};(function(){this.$defaultBehaviour=new n,this.tokenRe=new RegExp("^["+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+o.packages.L+o.packages.Mn+o.packages.Mc+o.packages.Nd+o.packages.Pc+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new i(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,r,i){function s(e){for(var t=r;t<=i;t++)e(n.getLine(t),t)}var n=t.doc,o=!0,l=!0,c=1/0,_=t.getTabSize(),d=!1;if(this.lineCommentStart){if(Array.isArray(this.lineCommentStart))var u=this.lineCommentStart.map(a.escapeRegExp).join("|"),m=this.lineCommentStart[0];else var u=a.escapeRegExp(this.lineCommentStart),m=this.lineCommentStart;u=new RegExp("^(\\s*)(?:"+u+") ?"),d=t.getUseSoftTabs();var g=function(e,t){var r=e.match(u);if(r){var i=r[1].length,s=r[0].length;b(e,i,s)||" "!=r[0][s-1]||s--,n.removeInLine(t,i,s)}},h=m+" ",p=function(e,t){o&&!/\S/.test(e)||(b(e,c,c)?n.insertInLine({row:t,column:c},h):n.insertInLine({row:t,column:c},m))},f=function(e,t){return u.test(e)},b=function(e,t,r){for(var i=0;t--&&" "==e.charAt(t);)i++;if(i%_!=0)return!1;for(var i=0;" "==e.charAt(r++);)i++;return _>2?i%_!=_-1:i%_==0}}else{if(!this.blockComment)return!1;var m=this.blockComment.start,y=this.blockComment.end,u=new RegExp("^(\\s*)(?:"+a.escapeRegExp(m)+")"),w=new RegExp("(?:"+a.escapeRegExp(y)+")\\s*$"),p=function(e,t){f(e,t)||o&&!/\S/.test(e)||(n.insertInLine({row:t,column:e.length},y),n.insertInLine({row:t,column:c},m))},g=function(e,t){var r;(r=e.match(w))&&n.removeInLine(t,e.length-r[0].length,e.length),(r=e.match(u))&&n.removeInLine(t,r[1].length,r[0].length)},f=function(e,r){if(u.test(e))return!0;for(var i=t.getTokens(r),s=0;se.length&&(v=e.length)}),c==1/0&&(c=v,o=!1,l=!1),d&&c%_!=0&&(c=Math.floor(c/_)*_),s(l?g:p)},this.toggleBlockComment=function(e,t,r,i){var s=this.blockComment;if(s){!s.start&&s[0]&&(s=s[0]);var n,o,a=new l(t,i.row,i.column),_=a.getCurrentToken(),d=(t.selection,t.selection.toOrientedRange());if(_&&/comment/.test(_.type)){for(var u,m;_&&/comment/.test(_.type);){var g=_.value.indexOf(s.start);if(-1!=g){var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn()+g;u=new c(h,p,h,p+s.start.length);break}_=a.stepBackward()}for(var a=new l(t,i.row,i.column),_=a.getCurrentToken();_&&/comment/.test(_.type);){var g=_.value.indexOf(s.end);if(-1!=g){var h=a.getCurrentTokenRow(),p=a.getCurrentTokenColumn()+g;m=new c(h,p,h,p+s.end.length);break}_=a.stepForward()}m&&t.remove(m),u&&(t.remove(u),n=u.start.row,o=-s.start.length)}else o=s.start.length,n=r.start.row,t.insert(r.end,s.end),t.insert(r.start,s.start);d.start.row==n&&(d.start.column+=o),d.end.row==n&&(d.end.column+=o),t.selection.fromOrientedRange(d)}},this.getNextLineIndent=function(e,t,r){return this.$getIndent(t)},this.checkOutdent=function(e,t,r){return!1},this.autoOutdent=function(e,t,r){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){this.$embeds=[],this.$modes={};for(var t in e)e[t]&&(this.$embeds.push(t),this.$modes[t]=new e[t]);for(var r=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"],t=0;tthis.row)){var r=t(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(r.row,r.column,!0)}},this.setPosition=function(e,t,r){var i;if(i=r?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=i.row||this.column!=i.column){var s={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:s,value:i})}},this.detach=function(){this.document.removeEventListener("change",this.$onChange)},this.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},this.$clipPositionToDocument=function(e,t){var r={};return e>=this.document.getLength()?(r.row=Math.max(0,this.document.getLength()-1),r.column=this.document.getLine(r.row).length):e<0?(r.row=0,r.column=0):(r.row=e,r.column=Math.min(this.document.getLine(r.row).length,Math.max(0,t))),t<0&&(r.column=0),r}}).call(n.prototype)}),define("ace/document",["require","exports","module","./lib/oop","./apply_delta","./lib/event_emitter","./range","./anchor"],function(e,t,r){"use strict";var i=e("./lib/oop"),s=e("./apply_delta").applyDelta,n=e("./lib/event_emitter").EventEmitter,o=e("./range").Range,a=e("./anchor").Anchor,l=function(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)};(function(){i.implement(this,n),this.setValue=function(e){var t=this.getLength()-1;this.remove(new o(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(e,t){return new a(this,e,t)},0==="aaa".split(/a/).length?this.$split=function(e){return e.replace(/\r\n|\r/g,"\n").split("\n")}:this.$split=function(e){return e.split(/\r\n|\r|\n/)},this.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},this.$autoNewLine="",this.$newLineMode="auto",this.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},this.getLine=function(e){return this.$lines[e]||""},this.getLines=function(e,t){return this.$lines.slice(e,t+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},this.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{t=this.getLines(e.start.row,e.end.row),t[0]=(t[0]||"").substring(e.start.column);var r=t.length-1;e.end.row-e.start.row==r&&(t[r]=t[r].substring(0,e.end.column))}return t},this.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},this.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},this.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},this.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},this.insertInLine=function(e,t){var r=this.clippedPos(e.row,e.column),i=this.pos(e.row,e.column+t.length);return this.applyDelta({start:r,end:i,action:"insert",lines:[t]},!0),this.clonePos(i)},this.clippedPos=function(e,t){var r=this.getLength();void 0===e?e=r:e<0?e=0:e>=r&&(e=r-1,t=void 0);var i=this.getLine(e);return void 0==t&&(t=i.length),t=Math.min(Math.max(t,0),i.length),{row:e,column:t}},this.clonePos=function(e){return{row:e.row,column:e.column}},this.pos=function(e,t){return{row:e,column:t}},this.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},this.insertFullLines=function(e,t){e=Math.min(Math.max(e,0),this.getLength());var r=0;e0,i=t=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},this.replace=function(e,t){if(e instanceof o||(e=o.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty())return e.start;if(t==this.getTextRange(e))return e.end;this.remove(e);return t?this.insert(e.start,t):e.start},this.applyDeltas=function(e){for(var t=0;t=0;t--)this.revertDelta(e[t])},this.applyDelta=function(e,t){var r="insert"==e.action;(r?e.lines.length<=1&&!e.lines[0]:!o.comparePoints(e.start,e.end))||(r&&e.lines.length>2e4&&this.$splitAndapplyLargeDelta(e,2e4),s(this.$lines,e,t),this._signal("change",e))},this.$splitAndapplyLargeDelta=function(e,t){for(var r=e.lines,i=r.length,s=e.start.row,n=e.start.column,o=0,a=0;;){o=a,a+=t-1;var l=r.slice(o,a);if(a>i){e.lines=l,e.start.row=s+o,e.start.column=n;break}l.push(""),this.applyDelta({start:this.pos(s+o,n),end:this.pos(s+a,n=0),action:e.action,lines:l},!0)}},this.revertDelta=function(e){this.applyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},this.indexToPosition=function(e,t){for(var r=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,s=t||0,n=r.length;s20){r.running=setTimeout(r.$worker,20);break}}r.currentLine=t,-1==i&&(i=t),n<=i&&r.fireUpdateEvent(n,i)}}};(function(){i.implement(this,s),this.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},this.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},this.fireUpdateEvent=function(e,t){var r={first:e,last:t};this._signal("update",{data:r})},this.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},this.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},this.$updateOnChange=function(e){var t=e.start.row,r=e.end.row-t;if(0===r)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,r+1,null),this.states.splice(t,r+1,null);else{var i=Array(r+1);i.unshift(t,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},this.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},this.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},this.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},this.$tokenizeRow=function(e){var t=this.doc.getLine(e),r=this.states[e-1],i=this.tokenizer.getLineTokens(t,r,e);return this.states[e]+""!=i.state+""?(this.states[e]=i.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=i.tokens}}).call(n.prototype),t.BackgroundTokenizer=n}),define("ace/search_highlight",["require","exports","module","./lib/lang","./lib/oop","./range"],function(e,t,r){"use strict";var i=e("./lib/lang"),s=(e("./lib/oop"),e("./range").Range),n=function(e,t,r){this.setRegexp(e),this.clazz=t,this.type=r||"text"};(function(){this.MAX_RANGES=500,this.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},this.update=function(e,t,r,n){if(this.regExp)for(var o=n.firstRow,a=n.lastRow,l=o;l<=a;l++){var c=this.cache[l];null==c&&(c=i.getMatchOffsets(r.getLine(l),this.regExp),c.length>this.MAX_RANGES&&(c=c.slice(0,this.MAX_RANGES)),c=c.map(function(e){return new s(l,e.offset,l,e.offset+e.length)}),this.cache[l]=c.length?c:"");for(var _=c.length;_--;)t.drawSingleLineMarker(e,c[_].toScreenRange(r),this.clazz,n)}}}).call(n.prototype),t.SearchHighlight=n}),define("ace/edit_session/fold_line",["require","exports","module","../range"],function(e,t,r){"use strict";function i(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var r=t[t.length-1];this.range=new s(t[0].start.row,t[0].start.column,r.end.row,r.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(e){e.setFoldLine(this)},this)}var s=e("../range").Range;(function(){this.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach(function(t){t.start.row+=e,t.end.row+=e})},this.addFold=function(e){if(e.sameRow){if(e.start.rowthis.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort(function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)}),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},this.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},this.walk=function(e,t,r){var i,s,n,o=0,a=this.folds,l=!0;null==t&&(t=this.end.row,r=this.end.column);for(var c=0;c0)){var l=s(e,o.start);return 0===a?t&&0!==l?-n-2:n:l>0||0===l&&!t?n:-n-1}}return-n-1},this.add=function(e){var t=!e.isEmpty(),r=this.pointIndex(e.start,t);r<0&&(r=-r-1);var i=this.pointIndex(e.end,t,r);return i<0?i=-i-1:i++,this.ranges.splice(r,i-r,e)},this.addList=function(e){for(var t=[],r=e.length;r--;)t.push.apply(t,this.add(e[r]));return t},this.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},this.merge=function(){var e=[],t=this.ranges;t=t.sort(function(e,t){return s(e.start,t.start)});for(var r,i=t[0],n=1;n=0},this.containsPoint=function(e){return this.pointIndex(e)>=0},this.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},this.clipRows=function(e,t){var r=this.ranges;if(r[0].start.row>t||r[r.length-1].start.rowi)break;if(_.start.row==i&&_.start.column>=t.column&&(_.start.column==t.column&&this.$insertRight||(_.start.column+=o,_.start.row+=n)),_.end.row==i&&_.end.column>=t.column){if(_.end.column==t.column&&this.$insertRight)continue;_.end.column==t.column&&o>0&&l_.start.column&&_.end.column==a[l+1].start.column&&(_.end.column-=o),_.end.column+=o,_.end.row+=n}}}if(0!=n&&l=e)return s;if(s.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var r=this.$foldData,i=0;for(t&&(i=r.indexOf(t)),-1==i&&(i=0),i;i=e)return s}return null},this.getFoldedRowCount=function(e,t){for(var r=this.$foldData,i=t-e+1,s=0;s=t){a=e?i-=t-a:i=0);break}o>=e&&(i-=a>=e?o-a:o-e+1)}return i},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort(function(e,t){return e.start.row-t.start.row}),e},this.addFold=function(e,t){var r,i=this.$foldData,s=!1;e instanceof o?r=e:(r=new o(t,e),r.collapseChildren=t.collapseChildren),this.$clipRangeToDocument(r.range);var a=r.start.row,l=r.start.column,c=r.end.row,_=r.end.column;if(!(a0&&(this.removeFolds(m),m.forEach(function(e){r.addSubFold(e)}));for(var g=0;g0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach(function(e){this.expandFold(e)},this)},this.unfold=function(e,t){var r,i;if(null==e?(r=new s(0,0,this.getLength(),0),t=!0):r="number"==typeof e?new s(e,0,e,this.getLine(e).length):"row"in e?s.fromPoints(e,e):e,i=this.getFoldsInRangeList(r),t)this.removeFolds(i);else for(var n=i;n.length;)this.expandFolds(n),n=this.getFoldsInRangeList(r);if(i.length)return i},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var r=this.getFoldLine(e,t);return r?r.end.row:e},this.getRowFoldStart=function(e,t){var r=this.getFoldLine(e,t);return r?r.start.row:e},this.getFoldDisplayLine=function(e,t,r,i,s){null==i&&(i=e.start.row),null==s&&(s=0),null==t&&(t=e.end.row),null==r&&(r=this.getLine(t).length);var n=this.doc,o="";return e.walk(function(e,t,r,a){if(!(t_)break}while(n&&l.test(n.type));n=i.stepBackward()}else n=i.getCurrentToken();return c.end.row=i.getCurrentTokenRow(),c.end.column=i.getCurrentTokenColumn()+n.value.length-2,c}},this.foldAll=function(e,t,r){void 0==r&&(r=1e5);var i=this.foldWidgets;if(i){t=t||this.getLength(),e=e||0;for(var s=e;s=e){s=n.end.row;try{var o=this.addFold("...",n);o&&(o.collapseChildren=r)}catch(e){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){if(this.$foldMode!=e){if(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),!e||"manual"==this.$foldStyle)return void(this.foldWidgets=null);this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)}},this.getParentFoldRangeData=function(e,t){var r=this.foldWidgets;if(!r||t&&r[e])return{};for(var i,s=e-1;s>=0;){var n=r[s];if(null==n&&(n=r[s]=this.getFoldWidget(s)),"start"==n){var o=this.getFoldWidgetRange(s);if(i||(i=o),o&&o.end.row>=e)break}s--}return{range:-1!==s&&o,firstRange:i}},this.onFoldWidgetClick=function(e,t){t=t.domEvent;var r={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,r)){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var r=this.getFoldWidget(e),i=this.getLine(e),s="end"===r?-1:1,n=this.getFoldAt(e,-1===s?0:i.length,s);if(n)return t.children||t.all?this.removeFold(n):this.expandFold(n),n;var o=this.getFoldWidgetRange(e,!0);if(o&&!o.isMultiLine()&&(n=this.getFoldAt(o.start.row,o.start.column,1))&&o.isEqual(n.range))return this.removeFold(n),n;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=o?o.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):o&&(t.all&&(o.collapseChildren=1e4),this.addFold("...",o));return o}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var r=this.$toggleFoldWidget(t,{});if(!r){var i=this.getParentFoldRangeData(t,!0);if(r=i.range||i.firstRange){t=r.start.row;var s=this.getFoldAt(t,this.getLine(t).length,1);s?this.removeFold(s):this.addFold("...",r)}}},this.updateFoldWidgets=function(e){var t=e.start.row,r=e.end.row-t;if(0===r)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,r+1,null);else{var i=Array(r+1);i.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}var s=e("../range").Range,n=e("./fold_line").FoldLine,o=e("./fold").Fold,a=e("../token_iterator").TokenIterator;t.Folding=i}),define("ace/edit_session/bracket_match",["require","exports","module","../token_iterator","../range"],function(e,t,r){"use strict";function i(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var r=t||this.getLine(e.row).charAt(e.column-1);if(""==r)return null;var i=r.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e):null},this.getBracketRange=function(e){var t,r=this.getLine(e.row),i=!0,s=r.charAt(e.column-1),o=s&&s.match(/([\(\[\{])|([\)\]\}])/);if(o||(s=r.charAt(e.column),e={row:e.row,column:e.column+1},o=s&&s.match(/([\(\[\{])|([\)\]\}])/),i=!1),!o)return null;if(o[1]){var a=this.$findClosingBracket(o[1],e);if(!a)return null;t=n.fromPoints(e,a),i||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a=this.$findOpeningBracket(o[2],e);if(!a)return null;t=n.fromPoints(a,e),i||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{"},this.$findOpeningBracket=function(e,t,r){var i=this.$brackets[e],n=1,o=new s(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){r||(r=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var _=c.charAt(l);if(_==i){if(0==(n-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else _==e&&(n+=1);l-=1}do{a=o.stepBackward()}while(a&&!r.test(a.type));if(null==a)break;c=a.value,l=c.length-1}return null}},this.$findClosingBracket=function(e,t,r){var i=this.$brackets[e],n=1,o=new s(this,t.row,t.column),a=o.getCurrentToken();if(a||(a=o.stepForward()),a){r||(r=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)")+")+"));for(var l=t.column-o.getCurrentTokenColumn();;){for(var c=a.value,_=c.length;l<_;){var d=c.charAt(l);if(d==i){if(0==(n-=1))return{row:o.getCurrentTokenRow(),column:l+o.getCurrentTokenColumn()}}else d==e&&(n+=1);l+=1}do{a=o.stepForward()}while(a&&!r.test(a.type));if(null==a)break;l=0}return null}}}var s=e("../token_iterator").TokenIterator,n=e("../range").Range;t.BracketMatch=i}),define("ace/edit_session",["require","exports","module","./lib/oop","./lib/lang","./bidihandler","./config","./lib/event_emitter","./selection","./mode/text","./range","./document","./background_tokenizer","./search_highlight","./edit_session/folding","./edit_session/bracket_match"],function(e,t,r){"use strict";var i=e("./lib/oop"),s=e("./lib/lang"),n=e("./bidihandler").BidiHandler,o=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,c=e("./mode/text").Mode,_=e("./range").Range,d=e("./document").Document,u=e("./background_tokenizer").BackgroundTokenizer,m=e("./search_highlight").SearchHighlight,g=function(e,t){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++g.$uid,this.$foldData.toString=function(){return this.join("\n")},this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof e&&e.getLine||(e=new d(e)),this.$bidiHandler=new n(this),this.setDocument(e),this.selection=new l(this),o.resetOptions(this),this.setMode(t),o._signal("session",this)};g.$uid=0,function(){function e(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}i.implement(this,a),this.setDocument=function(e){this.doc&&this.doc.removeListener("change",this.$onChange),this.doc=e,e.on("change",this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,r=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>r&&(this.$docRowCache.splice(r,t),this.$screenRowCache.splice(r,t))},this.$getRowCacheIndex=function(e,t){for(var r=0,i=e.length-1;r<=i;){var s=r+i>>1,n=e[s];if(t>n)r=s+1;else{if(!(t=t);n++);return(r=i[n])?(r.index=n,r.start=s-r.value.length,r):null},this.setUndoManager=function(e){if(this.$undoManager=e,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.$deltasFold.length&&(t.$deltas.push({group:"fold",deltas:t.$deltasFold}),t.$deltasFold=[]),t.$deltasDoc.length&&(t.$deltas.push({group:"doc",deltas:t.$deltasDoc}),t.$deltasDoc=[]),t.$deltas.length>0&&e.execute({action:"aceupdate",args:[t.$deltas,t],merge:t.mergeUndoDeltas}),t.mergeUndoDeltas=!1,t.$deltas=[]},this.$informUndoManager=s.delayedCall(this.$syncInformUndoManager)}},this.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},this.$defaultUndoManager={undo:function(){},redo:function(){},reset:function(){}},this.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},this.getTabString=function(){return this.getUseSoftTabs()?s.stringRepeat(" ",this.getTabSize()):"\t"},this.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},this.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},this.setTabSize=function(e){this.setOption("tabSize",e)},this.getTabSize=function(){return this.$tabSize},this.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},this.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},this.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},this.$overwrite=!1,this.setOverwrite=function(e){this.setOption("overwrite",e)},this.getOverwrite=function(){return this.$overwrite},this.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},this.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},this.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},this.getBreakpoints=function(){return this.$breakpoints},this.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t0&&(i=!!r.charAt(t-1).match(this.tokenRe)),i||(i=!!r.charAt(t).match(this.tokenRe)),i)var s=this.tokenRe;else if(/^\s+$/.test(r.slice(t-1,t+1)))var s=/\s/;else var s=this.nonTokenRe;var n=t;if(n>0){do{n--}while(n>=0&&r.charAt(n).match(s));n++}for(var o=t;oe&&(e=t.screenWidth)}),this.lineWidgetWidth=e},this.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),r=this.$rowLengthCache,i=0,s=0,n=this.$foldData[s],o=n?n.start.row:1/0,a=t.length,l=0;lo){if((l=n.end.row+1)>=a)break;n=this.$foldData[s++],o=n?n.start.row:1/0}null==r[l]&&(r[l]=this.$getStringScreenWidth(t[l])[0]),r[l]>i&&(i=r[l])}this.screenWidth=i}},this.getLine=function(e){return this.doc.getLine(e)},this.getLines=function(e,t){return this.doc.getLines(e,t)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},this.insert=function(e,t){return this.doc.insert(e,t)},this.remove=function(e){return this.doc.remove(e)},this.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},this.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var r=null,i=e.length-1;-1!=i;i--){var s=e[i];"doc"==s.group?(this.doc.revertDeltas(s.deltas),r=this.$getUndoSelection(s.deltas,!0,r)):s.deltas.forEach(function(e){this.addFolds(e.folds)},this)}return this.$fromUndo=!1,r&&this.$undoSelect&&!t&&this.selection.setSelectionRange(r),r}},this.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var r=null,i=0;ie.end.column&&(n.start.column+=a),n.end.row==e.end.row&&n.end.column>e.end.column&&(n.end.column+=a)),o&&n.start.row>=e.end.row&&(n.start.row+=o,n.end.row+=o)}if(n.end=this.insert(n.start,i),s.length){var l=e.start,c=n.start,o=c.row-l.row,a=c.column-l.column;this.addFolds(s.map(function(e){return e=e.clone(),e.start.row==l.row&&(e.start.column+=a),e.end.row==l.row&&(e.end.column+=a),e.start.row+=o,e.end.row+=o,e}))}return n},this.indentRows=function(e,t,r){r=r.replace(/\t/g,this.getTabString());for(var i=e;i<=t;i++)this.doc.insertInLine({row:i,column:0},r)},this.outdentRows=function(e){for(var t=e.collapseRows(),r=new _(0,0,0,0),i=this.getTabSize(),s=t.start.row;s<=t.end.row;++s){var n=this.getLine(s);r.start.row=s,r.end.row=s;for(var o=0;o0){var i=this.getRowFoldEnd(t+r);if(i>this.doc.getLength()-1)return 0;var s=i-t}else{e=this.$clipRowToDocument(e),t=this.$clipRowToDocument(t);var s=t-e+1}var n=new _(e,0,t,Number.MAX_VALUE),o=this.getFoldsInRange(n).map(function(e){return e=e.clone(),e.start.row+=s,e.end.row+=s,e}),a=0==r?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+s,a),o.length&&this.addFolds(o),s},this.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},this.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},this.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},this.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},this.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},this.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var r=this.doc.getLength();e>=r?(e=r-1,t=this.doc.getLine(r-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},this.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},this.adjustWrapLimit=function(e,t){var r=this.$wrapLimitRange;r.max<0&&(r={min:t,max:t});var i=this.$constrainWrapLimit(e,r.min,r.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},this.$constrainWrapLimit=function(e,t,r){return t&&(e=Math.max(t,e)),r&&(e=Math.min(r,e)),e},this.getWrapLimit=function(){return this.$wrapLimit},this.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},this.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},this.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,r=e.action,i=e.start,s=e.end,n=i.row,o=s.row,a=o-n,l=null;if(this.$updating=!0,0!=a)if("remove"===r){this[t?"$wrapData":"$rowLengthCache"].splice(n,a);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var _=this.getFoldLine(s.row),d=0;if(_){_.addRemoveChars(s.row,s.column,i.column-s.column),_.shiftRow(-a);var u=this.getFoldLine(n);u&&u!==_&&(u.merge(_),_=u),d=c.indexOf(_)+1}for(d;d=s.row&&_.shiftRow(-a)}o=n}else{var m=Array(a);m.unshift(n,0);var g=t?this.$wrapData:this.$rowLengthCache;g.splice.apply(g,m);var c=this.$foldData,_=this.getFoldLine(n),d=0;if(_){var h=_.range.compareInside(i.row,i.column);0==h?(_=_.split(i.row,i.column))&&(_.shiftRow(a),_.addRemoveChars(o,0,s.column-i.column)):-1==h&&(_.addRemoveChars(n,0,s.column-i.column),_.shiftRow(a)),d=c.indexOf(_)+1}for(d;d=n&&_.shiftRow(a)}}else{a=Math.abs(e.start.column-e.end.column),"remove"===r&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a);var _=this.getFoldLine(n);_&&_.addRemoveChars(n,i.column,a)}return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(n,o):this.$updateRowLengthCache(n,o),l},this.$updateRowLengthCache=function(e,t,r){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},this.$updateWrapData=function(e,i){var s,n,o=this.doc.getAllLines(),a=this.getTabSize(),l=this.$wrapData,c=this.$wrapLimit,_=e;for(i=Math.min(i,o.length-1);_<=i;)n=this.getFoldLine(_,n),n?(s=[],n.walk(function(e,i,n,a){var l;if(null!=e){l=this.$getDisplayTokens(e,s.length),l[0]=t;for(var c=1;ci-f;){var b=u+i-f;if(e[b-1]>=n&&e[b]>=n)a(b);else if(e[b]!=t&&e[b]!=r){for(var y=Math.max(b-(i-(i>>2)),u-1);b>y&&e[b]y&&e[b]y&&9==e[b];)b--}else for(;b>y&&e[b]y?a(++b):(b=u+i,2==e[b]&&b--,a(b-f))}else{for(b;b!=u-1&&e[b]!=t;b--);if(b>u){a(b);continue}for(b=u+i;b39&&a<48||a>57&&a<64?s.push(9):a>=4352&&e(a)?s.push(1,2):s.push(1)}return s},this.$getStringScreenWidth=function(t,r,i){if(0==r)return[0,0];null==r&&(r=1/0),i=i||0;var s,n;for(n=0;n=4352&&e(s)?i+=2:i+=1,!(i>r));n++);return[i,n]},this.lineWidgets=null,this.getRowLength=function(e){if(this.lineWidgets)var t=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0;else t=0;return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},this.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},this.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),r=this.$wrapData[t.row];return r.length&&r[0]=0)var a=c[_],n=this.$docRowCache[_],u=e>c[d-1];else var u=!d;for(var m=this.getLength()-1,g=this.getNextFoldLine(n),h=g?g.start.row:1/0;a<=e&&(l=this.getRowLength(n),!(a+l>e||n>=m));)a+=l,++n>h&&(n=g.end.row+1,g=this.getNextFoldLine(n,g),h=g?g.start.row:1/0),u&&(this.$docRowCache.push(n),this.$screenRowCache.push(a));if(g&&g.start.row<=n)i=this.getFoldDisplayLine(g),n=g.start.row;else{if(a+l<=e||n>m)return{row:m,column:this.getLine(m).length};i=this.getLine(n),g=null}var p=0,f=Math.floor(e-a);if(this.$useWrapMode){var b=this.$wrapData[n];b&&(s=b[f],f>0&&b.length&&(p=b.indent,o=b[f-1]||b[b.length-1],i=i.substring(o)))}return void 0!==r&&this.$bidiHandler.isBidiRow(a+f,n,f)&&(t=this.$bidiHandler.offsetToCol(r)),o+=this.$getStringScreenWidth(i,t-p)[1],this.$useWrapMode&&o>=s&&(o=s-1),g?g.idxToPosition(o):{row:n,column:o}},this.documentToScreenPosition=function(e,t){if(void 0===t)var r=this.$clipPositionToDocument(e.row,e.column);else r=this.$clipPositionToDocument(e,t);e=r.row,t=r.column;var i=0,s=null,n=null;(n=this.getFoldAt(e,t,1))&&(e=n.start.row,t=n.start.column);var o,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),_=l.length;if(_&&c>=0)var a=l[c],i=this.$screenRowCache[c],d=e>l[_-1];else var d=!_;for(var u=this.getNextFoldLine(a),m=u?u.start.row:1/0;a=m){if((o=u.end.row+1)>e)break @@ -402,6 +442,6 @@ pg_end_copy:["bool pg_end_copy([resource connection])","Sync with backend. Compl smfi_getsymval:["string smfi_getsymval(string macro)","Returns the value of the given macro or NULL if the macro is not defined."],smfi_replacebody:["bool smfi_replacebody(string body)","Replaces the body of the current message. If called more than once, subsequent calls result in data being appended to the new body."],smfi_setflags:["void smfi_setflags(long flags)","Sets the flags describing the actions the filter may take."],smfi_setreply:["bool smfi_setreply(string rcode, string xcode, string message)","Directly set the SMTP error reply code for this connection. This code will be used on subsequent error replies resulting from actions taken by this filter."],smfi_settimeout:["void smfi_settimeout(long timeout)","Sets the number of seconds libmilter will wait for an MTA connection before timing out a socket."],snmp2_get:["string snmp2_get(string host, string community, string object_id [, int timeout [, int retries]])","Fetch a SNMP object"],snmp2_getnext:["string snmp2_getnext(string host, string community, string object_id [, int timeout [, int retries]])","Fetch a SNMP object"],snmp2_real_walk:["array snmp2_real_walk(string host, string community, string object_id [, int timeout [, int retries]])","Return all objects including their respective object id withing the specified one"],snmp2_set:["int snmp2_set(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]])","Set the value of a SNMP object"],snmp2_walk:["array snmp2_walk(string host, string community, string object_id [, int timeout [, int retries]])","Return all objects under the specified object id"],snmp3_get:["int snmp3_get(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])","Fetch the value of a SNMP object"],snmp3_getnext:["int snmp3_getnext(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])","Fetch the value of a SNMP object"],snmp3_real_walk:["int snmp3_real_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])","Fetch the value of a SNMP object"],snmp3_set:["int snmp3_set(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id, string type, mixed value [, int timeout [, int retries]])","Fetch the value of a SNMP object"],snmp3_walk:["int snmp3_walk(string host, string sec_name, string sec_level, string auth_protocol, string auth_passphrase, string priv_protocol, string priv_passphrase, string object_id [, int timeout [, int retries]])","Fetch the value of a SNMP object"],snmp_get_quick_print:["bool snmp_get_quick_print(void)","Return the current status of quick_print"],snmp_get_valueretrieval:["int snmp_get_valueretrieval()","Return the method how the SNMP values will be returned"],snmp_read_mib:["int snmp_read_mib(string filename)","Reads and parses a MIB file into the active MIB tree."],snmp_set_enum_print:["void snmp_set_enum_print(int enum_print)","Return all values that are enums with their enum value instead of the raw integer"],snmp_set_oid_output_format:["void snmp_set_oid_output_format(int oid_format)","Set the OID output format."],snmp_set_quick_print:["void snmp_set_quick_print(int quick_print)","Return all objects including their respective object id withing the specified one"],snmp_set_valueretrieval:["void snmp_set_valueretrieval(int method)","Specify the method how the SNMP values will be returned"],snmpget:["string snmpget(string host, string community, string object_id [, int timeout [, int retries]])","Fetch a SNMP object"],snmpgetnext:["string snmpgetnext(string host, string community, string object_id [, int timeout [, int retries]])","Fetch a SNMP object"],snmprealwalk:["array snmprealwalk(string host, string community, string object_id [, int timeout [, int retries]])","Return all objects including their respective object id withing the specified one"],snmpset:["int snmpset(string host, string community, string object_id, string type, mixed value [, int timeout [, int retries]])","Set the value of a SNMP object"],snmpwalk:["array snmpwalk(string host, string community, string object_id [, int timeout [, int retries]])","Return all objects under the specified object id"],socket_accept:["resource socket_accept(resource socket)","Accepts a connection on the listening socket fd"],socket_bind:["bool socket_bind(resource socket, string addr [, int port])","Binds an open socket to a listening port, port is only specified in AF_INET family."],socket_clear_error:["void socket_clear_error([resource socket])","Clears the error on the socket or the last error code."],socket_close:["void socket_close(resource socket)","Closes a file descriptor"],socket_connect:["bool socket_connect(resource socket, string addr [, int port])","Opens a connection to addr:port on the socket specified by socket"],socket_create:["resource socket_create(int domain, int type, int protocol)","Creates an endpoint for communication in the domain specified by domain, of type specified by type"],socket_create_listen:["resource socket_create_listen(int port[, int backlog])","Opens a socket on port to accept connections"],socket_create_pair:["bool socket_create_pair(int domain, int type, int protocol, array &fd)","Creates a pair of indistinguishable sockets and stores them in fds."],socket_get_option:["mixed socket_get_option(resource socket, int level, int optname)","Gets socket options for the socket"],socket_getpeername:["bool socket_getpeername(resource socket, string &addr[, int &port])","Queries the remote side of the given socket which may either result in host/port or in a UNIX filesystem path, dependent on its type."],socket_getsockname:["bool socket_getsockname(resource socket, string &addr[, int &port])","Queries the remote side of the given socket which may either result in host/port or in a UNIX filesystem path, dependent on its type."],socket_last_error:["int socket_last_error([resource socket])","Returns the last socket error (either the last used or the provided socket resource)"],socket_listen:["bool socket_listen(resource socket[, int backlog])","Sets the maximum number of connections allowed to be waited for on the socket specified by fd"],socket_read:["string socket_read(resource socket, int length [, int type])","Reads a maximum of length bytes from socket"],socket_recv:["int socket_recv(resource socket, string &buf, int len, int flags)","Receives data from a connected socket"],socket_recvfrom:["int socket_recvfrom(resource socket, string &buf, int len, int flags, string &name [, int &port])","Receives data from a socket, connected or not"],socket_select:["int socket_select(array &read_fds, array &write_fds, array &except_fds, int tv_sec[, int tv_usec])","Runs the select() system call on the sets mentioned with a timeout specified by tv_sec and tv_usec"],socket_send:["int socket_send(resource socket, string buf, int len, int flags)","Sends data to a connected socket"],socket_sendto:["int socket_sendto(resource socket, string buf, int len, int flags, string addr [, int port])","Sends a message to a socket, whether it is connected or not"],socket_set_block:["bool socket_set_block(resource socket)","Sets blocking mode on a socket resource"],socket_set_nonblock:["bool socket_set_nonblock(resource socket)","Sets nonblocking mode on a socket resource"],socket_set_option:["bool socket_set_option(resource socket, int level, int optname, int|array optval)","Sets socket options for the socket"],socket_shutdown:["bool socket_shutdown(resource socket[, int how])","Shuts down a socket for receiving, sending, or both."],socket_strerror:["string socket_strerror(int errno)","Returns a string describing an error"],socket_write:["int socket_write(resource socket, string buf[, int length])","Writes the buffer to the socket resource, length is optional"],solid_fetch_prev:["bool solid_fetch_prev(resource result_id)",""],sort:["bool sort(array &array_arg [, int sort_flags])","Sort an array"],soundex:["string soundex(string str)","Calculate the soundex key of a string"],spl_autoload:["void spl_autoload(string class_name [, string file_extensions])","Default implementation for __autoload()"],spl_autoload_call:["void spl_autoload_call(string class_name)","Try all registerd autoload function to load the requested class"],spl_autoload_extensions:["string spl_autoload_extensions([string file_extensions])","Register and return default file extensions for spl_autoload"],spl_autoload_functions:["false|array spl_autoload_functions()","Return all registered __autoload() functionns"],spl_autoload_register:['bool spl_autoload_register([mixed autoload_function = "spl_autoload" [, throw = true [, prepend]]])',"Register given function as __autoload() implementation"],spl_autoload_unregister:["bool spl_autoload_unregister(mixed autoload_function)","Unregister given function as __autoload() implementation"],spl_classes:["array spl_classes()","Return an array containing the names of all clsses and interfaces defined in SPL"],spl_object_hash:["string spl_object_hash(object obj)","Return hash id for given object"],split:["array split(string pattern, string string [, int limit])","Split string into array by regular expression"],spliti:["array spliti(string pattern, string string [, int limit])","Split string into array by regular expression case-insensitive"],sprintf:["string sprintf(string format [, mixed arg1 [, mixed ...]])","Return a formatted string"],sql_regcase:["string sql_regcase(string string)","Make regular expression for case insensitive match"],sqlite_array_query:["array sqlite_array_query(resource db, string query [ , int result_type [, bool decode_binary]])","Executes a query against a given database and returns an array of arrays."],sqlite_busy_timeout:["void sqlite_busy_timeout(resource db, int ms)","Set busy timeout duration. If ms <= 0, all busy handlers are disabled."],sqlite_changes:["int sqlite_changes(resource db)","Returns the number of rows that were changed by the most recent SQL statement."],sqlite_close:["void sqlite_close(resource db)","Closes an open sqlite database."],sqlite_column:["mixed sqlite_column(resource result, mixed index_or_name [, bool decode_binary])","Fetches a column from the current row of a result set."],sqlite_create_aggregate:["bool sqlite_create_aggregate(resource db, string funcname, mixed step_func, mixed finalize_func[, long num_args])","Registers an aggregate function for queries."],sqlite_create_function:["bool sqlite_create_function(resource db, string funcname, mixed callback[, long num_args])",'Registers a "regular" function for queries.'],sqlite_current:["array sqlite_current(resource result [, int result_type [, bool decode_binary]])","Fetches the current row from a result set as an array."],sqlite_error_string:["string sqlite_error_string(int error_code)","Returns the textual description of an error code."],sqlite_escape_string:["string sqlite_escape_string(string item)","Escapes a string for use as a query parameter."],sqlite_exec:["boolean sqlite_exec(string query, resource db[, string &error_message])","Executes a result-less query against a given database"],sqlite_factory:["object sqlite_factory(string filename [, int mode [, string &error_message]])","Opens a SQLite database and creates an object for it. Will create the database if it does not exist."],sqlite_fetch_all:["array sqlite_fetch_all(resource result [, int result_type [, bool decode_binary]])","Fetches all rows from a result set as an array of arrays."],sqlite_fetch_array:["array sqlite_fetch_array(resource result [, int result_type [, bool decode_binary]])","Fetches the next row from a result set as an array."],sqlite_fetch_column_types:["resource sqlite_fetch_column_types(string table_name, resource db [, int result_type])","Return an array of column types from a particular table."],sqlite_fetch_object:["object sqlite_fetch_object(resource result [, string class_name [, NULL|array ctor_params [, bool decode_binary]]])","Fetches the next row from a result set as an object."],sqlite_fetch_single:["string sqlite_fetch_single(resource result [, bool decode_binary])","Fetches the first column of a result set as a string."],sqlite_field_name:["string sqlite_field_name(resource result, int field_index)","Returns the name of a particular field of a result set."],sqlite_has_prev:["bool sqlite_has_prev(resource result)","* Returns whether a previous row is available."],sqlite_key:["int sqlite_key(resource result)","Return the current row index of a buffered result."],sqlite_last_error:["int sqlite_last_error(resource db)","Returns the error code of the last error for a database."],sqlite_last_insert_rowid:["int sqlite_last_insert_rowid(resource db)","Returns the rowid of the most recently inserted row."],sqlite_libencoding:["string sqlite_libencoding()","Returns the encoding (iso8859 or UTF-8) of the linked SQLite library."],sqlite_libversion:["string sqlite_libversion()","Returns the version of the linked SQLite library."],sqlite_next:["bool sqlite_next(resource result)","Seek to the next row number of a result set."],sqlite_num_fields:["int sqlite_num_fields(resource result)","Returns the number of fields in a result set."],sqlite_num_rows:["int sqlite_num_rows(resource result)","Returns the number of rows in a buffered result set."],sqlite_open:["resource sqlite_open(string filename [, int mode [, string &error_message]])","Opens a SQLite database. Will create the database if it does not exist."],sqlite_popen:["resource sqlite_popen(string filename [, int mode [, string &error_message]])","Opens a persistent handle to a SQLite database. Will create the database if it does not exist."],sqlite_prev:["bool sqlite_prev(resource result)","* Seek to the previous row number of a result set."],sqlite_query:["resource sqlite_query(string query, resource db [, int result_type [, string &error_message]])","Executes a query against a given database and returns a result handle."],sqlite_rewind:["bool sqlite_rewind(resource result)","Seek to the first row number of a buffered result set."],sqlite_seek:["bool sqlite_seek(resource result, int row)","Seek to a particular row number of a buffered result set."],sqlite_single_query:["array sqlite_single_query(resource db, string query [, bool first_row_only [, bool decode_binary]])","Executes a query and returns either an array for one single column or the value of the first row."],sqlite_udf_decode_binary:["string sqlite_udf_decode_binary(string data)","Decode binary encoding on a string parameter passed to an UDF."],sqlite_udf_encode_binary:["string sqlite_udf_encode_binary(string data)","Apply binary encoding (if required) to a string to return from an UDF."],sqlite_unbuffered_query:["resource sqlite_unbuffered_query(string query, resource db [ , int result_type [, string &error_message]])","Executes a query that does not prefetch and buffer all data."],sqlite_valid:["bool sqlite_valid(resource result)","Returns whether more rows are available."],sqrt:["float sqrt(float number)","Returns the square root of the number"],srand:["void srand([int seed])","Seeds random number generator"],sscanf:["mixed sscanf(string str, string format [, string ...])","Implements an ANSI C compatible sscanf"],stat:["array stat(string filename)","Give information about a file"],str_getcsv:["array str_getcsv(string input[, string delimiter[, string enclosure[, string escape]]])","Parse a CSV string into an array"],str_ireplace:["mixed str_ireplace(mixed search, mixed replace, mixed subject [, int &replace_count])","Replaces all occurrences of search in haystack with replace / case-insensitive"],str_pad:["string str_pad(string input, int pad_length [, string pad_string [, int pad_type]])","Returns input string padded on the left or right to specified length with pad_string"],str_repeat:["string str_repeat(string input, int mult)","Returns the input string repeat mult times"],str_replace:["mixed str_replace(mixed search, mixed replace, mixed subject [, int &replace_count])","Replaces all occurrences of search in haystack with replace"],str_rot13:["string str_rot13(string str)","Perform the rot13 transform on a string"],str_shuffle:["void str_shuffle(string str)","Shuffles string. One permutation of all possible is created"],str_split:["array str_split(string str [, int split_length])","Convert a string to an array. If split_length is specified, break the string down into chunks each split_length characters long."],str_word_count:["mixed str_word_count(string str, [int format [, string charlist]])",'Counts the number of words inside a string. If format of 1 is specified, then the function will return an array containing all the words found inside the string. If format of 2 is specified, then the function will return an associated array where the position of the word is the key and the word itself is the value. For the purpose of this function, \'word\' is defined as a locale dependent string containing alphabetic characters, which also may contain, but not start with "\'" and "-" characters.'],strcasecmp:["int strcasecmp(string str1, string str2)","Binary safe case-insensitive string comparison"],strchr:["string strchr(string haystack, string needle)","An alias for strstr"],strcmp:["int strcmp(string str1, string str2)","Binary safe string comparison"],strcoll:["int strcoll(string str1, string str2)","Compares two strings using the current locale"],strcspn:["int strcspn(string str, string mask [, start [, len]])","Finds length of initial segment consisting entirely of characters not found in mask. If start or/and length is provide works like strcspn(substr($s,$start,$len),$bad_chars)"],stream_bucket_append:["void stream_bucket_append(resource brigade, resource bucket)","Append bucket to brigade"],stream_bucket_make_writeable:["object stream_bucket_make_writeable(resource brigade)","Return a bucket object from the brigade for operating on"],stream_bucket_new:["resource stream_bucket_new(resource stream, string buffer)","Create a new bucket for use on the current stream"],stream_bucket_prepend:["void stream_bucket_prepend(resource brigade, resource bucket)","Prepend bucket to brigade"],stream_context_create:["resource stream_context_create([array options[, array params]])","Create a file context and optionally set parameters"],stream_context_get_default:["resource stream_context_get_default([array options])","Get a handle on the default file/stream context and optionally set parameters"],stream_context_get_options:["array stream_context_get_options(resource context|resource stream)","Retrieve options for a stream/wrapper/context"],stream_context_get_params:["array stream_context_get_params(resource context|resource stream)","Get parameters of a file context"],stream_context_set_default:["resource stream_context_set_default(array options)","Set default file/stream context, returns the context as a resource"],stream_context_set_option:["bool stream_context_set_option(resource context|resource stream, string wrappername, string optionname, mixed value)","Set an option for a wrapper"],stream_context_set_params:["bool stream_context_set_params(resource context|resource stream, array options)","Set parameters for a file context"],stream_copy_to_stream:["long stream_copy_to_stream(resource source, resource dest [, long maxlen [, long pos]])","Reads up to maxlen bytes from source stream and writes them to dest stream."],stream_filter_append:["resource stream_filter_append(resource stream, string filtername[, int read_write[, string filterparams]])","Append a filter to a stream"],stream_filter_prepend:["resource stream_filter_prepend(resource stream, string filtername[, int read_write[, string filterparams]])","Prepend a filter to a stream"],stream_filter_register:["bool stream_filter_register(string filtername, string classname)","Registers a custom filter handler class"],stream_filter_remove:["bool stream_filter_remove(resource stream_filter)","Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource"],stream_get_contents:["string stream_get_contents(resource source [, long maxlen [, long offset]])","Reads all remaining bytes (or up to maxlen bytes) from a stream and returns them as a string."],stream_get_filters:["array stream_get_filters(void)","Returns a list of registered filters"],stream_get_line:["string stream_get_line(resource stream, int maxlen [, string ending])","Read up to maxlen bytes from a stream or until the ending string is found"],stream_get_meta_data:["array stream_get_meta_data(resource fp)","Retrieves header/meta data from streams/file pointers"],stream_get_transports:["array stream_get_transports()","Retrieves list of registered socket transports"],stream_get_wrappers:["array stream_get_wrappers()","Retrieves list of registered stream wrappers"],stream_is_local:["bool stream_is_local(resource stream|string url)",""],stream_resolve_include_path:["string stream_resolve_include_path(string filename)","Determine what file will be opened by calls to fopen() with a relative path"],stream_select:["int stream_select(array &read_streams, array &write_streams, array &except_streams, int tv_sec[, int tv_usec])","Runs the select() system call on the sets of streams with a timeout specified by tv_sec and tv_usec"],stream_set_blocking:["bool stream_set_blocking(resource socket, int mode)","Set blocking/non-blocking mode on a socket or stream"],stream_set_timeout:["bool stream_set_timeout(resource stream, int seconds [, int microseconds])","Set timeout on stream read to seconds + microseonds"],stream_set_write_buffer:["int stream_set_write_buffer(resource fp, int buffer)","Set file write buffer"],stream_socket_accept:["resource stream_socket_accept(resource serverstream, [ double timeout [, string &peername ]])","Accept a client connection from a server socket"],stream_socket_client:["resource stream_socket_client(string remoteaddress [, long &errcode [, string &errstring [, double timeout [, long flags [, resource context]]]]])","Open a client connection to a remote address"],stream_socket_enable_crypto:["int stream_socket_enable_crypto(resource stream, bool enable [, int cryptokind [, resource sessionstream]])","Enable or disable a specific kind of crypto on the stream"],stream_socket_get_name:["string stream_socket_get_name(resource stream, bool want_peer)","Returns either the locally bound or remote name for a socket stream"],stream_socket_pair:["array stream_socket_pair(int domain, int type, int protocol)","Creates a pair of connected, indistinguishable socket streams"],stream_socket_recvfrom:["string stream_socket_recvfrom(resource stream, long amount [, long flags [, string &remote_addr]])","Receives data from a socket stream"],stream_socket_sendto:["long stream_socket_sendto(resouce stream, string data [, long flags [, string target_addr]])","Send data to a socket stream. If target_addr is specified it must be in dotted quad (or [ipv6]) format"],stream_socket_server:["resource stream_socket_server(string localaddress [, long &errcode [, string &errstring [, long flags [, resource context]]]])","Create a server socket bound to localaddress"],stream_socket_shutdown:["int stream_socket_shutdown(resource stream, int how)","causes all or part of a full-duplex connection on the socket associated with stream to be shut down. If how is SHUT_RD, further receptions will be disallowed. If how is SHUT_WR, further transmissions will be disallowed. If how is SHUT_RDWR, further receptions and transmissions will be disallowed."],stream_supports_lock:["bool stream_supports_lock(resource stream)","Tells wether the stream supports locking through flock()."],stream_wrapper_register:["bool stream_wrapper_register(string protocol, string classname[, integer flags])","Registers a custom URL protocol handler class"],stream_wrapper_restore:["bool stream_wrapper_restore(string protocol)","Restore the original protocol handler, overriding if necessary"],stream_wrapper_unregister:["bool stream_wrapper_unregister(string protocol)","Unregister a wrapper for the life of the current request."],strftime:["string strftime(string format [, int timestamp])","Format a local time/date according to locale settings"],strip_tags:["string strip_tags(string str [, string allowable_tags])","Strips HTML and PHP tags from a string"],stripcslashes:["string stripcslashes(string str)","Strips backslashes from a string. Uses C-style conventions"],stripos:["int stripos(string haystack, string needle [, int offset])","Finds position of first occurrence of a string within another, case insensitive"],stripslashes:["string stripslashes(string str)","Strips backslashes from a string"],stristr:["string stristr(string haystack, string needle[, bool part])","Finds first occurrence of a string within another, case insensitive"],strlen:["int strlen(string str)","Get string length"],strnatcasecmp:["int strnatcasecmp(string s1, string s2)","Returns the result of case-insensitive string comparison using 'natural' algorithm"],strnatcmp:["int strnatcmp(string s1, string s2)","Returns the result of string comparison using 'natural' algorithm"],strncasecmp:["int strncasecmp(string str1, string str2, int len)","Binary safe string comparison"],strncmp:["int strncmp(string str1, string str2, int len)","Binary safe string comparison"],strpbrk:["array strpbrk(string haystack, string char_list)","Search a string for any of a set of characters"],strpos:["int strpos(string haystack, string needle [, int offset])","Finds position of first occurrence of a string within another"],strptime:["string strptime(string timestamp, string format)","Parse a time/date generated with strftime()"],strrchr:["string strrchr(string haystack, string needle)","Finds the last occurrence of a character in a string within another"],strrev:["string strrev(string str)","Reverse a string"],strripos:["int strripos(string haystack, string needle [, int offset])","Finds position of last occurrence of a string within another string"],strrpos:["int strrpos(string haystack, string needle [, int offset])","Finds position of last occurrence of a string within another string"],strspn:["int strspn(string str, string mask [, start [, len]])","Finds length of initial segment consisting entirely of characters found in mask. If start or/and length is provided works like strspn(substr($s,$start,$len),$good_chars)"],strstr:["string strstr(string haystack, string needle[, bool part])","Finds first occurrence of a string within another"],strtok:["string strtok([string str,] string token)","Tokenize a string"],strtolower:["string strtolower(string str)","Makes a string lowercase"],strtotime:["int strtotime(string time [, int now ])","Convert string representation of date and time to a timestamp"],strtoupper:["string strtoupper(string str)","Makes a string uppercase"],strtr:["string strtr(string str, string from[, string to])","Translates characters in str using given translation tables"],strval:["string strval(mixed var)","Get the string value of a variable"],substr:["string substr(string str, int start [, int length])","Returns part of a string"],substr_compare:["int substr_compare(string main_str, string str, int offset [, int length [, bool case_sensitivity]])","Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters"],substr_count:["int substr_count(string haystack, string needle [, int offset [, int length]])","Returns the number of times a substring occurs in the string"],substr_replace:["mixed substr_replace(mixed str, mixed repl, mixed start [, mixed length])","Replaces part of a string with another string"],sybase_affected_rows:["int sybase_affected_rows([resource link_id])","Get number of affected rows in last query"],sybase_close:["bool sybase_close([resource link_id])","Close Sybase connection"],sybase_connect:["int sybase_connect([string host [, string user [, string password [, string charset [, string appname [, bool new]]]]]])","Open Sybase server connection"],sybase_data_seek:["bool sybase_data_seek(resource result, int offset)","Move internal row pointer"],sybase_deadlock_retry_count:["void sybase_deadlock_retry_count(int retry_count)","Sets deadlock retry count"],sybase_fetch_array:["array sybase_fetch_array(resource result)","Fetch row as array"],sybase_fetch_assoc:["array sybase_fetch_assoc(resource result)","Fetch row as array without numberic indices"],sybase_fetch_field:["object sybase_fetch_field(resource result [, int offset])","Get field information"],sybase_fetch_object:["object sybase_fetch_object(resource result [, mixed object])","Fetch row as object"],sybase_fetch_row:["array sybase_fetch_row(resource result)","Get row as enumerated array"],sybase_field_seek:["bool sybase_field_seek(resource result, int offset)","Set field offset"],sybase_free_result:["bool sybase_free_result(resource result)","Free result memory"],sybase_get_last_message:["string sybase_get_last_message(void)","Returns the last message from server (over min_message_severity)"],sybase_min_client_severity:["void sybase_min_client_severity(int severity)","Sets minimum client severity"],sybase_min_server_severity:["void sybase_min_server_severity(int severity)","Sets minimum server severity"],sybase_num_fields:["int sybase_num_fields(resource result)","Get number of fields in result"],sybase_num_rows:["int sybase_num_rows(resource result)","Get number of rows in result"],sybase_pconnect:["int sybase_pconnect([string host [, string user [, string password [, string charset [, string appname]]]]])","Open persistent Sybase connection"],sybase_query:["int sybase_query(string query [, resource link_id])","Send Sybase query"],sybase_result:["string sybase_result(resource result, int row, mixed field)","Get result data"],sybase_select_db:["bool sybase_select_db(string database [, resource link_id])","Select Sybase database"],sybase_set_message_handler:["bool sybase_set_message_handler(mixed error_func [, resource connection])","Set the error handler, to be called when a server message is raised. If error_func is NULL the handler will be deleted"],sybase_unbuffered_query:["int sybase_unbuffered_query(string query [, resource link_id])","Send Sybase query"],symlink:["int symlink(string target, string link)","Create a symbolic link"],sys_get_temp_dir:["string sys_get_temp_dir()","Returns directory path used for temporary files"],sys_getloadavg:["array sys_getloadavg()",""],syslog:["bool syslog(int priority, string message)","Generate a system log message"],system:["int system(string command [, int &return_value])","Execute an external program and display output"],tan:["float tan(float number)","Returns the tangent of the number in radians"],tanh:["float tanh(float number)","Returns the hyperbolic tangent of the number, defined as sinh(number)/cosh(number)"],tempnam:["string tempnam(string dir, string prefix)","Create a unique filename in a directory"],textdomain:["string textdomain(string domain)",'Set the textdomain to "domain". Returns the current domain'],tidy_access_count:["int tidy_access_count()","Returns the Number of Tidy accessibility warnings encountered for specified document."],tidy_clean_repair:["boolean tidy_clean_repair()","Execute configured cleanup and repair operations on parsed markup"],tidy_config_count:["int tidy_config_count()","Returns the Number of Tidy configuration errors encountered for specified document."],tidy_diagnose:["boolean tidy_diagnose()","Run configured diagnostics on parsed and repaired markup."], tidy_error_count:["int tidy_error_count()","Returns the Number of Tidy errors encountered for specified document."],tidy_get_body:["TidyNode tidy_get_body(resource tidy)","Returns a TidyNode Object starting from the tag of the tidy parse tree"],tidy_get_config:["array tidy_get_config()","Get current Tidy configuarion"],tidy_get_error_buffer:["string tidy_get_error_buffer([boolean detailed])","Return warnings and errors which occured parsing the specified document"],tidy_get_head:["TidyNode tidy_get_head()","Returns a TidyNode Object starting from the tag of the tidy parse tree"],tidy_get_html:["TidyNode tidy_get_html()","Returns a TidyNode Object starting from the tag of the tidy parse tree"],tidy_get_html_ver:["int tidy_get_html_ver()","Get the Detected HTML version for the specified document."],tidy_get_opt_doc:["string tidy_get_opt_doc(tidy resource, string optname)","Returns the documentation for the given option name"],tidy_get_output:["string tidy_get_output()","Return a string representing the parsed tidy markup"],tidy_get_release:["string tidy_get_release()","Get release date (version) for Tidy library"],tidy_get_root:["TidyNode tidy_get_root()","Returns a TidyNode Object representing the root of the tidy parse tree"],tidy_get_status:["int tidy_get_status()","Get status of specfied document."],tidy_getopt:["mixed tidy_getopt(string option)","Returns the value of the specified configuration option for the tidy document."],tidy_is_xhtml:["boolean tidy_is_xhtml()","Indicates if the document is a XHTML document."],tidy_is_xml:["boolean tidy_is_xml()","Indicates if the document is a generic (non HTML/XHTML) XML document."],tidy_parse_file:["boolean tidy_parse_file(string file [, mixed config_options [, string encoding [, bool use_include_path]]])","Parse markup in file or URI"],tidy_parse_string:["bool tidy_parse_string(string input [, mixed config_options [, string encoding]])","Parse a document stored in a string"],tidy_repair_file:["boolean tidy_repair_file(string filename [, mixed config_file [, string encoding [, bool use_include_path]]])","Repair a file using an optionally provided configuration file"],tidy_repair_string:["boolean tidy_repair_string(string data [, mixed config_file [, string encoding]])","Repair a string using an optionally provided configuration file"],tidy_warning_count:["int tidy_warning_count()","Returns the Number of Tidy warnings encountered for specified document."],time:["int time(void)","Return current UNIX timestamp"],time_nanosleep:["mixed time_nanosleep(long seconds, long nanoseconds)","Delay for a number of seconds and nano seconds"],time_sleep_until:["mixed time_sleep_until(float timestamp)","Make the script sleep until the specified time"],timezone_abbreviations_list:["array timezone_abbreviations_list()","Returns associative array containing dst, offset and the timezone name"],timezone_identifiers_list:["array timezone_identifiers_list([long what[, string country]])","Returns numerically index array with all timezone identifiers."],timezone_location_get:["array timezone_location_get()","Returns location information for a timezone, including country code, latitude/longitude and comments"],timezone_name_from_abbr:["string timezone_name_from_abbr(string abbr[, long gmtOffset[, long isdst]])","Returns the timezone name from abbrevation"],timezone_name_get:["string timezone_name_get(DateTimeZone object)","Returns the name of the timezone."],timezone_offset_get:["long timezone_offset_get(DateTimeZone object, DateTime object)","Returns the timezone offset."],timezone_open:["DateTimeZone timezone_open(string timezone)","Returns new DateTimeZone object"],timezone_transitions_get:["array timezone_transitions_get(DateTimeZone object [, long timestamp_begin [, long timestamp_end ]])","Returns numerically indexed array containing associative array for all transitions in the specified range for the timezone."],timezone_version_get:["array timezone_version_get()","Returns the Olson database version number."],tmpfile:["resource tmpfile(void)","Create a temporary file that will be deleted automatically after use"],token_get_all:["array token_get_all(string source)",""],token_name:["string token_name(int type)",""],touch:["bool touch(string filename [, int time [, int atime]])","Set modification time of file"],trigger_error:["void trigger_error(string messsage [, int error_type])","Generates a user-level error/warning/notice message"],trim:["string trim(string str [, string character_mask])","Strips whitespace from the beginning and end of a string"],uasort:["bool uasort(array array_arg, string cmp_function)","Sort an array with a user-defined comparison function and maintain index association"],ucfirst:["string ucfirst(string str)","Make a string's first character lowercase"],ucwords:["string ucwords(string str)","Uppercase the first character of every word in a string"],uksort:["bool uksort(array array_arg, string cmp_function)","Sort an array by keys using a user-defined comparison function"],umask:["int umask([int mask])","Return or change the umask"],uniqid:["string uniqid([string prefix [, bool more_entropy]])","Generates a unique ID"],unixtojd:["int unixtojd([int timestamp])","Convert UNIX timestamp to Julian Day"],unlink:["bool unlink(string filename[, context context])","Delete a file"],unpack:["array unpack(string format, string input)","Unpack binary string into named array elements according to format argument"],unregister_tick_function:["void unregister_tick_function(string function_name)","Unregisters a tick callback function"],unserialize:["mixed unserialize(string variable_representation)","Takes a string representation of variable and recreates it"],unset:["void unset (mixed var [, mixed var])","Unset a given variable"],urldecode:["string urldecode(string str)","Decodes URL-encoded string"],urlencode:["string urlencode(string str)","URL-encodes string"],usleep:["void usleep(int micro_seconds)","Delay for a given number of micro seconds"],usort:["bool usort(array array_arg, string cmp_function)","Sort an array by values using a user-defined comparison function"],utf8_decode:["string utf8_decode(string data)","Converts a UTF-8 encoded string to ISO-8859-1"],utf8_encode:["string utf8_encode(string data)","Encodes an ISO-8859-1 string to UTF-8"],var_dump:["void var_dump(mixed var)","Dumps a string representation of variable to output"],var_export:["mixed var_export(mixed var [, bool return])","Outputs or returns a string representation of a variable"],variant_abs:["mixed variant_abs(mixed left)","Returns the absolute value of a variant"],variant_add:["mixed variant_add(mixed left, mixed right)",'"Adds" two variant values together and returns the result'],variant_and:["mixed variant_and(mixed left, mixed right)","performs a bitwise AND operation between two variants and returns the result"],variant_cast:["object variant_cast(object variant, int type)","Convert a variant into a new variant object of another type"],variant_cat:["mixed variant_cat(mixed left, mixed right)","concatenates two variant values together and returns the result"],variant_cmp:["int variant_cmp(mixed left, mixed right [, int lcid [, int flags]])","Compares two variants"],variant_date_from_timestamp:["object variant_date_from_timestamp(int timestamp)","Returns a variant date representation of a unix timestamp"],variant_date_to_timestamp:["int variant_date_to_timestamp(object variant)","Converts a variant date/time value to unix timestamp"],variant_div:["mixed variant_div(mixed left, mixed right)","Returns the result from dividing two variants"],variant_eqv:["mixed variant_eqv(mixed left, mixed right)","Performs a bitwise equivalence on two variants"],variant_fix:["mixed variant_fix(mixed left)","Returns the integer part ? of a variant"],variant_get_type:["int variant_get_type(object variant)","Returns the VT_XXX type code for a variant"],variant_idiv:["mixed variant_idiv(mixed left, mixed right)","Converts variants to integers and then returns the result from dividing them"],variant_imp:["mixed variant_imp(mixed left, mixed right)","Performs a bitwise implication on two variants"],variant_int:["mixed variant_int(mixed left)","Returns the integer portion of a variant"],variant_mod:["mixed variant_mod(mixed left, mixed right)","Divides two variants and returns only the remainder"],variant_mul:["mixed variant_mul(mixed left, mixed right)","multiplies the values of the two variants and returns the result"],variant_neg:["mixed variant_neg(mixed left)","Performs logical negation on a variant"],variant_not:["mixed variant_not(mixed left)","Performs bitwise not negation on a variant"],variant_or:["mixed variant_or(mixed left, mixed right)","Performs a logical disjunction on two variants"],variant_pow:["mixed variant_pow(mixed left, mixed right)","Returns the result of performing the power function with two variants"],variant_round:["mixed variant_round(mixed left, int decimals)","Rounds a variant to the specified number of decimal places"],variant_set:["void variant_set(object variant, mixed value)","Assigns a new value for a variant object"],variant_set_type:["void variant_set_type(object variant, int type)",'Convert a variant into another type. Variant is modified "in-place"'],variant_sub:["mixed variant_sub(mixed left, mixed right)","subtracts the value of the right variant from the left variant value and returns the result"],variant_xor:["mixed variant_xor(mixed left, mixed right)","Performs a logical exclusion on two variants"],version_compare:["int version_compare(string ver1, string ver2 [, string oper])",'Compares two "PHP-standardized" version number strings'],vfprintf:["int vfprintf(resource stream, string format, array args)","Output a formatted string into a stream"],virtual:["bool virtual(string filename)","Perform an Apache sub-request"],vprintf:["int vprintf(string format, array args)","Output a formatted string"],vsprintf:["string vsprintf(string format, array args)","Return a formatted string"],wddx_add_vars:["int wddx_add_vars(resource packet_id, mixed var_names [, mixed ...])","Serializes given variables and adds them to packet given by packet_id"],wddx_deserialize:["mixed wddx_deserialize(mixed packet)","Deserializes given packet and returns a PHP value"],wddx_packet_end:["string wddx_packet_end(resource packet_id)","Ends specified WDDX packet and returns the string containing the packet"],wddx_packet_start:["resource wddx_packet_start([string comment])","Starts a WDDX packet with optional comment and returns the packet id"],wddx_serialize_value:["string wddx_serialize_value(mixed var [, string comment])","Creates a new packet and serializes the given value"],wddx_serialize_vars:["string wddx_serialize_vars(mixed var_name [, mixed ...])","Creates a new packet and serializes given variables into a struct"],wordwrap:["string wordwrap(string str [, int width [, string break [, boolean cut]]])","Wraps buffer to selected number of characters using string break char"],xml_error_string:["string xml_error_string(int code)","Get XML parser error string"],xml_get_current_byte_index:["int xml_get_current_byte_index(resource parser)","Get current byte index for an XML parser"],xml_get_current_column_number:["int xml_get_current_column_number(resource parser)","Get current column number for an XML parser"],xml_get_current_line_number:["int xml_get_current_line_number(resource parser)","Get current line number for an XML parser"],xml_get_error_code:["int xml_get_error_code(resource parser)","Get XML parser error code"],xml_parse:["int xml_parse(resource parser, string data [, int isFinal])","Start parsing an XML document"],xml_parse_into_struct:["int xml_parse_into_struct(resource parser, string data, array &values [, array &index ])","Parsing a XML document"],xml_parser_create:["resource xml_parser_create([string encoding])","Create an XML parser"],xml_parser_create_ns:["resource xml_parser_create_ns([string encoding [, string sep]])","Create an XML parser"],xml_parser_free:["int xml_parser_free(resource parser)","Free an XML parser"],xml_parser_get_option:["int xml_parser_get_option(resource parser, int option)","Get options from an XML parser"],xml_parser_set_option:["int xml_parser_set_option(resource parser, int option, mixed value)","Set options in an XML parser"],xml_set_character_data_handler:["int xml_set_character_data_handler(resource parser, string hdl)","Set up character data handler"],xml_set_default_handler:["int xml_set_default_handler(resource parser, string hdl)","Set up default handler"],xml_set_element_handler:["int xml_set_element_handler(resource parser, string shdl, string ehdl)","Set up start and end element handlers"],xml_set_end_namespace_decl_handler:["int xml_set_end_namespace_decl_handler(resource parser, string hdl)","Set up character data handler"],xml_set_external_entity_ref_handler:["int xml_set_external_entity_ref_handler(resource parser, string hdl)","Set up external entity reference handler"],xml_set_notation_decl_handler:["int xml_set_notation_decl_handler(resource parser, string hdl)","Set up notation declaration handler"],xml_set_object:["int xml_set_object(resource parser, object &obj)","Set up object which should be used for callbacks"],xml_set_processing_instruction_handler:["int xml_set_processing_instruction_handler(resource parser, string hdl)","Set up processing instruction (PI) handler"],xml_set_start_namespace_decl_handler:["int xml_set_start_namespace_decl_handler(resource parser, string hdl)","Set up character data handler"],xml_set_unparsed_entity_decl_handler:["int xml_set_unparsed_entity_decl_handler(resource parser, string hdl)","Set up unparsed entity declaration handler"],xmlrpc_decode:["array xmlrpc_decode(string xml [, string encoding])","Decodes XML into native PHP types"],xmlrpc_decode_request:["array xmlrpc_decode_request(string xml, string& method [, string encoding])","Decodes XML into native PHP types"],xmlrpc_encode:["string xmlrpc_encode(mixed value)","Generates XML for a PHP value"],xmlrpc_encode_request:["string xmlrpc_encode_request(string method, mixed params [, array output_options])","Generates XML for a method request"],xmlrpc_get_type:["string xmlrpc_get_type(mixed value)","Gets xmlrpc type for a PHP value. Especially useful for base64 and datetime strings"],xmlrpc_is_fault:["bool xmlrpc_is_fault(array)","Determines if an array value represents an XMLRPC fault."],xmlrpc_parse_method_descriptions:["array xmlrpc_parse_method_descriptions(string xml)","Decodes XML into a list of method descriptions"],xmlrpc_server_add_introspection_data:["int xmlrpc_server_add_introspection_data(resource server, array desc)","Adds introspection documentation"],xmlrpc_server_call_method:["mixed xmlrpc_server_call_method(resource server, string xml, mixed user_data [, array output_options])","Parses XML requests and call methods"],xmlrpc_server_create:["resource xmlrpc_server_create(void)","Creates an xmlrpc server"],xmlrpc_server_destroy:["int xmlrpc_server_destroy(resource server)","Destroys server resources"],xmlrpc_server_register_introspection_callback:["bool xmlrpc_server_register_introspection_callback(resource server, string function)","Register a PHP function to generate documentation"],xmlrpc_server_register_method:["bool xmlrpc_server_register_method(resource server, string method_name, string function)","Register a PHP function to handle method matching method_name"],xmlrpc_set_type:["bool xmlrpc_set_type(string value, string type)","Sets xmlrpc type, base64 or datetime, for a PHP string value"],xmlwriter_end_attribute:["bool xmlwriter_end_attribute(resource xmlwriter)","End attribute - returns FALSE on error"],xmlwriter_end_cdata:["bool xmlwriter_end_cdata(resource xmlwriter)","End current CDATA - returns FALSE on error"],xmlwriter_end_comment:["bool xmlwriter_end_comment(resource xmlwriter)","Create end comment - returns FALSE on error"],xmlwriter_end_document:["bool xmlwriter_end_document(resource xmlwriter)","End current document - returns FALSE on error"],xmlwriter_end_dtd:["bool xmlwriter_end_dtd(resource xmlwriter)","End current DTD - returns FALSE on error"],xmlwriter_end_dtd_attlist:["bool xmlwriter_end_dtd_attlist(resource xmlwriter)","End current DTD AttList - returns FALSE on error"],xmlwriter_end_dtd_element:["bool xmlwriter_end_dtd_element(resource xmlwriter)","End current DTD element - returns FALSE on error"],xmlwriter_end_dtd_entity:["bool xmlwriter_end_dtd_entity(resource xmlwriter)","End current DTD Entity - returns FALSE on error"],xmlwriter_end_element:["bool xmlwriter_end_element(resource xmlwriter)","End current element - returns FALSE on error"],xmlwriter_end_pi:["bool xmlwriter_end_pi(resource xmlwriter)","End current PI - returns FALSE on error"],xmlwriter_flush:["mixed xmlwriter_flush(resource xmlwriter [,bool empty])","Output current buffer"],xmlwriter_full_end_element:["bool xmlwriter_full_end_element(resource xmlwriter)","End current element - returns FALSE on error"],xmlwriter_open_memory:["resource xmlwriter_open_memory()","Create new xmlwriter using memory for string output"],xmlwriter_open_uri:["resource xmlwriter_open_uri(resource xmlwriter, string source)","Create new xmlwriter using source uri for output"],xmlwriter_output_memory:["string xmlwriter_output_memory(resource xmlwriter [,bool flush])","Output current buffer as string"],xmlwriter_set_indent:["bool xmlwriter_set_indent(resource xmlwriter, bool indent)","Toggle indentation on/off - returns FALSE on error"],xmlwriter_set_indent_string:["bool xmlwriter_set_indent_string(resource xmlwriter, string indentString)","Set string used for indenting - returns FALSE on error"],xmlwriter_start_attribute:["bool xmlwriter_start_attribute(resource xmlwriter, string name)","Create start attribute - returns FALSE on error"],xmlwriter_start_attribute_ns:["bool xmlwriter_start_attribute_ns(resource xmlwriter, string prefix, string name, string uri)","Create start namespaced attribute - returns FALSE on error"],xmlwriter_start_cdata:["bool xmlwriter_start_cdata(resource xmlwriter)","Create start CDATA tag - returns FALSE on error"],xmlwriter_start_comment:["bool xmlwriter_start_comment(resource xmlwriter)","Create start comment - returns FALSE on error"],xmlwriter_start_document:["bool xmlwriter_start_document(resource xmlwriter, string version, string encoding, string standalone)","Create document tag - returns FALSE on error"],xmlwriter_start_dtd:["bool xmlwriter_start_dtd(resource xmlwriter, string name, string pubid, string sysid)","Create start DTD tag - returns FALSE on error"],xmlwriter_start_dtd_attlist:["bool xmlwriter_start_dtd_attlist(resource xmlwriter, string name)","Create start DTD AttList - returns FALSE on error"],xmlwriter_start_dtd_element:["bool xmlwriter_start_dtd_element(resource xmlwriter, string name)","Create start DTD element - returns FALSE on error"],xmlwriter_start_dtd_entity:["bool xmlwriter_start_dtd_entity(resource xmlwriter, string name, bool isparam)","Create start DTD Entity - returns FALSE on error"],xmlwriter_start_element:["bool xmlwriter_start_element(resource xmlwriter, string name)","Create start element tag - returns FALSE on error"],xmlwriter_start_element_ns:["bool xmlwriter_start_element_ns(resource xmlwriter, string prefix, string name, string uri)","Create start namespaced element tag - returns FALSE on error"],xmlwriter_start_pi:["bool xmlwriter_start_pi(resource xmlwriter, string target)","Create start PI tag - returns FALSE on error"],xmlwriter_text:["bool xmlwriter_text(resource xmlwriter, string content)","Write text - returns FALSE on error"],xmlwriter_write_attribute:["bool xmlwriter_write_attribute(resource xmlwriter, string name, string content)","Write full attribute - returns FALSE on error"],xmlwriter_write_attribute_ns:["bool xmlwriter_write_attribute_ns(resource xmlwriter, string prefix, string name, string uri, string content)","Write full namespaced attribute - returns FALSE on error"],xmlwriter_write_cdata:["bool xmlwriter_write_cdata(resource xmlwriter, string content)","Write full CDATA tag - returns FALSE on error"],xmlwriter_write_comment:["bool xmlwriter_write_comment(resource xmlwriter, string content)","Write full comment tag - returns FALSE on error"],xmlwriter_write_dtd:["bool xmlwriter_write_dtd(resource xmlwriter, string name, string pubid, string sysid, string subset)","Write full DTD tag - returns FALSE on error"],xmlwriter_write_dtd_attlist:["bool xmlwriter_write_dtd_attlist(resource xmlwriter, string name, string content)","Write full DTD AttList tag - returns FALSE on error"],xmlwriter_write_dtd_element:["bool xmlwriter_write_dtd_element(resource xmlwriter, string name, string content)","Write full DTD element tag - returns FALSE on error"],xmlwriter_write_dtd_entity:["bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content [, int pe [, string pubid [, string sysid [, string ndataid]]]])","Write full DTD Entity tag - returns FALSE on error"],xmlwriter_write_element:["bool xmlwriter_write_element(resource xmlwriter, string name[, string content])","Write full element tag - returns FALSE on error"],xmlwriter_write_element_ns:["bool xmlwriter_write_element_ns(resource xmlwriter, string prefix, string name, string uri[, string content])","Write full namesapced element tag - returns FALSE on error"],xmlwriter_write_pi:["bool xmlwriter_write_pi(resource xmlwriter, string target, string content)","Write full PI tag - returns FALSE on error"],xmlwriter_write_raw:["bool xmlwriter_write_raw(resource xmlwriter, string content)","Write text - returns FALSE on error"],xsl_xsltprocessor_get_parameter:["string xsl_xsltprocessor_get_parameter(string namespace, string name);",""],xsl_xsltprocessor_has_exslt_support:["bool xsl_xsltprocessor_has_exslt_support();",""],xsl_xsltprocessor_import_stylesheet:["void xsl_xsltprocessor_import_stylesheet(domdocument doc);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# Since:"],xsl_xsltprocessor_register_php_functions:["void xsl_xsltprocessor_register_php_functions([mixed $restrict]);",""],xsl_xsltprocessor_remove_parameter:["bool xsl_xsltprocessor_remove_parameter(string namespace, string name);",""],xsl_xsltprocessor_set_parameter:["bool xsl_xsltprocessor_set_parameter(string namespace, mixed name [, string value]);",""],xsl_xsltprocessor_set_profiling:["bool xsl_xsltprocessor_set_profiling(string filename) */",'PHP_FUNCTION(xsl_xsltprocessor_set_profiling) { zval *id; xsl_object *intern; char *filename = NULL; int filename_len; DOM_GET_THIS(id); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s!", &filename, &filename_len) == SUCCESS) { intern = (xsl_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern->profiling) { efree(intern->profiling); } if (filename != NULL) { intern->profiling = estrndup(filename,filename_len); } else { intern->profiling = NULL; } RETURN_TRUE; } else { WRONG_PARAM_COUNT; } } /* }}} end xsl_xsltprocessor_set_profiling'],xsl_xsltprocessor_transform_to_doc:["domdocument xsl_xsltprocessor_transform_to_doc(domnode doc);","URL: http://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html# Since:"],xsl_xsltprocessor_transform_to_uri:["int xsl_xsltprocessor_transform_to_uri(domdocument doc, string uri);",""],xsl_xsltprocessor_transform_to_xml:["string xsl_xsltprocessor_transform_to_xml(domdocument doc);",""],zend_logo_guid:["string zend_logo_guid(void)","Return the special ID used to request the Zend logo in phpinfo screens"],zend_version:["string zend_version(void)","Get the version of the Zend Engine"],zip_close:["void zip_close(resource zip)","Close a Zip archive"],zip_entry_close:["void zip_entry_close(resource zip_ent)","Close a zip entry"],zip_entry_compressedsize:["int zip_entry_compressedsize(resource zip_entry)","Return the compressed size of a ZZip entry"],zip_entry_compressionmethod:["string zip_entry_compressionmethod(resource zip_entry)","Return a string containing the compression method used on a particular entry"],zip_entry_filesize:["int zip_entry_filesize(resource zip_entry)","Return the actual filesize of a ZZip entry"],zip_entry_name:["string zip_entry_name(resource zip_entry)","Return the name given a ZZip entry"],zip_entry_open:["bool zip_entry_open(resource zip_dp, resource zip_entry [, string mode])","Open a Zip File, pointed by the resource entry"],zip_entry_read:["mixed zip_entry_read(resource zip_entry [, int len])","Read from an open directory entry"],zip_open:["resource zip_open(string filename)","Create new zip using source uri for output"],zip_read:["resource zip_read(resource zip)","Returns the next file in the archive"],zlib_get_coding_type:["string zlib_get_coding_type(void)","Returns the coding type used for output compression"]},n={$_COOKIE:{type:"array"},$_ENV:{type:"array"},$_FILES:{type:"array"},$_GET:{type:"array"},$_POST:{type:"array"},$_REQUEST:{type:"array"},$_SERVER:{type:"array",value:{DOCUMENT_ROOT:1,GATEWAY_INTERFACE:1,HTTP_ACCEPT:1,HTTP_ACCEPT_CHARSET:1,HTTP_ACCEPT_ENCODING:1,HTTP_ACCEPT_LANGUAGE:1,HTTP_CONNECTION:1,HTTP_HOST:1,HTTP_REFERER:1,HTTP_USER_AGENT:1,PATH_TRANSLATED:1,PHP_SELF:1,QUERY_STRING:1,REMOTE_ADDR:1,REMOTE_PORT:1,REQUEST_METHOD:1,REQUEST_URI:1,SCRIPT_FILENAME:1,SCRIPT_NAME:1,SERVER_ADMIN:1,SERVER_NAME:1,SERVER_PORT:1,SERVER_PROTOCOL:1,SERVER_SIGNATURE:1,SERVER_SOFTWARE:1}},$_SESSION:{type:"array"},$GLOBALS:{type:"array"}},o=function(){};(function(){this.getCompletions=function(e,t,r,s){var n=t.getTokenAt(r.row,r.column);if(!n)return[];if("identifier"===n.type)return this.getFunctionCompletions(e,t,r,s);if(i(n,"variable"))return this.getVariableCompletions(e,t,r,s);var o=t.getLine(r.row).substr(0,r.column);return"string"===n.type&&/(\$[\w]*)\[["']([^'"]*)$/i.test(o)?this.getArrayKeyCompletions(e,t,r,s):[]},this.getFunctionCompletions=function(e,t,r,i){return Object.keys(s).map(function(e){return{caption:e,snippet:e+"($0)",meta:"php function",score:Number.MAX_VALUE,docHTML:s[e][1]}})},this.getVariableCompletions=function(e,t,r,i){return Object.keys(n).map(function(e){return{caption:e,value:e,meta:"php variable",score:Number.MAX_VALUE}})},this.getArrayKeyCompletions=function(e,t,r,i){var s=t.getLine(r.row).substr(0,r.column),o=s.match(/(\$[\w]*)\[["']([^'"]*)$/i)[1];if(!n[o])return[];var a=[];return"array"===n[o].type&&n[o].value&&(a=Object.keys(n[o].value)),a.map(function(e){return{caption:e,value:e,meta:"php array key",score:Number.MAX_VALUE}})}}).call(o.prototype),t.PhpCompletions=o}),define("ace/mode/folding/cstyle",["require","exports","module","../../lib/oop","../../range","./fold_mode"],function(e,t,r){"use strict";var i=e("../../lib/oop"),s=e("../../range").Range,n=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};i.inherits(o,n),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,r){var i=e.getLine(r);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return"";var s=this._getFoldWidgetBase(e,t,r);return!s&&this.startRegionRe.test(i)?"start":s},this.getFoldWidgetRange=function(e,t,r,i){var s=e.getLine(r);if(this.startRegionRe.test(s))return this.getCommentRegionBlock(e,s,r);var n=s.match(this.foldingStartMarker);if(n){var o=n.index;if(n[1])return this.openingBracketBlock(e,n[1],r,o);var a=e.getCommentFoldRange(r,o+n[0].length,1);return a&&!a.isMultiLine()&&(i?a=this.getSectionRange(e,r):"all"!=t&&(a=null)),a}if("markbegin"!==t){var n=s.match(this.foldingStopMarker);if(n){var o=n.index+n[0].length;return n[1]?this.closingBracketBlock(e,n[1],r,o):e.getCommentFoldRange(r,o,-1)}}},this.getSectionRange=function(e,t){var r=e.getLine(t),i=r.search(/\S/),n=t,o=r.length;t+=1;for(var a=t,l=e.getLength();++tc)break;var _=this.getFoldWidgetRange(e,"all",t);if(_){if(_.start.row<=n)break;if(_.isMultiLine())t=_.end.row;else if(i==c)break}a=t}}return new s(n,o,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,r){for(var i=t.search(/\s*$/),n=e.getLength(),o=r,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++ro)return new s(o,i,_,t.length)}}.call(o.prototype)}),define("ace/mode/javascript",["require","exports","module","../lib/oop","./text","./javascript_highlight_rules","./matching_brace_outdent","../worker/worker_client","./behaviour/cstyle","./folding/cstyle"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text").Mode,n=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,_=function(){this.HighlightRules=n,this.$outdent=new o,this.$behaviour=new l,this.foldingRules=new c};i.inherits(_,s),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.$quotes={'"':'"',"'":"'","`":"`"},this.getNextLineIndent=function(e,t,r){var i=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,e),n=s.tokens,o=s.state;if(n.length&&"comment"==n[n.length-1].type)return i;if("start"==e||"no_regex"==e){var a=t.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);a&&(i+=r)}else if("doc-start"==e){if("start"==o||"no_regex"==o)return"";var a=t.match(/^\s*(\/?)\*/);a&&(a[1]&&(i+=" "),i+="* ")}return i},this.checkOutdent=function(e,t,r){return this.$outdent.checkOutdent(t,r)},this.autoOutdent=function(e,t,r){this.$outdent.autoOutdent(t,r)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/javascript"}.call(_.prototype),t.Mode=_}),define("ace/mode/css_completions",["require","exports","module"],function(e,t,r){"use strict";var i={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,double:2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{default:1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},float:{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{ normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,static:1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},s=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e)if("string"==typeof e[t]){var r=t.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()});i.hasOwnProperty(r)||(i[r]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,r,i){if(this.completionsDefined||this.defineCompletions(),!t.getTokenAt(r.row,r.column))return[];if("ruleset"===e){var s=t.getLine(r.row).substr(0,r.column);return/:[^;]+$/.test(s)?(/([\w\-]+):[^:]*$/.test(s),this.getPropertyValueCompletions(e,t,r,i)):this.getPropertyCompletions(e,t,r,i)}return[]},this.getPropertyCompletions=function(e,t,r,s){return Object.keys(i).map(function(e){return{caption:e,snippet:e+": $0",meta:"property",score:Number.MAX_VALUE}})},this.getPropertyValueCompletions=function(e,t,r,s){var n=t.getLine(r.row).substr(0,r.column),o=(/([\w\-]+):[^:]*$/.exec(n)||{})[1];if(!o)return[];var a=[];return o in i&&"object"==typeof i[o]&&(a=Object.keys(i[o])),a.map(function(e){return{caption:e,snippet:e,meta:"property value",score:Number.MAX_VALUE}})}}).call(s.prototype),t.CssCompletions=s}),define("ace/mode/behaviour/css",["require","exports","module","../../lib/oop","../behaviour","./cstyle","../../token_iterator"],function(e,t,r){"use strict";var i=e("../../lib/oop"),s=(e("../behaviour").Behaviour,e("./cstyle").CstyleBehaviour),n=e("../../token_iterator").TokenIterator,o=function(){this.inherit(s),this.add("colon","insertion",function(e,t,r,i,s){if(":"===s){var o=r.getCursorPosition(),a=new n(i,o.row,o.column),l=a.getCurrentToken();if(l&&l.value.match(/\s+/)&&(l=a.stepBackward()),l&&"support.type"===l.type){var c=i.doc.getLine(o.row);if(":"===c.substring(o.column,o.column+1))return{text:"",selection:[1,1]};if(!c.substring(o.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,r,i,s){var o=i.doc.getTextRange(s);if(!s.isMultiLine()&&":"===o){var a=r.getCursorPosition(),l=new n(i,a.row,a.column),c=l.getCurrentToken();if(c&&c.value.match(/\s+/)&&(c=l.stepBackward()),c&&"support.type"===c.type){if(";"===i.doc.getLine(s.start.row).substring(s.end.column,s.end.column+1))return s.end.column++,s}}}),this.add("semicolon","insertion",function(e,t,r,i,s){if(";"===s){var n=r.getCursorPosition();if(";"===i.doc.getLine(n.row).substring(n.column,n.column+1))return{text:"",selection:[1,1]}}})};i.inherits(o,s),t.CssBehaviour=o}),define("ace/mode/css",["require","exports","module","../lib/oop","./text","./css_highlight_rules","./matching_brace_outdent","../worker/worker_client","./css_completions","./behaviour/css","./folding/cstyle"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text").Mode,n=e("./css_highlight_rules").CssHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,l=e("./css_completions").CssCompletions,c=e("./behaviour/css").CssBehaviour,_=e("./folding/cstyle").FoldMode,d=function(){this.HighlightRules=n,this.$outdent=new o,this.$behaviour=new c,this.$completer=new l,this.foldingRules=new _};i.inherits(d,s),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,r){var i=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,e).tokens;return s.length&&"comment"==s[s.length-1].type?i:(t.match(/^.*\{\s*$/)&&(i+=r),i)},this.checkOutdent=function(e,t,r){return this.$outdent.checkOutdent(t,r)},this.autoOutdent=function(e,t,r){this.$outdent.autoOutdent(t,r)},this.getCompletions=function(e,t,r,i){return this.$completer.getCompletions(e,t,r,i)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/css"}.call(d.prototype),t.Mode=d}),define("ace/mode/behaviour/xml",["require","exports","module","../../lib/oop","../behaviour","../../token_iterator","../../lib/lang"],function(e,t,r){"use strict";function i(e,t){return e.type.lastIndexOf(t+".xml")>-1}var s=e("../../lib/oop"),n=e("../behaviour").Behaviour,o=e("../../token_iterator").TokenIterator,a=(e("../../lib/lang"),function(){this.add("string_dquotes","insertion",function(e,t,r,s,n){if('"'==n||"'"==n){var a=n,l=s.doc.getTextRange(r.getSelectionRange());if(""!==l&&"'"!==l&&'"'!=l&&r.getWrapBehavioursEnabled())return{text:a+l+a,selection:!1};var c=r.getCursorPosition(),_=s.doc.getLine(c.row),d=_.substring(c.column,c.column+1),u=new o(s,c.row,c.column),m=u.getCurrentToken();if(d==a&&(i(m,"attribute-value")||i(m,"string")))return{text:"",selection:[1,1]};if(m||(m=u.stepBackward()),!m)return;for(;i(m,"tag-whitespace")||i(m,"whitespace");)m=u.stepBackward();var g=!d||d.match(/\s/);if(i(m,"attribute-equals")&&(g||">"==d)||i(m,"decl-attribute-equals")&&(g||"?"==d))return{text:a+a,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,r,i,s){var n=i.doc.getTextRange(s);if(!s.isMultiLine()&&('"'==n||"'"==n)){if(i.doc.getLine(s.start.row).substring(s.start.column+1,s.start.column+2)==n)return s.end.column++,s}}),this.add("autoclosing","insertion",function(e,t,r,s,n){if(">"==n){var a=r.getSelectionRange().start,l=new o(s,a.row,a.column),c=l.getCurrentToken()||l.stepBackward();if(!c||!(i(c,"tag-name")||i(c,"tag-whitespace")||i(c,"attribute-name")||i(c,"attribute-equals")||i(c,"attribute-value")))return;if(i(c,"reference.attribute-value"))return;if(i(c,"attribute-value")){var _=c.value.charAt(0);if('"'==_||"'"==_){var d=c.value.charAt(c.value.length-1),u=l.getCurrentTokenColumn()+c.value.length;if(u>a.column||u==a.column&&_!=d)return}}for(;!i(c,"tag-name");)if(c=l.stepBackward(),"<"==c.value){c=l.stepForward();break}var m=l.getCurrentTokenRow(),g=l.getCurrentTokenColumn();if(i(l.stepBackward(),"end-tag-open"))return;var h=c.value;if(m==a.row&&(h=h.substring(0,a.column-g)),this.voidElements.hasOwnProperty(h.toLowerCase()))return;return{text:">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,r,i,s){if("\n"==s){var n=r.getCursorPosition(),a=i.getLine(n.row),l=new o(i,n.row,n.column),c=l.getCurrentToken();if(c&&-1!==c.type.indexOf("tag-close")){if("/>"==c.value)return;for(;c&&-1===c.type.indexOf("tag-name");)c=l.stepBackward();if(!c)return;var _=c.value,d=l.getCurrentTokenRow();if(!(c=l.stepBackward())||-1!==c.type.indexOf("end-tag"))return;if(this.voidElements&&!this.voidElements[_]){var u=i.getTokenAt(n.row,n.column+1),a=i.getLine(d),m=this.$getIndent(a),g=m+i.getTabString();return u&&"-1}var s=e("../../lib/oop"),n=(e("../../lib/lang"),e("../../range").Range),o=e("./fold_mode").FoldMode,a=e("../../token_iterator").TokenIterator,l=t.FoldMode=function(e,t){o.call(this),this.voidElements=e||{},this.optionalEndTags=s.mixin({},this.voidElements),t&&s.mixin(this.optionalEndTags,t)};s.inherits(l,o);var c=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,r){var i=this._getFirstTagInLine(e,r);return i?i.closing||!i.tagName&&i.selfClosing?"markbeginend"==t?"end":"":!i.tagName||i.selfClosing||this.voidElements.hasOwnProperty(i.tagName.toLowerCase())?"":this._findEndTagInLine(e,r,i.tagName,i.end.column)?"":"start":this.getCommentFoldWidget(e,r)},this.getCommentFoldWidget=function(e,t){return/comment/.test(e.getState(t))&&/"==o.value;break}return s}if(i(o,"tag-close"))return s.selfClosing="/>"==o.value,s;s.start.column+=o.value.length}return null},this._findEndTagInLine=function(e,t,r,s){for(var n=e.getTokens(t),o=0,a=0;a"==t.value,r.end.row=e.getCurrentTokenRow(),r.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){for(;e.length;){var r=e[e.length-1];if(t&&r.tagName!=t.tagName){if(this.optionalEndTags.hasOwnProperty(r.tagName)){e.pop();continue}return null}return e.pop()}},this.getFoldWidgetRange=function(e,t,r){var i=this._getFirstTagInLine(e,r);if(!i)return this.getCommentFoldWidget(e,r)&&e.getCommentFoldRange(r,e.getLine(r).length);var s,o=i.closing||i.selfClosing,l=[];if(o)for(var c=new a(e,r,i.end.column),_={row:r,column:i.start.column};s=this._readTagBackward(c);){if(s.selfClosing){if(l.length)continue;return s.start.column+=s.tagName.length+2,s.end.column-=2,n.fromPoints(s.start,s.end)}if(s.closing)l.push(s);else if(this._pop(l,s),0==l.length)return s.start.column+=s.tagName.length+2,s.start.row==s.end.row&&s.start.column-1}function s(e,t){for(var r=new o(e,t.row,t.column),s=r.getCurrentToken();s&&!i(s,"tag-name");)s=r.stepBackward();if(s)return s.value}function n(e,t){for(var r=new o(e,t.row,t.column),s=r.getCurrentToken();s&&!i(s,"attribute-name");)s=r.stepBackward();if(s)return s.value}var o=e("../token_iterator").TokenIterator,a=["accesskey","class","contenteditable","contextmenu","dir","draggable","dropzone","hidden","id","inert","itemid","itemprop","itemref","itemscope","itemtype","lang","spellcheck","style","tabindex","title","translate"],l=["onabort","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncuechange","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onpause","onplay","onplaying","onprogress","onratechange","onreset","onscroll","onseeked","onseeking","onselect","onshow","onstalled","onsubmit","onsuspend","ontimeupdate","onvolumechange","onwaiting"],c=a.concat(l),_={html:{manifest:1},head:{},title:{},base:{href:1,target:1},link:{href:1,hreflang:1,rel:{stylesheet:1,icon:1},media:{all:1,screen:1,print:1},type:{"text/css":1,"image/png":1,"image/jpeg":1,"image/gif":1},sizes:1},meta:{"http-equiv":{"content-type":1},name:{description:1,keywords:1},content:{"text/html; charset=UTF-8":1},charset:1},style:{type:1,media:{all:1,screen:1,print:1},scoped:1},script:{charset:1,type:{"text/javascript":1},src:1,defer:1,async:1},noscript:{href:1},body:{onafterprint:1,onbeforeprint:1,onbeforeunload:1,onhashchange:1,onmessage:1,onoffline:1,onpopstate:1,onredo:1,onresize:1,onstorage:1,onundo:1,onunload:1},section:{},nav:{},article:{pubdate:1},aside:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},header:{},footer:{},address:{},main:{},p:{},hr:{},pre:{},blockquote:{cite:1},ol:{start:1,reversed:1},ul:{},li:{value:1},dl:{},dt:{},dd:{},figure:{},figcaption:{},div:{},a:{href:1,target:{_blank:1,top:1},ping:1,rel:{nofollow:1,alternate:1,author:1,bookmark:1,help:1,license:1,next:1,noreferrer:1,prefetch:1,prev:1,search:1,tag:1},media:1,hreflang:1,type:1},em:{},strong:{},small:{},s:{},cite:{},q:{cite:1},dfn:{},abbr:{},data:{},time:{datetime:1},code:{},var:{},samp:{},kbd:{},sub:{},sup:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{},bdo:{},span:{},br:{},wbr:{},ins:{cite:1,datetime:1},del:{cite:1,datetime:1},img:{alt:1,src:1,height:1,width:1,usemap:1,ismap:1},iframe:{name:1,src:1,height:1,width:1,sandbox:{"allow-same-origin":1,"allow-top-navigation":1,"allow-forms":1,"allow-scripts":1},seamless:{seamless:1}},embed:{src:1,height:1,width:1,type:1},object:{param:1,data:1,type:1,height:1,width:1,usemap:1,name:1,form:1,classid:1},param:{name:1,value:1},video:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},width:1,height:1,poster:1,muted:{muted:1},preload:{auto:1,metadata:1,none:1}},audio:{src:1,autobuffer:1,autoplay:{autoplay:1},loop:{loop:1},controls:{controls:1},muted:{muted:1},preload:{auto:1,metadata:1,none:1}},source:{src:1,type:1,media:1},track:{kind:1,src:1,srclang:1,label:1,default:1},canvas:{width:1,height:1},map:{name:1},area:{shape:1,coords:1,href:1,hreflang:1,alt:1,target:1,media:1,rel:1,ping:1,type:1},svg:{},math:{},table:{summary:1},caption:{},colgroup:{span:1},col:{span:1},tbody:{},thead:{},tfoot:{},tr:{},td:{headers:1,rowspan:1,colspan:1},th:{headers:1,rowspan:1,colspan:1,scope:1},form:{"accept-charset":1,action:1,autocomplete:1,enctype:{"multipart/form-data":1,"application/x-www-form-urlencoded":1},method:{get:1,post:1},name:1,novalidate:1,target:{_blank:1,top:1}},fieldset:{disabled:1,form:1,name:1},legend:{},label:{form:1,for:1},input:{type:{text:1,password:1,hidden:1,checkbox:1,submit:1,radio:1,file:1,button:1,reset:1,image:31,color:1,date:1,datetime:1,"datetime-local":1,email:1,month:1,number:1,range:1,search:1,tel:1,time:1,url:1,week:1},accept:1,alt:1,autocomplete:{on:1,off:1},autofocus:{autofocus:1},checked:{checked:1},disabled:{disabled:1},form:1,formaction:1,formenctype:{"application/x-www-form-urlencoded":1,"multipart/form-data":1,"text/plain":1},formmethod:{get:1,post:1},formnovalidate:{formnovalidate:1},formtarget:{_blank:1,_self:1,_parent:1,_top:1},height:1,list:1,max:1,maxlength:1,min:1,multiple:{multiple:1},name:1,pattern:1,placeholder:1,readonly:{readonly:1},required:{required:1},size:1,src:1,step:1,width:1,files:1,value:1},button:{autofocus:1,disabled:{disabled:1},form:1,formaction:1,formenctype:1,formmethod:1,formnovalidate:1,formtarget:1,name:1,value:1,type:{button:1,submit:1}},select:{autofocus:1,disabled:1,form:1,multiple:{multiple:1},name:1,size:1,readonly:{readonly:1}},datalist:{},optgroup:{disabled:1,label:1},option:{disabled:1,selected:1,label:1,value:1},textarea:{autofocus:{autofocus:1},disabled:{disabled:1},form:1,maxlength:1,name:1,placeholder:1,readonly:{readonly:1},required:{required:1},rows:1,cols:1,wrap:{on:1,off:1,hard:1,soft:1}},keygen:{autofocus:1,challenge:{challenge:1},disabled:{disabled:1},form:1,keytype:{rsa:1,dsa:1,ec:1},name:1},output:{for:1,form:1,name:1},progress:{value:1,max:1},meter:{value:1,min:1,max:1,low:1,high:1,optimum:1},details:{open:1},summary:{},command:{type:1,label:1,icon:1,disabled:1,checked:1,radiogroup:1,command:1},menu:{type:1,label:1},dialog:{open:1}},d=Object.keys(_),u=function(){};(function(){this.getCompletions=function(e,t,r,s){var n=t.getTokenAt(r.row,r.column);return n?i(n,"tag-name")||i(n,"tag-open")||i(n,"end-tag-open")?this.getTagCompletions(e,t,r,s):i(n,"tag-whitespace")||i(n,"attribute-name")?this.getAttributeCompletions(e,t,r,s):i(n,"attribute-value")?this.getAttributeValueCompletions(e,t,r,s):/&[a-z]*$/i.test(t.getLine(r.row).substr(0,r.column))?this.getHTMLEntityCompletions(e,t,r,s):[]:[]},this.getTagCompletions=function(e,t,r,i){return d.map(function(e){return{value:e,meta:"tag",score:Number.MAX_VALUE}})},this.getAttributeCompletions=function(e,t,r,i){var n=s(t,r);if(!n)return[];var o=c;return n in _&&(o=o.concat(Object.keys(_[n]))),o.map(function(e){return{caption:e,snippet:e+'="$0"',meta:"attribute",score:Number.MAX_VALUE}})},this.getAttributeValueCompletions=function(e,t,r,i){var o=s(t,r),a=n(t,r);if(!o)return[];var l=[];return o in _&&a in _[o]&&"object"==typeof _[o][a]&&(l=Object.keys(_[o][a])),l.map(function(e){return{caption:e,snippet:e,meta:"attribute value",score:Number.MAX_VALUE}})},this.getHTMLEntityCompletions=function(e,t,r,i){return["Aacute;","aacute;","Acirc;","acirc;","acute;","AElig;","aelig;","Agrave;","agrave;","alefsym;","Alpha;","alpha;","amp;","and;","ang;","Aring;","aring;","asymp;","Atilde;","atilde;","Auml;","auml;","bdquo;","Beta;","beta;","brvbar;","bull;","cap;","Ccedil;","ccedil;","cedil;","cent;","Chi;","chi;","circ;","clubs;","cong;","copy;","crarr;","cup;","curren;","Dagger;","dagger;","dArr;","darr;","deg;","Delta;","delta;","diams;","divide;","Eacute;","eacute;","Ecirc;","ecirc;","Egrave;","egrave;","empty;","emsp;","ensp;","Epsilon;","epsilon;","equiv;","Eta;","eta;","ETH;","eth;","Euml;","euml;","euro;","exist;","fnof;","forall;","frac12;","frac14;","frac34;","frasl;","Gamma;","gamma;","ge;","gt;","hArr;","harr;","hearts;","hellip;","Iacute;","iacute;","Icirc;","icirc;","iexcl;","Igrave;","igrave;","image;","infin;","int;","Iota;","iota;","iquest;","isin;","Iuml;","iuml;","Kappa;","kappa;","Lambda;","lambda;","lang;","laquo;","lArr;","larr;","lceil;","ldquo;","le;","lfloor;","lowast;","loz;","lrm;","lsaquo;","lsquo;","lt;","macr;","mdash;","micro;","middot;","minus;","Mu;","mu;","nabla;","nbsp;","ndash;","ne;","ni;","not;","notin;","nsub;","Ntilde;","ntilde;","Nu;","nu;","Oacute;","oacute;","Ocirc;","ocirc;","OElig;","oelig;","Ograve;","ograve;","oline;","Omega;","omega;","Omicron;","omicron;","oplus;","or;","ordf;","ordm;","Oslash;","oslash;","Otilde;","otilde;","otimes;","Ouml;","ouml;","para;","part;","permil;","perp;","Phi;","phi;","Pi;","pi;","piv;","plusmn;","pound;","Prime;","prime;","prod;","prop;","Psi;","psi;","quot;","radic;","rang;","raquo;","rArr;","rarr;","rceil;","rdquo;","real;","reg;","rfloor;","Rho;","rho;","rlm;","rsaquo;","rsquo;","sbquo;","Scaron;","scaron;","sdot;","sect;","shy;","Sigma;","sigma;","sigmaf;","sim;","spades;","sub;","sube;","sum;","sup;","sup1;","sup2;","sup3;","supe;","szlig;","Tau;","tau;","there4;","Theta;","theta;","thetasym;","thinsp;","THORN;","thorn;","tilde;","times;","trade;","Uacute;","uacute;","uArr;","uarr;","Ucirc;","ucirc;","Ugrave;","ugrave;","uml;","upsih;","Upsilon;","upsilon;","Uuml;","uuml;","weierp;","Xi;","xi;","Yacute;","yacute;","yen;","Yuml;","yuml;","Zeta;","zeta;","zwj;","zwnj;"].map(function(e){return{caption:e,snippet:e,meta:"html entity",score:Number.MAX_VALUE}})}}).call(u.prototype),t.HtmlCompletions=u}),define("ace/mode/html",["require","exports","module","../lib/oop","../lib/lang","./text","./javascript","./css","./html_highlight_rules","./behaviour/xml","./folding/html","./html_completions","../worker/worker_client"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("../lib/lang"),n=e("./text").Mode,o=e("./javascript").Mode,a=e("./css").Mode,l=e("./html_highlight_rules").HtmlHighlightRules,c=e("./behaviour/xml").XmlBehaviour,_=e("./folding/html").FoldMode,d=e("./html_completions").HtmlCompletions,u=e("../worker/worker_client").WorkerClient,m=["area","base","br","col","embed","hr","img","input","keygen","link","meta","menuitem","param","source","track","wbr"],g=["li","dt","dd","p","rt","rp","optgroup","option","colgroup","td","th"],h=function(e){this.fragmentContext=e&&e.fragmentContext,this.HighlightRules=l,this.$behaviour=new c,this.$completer=new d,this.createModeDelegates({"js-":o,"css-":a}),this.foldingRules=new _(this.voidElements,s.arrayToMap(g))};i.inherits(h,n),function(){this.blockComment={start:"\x3c!--",end:"--\x3e"},this.voidElements=s.arrayToMap(m),this.getNextLineIndent=function(e,t,r){return this.$getIndent(t)},this.checkOutdent=function(e,t,r){return!1},this.getCompletions=function(e,t,r,i){return this.$completer.getCompletions(e,t,r,i)},this.createWorker=function(e){if(this.constructor==h){var t=new u(["ace"],"ace/mode/html_worker","Worker");return t.attachToDocument(e.getDocument()),this.fragmentContext&&t.call("setOptions",[{context:this.fragmentContext}]),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}},this.$id="ace/mode/html"}.call(h.prototype),t.Mode=h}),define("ace/mode/php",["require","exports","module","../lib/oop","./text","./php_highlight_rules","./php_highlight_rules","./matching_brace_outdent","../range","../worker/worker_client","./php_completions","./behaviour/cstyle","./folding/cstyle","../unicode","./html","./javascript","./css"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text").Mode,n=e("./php_highlight_rules").PhpHighlightRules,o=e("./php_highlight_rules").PhpLangHighlightRules,a=e("./matching_brace_outdent").MatchingBraceOutdent,l=(e("../range").Range,e("../worker/worker_client").WorkerClient),c=e("./php_completions").PhpCompletions,_=e("./behaviour/cstyle").CstyleBehaviour,d=e("./folding/cstyle").FoldMode,u=e("../unicode"),m=e("./html").Mode,g=e("./javascript").Mode,h=e("./css").Mode,p=function(e){this.HighlightRules=o,this.$outdent=new a,this.$behaviour=new _,this.$completer=new c,this.foldingRules=new d};i.inherits(p,s),function(){this.tokenRe=new RegExp("^["+u.packages.L+u.packages.Mn+u.packages.Mc+u.packages.Nd+u.packages.Pc+"_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+u.packages.L+u.packages.Mn+u.packages.Mc+u.packages.Nd+u.packages.Pc+"_]|\\s])+","g"),this.lineCommentStart=["//","#"],this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,r){var i=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,e),n=s.tokens,o=s.state;if(n.length&&"comment"==n[n.length-1].type)return i;if("start"==e){var a=t.match(/^.*[\{\(\[:]\s*$/);a&&(i+=r)}else if("doc-start"==e){if("doc-start"!=o)return"";var a=t.match(/^\s*(\/?)\*/);a&&(a[1]&&(i+=" "),i+="* ")}return i},this.checkOutdent=function(e,t,r){return this.$outdent.checkOutdent(t,r)},this.autoOutdent=function(e,t,r){this.$outdent.autoOutdent(t,r)},this.getCompletions=function(e,t,r,i){return this.$completer.getCompletions(e,t,r,i)},this.$id="ace/mode/php-inline"}.call(p.prototype);var f=function(e){if(e&&e.inline){var t=new p;return t.createWorker=this.createWorker,t.inlinePhp=!0,t}m.call(this),this.HighlightRules=n,this.createModeDelegates({"js-":g,"css-":h,"php-":p}),this.foldingRules.subModes["php-"]=new d};i.inherits(f,m),function(){this.createWorker=function(e){var t=new l(["ace"],"ace/mode/php_worker","PhpWorker");return t.attachToDocument(e.getDocument()),this.inlinePhp&&t.call("setOptions",[{inline:!0}]),t.on("annotate",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/php"}.call(f.prototype),t.Mode=f}),define("ace/mode/sql_highlight_rules",["require","exports","module","../lib/oop","./text_highlight_rules"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text_highlight_rules").TextHighlightRules,n=function(){var e=this.createKeywordMapper({"support.function":"avg|count|first|last|max|min|sum|ucase|lcase|mid|len|round|rank|now|format|coalesce|ifnull|isnull|nvl",keyword:"select|insert|update|delete|from|where|and|or|group|by|order|limit|offset|having|as|case|when|else|end|type|left|right|join|on|outer|desc|asc|union|create|table|primary|key|if|foreign|not|references|default|null|inner|cross|natural|database|drop|grant","constant.language":"true|false","storage.type":"int|numeric|decimal|date|varchar|char|bigint|float|double|bit|binary|text|set|timestamp|money|real|number|integer"},"identifier",!0);this.$rules={start:[{token:"comment",regex:"--.*$"},{token:"comment",start:"/\\*",end:"\\*/"},{token:"string",regex:'".*?"'},{token:"string",regex:"'.*?'"},{token:"string",regex:"`.*?`"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|="},{token:"paren.lparen",regex:"[\\(]"},{token:"paren.rparen",regex:"[\\)]"},{token:"text",regex:"\\s+"}]},this.normalizeRules()};i.inherits(n,s),t.SqlHighlightRules=n}),define("ace/mode/sql",["require","exports","module","../lib/oop","./text","./sql_highlight_rules"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text").Mode,n=e("./sql_highlight_rules").SqlHighlightRules,o=function(){this.HighlightRules=n,this.$behaviour=this.$defaultBehaviour};i.inherits(o,s),function(){this.lineCommentStart="--",this.$id="ace/mode/sql"}.call(o.prototype),t.Mode=o}),define("ace/mode/xml",["require","exports","module","../lib/oop","../lib/lang","./text","./xml_highlight_rules","./behaviour/xml","./folding/xml","../worker/worker_client"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("../lib/lang"),n=e("./text").Mode,o=e("./xml_highlight_rules").XmlHighlightRules,a=e("./behaviour/xml").XmlBehaviour,l=e("./folding/xml").FoldMode,c=e("../worker/worker_client").WorkerClient,_=function(){this.HighlightRules=o,this.$behaviour=new a,this.foldingRules=new l};i.inherits(_,n),function(){this.voidElements=s.arrayToMap([]),this.blockComment={start:"\x3c!--",end:"--\x3e"},this.createWorker=function(e){var t=new c(["ace"],"ace/mode/xml_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("error",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/xml"}.call(_.prototype),t.Mode=_}),define("ace/mode/json_highlight_rules",["require","exports","module","../lib/oop","./text_highlight_rules"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text_highlight_rules").TextHighlightRules,n=function(){this.$rules={start:[{token:"variable",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)'},{token:"string",regex:'"',next:"string"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:"text",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:"comment",regex:"\\/\\/.*$"},{token:"comment.start",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"}],string:[{token:"constant.language.escape",regex:/\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/},{token:"string",regex:'"|$',next:"start"},{defaultToken:"string"}],comment:[{token:"comment.end",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}]}};i.inherits(n,s),t.JsonHighlightRules=n}),define("ace/mode/json",["require","exports","module","../lib/oop","./text","./json_highlight_rules","./matching_brace_outdent","./behaviour/cstyle","./folding/cstyle","../worker/worker_client"],function(e,t,r){"use strict";var i=e("../lib/oop"),s=e("./text").Mode,n=e("./json_highlight_rules").JsonHighlightRules,o=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("./behaviour/cstyle").CstyleBehaviour,l=e("./folding/cstyle").FoldMode,c=e("../worker/worker_client").WorkerClient,_=function(){this.HighlightRules=n,this.$outdent=new o,this.$behaviour=new a,this.foldingRules=new l};i.inherits(_,s),function(){this.getNextLineIndent=function(e,t,r){var i=this.$getIndent(t);if("start"==e){t.match(/^.*[\{\(\[]\s*$/)&&(i+=r)}return i},this.checkOutdent=function(e,t,r){return this.$outdent.checkOutdent(t,r)},this.autoOutdent=function(e,t,r){this.$outdent.autoOutdent(t,r)},this.createWorker=function(e){var t=new c(["ace"],"ace/mode/json_worker","JsonWorker");return t.attachToDocument(e.getDocument()),t.on("annotate",function(t){ -e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(_.prototype),t.Mode=_}),define("ace/mode/markdown_highlight_rules",["require","exports","module","../lib/oop","../lib/lang","./text_highlight_rules","./javascript_highlight_rules","./xml_highlight_rules","./html_highlight_rules","./css_highlight_rules"],function(e,t,r){"use strict";function i(e,t){return{token:"support.function",regex:"^\\s*```"+e+"\\s*$",push:t+"start"}}var s=e("../lib/oop"),n=e("../lib/lang"),o=e("./text_highlight_rules").TextHighlightRules,a=e("./javascript_highlight_rules").JavaScriptHighlightRules,l=e("./xml_highlight_rules").XmlHighlightRules,c=e("./html_highlight_rules").HtmlHighlightRules,_=e("./css_highlight_rules").CssHighlightRules,d=function(e){return"(?:[^"+n.escapeRegExp(e)+"\\\\]|\\\\.)*"},u=function(){c.call(this),this.$rules.start.unshift({token:"empty_line",regex:"^$",next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+e.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},i("(?:javascript|js)","jscode-"),i("xml","xmlcode-"),i("html","htmlcode-"),i("css","csscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+d("]")+")(\\]\\s*\\[)("+d("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+d("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+d('"')+'"\\s*)?(\\))'},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{defaultToken:"support.function"}]}),this.embedRules(a,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(c,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(_,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};s.inherits(u,o),t.MarkdownHighlightRules=u}),define("ace/mode/folding/markdown",["require","exports","module","../../lib/oop","./fold_mode","../../range"],function(e,t,r){"use strict";var i=e("../../lib/oop"),s=e("./fold_mode").FoldMode,n=e("../../range").Range,o=t.FoldMode=function(){};i.inherits(o,s),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,r){var i=e.getLine(r);return this.foldingStartMarker.test(i)?"`"==i[0]&&"start"==e.bgTokenizer.getState(r)?"end":"start":""},this.getFoldWidgetRange=function(e,t,r){function i(t){return(d=e.getTokens(t)[0])&&0===d.type.lastIndexOf(u,0)}function s(){var e=d.value[0];return"="==e?6:"-"==e?5:7-d.value.search(/[^#]/)}var o=e.getLine(r),a=o.length,l=e.getLength(),c=r,_=r;if(o.match(this.foldingStartMarker)){if("`"==o[0]){if("start"!==e.bgTokenizer.getState(r)){for(;++r0&&(o=e.getLine(r),!("`"==o[0]&"```"==o.substring(0,3))););return new n(r,o.length,c,0)}var d,u="markup.heading";if(i(r)){for(var m=s();++r=m)break}if((_=r-(d&&-1!=["=","-"].indexOf(d.value[0])?2:1))>c)for(;_>c&&/^\s*$/.test(e.getLine(_));)_--;if(_>c){var h=e.getLine(_).length;return new n(c,a,_,h)}}}}}.call(o.prototype)}),define("cf/js/syntax/cfmarkdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules","ace/mode/json_highlight_rules","ace/mode/sql_highlight_rules","cf/js/syntax/cf_php_highlight_rules"],function(e,t,r){"use strict";function i(e,t){return{token:"support.function",regex:"^```\\s*"+e+"\\s*$",next:t+"start"}}var s=e("ace/lib/oop"),n=e("ace/mode/text_highlight_rules").TextHighlightRules,o=e("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,a=e("ace/mode/xml_highlight_rules").XmlHighlightRules,l=e("ace/mode/html_highlight_rules").HtmlHighlightRules,c=e("ace/mode/css_highlight_rules").CssHighlightRules,_=e("cf/js/syntax/cf_php_highlight_rules").PhpHighlightRules,d=e("cf/js/syntax/cf_php_highlight_rules").PhpLangHighlightRules,u=e("ace/mode/sql_highlight_rules").SqlHighlightRules,m=(e("ace/mode/json_highlight_rules").JsonHighlightRules,function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:"keyword",regex:twttr.txt.regexSupplant("(?:^|\\s)#{atSigns}[a-zA-Z0-9._-]{1,20}")},{token:["constant","constant"],regex:twttr.txt.regexSupplant("(#{hashSigns})(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)")},{token:["support.function","support.function","support.function"],regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"support.function",regex:"^[ ]{4}.+"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.1",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+(e.length-1)},regex:"^#{1,6} "},i("javascript","js-"),i("js","js-"),i("xml","xml-"),i("html","html-"),i("css","css-"),i("php","php-"),i("sql","sql-"),i("json","json-"),{token:"support.function",regex:"^```[a-zA-Z]+\\s*$",next:"githubblock"},{token:"string",regex:"^>[ ].+$",next:"blockquote"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:'(\\[)(\\[[^\\]]*\\]|[^\\[\\]]*)(\\]\\([ \\t]*)(?)((?:[ \t]*"(?:.*?)"[ \\t]*)?)(\\))'},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},{token:["string","string","string"],regex:"\\b([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)\\b"},{token:["string","string","string"],regex:"\\b([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)\\b"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"},{token:"text",regex:"[^\\*_@%$`\\[#<>]+?"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:".+"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string",regex:".+"}],githubblock:[{token:"support.function",regex:"^```",next:"start"},{token:"support.function",regex:".+"}]},this.embedRules(o,"js-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(_,"html-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(c,"css-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(a,"xml-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(d,"php-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(u,"sql-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(u,"json-",[{token:"support.function",regex:"^```",next:"start"}]);var e=(new l).getRules();for(var t in e)this.$rules[t]?this.$rules[t]=this.$rules[t].concat(e[t]):this.$rules[t]=e[t]});s.inherits(m,n),t.CFMarkdownHighlightRules=m}),define("cf/js/syntax/cfmarkdown",["require","exports","module","ace/lib/oop","ace/mode/php","ace/mode/sql","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/json","ace/mode/html","ace/tokenizer","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown","./cf_php_highlight_rules","./cfmarkdown_highlight_rules"],function(e,t,r){"use strict";var i=e("ace/lib/oop"),s=e("ace/mode/text").Mode,n=e("ace/mode/javascript").Mode,o=e("ace/mode/xml").Mode,a=e("ace/mode/html").Mode,l=e("ace/mode/php").Mode,c=e("cf/js/syntax/cf_php_highlight_rules").PhpLangHighlightRules,_=e("ace/mode/sql").Mode,d=e("ace/mode/json").Mode,u=e("ace/tokenizer").Tokenizer,m=e("./cfmarkdown_highlight_rules").CFMarkdownHighlightRules,g=e("ace/mode/folding/markdown").FoldMode;l.$tokenizer=new u((new c).getRules());var h=function(){var e=new m;this.$tokenizer=new u(e.getRules()),this.$embeds=e.getEmbeds(),this.createModeDelegates({"js-":n,"xml-":o,"html-":a,"php-":l,"sql-":_,"json-":d}),this.foldingRules=new g};i.inherits(h,s),function(){this.getNextLineIndent=function(e,t,r){if("listblock"==e){var i=/^((?:\s+)?)([-+*][ ]+)/.exec(t);return i?new Array(i[1].length+1).join(" ")+i[2]:""}return this.$getIndent(t)}}.call(h.prototype),t.Mode=h}),define("ace/requirejs/text!ace/ext/static.css",[],function(){return".ace_static_highlight {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\n font-size: 12px;\n white-space: pre-wrap\n}\n\n.ace_static_highlight .ace_gutter {\n width: 2em;\n text-align: right;\n padding: 0 3px 0 0;\n margin-right: 3px;\n}\n\n.ace_static_highlight.ace_show_gutter .ace_line {\n padding-left: 2.6em;\n}\n\n.ace_static_highlight .ace_line { position: relative; }\n\n.ace_static_highlight .ace_gutter-cell {\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n top: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n\n.ace_static_highlight .ace_gutter-cell:before {\n content: counter(ace_line, decimal);\n counter-increment: ace_line;\n}\n.ace_static_highlight {\n counter-reset: ace_line;\n}\n"}),define("cf/js/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/requirejs/text!ace/ext/static.css"],function(e,t,r){"use strict";var i=e("ace/edit_session").EditSession,s=e("ace/layer/text").Text,n=e("ace/requirejs/text!ace/ext/static.css");t.render=function(e,t,r,o,a){o=parseInt(o||1,10);var l=new i("");l.setMode(t),l.setUseWorker(!1);var c=new s(document.createElement("div"));c.setSession(l),c.config={characterWidth:10,lineHeight:20},l.setValue(e);for(var _=[],d=[],u="",m=l.getLength(),g=0;g"),c.$renderLine(d,g,!0,!1),d.push("");1!==o&&(u=" style='counter-reset: item "+o+";' ");var h="
\t\t\t:language\t\t\t\t
\t\t\t\t\t
    :code
\t\t\t\t
\t\t\t
".replace(/:cssClass/,r.cssClass).replace(/:language/,a).replace(/:olStyle/,u).replace(/:gutter/,_.join("")).replace(/:code/,d.join(""));return c.destroy(),{css:n+r.cssText,html:h}}}),define("cf/js/capsule",["require","exports","module","jquery","ace/ace","ace/mode/text","ace/lib/dom","ace/tokenizer","cf/js/syntax/cf_php_highlight_rules","cf/js/syntax/cfmarkdown","cf/js/static_highlight","ace/theme/textmate"],function(e,t,r,i){"use strict";var s=e("ace/ace"),n=e("ace/config");n.set("packaged",!0),n.set("basePath",requirejsL10n.ace+"/build/src-min"),window.editors={},window.Capsule={},Capsule.delaySave={},Capsule.spinner=function(e){return void 0===e&&(e=capsuleL10n.loading),'
'+e+"
"},Capsule.authCheck=function(e){return void 0===e.result||"unauthorized"!=e.result||(alert(e.msg),location.href=e.login_url+"?redirect_to="+encodeURIComponent(location.href),!1)},Capsule.get=function(e,t,r,s){i.get(e,t,function(e){Capsule.authCheck(e)&&r.call(this,e)},s)},Capsule.post=function(e,t,r,s){i.post(e,t,function(e){Capsule.authCheck(e)&&r.call(this,e)},s)},Capsule.loadExcerpt=function(e,t){e.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.get(capsuleL10n.endpointAjax,{capsule_action:"post_excerpt",post_id:t},function(r){r.html&&(e.replaceWith(r.html),e=i("#post-content-"+t),Capsule.postExpandable(e),e.scrollintoview({offset:10}).find(".post-content").linkify(),Capsule.highlightCodeSyntax(e.find(".post-content")))},"json")},Capsule.centerEditor=function(e){i("#post-edit-"+e).scrollintoview({duration:200,offset:15})},Capsule.loadEditor=function(e,t){e.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.get(capsuleL10n.endpointAjax,{capsule_action:"post_editor",post_id:t},function(r){r.html&&(e.replaceWith(r.html),Capsule.sizeEditor(),Capsule.initEditor(t,r.content),Capsule.centerEditor(t))},"json")},Capsule.createPost=function(e){e.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"create_post"},function(t){t.html&&(e.replaceWith(t.html),Capsule.sizeEditor(),Capsule.initEditor(t.post_id,""),Capsule.centerEditor(t.post_id))},"json")},Capsule.watchForEditorChanges=function(e,t,r){void 0===t&&(t=i("#post-edit-"+e)),void 0===r&&(r=!1);var s=(new Date).getTime()/1e3,n=date("g:i a",s),o=function(){Capsule.delaySave[e]=null,Capsule.updatePost(e,window.editors[e].getSession().getValue())},a=function(){return t.clearQueue().addClass("dirty"),Capsule.delaySave[e]&&clearTimeout(Capsule.delaySave[e]),Capsule.delaySave[e]=setTimeout(o,1e4),window.editors[e].getSession().removeEventListener("change",a),!0};r||t.find("span.post-last-saved").html(n),window.editors[e].getSession().on("change",a),t.delay(50).queue(function(){i(this).removeClass("dirty").dequeue()})},Capsule.updatePost=function(e,t,r,s){void 0===s&&(s=!1),void 0===r&&(r=i("#post-edit-"+e)),s?r.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()):r.addClass("saving");var n=t.replace(/^```([^]+?)^```/gm,"").replace(/
([^]+?)<\/pre>/gm,"").replace(/([^]+?)<\/code>/gm,""),o=twttr.txt.extractMentions(n),a=twttr.txt.extractHashtags(n),l=Capsule.extractCodeLanguages(t);Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"update_post",post_id:e,content:t,projects:JSON.stringify(o),post_tag:JSON.stringify(a),code:JSON.stringify(l)},function(t){"success"==t.result&&(s?Capsule.loadExcerpt(r,e):(r.removeClass("saving"),Capsule.updatePostTaxonomies(r,t.projects_html,t.tags_html,t.code_html),Capsule.watchForEditorChanges(e,r)))},"json")},Capsule.updatePostTaxonomies=function(e,t,r,i){e.find(".post-meta").html(t+r+i)},Capsule.deletePost=function(e,t){t.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"delete_post",post_id:e},function(e){"success"==e.result?t.replaceWith(e.html):(alert(e.msg),t.removeClass("unstyled").children().removeClass("transparent").end().find(".spinner").remove())},"json")},Capsule.undeletePost=function(e,t){t.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"undelete_post",post_id:e},function(r){"success"==r.result?(t.replaceWith(r.html),t=i("#post-content-"+e),Capsule.postExpandable(t)):(alert(r.msg),t.removeClass("unstyled").children().removeClass("transparent").end().find(".spinner").remove())},"json")},Capsule.stickPost=function(e,t){t.addClass("sticky-loading"),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"stick_post",post_id:e},function(e){"success"==e.result?t.addClass("sticky").removeClass("sticky-loading"):alert(e.msg)},"json")},Capsule.unstickPost=function(e,t){t.addClass("sticky-loading"),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"unstick_post",post_id:e},function(e){"success"==e.result?t.removeClass("sticky sticky sticky-loading"):alert(e.msg)},"json")},Capsule.initEditor=function(t,r){window.Capsule.CFMarkdownMode=e("cf/js/syntax/cfmarkdown").Mode,window.editors[t]=s.edit("ace-editor-"+t),window.editors[t].getSession().setUseWrapMode(!0),window.editors[t].getSession().setMode("cf/js/syntax/cfmarkdown"),window.editors[t].setShowPrintMargin(!1),window.editors[t].setTheme("ace/theme/twilight"),window.editors[t].getSession().setValue(r),window.editors[t].container.style.lineHeight="20px",window.editors[t].renderer.setPadding(12),window.editors[t].commands.addCommand({name:"save",bindKey:{mac:"Command-S",win:"Ctrl-S"},exec:function(e){Capsule.updatePost(t,e.getSession().getValue())}}),window.editors[t].commands.addCommand({name:"recenter",bindKey:{mac:"Command-Shift-0",win:"Ctrl-Shift-0"},exec:function(e){Capsule.centerEditor(t)}}),window.editors[t].commands.addCommand({name:"close",bindKey:{mac:"Esc",win:"Esc"},exec:function(e){var r=i("#post-edit-"+t);Capsule.updatePost(t,window.editors[t].getSession().getValue(),r,!0)}}),window.editors[t].commands.addCommand({name:"cfindent",bindKey:{mac:"Command-]",win:"Ctrl-]"},exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine"}),window.editors[t].commands.addCommand({name:"cfoutdent",bindKey:{mac:"Command-[",win:"Ctrl-["},exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine"}),Capsule.watchForEditorChanges(t,void 0,!0),window.editors[t].focus()},Capsule.sizeEditor=function(){i(".ace-editor:not(.resized)").each(function(){i(this).height(i(window).height()-i(this).closest("article").find("header").height()-60+"px")})},Capsule.saveAllEditors=function(){i(".ace-editor").each(function(){var e=i(this).closest("article"),t=e.data("post-id");e.hasClass("dirty")&&Capsule.updatePost(t,window.editors[t].getSession().getValue())})},Capsule.extractCodeLanguages=function(e){var t=new RegExp("^```[a-zA-Z]+\\s*$","gm"),r=new RegExp("[a-zA-Z]+",""),s=[],n=e.match(t);return null!=n&&n.length&&i.each(n,function(e,t){s.push(t.match(r)[0].replace(/^js$/i,"javascript"))}),s},Capsule.postExpandable=function(e){e.find(".post-content:first")[0].scrollHeight>e[0].scrollHeight&&e.addClass("toggleable")},Capsule.highlightCodeSyntax=function(t){void 0===t&&(t=i("article:not(.edit) .post-content")),t.each(function(){i(this).find("pre>code").each(function(t){var r,s,n,o=i(this),a=[""];o.find("br").each(function(e){a.push("")}),r=a.join("\n")+o.text(),"\n"===r.substr(-1)&&(r=r.substr(0,r.length-1)),s=o.attr("class"),s?(s=s.match(/language-([-_a-z0-9]+)/i),s&&(s=s[1].toLowerCase()),"js"===s&&(s="javascript")):s="code",n="code"===s||"bash"===s?"text":s;try{e(["cf/js/static_highlight","ace/theme/textmate","ace/mode/"+n,"ace/lib/dom","ace/tokenizer","cf/js/syntax/cf_php_highlight_rules"],function(t,i,n){var a;if(n){if(n=n.Mode,n=new n,"php"===s){var l=e("ace/tokenizer").Tokenizer,c=e("cf/js/syntax/cf_php_highlight_rules").PhpLangHighlightRules;n.$tokenizer=new l((new c).getRules())}a=t.render(r,n,i,1,s),o.closest("pre").replaceWith(a.html)}})}catch(e){throw console.log(e),e}})})},i(function(){Capsule.highlightCodeSyntax(),i(".js-search").suggest(capsuleSearchURL+"?capsule_action=search",{delay:500,minchars:2,multiple:!0,multipleSep:" ",resultsClass:"search_results",selectClass:"search_selected",matchClass:"search_match"}),i(".js-search").closest("form").on("submit",function(e){e.preventDefault();var t=i(".js-search",i(this)),r=i(this);if(t.val(t.val().trim()),1==r.data("permastruct"))return window.location.href=this.action+"search/"+encodeURIComponent(this.s.value).replace(/%20/g,"+").replace(/%2f/gi,"/"),!1;r.unbind("submit").submit()}),i(document).on("click","article.excerpt.toggleable .post-content",function(e){i(this).closest("article.excerpt.toggleable").removeClass("excerpt").addClass("open")}).on("click","article:not(.excerpt, a.post-edit-link) .post-toggle",function(e){i(this).closest("article").removeClass("open").addClass("excerpt")}).on("click","article .post-edit-link",function(e){var t=i(this).closest("article"),r=t.data("post-id");Capsule.loadEditor(t,r),e.preventDefault()}).on("dblclick","body:not(.capsule-server) article:not(.edit) .post-content",function(e){var t=i(this).closest("article"),r=t.data("post-id");Capsule.loadEditor(t,r)}).on("dblclick","body:not(.capsule-server) article:not(.edit) pre, body:not(.capsule-server) article:not(.edit) code",function(e){e.stopPropagation()}).on("click","article .post-close-link",function(e){e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.updatePost(r,window.editors[r].getSession().getValue(),t,!0)}).on("click","article .post-save-link",function(e){e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.updatePost(r,window.editors[r].getSession().getValue()),window.editors[r].focus()}).on("click","article .post-delete-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.deletePost(r,t)}).on("click","article .post-undelete-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.undeletePost(r,t)}).on("click","article:not(.sticky) .post-sticky-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.stickPost(r,t)}).on("click","article.sticky .post-unsticky-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.unstickPost(r,t)}).on("mousewheel","article.edit .post-content",function(e){e.preventDefault()}).on("click",".post-new-link",function(e){e.preventDefault(),i("#sidr-projects").is(":visible")&&i.sidr("close","sidr-projects"),i("#sidr-tags").is(":visible")&&i.sidr("close","sidr-tags"),i("#sidr-servers").is(":visible")&&i.sidr("close","sidr-servers");var t=i("
").height("400px");i(".body").prepend(t),Capsule.createPost(t)}).on("click",".filter-toggle",function(e){e.preventDefault();var t=i("body"),r=i("#header"),s=r.find('input[name="s"]'),n=r.find(".filter");t.hasClass("filters-on")?(n.slideUp(),i("body").removeClass("filters-on"),s.removeAttr("disabled")):(n.slideDown(),i("body").addClass("filters-on"),s.attr("disabled","disabled"))}).on("heartbeat-connection-lost",function(){i('body:not(".capsule-server")').addClass("connection-lost")}).on("heartbeat-connection-restored",function(){i("body").removeClass("connection-lost")}).on("keyup",null,"shift+h",function(){location.href=i(".main-nav .home").attr("href")}).on("keyup",null,"shift+n",function(){i(".main-nav .post-new-link").click()}).on("keyup",null,"shift+f",function(){i(".js-search").focus().select()}),i(window).on("resize",function(){Capsule.sizeEditor()}).on("blur",function(){Capsule.saveAllEditors()}),i("article").each(function(){Capsule.postExpandable(i(this))}),i(".main-nav").find(".projects").sidr({name:"sidr-projects",source:"#projects"}).end().find(".tags").sidr({name:"sidr-tags",source:"#tags"}).end().find(".servers").sidr({name:"sidr-servers",source:"#servers"}),i(":not(.edit) .post-content").linkify()})}); +e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t},this.$id="ace/mode/json"}.call(_.prototype),t.Mode=_}),define("ace/mode/markdown_highlight_rules",["require","exports","module","../lib/oop","../lib/lang","./text_highlight_rules","./javascript_highlight_rules","./xml_highlight_rules","./html_highlight_rules","./css_highlight_rules"],function(e,t,r){"use strict";function i(e,t){return{token:"support.function",regex:"^\\s*```"+e+"\\s*$",push:t+"start"}}var s=e("../lib/oop"),n=e("../lib/lang"),o=e("./text_highlight_rules").TextHighlightRules,a=e("./javascript_highlight_rules").JavaScriptHighlightRules,l=e("./xml_highlight_rules").XmlHighlightRules,c=e("./html_highlight_rules").HtmlHighlightRules,_=e("./css_highlight_rules").CssHighlightRules,d=function(e){return"(?:[^"+n.escapeRegExp(e)+"\\\\]|\\\\.)*"},u=function(){c.call(this),this.$rules.start.unshift({token:"empty_line",regex:"^$",next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+e.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},i("(?:javascript|js)","jscode-"),i("xml","xmlcode-"),i("html","htmlcode-"),i("css","csscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}),this.addRules({basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)("+d("]")+")(\\]\\s*\\[)("+d("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+d("]")+')(\\]\\()((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)(\\s*"'+d('"')+'"\\s*)?(\\))'},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:!0},{defaultToken:"string.blockquote"}],githubblock:[{token:"support.function",regex:"^\\s*```",next:"start"},{defaultToken:"support.function"}]}),this.embedRules(a,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(c,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(_,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.embedRules(l,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]),this.normalizeRules()};s.inherits(u,o),t.MarkdownHighlightRules=u}),define("ace/mode/folding/markdown",["require","exports","module","../../lib/oop","./fold_mode","../../range"],function(e,t,r){"use strict";var i=e("../../lib/oop"),s=e("./fold_mode").FoldMode,n=e("../../range").Range,o=t.FoldMode=function(){};i.inherits(o,s),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,r){var i=e.getLine(r);return this.foldingStartMarker.test(i)?"`"==i[0]&&"start"==e.bgTokenizer.getState(r)?"end":"start":""},this.getFoldWidgetRange=function(e,t,r){function i(t){return(d=e.getTokens(t)[0])&&0===d.type.lastIndexOf(u,0)}function s(){var e=d.value[0];return"="==e?6:"-"==e?5:7-d.value.search(/[^#]/)}var o=e.getLine(r),a=o.length,l=e.getLength(),c=r,_=r;if(o.match(this.foldingStartMarker)){if("`"==o[0]){if("start"!==e.bgTokenizer.getState(r)){for(;++r0&&(o=e.getLine(r),!("`"==o[0]&"```"==o.substring(0,3))););return new n(r,o.length,c,0)}var d,u="markup.heading";if(i(r)){for(var m=s();++r=m)break}if((_=r-(d&&-1!=["=","-"].indexOf(d.value[0])?2:1))>c)for(;_>c&&/^\s*$/.test(e.getLine(_));)_--;if(_>c){var h=e.getLine(_).length;return new n(c,a,_,h)}}}}}.call(o.prototype)}),define("cf/js/syntax/cfmarkdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules","ace/mode/json_highlight_rules","ace/mode/sql_highlight_rules","cf/js/syntax/cf_php_highlight_rules"],function(e,t,r){"use strict";function i(e,t){return{token:"support.function",regex:"^```\\s*"+e+"\\s*$",next:t+"start"}}var s=e("ace/lib/oop"),n=e("ace/mode/text_highlight_rules").TextHighlightRules,o=e("ace/mode/javascript_highlight_rules").JavaScriptHighlightRules,a=e("ace/mode/xml_highlight_rules").XmlHighlightRules,l=e("ace/mode/html_highlight_rules").HtmlHighlightRules,c=e("ace/mode/css_highlight_rules").CssHighlightRules,_=e("cf/js/syntax/cf_php_highlight_rules").PhpHighlightRules,d=e("cf/js/syntax/cf_php_highlight_rules").PhpLangHighlightRules,u=e("ace/mode/sql_highlight_rules").SqlHighlightRules,m=(e("ace/mode/json_highlight_rules").JsonHighlightRules,function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{token:"keyword",regex:twttr.txt.regexSupplant("(?:^|\\s)#{atSigns}[a-zA-Z0-9._-]{1,20}")},{token:["constant","constant"],regex:twttr.txt.regexSupplant("(#{hashSigns})(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)")},{token:["support.function","support.function","support.function"],regex:"(`+)([^\\r]*?[^`])(\\1)"},{token:"support.function",regex:"^[ ]{4}.+"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.1",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+(e.length-1)},regex:"^#{1,6} "},i("javascript","js-"),i("js","js-"),i("xml","xml-"),i("html","html-"),i("css","css-"),i("php","php-"),i("sql","sql-"),i("json","json-"),{token:"support.function",regex:"^```[a-zA-Z]+\\s*$",next:"githubblock"},{token:"string",regex:"^>[ ].+$",next:"blockquote"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:'(\\[)(\\[[^\\]]*\\]|[^\\[\\]]*)(\\]\\([ \\t]*)(?)((?:[ \t]*"(?:.*?)"[ \\t]*)?)(\\))'},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\*[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\-[ ]?){3,}\\s*$"},{token:"constant",regex:"^[ ]{0,2}(?:[ ]?\\_[ ]?){3,}\\s*$"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock"},{token:["string","string","string"],regex:"\\b([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)\\b"},{token:["string","string","string"],regex:"\\b([*]|[_](?=\\S))([^\\r]*?\\S[*_]*)(\\1)\\b"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"},{token:"text",regex:"[^\\*_@%$`\\[#<>]+?"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:".+"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string",regex:".+"}],githubblock:[{token:"support.function",regex:"^```",next:"start"},{token:"support.function",regex:".+"}]},this.embedRules(o,"js-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(_,"html-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(c,"css-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(a,"xml-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(d,"php-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(u,"sql-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(u,"json-",[{token:"support.function",regex:"^```",next:"start"}]);var e=(new l).getRules();for(var t in e)this.$rules[t]?this.$rules[t]=this.$rules[t].concat(e[t]):this.$rules[t]=e[t]});s.inherits(m,n),t.CFMarkdownHighlightRules=m}),define("cf/js/syntax/cfmarkdown",["require","exports","module","ace/lib/oop","ace/mode/php","ace/mode/sql","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/json","ace/mode/html","ace/tokenizer","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown","./cf_php_highlight_rules","./cfmarkdown_highlight_rules"],function(e,t,r){"use strict";var i=e("ace/lib/oop"),s=e("ace/mode/text").Mode,n=e("ace/mode/javascript").Mode,o=e("ace/mode/xml").Mode,a=e("ace/mode/html").Mode,l=e("ace/mode/php").Mode,c=e("cf/js/syntax/cf_php_highlight_rules").PhpLangHighlightRules,_=e("ace/mode/sql").Mode,d=e("ace/mode/json").Mode,u=e("ace/tokenizer").Tokenizer,m=e("./cfmarkdown_highlight_rules").CFMarkdownHighlightRules,g=e("ace/mode/folding/markdown").FoldMode;l.$tokenizer=new u((new c).getRules());var h=function(){var e=new m;this.$tokenizer=new u(e.getRules()),this.$embeds=e.getEmbeds(),this.createModeDelegates({"js-":n,"xml-":o,"html-":a,"php-":l,"sql-":_,"json-":d}),this.foldingRules=new g};i.inherits(h,s),function(){this.getNextLineIndent=function(e,t,r){if("listblock"==e){var i=/^((?:\s+)?)([-+*][ ]+)/.exec(t);return i?new Array(i[1].length+1).join(" ")+i[2]:""}return this.$getIndent(t)}}.call(h.prototype),t.Mode=h}),define("cf/js/syntax/cfsh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,r){"use strict";var i=e("ace/lib/oop"),s=e("ace/mode/text_highlight_rules").TextHighlightRules,n=t.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set|function|declare|readonly",o=t.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",a=function(){var e=this.createKeywordMapper({keyword:n,"support.function.builtin":o,"invalid.deprecated":"debugger"},"identifier");this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string.start",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$`"\\]|$)/},{include:"variables"},{token:"keyword.operator",regex:/`/},{token:"string.end",regex:'"',next:"pop"},{defaultToken:"string"}]},{regex:"<<<",token:"keyword.operator"},{stateName:"heredoc",regex:"(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",onMatch:function(e,t,r){var i="-"==e[2]?"indentedHeredoc":"heredoc",s=e.split(this.splitRegex);return r.push(i,s[4]),[{type:"constant",value:s[1]},{type:"text",value:s[2]},{type:"string",value:s[3]},{type:"support.class",value:s[4]},{type:"string",value:s[5]}]},rules:{heredoc:[{onMatch:function(e,t,r){return e===r[1]?(r.shift(),r.shift(),this.next=r[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}],indentedHeredoc:[{token:"string",regex:"^\t+"},{onMatch:function(e,t,r){return e===r[1]?(r.shift(),r.shift(),this.next=r[0]||"start","support.class"):(this.next="","string")},regex:".*$",next:"start"}]}},{regex:"$",token:"empty",next:function(e,t){return"heredoc"===t[0]||"indentedHeredoc"===t[0]?t[0]:e}},{token:["keyword","text","text","text","variable"],regex:/(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/},{token:"variable.language",regex:"(?:\\$(?:SHLVL|\\$|\\!|\\?))"},{token:"variable",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*(?==))"},{include:"variables"},{token:"support.function",regex:"(?:[a-zA-Z_][a-zA-Z0-9_]*\\s*\\(\\))"},{token:"support.function",regex:"(?:&(?:\\d+))"},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:"(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+)))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))"},{token:"constant.numeric",regex:"(?:(?:[1-9]\\d*)|(?:0))\\b"},{token:e,regex:"[a-zA-Z_][a-zA-Z0-9_]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"},{token:"punctuation.operator",regex:";"},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]]"},{token:"paren.rparen",regex:"[\\)\\}]",next:"pop"}],variables:[{token:"variable",regex:/(\$)(\w+)/},{token:["variable","paren.lparen"],regex:/(\$)(\()/,push:"start"},{token:["variable","paren.lparen","keyword.operator","variable","keyword.operator"],regex:/(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,push:"start"},{token:"variable",regex:/\$[*@#?\-$!0_]/},{token:["variable","paren.lparen"],regex:/(\$)(\{)/,push:"start"}]},this.normalizeRules()};i.inherits(a,s),t.CfShHighlightRules=a}),define("cf/js/syntax/cfsh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/range","./cfsh_highlight_rules","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"],function(e,t,r){"use strict";var i=e("ace/lib/oop"),s=e("ace/mode/text").Mode,n=e("./cfsh_highlight_rules").CfShHighlightRules,o=e("ace/range").Range,a=e("ace/mode/folding/cstyle").FoldMode,l=e("ace/mode/behaviour/cstyle").CstyleBehaviour,c=function(){this.HighlightRules=n,this.foldingRules=new a,this.$behaviour=new l};i.inherits(c,s),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,r){var i=this.$getIndent(t),s=this.getTokenizer().getLineTokens(t,e),n=s.tokens;if(n.length&&"comment"==n[n.length-1].type)return i;if("start"==e){t.match(/^.*[\{\(\[:]\s*$/)&&(i+=r)}return i};var e={pass:1,return:1,raise:1,break:1,continue:1};this.checkOutdent=function(t,r,i){if("\r\n"!==i&&"\r"!==i&&"\n"!==i)return!1;var s=this.getTokenizer().getLineTokens(r.trim(),t).tokens;if(!s)return!1;do{var n=s.pop()}while(n&&("comment"==n.type||"text"==n.type&&n.value.match(/^\s+$/)));return!!n&&("keyword"==n.type&&e[n.value])},this.autoOutdent=function(e,t,r){r+=1;var i=this.$getIndent(t.getLine(r)),s=t.getTabString();i.slice(-s.length)==s&&t.remove(new o(r,i.length-s.length,r,i.length))},this.$id="cf/js/syntax/cfsh"}.call(c.prototype),t.Mode=c}),define("ace/requirejs/text!ace/ext/static.css",[],function(){return".ace_static_highlight {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace;\n font-size: 12px;\n white-space: pre-wrap\n}\n\n.ace_static_highlight .ace_gutter {\n width: 2em;\n text-align: right;\n padding: 0 3px 0 0;\n margin-right: 3px;\n}\n\n.ace_static_highlight.ace_show_gutter .ace_line {\n padding-left: 2.6em;\n}\n\n.ace_static_highlight .ace_line { position: relative; }\n\n.ace_static_highlight .ace_gutter-cell {\n -moz-user-select: -moz-none;\n -khtml-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n top: 0;\n bottom: 0;\n left: 0;\n position: absolute;\n}\n\n\n.ace_static_highlight .ace_gutter-cell:before {\n content: counter(ace_line, decimal);\n counter-increment: ace_line;\n}\n.ace_static_highlight {\n counter-reset: ace_line;\n}\n"}),define("cf/js/static_highlight",["require","exports","module","ace/edit_session","ace/layer/text","ace/requirejs/text!ace/ext/static.css"],function(e,t,r){"use strict";var i=e("ace/edit_session").EditSession,s=e("ace/layer/text").Text,n=e("ace/requirejs/text!ace/ext/static.css");t.render=function(e,t,r,o,a){o=parseInt(o||1,10);var l=new i("");l.setMode(t),l.setUseWorker(!1);var c=new s(document.createElement("div"));c.setSession(l),c.config={characterWidth:10,lineHeight:20},l.setValue(e);for(var _=[],d=[],u="",m=l.getLength(),g=0;g"),c.$renderLine(d,g,!0,!1),d.push("");1!==o&&(u=" style='counter-reset: item "+o+";' ");var h="
\t\t\t:language\t\t\t\t
\t\t\t\t\t
    :code
\t\t\t\t
\t\t\t
".replace(/:cssClass/,r.cssClass).replace(/:language/,a).replace(/:olStyle/,u).replace(/:gutter/,_.join("")).replace(/:code/,d.join(""));return c.destroy(),{css:n+r.cssText,html:h}}}),define("cf/js/capsule",["require","exports","module","jquery","ace/ace","ace/mode/text","ace/lib/dom","ace/tokenizer","cf/js/syntax/cf_php_highlight_rules","cf/js/syntax/cfmarkdown","cf/js/syntax/cfsh","cf/js/static_highlight","ace/theme/textmate"],function(e,t,r,i){"use strict";var s=e("ace/ace"),n=e("ace/config");n.set("packaged",!0),n.set("basePath",requirejsL10n.ace+"/build/src-min"),window.editors={},window.Capsule={},Capsule.delaySave={},Capsule.spinner=function(e){return void 0===e&&(e=capsuleL10n.loading),'
'+e+"
"},Capsule.authCheck=function(e){return void 0===e.result||"unauthorized"!=e.result||(alert(e.msg),location.href=e.login_url+"?redirect_to="+encodeURIComponent(location.href),!1)},Capsule.get=function(e,t,r,s){i.get(e,t,function(e){Capsule.authCheck(e)&&r.call(this,e)},s)},Capsule.post=function(e,t,r,s){i.post(e,t,function(e){Capsule.authCheck(e)&&r.call(this,e)},s)},Capsule.loadExcerpt=function(e,t){e.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.get(capsuleL10n.endpointAjax,{capsule_action:"post_excerpt",post_id:t},function(r){r.html&&(e.replaceWith(r.html),e=i("#post-content-"+t),Capsule.postExpandable(e),e.scrollintoview({offset:10}).find(".post-content").linkify(),Capsule.highlightCodeSyntax(e.find(".post-content")))},"json")},Capsule.centerEditor=function(e){i("#post-edit-"+e).scrollintoview({duration:200,offset:15})},Capsule.loadEditor=function(e,t){e.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.get(capsuleL10n.endpointAjax,{capsule_action:"post_editor",post_id:t},function(r){r.html&&(e.replaceWith(r.html),Capsule.sizeEditor(),Capsule.initEditor(t,r.content),Capsule.centerEditor(t))},"json")},Capsule.createPost=function(e){e.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"create_post"},function(t){t.html&&(e.replaceWith(t.html),Capsule.sizeEditor(),Capsule.initEditor(t.post_id,""),Capsule.centerEditor(t.post_id))},"json")},Capsule.watchForEditorChanges=function(e,t,r){void 0===t&&(t=i("#post-edit-"+e)),void 0===r&&(r=!1);var s=(new Date).getTime()/1e3,n=date("g:i a",s),o=function(){Capsule.delaySave[e]=null,Capsule.updatePost(e,window.editors[e].getSession().getValue())},a=function(){return t.clearQueue().addClass("dirty"),Capsule.delaySave[e]&&clearTimeout(Capsule.delaySave[e]),Capsule.delaySave[e]=setTimeout(o,1e4),window.editors[e].getSession().removeEventListener("change",a),!0};r||t.find("span.post-last-saved").html(n),window.editors[e].getSession().on("change",a),t.delay(50).queue(function(){i(this).removeClass("dirty").dequeue()})},Capsule.updatePost=function(e,t,r,s){void 0===s&&(s=!1),void 0===r&&(r=i("#post-edit-"+e)),s?r.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()):r.addClass("saving");var n=t.replace(/^```([\s\S]+)^```/gm,"").replace(/^\/\*([\s\S]+)^\*\//gm,"").replace(/
([^]+?)<\/pre>/gm,"").replace(/([^]+?)<\/code>/gm,""),o=twttr.txt.extractMentions(n),a=twttr.txt.extractHashtags(n),l=Capsule.extractCodeLanguages(t);Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"update_post",post_id:e,content:t,projects:JSON.stringify(o),post_tag:JSON.stringify(a),code:JSON.stringify(l)},function(t){"success"==t.result&&(s?Capsule.loadExcerpt(r,e):(r.removeClass("saving"),Capsule.updatePostTaxonomies(r,t.projects_html,t.tags_html,t.code_html),Capsule.watchForEditorChanges(e,r)))},"json")},Capsule.updatePostTaxonomies=function(e,t,r,i){e.find(".post-meta").html(t+r+i)},Capsule.deletePost=function(e,t){t.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"delete_post",post_id:e},function(e){"success"==e.result?t.replaceWith(e.html):(alert(e.msg),t.removeClass("unstyled").children().removeClass("transparent").end().find(".spinner").remove())},"json")},Capsule.undeletePost=function(e,t){t.addClass("unstyled").children().addClass("transparent").end().append(Capsule.spinner()),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"undelete_post",post_id:e},function(r){"success"==r.result?(t.replaceWith(r.html),t=i("#post-content-"+e),Capsule.postExpandable(t)):(alert(r.msg),t.removeClass("unstyled").children().removeClass("transparent").end().find(".spinner").remove())},"json")},Capsule.stickPost=function(e,t){t.addClass("sticky-loading"),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"stick_post",post_id:e},function(e){"success"==e.result?t.addClass("sticky").removeClass("sticky-loading"):alert(e.msg)},"json")},Capsule.unstickPost=function(e,t){t.addClass("sticky-loading"),Capsule.post(capsuleL10n.endpointAjax,{capsule_action:"unstick_post",post_id:e},function(e){"success"==e.result?t.removeClass("sticky sticky sticky-loading"):alert(e.msg)},"json")},Capsule.initEditor=function(t,r){window.Capsule.CFMarkdownMode=e("cf/js/syntax/cfmarkdown").Mode,window.editors[t]=s.edit("ace-editor-"+t),window.editors[t].getSession().setUseWrapMode(!0),window.editors[t].getSession().setMode("cf/js/syntax/cfmarkdown"),window.editors[t].setShowPrintMargin(!1),window.editors[t].setTheme("ace/theme/twilight"),window.editors[t].getSession().setValue(r),window.editors[t].container.style.lineHeight="20px",window.editors[t].renderer.setPadding(12),window.editors[t].commands.addCommand({name:"save",bindKey:{mac:"Command-S",win:"Ctrl-S"},exec:function(e){Capsule.updatePost(t,e.getSession().getValue())}}),window.editors[t].commands.addCommand({name:"recenter",bindKey:{mac:"Command-Shift-0",win:"Ctrl-Shift-0"},exec:function(e){Capsule.centerEditor(t)}}),window.editors[t].commands.addCommand({name:"close",bindKey:{mac:"Esc",win:"Esc"},exec:function(e){var r=i("#post-edit-"+t);Capsule.updatePost(t,window.editors[t].getSession().getValue(),r,!0)}}),window.editors[t].commands.addCommand({name:"cfindent",bindKey:{mac:"Command-]",win:"Ctrl-]"},exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine"}),window.editors[t].commands.addCommand({name:"cfoutdent",bindKey:{mac:"Command-[",win:"Ctrl-["},exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine"}),Capsule.watchForEditorChanges(t,void 0,!0),window.editors[t].focus()},Capsule.sizeEditor=function(){i(".ace-editor:not(.resized)").each(function(){i(this).height(i(window).height()-i(this).closest("article").find("header").height()-60+"px")})},Capsule.saveAllEditors=function(){i(".ace-editor").each(function(){var e=i(this).closest("article"),t=e.data("post-id");e.hasClass("dirty")&&Capsule.updatePost(t,window.editors[t].getSession().getValue())})},Capsule.extractCodeLanguages=function(e){var t=new RegExp("^```[a-zA-Z]+\\s*$","gm"),r=new RegExp("[a-zA-Z]+",""),s=[],n=e.match(t);return null!=n&&n.length&&i.each(n,function(e,t){s.push(t.match(r)[0].replace(/^js$/i,"javascript"))}),s},Capsule.postExpandable=function(e){e.find(".post-content:first")[0].scrollHeight>e[0].scrollHeight&&e.addClass("toggleable")},Capsule.highlightCodeSyntax=function(t){void 0===t&&(t=i("article:not(.edit) .post-content")),t.each(function(){i(this).find("pre>code").each(function(t){var r,s,n,o=i(this),a=[""];o.find("br").each(function(e){a.push("")}),r=a.join("\n")+o.text(),"\n"===r.substr(-1)&&(r=r.substr(0,r.length-1)),s=o.attr("class"),s?(s=s.match(/language-([-_a-z0-9]+)/i),s&&(s=s[1].toLowerCase()),"js"===s&&(s="javascript")):s="code",n="code"===s||"bash"===s?"cfsh":s;try{var l=function(t,i,n){var a;if(n){if(n=n.Mode,n=new n,"php"===s){var l=e("ace/tokenizer").Tokenizer,c=e("cf/js/syntax/cf_php_highlight_rules").PhpLangHighlightRules;n.$tokenizer=new l((new c).getRules())}a=t.render(r,n,i,1,s),o.closest("pre").replaceWith(a.html)}};e(["cf/js/static_highlight","ace/theme/textmate","cfsh"===n?"cf/js/syntax/cfsh":"ace/mode/"+n,"ace/lib/dom","ace/tokenizer","cf/js/syntax/cf_php_highlight_rules"],l)}catch(e){throw console.log(e),e}})})},i(function(){Capsule.highlightCodeSyntax(),i(".js-search").suggest(capsuleSearchURL+"?capsule_action=search",{delay:500,minchars:2,multiple:!0,multipleSep:" ",resultsClass:"search_results",selectClass:"search_selected",matchClass:"search_match"}),i(".js-search").closest("form").on("submit",function(e){e.preventDefault();var t=i(".js-search",i(this)),r=i(this);if(t.val(t.val().trim()),1==r.data("permastruct"))return window.location.href=this.action+"search/"+encodeURIComponent(this.s.value).replace(/%20/g,"+").replace(/%2f/gi,"/"),!1;r.unbind("submit").submit()}),i(document).on("click","article.excerpt.toggleable .post-content",function(e){i(this).closest("article.excerpt.toggleable").removeClass("excerpt").addClass("open")}).on("click","article:not(.excerpt, a.post-edit-link) .post-toggle",function(e){i(this).closest("article").removeClass("open").addClass("excerpt")}).on("click","article .post-edit-link",function(e){var t=i(this).closest("article"),r=t.data("post-id");Capsule.loadEditor(t,r),e.preventDefault()}).on("dblclick","body:not(.capsule-server) article:not(.edit) .post-content",function(e){var t=i(this).closest("article"),r=t.data("post-id");Capsule.loadEditor(t,r)}).on("dblclick","body:not(.capsule-server) article:not(.edit) pre, body:not(.capsule-server) article:not(.edit) code",function(e){e.stopPropagation()}).on("click","article .post-close-link",function(e){e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.updatePost(r,window.editors[r].getSession().getValue(),t,!0)}).on("click","article .post-save-link",function(e){e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.updatePost(r,window.editors[r].getSession().getValue()),window.editors[r].focus()}).on("click","article .post-delete-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.deletePost(r,t)}).on("click","article .post-undelete-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.undeletePost(r,t)}).on("click","article:not(.sticky) .post-sticky-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.stickPost(r,t)}).on("click","article.sticky .post-unsticky-link",function(e){e.stopPropagation(),e.preventDefault();var t=i(this).closest("article"),r=t.data("post-id");Capsule.unstickPost(r,t)}).on("mousewheel","article.edit .post-content",function(e){e.preventDefault()}).on("click",".post-new-link",function(e){e.preventDefault(),i("#sidr-projects").is(":visible")&&i.sidr("close","sidr-projects"),i("#sidr-tags").is(":visible")&&i.sidr("close","sidr-tags"),i("#sidr-servers").is(":visible")&&i.sidr("close","sidr-servers");var t=i("
").height("400px");i(".body").prepend(t),Capsule.createPost(t)}).on("click",".filter-toggle",function(e){e.preventDefault();var t=i("body"),r=i("#header"),s=r.find('input[name="s"]'),n=r.find(".filter");t.hasClass("filters-on")?(n.slideUp(),i("body").removeClass("filters-on"),s.removeAttr("disabled")):(n.slideDown(),i("body").addClass("filters-on"),s.attr("disabled","disabled"))}).on("heartbeat-connection-lost",function(){i('body:not(".capsule-server")').addClass("connection-lost")}).on("heartbeat-connection-restored",function(){i("body").removeClass("connection-lost")}).on("keyup",null,"shift+h",function(){location.href=i(".main-nav .home").attr("href")}).on("keyup",null,"shift+n",function(){i(".main-nav .post-new-link").click()}).on("keyup",null,"shift+f",function(){i(".js-search").focus().select()}),i(window).on("resize",function(){Capsule.sizeEditor()}).on("blur",function(){Capsule.saveAllEditors()}),i("article").each(function(){Capsule.postExpandable(i(this))}),i(".main-nav").find(".projects").sidr({name:"sidr-projects",source:"#projects"}).end().find(".tags").sidr({name:"sidr-tags",source:"#tags"}).end().find(".servers").sidr({name:"sidr-servers",renaming:!1,source:"#servers"}),i(":not(.edit) .post-content").linkify()})}); /*** assets/js/load.js ***/ require(["cf/js/capsule"]); \ No newline at end of file diff --git a/ui/assets/js/static_highlight.js b/ui/assets/js/static_highlight.js index 523a22f..bf7e623 100644 --- a/ui/assets/js/static_highlight.js +++ b/ui/assets/js/static_highlight.js @@ -5,7 +5,7 @@ * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * https://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License diff --git a/ui/assets/js/syntax/cf_php_highlight_rules.js b/ui/assets/js/syntax/cf_php_highlight_rules.js index 53e67df..ee37b16 100644 --- a/ui/assets/js/syntax/cf_php_highlight_rules.js +++ b/ui/assets/js/syntax/cf_php_highlight_rules.js @@ -47,7 +47,7 @@ var HtmlHighlightRules = require("ace/mode/html_highlight_rules").HtmlHighlightR var PhpLangHighlightRules = function() { var docComment = DocCommentHighlightRules; - // http://php.net/quickref.php + // https://php.net/quickref.php var builtinFunctions = lang.arrayToMap( ('abs|acos|acosh|addcslashes|addslashes|aggregate|aggregate_info|aggregate_methods|aggregate_methods_by_list|aggregate_methods_by_regexp|' + 'aggregate_properties|aggregate_properties_by_list|aggregate_properties_by_regexp|aggregation_info|amqpconnection|amqpexchange|amqpqueue|' + @@ -841,14 +841,14 @@ var PhpLangHighlightRules = function() { 'ziparchive_unchangeindex|ziparchive_unchangename|zlib_get_coding_type').split('|') ); - // http://php.net/manual/en/reserved.keywords.php + // https://php.net/manual/en/reserved.keywords.php var keywords = lang.arrayToMap( ('abstract|and|array|as|break|case|catch|class|clone|const|continue|declare|default|do|else|elseif|enddeclare|endfor|endforeach|endif|' + 'endswitch|endwhile|extends|final|for|foreach|function|global|goto|if|implements|interface|instanceof|namespace|new|or|private|protected|' + 'public|static|switch|throw|try|use|var|while|xor').split('|') ); - // http://php.net/manual/en/reserved.keywords.php + // https://php.net/manual/en/reserved.keywords.php var languageConstructs = lang.arrayToMap( ('die|echo|empty|exit|eval|include|include_once|isset|list|require|require_once|return|print|unset').split('|') ); @@ -862,7 +862,7 @@ var PhpLangHighlightRules = function() { '$http_response_header|$argc|$argv').split('|') ); - // Discovery done by downloading 'Many HTML files' from: http://php.net/download-docs.php + // Discovery done by downloading 'Many HTML files' from: https://php.net/download-docs.php // Then search for files containing 'deprecated' (case-insensitive) and look at each file that turns up. var builtinFunctionsDeprecated = lang.arrayToMap( ('key_exists|cairo_matrix_create_scale|cairo_matrix_create_translate|call_user_method|call_user_method_array|com_addref|com_get|' + diff --git a/ui/assets/js/syntax/cfmarkdown.js b/ui/assets/js/syntax/cfmarkdown.js index 4ac9aeb..3a97d35 100644 --- a/ui/assets/js/syntax/cfmarkdown.js +++ b/ui/assets/js/syntax/cfmarkdown.js @@ -5,7 +5,7 @@ * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * https://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License diff --git a/ui/assets/js/syntax/cfmarkdown_highlight_rules.js b/ui/assets/js/syntax/cfmarkdown_highlight_rules.js index 7a322f5..77091df 100644 --- a/ui/assets/js/syntax/cfmarkdown_highlight_rules.js +++ b/ui/assets/js/syntax/cfmarkdown_highlight_rules.js @@ -5,7 +5,7 @@ * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ + * https://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License diff --git a/ui/assets/js/syntax/cfsh.js b/ui/assets/js/syntax/cfsh.js new file mode 100644 index 0000000..63fe970 --- /dev/null +++ b/ui/assets/js/syntax/cfsh.js @@ -0,0 +1,129 @@ +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cf/js/syntax/cfsh', ['require', 'exports', 'module', + 'ace/lib/oop', 'ace/mode/text', 'ace/range', './cfsh_highlight_rules', + 'ace/mode/folding/cstyle', 'ace/mode/behaviour/cstyle' + ], +function(require, exports, module) { +"use strict"; +var oop = require("ace/lib/oop"); +var TextMode = require("ace/mode/text").Mode; +var CfShHighlightRules = require("./cfsh_highlight_rules").CfShHighlightRules; +var Range = require("ace/range").Range; +var CStyleFoldMode = require("ace/mode/folding/cstyle").FoldMode; +var CstyleBehaviour = require("ace/mode/behaviour/cstyle").CstyleBehaviour; + +var Mode = function() { + this.HighlightRules = CfShHighlightRules; + this.foldingRules = new CStyleFoldMode(); + this.$behaviour = new CstyleBehaviour(); +}; +oop.inherits(Mode, TextMode); + +(function() { + + + this.lineCommentStart = "#"; + + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); + + var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokens = tokenizedLine.tokens; + + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } + + if (state == "start") { + var match = line.match(/^.*[\{\(\[:]\s*$/); + if (match) { + indent += tab; + } + } + + return indent; + }; + + var outdents = { + "pass": 1, + "return": 1, + "raise": 1, + "break": 1, + "continue": 1 + }; + + this.checkOutdent = function(state, line, input) { + if (input !== "\r\n" && input !== "\r" && input !== "\n") + return false; + + var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + + if (!tokens) + return false; + + // ignore trailing comments + do { + var last = tokens.pop(); + } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/)))); + + if (!last) + return false; + + return (last.type == "keyword" && outdents[last.value]); + }; + + this.autoOutdent = function(state, doc, row) { + // outdenting in sh is slightly different because it always applies + // to the next line and only of a new line is inserted + + row += 1; + var indent = this.$getIndent(doc.getLine(row)); + var tab = doc.getTabString(); + if (indent.slice(-tab.length) == tab) + doc.remove(new Range(row, indent.length-tab.length, row, indent.length)); + }; + + this.$id = "cf/js/syntax/cfsh"; +}).call(Mode.prototype); + +exports.Mode = Mode; +}); diff --git a/ui/assets/js/syntax/cfsh_highlight_rules.js b/ui/assets/js/syntax/cfsh_highlight_rules.js new file mode 100644 index 0000000..61e4bcd --- /dev/null +++ b/ui/assets/js/syntax/cfsh_highlight_rules.js @@ -0,0 +1,249 @@ +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define('cf/js/syntax/cfsh_highlight_rules', ['require', 'exports', 'module', + 'ace/lib/oop', 'ace/mode/text_highlight_rules' + ], +function(require, exports, module) { +"use strict"; + +var oop = require("ace/lib/oop"); +var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightRules; + +var reservedKeywords = exports.reservedKeywords = ( + '!|{|}|case|do|done|elif|else|'+ + 'esac|fi|for|if|in|then|until|while|'+ + '&|;|export|local|read|typeset|unset|'+ + 'elif|select|set|function|declare|readonly' + ); + +var languageConstructs = exports.languageConstructs = ( + '[|]|alias|bg|bind|break|builtin|'+ + 'cd|command|compgen|complete|continue|'+ + 'dirs|disown|echo|enable|eval|exec|'+ + 'exit|fc|fg|getopts|hash|help|history|'+ + 'jobs|kill|let|logout|popd|printf|pushd|'+ + 'pwd|return|set|shift|shopt|source|'+ + 'suspend|test|times|trap|type|ulimit|'+ + 'umask|unalias|wait' +); + +var CfShHighlightRules = function() { + var keywordMapper = this.createKeywordMapper({ + "keyword": reservedKeywords, + "support.function.builtin": languageConstructs, + "invalid.deprecated": "debugger" + }, "identifier"); + + var integer = "(?:(?:[1-9]\\d*)|(?:0))"; + // var integer = "(?:" + decimalInteger + ")"; + + var fraction = "(?:\\.\\d+)"; + var intPart = "(?:\\d+)"; + var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; + var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")"; + var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")"; + var fileDescriptor = "(?:&" + intPart + ")"; + + var variableName = "[a-zA-Z_][a-zA-Z0-9_]*"; + var variable = "(?:" + variableName + "(?==))"; + + var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))"; + + var func = "(?:" + variableName + "\\s*\\(\\))"; + + this.$rules = { + "start" : [{ + token : "constant", + regex : /\\./ + }, { + token : ["text", "comment"], + regex : /(^|\s)(#.*)$/ + }, { + token : "string.start", + regex : '"', + push : [{ + token : "constant.language.escape", + regex : /\\(?:[$`"\\]|$)/ + }, { + include : "variables" + }, { + token : "keyword.operator", + regex : /`/ // TODO highlight ` + }, { + token : "string.end", + regex : '"', + next: "pop" + }, { + defaultToken: "string" + }] + }, { + regex : "<<<", + token : "keyword.operator" + }, { + stateName: "heredoc", + regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)", + onMatch : function(value, currentState, stack) { + var next = value[2] == '-' ? "indentedHeredoc" : "heredoc"; + var tokens = value.split(this.splitRegex); + stack.push(next, tokens[4]); + return [ + {type:"constant", value: tokens[1]}, + {type:"text", value: tokens[2]}, + {type:"string", value: tokens[3]}, + {type:"support.class", value: tokens[4]}, + {type:"string", value: tokens[5]} + ]; + }, + rules: { + heredoc: [{ + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }], + indentedHeredoc: [{ + token: "string", + regex: "^\t+" + }, { + onMatch: function(value, currentState, stack) { + if (value === stack[1]) { + stack.shift(); + stack.shift(); + this.next = stack[0] || "start"; + return "support.class"; + } + this.next = ""; + return "string"; + }, + regex: ".*$", + next: "start" + }] + } + }, { + regex : "$", + token : "empty", + next : function(currentState, stack) { + if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc") + return stack[0]; + return currentState; + } + }, { + token : ["keyword", "text", "text", "text", "variable"], + regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/ + }, { + token : "variable.language", + regex : builtinVariable + }, { + token : "variable", + regex : variable + }, { + include : "variables" + }, { + token : "support.function", + regex : func + }, { + token : "support.function", + regex : fileDescriptor + }, { + token : "string", // ' string + start : "'", end : "'" + }, { + token : "constant.numeric", // float + regex : floatNumber + }, { + token : "constant.numeric", // integer + regex : integer + "\\b" + }, { + token : keywordMapper, + regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b" + }, { + token : "keyword.operator", + regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]" + }, { + token : "punctuation.operator", + regex : ";" + }, { + token : "paren.lparen", + regex : "[\\[\\(\\{]" + }, { + token : "paren.rparen", + regex : "[\\]]" + }, { + token : "paren.rparen", + regex : "[\\)\\}]", + next : "pop" + }], + variables: [{ + token : "variable", + regex : /(\$)(\w+)/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\()/, + push : "start" + }, { + token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"], + regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/, + push : "start" + }, { + token : "variable", + regex : /\$[*@#?\-$!0_]/ + }, { + token : ["variable", "paren.lparen"], + regex : /(\$)(\{)/, + push : "start" + }] + }; + + this.normalizeRules(); +}; + +oop.inherits(CfShHighlightRules, TextHighlightRules); + +exports.CfShHighlightRules = CfShHighlightRules; +}); \ No newline at end of file diff --git a/ui/assets/scss/_icons.scss b/ui/assets/scss/_icons.scss new file mode 100644 index 0000000..9c9758b --- /dev/null +++ b/ui/assets/scss/_icons.scss @@ -0,0 +1,34 @@ +/* -------------------------------------------------- + * Icons +-------------------------------------------------- */ +[class^="capsule-icon-"]:before, [class*=" capsule-icon-"]:before { + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + display: inline-block; + font-family: "Fontello"; + font-style: normal; + font-variant: normal; + font-weight: normal; + margin-left: .2em; + margin-right: .2em; + speak: none; + text-align: center; + text-decoration: inherit; + text-transform: none; + width: 1em; +} + +.capsule-icon-numbersign:before { content: '\e801'; } +.capsule-icon-star-empty:before { content: '\e802'; } +.capsule-icon-star-full:before { content: '\e803'; } +.capsule-icon-drive:before { content: '\e804'; } +.capsule-icon-edit:before { content: '\e805'; } +.capsule-icon-trash:before { content: '\e806'; } +.capsule-icon-globe:before { content: '\e807'; } +.capsule-icon-home:before { content: '\e808'; } +.capsule-icon-x-circle:before { content: '\e809'; } +.capsule-icon-plus-circle:before { content: '\e80a'; } +.capsule-icon-cog-wheel:before { content: '\e80b'; } +.capsule-icon-magnifying-glass:before { content: '\e80c'; } +.capsule-icon-open-in-new:before { content: '\e80e'; } +.capsule-icon-circle:before { content: '\e831'; } diff --git a/ui/assets/scss/_utility.scss b/ui/assets/scss/_utility.scss index a039c33..aab1063 100644 --- a/ui/assets/scss/_utility.scss +++ b/ui/assets/scss/_utility.scss @@ -119,4 +119,24 @@ /* background image set in functions.php */ height: 100%; width: 100%; +} + +.sr-only { + border: 0; + clip: rect(0, 0, 0, 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + width: auto; } \ No newline at end of file diff --git a/ui/assets/scss/style.scss b/ui/assets/scss/style.scss index bed33f8..8e5d464 100644 --- a/ui/assets/scss/style.scss +++ b/ui/assets/scss/style.scss @@ -68,6 +68,7 @@ $font-icon: 'Fontello'; src: url('../fonts/fontello/fontello.eot'); src: url('../fonts/fontello/fontello.eot?#iefix') format('embedded-opentype'), url('../fonts/fontello/fontello.woff') format('woff'), + url('../fonts/fontello/fontello.woff2') format('woff2'), url('../fonts/fontello/fontello.ttf') format('truetype'), url('../fonts/fontello/fontello.svg') format('svg'); } @@ -85,7 +86,7 @@ $font-icon: 'Fontello'; border-radius: $radius; /* Standard. IE9+ */ /** * @bugfix border-radius background bleed - * @see http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed + * @see https://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleed */ -webkit-background-clip: padding-box; } @@ -167,6 +168,8 @@ $assetpath: "/wp-content/themes/capsule/assets/img/"; // Helper Classes & Debug Styles @import "utility"; +@import "icons"; + // Global Header @import "header"; diff --git a/ui/assets/svg/cf-logo.svg b/ui/assets/svg/cf-logo.svg index f8877f8..beb75ba 100644 --- a/ui/assets/svg/cf-logo.svg +++ b/ui/assets/svg/cf-logo.svg @@ -1,7 +1,7 @@ Slice 1 - Created with Sketch (http://www.bohemiancoding.com/sketch) + Created with Sketch (https://www.sketch.com/) diff --git a/ui/controller.php b/ui/controller.php index 131364b..4a6a077 100644 --- a/ui/controller.php +++ b/ui/controller.php @@ -1,4 +1,5 @@ -get_col( - $wpdb->prepare( ' - SELECT t.name - FROM ' . $wpdb->term_taxonomy . ' AS tt - INNER JOIN ' . $wpdb->terms . ' AS t ON tt.term_id = t.term_id + $wpdb->prepare( + ' + SELECT t.name + FROM ' . $wpdb->term_taxonomy . ' AS tt + INNER JOIN ' . $wpdb->terms . ' AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = %s AND t.name LIKE (%s) AND tt.count > 0', $taxonomy, - $wpdb->esc_like( $term_name ) . '%' + $wpdb->esc_like($term_name) . '%' ) ); $html = ''; - foreach ( $results as $result ) { + foreach ($results as $result) { $html .= $prefix . $result . "\n"; } - echo esc_html( $html ); + echo esc_html($html); } } die(); } - if ( 0 === strpos( $action, 'queue_' ) ) { - $api_key = filter_input( INPUT_GET, 'api_key' ); - if ( stripslashes( $api_key ) === capsule_queue_api_key() ) { - switch ( $action ) { + if (0 === strpos($action, 'queue_')) { + $api_key = filter_input(INPUT_GET, 'api_key'); + if (stripslashes($api_key) === capsule_queue_api_key()) { + switch ($action) { case 'queue_run': capsule_queue_run(); break; case 'queue_post_to_server': // Required params: post_id. - $post_id = (int) filter_input( INPUT_GET, 'post_id', FILTER_VALIDATE_INT ); - if ( $post_id > 0 ) { - capsule_queue_post_to_server( $post_id ); + $post_id = (int) filter_input(INPUT_GET, 'post_id', FILTER_VALIDATE_INT); + if ($post_id > 0) { + capsule_queue_post_to_server($post_id); } break; @@ -104,35 +108,35 @@ function capsule_controller_action_get( $action ) { } } - if ( ! current_user_can( 'edit_posts' ) ) { + if (! current_user_can('edit_posts')) { capsule_unauthorized_json(); } - switch ( $action ) { + switch ($action) { case 'post_excerpt': case 'post_content': // Required params: post_id. - $post_id = (int) filter_input( INPUT_GET, 'post_id', FILTER_VALIDATE_INT ); - if ( $post_id > 0 ) { + $post_id = (int) filter_input(INPUT_GET, 'post_id', FILTER_VALIDATE_INT); + if ($post_id > 0) { global $post; - $post = get_post( $post_id ); - setup_postdata( $post ); - $view = str_replace( 'post_', '', $action ); + $post = get_post($post_id); + setup_postdata($post); + $view = str_replace('post_', '', $action); ob_start(); include get_template_directory() . '/ui/views/' . $view . '.php'; $html = ob_get_clean(); - $response = compact( 'html' ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + $response = compact('html'); + header('Content-type: application/json'); + wp_send_json($response); } break; case 'post_editor': // Required params: post_id. - $post_id = (int) filter_input( INPUT_GET, 'post_id', FILTER_VALIDATE_INT ); - if ( $post_id > 0 ) { + $post_id = (int) filter_input(INPUT_GET, 'post_id', FILTER_VALIDATE_INT); + if ($post_id > 0) { global $post; - $post = get_post( $post_id ); - setup_postdata( $post ); + $post = get_post($post_id); + setup_postdata($post); ob_start(); include get_template_directory() . '/ui/views/edit.php'; $html = ob_get_clean(); @@ -140,13 +144,13 @@ function capsule_controller_action_get( $action ) { 'html' => $html, 'content' => $post->post_content, ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + header('Content-type: application/json'); + wp_send_json($response); } break; default: - do_action( 'capsule_controller_action_get', $action ); + do_action('capsule_controller_action_get', $action); break; } } @@ -157,8 +161,9 @@ function capsule_controller_action_get( $action ) { * @param string $action Current action. * @return void */ -function capsule_controller_action_post( $action ) { - switch ( $action ) { +function capsule_controller_action_post($action) +{ + switch ($action) { case 'create_post': global $post; $post_id = wp_insert_post( @@ -166,21 +171,22 @@ function capsule_controller_action_post( $action ) { 'post_title' => time(), 'post_status' => 'draft', 'post_content' => '', - ), true + ), + true ); - if ( is_wp_error( $post_id ) ) { + if (is_wp_error($post_id)) { $result = 'error'; $msg = $post_id->get_error_message(); - $response = compact( 'result', 'msg' ); + $response = compact('result', 'msg'); } else { $result = 'success'; - $msg = __( 'Post created.', 'capsule' ); - $post = get_post( $post_id ); - setup_postdata( $post ); + $msg = __('Post created.', 'capsule'); + $post = get_post($post_id); + setup_postdata($post); ob_start(); include get_template_directory() . '/ui/views/edit.php'; $html = ob_get_clean(); - $ymd = get_the_time( 'Ymd', $post ); + $ymd = get_the_time('Ymd', $post); $response = array( 'post_id' => $post_id, 'result' => $result, @@ -189,14 +195,14 @@ function capsule_controller_action_post( $action ) { 'content' => $post->post_content, ); } - header( 'Content-type: application/json' ); - wp_send_json( $response ); + header('Content-type: application/json'); + wp_send_json($response); break; case 'update_post': // Required params: post_id, content. - $post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_VALIDATE_INT ); - if ( $post_id <= 0 ) { + $post_id = (int) filter_input(INPUT_POST, 'post_id', FILTER_VALIDATE_INT); + if ($post_id <= 0) { die(); } $post_title = ''; @@ -205,41 +211,41 @@ function capsule_controller_action_post( $action ) { 'post_tag' => array(), 'code' => array(), ); - foreach ( $taxonomies as $tax => $terms ) { - $submitted_tax = filter_input( INPUT_POST, $tax ); - $terms = json_decode( $submitted_tax ); + foreach ($taxonomies as $tax => $terms) { + $submitted_tax = filter_input(INPUT_POST, $tax); + $terms = json_decode($submitted_tax); // There is no easy WP way assign terms by name to a post on the fly // they must be created first and then use the slug (or ID for heirarchial). - foreach ( $terms as $term_name ) { - $term = get_term_by( 'name', $term_name, $tax ); - if ( ! $term ) { - $term_data = wp_insert_term( $term_name, $tax ); - if ( ! is_wp_error( $term_data ) ) { - $term = get_term_by( 'id', $term_data['term_id'], $tax ); + foreach ($terms as $term_name) { + $term = get_term_by('name', $term_name, $tax); + if (! $term) { + $term_data = wp_insert_term($term_name, $tax); + if (! is_wp_error($term_data)) { + $term = get_term_by('id', $term_data['term_id'], $tax); $taxonomies[ $tax ][] = $term->slug; } } else { $taxonomies[ $tax ][] = $term->slug; } } - $post_title .= ' ' . implode( ' ', $terms ); + $post_title .= ' ' . implode(' ', $terms); } // If the content is empty, wp_update_post fails. - $content = filter_input( INPUT_POST, 'content' ); - if ( empty( $content ) ) { + $content = filter_input(INPUT_POST, 'content'); + if (empty($content)) { $content = ' '; } $update = wp_update_post( array( 'ID' => $post_id, - 'post_title' => trim( $post_title ), + 'post_title' => trim($post_title), 'post_content' => $content, 'post_status' => 'publish', ) ); - if ( $update ) { - foreach ( $taxonomies as $tax => $terms ) { - wp_set_post_terms( $post_id, $terms, $tax ); + if ($update) { + foreach ($taxonomies as $tax => $terms) { + wp_set_post_terms($post_id, $terms, $tax); } $result = 'success'; $msg = 'Post saved.'; @@ -247,92 +253,92 @@ function capsule_controller_action_post( $action ) { $result = 'error'; $msg = 'Saving post #' . $post_id . ' failed.'; } - $projects_html = capsule_term_list( $post_id, 'projects' ); - $tags_html = capsule_term_list( $post_id, 'post_tag' ); - $code_html = capsule_term_list( $post_id, 'code' ); - $response = compact( 'post_id', 'result', 'msg', 'projects_html', 'tags_html', 'code_html' ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + $projects_html = capsule_term_list($post_id, 'projects'); + $tags_html = capsule_term_list($post_id, 'post_tag'); + $code_html = capsule_term_list($post_id, 'code'); + $response = compact('post_id', 'result', 'msg', 'projects_html', 'tags_html', 'code_html'); + header('Content-type: application/json'); + wp_send_json($response); break; case 'delete_post': // Required params: post_id. - $post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_VALIDATE_INT ); - $delete = wp_delete_post( $post_id ); - if ( false !== $delete ) { - $post = get_post( $post_id ); - setup_postdata( $post ); + $post_id = (int) filter_input(INPUT_POST, 'post_id', FILTER_VALIDATE_INT); + $delete = wp_delete_post($post_id); + if (false !== $delete) { + $post = get_post($post_id); + setup_postdata($post); $result = 'success'; - $msg = __( 'Post deleted', 'capsule' ); + $msg = __('Post deleted', 'capsule'); ob_start(); include get_template_directory() . '/ui/views/deleted.php'; $html = ob_get_clean(); } else { $result = 'error'; - $msg = __( 'Post not deleted, please try again.', 'capsule' ); + $msg = __('Post not deleted, please try again.', 'capsule'); $html = ''; } - $response = compact( 'post_id', 'result', 'msg', 'html' ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + $response = compact('post_id', 'result', 'msg', 'html'); + header('Content-type: application/json'); + wp_send_json($response); break; case 'undelete_post': // Required params: post_id. global $post; - $post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_VALIDATE_INT ); - $post = wp_untrash_post( $post_id ); - if ( false !== $post ) { - $post = get_post( $post_id ); - setup_postdata( $post ); + $post_id = (int) filter_input(INPUT_POST, 'post_id', FILTER_VALIDATE_INT); + $post = wp_untrash_post($post_id); + if (false !== $post) { + $post = get_post($post_id); + setup_postdata($post); $result = 'success'; - $msg = __( 'Post recovered from trash.', 'capsule' ); + $msg = __('Post recovered from trash.', 'capsule'); ob_start(); include get_template_directory() . '/ui/views/excerpt.php'; $html = ob_get_clean(); } else { $result = 'error'; - $msg = __( 'Post not restored, please try again.', 'capsule' ); + $msg = __('Post not restored, please try again.', 'capsule'); $html = ''; } - $response = compact( 'post_id', 'result', 'msg', 'html' ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + $response = compact('post_id', 'result', 'msg', 'html'); + header('Content-type: application/json'); + wp_send_json($response); break; case 'stick_post': // Required params: post_id. - $post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_VALIDATE_INT ); - $post = get_post( $post_id ); - if ( ! $post ) { + $post_id = (int) filter_input(INPUT_POST, 'post_id', FILTER_VALIDATE_INT); + $post = get_post($post_id); + if (! $post) { die(); } - stick_post( $post_id ); + stick_post($post_id); $response = array( 'post_id' => $post_id, 'result' => 'success', - 'msg' => __( 'Post stuck.', 'capsule' ), + 'msg' => __('Post stuck.', 'capsule'), 'html' => '', ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + header('Content-type: application/json'); + wp_send_json($response); break; case 'unstick_post': // Required params: post_id. - $post_id = (int) filter_input( INPUT_POST, 'post_id', FILTER_VALIDATE_INT ); - if ( $post_id <= 0 ) { + $post_id = (int) filter_input(INPUT_POST, 'post_id', FILTER_VALIDATE_INT); + if ($post_id <= 0) { die(); } - unstick_post( $post_id ); + unstick_post($post_id); $response = array( 'post_id' => $post_id, 'result' => 'success', - 'msg' => __( 'Post unstuck.', 'capsule' ), + 'msg' => __('Post unstuck.', 'capsule'), 'html' => '', ); - header( 'Content-type: application/json' ); - wp_send_json( $response ); + header('Content-type: application/json'); + wp_send_json($response); break; case 'split_post': @@ -346,7 +352,7 @@ function capsule_controller_action_post( $action ) { break; default: - do_action( 'capsule_controller_action_post', $action ); + do_action('capsule_controller_action_post', $action); break; } } diff --git a/ui/functions.php b/ui/functions.php index 29607cd..18aab07 100644 --- a/ui/functions.php +++ b/ui/functions.php @@ -1,27 +1,29 @@ - 'unauthorized', - 'msg' => __( 'Please log in.', 'capsule' ), + 'msg' => __('Please log in.', 'capsule'), 'login_url' => wp_login_url(), - ) ); + )); die(); } @@ -94,9 +101,10 @@ function capsule_unauthorized_json() { * * @return void */ -function capsule_resources_prod() { - $template_url = trailingslashit( get_template_directory_uri() ) . 'ui/'; - $assets_url = trailingslashit( $template_url . 'assets' ); +function capsule_resources_prod() +{ + $template_url = trailingslashit(get_template_directory_uri()) . 'ui/'; + $assets_url = trailingslashit($template_url . 'assets'); // Styles. wp_enqueue_style( @@ -107,8 +115,8 @@ function capsule_resources_prod() { ); // Scripts. - wp_enqueue_script( 'jquery' ); - wp_enqueue_script( 'suggest' ); + wp_enqueue_script('jquery'); + wp_enqueue_script('suggest'); wp_enqueue_script( 'capsule', $assets_url . 'js/optimized.js', @@ -116,18 +124,18 @@ function capsule_resources_prod() { CAPSULE_URL_VERSION, true ); - wp_localize_script( 'capsule', 'capsuleL10n', array( - 'endpointAjax' => home_url( 'index.php' ), - 'loading' => __( 'Loading...', 'capsule' ), - ) ); - wp_localize_script( 'capsule', 'requirejsL10n', array( + wp_localize_script('capsule', 'capsuleL10n', array( + 'endpointAjax' => home_url('index.php'), + 'loading' => __('Loading...', 'capsule'), + )); + wp_localize_script('capsule', 'requirejsL10n', array( 'capsule' => $assets_url, 'ace' => $template_url . 'lib/ace', 'lib' => $template_url . 'lib', - 'cachebust' => rawurlencode( CAPSULE_URL_VERSION ), - ) ); - if ( ! is_capsule_server() ) { - wp_enqueue_script( 'heartbeat' ); + 'cachebust' => rawurlencode(CAPSULE_URL_VERSION), + )); + if (! is_capsule_server()) { + wp_enqueue_script('heartbeat'); } } @@ -136,9 +144,10 @@ function capsule_resources_prod() { * * @return void */ -function capsule_resources_dev() { - $template_url = trailingslashit( get_template_directory_uri() ) . 'ui/'; - $assets_url = trailingslashit( $template_url . 'assets' ); +function capsule_resources_dev() +{ + $template_url = trailingslashit(get_template_directory_uri()) . 'ui/'; + $assets_url = trailingslashit($template_url . 'assets'); // Styles. wp_enqueue_style( @@ -149,7 +158,7 @@ function capsule_resources_dev() { ); // Scripts. - wp_enqueue_script( 'jquery' ); + wp_enqueue_script('jquery'); wp_enqueue_script( 'hotkeys', $template_url . 'lib/jquery.hotkeys/jquery.hotkeys.js', @@ -157,9 +166,9 @@ function capsule_resources_dev() { CAPSULE_URL_VERSION, true ); - wp_enqueue_script( 'suggest' ); - if ( ! is_capsule_server() ) { - wp_enqueue_script( 'heartbeat' ); + wp_enqueue_script('suggest'); + if (! is_capsule_server()) { + wp_enqueue_script('heartbeat'); } // require.js enforces JS module dependencies, heavily used in @@ -178,12 +187,12 @@ function capsule_resources_dev() { CAPSULE_URL_VERSION, true ); - wp_localize_script( 'requirejs', 'requirejsL10n', array( + wp_localize_script('requirejs', 'requirejsL10n', array( 'capsule' => $assets_url, 'ace' => $template_url . 'lib/ace', 'lib' => $template_url . 'lib', - 'cachebust' => rawurlencode( CAPSULE_URL_VERSION ), - ) ); + 'cachebust' => rawurlencode(CAPSULE_URL_VERSION), + )); wp_enqueue_script( 'capsulebundle', $assets_url . 'js/capsule.js', @@ -199,10 +208,10 @@ function capsule_resources_dev() { CAPSULE_URL_VERSION, true ); - wp_localize_script( 'capsule', 'capsuleL10n', array( - 'endpointAjax' => home_url( 'index.php' ), - 'loading' => __( 'Loading...', 'capsule' ), - ) ); + wp_localize_script('capsule', 'capsuleL10n', array( + 'endpointAjax' => home_url('index.php'), + 'loading' => __('Loading...', 'capsule'), + )); wp_enqueue_script( 'php-date', @@ -240,13 +249,6 @@ function capsule_resources_dev() { CAPSULE_URL_VERSION, true ); - wp_enqueue_script( - 'sidr', - $template_url . 'lib/sidr/dist/jquery.sidr.js', - array( 'jquery' ), - CAPSULE_URL_VERSION, - true - ); wp_enqueue_script( 'linkify', $template_url . 'lib/linkify/1.0/jquery.linkify-1.0-min.js', @@ -255,10 +257,11 @@ function capsule_resources_dev() { true ); } -if ( 'dev' === capsule_mode() || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) { - add_action( 'wp_enqueue_scripts', 'capsule_resources_dev' ); + +if ('dev' === capsule_mode() || ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG )) { + add_action('wp_enqueue_scripts', 'capsule_resources_dev'); } else { - add_action( 'wp_enqueue_scripts', 'capsule_resources_prod' ); + add_action('wp_enqueue_scripts', 'capsule_resources_prod'); } /** @@ -266,24 +269,25 @@ function capsule_resources_dev() { * * @return void */ -function capsule_register_taxonomies() { +function capsule_register_taxonomies() +{ register_taxonomy( 'projects', 'post', array( 'hierarchical' => false, 'labels' => array( - 'name' => __( 'Projects', 'capsule' ), - 'singular_name' => __( 'Project', 'capsule' ), - 'search_items' => __( 'Search Projects', 'capsule' ), - 'popular_items' => __( 'Popular Projects', 'capsule' ), - 'all_items' => __( 'All Projects', 'capsule' ), - 'parent_item' => __( 'Parent Project', 'capsule' ), - 'parent_item_colon' => __( 'Parent Project:', 'capsule' ), - 'edit_item' => __( 'Edit Project', 'capsule' ), - 'update_item' => __( 'Update Project', 'capsule' ), - 'add_new_item' => __( 'Add New Project', 'capsule' ), - 'new_item_name' => __( 'New Project Name', 'capsule' ), + 'name' => __('Projects', 'capsule'), + 'singular_name' => __('Project', 'capsule'), + 'search_items' => __('Search Projects', 'capsule'), + 'popular_items' => __('Popular Projects', 'capsule'), + 'all_items' => __('All Projects', 'capsule'), + 'parent_item' => __('Parent Project', 'capsule'), + 'parent_item_colon' => __('Parent Project:', 'capsule'), + 'edit_item' => __('Edit Project', 'capsule'), + 'update_item' => __('Update Project', 'capsule'), + 'add_new_item' => __('Add New Project', 'capsule'), + 'new_item_name' => __('New Project Name', 'capsule'), ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), @@ -299,17 +303,17 @@ function capsule_register_taxonomies() { array( 'hierarchical' => false, 'labels' => array( - 'name' => __( 'Code Languages', 'capsule' ), - 'singular_name' => __( 'Code Language', 'capsule' ), - 'search_items' => __( 'Search Code Languages', 'capsule' ), - 'popular_items' => __( 'Popular Code Languages', 'capsule' ), - 'all_items' => __( 'All Code Languages', 'capsule' ), - 'parent_item' => __( 'Parent Code Language', 'capsule' ), - 'parent_item_colon' => __( 'Parent Code Language:', 'capsule' ), - 'edit_item' => __( 'Edit Code Language', 'capsule' ), - 'update_item' => __( 'Update Code Language', 'capsule' ), - 'add_new_item' => __( 'Add New Code Language', 'capsule' ), - 'new_item_name' => __( 'New Code Language Name', 'capsule' ), + 'name' => __('Code Languages', 'capsule'), + 'singular_name' => __('Code Language', 'capsule'), + 'search_items' => __('Search Code Languages', 'capsule'), + 'popular_items' => __('Popular Code Languages', 'capsule'), + 'all_items' => __('All Code Languages', 'capsule'), + 'parent_item' => __('Parent Code Language', 'capsule'), + 'parent_item_colon' => __('Parent Code Language:', 'capsule'), + 'edit_item' => __('Edit Code Language', 'capsule'), + 'update_item' => __('Update Code Language', 'capsule'), + 'add_new_item' => __('Add New Code Language', 'capsule'), + 'new_item_name' => __('New Code Language Name', 'capsule'), ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), @@ -325,17 +329,17 @@ function capsule_register_taxonomies() { array( 'hierarchical' => true, 'labels' => array( - 'name' => __( 'Evergreen', 'capsule' ), - 'singular_name' => __( 'Evergreen Status', 'capsule' ), - 'search_items' => __( 'Search Evergreen Status', 'capsule' ), - 'popular_items' => __( 'Popular Evergreen Status', 'capsule' ), - 'all_items' => __( 'All Evergreen Status', 'capsule' ), - 'parent_item' => __( 'Parent Evergreen Status', 'capsule' ), - 'parent_item_colon' => __( 'Parent Evergreen Status:', 'capsule' ), - 'edit_item' => __( 'Edit Evergreen Status', 'capsule' ), - 'update_item' => __( 'Update Evergreen Status', 'capsule' ), - 'add_new_item' => __( 'Add New Evergreen Status', 'capsule' ), - 'new_item_name' => __( 'New Evergreen Status Name', 'capsule' ), + 'name' => __('Evergreen', 'capsule'), + 'singular_name' => __('Evergreen Status', 'capsule'), + 'search_items' => __('Search Evergreen Status', 'capsule'), + 'popular_items' => __('Popular Evergreen Status', 'capsule'), + 'all_items' => __('All Evergreen Status', 'capsule'), + 'parent_item' => __('Parent Evergreen Status', 'capsule'), + 'parent_item_colon' => __('Parent Evergreen Status:', 'capsule'), + 'edit_item' => __('Edit Evergreen Status', 'capsule'), + 'update_item' => __('Update Evergreen Status', 'capsule'), + 'add_new_item' => __('Add New Evergreen Status', 'capsule'), + 'new_item_name' => __('New Evergreen Status Name', 'capsule'), ), 'sort' => true, 'args' => array( 'orderby' => 'term_order' ), @@ -347,33 +351,34 @@ function capsule_register_taxonomies() { ) ); } -add_action( 'init', 'capsule_register_taxonomies' ); +add_action('init', 'capsule_register_taxonomies'); /** * Check for taxonomy support in permalink patterns. * * @return void */ -function capsule_permalink_check() { - $rewrite_rules = get_option( 'rewrite_rules' ); - if ( empty( $rewrite_rules ) ) { +function capsule_permalink_check() +{ + $rewrite_rules = get_option('rewrite_rules'); + if (empty($rewrite_rules)) { return; } global $wp_rewrite; $pattern = 'projects/'; - if ( '/' === substr( $pattern, 0, 1 ) ) { - $pattern = substr( $pattern, 1 ); + if ('/' === substr($pattern, 0, 1)) { + $pattern = substr($pattern, 1); } // Check for 'projects' in rewrite rules. - foreach ( $rewrite_rules as $rule => $params ) { - if ( substr( $rule, 0, strlen( $pattern ) === $pattern ) ) { + foreach ($rewrite_rules as $rule => $params) { + if (substr($rule, 0, strlen($pattern) === $pattern)) { return; } } // Flush rules if not found above. flush_rewrite_rules(); } -add_action( 'admin_init', 'capsule_permalink_check' ); +add_action('admin_init', 'capsule_permalink_check'); /** * Get Capsule custom taxonomy terms for a post. @@ -384,10 +389,11 @@ function capsule_permalink_check() { * @param string $taxonomy Taxonomy name. * @return array Post taxonomy terms. */ -function capsule_get_the_terms( $terms, $id, $taxonomy ) { - if ( is_array( $terms ) && count( $terms ) ) { +function capsule_get_the_terms($terms, $id, $taxonomy) +{ + if (is_array($terms) && count($terms)) { $prefix = null; - switch ( $taxonomy ) { + switch ($taxonomy) { case 'projects': $prefix = CAPSULE_TAX_PREFIX_PROJECT; break; @@ -399,9 +405,9 @@ function capsule_get_the_terms( $terms, $id, $taxonomy ) { break; } $_terms = array(); - foreach ( $terms as $term_id => $term ) { - if ( ! empty( $prefix ) ) { - if ( substr( $term->name, 0, strlen( $prefix ) ) !== $prefix ) { + foreach ($terms as $term_id => $term) { + if (! empty($prefix)) { + if (substr($term->name, 0, strlen($prefix)) !== $prefix) { $term->name = $prefix . $term->name; } } @@ -411,7 +417,7 @@ function capsule_get_the_terms( $terms, $id, $taxonomy ) { } return $terms; } -add_filter( 'get_the_terms', 'capsule_get_the_terms', 10, 3 ); +add_filter('get_the_terms', 'capsule_get_the_terms', 10, 3); /** * Get list of terms for a post. @@ -420,15 +426,16 @@ function capsule_get_the_terms( $terms, $id, $taxonomy ) { * @param string $taxonomy Taxonomy name. * @return string HTML content. */ -function capsule_term_list( $post_id, $taxonomy ) { - $tax_terms = get_the_terms( $post_id, $taxonomy ); - if ( false === $tax_terms || is_wp_error( $tax_terms ) ) { +function capsule_term_list($post_id, $taxonomy) +{ + $tax_terms = get_the_terms($post_id, $taxonomy); + if (false === $tax_terms || is_wp_error($tax_terms)) { return ''; } - if ( 'post_tag' === $taxonomy ) { - return get_the_term_list( $post_id, $taxonomy, '' ); + if ('post_tag' === $taxonomy) { + return get_the_term_list($post_id, $taxonomy, ''); } else { - return get_the_term_list( $post_id, $taxonomy, '
  • ', '
  • ', '
' ); + return get_the_term_list($post_id, $taxonomy, '
  • ', '
  • ', '
'); } } @@ -438,13 +445,14 @@ function capsule_term_list( $post_id, $taxonomy ) { * @param string $content Content. * @return string Updated content. */ -function capsule_the_content_markdown( $content ) { +function capsule_the_content_markdown($content) +{ include_once get_template_directory() . '/ui/lib/php-markdown/markdown_extended.php'; - return MarkdownExtended( $content ); + return MarkdownExtended($content); } -add_filter( 'the_content', 'capsule_the_content_markdown', 6 ); -remove_filter( 'the_content', 'wpautop' ); -remove_filter( 'the_content', 'wptexturize' ); +add_filter('the_content', 'capsule_the_content_markdown', 6); +remove_filter('the_content', 'wpautop'); +remove_filter('the_content', 'wptexturize'); /** * Trim excerpt. @@ -452,29 +460,31 @@ function capsule_the_content_markdown( $content ) { * @param string $excerpt Excerpt. * @return string Trimmed excerpt. */ -function capsule_trim_excerpt( $excerpt ) { +function capsule_trim_excerpt($excerpt) +{ $max = 500; - if ( strlen( $excerpt ) > $max ) { - $excerpt = substr( $excerpt, 0, $max ); + if (strlen($excerpt) > $max) { + $excerpt = substr($excerpt, 0, $max); } return $excerpt; } -add_filter( 'get_the_excerpt', 'capsule_trim_excerpt' ); +add_filter('get_the_excerpt', 'capsule_trim_excerpt'); /** * Generate the searchurl for the frontend. * * @return void */ -function capsule_header_js() { -?> +function capsule_header_js() +{ + ?> -' . esc_html__( 'Options', 'capsule' ) . ''; + echo '
' . esc_html__('Options', 'capsule') . ''; - foreach ( $args['taxonomies'] as $taxonomy => $tax_args ) { - if ( is_array( $args ) ) { - CF_Taxonomy_Filter::tax_filter( $taxonomy, $tax_args ); + foreach ($args['taxonomies'] as $taxonomy => $tax_args) { + if (is_array($args)) { + CF_Taxonomy_Filter::tax_filter($taxonomy, $tax_args); } else { // Just passed in taxonomy name with no options. - CF_Taxonomy_Filter::tax_filter( $args ); + CF_Taxonomy_Filter::tax_filter($args); } } CF_Taxonomy_Filter::author_select(); echo '
'; - echo '
' . esc_html__( 'Date Range', 'capsule' ) . ''; + echo '
' . esc_html__('Date Range', 'capsule') . ''; CF_Taxonomy_Filter::date_filter(); @@ -535,59 +546,82 @@ function capsule_taxonomy_filter() { * * @return string Taxonomy filter URL. */ -function capsule_tax_filter_url() { +function capsule_tax_filter_url() +{ return get_template_directory_uri() . '/ui/lib/wp-taxonomy-filter/'; } -add_filter( 'cftf_url', 'capsule_tax_filter_url' ); +add_filter('cftf_url', 'capsule_tax_filter_url'); /** * Display credits. * * @return void */ -function capsule_credits() { -?> +function capsule_credits() +{ + ?> - 'queue_run', 'api_key' => capsule_queue_api_key(), - ), site_url( 'index.php' ) ); - wp_remote_get( + ), site_url('index.php')); + wp_safe_remote_get( $url, array( 'blocking' => false, @@ -687,27 +726,28 @@ function capsule_queue_start() { * * @return void */ -function capsule_queue_run() { - set_time_limit( 0 ); +function capsule_queue_run() +{ + set_time_limit(0); // this is a very weak "lock" mechanism, but may be suitable for // low request situations like Capsule. - $lock = get_option( 'capsule_queue_lock' ); - if ( ! empty( $lock ) && $lock > strtotime( 'now' ) ) { + $lock = get_option('capsule_queue_lock'); + if (! empty($lock) && $lock > strtotime('now')) { return; } - update_option( 'capsule_queue_lock', strtotime( '+5 minutes' ) ); - $queue = get_option( 'capsule_queue' ); + update_option('capsule_queue_lock', strtotime('+5 minutes')); + $queue = get_option('capsule_queue'); - for ( $i = 0; $i < 10; $i++ ) { - if ( $i >= count( $queue ) ) { + for ($i = 0; $i < 10; $i++) { + if ($i >= count($queue)) { break; } $url = add_query_arg(array( 'capsule_action' => 'queue_post_to_server', 'post_id' => $queue[ $i ], 'api_key' => capsule_queue_api_key(), - ), site_url( 'index.php' ) ); - wp_remote_get( + ), site_url('index.php')); + wp_safe_remote_get( $url, array( 'blocking' => false, @@ -716,10 +756,10 @@ function capsule_queue_run() { ) ); } - if ( count( $queue ) > 10 ) { + if (count($queue) > 10) { capsule_queue_start(); } - update_option( 'capsule_queue_lock', '' ); + update_option('capsule_queue_lock', ''); } /** @@ -728,120 +768,133 @@ function capsule_queue_run() { * @param integer $post_id Post id. * @return void */ -function capsule_queue_post_to_server( $post_id ) { +function capsule_queue_post_to_server($post_id) +{ global $cap_client; - $post = get_post( $post_id ); + $post = get_post($post_id); // Check if there are any posts in the post type. - $taxonomies = get_object_taxonomies( $post->post_type ); + $taxonomies = get_object_taxonomies($post->post_type); $servers = $cap_client->get_servers(); $postarr = (array) $post; $errors = 0; - foreach ( $servers as $server_post ) { + foreach ($servers as $server_post) { // Only send post if theres a term thats been mapped. - if ( $cap_client->has_server_mapping( $post, $server_post ) ) { + if ($cap_client->has_server_mapping($post, $server_post)) { $tax_input = $cap_client->format_terms_to_send( $post, $taxonomies, - $cap_client->post_type_slug( $server_post->post_name ) + $cap_client->post_type_slug($server_post->post_name) ); $mapped_taxonomies = $cap_client->taxonomies_to_map(); - $tax = compact( 'taxonomies', 'tax_input', 'mapped_taxonomies' ); + $tax = compact('taxonomies', 'tax_input', 'mapped_taxonomies'); - $api_key = get_post_meta( $server_post->ID, $cap_client->server_api_key, true ); - $endpoint = get_post_meta( $server_post->ID, $cap_client->server_url_key, true ); + $api_key = get_post_meta($server_post->ID, $cap_client->server_api_key, true); + $endpoint = get_post_meta($server_post->ID, $cap_client->server_url_key, true); - $response = $cap_client->send_post( $postarr, $tax, $api_key, $endpoint ); + $response = $cap_client->send_post($postarr, $tax, $api_key, $endpoint); - if ( ! $response || ! isset( $response->result ) || 'success' !== $response->result ) { + if (! $response || ! isset($response->result) || 'success' !== $response->result) { $errors++; } else { // Older server theme versions will not send the permalink. - $permalink = isset( $response->data->permalink ) ? $response->data->permalink : ''; + $permalink = isset($response->data->permalink) ? $response->data->permalink : ''; - $server_statuses = get_post_meta( $post_id, '_cap_client_server_statuses', true ); - $server_statuses = is_array( $server_statuses ) ? $server_statuses : array(); + $server_statuses = get_post_meta($post_id, '_cap_client_server_statuses', true); + $server_statuses = is_array($server_statuses) ? $server_statuses : array(); $server_statuses[ $server_post->ID ] = array( - 'gmt_time' => current_time( 'timestamp', true ), + 'gmt_time' => current_time('timestamp', true), 'permalink' => $permalink, ); - update_post_meta( $post_id, '_cap_client_server_statuses', $server_statuses ); + update_post_meta($post_id, '_cap_client_server_statuses', $server_statuses); } } } - if ( empty( $errors ) ) { + if (empty($errors)) { // "send at least once" style queue - only remove if all sends are successful. - capsule_queue_remove( $post_id ); + capsule_queue_remove($post_id); } } -/** - * Display warning. - * - * @return void - */ -function capsule_wp_editor_warning() { -?> - -
-

-

- Capsule is designed for front-end editing only.
Changes to projects, tags, etc. here will be overwritten when this post is edited on the front-end.', 'capsule' ); ?> -
', 'capsule' ); ?> -

-

Let me in anyway.', 'capsule' ); ?>

-
- - + '; - foreach ( $meta as $server_id => $data ) { - if ( ! empty( $data['gmt_time'] ) ) { - // Server should have sent permalink, but if the server theme is running an older version it will be empty, set it to the server URL. - $permalink = ! empty( $data['permalink'] ) ? $data['permalink'] : get_post_meta( $server_id, $cap_client->server_url_key, true ); - $wp_time = capsule_gmt_to_wp_time( $data['gmt_time'] ); - $date_format = apply_filters( 'capsule_server_push_date_format', 'M j, Y @ g:ia' ); - - $html .= '
  • ' . get_the_title( $server_id ) . '' . date( $date_format, $wp_time ) . '
  • '; + foreach ($meta as $server_id => $data) { + if (! empty($data['gmt_time'])) { + // Server should have sent permalink, + // but if the server theme is running an older version it will be empty, set it to the server URL. + $permalink = ! empty($data['permalink']) + ? $data['permalink'] + : get_post_meta($server_id, $cap_client->server_url_key, true); + $wp_time = capsule_gmt_to_wp_time($data['gmt_time']); + $date_format = apply_filters('capsule_server_push_date_format', 'M j, Y @ g:ia'); + + $html .= '
  • '; + $html .= '' . get_the_title($server_id); + $html .= '' . date($date_format, $wp_time) . '
  • '; } } $html .= ''; @@ -876,18 +935,19 @@ function capsule_last_pushed( $post_id ) { * @param integer $gmt_time Timestamp. * @return integer Updated timestamp. */ -function capsule_gmt_to_wp_time( $gmt_time ) { - $timezone_string = get_option( 'timezone_string' ); - if ( ! empty( $timezone_string ) ) { +function capsule_gmt_to_wp_time($gmt_time) +{ + $timezone_string = get_option('timezone_string'); + if (! empty($timezone_string)) { // Not using get_option( 'gmt_offset' ) because it gets the offset for the // current date/time which doesn't work for timezones with daylight savings time. - $gmt_date = date( 'Y-m-d H:i:s', $gmt_time ); - $datetime = new DateTime( $gmt_date ); - $datetime->setTimezone( new DateTimeZone( get_option( 'timezone_string' ) ) ); + $gmt_date = date('Y-m-d H:i:s', $gmt_time); + $datetime = new DateTime($gmt_date); + $datetime->setTimezone(new DateTimeZone(get_option('timezone_string'))); $offset_in_secs = $datetime->getOffset(); return $gmt_time + $offset_in_secs; } else { - return $gmt_time + ( get_option( 'gmt_offset' ) * 3600 ); + return $gmt_time + ( get_option('gmt_offset') * 3600 ); } } diff --git a/ui/index.php b/ui/index.php index 39e5058..48992e1 100644 --- a/ui/index.php +++ b/ui/index.php @@ -1,14 +1,15 @@ get_servers() : array(); -$blog_desc = get_bloginfo( 'description' ); -$title_description = ( is_home() && ! empty( $blog_desc ) ? ' - ' . $blog_desc : '' ); +$blog_desc = get_bloginfo('description'); +$title_description = ( is_home() && ! empty($blog_desc) ? ' - ' . $blog_desc : '' ); -$permalink_structure = get_option( 'permalink_structure' ); -$search_permastruct = ( empty( $permalink_structure ) ) ? '0' : '1'; +$permalink_structure = get_option('permalink_structure'); +$search_permastruct = ( empty($permalink_structure) ) ? '0' : '1'; -if ( function_exists( 'cftf_is_filter' ) && cftf_is_filter() ) { +if (function_exists('cftf_is_filter') && cftf_is_filter()) { $body_classes[] = 'filters-on'; } -$theme_url = trailingslashit( get_template_directory_uri() ); +$theme_url = trailingslashit(get_template_directory_uri()); $title = ''; -if ( is_home() || is_front_page() ) { - $title = __( 'Home', 'capsule' ); -} elseif ( function_exists( 'cftf_is_filter' ) && cftf_is_filter() ) { - $title = __( 'Filter', 'capsule' ); -} elseif ( is_search() ) { +if (is_home() || is_front_page()) { + $title = __('Home', 'capsule'); +} elseif (function_exists('cftf_is_filter') && cftf_is_filter()) { + $title = __('Filter', 'capsule'); +} elseif (is_search()) { // Translators: %s is the search term. - $title = sprintf( __( 'Search: %s', 'capsule' ), esc_html( get_query_var( 's' ) ) ); -} elseif ( is_tag() ) { + $title = sprintf(__('Search: %s', 'capsule'), esc_html(get_query_var('s'))); +} elseif (is_tag()) { $term = get_queried_object(); // Translators: %s is the taxonomy term name. - $title = sprintf( __( '#%s', 'capsule' ), $term->name ); -} elseif ( is_tax( 'projects' ) ) { + $title = sprintf(__('#%s', 'capsule'), $term->name); +} elseif (is_tax('projects')) { $term = get_queried_object(); // Translators: %s is the taxonomy term name. - $title = sprintf( __( '@%s', 'capsule' ), $term->name ); -} elseif ( is_tax( 'code' ) ) { + $title = sprintf(__('@%s', 'capsule'), $term->name); +} elseif (is_tax('code')) { $term = get_queried_object(); // Translators: %s is the taxonomy term name. - $title = sprintf( __( '`%s', 'capsule' ), $term->name ); -} elseif ( is_tax( 'code' ) ) { + $title = sprintf(__('`%s', 'capsule'), $term->name); +} elseif (is_tax('code')) { $term = get_queried_object(); // Translators: %s is the taxonomy term name. - $title = sprintf( __( '`%s', 'capsule' ), $term->name ); -} elseif ( is_author() ) { + $title = sprintf(__('`%s', 'capsule'), $term->name); +} elseif (is_author()) { $author = get_queried_object(); // Translators: %s is the author name. - $title = sprintf( __( 'Author: %s', 'capsule' ), $author->display_name ); + $title = sprintf(__('Author: %s', 'capsule'), $author->display_name); } -$title = apply_filters( 'capsule_page_title', $title ); +$title = apply_filters('capsule_page_title', $title); ?> - + <?php - wp_title( '|', true, 'right' ); - echo esc_html( get_bloginfo( 'name' ), 1 ) . esc_html( $title_description ); + wp_title('|', true, 'right'); + echo esc_html(get_bloginfo('name'), 1) . esc_html($title_description); ?> - - - - - + + + + + -> +>
    @@ -122,11 +168,22 @@
    - + - max_num_pages > 1 ) : ?> + max_num_pages > 1) : ?> - -

    + +

    + +

    -

    +

      '' . __( '(none)', 'capsule' ) . '', + 'show_option_none' => '' . __('(none)', 'capsule') . '', 'taxonomy' => 'projects', 'title_li' => '', ) ); - ?> + ?>
    -

    +

      '' . __( '(none)', 'capsule' ) . '', + 'show_option_none' => '' . __('(none)', 'capsule') . '', 'taxonomy' => 'post_tag', 'title_li' => '', ) ); - ?> + ?>
    -

    +

    -
    +
    - -
    unfiltered_html capability to work as expected. Learn more.', 'capsule' ); ?>
    + +
    + +
    diff --git a/ui/lib/cf-gatekeeper/cf-gatekeeper.php b/ui/lib/cf-gatekeeper/cf-gatekeeper.php index 23980a4..3158a59 100644 --- a/ui/lib/cf-gatekeeper/cf-gatekeeper.php +++ b/ui/lib/cf-gatekeeper/cf-gatekeeper.php @@ -3,7 +3,7 @@ * Plugin Name: CF Gatekeeper * Description: Redirect to login page if the user is not logged in. * Author: CrowdFavorite - * Author URI: http://crowdfavorite.com + * Author URI: https://crowdfavorite.com * Version: 1.8.3-dev * * @package cf-gatekeeper @@ -162,7 +162,7 @@ function cfgk_request_handler() { } // Redirect properly, with a message id. - wp_redirect( + wp_safe_redirect( basename( $_SERVER['SCRIPT_NAME'] ) . sprintf( '?page=%1$s&updated=true&message=%2%s', $page, $message_id ) ); @@ -170,7 +170,7 @@ function cfgk_request_handler() { } // Nothing updated. - wp_redirect( basename( $_SERVER['SCRIPT_NAME'] ) . '?page=' . $page ); + wp_safe_redirect( basename( $_SERVER['SCRIPT_NAME'] ) . '?page=' . $page ); exit; default: break; diff --git a/ui/lib/php-markdown/markdown.php b/ui/lib/php-markdown/markdown.php index b573bc5..3b24717 100644 --- a/ui/lib/php-markdown/markdown.php +++ b/ui/lib/php-markdown/markdown.php @@ -3,11 +3,11 @@ # Markdown Extra - A text-to-HTML conversion tool for web writers # # PHP Markdown & Extra -# Copyright (c) 2004-2009 Michel Fortin +# Copyright (c) 2004-2009 Michel Fortin # # # Original Markdown -# Copyright (c) 2004-2006 John Gruber +# Copyright (c) 2004-2006 John Gruber # # @@ -79,7 +79,7 @@ function Markdown($text) { if (isset($wp_version)) { # More details about how it works here: # - + # Post content and excerpts # - Remove WordPress paragraph generator. # - Run Markdown on excerpt, then remove all tags. @@ -94,13 +94,13 @@ function Markdown($text) { add_filter('get_the_excerpt', 'trim', 7); add_filter('the_excerpt', 'mdwp_add_p'); add_filter('the_excerpt_rss', 'mdwp_strip_p'); - + remove_filter('content_save_pre', 'balanceTags', 50); remove_filter('excerpt_save_pre', 'balanceTags', 50); add_filter('the_content', 'balanceTags', 50); add_filter('get_the_excerpt', 'balanceTags', 9); } - + # Add a footnote id prefix to posts when inside a loop. function mdwp_MarkdownPost($text) { static $parser; @@ -115,7 +115,7 @@ function mdwp_MarkdownPost($text) { } return $parser->transform($text); } - + # Comments # - Remove WordPress paragraph generator. # - Remove WordPress auto-link generator. @@ -130,7 +130,7 @@ function mdwp_MarkdownPost($text) { add_filter('get_comment_text', 'Markdown', 6); add_filter('get_comment_excerpt', 'Markdown', 6); add_filter('get_comment_excerpt', 'mdwp_strip_p', 7); - + global $mdwp_hidden_tags, $mdwp_placeholders; $mdwp_hidden_tags = explode(' ', '

     
  • '); @@ -138,7 +138,7 @@ function mdwp_MarkdownPost($text) { 'pEj07ZbbBZ U1kqgh4w4p pre2zmeN6K QTi31t9pre ol0MP1jzJR '. 'ML5IjmbRol ulANi1NsGY J7zRLJqPul liA8ctl16T K9nhooUHli')); } - + function mdwp_add_p($text) { if (!preg_match('{^$|^<(p|ul|ol|dl|pre|blockquote)>}i', $text)) { $text = '

    '.$text.'

    '; @@ -146,7 +146,7 @@ function mdwp_add_p($text) { } return $text; } - + function mdwp_strip_p($t) { return preg_replace('{}i', '', $t); } function mdwp_hide_tags($text) { @@ -218,7 +218,7 @@ class Markdown_Parser { # Needed to insert a maximum bracked depth while converting to PHP. var $nested_brackets_depth = 6; var $nested_brackets_re; - + var $nested_url_parenthesis_depth = 4; var $nested_url_parenthesis_re; @@ -229,11 +229,11 @@ class Markdown_Parser { # Change to ">" for HTML output. var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX; var $tab_width = MARKDOWN_TAB_WIDTH; - + # Change to `true` to disallow markup or entities. var $no_markup = false; var $no_entities = false; - + # Predefined urls and titles for reference links and images. var $predef_urls = array(); var $predef_titles = array(); @@ -245,17 +245,17 @@ function __construct() { # $this->_initDetab(); $this->prepareItalicsAndBold(); - - $this->nested_brackets_re = + + $this->nested_brackets_re = str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth). str_repeat('\])*', $this->nested_brackets_depth); - - $this->nested_url_parenthesis_re = + + $this->nested_url_parenthesis_re = str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth). str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth); - + $this->escape_chars_re = '['.preg_quote($this->escape_chars).']'; - + # Sort document, block, and span gamut in ascendent priority order. asort($this->document_gamut); asort($this->block_gamut); @@ -267,27 +267,27 @@ function __construct() { var $urls = array(); var $titles = array(); var $html_hashes = array(); - + # Status flag to avoid invalid nesting. var $in_anchor = false; - - + + function setup() { # - # Called before the transformation process starts to setup parser + # Called before the transformation process starts to setup parser # states. # # Clear global hashes. $this->urls = $this->predef_urls; $this->titles = $this->predef_titles; $this->html_hashes = array(); - + $in_anchor = false; } - + function teardown() { # - # Called after the transformation process to clear any variable + # Called after the transformation process to clear any variable # which may be taking up memory unnecessarly. # $this->urls = array(); @@ -302,7 +302,7 @@ function transform($text) { # and pass it through the document gamut. # $this->setup(); - + # Remove UTF-8 BOM and marker character in input, if present. $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); @@ -329,16 +329,16 @@ function transform($text) { foreach ($this->document_gamut as $method => $priority) { $text = $this->$method($text); } - + $this->teardown(); return $text . "\n"; } - + var $document_gamut = array( # Strip link definitions, store in hashes. "stripLinkDefinitions" => 20, - + "runBasicBlockGamut" => 30, ); @@ -399,8 +399,8 @@ function hashHTMLBlocks($text) { # hard-coded: # # * List "a" is made of tags which can be both inline or block-level. - # These will be treated block-level when the start tag is alone on - # its line, otherwise they're not matched here and will be taken as + # These will be treated block-level when the start tag is alone on + # its line, otherwise they're not matched here and will be taken as # inline later. # * List "b" is made of tags which are always block-level; # @@ -422,7 +422,7 @@ function hashHTMLBlocks($text) { | \'[^\']*\' # text inside single quotes (tolerate ">") )* - )? + )? '; $content = str_repeat(' @@ -439,7 +439,7 @@ function hashHTMLBlocks($text) { str_repeat(' # closing nested tag ) - | + | <(?!/\2\s*> # other tags with a different name ) )*', @@ -465,9 +465,9 @@ function hashHTMLBlocks($text) { ) ( # save in $1 - # Match from `\n` to `\n`, handling nested tags + # Match from `\n` to `\n`, handling nested tags # in between. - + [ ]{0,'.$less_than_tab.'} <('.$block_tags_b_re.')# start tag = $2 '.$attr.'> # attributes followed by > and \n @@ -485,28 +485,28 @@ function hashHTMLBlocks($text) { # the matching end tag [ ]* # trailing spaces/tabs (?=\n+|\Z) # followed by a newline or end of document - - | # Special case just for
    . It was easier to make a special + + | # Special case just for
    . It was easier to make a special # case than to make the other regex more complicated. - + [ ]{0,'.$less_than_tab.'} <(hr) # start tag = $2 '.$attr.' # attributes /?> # the matching end tag [ ]* (?=\n{2,}|\Z) # followed by a blank line or end of document - + | # Special case for standalone HTML comments: - + [ ]{0,'.$less_than_tab.'} (?s: ) [ ]* (?=\n{2,}|\Z) # followed by a blank line or end of document - + | # PHP and ASP-style processor instructions (hashBlock($text); return "\n\n$key\n\n"; } - - + + function hashPart($text, $boundary = 'X') { # - # Called whenever a tag must be hashed when a function insert an atomic + # Called whenever a tag must be hashed when a function insert an atomic # element in the text stream. Passing $text to through this function gives # a unique text-token which will be reverted back when calling unhash. # @@ -544,7 +544,7 @@ function hashPart($text, $boundary = 'X') { # Swap back any tag hash found in $text so we do not have to `unhash` # multiple times at the end. $text = $this->unhash($text); - + # Then hash the block. static $i = 0; $key = "$boundary\x1A" . ++$i . $boundary; @@ -568,7 +568,7 @@ function hashBlock($text) { # "doHeaders" => 10, "doHorizontalRules" => 20, - + "doLists" => 40, "doCodeBlocks" => 50, "doBlockQuotes" => 60, @@ -578,33 +578,33 @@ function runBlockGamut($text) { # # Run block gamut tranformations. # - # We need to escape raw HTML in Markdown source before doing anything - # else. This need to be done for each block, and not only at the + # We need to escape raw HTML in Markdown source before doing anything + # else. This need to be done for each block, and not only at the # begining in the Markdown function since hashed blocks can be part of - # list items and could have been indented. Indented blocks would have + # list items and could have been indented. Indented blocks would have # been seen as a code block in a previous pass of hashHTMLBlocks. $text = $this->hashHTMLBlocks($text); - + return $this->runBasicBlockGamut($text); } - + function runBasicBlockGamut($text) { # - # Run block gamut tranformations, without hashing HTML blocks. This is + # Run block gamut tranformations, without hashing HTML blocks. This is # useful when HTML blocks are known to be already hashed, like in the first # whole-document pass. # foreach ($this->block_gamut as $method => $priority) { $text = $this->$method($text); } - + # Finally form paragraph and restore hashed blocks. $text = $this->formParagraphs($text); return $text; } - - + + function doHorizontalRules($text) { # Do Horizontal Rules: return preg_replace( @@ -618,7 +618,7 @@ function doHorizontalRules($text) { [ ]* # Tailing spaces $ # End of line. }mx', - "\n".$this->hashBlock("empty_element_suffix")."\n", + "\n".$this->hashBlock("empty_element_suffix")."\n", $text); } @@ -636,7 +636,7 @@ function doHorizontalRules($text) { # because ![foo][f] looks like an anchor. "doImages" => 10, "doAnchors" => 20, - + # Make links out of things like `` # Must come after doAnchors, because you can use < and > # delimiters in inline links like [this](). @@ -657,11 +657,11 @@ function runSpanGamut($text) { return $text; } - - + + function doHardBreaks($text) { # Do hard breaks: - return preg_replace_callback('/ {2,}\n/', + return preg_replace_callback('/ {2,}\n/', array(&$this, '_doHardBreaks_callback'), $text); } function _doHardBreaks_callback($matches) { @@ -675,7 +675,7 @@ function doAnchors($text) { # if ($this->in_anchor) return $text; $this->in_anchor = true; - + # # First, handle reference-style links: [link text] [id] # @@ -748,7 +748,7 @@ function _doAnchors_reference_callback($matches) { # for shortcut links like [this][] or [this]. $link_id = $link_text; } - + # lower-case and turn embedded newlines into spaces $link_id = strtolower($link_id); $link_id = preg_replace('{[ ]?\n}', ' ', $link_id); @@ -756,14 +756,14 @@ function _doAnchors_reference_callback($matches) { if (isset($this->urls[$link_id])) { $url = $this->urls[$link_id]; $url = $this->encodeAttribute($url); - + $result = "titles[$link_id] ) ) { $title = $this->titles[$link_id]; $title = $this->encodeAttribute($title); $result .= " title=\"$title\""; } - + $link_text = $this->runSpanGamut($link_text); $result .= ">$link_text"; $result = $this->hashPart($result); @@ -786,7 +786,7 @@ function _doAnchors_inline_callback($matches) { $title = $this->encodeAttribute($title); $result .= " title=\"$title\""; } - + $link_text = $this->runSpanGamut($link_text); $result .= ">$link_text"; @@ -815,7 +815,7 @@ function doImages($text) { \] ) - }xs', + }xs', array(&$this, '_doImages_reference_callback'), $text); # @@ -900,7 +900,7 @@ function doHeaders($text) { # Setext-style headers: # Header 1 # ======== - # + # # Header 2 # -------- # @@ -930,7 +930,7 @@ function _doHeaders_callback_setext($matches) { # Terrible hack to check we haven't found an empty list item. if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1])) return $matches[0]; - + $level = $matches[2]{0} == '=' ? 1 : 2; $block = "".$this->runSpanGamut($matches[1]).""; return "\n" . $this->hashBlock($block) . "\n\n"; @@ -986,10 +986,10 @@ function doLists($text) { ) ) '; // mx - + # We use a different prefix before nested lists than top-level lists. # See extended comment in _ProcessListItems(). - + if ($this->list_level) { $text = preg_replace_callback('{ ^ @@ -1013,15 +1013,15 @@ function _doLists_callback($matches) { $marker_ul_re = '[*+-]'; $marker_ol_re = '\d+[.]'; $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)"; - + $list = $matches[1]; $list_type = preg_match("/$marker_ul_re/", $matches[4]) ? "ul" : "ol"; - + $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re ); - + $list .= "\n"; $result = $this->processListItems($list, $marker_any_re); - + $result = $this->hashBlock("<$list_type>\n" . $result . ""); return "\n". $result ."\n\n"; } @@ -1053,7 +1053,7 @@ function processListItems($list_str, $marker_any_re) { # without resorting to mind-reading. Perhaps the solution is to # change the syntax rules such that sub-lists must start with a # starting cardinal number; e.g. "1." or "a.". - + $this->list_level++; # trim trailing blank lines: @@ -1081,7 +1081,7 @@ function _processListItems_callback($matches) { $marker_space = $matches[3]; $tailing_blank_line =& $matches[5]; - if ($leading_line || $tailing_blank_line || + if ($leading_line || $tailing_blank_line || preg_match('/\n{2,}/', $item)) { # Replace marker with the appropriate whitespace indentation @@ -1156,7 +1156,7 @@ function makeCodeSpan($code) { '___' => '(?<=\S|^)(?em_strong_prepared_relist["$em$strong"] = $token_re; } } } - + function doItalicsAndBold($text) { $token_stack = array(''); $text_stack = array(''); $em = ''; $strong = ''; $tree_char_em = false; - + while (1) { # # Get prepared regular expression for seraching emphasis tokens # in current context. # $token_re = $this->em_strong_prepared_relist["$em$strong"]; - + # - # Each loop iteration search for the next emphasis token. + # Each loop iteration search for the next emphasis token. # Each token is then passed to handleSpanToken. # $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); $text_stack[0] .= $parts[0]; $token =& $parts[1]; $text =& $parts[2]; - + if (empty($token)) { # Reached end of text span: empty stack without emitting. # any more emphasis. @@ -1211,7 +1211,7 @@ function doItalicsAndBold($text) { } break; } - + $token_len = strlen($token); if ($tree_char_em) { # Reached closing marker while inside a three-char emphasis. @@ -1250,7 +1250,7 @@ function doItalicsAndBold($text) { $$tag = ''; # $$tag stands for $em or $strong } } else { - # Reached opening three-char emphasis marker. Push on token + # Reached opening three-char emphasis marker. Push on token # stack; will be handled by the special condition above. $em = $token{0}; $strong = "$em$em"; @@ -1324,9 +1324,9 @@ function _doBlockQuotes_callback($matches) { $bq = $this->runBlockGamut($bq); # recurse $bq = preg_replace('/^/m', " ", $bq); - # These leading spaces cause problem with
     content, 
    +		# These leading spaces cause problem with 
     content,
     		# so we need to fix that:
    -		$bq = preg_replace_callback('{(\s*
    .+?
    )}sx', + $bq = preg_replace_callback('{(\s*
    .+?
    )}sx', array(&$this, '_doBlockQuotes_callback2'), $bq); return "\n". $this->hashBlock("
    \n$bq\n
    ")."\n\n"; @@ -1389,7 +1389,7 @@ function formParagraphs($text) { // # We can't call Markdown(), because that resets the hash; // # that initialization code should be pulled into its own sub, though. // $div_content = $this->hashHTMLBlocks($div_content); -// +// // # Run document gamut methods on the content. // foreach ($this->document_gamut as $method => $priority) { // $div_content = $this->$method($div_content); @@ -1417,11 +1417,11 @@ function encodeAttribute($text) { $text = str_replace('"', '"', $text); return $text; } - - + + function encodeAmpsAndAngles($text) { # - # Smart processing for ampersands and angle brackets that need to + # Smart processing for ampersands and angle brackets that need to # be encoded. Valid character entities are left alone unless the # no-entities mode is set. # @@ -1430,7 +1430,7 @@ function encodeAmpsAndAngles($text) { } else { # Ampersand-encoding based entirely on Nat Irons's Amputator # MT plugin: - $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', + $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/', '&', $text);; } # Encode remaining <'s @@ -1441,7 +1441,7 @@ function encodeAmpsAndAngles($text) { function doAutoLinks($text) { - $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i', + $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i', array(&$this, '_doAutoLinks_url_callback'), $text); # Email addresses: @@ -1498,7 +1498,7 @@ function encodeEmailAddress($addr) { $addr = "mailto:" . $addr; $chars = preg_split('/(? $char) { $ord = ord($char); # Ignore non-ascii chars. @@ -1511,7 +1511,7 @@ function encodeEmailAddress($addr) { else $chars[$key] = '&#'.$ord.';'; } } - + $addr = implode('', $chars); $text = implode('', array_slice($chars, 7)); # text without `mailto:` $addr = "$text"; @@ -1526,7 +1526,7 @@ function parseSpan($str) { # escaped characters and handling code spans. # $output = ''; - + $span_re = '{ ( \\\\'.$this->escape_chars_re.' @@ -1551,17 +1551,17 @@ function parseSpan($str) { while (1) { # - # Each loop iteration seach for either the next tag, the next - # openning code span marker, or the next escaped character. + # Each loop iteration seach for either the next tag, the next + # openning code span marker, or the next escaped character. # Each token is then passed to handleSpanToken. # $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE); - + # Create token from text preceding tag. if ($parts[0] != "") { $output .= $parts[0]; } - + # Check if we reach the end. if (isset($parts[1])) { $output .= $this->handleSpanToken($parts[1], $parts[2]); @@ -1571,14 +1571,14 @@ function parseSpan($str) { break; } } - + return $output; } - - + + function handleSpanToken($token, &$str) { # - # Handle $token provided by parseSpan by determining its nature and + # Handle $token provided by parseSpan by determining its nature and # returning the corresponding value that should replace it. # switch ($token{0}) { @@ -1586,7 +1586,7 @@ function handleSpanToken($token, &$str) { return $this->hashPart("&#". ord($token{1}). ";"); case "`": # Search for end marker in remaining text. - if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', + if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm', $str, $matches)) { $str = $matches[2]; @@ -1608,18 +1608,18 @@ function outdent($text) { } - # String length function for detab. `_initDetab` will create a function to + # String length function for detab. `_initDetab` will create a function to # hanlde UTF-8 if the default function does not exist. var $utf8_strlen = 'mb_strlen'; - + function detab($text) { # # Replace tabs with the appropriate amount of space. # # For each line we separate the line in blocks delemited by - # tab characters. Then we reconstruct every line by adding the + # tab characters. Then we reconstruct every line by adding the # appropriate number of space between each blocks. - + $text = preg_replace_callback('/^.*\t.*$/m', array(&$this, '_detab_callback'), $text); @@ -1628,7 +1628,7 @@ function detab($text) { function _detab_callback($matches) { $line = $matches[0]; $strlen = $this->utf8_strlen; # strlen function for UTF-8. - + # Split in blocks. $blocks = explode("\t", $line); # Add each blocks to the line. @@ -1636,7 +1636,7 @@ function _detab_callback($matches) { unset($blocks[0]); # Do not add first block twice. foreach ($blocks as $block) { # Calculate amount of space, insert spaces, insert block. - $amount = $this->tab_width - + $amount = $this->tab_width - $strlen($line, 'UTF-8') % $this->tab_width; $line .= str_repeat(" ", $amount) . $block; } @@ -1645,13 +1645,13 @@ function _detab_callback($matches) { function _initDetab() { # # Check for the availability of the function in the `utf8_strlen` property - # (initially `mb_strlen`). If the function is not available, create a + # (initially `mb_strlen`). If the function is not available, create a # function that will loosely count the number of UTF-8 characters with a # regular expression. # if (function_exists($this->utf8_strlen)) return; $this->utf8_strlen = create_function('$text', 'return preg_match_all( - "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", + "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/", $text, $m);'); } @@ -1660,7 +1660,7 @@ function unhash($text) { # # Swap back in all the tags hashed by _HashHTMLBlocks. # - return preg_replace_callback('/(.)\x1A[0-9]+\1/', + return preg_replace_callback('/(.)\x1A[0-9]+\1/', array(&$this, '_unhash_callback'), $text); } function _unhash_callback($matches) { @@ -1678,15 +1678,15 @@ class MarkdownExtra_Parser extends Markdown_Parser { # Prefix for footnote ids. var $fn_id_prefix = ""; - + # Optional title attribute for footnote links and backlinks. var $fn_link_title = MARKDOWN_FN_LINK_TITLE; var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE; - + # Optional class attribute for footnote links and backlinks. var $fn_link_class = MARKDOWN_FN_LINK_CLASS; var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS; - + # Predefined abbreviations. var $predef_abbr = array(); @@ -1695,11 +1695,11 @@ function __construct() { # # Constructor function. Initialize the parser object. # - # Add extra escapable characters before parent constructor + # Add extra escapable characters before parent constructor # initialize the table. $this->escape_chars .= ':|'; - - # Insert extra document, block, and span transformations. + + # Insert extra document, block, and span transformations. # Parent constructor will do the sorting. $this->document_gamut += array( "doFencedCodeBlocks" => 5, @@ -1716,33 +1716,33 @@ function __construct() { "doFootnotes" => 5, "doAbbreviations" => 70, ); - + parent::__construct(); } - - + + # Extra variables used during extra transformations. var $footnotes = array(); var $footnotes_ordered = array(); var $abbr_desciptions = array(); var $abbr_word_re = ''; - + # Give the current footnote number. var $footnote_counter = 1; - - + + function setup() { # # Setting up Extra-specific variables. # parent::setup(); - + $this->footnotes = array(); $this->footnotes_ordered = array(); $this->abbr_desciptions = array(); $this->abbr_word_re = ''; $this->footnote_counter = 1; - + foreach ($this->predef_abbr as $abbr_word => $abbr_desc) { if ($this->abbr_word_re) $this->abbr_word_re .= '|'; @@ -1750,7 +1750,7 @@ function setup() { $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); } } - + function teardown() { # # Clearing Extra-specific variables. @@ -1759,29 +1759,29 @@ function teardown() { $this->footnotes_ordered = array(); $this->abbr_desciptions = array(); $this->abbr_word_re = ''; - + parent::teardown(); } - - + + ### HTML Block Parser ### - + # Tags that are always treated as block tags: var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend'; - + # Tags treated as block tags only if the opening tag is alone on it's line: var $context_block_tags_re = 'script|noscript|math|ins|del'; - + # Tags where markdown="1" default to span mode: var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address'; - - # Tags which must not have their contents modified, no matter where + + # Tags which must not have their contents modified, no matter where # they appear: var $clean_tags_re = 'script|math'; - + # Tags that do not need to be closed. var $auto_close_tags_re = 'hr|img'; - + function hashHTMLBlocks($text) { # @@ -1794,7 +1794,7 @@ function hashHTMLBlocks($text) { # hard-coded. # # This works by calling _HashHTMLBlocks_InMarkdown, which then calls - # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" + # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1" # attribute is found whitin a tag, _HashHTMLBlocks_InHTML calls back # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag. # These two functions are calling each other. It's recursive! @@ -1803,17 +1803,17 @@ function hashHTMLBlocks($text) { # Call the HTML-in-Markdown hasher. # list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text); - + return $text; } - function _hashHTMLBlocks_inMarkdown($text, $indent = 0, + function _hashHTMLBlocks_inMarkdown($text, $indent = 0, $enclosing_tag_re = '', $span = false) { # # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags. # - # * $indent is the number of space to be ignored when checking for code - # blocks. This is important because if we don't take the indent into + # * $indent is the number of space to be ignored when checking for code + # blocks. This is important because if we don't take the indent into # account, something like this (which looks right) won't work as expected: # #
    @@ -1825,11 +1825,11 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, # If you don't like this, just don't indent the tag on which # you apply the markdown="1" attribute. # - # * If $enclosing_tag_re is not empty, stops at the first unmatched closing + # * If $enclosing_tag_re is not empty, stops at the first unmatched closing # tag with that name. Nested tags supported. # - # * If $span is true, text inside must treated as span. So any double - # newline will be replaced by a single newline so that it does not create + # * If $span is true, text inside must treated as span. So any double + # newline will be replaced by a single newline so that it does not create # paragraphs. # # Returns an array of that form: ( processed text , remaining text ) @@ -1838,13 +1838,13 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, # Regex to check for the presense of newlines around a block tag. $newline_before_re = '/(?:^\n?|\n\n)*$/'; - $newline_after_re = + $newline_after_re = '{ ^ # Start of text following the tag. (?>[ ]*)? # Optional comment. [ ]*\n # Must be followed by newline. }xs'; - + # Regex to match any tag. $block_tag_re = '{ @@ -1890,7 +1890,7 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, ) }xs'; - + $depth = 0; # Current depth inside the tag tree. $parsed = ""; # Parsed text that will be returned. @@ -1902,32 +1902,32 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, # # Split the text using the first $tag_match pattern found. # Text before pattern will be first in the array, text after - # pattern will be at the end, and between will be any catches made + # pattern will be at the end, and between will be any catches made # by the pattern. # - $parts = preg_split($block_tag_re, $text, 2, + $parts = preg_split($block_tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); - - # If in Markdown span mode, add a empty-string span-level hash + + # If in Markdown span mode, add a empty-string span-level hash # after each newline to prevent triggering any block element. if ($span) { $void = $this->hashPart("", ':'); $newline = "$void\n"; $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void; } - + $parsed .= $parts[0]; # Text before current tag. - + # If end of $text has been reached. Stop loop. if (count($parts) < 3) { $text = ""; break; } - + $tag = $parts[1]; # Tag to handle. $text = $parts[2]; # Remaining text after current tag. $tag_re = preg_quote($tag); # For use in a regular expression. - + # # Check for: Code span marker # @@ -1950,7 +1950,7 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, # Check for: Indented code block. # else if ($tag{0} == "\n" || $tag{0} == " ") { - # Indented code block: pass it unchanged, will be handled + # Indented code block: pass it unchanged, will be handled # later. $parsed .= $tag; } @@ -1960,8 +1960,8 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, else if ($tag{0} == "~") { # Fenced code block marker: find matching end marker. $tag_re = preg_quote(trim($tag)); - if (preg_match('{^(?>.*\n)+?'.$tag_re.' *\n}', $text, - $matches)) + if (preg_match('{^(?>.*\n)+?'.$tag_re.' *\n}', $text, + $matches)) { # End marker found: pass text unchanged until marker. $parsed .= $tag . $matches[0]; @@ -1974,7 +1974,7 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, } # # Check for: Opening Block level tag or - # Opening Context Block tag (like ins and del) + # Opening Context Block tag (like ins and del) # used as a block tag (tag is alone on it's line). # else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) || @@ -1984,9 +1984,9 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, ) { # Need to parse tag and following text using the HTML parser. - list($block_text, $text) = + list($block_text, $text) = $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true); - + # Make sure it stays outside of any paragraph by adding newlines. $parsed .= "\n\n$block_text\n\n"; } @@ -1999,9 +1999,9 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, { # Need to parse tag and following text using the HTML parser. # (don't check for markdown attribute) - list($block_text, $text) = + list($block_text, $text) = $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false); - + $parsed .= $block_text; } # @@ -2025,14 +2025,14 @@ function _hashHTMLBlocks_inMarkdown($text, $indent = 0, $text = $tag . $text; break; } - + $parsed .= $tag; } else { $parsed .= $tag; } } while ($depth >= 0); - + return array($parsed, $text); } function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { @@ -2047,7 +2047,7 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { # Returns an array of that form: ( processed text , remaining text ) # if ($text === '') return array('', ''); - + # Regex to match `markdown` attribute inside of a tag. $markdown_attr_re = ' { @@ -2055,15 +2055,15 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { markdown \s*=\s* (?> - (["\']) # $1: quote delimiter + (["\']) # $1: quote delimiter (.*?) # $2: attribute value - \1 # matching delimiter + \1 # matching delimiter | ([^\s>]*) # $3: unquoted attribute value ) () # $4: make $3 always defined (avoid warnings) }xs'; - + # Regex to match any tag. $tag_re = '{ ( # $2: Capture hole tag. @@ -2086,9 +2086,9 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { # CData Block ) }xs'; - + $original_text = $text; # Save original text in case of faliure. - + $depth = 0; # Current depth inside the tag tree. $block_text = ""; # Temporary text holder for current text. $parsed = ""; # Parsed text that will be returned. @@ -2107,25 +2107,25 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { # # Split the text using the first $tag_match pattern found. # Text before pattern will be first in the array, text after - # pattern will be at the end, and between will be any catches made + # pattern will be at the end, and between will be any catches made # by the pattern. # $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE); - + if (count($parts) < 3) { # # End of $text reached with unbalenced tag(s). # In that case, we return original text unchanged and pass the - # first character as filtered to prevent an infinite loop in the + # first character as filtered to prevent an infinite loop in the # parent function. # return array($original_text{0}, substr($original_text, 1)); } - + $block_text .= $parts[0]; # Text before current tag. $tag = $parts[1]; # Tag to handle. $text = $parts[2]; # Remaining text after current tag. - + # # Check for: Auto-close tag (like
    ) # Comments and Processing Instructions. @@ -2145,22 +2145,22 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { if ($tag{1} == '/') $depth--; else if ($tag{strlen($tag)-2} != '/') $depth++; } - + # # Check for `markdown="1"` attribute and handle it. # - if ($md_attr && + if ($md_attr && preg_match($markdown_attr_re, $tag, $attr_m) && preg_match('/^1|block|span$/', $attr_m[2] . $attr_m[3])) { # Remove `markdown` attribute from opening tag. $tag = preg_replace($markdown_attr_re, '', $tag); - + # Check if text inside this tag must be parsed in span mode. $this->mode = $attr_m[2] . $attr_m[3]; $span_mode = $this->mode == 'span' || $this->mode != 'block' && preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag); - + # Calculate indent before tag. if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) { $strlen = $this->utf8_strlen; @@ -2168,44 +2168,44 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { } else { $indent = 0; } - + # End preceding block with this tag. $block_text .= $tag; $parsed .= $this->$hash_method($block_text); - + # Get enclosing tag name for the ParseMarkdown function. # (This pattern makes $tag_name_re safe without quoting.) preg_match('/^<([\w:$]*)\b/', $tag, $matches); $tag_name_re = $matches[1]; - + # Parse the content using the HTML-in-Markdown parser. list ($block_text, $text) - = $this->_hashHTMLBlocks_inMarkdown($text, $indent, + = $this->_hashHTMLBlocks_inMarkdown($text, $indent, $tag_name_re, $span_mode); - + # Outdent markdown text. if ($indent > 0) { - $block_text = preg_replace("/^[ ]{1,$indent}/m", "", + $block_text = preg_replace("/^[ ]{1,$indent}/m", "", $block_text); } - + # Append tag content to parsed text. if (!$span_mode) $parsed .= "\n\n$block_text\n\n"; else $parsed .= "$block_text"; - + # Start over a new block. $block_text = ""; } else $block_text .= $tag; } - + } while ($depth > 0); - + # # Hash last block text that wasn't processed inside the loop. # $parsed .= $this->$hash_method($block_text); - + return array($parsed, $text); } @@ -2213,7 +2213,7 @@ function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) { function hashClean($text) { # # Called whenever a tag must be hashed when a function insert a "clean" tag - # in $text, it pass through this function and is automaticaly escaped, + # in $text, it pass through this function and is automaticaly escaped, # blocking invalid nested overlap. # return $this->hashPart($text, 'C'); @@ -2227,7 +2227,7 @@ function doHeaders($text) { # Setext-style headers: # Header 1 {#header1} # ======== - # + # # Header 2 {#header2} # -------- # @@ -2248,7 +2248,7 @@ function doHeaders($text) { # $text = preg_replace_callback('{ ^(\#{1,6}) # $1 = string of #\'s - [ ]* + [ ]+ (.+?) # $2 = Header text [ ]* \#* # optional closing #\'s (not counted) @@ -2299,10 +2299,10 @@ function doTables($text) { [ ]{0,'.$less_than_tab.'} # Allowed whitespace. [|] # Optional leading pipe (present) (.+) \n # $1: Header row (at least one pipe) - + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline - + ( # $3: Cells (?> [ ]* # Allowed whitespace. @@ -2312,7 +2312,7 @@ function doTables($text) { (?=\n|\Z) # Stop at final double newline. }xm', array(&$this, '_doTable_leadingPipe_callback'), $text); - + # # Find tables without leading pipe. # @@ -2326,10 +2326,10 @@ function doTables($text) { ^ # Start of a line [ ]{0,'.$less_than_tab.'} # Allowed whitespace. (\S.*[|].*) \n # $1: Header row (at least one pipe) - + [ ]{0,'.$less_than_tab.'} # Allowed whitespace. ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline - + ( # $3: Cells (?> .* [|] .* \n # Row content @@ -2345,10 +2345,10 @@ function _doTable_leadingPipe_callback($matches) { $head = $matches[1]; $underline = $matches[2]; $content = $matches[3]; - + # Remove leading pipe for each row. $content = preg_replace('/^ *[|]/m', '', $content); - + return $this->_doTable_callback(array($matches[0], $head, $underline, $content)); } function _doTable_callback($matches) { @@ -2360,7 +2360,7 @@ function _doTable_callback($matches) { $head = preg_replace('/[|] *$/m', '', $head); $underline = preg_replace('/[|] *$/m', '', $underline); $content = preg_replace('/[|] *$/m', '', $content); - + # Reading alignement from header underline. $separators = preg_split('/ *[|] */', $underline); foreach ($separators as $n => $s) { @@ -2369,13 +2369,13 @@ function _doTable_callback($matches) { else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"'; else $attr[$n] = ''; } - - # Parsing span elements, including code spans, character escapes, + + # Parsing span elements, including code spans, character escapes, # and inline HTML tags, so that pipes inside those gets ignored. $head = $this->parseSpan($head); $headers = preg_split('/ *[|] */', $head); $col_count = count($headers); - + # Write column headers. $text = "\n"; $text .= "\n"; @@ -2384,20 +2384,20 @@ function _doTable_callback($matches) { $text .= " ".$this->runSpanGamut(trim($header))."\n"; $text .= "\n"; $text .= "\n"; - + # Split content by row. $rows = explode("\n", trim($content, "\n")); - + $text .= "\n"; foreach ($rows as $row) { - # Parsing span elements, including code spans, character escapes, + # Parsing span elements, including code spans, character escapes, # and inline HTML tags, so that pipes inside those gets ignored. $row = $this->parseSpan($row); - + # Split row by cell. $row_cells = preg_split('/ *[|] */', $row, $col_count); $row_cells = array_pad($row_cells, $col_count, ''); - + $text .= "\n"; foreach ($row_cells as $n => $cell) $text .= " ".$this->runSpanGamut(trim($cell))."\n"; @@ -2405,11 +2405,11 @@ function _doTable_callback($matches) { } $text .= "\n"; $text .= "
    "; - + return $this->hashBlock($text) . "\n"; } - + function doDefLists($text) { # # Form HTML definition lists. @@ -2455,7 +2455,7 @@ function doDefLists($text) { function _doDefLists_callback($matches) { # Re-usable patterns to match list item bullets and number markers: $list = $matches[1]; - + # Turn double returns into triple returns, so that we can make a # paragraph for the last item in a list, if necessary: $result = trim($this->processDefListItems($list)); @@ -2470,7 +2470,7 @@ function processDefListItems($list_str) { # into individual term and definition list items. # $less_than_tab = $this->tab_width - 1; - + # trim trailing blank lines: $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str); @@ -2479,11 +2479,11 @@ function processDefListItems($list_str) { (?>\A\n?|\n\n+) # leading line ( # definition terms = $1 [ ]{0,'.$less_than_tab.'} # leading whitespace - (?![:][ ]|[ ]) # negative lookahead for a definition + (?![:][ ]|[ ]) # negative lookahead for a definition # mark (colon) or more whitespace. - (?> \S.* \n)+? # actual term (not whitespace). - ) - (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed + (?> \S.* \n)+? # actual term (not whitespace). + ) + (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed # with a definition mark. }xm', array(&$this, '_processDefListItems_callback_dt'), $list_str); @@ -2500,8 +2500,8 @@ function processDefListItems($list_str) { (?: # next term or end of text [ ]{0,'.$less_than_tab.'} [:][ ] |
    | \z - ) - ) + ) + ) }xm', array(&$this, '_processDefListItems_callback_dd'), $list_str); @@ -2545,7 +2545,7 @@ function doFencedCodeBlocks($text) { # ~~~ # $less_than_tab = $this->tab_width; - + $text = preg_replace_callback('{ (?:\n|\A) # 1: Opening marker @@ -2553,7 +2553,7 @@ function doFencedCodeBlocks($text) { ~{3,} # Marker: three tilde or more. ) [ ]* \n # Whitespace and newline following marker. - + # 2: Content ( (?> @@ -2561,7 +2561,7 @@ function doFencedCodeBlocks($text) { .*\n+ )+ ) - + # Closing marker. \1 [ ]* \n }xm', @@ -2578,7 +2578,7 @@ function _doFencedCodeBlocks_callback($matches) { return "\n\n".$this->hashBlock($codeblock)."\n\n"; } function _doFencedCodeBlocks_newlines($matches) { - return str_repeat("empty_element_suffix", + return str_repeat("empty_element_suffix", strlen($matches[0])); } @@ -2611,7 +2611,7 @@ function formParagraphs($text) { # # Strip leading and trailing lines: $text = preg_replace('/\A\n+|\n+\z/', '', $text); - + $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY); # @@ -2619,29 +2619,29 @@ function formParagraphs($text) { # foreach ($grafs as $key => $value) { $value = trim($this->runSpanGamut($value)); - + # Check if this should be enclosed in a paragraph. # Clean tag hashes & block tag hashes are left alone. $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value); - + if ($is_p) { $value = "

    $value

    "; } $grafs[$key] = $value; } - - # Join grafs in one text, then unhash HTML tags. + + # Join grafs in one text, then unhash HTML tags. $text = implode("\n\n", $grafs); - + # Finish by removing any tag hashes still present in $text. $text = $this->unhash($text); - + return $text; } - - + + ### Footnotes - + function stripFootnotes($text) { # # Strips link definitions from text, stores the URLs and titles in @@ -2655,15 +2655,15 @@ function stripFootnotes($text) { [ ]* \n? # maybe *one* newline ( # text = $2 (no blank lines allowed) - (?: + (?: .+ # actual text | - \n # newlines but + \n # newlines but (?!\[\^.+?\]:\s)# negative lookahead for footnote marker. - (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed + (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed # by non-indented content )* - ) + ) }xm', array(&$this, '_stripFootnotes_callback'), $text); @@ -2678,7 +2678,7 @@ function _stripFootnotes_callback($matches) { function doFootnotes($text) { # - # Replace footnote references in $text [^id] with a special text-token + # Replace footnote references in $text [^id] with a special text-token # which will be replaced by the actual footnote marker in appendFootnotes. # if (!$this->in_anchor) { @@ -2687,20 +2687,20 @@ function doFootnotes($text) { return $text; } - + function appendFootnotes($text) { # # Append footnote list to text. # - $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', array(&$this, '_appendFootnotes_callback'), $text); - + if (!empty($this->footnotes_ordered)) { $text .= "\n\n"; $text .= "
    \n"; $text .= "empty_element_suffix ."\n"; $text .= "
      \n\n"; - + $attr = " rev=\"footnote\""; if ($this->fn_backlink_class != "") { $class = $this->fn_backlink_class; @@ -2713,20 +2713,20 @@ function appendFootnotes($text) { $attr .= " title=\"$title\""; } $num = 0; - + while (!empty($this->footnotes_ordered)) { $footnote = reset($this->footnotes_ordered); $note_id = key($this->footnotes_ordered); unset($this->footnotes_ordered[$note_id]); - + $footnote .= "\n"; # Need to append newline before parsing. - $footnote = $this->runBlockGamut("$footnote\n"); - $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', + $footnote = $this->runBlockGamut("$footnote\n"); + $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}', array(&$this, '_appendFootnotes_callback'), $footnote); - + $attr = str_replace("%%", ++$num, $attr); $note_id = $this->encodeAttribute($note_id); - + # Add backlink to last paragraph; create new paragraph if needed. $backlink = ""; if (preg_match('{

      $}', $footnote)) { @@ -2734,12 +2734,12 @@ function appendFootnotes($text) { } else { $footnote .= "\n\n

      $backlink

      "; } - + $text .= "
    1. \n"; $text .= $footnote . "\n"; $text .= "
    2. \n\n"; } - + $text .= "
    \n"; $text .= "
    "; } @@ -2747,14 +2747,14 @@ function appendFootnotes($text) { } function _appendFootnotes_callback($matches) { $node_id = $this->fn_id_prefix . $matches[1]; - + # Create footnote marker only if it has a corresponding footnote *and* # the footnote hasn't been used by another marker. if (isset($this->footnotes[$node_id])) { # Transfert footnote content to the ordered list. $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id]; unset($this->footnotes[$node_id]); - + $num = $this->footnote_counter++; $attr = " rel=\"footnote\""; if ($this->fn_link_class != "") { @@ -2767,22 +2767,22 @@ function _appendFootnotes_callback($matches) { $title = $this->encodeAttribute($title); $attr .= " title=\"$title\""; } - + $attr = str_replace("%%", $num, $attr); $node_id = $this->encodeAttribute($node_id); - + return "". "$num". ""; } - + return "[^".$matches[1]."]"; } - - + + ### Abbreviations ### - + function stripAbbreviations($text) { # # Strips abbreviations from text, stores titles in hash references. @@ -2792,7 +2792,7 @@ function stripAbbreviations($text) { # Link defs are in the form: [id]*: url "optional title" $text = preg_replace_callback('{ ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1 - (.*) # text = $2 (no blank lines allowed) + (.*) # text = $2 (no blank lines allowed) }xm', array(&$this, '_stripAbbreviations_callback'), $text); @@ -2807,20 +2807,20 @@ function _stripAbbreviations_callback($matches) { $this->abbr_desciptions[$abbr_word] = trim($abbr_desc); return ''; # String that will replace the block } - - + + function doAbbreviations($text) { # # Find defined abbreviations in text and wrap them in elements. # if ($this->abbr_word_re) { - // cannot use the /x modifier because abbr_word_re may + // cannot use the /x modifier because abbr_word_re may // contain significant spaces: $text = preg_replace_callback('{'. '(?abbr_word_re.')'. '(?![\w\x1A])'. - '}', + '}', array(&$this, '_doAbbreviations_callback'), $text); } return $text; @@ -2851,9 +2851,9 @@ function _doAbbreviations_callback($matches) { Description ----------- -This is a PHP port of the original Markdown formatter written in Perl -by John Gruber. This special "Extra" version of PHP Markdown features -further enhancements to the syntax for making additional constructs +This is a PHP port of the original Markdown formatter written in Perl +by John Gruber. This special "Extra" version of PHP Markdown features +further enhancements to the syntax for making additional constructs such as tables and definition list. Markdown is a text-to-HTML filter; it translates an easy-to-read / @@ -2883,7 +2883,7 @@ function _doAbbreviations_callback($matches) { Version History ---------------- +--------------- See the readme file for detailed release notes for this version. @@ -2891,14 +2891,14 @@ function _doAbbreviations_callback($matches) { Copyright and License --------------------- -PHP Markdown & Extra -Copyright (c) 2004-2009 Michel Fortin - +PHP Markdown & Extra +Copyright (c) 2004-2009 Michel Fortin + All rights reserved. -Based on Markdown -Copyright (c) 2003-2006 John Gruber - +Based on Markdown +Copyright (c) 2003-2006 John Gruber + All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/ui/package-lock.json b/ui/package-lock.json index fe52f70..d3e771e 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,56 +1,124 @@ { "name": "capsule-ui", - "version": "0.1.0", + "version": "1.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "coffee-script": { "version": "1.12.7", "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.12.7.tgz", "integrity": "sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw==" }, "commander": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz", - "integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==" + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "requirejs": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.5.tgz", - "integrity": "sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw==" + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", + "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==" }, "rimraf": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", - "integrity": "sha1-5Dm+Kq7jJzIZUnMPmaiSnk/FBYI=" - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "requires": { + "glob": "^7.1.3" + } }, "temp": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", - "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.9.1.tgz", + "integrity": "sha512-WMuOgiua1xb5R56lE0eH6ivpVmg/lq2OHm4+LtT/xtEtPQ+sz6N3bBM6WZ5FvO1lO4IKIOb43qnhoc4qxP5OeA==", "requires": { - "os-tmpdir": "1.0.2", - "rimraf": "2.2.8" + "rimraf": "~2.6.2" } }, "uglify-js": { - "version": "3.3.14", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.14.tgz", - "integrity": "sha512-OY8VPQU25q09gQRbC+Ekk3xgEVBmYFEfVcgS47ksjTiNht2LmLlUkWutyi38ZsDSToJHwbe76kDGwmD226Z2Fg==", + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.9.2.tgz", + "integrity": "sha512-zGVwKslUAD/EeqOrD1nQaBmXIHl1Vw371we8cvS8I6mYK9rmgX5tv8AAeJdfsQ3Kk5mGax2SVV/AizxdNGhl7Q==", "requires": { - "commander": "2.14.1", - "source-map": "0.6.1" + "commander": "~2.20.3" } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" } } } diff --git a/ui/package.json b/ui/package.json index f3cb74e..9a437e6 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,6 +1,6 @@ { "name": "capsule-ui", - "version": "0.1.0", + "version": "1.3.0", "devDependencies": {}, "dependencies": { "requirejs": "", diff --git a/ui/phpcs.xml b/ui/phpcs.xml new file mode 100644 index 0000000..336456d --- /dev/null +++ b/ui/phpcs.xml @@ -0,0 +1,69 @@ + + + Custom variant of PSR12 with WordPress security checks for PHP development + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */node_modules/* + */vendor/* + */dependencies/* + */lib/* + + + . + + + + + + + + + + + + diff --git a/ui/views/content.php b/ui/views/content.php index 0794e29..fdad095 100644 --- a/ui/views/content.php +++ b/ui/views/content.php @@ -1,4 +1,5 @@ -
    > + diff --git a/ui/views/deleted.php b/ui/views/deleted.php index e43d8b1..cac1843 100644 --- a/ui/views/deleted.php +++ b/ui/views/deleted.php @@ -1,4 +1,5 @@ -
    ID ); ?>> +
    ID); ?> +>
    - + + + + + +
    diff --git a/ui/views/edit.php b/ui/views/edit.php index 7e389e9..b5b1ff8 100644 --- a/ui/views/edit.php +++ b/ui/views/edit.php @@ -1,4 +1,5 @@ -
    ID ) ? ' sticky' : '' ) ); ?>> +
    ID) ? ' sticky' : '' )); ?> +>

    - : + : +

    - + + +
    diff --git a/ui/views/excerpt.php b/ui/views/excerpt.php index 12ba896..1025c11 100644 --- a/ui/views/excerpt.php +++ b/ui/views/excerpt.php @@ -1,4 +1,5 @@ -