File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/code-snippets.tar
CHANGELOG.md 0000644 00000144447 15153464547 0006411 0 ustar 00 # Changelog
## [3.6.8] (2025-02-14)
### Added
* `code_snippets/hide_welcome_banner` filter hook for hiding welcome banner in dashboard.
### Changed
* Updated Freemius SDK to the latest version. (PRO)
### Removed
* Functionality allowing `[code_snippet]` shortcodes to be embedded recursively – it will be re-added in a future version.
### Fixed
* Shortcodes embedded within `[code_snippet]` shortcodes not evaluating correctly.
* Translation functions being called too early in some instances when loading plugin settings.
* 'Generate' button not appearing on some sites. (PRO)
* Incorrect arrow entity used in cloud list table (props to [brandonjp]).
* Removed reference to missing plugins.css file in core plugin version.
## [3.6.7] (2025-01-24)
### Added
* Generated snippet shortcode tags will include the snippet name, for easier identification.
* Admin notices will dismiss automatically after five seconds. ([#208](https://github.com/codesnippetspro/code-snippets/issues/208))
### Changed
* Updated CSS to use latest Sass features.
* Moved theme selector to just above editor preview on settings page (thanks to [brandonjp]). ([#206](https://github.com/codesnippetspro/code-snippets/issues/206))
* `[code_snippet]` shortcodes can now be nested within each other. ([#198](https://github.com/codesnippetspro/code-snippets/issues/198))
### Fixed
* Save buttons above editor did not follow usual validation process in Pro. (PRO) ([#197](https://github.com/codesnippetspro/code-snippets/issues/197))
* Minor inconsistencies in consistent UI elements between Core and Pro.
* Tags input not allowing input. ([#211](https://github.com/codesnippetspro/code-snippets/issues/211))
* Issue with Elementor source code widget. (PRO) ([#205](https://github.com/codesnippetspro/code-snippets/issues/205))
* Snippet descriptions not visible when viewing cloud search results.
* Snippet import page not displaying number of successfully imported snippets.
* Use UTC time when deciding when to display campaign notices.
## [3.6.6.1] (2024-11-27)
### Fixed
* Redeployment of [v3.6.6](#366-2024-11-27) to overcome issue with initial build.
* Type issue when caching cloud links. (PRO)
## [3.6.6] (2024-11-27)
### Changed
* Improved compatability with modern versions of PHP.
* Extended welcome API to include admin notices.
* Action hook `code_snippets/update_snippet` now only includes the snippet ID instead of the full snippet object.
* Action hook `code_snippets/admin/manage` now includes the currently viewed type.
### Fixed
* Memory issue from checking aggregate posts while loading front-end syntax highlighter.
* Translation functions being called too early on upgrade, resulting in localisation loading errors.
* Bug preventing the 'share on network' status of network snippets from correctly updating.
* Incorrect logic controlling when to display 'Save Changes' or 'Save Changes and Activate' buttons.
* Old notices persisting when switching between editing and creating snippets.
## 3.6.5.1 (2024-05-24)
* Redeployment of [v3.6.5](#365-2024-05-24) to overcome issue with initial build.
## [3.6.5] (2024-05-24)
### Added
* New admin menu providing useful resources and updates on the Code Snippets plugin and community.
## [3.6.4] (2024-03-15)
### Added
* AI generation for all snippet types: HTML, CSS, JS. (PRO)
* Button to create a cloud connection directly from the Snippets menu when disconnected. (PRO)
### Changed
* Increment the revision number of CSS and JS snippet when using the 'Reset Caches' debug action. (PRO)
* UX in generate dialog, such as allowing 'Enter' to submit the form. (PRO)
### Fixed
* Minor type compatability issue with newer versions of PHP.
* Undefined array key issue when initiating cloud sync. (PRO)
* Bug preventing downloading a single snippet from a bundle. (PRO)
* Translations not loading for strings in JavaScript files.
## [3.6.3] (2023-11-13)
### Added
* Added debug action for resetting snippets caches.
### Fixed
* Import error when initialising cloud sync configuration. (PRO)
## [3.6.2] (2023-11-11)
### Removed
* Removed automatic encoding of code content.
### Fixed
* Error when attempting to save shared network snippets marked as active.
* Type error when rendering checkbox fields without a stored or default value.
* Label for snippet sharing input incorrectly linked to input field.
* Error when attempting to download export files from Edit menu.
* Issue loading Freemius string overrides too early. (PRO)
* Fix redirect URL when connecting with OAuth on subdirectory or HTTPS sites. (PRO)
* Import error when attempting to completely uninstall the plugin.
## [3.6.1] (2023-11-07)
### Fixed
* Issue accessing fields on Snippets class.
## [3.6.0] (2023-11-07)
### Added
* Ability to authenticate with Code Snippets Cloud using OAuth. (PRO)
* Integration with GPT AI for generating snippets. (PRO)
* Ability to generate line-by-line descriptions of snippet code with GPT AI. (PRO)
* Ability to generate tags and description text from existing snippet code with GPT AI. (PRO)
* Added debug settings menu for manually performing problem-solving actions.
* Filter to disable scroll-into-view functionality for edit page notices.
### Changed
* Updated minimum PHP requirement to 7.4.
* Ensure that the URL of the edit snippet page changes when adding a new snippet.
* Snippet tags will automatically be added when focus is lost on the tags field.
### Fixed
* Moved active status border on edit name field to left-hand side.
* New notices will not scroll if already at top of page.
* Potential CSRF vulnerability allowing an authenticated user to reset settings.
## [3.5.1] (2023-09-15)
### Fixed
* Undefined array key error when accessing plugin settings page. (PRO)
* Issue registering API endpoints affecting edit post screen. (PRO)
* Snippet ID instead of snippet object being passed to `code_snippets/update_snippet` action hook.
## [3.5.0] (2023-09-13)
### Added
* Support for the Code Snippets Cloud API.
* Search and download public snippets.
* Codevault back-up and synchronisation. (PRO)
* Synchronised local snippets are automatically updated in Cloud. (PRO)
* Bulk actions - 'update' and 'download'.
* Download snippets from public and private codevaults. (PRO)
* Search and download any publicly viewable snippet in Code Snippet Cloud by keyword or name of codevault. (PRO)
* Deploy snippets to plugin from Code Snippets Cloud app. (PRO)
* Bundles of Joy! Search and download Snippet Bundles in one go direct from Code Snippets Cloud. (PRO)
### Changed
* Redirect to snippets table when deleting snippet from the edit menu.
* Scroll new notices into view on edit menu.
### Fixed
* Error when attempting to update network shared snippets after saving. [[#](https://wordpress.org/support/topic/activating-snippets-breaks-on-wordpress-6-3/)]
## [3.4.2] (2023-07-05)
### Fixed
* Issue causing export process to fail with fatal error. [[#](https://wordpress.org/support/topic/critical-error-on-exporting-snippets/)]
* Type issue on `the_posts` filter when no posts available. [[#](https://wordpress.org/support/topic/collision-with-plugin-xml-sitemap-google-news/)]
## [3.4.1] (2023-06-29)
### Added
* Added better debugging when calling REST API methods from the edit menu.
### Changed
* Escape special characters when sending snippet code through AJAX to avoid false-positives from security modules. [[#](https://wordpress.org/support/topic/latest-3-4-0-ajax-bug-cannot-save-snippets-403-error/)]
* Only display the latest update or error notice on the edit page, instead of allowing them to stack.
### Fixed
* Undefined array key error. [[#](https://wordpress.org/support/topic/after-updating-occasionally-getting-undefined-array-key-query/)]
* Potential type issue when loading Prism. [[#](https://wordpress.org/support/topic/code-snippets-fatal-error-breaking-xml-sitemaps/)]
* Potential type issue when sorting snippets. [[#](https://github.com/codesnippetspro/code-snippets/issues/166)]
* Issue preventing asset revision numbers from updating correctly. (PRO) [[#](https://github.com/codesnippetspro/code-snippets/issues/166)]
## [3.4.0] (2023-05-17)
### Added
* Proper WordPress REST API support for retrieving and modifying snippets.
* Added help links to content snippet options.
### Changed
* Better compatibility with modern versions of PHP (7.0+).
* Converted Edit/Add New Snippet page to use React.
* Converted action buttons to asynchronously use REST API endpoints through AJAX.
* Load page components dynamically through React.
* Added action notice queue system.
* Replaced native alert dialog with proper React modal.
* Catch snippet execution errors to prevent site from crashing.
* Display recent snippet errors in admin dashboard instead.
* Updated editor block to use new REST API endpoints. (PRO)
* Change colour of upgrade notice in Pro plugin. (PRO)
* All available snippet data is included in export files.
* Only import specific fields from export file, even if additional fields specified.
* Pass additional attributes specified in `[code_snippet]` content shortcode to shortcode content.
* Make shortcode attributes available as individual variables.
* Allow boolean attributes to be passed to code snippets shortcodes without specifying a value.
* Replace external links to Pro pricing page with an upgrade modal.
### Fixed
* Issue preventing editor colorpicker from loading correctly. (PRO)
* Issue preventing linting libraries from loading correctly in the code editor.
## [3.3.0] (2023-03-09)
### Added
* Added additional editor shortcuts to list in tooltip.
* Filter for changing Snippets admin menu position. [See this help article for more information.](https://help.codesnippets.pro/article/61-how-can-i-change-the-location-of-the-snippets-admin-menu)
* Ability to filter shortcode output. Thanks to contributions from [Jack Szwergold](https://github.com/JackSzwergold).
### Fixed
* Do not enqueue CSS or JS snippet file if no snippets exist. (PRO)
* Bug causing all snippets to show in site health information instead of those active.
* Unnecessary sanitization of file upload data causing import process to fail on Windows systems.
## [3.2.2] (2022-11-17)
### Fixed
* Plugin lacking a valid header error on activation.
## [3.2.1] (2022-10-05)
### Added
* `Ctrl`+`/` or `Cmd`+`/` as shortcut for commenting out code in the snippet editor.
* Additional hooks to various snippet actions, thanks to contributions made by [ancient-spirit](https://github.com/ancient-spirit).
* Fold markers, additional keyboard shortcuts and keymap options to snippet editor,
thanks to contributions made by [Amaral Krichman](https://github.com/karmaral).
* WP-CLI commands for retrieving, activating, deactivating, deleting, creating, updating, exporting and importing snippets.
### Changed
* Removed duplicate tables exist query. ([#](https://wordpress.org/support/topic/duplicate-queries-21)).
* Enabled 'add paragraphs and formatting' option by default for newly inserted content snippets.
### Fixed
* Issue making survey reminder notice not dismissible.
* Path to iron visible when updating the pro plugin.
## [3.2.0] (2022-07-22)
### Added
* Option to show and hide line numbers in Gutenberg source code editor block. (PRO)
* Support for highlighting HTML, CSS, JS and embedded code in the front-end PrismJS code highlighter.
* Additional features to front-end PrismJS code highlighter, including automatic links and a copy button.
* Support for multiple code styles in the source code Gutenberg editor block. (PRO)
* Admin notice announcing release of Code Snippets Pro.
* Button for copying shortcode text to clipboard.
* Option to choose from 44 different themes for the Prism code highlighter in the source editor block and Elementor widget. (PRO)
### Changed
* Include Code Snippets CSS and JS source code in distributed package.
* Don't delete data from plugin if deleting Code Snippets Free while Code Snippets Pro is active.
* Streamlined user interface and experience in Gutenberg editor blocks. (PRO)
* Compatibility of Elementor widgets with the latest version of Elementor. (PRO)
* Replace icon font menu icon with embedded SVG icon.
### Removed
* Remove default value from SQL columns to improve compatibility with certain versions of MySQL.
### Fixed
* Delay loading snippets in Gutenberg editor blocks. (PRO)
* Inconsistencies with translations between different plugin versions.
* Issue with Content Snippet shortcode information not displaying.
## [3.1.2] (2022-07-03)
### Changed
* Updated external links and branding for Code Snippets Pro.
* Add link URLs to settings pages, as an alternative to in-page navigation.
* Improved visual style of Gutenberg editor blocks. (PRO)
### Fixed
* Various fixes to block editor scripts. (PRO)
## [3.1.1] (2022-06-13)
### Added
* Added additional parameters to `code_snippets/export/filename` filter.
### Fixed
* Download snippets feature not including snippet content.
* Alignment of 'opens externally' dashicon.
## [3.1.0] (2022-05-17)
### Added
* More comprehensive cache coverage, including for active snippets.
* Icon to 'Go Pro' button indicating it opens an external tab.
### Changed
* Simplified database queries.
* Allow display styles in snippet descriptions.
### Fixed
* Caching inconsistencies preventing snippets and settings from refreshing on sites with persistent object caching.
## [3.0.1] (2022-05-14)
### Fixed
* Incompatibility issue with earlier versions of PHP.
## [3.0.0] (2022-05-14)
### Added
* HTML content snippets for displaying as shortcodes or including in the page head or footer area.
* Notice reminding users to upgrade unsupported PHP versions.
* Visual settings to add attributes to shortcodes.
* Shortcode buttons to the post and page content editors.
* Basic REST API endpoints.
* Snippet type column to the snippets table.
* Snippet type badges to Edit and Add New Snippet pages.
* Setting to control whether the current line of the code editor is highlighted.
* Display a warning when saving a snippet with missing title or code.
* Add suffix to title of cloned snippets.
* Added key for the 'active' and 'scope' database table columns to speed up queries.
* Added snippet type labels to the tabs on the Snippets page.
* Added hover effect to priority settings in the snippets table to show that they are editable.
* CSS style snippets for the site front-end and admin area. (PRO)
* JavaScript snippets for the site head and body area on the front-end. (PRO)
* Browser cache versioning for CSS and JavaScript snippets. (PRO)
* Support for exporting and downloading CSS and JavaScript snippets. (PRO)
* Support for highlighting code on the front-end. (PRO)
* Editor syntax highlighting for CSS, JavaScript and HTML snippets. (PRO)
* Button to preview full file when editing CSS or JavaScript snippets. (PRO)
* Option to minify CSS and JavaScript snippets. (PRO)
* Gutenberg editor block for displaying content snippets. (PRO)
* Gutenberg editor block for displaying snippet source code. (PRO)
* Elementor widget for displaying content snippets. (PRO)
* Elementor widget for displaying snippet source code. (PRO)
### Changed
* Updated plugin code to use namespaces, preventing name collisions with other plugins.
* Redirect from edit menu if not editing a valid snippet.
* Moved activation switch into its own table column.
* Updated code documentation according to WordPress standards.
* Split settings page into tabs.
* Use the version of CodeMirror included with WordPress where possible to inherit the additional built-in features.
### Deprecated
* Deprecated functions and compatibility code for unsupported PHP versions.
### Removed
* Option to disable snippet scopes.
### Fixed
* Snippets table layout on smaller screens.
## [2.14.6] (2022-05-13)
### Fixed
* Issue with processing uploaded import files.
* Issue with processing tag filters.
## [2.14.5] (2022-05-10)
### Fixed
* Incompatibility issue with older versions of PHP.
## [2.14.4] (2022-05-05)
### Fixed
* Prevent array key errors when loading the snippet table with unknown order values.
## [2.14.3] (2021-12-10)
### Fixed
* Potential security issue outputting snippets-safe-mode query variable value as-is. Thanks to Krzysztof Zając for reporting.
## [2.14.2] (2021-09-09)
### Added
* Added translations:
* Spanish by [Ibidem Group](https://www.ibidemgroup.com)
* Urdu by [Samuel Badree](https://mobilemall.pk/)
* Greek by [Toni Bishop from Jrop](https://www.jrop.com/)
* Support for `:class` syntax to the code validator.
* PHP8 support to the code linter.
* Color picker feature to the code editor.
* Failsafe to prevent multiple versions of Code Snippets from running simultaneously.
### Fixed
* Prevent network snippets table from being created on single-site installs.
## [2.14.1] (2021-03-10)
### Added
* Czech translation by [Lukáš Tesař](https://github.com/atomicf4ll).
* Code direction setting for RTL users.
* Additional action hooks and search API thanks to [@Spreeuw](https://github.com/Spreeuw).
### Changed
* Updated CodeMirror to version 5.59.4.
### Fixed
* Code validator now supports `function_exists` and `class_exists` checks.
* Code validator now supports anonymous functions.
* Issue with saving the hidden columns setting.
* Replaced the outdated tag-it library with [tagger](https://github.com/jcubic/tagger) for powering the snippet tags editor.
## [2.14.0] (2020-01-26)
### Added
* Basic error checking for duplicate functions and classes.
* Additional API options for retrieving snippets.
* Store the time and date when each snippet was last modified.
* Basic error checking when activating snippets.
### Changed
* Updated CodeMirror to version 5.50.2.
* Updated Italian translations to fix display issues – thanks to [Francesco Marino](https://360fun.net).
* Changed the indicator color for inactive snippets from red to grey.
### Fixed
* Ordering snippets in the table by name will now be case-insensitive.
* Code editor will now properly highlight embedded HTML, CSS and JavaScript code.
* Fixed a bug preventing the editor theme from being set to default.
* Ensure that imported snippets are always inactive.
* Check the referer on the import menu to prevent CSRF attacks.
Thanks to [Chloe with the Wordfence Threat Intelligence team](https://www.wordfence.com/blog/author/wfchloe/) for reporting.
* Ensure that individual snippet action links use proper verification.
## [2.13.3] (2019-03-13)
### Added
* Hover effect to activation switches.
* Additional save buttons above snippet editor.
* List save keyboard shortcuts to the help tooltip.
* Change "no items found" message when search filters match nothing.
### Changed
* Updated CodeMirror to version 5.44.0.
### Fixed
* Calling deprecated code in database upgrade process.
* Include snippet priority in export files.
* Use Unix newlines in code export file.
* Correctly register snippet tables with WordPress to prevent database repair errors.
[[#](https://wordpress.org/support/topic/database-corrupted-4/)]
* CodeMirror indentation settings being applied incorrectly.
## [2.13.2] (2019-01-25)
### Removed
* Removed potentially problematic cursor position saving feature.
## [2.13.1] (2019-01-22)
### Added
* Add menu buttons to settings page for compact menu.
* Help tooltop to snippet editor for keyboard shortcuts, thanks to Michael DeWitt.
* Added button for executing single-use snippets to snippets table.
* Sample snippet for ordering snippets table by name by default.
### Changed
* French translation updated thanks to momo-fr.
* Updated CodeMirror to version 5.43.0.
### Fixed
* Split code editor and tag editor scripts into their own files to prevent dependency errors.
* Handling of single-use shared network snippets.
* Minor translation template issues.
## [2.13.0] (2018-12-17)
### Added
* Search/replace functionality to the snippet editor. [See here for a list of keyboard shortcuts.](https://codemirror.net/demo/search.html) [[#](https://wordpress.org/support/topic/feature-request-codemirror-search-and-replace/)]
* Option to make admin menu more compact.
* Added additional styles to editor settings preview.
* PHP linter to code editor.
### Changed
* Updated CodeMirror to version 5.42.0.
* Integration between plugin and the CodeMirror library, to prevent collisions.
* Use external scripts instead of inline scripts.
### Fixed
* Problem clearing recently active snippet list.
* Missing functionality for 'Auto Close Brackets' and 'Highlight Selection Matches' settings.
## [2.12.1] (2018-11-15)
### Changed
* CodeMirror updated to version 5.41.0.
* Attempt to create database columns that might be missing after a table upgrade.
* Streamlined upgrade process.
* Made search box appear at top of page on mobile. [[#](https://wordpress.org/support/topic/small-modification-for-mobile-ux/)]
* Updated screenshots.
### Fixed
* Interface layout on sites using right-to-left languages.
## [2.12.0] (2018-09-23)
### Added
* Added Import button next to page title on manage page.
* Added coloured banner indicating whether a snippet is active when editing.
### Changed
* Updated import page to improve usability.
* Updated CodeMirror to 5.40.0.
### Removed
* Removed option for including network-wide snippets in subsite lists on multisite.
### Fixed
* Prevented hidden columns setting from reverting to default.
## [2.11.0] (2018-07-24)
### Added
* Ability to assign a priority to snippets, to determine the order in which they are executed.
* Pressing Ctrl/Cmd + S while writing a snippet will save it.
* Shadow opening PHP tag above the code editor.
* Install sample snippets when the plugin is installed.
* Filter hook for controlling the default list table view.
* Action for cloning snippets.
### Changed
* The editor cursor position will be preserved when saving a snippet.
* Updated the message shown when there are no snippets.
* Show all available tags when selecting the tag field.
## [2.10.2] (2018-07-21)
### Added
* Button to reset settings to their default values.
* Belarusian translation by Hrank.com.
### Changed
* Made uninstall cleanup optional through a plugin setting.
* Ordered tags by name in the filter dropdown menu.
* Enabled sorting snippets table by tags.
* Updated CodeMirror to version 5.39.0.
### Fixed
* Applied formatting filters to snippet descriptions in the table.
* Incorrectly translated strings.
## [2.10.1] (2018-02-10)
### Fixed
* Prevent errors when trying to export no snippets.
* Use wp_json_encode() to encode export data.
* Check both the file extension and MIME type of uploaded import files.
## [2.10.0] (2018-01-18)
### Added
* Added support for importing from multiple export files at once.
* New scope for single-use snippets.
* Allowed plugin settings to be unified on multisite through Network Settings option.
### Changed
* Unbold the titles of inactive snippets for greater visual distinction.
* Don't show network snippets on subsites by default, and only to super admins.
* Export snippets to JSON instead of XML.
* More options for importing duplicate snippets.
* Use strings for representing scopes internally instead of numbers.
* Rename 'Export to PHP' to 'Download', and add button to edit snippet page.
### Fixed
* Issue with incorrectly treating network snippets as site-wide for code validation.
## [2.9.6] (2018-01-14)
### Added
* Added Brazilian Portuguese translation by [Bruno Borges](http://brunoborges.info)
### Changed
* Moved scope and other settings on single snippet page to below code area.
### Fixed
* Use standard WordPress capabilities instead of custom capabilities to prevent lockouts.
* Multisite issue with retrieving active shared snippets from the wrong table causing duplicate snippet execution.
## [2.9.5] (2018-01-13)
### Changed
* Updated CodeMirror to version 5.33.
* Made the "Activate By Default" setting enabled by default for new installations.
### Fixed
* Undefined function error when accessing the database on multisite.
* Ensured all admin headings are hierarchical for accessibility.
## [2.9.4] (2017-09-19)
### Changed
* Minor improvements to database creation function.
### Fixed
* Prevented PHP error from occurring when saving a snippet.
## [2.9.3] (2017-09-11)
### Fixed
* Prevent snippets from being executed twice when saving due to invalid ID being passed to allow_execute_snippet filter.
* Re-enabled output suppression when executing snippets.
## [2.9.2] (2017-09-08)
### Fixed
* Do not attempt to combine queries for fetching local and multisite snippets.
## [2.9.1] (2017-09-07)
### Fixed
* Prevent illegal mix of collations errors when fetching snippets from database tables with different collations.
[[#](https://wordpress.org/support/topic/issue-on-multisite-with-wpml/)]
## [2.9.0] (2017-09-06)
### Changed
* Moved code to disable snippet execution into a filter hook.
* execute_active_snippets() function updated with improved efficiency.
* Renamed Snippet class to avoid name collisions with other plugins.
* Don't hide output when executing a snippet.
### Fixed
* Prevented invalid properties from being set when saving a snippet.
* Use the correct protocol when saving a snippet.
* Active shared snippets not being updated correctly.
## [2.8.7] (2017-05-18)
### Added
* Added French (Canada) translation by Domonic Desbiens.
* Added fixes for Indonesian translation by @zmni.
## [2.8.6] (2017-05-14)
### Fixed
* Fixed snippet description field alias not mapping correctly, causing snippet descriptions to not be displayed in the table or when editing a snippet.
* Ensured that get_snippets() function retrieves snippets with the correct 'network' setting. Fixes snippet edit links in network admin.
## [2.8.5] (2017-05-13)
### Added
* Added Indonesian translation by Jordan Silaen from ChameleonJohn.com .
* Added setting to hide network snippets on subsites.
### Security
* Ensured HTML in snippet titles is escaped in snippets table.
* Disallowed undefined fields to be set on the Snippets class.
* Prevented shared network snippets from being included twice in snippets table on multisite.
## [2.8.4] (2017-04-29)
### Fixed
* Fixed all snippets being treated as network snippets on non-multisite sites.
## [2.8.3] (2017-04-29)
### Added
* Added more compete output escaping to prevent XSS errors.
### Changed
* Updated CodeMirror to version 5.25.0.
* Show network active snippets as read-only on multisite subsites.
## [2.8.2] (2017-02-27)
### Fixed
* Fix bug introduced in 2.8.1 that broke code verification functionality by executing code twice.
## [2.8.1] (2017-02-25)
### Changed
* Updated German translation.
* Updated CodeMirror to version 5.24.0.
### Removed
* Removed possible conflict between Debug Bar Console plugin. (#52)
### Fixed
* Fixed admin menu items not translating.
* Corrected editor alignment on RTL sites. ([#](https://wordpress.org/support/topic/suggestion-css-fix-for-rtl-sites/))
* Fixed bulk actions running when Filter button is clicked. ([#](https://wordpress.org/support/topic/bug-with-filtering-action-buttons/))
## [2.8.0] (2016-12-14)
### Changed
* Renamed 'Manage' admin menu label to 'All Snippets' to keep in line with other admin menu labels.
* Renamed placeholder on snippet name field to 'Enter title here'.
* Updated CodeMirror to version 5.21.0.
* Moved 'Edit Snippet' admin menu above 'Add New' menu.
* Made pressing Ctrl-Enter in the code editor save the snippet.
### Removed
* Removed CodeMirror search functionality.
### Fixed
* Fixed Italian translation errors. Props to @arsenalemusica.
## [2.7.3] (2016-10-24)
### Changed
* Updated CodeMirror to version 5.10.0.
### Fixed
* Fixed a few strings not being translated.
## [2.7.2] (2016-10-01)
### Changed
* Updated German translation by [Mario Siegmann](https://web-alltag.de).
## [2.7.1] (2016-09-30)
### Added
* Added Dutch translation by Sander Spies.
### Changed
* Updated CodeMirror to version 5.19.0.
### Security
* Ensured that the editor theme setting is properly validated. Thanks to [Netsparker](https://www.netsparker.com) for reporting.
* Ensured that snippet tags are properly escaped. Thanks to [Netsparker](https://www.netsparker.com) for reporting.
## [2.7.0] (2016-07-23)
### Added
* Added query var to disable snippet execution. To use, add `?snippets-safe-mode=true` to the URL.
### Changed
* Updated German translation by [Mario Siegmann](https://web-alltag.de).
* Updated CodeMirror to version 5.17.0.
* Increased default snippets per page so that all are usually shown.
### Fixed
* Fixed plugin translations being loaded.
* Fixed description field not being imported.
* Fixed issue with CodeMirror rubyblue theme. [[#](https://wordpress.org/support/topic/a-problem-with-the-cursor-color-and-the-fix-that-worked-for-me)]
* Fixed snippet fields not importing.
* Fixed a minor XSS vulnerability discovered by Burak Kelebek. [[#](https://wordpress.org/support/topic/security-vulnerability-20)]
## [2.6.1] (2016-02-10)
### Changed
* Updated German translation by [Mario Siegmann](https://web-alltag.de).
* Updated error catching to work with snippets including functions and classes.
### Fixed
* Fixed error catching not working correctly.
* Fixed editor autoresizing.
## [2.6.0] (2015-12-31)
### Added
* Added `[code_snippets]` shortcode for embedding snippet code in a post.
* Added front-end syntax highlighting for shortcode using [PrismJS](https://prismjs.com).
### Changed
* Updated CodeMirror to version 5.10.0.
### Removed
* Reconfigured plugin to use classloader and converted a lot of functional code into OOP code.
### Fixed
* Fixed broken snippet search feature. [[#](https://wordpress.org/support/topic/search-is-not-working-6)]
## [2.5.1] (2016-10-11)
### Fixed
* Ensure errors are fatal before catching them during error checking.
* Escape the snippet name on the edit page to ensure it displays correctly.
* Exclude snippets with named functions from error checking so they do not run twice.
## [2.5.0] (2015-10-08)
### Added
* Detect parse and fatal errors in code when saving a snippet, and display a user-friendly message.
### Changed
* Updated access of some methods in Code_Snippets_List_Table class to match updated WP_List_Table class.
## [2.4.2] (2015-09-27)
### Added
* Added query variable to activate safe mode.
* Added settings to disable description and tag editors.
### Changed
* Updated editor preview updating code to use vanilla JavaScript instead of jQuery.
### Fixed
* Fixed settings not saving.
* Fixed snippet descriptions not displaying on manage menu.
* Load CodeMirror after plugin styles to fix error with Zenburn theme.
* Hide snippet scope icons when the scope selector is disabled.
* Fixed description heading on edt snippet menu being hidden when visual editor disabled.
* Deactivate a shared network snippet on all subsites when it looses its sharing status.
## [2.4.1] (2015-09-17)
### Fixed
* Fixed CodeMirror themes not being detected on settings page [[#](https://wordpress.org/support/topic/updated-to-240-now-i-cant-switch-theme)]
## [2.4.0] (2015-09-17)
### Added
* Added ability to share network snippets to individual sites on WordPress multisite.
* Added `code_snippets/after_execute_snippet` filter.
* Added class for individual snippets.
### Changed
* Improved code directory and class structure.
* Improved code for printing admin messages.
* Updated German translation (Joerg Knoerchen)
* Updated `get_snippets()` function to retrieve individual snippets.
* Changed admin page headers to use `<h1>` tags instead of `<h2>` tags.
* Updated CodeMirror to version 5.6.
### Removed
* Remove legacy code for pre-3.6 compatibility.
* Removed scope statuses and added fixed tags to indicate scope.
* Removed snippet settings page from network admin.
## [2.3.0] (2015-05-20)
### Added
* Added icons for admin and front-end snippets to manage table.
* Added filter switch to prevent a snippet from executing. ([#25](https://github.com/codesnippetspro/code-snippets/issues/25))
### Changed
* Improved settings retrieval by caching settings.
* Updated Russian translation by [Alexey Chumakov](http://chumakov.ru/).
### Removed
* Removed nested functions.
### Fixed
* Fixed errors in string translation.
* Fixed bug in import process. ([#32](https://github.com/codesnippetspro/code-snippets/issues/32))
## [2.2.3] (2015-05-13)
### Added
* Added support for importing and exporting snippet scope.
### Changed
* Improved database table structure.
### Fixed
* Fixed broken call to `export_snippet()` function.
* Fixed duplicate primary key database error.
## [2.2.2] (2015-05-11)
### Added
* Added statuses for snippet scopes on manage snippets table.
### Changed
* Updated references to old plugin site.
* Made minor updates to French translation file.
### Fixed
* Resolved JavaScript error on edit snippet pages.
* Added polyfill for array_replace_recursive() function for PHP 5.2.
## [2.2.1] (2015-05-10)
### Fixed
* Fixed the default values of new setting not being applied.
* Fixed missing background of tags input.
## [2.2.0] (2015-05-10)
### Added
* Introduced CodeSniffer testing on code.
* Added snippet scope selector.
### Changed
* Minified all CSS and JS in plugin.
* Made CodeMirror theme names more readable.
### Fixed
* Fixed description heading disappearing when media buttons enabled.
* Fixed bug causing translations to not be loaded.
## [2.1.0] (2015-05-09)
### Added
* Added additional setting descriptions.
* Added settings for code and description editor height.
### Changed
* Updated CodeMirror to version 5.2.
* Improved efficiency of settings component.
### Fixed
* Fixed not escaping the request URL when using query arg functions.
## [2.0.3] (2015-03-17)
### Changed
* Updated German translation by [Joerg Knoerchen](https://www.sensorgrafie.de/).
## [2.0.2] (2015-03-05)
### Removed
* Remove settings database option when plugin is uninstalled.
### Fixed
* Fix error in table creation code.
## [2.0.1] (2015-02-25)
### Fixed
* Fixed table creation code not running on upgrade.
* Fixed snippets per page option not saving.
## [2.0.0] (2015-02-24)
### Highlights
* Better import/export functionality.
* New settings page with code editor settings.
* Code rewritten for cleaner and more efficient code.
* Lots of new translations.
### Added
* Added link to Code Snippets importer under Snippets admin menu.
* Added settings component and admin page.
* Added support for different CodeMirror themes.
* Added Auto Close Brackets CodeMirror addon (props to TronicLabs).
* Added Croatian translation by Borisa Djuraskovic from [Web Hosting Hub](https://www.webhostinghub.com).
* Added Highlight Selection Matches CodeMirror addon (props to TronicLabs).
* Added Chinese translation thanks to Jincheng Shan.
* Added Russian translation by Alexander Samsonov.
* Added Slovak translation by [Ján Fajčák] from [WordPress Slovakia](https://wp.sk).
* Added setting to always save and activate snippets by default.
* Added braces to single-line conditionals in line with [new coding standards](https://make.wordpress.org/core/2013/11/13/proposed-coding-standards-change-always-require-braces/).
### Changed
* Improved plugin file structure.
* Updated CodeMirror library to version 5.0.
* Split up large classes into separate functions.
* Replaced uninstallation hook with single file method.
* Rewritten import/export functionality to use DOMDocument.
### Removed
* Removed old admin style support.
* Removed backwards-compatible support.
* Removed duplicate MySQL primary key indexing.
### Deprecated
* Integrated tags component into main plugin. Current users of the Code Snippets Tags plugin can safely uninstall it.
* Merged Code_Snippets_Export_PHP class into Code_Snippets_Export class.
### Fixed
* Fixed incompatibility errors with PHP 5.2.
* Fixed empty MO translation files.
## [1.9.1.1] (2014-01-03)
### Fixed
* Added capability check to site snippets importer.
## [1.9.1] (2014-01-02)
### Changed
* Use an icon font for menu icon instead of embedded SVG.
* Use Sass (libsass) instead of Compass.
* Unminified CodeMirror scripts.
### Fixed
* Fixes for the WP 3.8 interface.
* Fix 'enable snippets menu for site admins' multisite setting.
## [1.9.0] (2013-11-11)
### Added
* Added French translation thanks to translator [oWEB](http://office-web.net).
* Added 'Save & Deactivate' button to the edit snippet page. ([#](https://wordpress.org/support/topic/deactivate-button-in-edit-snippet-page))
* Added nonce to edit snippet page.
* Added a fallback MP6 icon.
### Changed
* Updated MP6 icon implementation.
* Improved CodeMirror implementation.
* Updated CodeMirror to version 3.19.
* Updated WordPress.org plugin banner.
* Add and remove network capabilities as super admins are added and removed.
* Replaced buggy trim `<?php` and `?>` functionality with a much more reliable regex method. ([#](https://wordpress.org/support/topic/character-gets-cut))
* Make the title of each snippet on the manage page a clickable link to edit the snippet ([#](https://wordpress.org/support/topic/deactivate-button-in-edit-snippet-page?replies=9#post-4682757))
* Hide row actions on manage snippet page by default.
* Use the proper WordPress database APIs consistently.
* Rewritten export functionality.
### Removed
* Removed edit and install capabilities (now only uses the manage capability).
* Removed screenshots from plugin.
* Removed CodeMirror bundled with plugin.
### Fixed
* Fixed snippet failing to save when code contains `%` character, props to [nikan06](https://wordpress.org/support/profile/nikan06). ([#](https://wordpress.org/support/topic/percent-sign-bug))
* Fixed HTML breaking in export files. ([#](https://wordpress.org/support/topic/import-problem-7))
* Fixed incorrect export filename.
* Fixed CodeMirror incompatibility with the WP Editor plugin.
* Fixed CodeMirror incompatibility with the Debug Bar Console plugin.
## [1.8.1.1] (2013-08-18)
## [1.8.1] (2013-07-29)
### Changed
* Updated CodeMirror to 3.15.
* Compiled all CodeMirror scripts into a single file.
* Use Sass + Compass for CSS.
* Use Grunt for build automation.
* Minify CSS.
### Fixed
* Fixed code typo that was breaking export files.
## [1.8.0] (2013-07-09)
### Added
* Added error message handling for import snippets page.
### Changed
* Improved database table creation method: on a single-site install, the snippets table will always be created. On a multisite install, the network snippets table will always be created; the site-specific table will always be created for the main site; for sub-sites the snippets table will only be created on a visit to a snippets admin page.
* Updated to CodeMirror 3.14.
* Allow no snippet name or code to be set.
* Prevented an error on fresh multisite installations.
* Refactored code to use best practices.
### Deprecated
* Changes to filter and action hook API.
### Fixed
* Removed encoding of HTML entities in database.
## [1.7.1.2] (2013-05-03)
### Fixed
* Correct path to admin menu icon. Fixes [#8](https://github.com/codesnippetspro/code-snippets/issues/8)
## [1.7.1.1] (2013-04-29)
### Fixed
* Fixed a bug with custom capabilities and admin menus.
## [1.7.1] (2013-04-22)
### Added
* Added German translation thanks to [David Decker](https://deckerweb.de)
* Allow or deny site administrators access to snippet admin menus. Set your preference in the **Enable Administration Menus** setting under the *Settings > Network Settings* network admin menu.
### Changed
* Updated PHP Documentation completely. [[View online](https://bungeshea.github.io/code-snippets/api)]
* Only load admin functions when viewing dashboard.
* Improve database table creation and upgrade process.
* Optimized to use less database queries.
### Fixed
* Fix a bug with snippet being set as deactivated when saved.
## [1.7.0] (2013-03-26)
### Added
* Added icon for the new MP6 admin UI ([#](https://wordpress.org/support/topic/icon-disappears-with-mp6))
* Allow plugin to be activated on individual sites on multisite ([#](https://wordpress.org/support/topic/dont-work-at-multisite))
* Strip PHP tags from the beginning and end of a snippet on save ([#](https://wordpress.org/support/topic/php-tags))
* Change label in admin menu when editing a snippet.
### Changed
* Improved plugin API.
* Updated CodeMirror to version 3.11.
* Changed to [MIT license](https://opensource.org/licenses/mit-license.php)
* Improved admin styling.
* Slimmed down the description visual editor.
* Made everything leaner, faster, and better.
### Removed
* Removed HTML, CSS and JavaScript CodeMirror modes that were messing things up.
### Fixed
* Fixed a bug with saving snippets per page option ([#](https://wordpress.org/support/topic/plugin-code-snippets-snippets-per-page-does-not-work#post-3710991))
## [1.6.1] (2012-12-29)
### Fixed
* Fixed a bug with permissions not being applied on install ([#](https://wordpress.org/support/topic/permissions-problem-after-install))
* Fixed a bug in the uninstall method ([#](https://wordpress.org/support/topic/bug-in-delete-script))
## [1.6.0] (2012-12-22)
### Added
* Current line of code editor is now highlighted.
* Highlight matches of selected text in code editor.
### Changed
* Code improvements and optimization.
* Updated code editor to use CodeMirror 3.
* Improved compatibility with Clean Options plugin.
* Changed namespace from `cs` to `code_snippets`.
* Improved updating process.
* Move css and js under assets.
* Organized CodeMirror scripts.
* Store multisite only options in site options table.
* Only create snippet tables when needed.
### Fixed
* Fixed compatibility bugs with WordPress 3.5.
## [1.5.0] (2012-09-18)
### Added
* Added custom capabilities.
* Added 'Export to PHP' feature. ([#](https://wordpress.org/support/topic/plugin-code-snippets-suggestion-bulk-export-to-php))
* Added i18n.
### Changed
* Updated CodeMirror to version 2.33.
* Updated the 'Manage Snippets' page to use the WP_List_Table class.
* Added 'Screen Options' tab to 'Manage Snippets' page.
* Added search capability to 'Manage Snippets' page.
* Added views to easily filter activated, deactivated and recently activated snippets.
* Added ID column to 'Manage Snippets' page.
* Added sortable name and ID column on 'Manage Snippets' page ([#](https://wordpress.org/support/topic/plugin-code-snippets-suggestion-sort-by-snippet-name))
* Improved API.
* Lengthened snippet name field to 64 characters. ([#](https://wordpress.org/support/topic/plugin-code-snippets-snippet-title-limited-to-36-characters))
## [1.4.0] (2012-08-20)
### Added
* Added interface to Network Dashboard.
### Changed
* Updated uninstall to support multisite.
* Replaced EditArea with [CodeMirror](https://codemirror.net).
* Small improvements.
## [1.3.2] (2012-08-17)
### Fixed
* Fixed a bug with version 1.3.1.
## [1.3.1] (2012-08-17)
### Changed
* Changed plugin website URI.
* Cleaned up some code.
## [1.3.0] (2012-08-01)
### Added
* Added export option to 'Manage Snippets' page.
* Added 'Import Snippets' page.
## [1.2.0] (2012-07-29)
### Added
* Added code highlighting.
### Changed
* Minor improvements.
* Data will now be cleaned up when plugin is deleted through WordPress admin.
### Removed
* Removed 'Uninstall Plugin' page.
## [1.1.0] (2012-06-24)
### Fixed
* Fixed a permissions bug with `DISALLOW_FILE_EDIT` being set to true. ([#](https://wordpress.org/support/topic/plugin-code-snippets-cant-add-new))
* Fixed a bug with the page title reading 'Add New Snippet' on the 'Edit Snippets' page.
* Fixed a bug not allowing the plugin to be Network Activated. ([#](https://wordpress.org/support/topic/plugin-code-snippets-network-activate-does-not-create-snippets-tables))
## [1.0.0] (2012-06-13)
### Added
* Stable version released.
[brandonjp]: https://github.com/brandonjp
[unreleased]: https://github.com/codesnippetspro/code-snippets/tree/core
[3.6.7]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.7
[3.6.6.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.6.1
[3.6.6]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.6
[3.6.5]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.5
[3.6.4]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.4
[3.6.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.3
[3.6.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.2
[3.6.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.1
[3.6.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.6.0
[3.5.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.5.1
[3.5.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.5.0
[3.4.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.4.2
[3.4.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.4.1
[3.4.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.4.0
[3.3.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.3.0
[3.2.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.2.2
[3.2.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.2.1
[3.2.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.2.0
[3.1.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.1.2
[3.1.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.1.1
[3.1.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.1.0
[3.0.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.0.1
[3.0.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v3.0.0
[2.14.6]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.6
[2.14.5]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.5
[2.14.4]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.4
[2.14.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.3
[2.14.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.2
[2.14.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.1
[2.14.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.14.0
[2.13.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.13.3
[2.13.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.13.2
[2.13.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.13.1
[2.13.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.13.0
[2.12.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.12.1
[2.12.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.12.0
[2.11.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.11.0
[2.10.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.10.2
[2.10.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.10.1
[2.10.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.10.0
[2.9.6]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.6
[2.9.5]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.5
[2.9.4]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.4
[2.9.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.3
[2.9.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.2
[2.9.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.1
[2.9.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.9.0
[2.8.7]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.7
[2.8.6]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.6
[2.8.5]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.5
[2.8.4]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.4
[2.8.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.3
[2.8.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.2
[2.8.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.1
[2.8.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.8.0
[2.7.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.7.3
[2.7.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.7.2
[2.7.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.7.1
[2.7.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.7.0
[2.6.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.6.1
[2.6.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.6.0
[2.5.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.5.1
[2.5.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.5.0
[2.4.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.4.2
[2.4.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.4.1
[2.4.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.4.0
[2.3.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.3.0
[2.2.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.2.3
[2.2.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.2.2
[2.2.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.2.1
[2.2.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.2.0
[2.1.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.1.0
[2.0.3]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.0.3
[2.0.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.0.2
[2.0.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.0.1
[2.0.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v2.0.0
[1.9.1.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.9.1.1
[1.9.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.9.1
[1.9.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.9.0
[1.8.1.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.8.1.1
[1.8.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.8.1
[1.8.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.8.0
[1.7.1.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.7.1.2
[1.7.1.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.7.1.1
[1.7.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.7.1
[1.7.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.7.0
[1.6.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.6.1
[1.6.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.6.0
[1.5.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.5.0
[1.4.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.4.0
[1.3.2]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.3.2
[1.3.1]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.3.1
[1.3.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.3.0
[1.2.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.2.0
[1.1.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.1.0
[1.0.0]: https://github.com/codesnippetspro/code-snippets/releases/tag/v1.0.0
assets/icon.svg 0000644 00000007215 15153464547 0007542 0 ustar 00 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="527.87659"
viewBox="0 0 527.87659 437.89301"
height="437.89301"
version="1.1"
id="svg3782"
sodipodi:docname="icon.svg"
style="fill:none"
inkscape:version="1.2.1 (9c6d41e, 2022-07-14)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata3786">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1728"
inkscape:window-height="922"
id="namedview3784"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="0.82418304"
inkscape:cx="166.83187"
inkscape:cy="220.82473"
inkscape:window-x="1824"
inkscape:window-y="77"
inkscape:window-maximized="0"
inkscape:current-layer="svg3782"
inkscape:showpageshadow="2"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1" />
<path
d="m 485.43,285.72732 c 51.43,-29.68 51.43,-103.88 0,-133.56 L 246.64,14.377317 c -51.41,-29.661998 -115.66,7.432 -115.66,66.779 V 356.73632 c 0,59.35 64.25,96.44 115.66,66.78 l 238.79,-137.79 z"
id="path3769"
inkscape:connector-curvature="0"
style="fill:#08c5d1;stroke:#ffffff;stroke-width:8" />
<path
d="m 358.46,285.72732 c 51.42,-29.68 51.42,-103.88 0,-133.56 L 119.66,14.377317 C 68.251,-15.284681 4,21.809317 4,81.156317 V 356.73632 c 0,59.35 64.251,96.44 115.66,66.78 l 238.8,-137.79 z"
id="path3771"
inkscape:connector-curvature="0"
style="fill:#d46f4d;stroke:#ffffff;stroke-width:8" />
<g
clip-path="url(#clip0)"
id="g3775"
transform="translate(0,-1.0526808)">
<path
d="m 186.95,222.05 65.43,-55.94 c 1.84,-1.57 1.84,-4.13 0,-5.7 -12.9,-11.02 -33.81,-11.02 -46.7,0 l -45.42,38.83 -9.77,-8.36 c 1.69,-3.67 2.63,-7.67 2.63,-11.85 0,-17.82 -16.9,-32.27 -37.75,-32.27 -20.841,0 -37.738,14.45 -37.738,32.27 0,17.82 16.897,32.26 37.738,32.26 1.79,0 3.54,-0.1 5.26,-0.31 l 12.94,11.07 -12.94,11.07 c -1.72,-0.21 -3.47,-0.32 -5.26,-0.32 -20.841,0 -37.738,14.45 -37.738,32.27 0,17.82 16.897,32.26 37.738,32.26 20.85,0 37.75,-14.44 37.75,-32.26 0,-4.19 -0.94,-8.18 -2.63,-11.85 l 9.77,-8.36 45.42,38.83 c 12.89,11.02 33.8,11.02 46.7,0 1.84,-1.58 1.84,-4.13 0,-5.71 z m -71.58,-32.27 c -6.93,0 -12.58,-4.82 -12.58,-10.75 0,-5.93 5.65,-10.76 12.58,-10.76 6.94,0 12.58,4.83 12.58,10.76 0,5.93 -5.64,10.75 -12.58,10.75 z m 0,86.04 c -6.93,0 -12.58,-4.82 -12.58,-10.75 0,-5.93 5.65,-10.76 12.58,-10.76 6.94,0 12.58,4.83 12.58,10.76 0,5.93 -5.64,10.75 -12.58,10.75 z"
id="path3773"
inkscape:connector-curvature="0"
style="fill:#ffffff" />
</g>
<defs
id="defs3780">
<clipPath
id="clip0">
<rect
width="176.13"
transform="translate(77.632,136.01)"
height="172.08"
id="rect3777"
x="0"
y="0"
style="fill:#ffffff" />
</clipPath>
</defs>
</svg>
assets/menu-icon.svg 0000644 00000002233 15153464547 0010477 0 ustar 00 <svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<g>
<path fill="transparent"
d="M191.968 464.224h158.912c23.68 0 42.656 19.2 42.656 42.656 0 11.488-4.48 21.984-11.968 29.632l0.192 0.448-108.768 108.736c-75.104 75.136-75.104 196.512 0 271.584 74.88 74.848 196.448 74.848 271.552 0 74.88-75.104 74.88-196.48 0-271.584-21.76-21.504-47.36-37.12-74.464-46.272l28.608-28.576h365.248c87.040 0 157.856-74.016 159.968-166.4 0-1.472 0.224-2.752 0-4.256-2.112-23.904-22.368-42.656-46.912-42.656h-264.96l191.328-191.328c17.504-17.504 18.56-45.024 3.2-63.36-1.024-1.28-2.080-2.144-3.2-3.2-66.528-63.552-169.152-65.92-230.56-4.48l-262.368 262.368h-46.528c12.8-25.6 20.032-54.624 20.032-85.344 0-106.016-85.952-192-192-192-106.016 0-191.968 85.984-191.968 192 0.032 106.080 85.984 192.032 192 192.032zM277.312 272.256c0 47.136-38.176 85.344-85.344 85.344-47.136 0-85.312-38.176-85.312-85.344s38.176-85.344 85.312-85.344c47.168 0 85.344 38.208 85.344 85.344zM469.088 721.312c33.28 33.248 33.28 87.264 0 120.512-33.28 33.472-87.264 33.472-120.736 0-33.28-33.248-33.28-87.264 0-120.512 33.472-33.504 87.456-33.504 120.736 0z" />
</g>
</svg>
code-snippets.php 0000644 00000003456 15153464547 0010060 0 ustar 00 <?php
/**
* Plugin Name: Code Snippets
* Plugin URI: https://codesnippets.pro
* Description: An easy, clean and simple way to run code snippets on your site. No need to edit to your theme's functions.php file again!
* Author: Code Snippets Pro
* Author URI: https://codesnippets.pro
* License: GPL-2.0-or-later
* License URI: license.txt
* Text Domain: code-snippets
* Version: 3.6.8
* Requires PHP: 7.4
* Requires at least: 5.0
*
* @version 3.6.8
* @package Code_Snippets
* @author Shea Bunge <shea@codesnippets.pro>
* @copyright 2012-2023 Code Snippets Pro
* @license GPL-2.0-or-later https://spdx.org/licenses/GPL-2.0-or-later.html
* @link https://github.com/codesnippetspro/code-snippets
*
* phpcs:disable Modernize.FunctionCalls.Dirname.FileConstant
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
return;
}
// Halt loading here if the plugin is already loaded, or we're running an incompatible version of PHP.
if ( ! defined( 'CODE_SNIPPETS_FILE' ) && version_compare( phpversion(), '7.4', '>=' ) ) {
/**
* The current plugin version.
*
* Should be set to the same value as set above.
*
* @const string
*/
define( 'CODE_SNIPPETS_VERSION', '3.6.8' );
/**
* The full path to the main file of this plugin.
*
* This can later be passed to functions such as plugin_dir_path(), plugins_url() and plugin_basename()
* to retrieve information about plugin paths.
*
* @since 2.0.0
* @const string
*/
define( 'CODE_SNIPPETS_FILE', __FILE__ );
/**
* Used to determine which version of Code Snippets is running.
*
* @since 3.0.0
* @onst boolean
*/
define( 'CODE_SNIPPETS_PRO', true );
require_once dirname( __FILE__ ) . '/php/load.php';
} else {
require_once dirname( __FILE__ ) . '/php/deactivation-notice.php';
}
css/common/_editor.scss 0000644 00000004121 15153464547 0011162 0 ustar 00 @import '~codemirror-colorpicker/dist/codemirror-colorpicker.css';
.CodeMirror {
border: 1px solid #dfdfdf;
border-radius: 3px;
height: auto !important;
background-color: #fff;
}
.CodeMirror-code {
outline: none;
}
.CodeMirror-focused .cm-matchhighlight {
color: white !important;
outline: 1px solid green;
}
/* Add a bit of extra space above the editor */
.CodeMirror-sizer {
&::before, &::after {
display: block;
color: #bbb;
}
&::before {
content: '';
padding-bottom: 5px;
}
}
/* Fix cursor color with rubyblue theme (see https://goo.gl/3HDgRm */
.cm-s-rubyblue .CodeMirror-cursor {
border-left: 1px solid white !important;
}
[class*="CodeMirror-lint-marker"], [class*="CodeMirror-lint-message"], .CodeMirror-lint-marker-multiple {
background-image: none;
}
.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
cursor: help;
}
.CodeMirror-lint-marker-multiple {
position: absolute;
top: 0;
}
[class*="CodeMirror-lint-marker"]:before {
font: normal 18px/1 dashicons;
position: relative;
top: -2px;
}
[class*="CodeMirror-lint-message"]:before {
font: normal 16px/1 dashicons;
left: 16px;
position: absolute;
}
.CodeMirror-lint-message-error,
.CodeMirror-lint-message-warning {
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
margin: 5px 0 2px;
padding: 3px 12px 3px 28px;
}
.CodeMirror-lint-message-warning {
background-color: #fff8e5;
border-left: 4px solid #ffb900;
}
.CodeMirror-lint-marker-warning::before, .CodeMirror-lint-message-warning::before {
content: "\f534";
color: #f6a306;
}
.CodeMirror-lint-message-error {
background-color: #fbeaea;
border-left: 4px solid #dc3232;
}
.CodeMirror-lint-marker-error::before, .CodeMirror-lint-message-error::before {
content: "\f153";
color: #dc3232;
}
.CodeMirror-lint-tooltip {
background: none;
border: none;
border-radius: 0;
direction: ltr;
}
.CodeMirror .CodeMirror-matchingbracket {
background: rgba(255, 150, 0, .3);
color: inherit;
}
.CodeMirror .CodeMirror-linenumber {
color: #666;
}
.CodeMirror-foldmarker {
color: inherit;
margin-left: 0.25em;
margin-right: 0.25em;
font-weight: bold;
}
css/common/_theme.scss 0000644 00000001241 15153464547 0010776 0 ustar 00 @use 'sass:color';
$primary: #03c7d2;
$secondary: #d46f4d;
$outline: #9e9e9e;
$core: #0073aa;
$pro: #ce0000;
$php-active: #0073aa;
$php-inactive: #579;
$php-background: #78c8e6;
$css-inactive: #b452cd;
$css-active: #7d26cd;
$css-background: #551a8b;
$css-highlight: #8000ff;
$html-active: #548b54;
$html-background: #548b54;
$html-highlight: $html-active;
$js-inactive: #cd6600;
$js-active: #d44500;
$js-background: #cd6600;
$js-highlight: #cd6600;
$brand-discord: #5865f2;
$brand-facebook: #3b5998;
@mixin link-colors($color, $lightness: 15%) {
a {
color: $color;
&:hover, &:active, &:focus {
color: color.adjust($color, $lightness: $lightness);
}
}
}
css/common/_type-badges.scss 0000644 00000003265 15153464547 0012110 0 ustar 00 @use 'theme';
.nav-tab .badge, .snippet-type-badge, .go-pro-button .badge, .button .badge {
font-size: 10px;
text-transform: uppercase;
border: 1px solid;
padding: 1px 2px;
border-radius: 5px;
}
.nav-tab .badge, .button .snippet-type-badge, .go-pro-button .badge,
h1 .snippet-type-badge, h2 .snippet-type-badge, h3 .snippet-type-badge {
/* rtl:ignore */
margin-left: 3px;
}
.button .badge {
font-size: 8px;
text-transform: lowercase;
}
.nav-tab span,
.nav-tab .badge {
vertical-align: middle;
}
$badges: (php: theme.$php-active, css: theme.$css-highlight, js: theme.$js-highlight, html: theme.$html-active);
@each $type, $color in $badges {
.nav-tab[data-snippet-type=#{$type}] .badge, .snippet-type-badge[data-snippet-type=#{$type}] {
color: $color;
border-color: currentColor;
}
.nav-tab-inactive[data-snippet-type=#{$type}]:hover .badge {
color: $color;
}
}
.nav-tab-button .dashicons-external {
font-size: 15px;
color: #666;
vertical-align: middle;
}
.nav-tab.nav-tab-inactive {
background: transparent;
text-shadow: 0 1px 0 #fff;
&, .badge {
color: #a7aaad;
}
&:hover {
color: #50575e;
}
}
.go-pro-badge, .pro-badge, .core-badge {
margin-left: 3px;
border: 1px solid currentColor;
border-radius: 5px;
font-size: 10px;
padding: 1px 2px;
text-transform: uppercase;
}
.go-pro-badge, .pro-badge {
color: theme.$pro;
}
.core-badge {
color: theme.$core;
}
.go-pro-button .badge, .go-pro-badge {
color: theme.$pro;
border-color: theme.$pro;
margin-left: 1px;
}
.wp-core-ui .button.nav-tab-button {
margin-left: 0.5em;
float: right;
color: #a7aaad;
background: #f6f7f7;
border-color: #f6f7f7;
&:hover {
background-color: #fff;
color: #3c434a;
}
}
css/edit/_gpt.scss 0000644 00000002046 15153464547 0010127 0 ustar 00 .cloud-create-modal {
.components-modal__content {
min-width: 550px;
}
.action-buttons {
display: flex;
justify-content: flex-end;
}
.components-button.is-secondary {
box-shadow: none;
}
.notice {
margin-left: 0;
margin-right: 0;
}
}
.generate-button {
float: right;
display: flex;
align-items: center;
.dashicons-warning {
color: #b32d2e;
margin-right: 11px;
}
}
.code-line-explanation {
display: flex;
align-items: center;
font-size: 13px;
margin: 0;
padding: 0 8px;
background-color: #fff;
border: 1px solid #bbb;
border-left: 0;
border-right: 0;
color: #666;
font-style: italic;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen-Sans, Ubuntu, Cantarell, Helvetica Neue, sans-serif;
img {
height: 1rem;
padding-right: 5px;
}
}
.cloud-connect-modal {
.icons-group {
display: flex;
align-items: center;
justify-content: center;
.dashicons {
width: 50px;
height: 50px;
font-size: 50px;
}
}
.action-buttons {
display: flex;
justify-content: flex-end;
}
}
css/edit/_tags.scss 0000644 00000003020 15153464547 0010264 0 ustar 00 /**
* Code based on Tagger, copyright (c) 2018-2022 Jakub T. Jankiewicz <https://jcubic.pl/me>.
* Released under the MIT license.
*/
.tagger {
border: 0;
}
.tagger > ul {
display: flex;
width: 100%;
align-items: center;
padding: 4px 5px 0;
justify-content: space-between;
box-sizing: border-box;
height: auto;
flex: 0 0 auto;
overflow-y: auto;
margin: 0;
list-style: none;
border: 1px solid #dfdfdf;
border-radius: 3px;
background-color: #fff;
}
.tagger > ul > li {
padding-bottom: 0.4rem;
margin: 0.4rem 5px 4px;
&:not(.tagger-new) {
a, a:visited {
text-decoration: none;
color: black;
}
> :first-child {
padding: 4px 4px 4px 8px;
background: #B1C3D7;
border: 1px solid #4181ed;
border-radius: 3px;
}
> span,
> a > span {
white-space: nowrap;
}
}
}
.tagger li a.close {
padding: 4px;
margin-left: 4px;
&:hover {
color: white;
}
}
.tagger .tagger-new {
flex-grow: 1;
position: relative;
min-width: 40px;
input {
border: none;
outline: none;
box-shadow: none;
width: 100%;
padding-left: 0;
box-sizing: border-box;
background: transparent;
}
}
.tagger.wrap > ul {
flex-wrap: wrap;
justify-content: start;
}
.tagger-new ul,
.tagger > ul > li:not(.tagger-new) > a,
.tagger li:not(.tagger-new) > span {
border-radius: 6px;
border: 1px solid #cad8f3;
background-color: #dee7f8;
&:hover {
background-color: #bbcef1;
border-color: #6d95e0;
}
}
.tagger-new ul,
.tagger > ul > li:not(.tagger-new) {
a, a:visited {
color: #555;
font-size: 1.1em;
}
}
css/edit/_tooltips.scss 0000644 00000001610 15153464547 0011206 0 ustar 00
.editor-help-tooltip {
cursor: help;
padding: 0.3em 0.3em 0;
display: inline-block;
font-size: 10px;
background: transparent !important;
}
.snippet-editor-help {
position: absolute;
right: 5px;
top: 5px;
&:hover .editor-help-text {
visibility: visible;
opacity: 1;
}
}
.editor-help-text {
visibility: hidden;
background-color: #555;
color: #fff;
padding: 5px;
border-radius: 6px;
position: absolute;
z-index: 99;
top: 125%;
right: 0;
margin-right: -10px;
opacity: 0;
transition: opacity 0.3s;
white-space: nowrap;
font-size: small;
&::after {
content: "";
position: absolute;
bottom: 100%;
right: 0;
margin-right: 10px;
border: 5px solid transparent;
border-bottom-color: #555;
}
td:first-child {
padding-right: 0.5em;
}
.mac-key {
display: none;
}
&.platform-mac {
.mac-key {
display: inline;
}
.pc-key {
display: none;
}
}
}
css/edit/_types.scss 0000644 00000001721 15153464547 0010500 0 ustar 00
.CodeMirror-sizer {
min-height: 300px !important;
box-sizing: border-box;
padding-bottom: 1.5em !important;
&::after {
position: absolute;
bottom: 0;
}
}
.snippet-scope {
display: none;
.description {
display: block;
}
}
.snippet-form.php-snippet {
.php-scopes-list {
display: block;
}
.CodeMirror-sizer {
padding-bottom: 0 !important;
&::before {
content: '<?php';
}
}
}
.snippet-form.css-snippet {
.css-scopes-list {
display: block;
}
.CodeMirror-sizer {
&::before {
content: '<style>';
}
&::after {
content: '</style>';
}
}
}
.snippet-form.js-snippet {
.js-scopes-list {
display: block;
}
.CodeMirror-sizer {
&::before {
content: '<script>';
}
&::after {
content: '</script>';
}
}
}
.snippet-form.html-snippet {
.html-scopes-list {
display: block;
}
.CodeMirror-sizer {
&::before {
content: '<!-- begin content -->';
}
&::after {
content: '<!-- end content -->';
}
}
}
css/edit/_upgrade-dialog.scss 0000644 00000001604 15153464547 0012220 0 ustar 00 .code-snippets-upgrade-dialog {
.logo {
font-size: 25px;
display: grid;
gap: 0.2em;
grid-template-columns: auto auto;
justify-content: center;
align-items: center;
color: #3f444b;
img {
height: 50px;
}
}
p {
text-align: left;
}
ul {
list-style: none;
li:before {
content: '✓ ';
margin-left: 1em;
color: #2ecc40;
}
}
.components-modal__content {
margin-top: 0;
padding: 32px;
}
.upgrade-plans {
text-align: center;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
margin: 2em 0;
}
.action-buttons {
display: grid;
grid-template-columns: auto auto;
justify-content: space-around;
align-items: center;
margin-bottom: 0;
}
.current-plan-cost {
font-size: 1rem;
}
.button .dashicons,
.button svg {
vertical-align: middle;
margin-left: 1ch;
}
.components-external-link.button {
text-decoration: none;
}
}
css/edit.scss 0000644 00000004312 15153464547 0007174 0 ustar 00 @use 'common/editor';
@use 'common/type-badges';
@use 'edit/tooltips';
@use 'edit/types';
@use 'edit/tags';
@use 'edit/upgrade-dialog';
@use 'edit/gpt';
/**
* Custom styling for the single snippet admin page
*/
.form-table th {
width: auto;
}
.notice.error blockquote {
margin-bottom: 0;
}
h2 {
/* Provide some decent space between the fields and titles. */
margin: 25px 0 15px;
label {
cursor: auto;
}
}
h2:first-of-type, .submit-inline {
margin: 20px 0 10px;
}
.saved-snippet {
&.inactive-snippet, &.active-snippet {
#title {
border-left-width: 4px;
}
}
&.active-snippet #title {
border-left-color: #46b450;
}
&.inactive-snippet #title {
border-left-color: #bbb;
}
&.erroneous-snippet #title {
border-left-color: #dc3232;
}
}
#snippet-form {
margin-top: 10px;
#snippet-tags, textarea {
width: 100%;
font-family: monospace;
}
}
/* Position the description heading on the same level as the editor buttons */
label[for='snippet_description'] h3 div {
position: absolute;
}
/* Add spacing in between the action buttons */
.button + .button,
.generate-button + .button {
margin-left: .5em;
}
h2 .button {
font-weight: normal;
}
.button svg {
height: 1rem;
vertical-align: middle;
line-height: 1;
margin: -2px 3px 0 0;
}
.submit, .submit-inline {
display: flex;
}
.submit-inline {
float: right;
margin-bottom: 0;
}
p.snippet-scope, .snippet-scope p {
margin-top: 15px;
}
.snippet-description-container {
margin-top: 25px;
.wp-editor-tools {
padding-top: 5px;
}
.wp-editor-tabs {
float: left;
}
}
.snippet-scope label,
.html-shortcode-options strong {
display: inline-block;
margin-right: 1.5em;
}
.below-snippet-editor {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
padding-top: 1px;
}
.snippet-priority {
label {
font-weight: bold;
cursor: help;
font-size: 1.1em;
padding-right: 0.5em;
}
input {
width: 4em;
}
}
.snippet-editor {
position: relative;
}
.CodeMirror {
width: 100%;
}
.wrap h2.nav-tab-wrapper {
border-bottom: none;
}
.code-snippets-copy-text {
color: inherit;
}
.wrap .notice {
scroll-margin: 0.75em;
}
#edit-snippet-form-container .cs-sticky-notice {
position: sticky;
top: 40px;
z-index: 100;
}
css/manage/_cloud.scss 0000644 00000015042 15153464547 0010746 0 ustar 00
.cloud-search-info {
text-align: justify;
small {
color: #646970;
float: right;
}
}
.thickbox-code-viewer {
min-height: 250px;
background-color: hsl(0, 0%, 96.5%);
padding: 20px;
border-radius: 10px;
}
#snippet-code-thickbox {
display: block;
width: 100%;
}
.cloud-icon {
margin-right: 3px;
}
.nav-tab-inactive .cloud-badge {
color: #a7aaad;
}
.nav-tab-inactive[data-snippet-type=cloud]:hover .cloud-badge {
color: #00bcd4;
}
.cloud-synced-legend {
color: #00bcd4;
}
.cloud-synced {
color: #00bcd4;
}
.cloud-downloaded {
color: #e91e63;
}
.nav-tab-inactive[data-snippet-type=cloud_search]:hover .cloud-badge {
color: #e91e63;
}
.nav-tab-inactive[data-snippet-type=bundles]:hover .cloud-badge {
color: #50575e;
}
.cloud-not-downloaded {
color: #9e9e9e;
}
.cloud-update {
color: #ff9800 !important;
}
.cloud_update a {
color: #ff9800 !important;
text-decoration: underline;
}
.cloud-table > tbody > tr {
height: 80px;
box-shadow: inset 0 -1px 0 rgb(0 0 0 / 10%);
}
.cloud-table > tbody > tr > td {
max-width: 250px;
}
.cloud-table tbody .active-snippet .column-name {
font-weight: 400;
max-width: 400px;
white-space: normal !important;
}
.cloud-table td .no-results {
margin-top: 15px;
color: #e32121;
text-align: center;
}
.updated.column-updated span {
text-decoration: dotted underline;
}
.column-download a, .action-button-link {
border: 1px solid;
border-radius: 5px;
padding: 5px;
margin-bottom: 5px;
display: block;
text-align: center;
background: transparent;
}
.cloud-snippet-download {
color: #2271b1 !important;
}
.cloud-snippet-downloaded, .cloud-snippet-preview-style {
color: #616161 !important;
}
.cloud-snippet-update {
color: #ff9800 !important;
}
.snippet-type-badge {
white-space: nowrap;
}
.cloud-badge {
margin-left: 10px;
border: 1px solid;
border-radius: 5px;
font-size: 15px;
line-height: 19px;
}
#cloud-search-form {
margin-top: 30px;
margin-bottom: 30px;
text-align: center;
}
.input-group {
position: relative;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: stretch;
-ms-flex-align: stretch;
align-items: stretch;
max-width: 900px;
margin: 0 auto;
}
#cloud_search {
display: block;
padding: 0.375rem 0.75rem;
font-size: 1rem;
color: #495057;
background-clip: padding-box;
border-radius: 0;
transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
position: relative;
-webkit-box-flex: 1;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
width: 1%;
margin-bottom: 0;
&:focus {
outline: 0;
border: 1px solid #8c8f94;
box-shadow: none;
}
}
#cloud-select-prepend {
margin-right: -3px;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
position: relative;
z-index: 2;
color: #2271b1;
border-color: #2271b1;
background-color: #f6f7f7;
&:hover {
background-color: #f0f0f1;
border-color: #0a4b78;
color: #0a4b78;
}
}
#cloud-search-submit {
padding: 0 15px;
margin-left: -3px;
display: flex;
justify-content: center;
align-items: center;
}
.cloud-search {
margin-left: 5px;
}
.bundle-group {
margin-top: 10px;
justify-content: space-between;
display: flex;
gap: 5px;
flex-wrap: nowrap;
}
#cloud-bundles {
color: #495057;
display: flex;
flex: 1 1 auto;
font-size: 1rem;
padding: 0.375rem 0.75rem;
position: relative;
width: 50%;
}
#cloud-bundle-show {
width: 10%;
}
#cloud-bundle-run {
width: 15%;
}
#bundle_share_name {
color: #495057;
font-size: 1rem;
width: 25%;
}
.heading-box {
max-width: 900px;
margin: auto;
padding-bottom: 1rem;
}
.cloud-search-heading {
font-size: 23px;
font-weight: 400;
padding: 9px 0 4px;
line-height: 1.3;
text-align: center;
margin-bottom: 0;
}
.cloud-badge.ai-icon {
font-size: 12px;
padding: 3px;
margin-left: 5px;
color: #b22222;
}
.cloud-search-card-bottom {
min-height: 40px;
}
#cloud-search-results .cloud-snippets #the-list {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.cloud-snippets .plugin-card {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.cloud-connect-wrap {
display: flex;
justify-content: space-between;
align-items: center;
max-height: 35px;
margin: 0 3px;
float: right;
gap: 5px;
}
.cloud-status-dot {
height: 10px;
width: 10px;
background-color: #ce0000;
border-radius: 50%;
.cloud-connect-active & {
background-color: #25a349;
}
}
.cloud-connect-text {
color: #ce0000;
.cloud-connect-active & {
color: #2e7d32;
}
}
.voted-info {
display: inline-flex;
gap: 3px;
align-items: center;
margin-bottom: 6px !important;
&:hover {
.thumbs-up {
stroke: #059669;
fill: #6ee7b7;
animation: thumb 1s ease-in-out infinite;
}
}
}
.thumbs-up {
width: 1.25rem; /* 20px */
height: 1.25rem; /* 20px */
transform-origin: bottom left;
&:hover {
stroke: #059669;
fill: #6ee7b7;
}
}
.ai-verified-snippet .badge, .snippet-type-badge[data-type=ai-verified] {
background-color: #ccfbf1;
color: #0f766e;
}
.private-snippet .badge, .snippet-type-badge[data-type=private] {
background-color: #eff6ff;
color: #1d4ed8;
}
.public-snippet .badge, .snippet-type-badge[data-type=public] {
background-color: #fefce8;
color: #a16207;
}
.unverified-snippet .badge, .snippet-type-badge[data-type=unverified] {
background-color: #fff1f2;
color: #be123c;
&:hover {
background-color: #fde2e4;
color: #be123c;
}
}
.no-results {
font-size: 15px;
}
.css-badge {
color: #8000ff !important;
}
.js-badge {
color: #cd6600 !important;
}
.php-badge {
color: #0073aa !important;
}
.html-badge {
color: #548b54 !important;
}
.tooltip-box {
position: relative;
display: inline-block;
}
.tooltip-box .tooltip-text {
visibility: hidden;
width: 400px;
background-color: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(3px);
padding: 6px;
position: absolute;
z-index: 5;
border-radius: 5px;
}
.tooltip-box:hover .tooltip-text {
visibility: visible;
}
.tooltip-text-item, .tooltip-text-link {
color: #fff !important;
text-align: center;
}
.tooltip-text-title {
font-weight: bold;
text-decoration: underline;
color: #fff !important;
text-align: center;
}
.tooltip-text-link {
text-decoration: underline;
}
.tooltip-box .cloud-key {
right: 0;
color: white;
width: 450px;
}
.plugin-card-bottom {
overflow: visible !important;
}
.beta-test-notice {
margin-top: 20px;
}
.highlight-yellow {
background: #ffee58;
padding: 3px;
border-radius: 3px;
}
@keyframes thumb {
0% {
transform: rotate(0)
}
33% {
transform: rotate(7deg)
}
66% {
transform: rotate(-15deg)
}
90% {
transform: rotate(5deg)
}
to {
transform: rotate(0)
}
}
css/manage.scss 0000644 00000012450 15153464547 0007501 0 ustar 00 /**
* Custom styling for the snippets table
*/
$active-color: #2196f3;
$inactive-color: #ccc;
@use 'common/theme';
@use 'common/type-badges';
@use 'manage/cloud';
.column-name,
.column-type {
.dashicons {
font-size: 16px;
width: 16px;
height: 16px;
vertical-align: middle;
}
.dashicons-clock {
vertical-align: middle;
}
}
.active-snippet .column-name > a {
font-weight: 600;
}
.column-priority input {
appearance: none;
background: none;
border: none;
box-shadow: none;
width: 4em;
color: #666;
text-align: center;
&:hover, &:focus, &:active {
color: #000;
background-color: #f5f5f5;
background-color: rgba(0, 0, 0, 0.1);
border-radius: 6px;
}
&:disabled {
color: inherit;
}
}
.snippet-execution-button,
.snippet-activation-switch {
display: block;
position: relative;
}
.snippet-activation-switch {
margin-top: 5px;
width: 30px;
height: 17px;
border-radius: 34px;
background-color: #ccc;
&::before {
transition: all .4s;
content: '';
height: 13px;
width: 13px;
display: inline-block;
margin: 2px;
background-color: white;
border-radius: 50%;
}
.snippets .active-snippet & {
background-color: $active-color;
&::before {
transform: translateX(100%);
}
}
.snippets .erroneous-snippet &::before {
content: '!';
transform: translateX(50%);
text-align: center;
font-weight: bold;
line-height: 1;
color: #bbb;
}
}
.snippet-execution-button {
margin-left: 10px;
margin-top: 9px;
width: 0;
height: 0;
border-top: 9px solid transparent;
border-bottom: 9px solid transparent;
border-left: 10px solid $inactive-color;
transition: all 0.3s;
&::before {
content: '';
position: absolute;
top: -14px;
left: -21px;
bottom: -14px;
right: -8px;
border-radius: 50%;
border: 1.8px solid $inactive-color;
z-index: 2;
transition: all .3s;
}
&:hover, &:focus {
border-left-color: #579;
&::before {
transform: scale(1.1);
border-color: #579;
}
}
}
.clear-filters {
vertical-align: baseline !important;
}
.snippets {
tr {
background: #fff;
}
ol, ul {
margin: 0 0 1.5em 1.5em;
}
ul {
list-style: disc;
}
th.sortable a, th.sorted a {
display: flex;
flex-direction: row;
}
.row-actions {
color: #ddd;
position: relative;
left: 0;
}
.column-activate {
padding-right: 0 !important;
}
.clear-filters {
vertical-align: middle;
}
tfoot th.check-column {
padding: 13px 0 0 3px;
}
thead th.check-column,
tfoot th.check-column,
.inactive-snippet th.check-column {
padding-left: 5px;
}
td.column-description {
max-width: 700px;
}
.active-snippet, .inactive-snippet {
td, th {
padding: 10px 9px;
border: none;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}
}
.badge {
margin-left: 4px;
padding: 3px 6px;
text-decoration: none;
border: medium none;
border-radius: 2px;
background-color: #e0e0e0;
background-color: rgba(0, 0, 0, 0.08);
font-size: smaller;
line-height: 1.2;
/* rtl:ignore */
.rtl & {
float: left;
}
}
tr.active-snippet + tr.inactive-snippet th,
tr.active-snippet + tr.inactive-snippet td {
border-top: 1px solid rgba(0, 0, 0, 0.03);
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02), inset 0 -1px 0 #e1e1e1;
}
&, #all-snippets-table, #search-snippets-table {
a.delete:hover {
border-bottom: 1px solid #f00;
color: #f00;
}
}
#wpbody-content & .column-name {
white-space: nowrap; /* prevents wrapping of snippet title */
}
}
.inactive-snippet {
@include theme.link-colors(theme.$php-inactive);
}
.active-snippet {
td, th {
background-color: rgba(theme.$php-background, 0.06);
}
th.check-column {
border-left: 2px solid #2ea2cc;
}
.snippet-activation-switch {
background-color: $active-color;
}
}
@mixin snippet-type-colors($type, $active, $inactive, $background, $highlight) {
.#{$type}-snippet {
@include theme.link-colors($inactive);
}
.#{$type}-snippet.active-snippet {
@include theme.link-colors($active);
td, th {
background-color: rgba($background, 0.06);
}
.snippet-activation-switch {
background-color: $highlight;
}
th.check-column {
border-left-color: $highlight;
}
}
}
@include snippet-type-colors(css, theme.$css-active, theme.$css-inactive, theme.$css-background, theme.$css-highlight);
@include snippet-type-colors(html, theme.$html-active, theme.$html-active, theme.$html-background, theme.$html-highlight);
@include snippet-type-colors(js, theme.$js-active, theme.$js-inactive, theme.$js-background, theme.$js-highlight);
@media screen and (max-width: 782px) {
p.search-box {
float: left;
position: initial;
margin: 1em 0 0 0;
height: auto;
}
}
.wp-list-table .is-expanded td.column-activate.activate {
/* fix for mobile layout */
display: table-cell !important;
}
.nav-tab-wrapper + .subsubsub, p.search-box {
margin: 10px 0 0 0;
}
.snippet-type-description {
border-bottom: 1px solid #ccc;
margin: 0;
padding: 1em 0;
}
.code-snippets-notice a.notice-dismiss {
text-decoration: none;
}
.refresh-button-container {
display: flex;
align-items: center;
justify-content: flex-start;
margin-top: 15px;
margin-bottom: -39px;
gap: 7px;
}
#refresh-button {
width: 30px;
padding: 0;
font-size: 20px;
line-height: 1.4;
}
@media screen and (max-width: 1190px) {
.nav-tab {
.snippet-label {
display: none;
}
.cloud-badge{
margin-right: 10px;
}
}
}
css/menu-button.scss 0000644 00000000755 15153464547 0010533 0 ustar 00 #adminmenu .code-snippets-upgrade-button {
color: #fff;
background-color: #d46F4d;
border: none;
text-align: center;
font-weight: bold;
transition: background-color .1s linear;
white-space: break-spaces;
line-height: inherit;
display: flex;
justify-content: center;
align-items: center;
&:hover {
background-color: #08c5d1;
}
.dashicons {
vertical-align: text-bottom;
}
}
#adminmenu .wp-submenu a[href="admin.php?page=code_snippets_upgrade"]:hover {
box-shadow: none;
}
css/prism.scss 0000644 00000003715 15153464547 0007407 0 ustar 00 @import '~prismjs/themes/prism.css';
@import '~prismjs/plugins/line-numbers/prism-line-numbers.css';
@import '~prismjs/plugins/toolbar/prism-toolbar.css';
@import '~prismjs/plugins/inline-color/prism-inline-color.css';
@import '~prismjs/plugins/previewers/prism-previewers.css';
@import '~prismjs/plugins/autolinker/prism-autolinker.css';
/* These lines are taken from '~prismjs/plugins/inline-color/prism-inline-color.css', adjusted to avoid autoprefixer
complaining about deprecated syntax. Ideally, they can be removed if the file in question is updated. */
pre[data-line] {
position: relative;
padding: 1em 0 1em 3em;
}
.line-highlight {
position: absolute;
left: 0;
right: 0;
padding: inherit;
margin-top: 1em;
background: hsla(24, 20%, 50%, .08);
background: linear-gradient(to right, hsla(24, 20%, 50%, .1) 70%, hsla(24, 20%, 50%, 0));
pointer-events: none;
line-height: inherit;
white-space: pre;
@media print {
print-color-adjust: exact;
}
&:before, &[data-end]:after {
content: attr(data-start);
position: absolute;
top: .4em;
left: .6em;
min-width: 1em;
padding: 0 .5em;
background-color: hsla(24, 20%, 50%, .4);
color: hsl(24, 20%, 95%);
font: bold 65%/1.5 sans-serif;
text-align: center;
vertical-align: .3em;
border-radius: 999px;
text-shadow: none;
box-shadow: 0 1px white;
}
&[data-end]:after {
content: attr(data-end);
top: auto;
bottom: .4em;
}
.line-numbers &:before, .line-numbers &:after {
content: none;
}
/* Additional fixes to the behaviour of line highlighting with certain themes. */
:not(.is-style-prism-shades-of-purple) pre[class*=language-].line-numbers & {
box-sizing: border-box;
padding: 0;
margin: 1em 0 0;
}
.is-style-prism-coy-without-shadows pre[class*=language-] & {
margin-top: 0;
}
}
pre[id].linkable-line-numbers span.line-numbers-rows {
pointer-events: all;
> span:before {
cursor: pointer;
}
> span:hover:before {
background-color: rgba(128, 128, 128, .2);
}
}
css/settings.scss 0000644 00000003341 15153464547 0010110 0 ustar 00 @use 'common/editor';
$sections: general, editor, debug;
p.submit {
display: flex;
justify-content: space-between;
}
.settings-section,
p.submit {
max-width: 1020px;
}
.nav-tab-wrapper {
margin-bottom: 1em;
}
input[type=number] {
width: 4em;
}
.CodeMirror {
max-width: 800px;
width: 100%;
padding-right: 1em;
}
.CodeMirror-sizer::before {
content: '<?php';
}
body.no-js {
.nav-tab-wrapper {
display: none;
}
.settings-section {
display: block !important;
}
}
body.js {
.settings-section-title {
border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
}
.nav-tab:not(.nav-tab-active) {
cursor: pointer;
}
.settings-section {
display: none;
}
@each $section in $sections {
.wrap[data-active-tab=#{$section}] .#{$section}-settings {
display: block;
}
}
}
.license-status {
display: inline-block;
padding-right: 2em;
line-height: 2;
color: #aaa;
}
.license-status-valid {
color: #2ecc40;
}
.license-status-expired {
color: #dc3232;
}
.wrap[data-active-tab=license] .submit {
display: none;
}
#code_snippets_remove_license {
color: #b32d2e;
border-color: #b32d2e;
}
#code_snippets_license_key {
font-family: Consolas, Monaco, monospace;
}
#cloud_token {
max-width: 450px;
width: 90vw;
}
.cloud-message {
width: fit-content;
padding: 5px;
border-radius: 5px;
font-weight: 600;
}
.cloud-error {
background: #e53935;
color: #ffebee;
}
.cloud-success {
background: #43a047;
color: #e8f5e9;
}
.refresh-success {
background: #2271b1;
color: #ffeb3b;
}
.cloud-settings tbody tr:nth-child(n+5) {
display: none;
}
css/welcome.scss 0000644 00000012705 15153464547 0007707 0 ustar 00 @use 'sass:color';
@use 'common/theme';
@use 'common/type-badges';
$breakpoint: 1060px;
.csp-welcome-wrap {
padding: 25px;
h1, h2, h3 {
font-weight: 700;
margin-top: 10px;
margin-bottom: 10px;
.dashicons {
font-size: 90%;
line-height: inherit;
width: auto;
}
}
h1 {
font-size: 1.6rem;
}
h2 {
font-size: 1.4rem;
}
.dashicons-external {
float: right;
color: #666;
}
}
.csp-welcome-header {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
align-items: center;
.csp-welcome-logo {
display: flex;
flex-direction: row;
align-items: center;
gap: 10px;
h1 {
font-size: 1.4rem;
font-weight: bold;
line-height: 1;
margin: 0;
span {
text-decoration: underline theme.$primary wavy 3px;
text-decoration-skip-ink: none;
text-underline-offset: 11px;
text-transform: capitalize;
}
}
}
}
.csp-welcome-nav {
column-gap: 15px;
display: flex;
flex-flow: row wrap;
justify-content: space-evenly;
margin: 0;
li {
margin-bottom: 0;
}
li a {
margin-top: 10px;
margin-bottom: 10px;
align-items: center;
border-width: 1px;
border-style: solid;
color: white;
cursor: pointer;
display: flex;
font-weight: 400;
gap: 3px;
text-decoration: none;
transition: all .1s ease-in-out;
border-radius: 3px;
padding: 8px;
&:hover {
background: transparent;
}
.dashicons, svg {
text-decoration: none;
margin-top: -1px;
margin-left: 3px;
}
svg {
fill: #fff;
width: 20px;
height: 20px;
font-size: 20px;
vertical-align: top;
}
&:hover svg {
fill: currentColor;
}
}
@each $link_name, $color in (
pro: theme.$secondary,
cloud: #08c5d1,
resources: #424242,
discord: theme.$brand-discord,
facebook: theme.$brand-facebook) {
.csp-link-#{$link_name} {
background: $color;
border-color: $color;
&:hover {
color: $color;
}
}
}
}
.csp-cards {
display: grid;
grid-auto-rows: 1fr;
row-gap: 40px;
grid-template-columns: repeat(4, 1fr);
gap: 15px;
@media (max-width: $breakpoint) {
grid-template-columns: 1fr !important;
}
}
.csp-card {
border: 1px solid theme.$outline;
background: white;
border-radius: 10px;
display: flex;
flex-flow: column;
}
a.csp-card {
text-decoration: none;
&:hover {
background: color.adjust(theme.$primary, $lightness: 55%);
transition: .5s background-color;
box-shadow: 0 1px 1px rgb(255 255 255 / 50%);
.dashicons-external {
color: #000;
}
}
}
.csp-section-changes {
border: 1px solid theme.$outline;
border-left: 0;
border-right: 0;
padding: 40px 0 50px 0;
display: flex;
flex-direction: column;
row-gap: 20px;
margin-top: 30px;
.csp-cards {
grid-template-columns: 2fr 1fr;
gap: 20px;
}
.csp-card {
padding: 20px;
box-shadow: 0 1px 1px rgb(0 0 0 / 5%);
h2 {
color: theme.$primary;
}
&:last-child {
overflow-y: scroll;
}
}
.csp-section-changelog {
font-size: 0.9rem;
line-height: 1.5;
color: #333;
height: 400px;
h3 {
float: right;
color: #666;
}
h4 {
margin: 30px 0 10px;
}
ul {
margin-top: 5px;
}
li {
display: grid;
grid-template-columns: 40px 1fr;
grid-template-rows: 1fr;
align-items: baseline;
gap: 7px;
}
li .badge {
text-align: center;
}
> article::after {
border-bottom: 1px solid #666;
content: ' ';
display: block;
width: 50%;
margin: 3em auto 0;
}
> article:last-child {
padding-bottom: 1px;
&::after {
border: 0;
}
}
}
figure {
margin: 1em 0 0;
overflow: hidden;
border-radius: 0.5rem;
border: 1px solid grey;
position: relative;
height: auto;
background: #646970;
img {
width: 100%;
height: 100%;
overflow: hidden;
object-fit: cover;
}
}
.dashicons-lightbulb {
color: #f1c40f;
}
.dashicons-chart-line {
color: #85144b;
}
.dashicons-buddicons-replies {
color: #3D9970;
}
}
.csp-section-articles {
figure img {
aspect-ratio: 1;
}
}
.csp-section-links {
padding: 40px 0 50px 0;
.csp-card {
margin-top: 20px;
justify-content: flex-start;
color: black;
position: relative;
overflow: hidden;
row-gap: 10px;
padding: 1rem;
width: 85%;
header {
flex: 1;
}
figure {
margin: 1em 0 0 0;
img {
border-radius: 5px;
width: 100%;
height: 100%;
max-height: 300px;
overflow: hidden;
object-fit: cover;
}
}
.csp-card-item-category {
color: white;
background: theme.$secondary;
display: block;
font-size: .9rem;
letter-spacing: 1px;
margin-bottom: 0;
margin-top: 0;
text-transform: uppercase;
width: fit-content;
padding: 5px 15px;
border-radius: 50px;
}
h3 {
font-size: 1.7rem;
color: theme.$primary;
line-height: normal;
}
.csp-card-item-description {
color: #51525c;
font-size: 1rem;
font-weight: 300;
}
footer {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
}
}
.csp-section-articles {
h2 {
font-size: 1.1rem;
}
}
.csp-section-partners {
border-top: 1px solid theme.$outline;
header {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
align-items: center;
}
}
.csp-loading-spinner {
height: 0;
width: 0;
padding: 15px;
border: 6px solid #e7c0b3;
border-right-color: theme.$secondary;
border-radius: 22px;
animation: loading-rotate 1s infinite linear;
position: absolute;
left: 47%;
top: 45%;
}
@keyframes loading-rotate {
100% {
transform: rotate(360deg);
}
}
dist/edit-rtl.css 0000644 00000125516 15153464547 0007775 0 ustar 00 .codemirror-colorview{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;border:1px solid #cecece;box-sizing:border-box;cursor:pointer;display:inline-block;height:10px;margin:0 2px;position:relative;vertical-align:middle;width:10px}.codemirror-colorview .codemirror-colorview-background{bottom:0;content:"";right:0;position:absolute;left:0;top:0}.codemirror-colorview:hover{border-color:#494949}.codemirror-colorpicker{background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:3px;box-shadow:0 0 10px 2px rgba(0,0,0,.12);display:inline-block;position:relative;width:224px;z-index:1000}.codemirror-colorpicker>.arrow{border-bottom:10px solid rgba(0,0,0,.2);border-right:10px solid transparent;border-left:10px solid transparent;display:none;height:0;right:7px;pointer-events:none;position:absolute;top:-10px;width:0}.codemirror-colorpicker>.arrow:after{border-bottom:9px solid #fff;border-right:9px solid transparent;border-left:9px solid transparent;content:"";height:0;right:-9px;position:absolute;top:1px;width:0}.codemirror-colorpicker .colorpicker-body .arrow-button{background-color:transparent;height:12px;padding:0;position:relative;width:10px}.codemirror-colorpicker .colorpicker-body .arrow-button:before{border-bottom:3px solid #000;height:50%;top:0}.codemirror-colorpicker .colorpicker-body .arrow-button:after,.codemirror-colorpicker .colorpicker-body .arrow-button:before{border-right:3px solid transparent;border-left:3px solid transparent;box-sizing:border-box;content:"";display:inline-block;height:0;right:0;margin:2px;pointer-events:none;position:absolute;left:0;width:0}.codemirror-colorpicker .colorpicker-body .arrow-button:after{border-top:3px solid #000;bottom:0;top:50%}.codemirror-colorpicker .colorpicker-body .color{cursor:pointer;height:120px;overflow:hidden;position:relative}.codemirror-colorpicker .colorpicker-body .color>.saturation,.codemirror-colorpicker .colorpicker-body .color>.saturation>.value{height:100%;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value>.drag-pointer{border-radius:50%;height:10px;position:absolute;transform:translateX(50%) translateY(-50%);width:10px}.codemirror-colorpicker .colorpicker-body .color>.saturation{background-color:hsla(20,42%,65%,0);background-image:linear-gradient(-90deg,#fff,hsla(20,42%,65%,0));background-repeat:repeat-x}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0))}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value>.drag-pointer{border:1px solid #fff;box-shadow:0 0 2px 0 rgba(0,0,0,.05)}.codemirror-colorpicker .colorpicker-body .control{padding:10px 0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper{padding-right:30px}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper .el-cp-color-control__left{border-radius:50%;box-sizing:border-box;height:30px;right:12px;position:absolute;top:20px;width:30px}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper>.color,.codemirror-colorpicker .colorpicker-body .control.has-eyedropper>.empty{right:45px}.codemirror-colorpicker .colorpicker-body .control>.color,.codemirror-colorpicker .colorpicker-body .control>.empty{border-radius:50%;box-sizing:border-box;height:30px;right:12px;position:absolute;top:14px;width:30px}.codemirror-colorpicker .colorpicker-body .control>.color{border:1px solid rgba(0,0,0,.1)}.codemirror-colorpicker .colorpicker-body .control>.hue{box-sizing:border-box;cursor:pointer;margin:0 42px 0 0;padding:6px 16px;position:relative}.codemirror-colorpicker .colorpicker-body .control>.hue>.hue-container{border-radius:3px;height:10px;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .control>.opacity{box-sizing:border-box;cursor:pointer;margin:0 42px 0 0;padding:3px 16px;position:relative}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container{border-radius:3px;height:10px;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .control .drag-bar,.codemirror-colorpicker .colorpicker-body .control .drag-bar2{border-radius:50%;cursor:pointer;height:12px;right:0;position:absolute;top:50%;transform:translateX(50%) translateY(-50%);width:12px}.codemirror-colorpicker .colorpicker-body .control>.hue>.hue-container{background:linear-gradient(-90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container>.color-bar{bottom:0;content:"";display:block;right:0;position:absolute;left:0;top:0}.codemirror-colorpicker .colorpicker-body .control>.empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat}.codemirror-colorpicker .colorpicker-body .control .drag-bar,.codemirror-colorpicker .colorpicker-body .control .drag-bar2{background-color:#fefefe;border:1px solid rgba(0,0,0,.05);box-shadow:-2px 2px 2px 0 rgba(0,0,0,.2)}.codemirror-colorpicker .colorpicker-body .information{box-sizing:padding-box;position:relative}.codemirror-colorpicker .colorpicker-body .information>input{bottom:20px;box-sizing:border-box;font-size:10px;height:20px;padding:0 2px 0 0;position:absolute;-webkit-user-select:text;-moz-user-select:text;user-select:text}.codemirror-colorpicker .colorpicker-body .information>input[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.codemirror-colorpicker .colorpicker-body .information>input[type=number]::-webkit-inner-spin-button,.codemirror-colorpicker .colorpicker-body .information>input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.codemirror-colorpicker .colorpicker-body .information.hex>.information-item.hex,.codemirror-colorpicker .colorpicker-body .information.hsl>.information-item.hsl,.codemirror-colorpicker .colorpicker-body .information.rgb>.information-item.rgb{display:flex}.codemirror-colorpicker .colorpicker-body .information>.information-item{box-sizing:border-box;display:none;margin-left:40px;padding:0 9px 0 5px;position:relative}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field{box-sizing:border-box;display:block;flex:1;padding:3px;position:relative}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field>.title{color:#a9a9a9;cursor:pointer;font-size:12px;padding-top:2px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input{border:1px solid #cbcbcb;border-radius:2px;box-sizing:border-box;color:#333;font-size:11px;height:21px;padding:3px;text-align:center;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:100%}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]::-webkit-inner-spin-button,.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field.hsl-l input[type=number],.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field.hsl-s input[type=number]{padding-right:1px;padding-left:10px}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field .postfix{box-sizing:border-box;display:inline-block;font-size:11px;height:21px;line-height:2;padding:2px;position:absolute;left:3px;text-align:center;top:2px}.codemirror-colorpicker .colorpicker-body .information>.information-change{bottom:0;box-sizing:border-box;display:block;padding-top:5px;position:absolute;left:0;text-align:center;top:0;width:40px}.codemirror-colorpicker .colorpicker-body .information>.information-change>.format-change-button{background:transparent;border:0;box-sizing:border-box;cursor:pointer;outline:none}.codemirror-colorpicker .colorpicker-body .information>.title{color:#a3a3a3}.codemirror-colorpicker .colorpicker-body .information>.input{color:#333}.codemirror-colorpicker .colorpicker-body .colorsets{border-top:1px solid #e2e2e2}.codemirror-colorpicker .colorpicker-body .colorsets>.menu{float:left;padding:10px 5px 10px 15px}.codemirror-colorpicker .colorpicker-body .colorsets>.menu button{border:0;cursor:pointer;font-family:serif,sans-serif;font-size:14px;font-weight:300;outline:none}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list{box-sizing:border-box;display:block;line-height:0;margin-left:30px;padding:12px 12px 0 0}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item{background-size:contain;border-radius:2px;box-sizing:border-box;cursor:pointer;display:inline-block;height:13px;margin-bottom:12px;margin-left:12px;overflow:hidden;position:relative;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item:hover{transform:scale(1.2)}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item .empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;height:100%;right:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item .color-view{border:1px solid rgba(0,0,0,.1);box-sizing:border-box;height:100%;right:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .add-color-item{color:#8e8e8e;cursor:pointer;display:inline-block;font-family:serif,sans-serif;font-size:16px;font-weight:400;height:13px;line-height:1;margin-bottom:12px;margin-left:12px;text-align:center;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .color-chooser{background-color:rgba(0,0,0,.5);bottom:0;right:0;opacity:0;pointer-events:none;position:absolute;left:0;top:0;transition:opacity .05s ease-out}.codemirror-colorpicker .colorpicker-body .color-chooser.open{opacity:1;pointer-events:all}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container{background-color:#fff;bottom:0;right:0;position:absolute;left:0;top:120px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;display:flex;height:34px;right:0;padding:3px 0;position:absolute;left:0;top:0}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header .title{box-sizing:border-box;color:#000;flex:2;font-size:15px;font-weight:700;margin:0;overflow:hidden;padding:5px 14px 5px 5px;text-align:right;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header .items{cursor:pointer;display:block;flex:1;height:100%;line-height:2;padding-left:10px;text-align:left}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list{bottom:0;right:0;overflow:auto;position:absolute;left:0;top:34px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item{border-bottom:1px solid rgba(0,0,0,.1);cursor:pointer;display:flex;padding:3px 0}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item:hover{background-color:rgba(0,0,0,.05)}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .title{box-sizing:border-box;color:#000;flex:2;font-size:14px;font-size:13px;font-weight:400;margin:0;overflow:hidden;padding:5px 14px 5px 5px;pointer-events:none;text-align:right;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items{cursor:pointer;display:block;flex:3;height:100%;line-height:1.6;pointer-events:none}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;background-size:contain;border:1px solid #ddd;border-radius:3px;box-sizing:border-box;cursor:pointer;display:inline-block;height:13px;margin-left:10px;overflow:hidden;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item .color-view{height:100%;margin:0;padding:0;pointer-events:none;width:100%}.codemirror-colorpicker.sketch{border-radius:5px}.codemirror-colorpicker.sketch>.colorpicker-body>.color{box-sizing:border-box;height:150px;margin:10px 10px 2px}.codemirror-colorpicker.sketch>.colorpicker-body>.control{padding:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control.has-eyedropper{padding-right:30px}.codemirror-colorpicker.sketch>.colorpicker-body>.control.has-eyedropper .el-cp-color-control__left{top:4px}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.color,.codemirror-colorpicker.sketch>.colorpicker-body>.control>.empty{border-radius:2px;box-sizing:border-box;height:26px;right:auto;position:absolute;left:10px;top:1px;width:26px}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.color{box-shadow:inset 0 0 1px 0 rgba(0,0,0,.5)}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.hue{margin:0 0 0 38px;padding:2px 10px 2px 2px;position:relative}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.hue>.hue-container{border-radius:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.opacity{margin:0 0 0 38px;padding:2px 10px 2px 2px;position:relative}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.opacity>.opacity-container{border-radius:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2{border-radius:0;border-radius:1px;bottom:1px!important;height:50%;right:0;top:50%;transform:translateX(50%) translateY(-50%);width:2px}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar.first,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2.first{right:0;transform:translateX(-50%) translateY(-50%)!important}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar.last,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2.last{transform:translateX(150%) translateY(-50%)!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-change{display:none}.codemirror-colorpicker.sketch>.colorpicker-body>.information.rgb .information-item.rgb{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information.rgb .information-item.hsl{display:none!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hex .information-item.hex{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hex .information-item.hsl,.codemirror-colorpicker.sketch>.colorpicker-body>.information.hsl .information-item.rgb{display:none!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hsl .information-item.hsl{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item{display:inline-flex!important;margin-left:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field{padding-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field:last-child{padding-left:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field>.title{color:#000;cursor:pointer;font-size:11px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field:last-child:not(:first-child){padding-left:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.hex{padding-right:5px;padding-left:0;width:74px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.rgb{padding-right:0;padding-left:0;width:140px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.hsl{display:none;padding-right:0;padding-left:0;width:140px}.codemirror-colorpicker.sketch>.colorpicker-body>.colorsets>.color-list{margin-left:0;padding-left:12px}.codemirror-colorpicker.sketch>.colorpicker-body>.colorsets>.color-list .color-item{border-radius:3px;height:16px;margin-bottom:10px;margin-left:9px;width:16px}.codemirror-colorpicker.palette{border-radius:3px;box-shadow:none}.codemirror-colorpicker.palette>.colorpicker-body>.color,.codemirror-colorpicker.palette>.colorpicker-body>.control,.codemirror-colorpicker.palette>.colorpicker-body>.information{display:none}.codemirror-colorpicker.palette>.colorpicker-body>.colorsets{border-top:0;box-sizing:border-box}.codemirror-colorpicker.palette>.colorpicker-body>.colorsets>.color-list .color-item{height:15px;margin-bottom:10px;margin-left:10px;width:15px}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser{box-sizing:border-box;display:none}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open{border:1px solid #d8d8d8;border-radius:3px;bottom:auto;box-shadow:0 0 10px 2px rgba(0,0,0,.12);display:block;right:-1px;left:-1px;top:-1px}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container{background-color:#fff;border-radius:2px;bottom:auto;box-sizing:border-box;right:auto;position:relative;left:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-item-header{border-top-right-radius:3px;border-top-left-radius:3px;bottom:auto;right:auto;position:relative;left:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-list{bottom:auto;right:auto;overflow:auto;position:relative;left:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-list .colorsets-item:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.codemirror-colorpicker.macos .colorpicker-body .wheel{box-sizing:border-box;height:224px;position:relative;width:224px}.codemirror-colorpicker.macos .colorpicker-body .wheel .wheel-canvas{border-radius:50%;height:214px;right:5px;position:absolute;top:5px;width:214px}.codemirror-colorpicker.macos .colorpicker-body .wheel .drag-pointer{border:1px solid #fff;border-radius:50%;display:inline-block;height:10px;right:50%;position:absolute;top:50%;transform:translateX(50%) translateY(-50%);width:10px;z-index:2}.codemirror-colorpicker.macos .control{padding-top:0}.codemirror-colorpicker.macos .control>.color,.codemirror-colorpicker.macos .control>.empty{top:4px}.codemirror-colorpicker.macos .control.has-eyedropper{padding-right:30px}.codemirror-colorpicker.macos .control.has-eyedropper .el-cp-color-control__left{top:9px}.codemirror-colorpicker.macos .value{box-sizing:border-box;cursor:pointer;margin:0 42px 0 0;padding:6px 16px;position:relative}.codemirror-colorpicker.macos .value>.value-container{background-image:linear-gradient(-90deg,#000 0,hsla(0,0%,100%,0));border-radius:3px;box-sizing:border-box;height:10px;position:relative;width:100%}.codemirror-colorpicker.macos .value>.value-container .drag-bar{border-radius:50%;cursor:pointer;height:12px;right:0;position:absolute;top:50%;transform:translateX(50%) translateY(-50%);width:12px}.codemirror-colorpicker.mini{display:inline-block;width:180px}.codemirror-colorpicker.mini .control{padding:0}.codemirror-colorpicker.mini .control .hue,.codemirror-colorpicker.mini .control .opacity{margin:0;padding:0}.codemirror-colorpicker.mini .control .hue>.hue-container,.codemirror-colorpicker.mini .control .opacity>.opacity-container{border-radius:0;height:20px;overflow:hidden}.codemirror-colorpicker.mini .control .drag-bar,.codemirror-colorpicker.mini .control .drag-bar2{background-color:transparent;border:0;box-shadow:none;box-sizing:border-box;height:100%;width:5px}.codemirror-colorpicker.mini .control .drag-bar.last:before,.codemirror-colorpicker.mini .control .drag-bar.lastafter,.codemirror-colorpicker.mini .control .drag-bar2.last:before,.codemirror-colorpicker.mini .control .drag-bar2.lastafter{right:1px}.codemirror-colorpicker.mini .control .drag-bar.first:after,.codemirror-colorpicker.mini .control .drag-bar.first:before,.codemirror-colorpicker.mini .control .drag-bar2.first:after,.codemirror-colorpicker.mini .control .drag-bar2.first:before{right:3px}.codemirror-colorpicker.mini .control .drag-bar2:before,.codemirror-colorpicker.mini .control .drag-bar:before{border-right:4px solid transparent;border-left:4px solid transparent;border-top:4px solid #000;content:"";height:0;right:2px;position:absolute;top:0;transform:translateX(50%);width:0}.codemirror-colorpicker.mini .control .drag-bar2:after,.codemirror-colorpicker.mini .control .drag-bar:after{border-bottom:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;bottom:0;content:"";height:0;right:2px;position:absolute;transform:translateX(50%);width:0}.codemirror-colorpicker.mini-vertical{display:inline-block;width:180px}.codemirror-colorpicker.mini-vertical .color{display:inline-block;height:160px;vertical-align:middle;width:140px}.codemirror-colorpicker.mini-vertical .control{display:inline-block;height:160px;padding:0;vertical-align:middle}.codemirror-colorpicker.mini-vertical .control .hue,.codemirror-colorpicker.mini-vertical .control .opacity{display:inline-block;height:100%;margin:0;padding:0;position:relative;vertical-align:middle;width:20px}.codemirror-colorpicker.mini-vertical .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.mini-vertical .control .opacity>.opacity-container{border-radius:0;height:100%;overflow:hidden;width:20px}.codemirror-colorpicker.mini-vertical .control .drag-bar,.codemirror-colorpicker.mini-vertical .control .drag-bar2{background-color:transparent;border:0;box-shadow:none;box-sizing:border-box;height:2px;transform:none;width:100%}.codemirror-colorpicker.mini-vertical .control .drag-bar.last:after,.codemirror-colorpicker.mini-vertical .control .drag-bar.last:before,.codemirror-colorpicker.mini-vertical .control .drag-bar2.last:after,.codemirror-colorpicker.mini-vertical .control .drag-bar2.last:before{top:2px}.codemirror-colorpicker.mini-vertical .control .drag-bar.first:after,.codemirror-colorpicker.mini-vertical .control .drag-bar.first:before,.codemirror-colorpicker.mini-vertical .control .drag-bar2.first:after,.codemirror-colorpicker.mini-vertical .control .drag-bar2.first:before{top:-1px}.codemirror-colorpicker.mini-vertical .control .drag-bar2:before,.codemirror-colorpicker.mini-vertical .control .drag-bar:before{border-bottom:4px solid transparent;border-right:4px solid #000;border-top:4px solid transparent;content:"";height:0;right:0;position:absolute;top:2px;transform:translateY(-50%);width:0}.codemirror-colorpicker.mini-vertical .control .drag-bar2:after,.codemirror-colorpicker.mini-vertical .control .drag-bar:after{border-bottom:4px solid transparent;border-left:4px solid #000;border-top:4px solid transparent;content:"";height:0;position:absolute;left:0;top:2px;transform:translateY(-50%);width:0}.codemirror-colorpicker.ring .colorpicker-body>.color{height:120px;right:52px;position:absolute;top:52px;width:120px}.codemirror-colorpicker.ring .colorpicker-body .wheel{box-sizing:border-box;height:224px;position:relative;width:224px}.codemirror-colorpicker.ring .colorpicker-body .wheel .wheel-canvas{border-radius:50%;height:214px;right:5px;position:absolute;top:5px;width:214px}.codemirror-colorpicker.ring .colorpicker-body .wheel .drag-pointer{border:1px solid #fff;border-radius:50%;display:inline-block;height:10px;right:50%;position:absolute;top:50%;transform:translateX(50%) translateY(-50%);width:10px;z-index:2}.codemirror-colorpicker.ring .control{padding-top:0}.codemirror-colorpicker.ring .control .value{display:none}.codemirror-colorpicker.ring .control>.color,.codemirror-colorpicker.ring .control>.empty{border-radius:2px;height:30px;top:-17px;width:30px}.codemirror-colorpicker.ring .control.has-eyedropper{padding-right:30px;padding-top:10px}.codemirror-colorpicker.ring .control.has-eyedropper>.color,.codemirror-colorpicker.ring .control.has-eyedropper>.empty{top:-2px}.codemirror-colorpicker.ring .control.has-eyedropper .el-cp-color-control__left{top:4px}.codemirror-colorpicker.xd{display:inline-block;padding-top:12px;width:245px}.codemirror-colorpicker.xd .color{border:1px solid #cecece;border-radius:3px;box-sizing:border-box;display:inline-block;height:170px;margin-bottom:12px;margin-right:12px;overflow:hidden;vertical-align:middle;width:170px}.codemirror-colorpicker.xd .color>.saturation>.value>.drag-pointer{border:2px solid #fff;box-shadow:0 0 1px 0 #000,inset 0 0 1px 0 #000;height:7px;width:7px}.codemirror-colorpicker.xd .control{display:inline-block;height:170px;margin-bottom:12px;margin-left:12px;padding:0;vertical-align:middle}.codemirror-colorpicker.xd .control .hue,.codemirror-colorpicker.xd .control .opacity{border-radius:3px;display:inline-block;height:100%;margin:0 8px 0 0;overflow:hidden;padding:0;position:relative;vertical-align:middle;width:13px}.codemirror-colorpicker.xd .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.xd .control .opacity>.opacity-container{border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.xd .control .drag-bar,.codemirror-colorpicker.xd .control .drag-bar2{background-color:transparent;border:2px solid #fff;box-shadow:0 0 1px 0 #000,inset 0 0 1px 0 #000;box-sizing:border-box;height:10px;right:50%;overflow:hidden;transform:none;transform:translateX(50%) translateY(-50%);width:10px}.codemirror-colorpicker.xd .information{margin-top:5px}.codemirror-colorpicker.vscode{background-color:#333;border:1px solid #ececec;box-sizing:border-box;width:336px}.codemirror-colorpicker.vscode,.codemirror-colorpicker.vscode .colorpicker-body{border-radius:0;display:inline-block}.codemirror-colorpicker.vscode .colorpicker-body .color-view{height:34px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper{display:flex}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .color-view-container{display:inline-block;width:254px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left{float:left;padding:6px 0;text-align:center;width:80px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left button{display:inline-block}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left button svg path{fill:#fff}.codemirror-colorpicker.vscode .colorpicker-body .color-view .color-view-container{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;cursor:pointer;font-size:14px;height:100%;line-height:34px;text-align:center;text-shadow:0 0 3px #535353;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.codemirror-colorpicker.vscode .colorpicker-body .color-view .color-view-container .preview{display:block;height:100%}.codemirror-colorpicker.vscode .colorpicker-body .color-tool{padding:8px}.codemirror-colorpicker.vscode .color{display:inline-block;height:160px;vertical-align:middle;width:240px}.codemirror-colorpicker.vscode .control{display:inline-block;height:160px;padding:0 4px 0 0;vertical-align:middle}.codemirror-colorpicker.vscode .control .hue,.codemirror-colorpicker.vscode .control .opacity{display:inline-block;height:100%;margin:0;padding:0;position:relative;vertical-align:middle;width:30px}.codemirror-colorpicker.vscode .control .hue{padding-right:5px;width:35px}.codemirror-colorpicker.vscode .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%}.codemirror-colorpicker.vscode .control .opacity>.opacity-container{border-radius:0;height:100%;width:30px}.codemirror-colorpicker.vscode .control .drag-bar,.codemirror-colorpicker.vscode .control .drag-bar2{background-color:transparent;border:1px solid #fff;border-radius:0;box-shadow:none;box-shadow:0 0 2px 0 #000,inset 0 0 0 0 #000;box-sizing:border-box;height:5px;transform:translateY(-50%) translateX(2px);width:33px}.codemirror-colorpicker.box{border-radius:10px;width:420px}.codemirror-colorpicker.box .colorpicker-body{-moz-column-gap:10px;column-gap:10px;display:grid;grid-template-columns:200px 1fr;grid-template-rows:auto;padding:10px 10px 10px 20px}.codemirror-colorpicker.box .colorpicker-body>.color{border-radius:8px;height:100%;overflow:hidden}.codemirror-colorpicker.box .control{padding:0!important}.codemirror-colorpicker.box .control>*{vertical-align:middle}.codemirror-colorpicker.box .control .color-info{display:inline-block;height:30px;position:relative;width:30px}.codemirror-colorpicker.box .control .color-info>.color,.codemirror-colorpicker.box .control .color-info>.empty{border-radius:50%;box-sizing:border-box;height:100%;position:absolute;width:100%}.codemirror-colorpicker.box .control .color-info>.color{border:1px solid rgba(0,0,0,.1)}.codemirror-colorpicker.box .control>.color,.codemirror-colorpicker.box .control>.empty{top:4px}.codemirror-colorpicker.box .control.has-eyedropper{padding-right:30px}.codemirror-colorpicker.box .control.has-eyedropper .el-cp-color-control__left{display:inline-block;height:30px;right:auto;position:relative;top:auto;width:30px}.codemirror-colorpicker.box .control .hue,.codemirror-colorpicker.box .control .opacity{margin-right:0!important;padding-right:0!important;padding-left:0!important}.codemirror-colorpicker.box .value{box-sizing:border-box;cursor:pointer;position:relative}.codemirror-colorpicker.box .value>.value-container{background-image:linear-gradient(-90deg,#000 0,hsla(0,0%,100%,0));border-radius:3px;box-sizing:border-box;height:10px;position:relative;width:100%}.codemirror-colorpicker.box .value>.value-container .drag-bar{border-radius:50%;cursor:pointer;height:12px;right:0;position:absolute;top:50%;transform:translateX(50%) translateY(-50%);width:12px}.codemirror-colorpicker.box .information{margin-top:6px}.codemirror-colorpicker.box .information .information-change{display:none}.codemirror-colorpicker.box .information>.information-item{margin:0!important;padding:0!important}.codemirror-colorpicker.box .colorsets{border:0;position:relative}.codemirror-colorpicker.box .colorsets .color-list{margin-left:0!important;padding:0!important}.codemirror-colorpicker.box .colorsets .color-list .current-color-sets .color-item{height:20px;margin-bottom:4px!important;margin-left:4px!important;width:20px}.codemirror-colorpicker.box .colorsets .menu{float:none;position:absolute;left:-20px;top:-15px}.codemirror-colorpicker.box .color-chooser .color-chooser-container{right:200px;top:0}.colorsets-contextmenu{background-color:#ececec;border:1px solid #ccc;border-radius:6px;display:none;font-size:13px;list-style:none;padding:4px 0;position:fixed}.colorsets-contextmenu.show{display:inline-block}.colorsets-contextmenu .menu-item{cursor:default;padding:2px 20px}.colorsets-contextmenu .menu-item:hover{background-color:#5ea3fb;color:#fff}.colorsets-contextmenu.small .menu-item.small-hide{display:none}.el-cp-color-eyedropper button{background:none;border:none;border-radius:var(--size-radius);box-sizing:border-box;cursor:pointer;display:block;font-size:0;height:30px;margin:-4px;outline:none;padding:0;transition:box-shadow var(--speed-focus) ease-out,opacity var(--speed-focus) ease-out;width:30px}.el-cp-color-eyedropper button:focus-visible{box-shadow:0 0 0 2px var(--color-key)}.el-cp-color-eyedropper button:active{opacity:.5}.el-cp-color-eyedropper svg{color:var(--color-fill);display:block;margin:0 auto}
.CodeMirror{background-color:#fff;border:1px solid #dfdfdf;border-radius:3px;height:auto!important}.CodeMirror-code{outline:none}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.CodeMirror-sizer:after,.CodeMirror-sizer:before{color:#bbb;display:block}.CodeMirror-sizer:before{content:"";padding-bottom:5px}.cm-s-rubyblue .CodeMirror-cursor{border-right:1px solid #fff!important}.CodeMirror-lint-marker-multiple,[class*=CodeMirror-lint-marker],[class*=CodeMirror-lint-message]{background-image:none}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{cursor:help}.CodeMirror-lint-marker-multiple{position:absolute;top:0}[class*=CodeMirror-lint-marker]:before{font:normal 18px/1 dashicons;position:relative;top:-2px}[class*=CodeMirror-lint-message]:before{font:normal 16px/1 dashicons;right:16px;position:absolute}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 0 2px;padding:3px 28px 3px 12px}.CodeMirror-lint-message-warning{background-color:#fff8e5;border-right:4px solid #ffb900}.CodeMirror-lint-marker-warning:before,.CodeMirror-lint-message-warning:before{color:#f6a306;content:""}.CodeMirror-lint-message-error{background-color:#fbeaea;border-right:4px solid #dc3232}.CodeMirror-lint-marker-error:before,.CodeMirror-lint-message-error:before{color:#dc3232;content:""}.CodeMirror-lint-tooltip{background:none;border:none;border-radius:0;direction:rtl}.CodeMirror .CodeMirror-matchingbracket{background:rgba(255,150,0,.3);color:inherit}.CodeMirror .CodeMirror-linenumber{color:#666}.CodeMirror-foldmarker{color:inherit;font-weight:700;margin-right:.25em;margin-left:.25em}.button .badge,.go-pro-button .badge,.nav-tab .badge,.snippet-type-badge{border:1px solid;border-radius:5px;font-size:10px;padding:1px 2px;text-transform:uppercase}.button .snippet-type-badge,.go-pro-button .badge,.nav-tab .badge,h1 .snippet-type-badge,h2 .snippet-type-badge,h3 .snippet-type-badge{margin-right:3px}.button .badge{font-size:8px;text-transform:lowercase}.nav-tab .badge,.nav-tab span{vertical-align:middle}.nav-tab[data-snippet-type=php] .badge,.snippet-type-badge[data-snippet-type=php]{border-color:currentColor;color:#0073aa}.nav-tab-inactive[data-snippet-type=php]:hover .badge{color:#0073aa}.nav-tab[data-snippet-type=css] .badge,.snippet-type-badge[data-snippet-type=css]{border-color:currentColor;color:#8000ff}.nav-tab-inactive[data-snippet-type=css]:hover .badge{color:#8000ff}.nav-tab[data-snippet-type=js] .badge,.snippet-type-badge[data-snippet-type=js]{border-color:currentColor;color:#cd6600}.nav-tab-inactive[data-snippet-type=js]:hover .badge{color:#cd6600}.nav-tab[data-snippet-type=html] .badge,.snippet-type-badge[data-snippet-type=html]{border-color:currentColor;color:#548b54}.nav-tab-inactive[data-snippet-type=html]:hover .badge{color:#548b54}.nav-tab-button .dashicons-external{color:#666;font-size:15px;vertical-align:middle}.nav-tab.nav-tab-inactive{background:transparent;text-shadow:0 1px 0 #fff}.nav-tab.nav-tab-inactive,.nav-tab.nav-tab-inactive .badge{color:#a7aaad}.nav-tab.nav-tab-inactive:hover{color:#50575e}.core-badge,.go-pro-badge,.pro-badge{border:1px solid;border-radius:5px;font-size:10px;margin-right:3px;padding:1px 2px;text-transform:uppercase}.go-pro-badge,.pro-badge{color:#ce0000}.core-badge{color:#0073aa}.go-pro-badge,.go-pro-button .badge{border-color:#ce0000;color:#ce0000;margin-right:1px}.wp-core-ui .button.nav-tab-button{background:#f6f7f7;border-color:#f6f7f7;color:#a7aaad;float:left;margin-right:.5em}.wp-core-ui .button.nav-tab-button:hover{background-color:#fff;color:#3c434a}.editor-help-tooltip{background:transparent!important;cursor:help;display:inline-block;font-size:10px;padding:.3em .3em 0}.snippet-editor-help{position:absolute;left:5px;top:5px}.snippet-editor-help:hover .editor-help-text{opacity:1;visibility:visible}.editor-help-text{background-color:#555;border-radius:6px;color:#fff;font-size:small;margin-left:-10px;opacity:0;padding:5px;position:absolute;left:0;top:125%;transition:opacity .3s;visibility:hidden;white-space:nowrap;z-index:99}.editor-help-text:after{border:5px solid transparent;border-bottom-color:#555;bottom:100%;content:"";margin-left:10px;position:absolute;left:0}.editor-help-text td:first-child{padding-left:.5em}.editor-help-text .mac-key{display:none}.editor-help-text.platform-mac .mac-key{display:inline}.editor-help-text.platform-mac .pc-key{display:none}.CodeMirror-sizer{box-sizing:border-box;min-height:300px!important;padding-bottom:1.5em!important}.CodeMirror-sizer:after{bottom:0;position:absolute}.snippet-scope{display:none}.snippet-form.php-snippet .php-scopes-list,.snippet-scope .description{display:block}.snippet-form.php-snippet .CodeMirror-sizer{padding-bottom:0!important}.snippet-form.php-snippet .CodeMirror-sizer:before{content:"<?php"}.snippet-form.css-snippet .css-scopes-list{display:block}.snippet-form.css-snippet .CodeMirror-sizer:before{content:"<style>"}.snippet-form.css-snippet .CodeMirror-sizer:after{content:"</style>"}.snippet-form.js-snippet .js-scopes-list{display:block}.snippet-form.js-snippet .CodeMirror-sizer:before{content:"<script>"}.snippet-form.js-snippet .CodeMirror-sizer:after{content:"</script>"}.snippet-form.html-snippet .html-scopes-list{display:block}.snippet-form.html-snippet .CodeMirror-sizer:before{content:"<!-- begin content -->"}.snippet-form.html-snippet .CodeMirror-sizer:after{content:"<!-- end content -->"}.tagger{border:0}.tagger>ul{align-items:center;background-color:#fff;border:1px solid #dfdfdf;border-radius:3px;box-sizing:border-box;display:flex;flex:0 0 auto;height:auto;justify-content:space-between;list-style:none;margin:0;overflow-y:auto;padding:4px 5px 0;width:100%}.tagger>ul>li{margin:.4rem 5px 4px;padding-bottom:.4rem}.tagger>ul>li:not(.tagger-new) a,.tagger>ul>li:not(.tagger-new) a:visited{color:#000;text-decoration:none}.tagger>ul>li:not(.tagger-new)>:first-child{background:#b1c3d7;border:1px solid #4181ed;border-radius:3px;padding:4px 8px 4px 4px}.tagger>ul>li:not(.tagger-new)>a>span,.tagger>ul>li:not(.tagger-new)>span{white-space:nowrap}.tagger li a.close{margin-right:4px;padding:4px}.tagger li a.close:hover{color:#fff}.tagger .tagger-new{flex-grow:1;min-width:40px;position:relative}.tagger .tagger-new input{background:transparent;border:none;box-shadow:none;box-sizing:border-box;outline:none;padding-right:0;width:100%}.tagger.wrap>ul{flex-wrap:wrap;justify-content:start}.tagger li:not(.tagger-new)>span,.tagger-new ul,.tagger>ul>li:not(.tagger-new)>a{background-color:#dee7f8;border:1px solid #cad8f3;border-radius:6px}.tagger li:not(.tagger-new)>span:hover,.tagger-new ul:hover,.tagger>ul>li:not(.tagger-new)>a:hover{background-color:#bbcef1;border-color:#6d95e0}.tagger-new ul a,.tagger-new ul a:visited,.tagger>ul>li:not(.tagger-new) a,.tagger>ul>li:not(.tagger-new) a:visited{color:#555;font-size:1.1em}.code-snippets-upgrade-dialog .logo{align-items:center;color:#3f444b;display:grid;font-size:25px;gap:.2em;grid-template-columns:auto auto;justify-content:center}.code-snippets-upgrade-dialog .logo img{height:50px}.code-snippets-upgrade-dialog p{text-align:right}.code-snippets-upgrade-dialog ul{list-style:none}.code-snippets-upgrade-dialog ul li:before{color:#2ecc40;content:"✓ ";margin-right:1em}.code-snippets-upgrade-dialog .components-modal__content{margin-top:0;padding:32px}.code-snippets-upgrade-dialog .upgrade-plans{display:grid;grid-template-columns:1fr 1fr 1fr;margin:2em 0;text-align:center}.code-snippets-upgrade-dialog .action-buttons{align-items:center;display:grid;grid-template-columns:auto auto;justify-content:space-around;margin-bottom:0}.code-snippets-upgrade-dialog .current-plan-cost{font-size:1rem}.code-snippets-upgrade-dialog .button .dashicons,.code-snippets-upgrade-dialog .button svg{margin-right:1ch;vertical-align:middle}.code-snippets-upgrade-dialog .components-external-link.button{text-decoration:none}.cloud-create-modal .components-modal__content{min-width:550px}.cloud-create-modal .action-buttons{display:flex;justify-content:flex-end}.cloud-create-modal .components-button.is-secondary{box-shadow:none}.cloud-create-modal .notice{margin-right:0;margin-left:0}.generate-button{align-items:center;display:flex;float:left}.generate-button .dashicons-warning{color:#b32d2e;margin-left:11px}.code-line-explanation{align-items:center;background-color:#fff;border:1px solid #bbb;border-right:0;border-left:0;color:#666;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-style:italic;margin:0;padding:0 8px}.code-line-explanation img{height:1rem;padding-left:5px}.cloud-connect-modal .icons-group{align-items:center;display:flex;justify-content:center}.cloud-connect-modal .icons-group .dashicons{font-size:50px;height:50px;width:50px}.cloud-connect-modal .action-buttons{display:flex;justify-content:flex-end}.form-table th{width:auto}.notice.error blockquote{margin-bottom:0}h2{margin:25px 0 15px}h2 label{cursor:auto}.submit-inline,h2:first-of-type{margin:20px 0 10px}.saved-snippet.active-snippet #title,.saved-snippet.inactive-snippet #title{border-right-width:4px}.saved-snippet.active-snippet #title{border-right-color:#46b450}.saved-snippet.inactive-snippet #title{border-right-color:#bbb}.saved-snippet.erroneous-snippet #title{border-right-color:#dc3232}#snippet-form{margin-top:10px}#snippet-form #snippet-tags,#snippet-form textarea{font-family:monospace;width:100%}label[for=snippet_description] h3 div{position:absolute}.button+.button,.generate-button+.button{margin-right:.5em}h2 .button{font-weight:400}.button svg{height:1rem;line-height:1;margin:-2px 0 0 3px;vertical-align:middle}.submit,.submit-inline{display:flex}.submit-inline{float:left;margin-bottom:0}.snippet-scope p,p.snippet-scope{margin-top:15px}.snippet-description-container{margin-top:25px}.snippet-description-container .wp-editor-tools{padding-top:5px}.snippet-description-container .wp-editor-tabs{float:right}.html-shortcode-options strong,.snippet-scope label{display:inline-block;margin-left:1.5em}.below-snippet-editor{display:flex;flex-flow:row wrap;justify-content:space-between;padding-top:1px}.snippet-priority label{cursor:help;font-size:1.1em;font-weight:700;padding-left:.5em}.snippet-priority input{width:4em}.snippet-editor{position:relative}.CodeMirror{width:100%}.wrap h2.nav-tab-wrapper{border-bottom:none}.code-snippets-copy-text{color:inherit}.wrap .notice{scroll-margin:.75em}#edit-snippet-form-container .cs-sticky-notice{position:sticky;top:40px;z-index:100}
dist/edit.css 0000644 00000125501 15153464547 0007170 0 ustar 00 .codemirror-colorview{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;border:1px solid #cecece;box-sizing:border-box;cursor:pointer;display:inline-block;height:10px;margin:0 2px;position:relative;vertical-align:middle;width:10px}.codemirror-colorview .codemirror-colorview-background{bottom:0;content:"";left:0;position:absolute;right:0;top:0}.codemirror-colorview:hover{border-color:#494949}.codemirror-colorpicker{background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:3px;box-shadow:0 0 10px 2px rgba(0,0,0,.12);display:inline-block;position:relative;width:224px;z-index:1000}.codemirror-colorpicker>.arrow{border-bottom:10px solid rgba(0,0,0,.2);border-left:10px solid transparent;border-right:10px solid transparent;display:none;height:0;left:7px;pointer-events:none;position:absolute;top:-10px;width:0}.codemirror-colorpicker>.arrow:after{border-bottom:9px solid #fff;border-left:9px solid transparent;border-right:9px solid transparent;content:"";height:0;left:-9px;position:absolute;top:1px;width:0}.codemirror-colorpicker .colorpicker-body .arrow-button{background-color:transparent;height:12px;padding:0;position:relative;width:10px}.codemirror-colorpicker .colorpicker-body .arrow-button:before{border-bottom:3px solid #000;height:50%;top:0}.codemirror-colorpicker .colorpicker-body .arrow-button:after,.codemirror-colorpicker .colorpicker-body .arrow-button:before{border-left:3px solid transparent;border-right:3px solid transparent;box-sizing:border-box;content:"";display:inline-block;height:0;left:0;margin:2px;pointer-events:none;position:absolute;right:0;width:0}.codemirror-colorpicker .colorpicker-body .arrow-button:after{border-top:3px solid #000;bottom:0;top:50%}.codemirror-colorpicker .colorpicker-body .color{cursor:pointer;height:120px;overflow:hidden;position:relative}.codemirror-colorpicker .colorpicker-body .color>.saturation,.codemirror-colorpicker .colorpicker-body .color>.saturation>.value{height:100%;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value>.drag-pointer{border-radius:50%;height:10px;position:absolute;transform:translateX(-50%) translateY(-50%);width:10px}.codemirror-colorpicker .colorpicker-body .color>.saturation{background-color:hsla(20,42%,65%,0);background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0));background-repeat:repeat-x}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0))}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value>.drag-pointer{border:1px solid #fff;box-shadow:0 0 2px 0 rgba(0,0,0,.05)}.codemirror-colorpicker .colorpicker-body .control{padding:10px 0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper{padding-left:30px}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper .el-cp-color-control__left{border-radius:50%;box-sizing:border-box;height:30px;left:12px;position:absolute;top:20px;width:30px}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper>.color,.codemirror-colorpicker .colorpicker-body .control.has-eyedropper>.empty{left:45px}.codemirror-colorpicker .colorpicker-body .control>.color,.codemirror-colorpicker .colorpicker-body .control>.empty{border-radius:50%;box-sizing:border-box;height:30px;left:12px;position:absolute;top:14px;width:30px}.codemirror-colorpicker .colorpicker-body .control>.color{border:1px solid rgba(0,0,0,.1)}.codemirror-colorpicker .colorpicker-body .control>.hue{box-sizing:border-box;cursor:pointer;margin:0 0 0 42px;padding:6px 16px;position:relative}.codemirror-colorpicker .colorpicker-body .control>.hue>.hue-container{border-radius:3px;height:10px;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .control>.opacity{box-sizing:border-box;cursor:pointer;margin:0 0 0 42px;padding:3px 16px;position:relative}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container{border-radius:3px;height:10px;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .control .drag-bar,.codemirror-colorpicker .colorpicker-body .control .drag-bar2{border-radius:50%;cursor:pointer;height:12px;left:0;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:12px}.codemirror-colorpicker .colorpicker-body .control>.hue>.hue-container{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container>.color-bar{bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.codemirror-colorpicker .colorpicker-body .control>.empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat}.codemirror-colorpicker .colorpicker-body .control .drag-bar,.codemirror-colorpicker .colorpicker-body .control .drag-bar2{background-color:#fefefe;border:1px solid rgba(0,0,0,.05);box-shadow:2px 2px 2px 0 rgba(0,0,0,.2)}.codemirror-colorpicker .colorpicker-body .information{box-sizing:padding-box;position:relative}.codemirror-colorpicker .colorpicker-body .information>input{bottom:20px;box-sizing:border-box;font-size:10px;height:20px;padding:0 0 0 2px;position:absolute;-webkit-user-select:text;-moz-user-select:text;user-select:text}.codemirror-colorpicker .colorpicker-body .information>input[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.codemirror-colorpicker .colorpicker-body .information>input[type=number]::-webkit-inner-spin-button,.codemirror-colorpicker .colorpicker-body .information>input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.codemirror-colorpicker .colorpicker-body .information.hex>.information-item.hex,.codemirror-colorpicker .colorpicker-body .information.hsl>.information-item.hsl,.codemirror-colorpicker .colorpicker-body .information.rgb>.information-item.rgb{display:flex}.codemirror-colorpicker .colorpicker-body .information>.information-item{box-sizing:border-box;display:none;margin-right:40px;padding:0 5px 0 9px;position:relative}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field{box-sizing:border-box;display:block;flex:1;padding:3px;position:relative}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field>.title{color:#a9a9a9;cursor:pointer;font-size:12px;padding-top:2px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input{border:1px solid #cbcbcb;border-radius:2px;box-sizing:border-box;color:#333;font-size:11px;height:21px;padding:3px;text-align:center;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:100%}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]::-webkit-inner-spin-button,.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field.hsl-l input[type=number],.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field.hsl-s input[type=number]{padding-left:1px;padding-right:10px}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field .postfix{box-sizing:border-box;display:inline-block;font-size:11px;height:21px;line-height:2;padding:2px;position:absolute;right:3px;text-align:center;top:2px}.codemirror-colorpicker .colorpicker-body .information>.information-change{bottom:0;box-sizing:border-box;display:block;padding-top:5px;position:absolute;right:0;text-align:center;top:0;width:40px}.codemirror-colorpicker .colorpicker-body .information>.information-change>.format-change-button{background:transparent;border:0;box-sizing:border-box;cursor:pointer;outline:none}.codemirror-colorpicker .colorpicker-body .information>.title{color:#a3a3a3}.codemirror-colorpicker .colorpicker-body .information>.input{color:#333}.codemirror-colorpicker .colorpicker-body .colorsets{border-top:1px solid #e2e2e2}.codemirror-colorpicker .colorpicker-body .colorsets>.menu{float:right;padding:10px 15px 10px 5px}.codemirror-colorpicker .colorpicker-body .colorsets>.menu button{border:0;cursor:pointer;font-family:serif,sans-serif;font-size:14px;font-weight:300;outline:none}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list{box-sizing:border-box;display:block;line-height:0;margin-right:30px;padding:12px 0 0 12px}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item{background-size:contain;border-radius:2px;box-sizing:border-box;cursor:pointer;display:inline-block;height:13px;margin-bottom:12px;margin-right:12px;overflow:hidden;position:relative;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item:hover{transform:scale(1.2)}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item .empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;height:100%;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item .color-view{border:1px solid rgba(0,0,0,.1);box-sizing:border-box;height:100%;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .add-color-item{color:#8e8e8e;cursor:pointer;display:inline-block;font-family:serif,sans-serif;font-size:16px;font-weight:400;height:13px;line-height:1;margin-bottom:12px;margin-right:12px;text-align:center;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .color-chooser{background-color:rgba(0,0,0,.5);bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .05s ease-out}.codemirror-colorpicker .colorpicker-body .color-chooser.open{opacity:1;pointer-events:all}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container{background-color:#fff;bottom:0;left:0;position:absolute;right:0;top:120px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;display:flex;height:34px;left:0;padding:3px 0;position:absolute;right:0;top:0}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header .title{box-sizing:border-box;color:#000;flex:2;font-size:15px;font-weight:700;margin:0;overflow:hidden;padding:5px 5px 5px 14px;text-align:left;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header .items{cursor:pointer;display:block;flex:1;height:100%;line-height:2;padding-right:10px;text-align:right}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list{bottom:0;left:0;overflow:auto;position:absolute;right:0;top:34px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item{border-bottom:1px solid rgba(0,0,0,.1);cursor:pointer;display:flex;padding:3px 0}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item:hover{background-color:rgba(0,0,0,.05)}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .title{box-sizing:border-box;color:#000;flex:2;font-size:14px;font-size:13px;font-weight:400;margin:0;overflow:hidden;padding:5px 5px 5px 14px;pointer-events:none;text-align:left;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items{cursor:pointer;display:block;flex:3;height:100%;line-height:1.6;pointer-events:none}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;background-size:contain;border:1px solid #ddd;border-radius:3px;box-sizing:border-box;cursor:pointer;display:inline-block;height:13px;margin-right:10px;overflow:hidden;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item .color-view{height:100%;margin:0;padding:0;pointer-events:none;width:100%}.codemirror-colorpicker.sketch{border-radius:5px}.codemirror-colorpicker.sketch>.colorpicker-body>.color{box-sizing:border-box;height:150px;margin:10px 10px 2px}.codemirror-colorpicker.sketch>.colorpicker-body>.control{padding:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control.has-eyedropper{padding-left:30px}.codemirror-colorpicker.sketch>.colorpicker-body>.control.has-eyedropper .el-cp-color-control__left{top:4px}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.color,.codemirror-colorpicker.sketch>.colorpicker-body>.control>.empty{border-radius:2px;box-sizing:border-box;height:26px;left:auto;position:absolute;right:10px;top:1px;width:26px}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.color{box-shadow:inset 0 0 1px 0 rgba(0,0,0,.5)}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.hue{margin:0 38px 0 0;padding:2px 2px 2px 10px;position:relative}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.hue>.hue-container{border-radius:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.opacity{margin:0 38px 0 0;padding:2px 2px 2px 10px;position:relative}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.opacity>.opacity-container{border-radius:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2{border-radius:0;border-radius:1px;bottom:1px!important;height:50%;left:0;top:50%;transform:translateX(-50%) translateY(-50%);width:2px}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar.first,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2.first{left:0;transform:translateX(50%) translateY(-50%)!important}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar.last,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2.last{transform:translateX(-150%) translateY(-50%)!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-change{display:none}.codemirror-colorpicker.sketch>.colorpicker-body>.information.rgb .information-item.rgb{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information.rgb .information-item.hsl{display:none!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hex .information-item.hex{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hex .information-item.hsl,.codemirror-colorpicker.sketch>.colorpicker-body>.information.hsl .information-item.rgb{display:none!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hsl .information-item.hsl{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item{display:inline-flex!important;margin-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field{padding-left:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field:last-child{padding-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field>.title{color:#000;cursor:pointer;font-size:11px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field:last-child:not(:first-child){padding-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.hex{padding-left:5px;padding-right:0;width:74px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.rgb{padding-left:0;padding-right:0;width:140px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.hsl{display:none;padding-left:0;padding-right:0;width:140px}.codemirror-colorpicker.sketch>.colorpicker-body>.colorsets>.color-list{margin-right:0;padding-right:12px}.codemirror-colorpicker.sketch>.colorpicker-body>.colorsets>.color-list .color-item{border-radius:3px;height:16px;margin-bottom:10px;margin-right:9px;width:16px}.codemirror-colorpicker.palette{border-radius:3px;box-shadow:none}.codemirror-colorpicker.palette>.colorpicker-body>.color,.codemirror-colorpicker.palette>.colorpicker-body>.control,.codemirror-colorpicker.palette>.colorpicker-body>.information{display:none}.codemirror-colorpicker.palette>.colorpicker-body>.colorsets{border-top:0;box-sizing:border-box}.codemirror-colorpicker.palette>.colorpicker-body>.colorsets>.color-list .color-item{height:15px;margin-bottom:10px;margin-right:10px;width:15px}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser{box-sizing:border-box;display:none}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open{border:1px solid #d8d8d8;border-radius:3px;bottom:auto;box-shadow:0 0 10px 2px rgba(0,0,0,.12);display:block;left:-1px;right:-1px;top:-1px}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container{background-color:#fff;border-radius:2px;bottom:auto;box-sizing:border-box;left:auto;position:relative;right:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-item-header{border-top-left-radius:3px;border-top-right-radius:3px;bottom:auto;left:auto;position:relative;right:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-list{bottom:auto;left:auto;overflow:auto;position:relative;right:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-list .colorsets-item:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.codemirror-colorpicker.macos .colorpicker-body .wheel{box-sizing:border-box;height:224px;position:relative;width:224px}.codemirror-colorpicker.macos .colorpicker-body .wheel .wheel-canvas{border-radius:50%;height:214px;left:5px;position:absolute;top:5px;width:214px}.codemirror-colorpicker.macos .colorpicker-body .wheel .drag-pointer{border:1px solid #fff;border-radius:50%;display:inline-block;height:10px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:10px;z-index:2}.codemirror-colorpicker.macos .control{padding-top:0}.codemirror-colorpicker.macos .control>.color,.codemirror-colorpicker.macos .control>.empty{top:4px}.codemirror-colorpicker.macos .control.has-eyedropper{padding-left:30px}.codemirror-colorpicker.macos .control.has-eyedropper .el-cp-color-control__left{top:9px}.codemirror-colorpicker.macos .value{box-sizing:border-box;cursor:pointer;margin:0 0 0 42px;padding:6px 16px;position:relative}.codemirror-colorpicker.macos .value>.value-container{background-image:linear-gradient(90deg,#000 0,hsla(0,0%,100%,0));border-radius:3px;box-sizing:border-box;height:10px;position:relative;width:100%}.codemirror-colorpicker.macos .value>.value-container .drag-bar{border-radius:50%;cursor:pointer;height:12px;left:0;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:12px}.codemirror-colorpicker.mini{display:inline-block;width:180px}.codemirror-colorpicker.mini .control{padding:0}.codemirror-colorpicker.mini .control .hue,.codemirror-colorpicker.mini .control .opacity{margin:0;padding:0}.codemirror-colorpicker.mini .control .hue>.hue-container,.codemirror-colorpicker.mini .control .opacity>.opacity-container{border-radius:0;height:20px;overflow:hidden}.codemirror-colorpicker.mini .control .drag-bar,.codemirror-colorpicker.mini .control .drag-bar2{background-color:transparent;border:0;box-shadow:none;box-sizing:border-box;height:100%;width:5px}.codemirror-colorpicker.mini .control .drag-bar.last:before,.codemirror-colorpicker.mini .control .drag-bar.lastafter,.codemirror-colorpicker.mini .control .drag-bar2.last:before,.codemirror-colorpicker.mini .control .drag-bar2.lastafter{left:1px}.codemirror-colorpicker.mini .control .drag-bar.first:after,.codemirror-colorpicker.mini .control .drag-bar.first:before,.codemirror-colorpicker.mini .control .drag-bar2.first:after,.codemirror-colorpicker.mini .control .drag-bar2.first:before{left:3px}.codemirror-colorpicker.mini .control .drag-bar2:before,.codemirror-colorpicker.mini .control .drag-bar:before{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;content:"";height:0;left:2px;position:absolute;top:0;transform:translateX(-50%);width:0}.codemirror-colorpicker.mini .control .drag-bar2:after,.codemirror-colorpicker.mini .control .drag-bar:after{border-bottom:4px solid #000;border-left:4px solid transparent;border-right:4px solid transparent;bottom:0;content:"";height:0;left:2px;position:absolute;transform:translateX(-50%);width:0}.codemirror-colorpicker.mini-vertical{display:inline-block;width:180px}.codemirror-colorpicker.mini-vertical .color{display:inline-block;height:160px;vertical-align:middle;width:140px}.codemirror-colorpicker.mini-vertical .control{display:inline-block;height:160px;padding:0;vertical-align:middle}.codemirror-colorpicker.mini-vertical .control .hue,.codemirror-colorpicker.mini-vertical .control .opacity{display:inline-block;height:100%;margin:0;padding:0;position:relative;vertical-align:middle;width:20px}.codemirror-colorpicker.mini-vertical .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.mini-vertical .control .opacity>.opacity-container{border-radius:0;height:100%;overflow:hidden;width:20px}.codemirror-colorpicker.mini-vertical .control .drag-bar,.codemirror-colorpicker.mini-vertical .control .drag-bar2{background-color:transparent;border:0;box-shadow:none;box-sizing:border-box;height:2px;transform:none;width:100%}.codemirror-colorpicker.mini-vertical .control .drag-bar.last:after,.codemirror-colorpicker.mini-vertical .control .drag-bar.last:before,.codemirror-colorpicker.mini-vertical .control .drag-bar2.last:after,.codemirror-colorpicker.mini-vertical .control .drag-bar2.last:before{top:2px}.codemirror-colorpicker.mini-vertical .control .drag-bar.first:after,.codemirror-colorpicker.mini-vertical .control .drag-bar.first:before,.codemirror-colorpicker.mini-vertical .control .drag-bar2.first:after,.codemirror-colorpicker.mini-vertical .control .drag-bar2.first:before{top:-1px}.codemirror-colorpicker.mini-vertical .control .drag-bar2:before,.codemirror-colorpicker.mini-vertical .control .drag-bar:before{border-bottom:4px solid transparent;border-left:4px solid #000;border-top:4px solid transparent;content:"";height:0;left:0;position:absolute;top:2px;transform:translateY(-50%);width:0}.codemirror-colorpicker.mini-vertical .control .drag-bar2:after,.codemirror-colorpicker.mini-vertical .control .drag-bar:after{border-bottom:4px solid transparent;border-right:4px solid #000;border-top:4px solid transparent;content:"";height:0;position:absolute;right:0;top:2px;transform:translateY(-50%);width:0}.codemirror-colorpicker.ring .colorpicker-body>.color{height:120px;left:52px;position:absolute;top:52px;width:120px}.codemirror-colorpicker.ring .colorpicker-body .wheel{box-sizing:border-box;height:224px;position:relative;width:224px}.codemirror-colorpicker.ring .colorpicker-body .wheel .wheel-canvas{border-radius:50%;height:214px;left:5px;position:absolute;top:5px;width:214px}.codemirror-colorpicker.ring .colorpicker-body .wheel .drag-pointer{border:1px solid #fff;border-radius:50%;display:inline-block;height:10px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:10px;z-index:2}.codemirror-colorpicker.ring .control{padding-top:0}.codemirror-colorpicker.ring .control .value{display:none}.codemirror-colorpicker.ring .control>.color,.codemirror-colorpicker.ring .control>.empty{border-radius:2px;height:30px;top:-17px;width:30px}.codemirror-colorpicker.ring .control.has-eyedropper{padding-left:30px;padding-top:10px}.codemirror-colorpicker.ring .control.has-eyedropper>.color,.codemirror-colorpicker.ring .control.has-eyedropper>.empty{top:-2px}.codemirror-colorpicker.ring .control.has-eyedropper .el-cp-color-control__left{top:4px}.codemirror-colorpicker.xd{display:inline-block;padding-top:12px;width:245px}.codemirror-colorpicker.xd .color{border:1px solid #cecece;border-radius:3px;box-sizing:border-box;display:inline-block;height:170px;margin-bottom:12px;margin-left:12px;overflow:hidden;vertical-align:middle;width:170px}.codemirror-colorpicker.xd .color>.saturation>.value>.drag-pointer{border:2px solid #fff;box-shadow:0 0 1px 0 #000,inset 0 0 1px 0 #000;height:7px;width:7px}.codemirror-colorpicker.xd .control{display:inline-block;height:170px;margin-bottom:12px;margin-right:12px;padding:0;vertical-align:middle}.codemirror-colorpicker.xd .control .hue,.codemirror-colorpicker.xd .control .opacity{border-radius:3px;display:inline-block;height:100%;margin:0 0 0 8px;overflow:hidden;padding:0;position:relative;vertical-align:middle;width:13px}.codemirror-colorpicker.xd .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.xd .control .opacity>.opacity-container{border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.xd .control .drag-bar,.codemirror-colorpicker.xd .control .drag-bar2{background-color:transparent;border:2px solid #fff;box-shadow:0 0 1px 0 #000,inset 0 0 1px 0 #000;box-sizing:border-box;height:10px;left:50%;overflow:hidden;transform:none;transform:translateX(-50%) translateY(-50%);width:10px}.codemirror-colorpicker.xd .information{margin-top:5px}.codemirror-colorpicker.vscode{background-color:#333;border:1px solid #ececec;box-sizing:border-box;width:336px}.codemirror-colorpicker.vscode,.codemirror-colorpicker.vscode .colorpicker-body{border-radius:0;display:inline-block}.codemirror-colorpicker.vscode .colorpicker-body .color-view{height:34px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper{display:flex}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .color-view-container{display:inline-block;width:254px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left{float:right;padding:6px 0;text-align:center;width:80px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left button{display:inline-block}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left button svg path{fill:#fff}.codemirror-colorpicker.vscode .colorpicker-body .color-view .color-view-container{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;cursor:pointer;font-size:14px;height:100%;line-height:34px;text-align:center;text-shadow:0 0 3px #535353;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.codemirror-colorpicker.vscode .colorpicker-body .color-view .color-view-container .preview{display:block;height:100%}.codemirror-colorpicker.vscode .colorpicker-body .color-tool{padding:8px}.codemirror-colorpicker.vscode .color{display:inline-block;height:160px;vertical-align:middle;width:240px}.codemirror-colorpicker.vscode .control{display:inline-block;height:160px;padding:0 0 0 4px;vertical-align:middle}.codemirror-colorpicker.vscode .control .hue,.codemirror-colorpicker.vscode .control .opacity{display:inline-block;height:100%;margin:0;padding:0;position:relative;vertical-align:middle;width:30px}.codemirror-colorpicker.vscode .control .hue{padding-left:5px;width:35px}.codemirror-colorpicker.vscode .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%}.codemirror-colorpicker.vscode .control .opacity>.opacity-container{border-radius:0;height:100%;width:30px}.codemirror-colorpicker.vscode .control .drag-bar,.codemirror-colorpicker.vscode .control .drag-bar2{background-color:transparent;border:1px solid #fff;border-radius:0;box-shadow:none;box-shadow:0 0 2px 0 #000,inset 0 0 0 0 #000;box-sizing:border-box;height:5px;transform:translateY(-50%) translateX(-2px);width:33px}.codemirror-colorpicker.box{border-radius:10px;width:420px}.codemirror-colorpicker.box .colorpicker-body{-moz-column-gap:10px;column-gap:10px;display:grid;grid-template-columns:200px 1fr;grid-template-rows:auto;padding:10px 20px 10px 10px}.codemirror-colorpicker.box .colorpicker-body>.color{border-radius:8px;height:100%;overflow:hidden}.codemirror-colorpicker.box .control{padding:0!important}.codemirror-colorpicker.box .control>*{vertical-align:middle}.codemirror-colorpicker.box .control .color-info{display:inline-block;height:30px;position:relative;width:30px}.codemirror-colorpicker.box .control .color-info>.color,.codemirror-colorpicker.box .control .color-info>.empty{border-radius:50%;box-sizing:border-box;height:100%;position:absolute;width:100%}.codemirror-colorpicker.box .control .color-info>.color{border:1px solid rgba(0,0,0,.1)}.codemirror-colorpicker.box .control>.color,.codemirror-colorpicker.box .control>.empty{top:4px}.codemirror-colorpicker.box .control.has-eyedropper{padding-left:30px}.codemirror-colorpicker.box .control.has-eyedropper .el-cp-color-control__left{display:inline-block;height:30px;left:auto;position:relative;top:auto;width:30px}.codemirror-colorpicker.box .control .hue,.codemirror-colorpicker.box .control .opacity{margin-left:0!important;padding-left:0!important;padding-right:0!important}.codemirror-colorpicker.box .value{box-sizing:border-box;cursor:pointer;position:relative}.codemirror-colorpicker.box .value>.value-container{background-image:linear-gradient(90deg,#000 0,hsla(0,0%,100%,0));border-radius:3px;box-sizing:border-box;height:10px;position:relative;width:100%}.codemirror-colorpicker.box .value>.value-container .drag-bar{border-radius:50%;cursor:pointer;height:12px;left:0;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:12px}.codemirror-colorpicker.box .information{margin-top:6px}.codemirror-colorpicker.box .information .information-change{display:none}.codemirror-colorpicker.box .information>.information-item{margin:0!important;padding:0!important}.codemirror-colorpicker.box .colorsets{border:0;position:relative}.codemirror-colorpicker.box .colorsets .color-list{margin-right:0!important;padding:0!important}.codemirror-colorpicker.box .colorsets .color-list .current-color-sets .color-item{height:20px;margin-bottom:4px!important;margin-right:4px!important;width:20px}.codemirror-colorpicker.box .colorsets .menu{float:none;position:absolute;right:-20px;top:-15px}.codemirror-colorpicker.box .color-chooser .color-chooser-container{left:200px;top:0}.colorsets-contextmenu{background-color:#ececec;border:1px solid #ccc;border-radius:6px;display:none;font-size:13px;list-style:none;padding:4px 0;position:fixed}.colorsets-contextmenu.show{display:inline-block}.colorsets-contextmenu .menu-item{cursor:default;padding:2px 20px}.colorsets-contextmenu .menu-item:hover{background-color:#5ea3fb;color:#fff}.colorsets-contextmenu.small .menu-item.small-hide{display:none}.el-cp-color-eyedropper button{background:none;border:none;border-radius:var(--size-radius);box-sizing:border-box;cursor:pointer;display:block;font-size:0;height:30px;margin:-4px;outline:none;padding:0;transition:box-shadow var(--speed-focus) ease-out,opacity var(--speed-focus) ease-out;width:30px}.el-cp-color-eyedropper button:focus-visible{box-shadow:0 0 0 2px var(--color-key)}.el-cp-color-eyedropper button:active{opacity:.5}.el-cp-color-eyedropper svg{color:var(--color-fill);display:block;margin:0 auto}
.CodeMirror{background-color:#fff;border:1px solid #dfdfdf;border-radius:3px;height:auto!important}.CodeMirror-code{outline:none}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.CodeMirror-sizer:after,.CodeMirror-sizer:before{color:#bbb;display:block}.CodeMirror-sizer:before{content:"";padding-bottom:5px}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}.CodeMirror-lint-marker-multiple,[class*=CodeMirror-lint-marker],[class*=CodeMirror-lint-message]{background-image:none}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{cursor:help}.CodeMirror-lint-marker-multiple{position:absolute;top:0}[class*=CodeMirror-lint-marker]:before{font:normal 18px/1 dashicons;position:relative;top:-2px}[class*=CodeMirror-lint-message]:before{font:normal 16px/1 dashicons;left:16px;position:absolute}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 0 2px;padding:3px 12px 3px 28px}.CodeMirror-lint-message-warning{background-color:#fff8e5;border-left:4px solid #ffb900}.CodeMirror-lint-marker-warning:before,.CodeMirror-lint-message-warning:before{color:#f6a306;content:""}.CodeMirror-lint-message-error{background-color:#fbeaea;border-left:4px solid #dc3232}.CodeMirror-lint-marker-error:before,.CodeMirror-lint-message-error:before{color:#dc3232;content:""}.CodeMirror-lint-tooltip{background:none;border:none;border-radius:0;direction:ltr}.CodeMirror .CodeMirror-matchingbracket{background:rgba(255,150,0,.3);color:inherit}.CodeMirror .CodeMirror-linenumber{color:#666}.CodeMirror-foldmarker{color:inherit;font-weight:700;margin-left:.25em;margin-right:.25em}.button .badge,.go-pro-button .badge,.nav-tab .badge,.snippet-type-badge{border:1px solid;border-radius:5px;font-size:10px;padding:1px 2px;text-transform:uppercase}.button .snippet-type-badge,.go-pro-button .badge,.nav-tab .badge,h1 .snippet-type-badge,h2 .snippet-type-badge,h3 .snippet-type-badge{margin-left:3px}.button .badge{font-size:8px;text-transform:lowercase}.nav-tab .badge,.nav-tab span{vertical-align:middle}.nav-tab[data-snippet-type=php] .badge,.snippet-type-badge[data-snippet-type=php]{border-color:currentColor;color:#0073aa}.nav-tab-inactive[data-snippet-type=php]:hover .badge{color:#0073aa}.nav-tab[data-snippet-type=css] .badge,.snippet-type-badge[data-snippet-type=css]{border-color:currentColor;color:#8000ff}.nav-tab-inactive[data-snippet-type=css]:hover .badge{color:#8000ff}.nav-tab[data-snippet-type=js] .badge,.snippet-type-badge[data-snippet-type=js]{border-color:currentColor;color:#cd6600}.nav-tab-inactive[data-snippet-type=js]:hover .badge{color:#cd6600}.nav-tab[data-snippet-type=html] .badge,.snippet-type-badge[data-snippet-type=html]{border-color:currentColor;color:#548b54}.nav-tab-inactive[data-snippet-type=html]:hover .badge{color:#548b54}.nav-tab-button .dashicons-external{color:#666;font-size:15px;vertical-align:middle}.nav-tab.nav-tab-inactive{background:transparent;text-shadow:0 1px 0 #fff}.nav-tab.nav-tab-inactive,.nav-tab.nav-tab-inactive .badge{color:#a7aaad}.nav-tab.nav-tab-inactive:hover{color:#50575e}.core-badge,.go-pro-badge,.pro-badge{border:1px solid;border-radius:5px;font-size:10px;margin-left:3px;padding:1px 2px;text-transform:uppercase}.go-pro-badge,.pro-badge{color:#ce0000}.core-badge{color:#0073aa}.go-pro-badge,.go-pro-button .badge{border-color:#ce0000;color:#ce0000;margin-left:1px}.wp-core-ui .button.nav-tab-button{background:#f6f7f7;border-color:#f6f7f7;color:#a7aaad;float:right;margin-left:.5em}.wp-core-ui .button.nav-tab-button:hover{background-color:#fff;color:#3c434a}.editor-help-tooltip{background:transparent!important;cursor:help;display:inline-block;font-size:10px;padding:.3em .3em 0}.snippet-editor-help{position:absolute;right:5px;top:5px}.snippet-editor-help:hover .editor-help-text{opacity:1;visibility:visible}.editor-help-text{background-color:#555;border-radius:6px;color:#fff;font-size:small;margin-right:-10px;opacity:0;padding:5px;position:absolute;right:0;top:125%;transition:opacity .3s;visibility:hidden;white-space:nowrap;z-index:99}.editor-help-text:after{border:5px solid transparent;border-bottom-color:#555;bottom:100%;content:"";margin-right:10px;position:absolute;right:0}.editor-help-text td:first-child{padding-right:.5em}.editor-help-text .mac-key{display:none}.editor-help-text.platform-mac .mac-key{display:inline}.editor-help-text.platform-mac .pc-key{display:none}.CodeMirror-sizer{box-sizing:border-box;min-height:300px!important;padding-bottom:1.5em!important}.CodeMirror-sizer:after{bottom:0;position:absolute}.snippet-scope{display:none}.snippet-form.php-snippet .php-scopes-list,.snippet-scope .description{display:block}.snippet-form.php-snippet .CodeMirror-sizer{padding-bottom:0!important}.snippet-form.php-snippet .CodeMirror-sizer:before{content:"<?php"}.snippet-form.css-snippet .css-scopes-list{display:block}.snippet-form.css-snippet .CodeMirror-sizer:before{content:"<style>"}.snippet-form.css-snippet .CodeMirror-sizer:after{content:"</style>"}.snippet-form.js-snippet .js-scopes-list{display:block}.snippet-form.js-snippet .CodeMirror-sizer:before{content:"<script>"}.snippet-form.js-snippet .CodeMirror-sizer:after{content:"</script>"}.snippet-form.html-snippet .html-scopes-list{display:block}.snippet-form.html-snippet .CodeMirror-sizer:before{content:"<!-- begin content -->"}.snippet-form.html-snippet .CodeMirror-sizer:after{content:"<!-- end content -->"}.tagger{border:0}.tagger>ul{align-items:center;background-color:#fff;border:1px solid #dfdfdf;border-radius:3px;box-sizing:border-box;display:flex;flex:0 0 auto;height:auto;justify-content:space-between;list-style:none;margin:0;overflow-y:auto;padding:4px 5px 0;width:100%}.tagger>ul>li{margin:.4rem 5px 4px;padding-bottom:.4rem}.tagger>ul>li:not(.tagger-new) a,.tagger>ul>li:not(.tagger-new) a:visited{color:#000;text-decoration:none}.tagger>ul>li:not(.tagger-new)>:first-child{background:#b1c3d7;border:1px solid #4181ed;border-radius:3px;padding:4px 4px 4px 8px}.tagger>ul>li:not(.tagger-new)>a>span,.tagger>ul>li:not(.tagger-new)>span{white-space:nowrap}.tagger li a.close{margin-left:4px;padding:4px}.tagger li a.close:hover{color:#fff}.tagger .tagger-new{flex-grow:1;min-width:40px;position:relative}.tagger .tagger-new input{background:transparent;border:none;box-shadow:none;box-sizing:border-box;outline:none;padding-left:0;width:100%}.tagger.wrap>ul{flex-wrap:wrap;justify-content:start}.tagger li:not(.tagger-new)>span,.tagger-new ul,.tagger>ul>li:not(.tagger-new)>a{background-color:#dee7f8;border:1px solid #cad8f3;border-radius:6px}.tagger li:not(.tagger-new)>span:hover,.tagger-new ul:hover,.tagger>ul>li:not(.tagger-new)>a:hover{background-color:#bbcef1;border-color:#6d95e0}.tagger-new ul a,.tagger-new ul a:visited,.tagger>ul>li:not(.tagger-new) a,.tagger>ul>li:not(.tagger-new) a:visited{color:#555;font-size:1.1em}.code-snippets-upgrade-dialog .logo{align-items:center;color:#3f444b;display:grid;font-size:25px;gap:.2em;grid-template-columns:auto auto;justify-content:center}.code-snippets-upgrade-dialog .logo img{height:50px}.code-snippets-upgrade-dialog p{text-align:left}.code-snippets-upgrade-dialog ul{list-style:none}.code-snippets-upgrade-dialog ul li:before{color:#2ecc40;content:"✓ ";margin-left:1em}.code-snippets-upgrade-dialog .components-modal__content{margin-top:0;padding:32px}.code-snippets-upgrade-dialog .upgrade-plans{display:grid;grid-template-columns:1fr 1fr 1fr;margin:2em 0;text-align:center}.code-snippets-upgrade-dialog .action-buttons{align-items:center;display:grid;grid-template-columns:auto auto;justify-content:space-around;margin-bottom:0}.code-snippets-upgrade-dialog .current-plan-cost{font-size:1rem}.code-snippets-upgrade-dialog .button .dashicons,.code-snippets-upgrade-dialog .button svg{margin-left:1ch;vertical-align:middle}.code-snippets-upgrade-dialog .components-external-link.button{text-decoration:none}.cloud-create-modal .components-modal__content{min-width:550px}.cloud-create-modal .action-buttons{display:flex;justify-content:flex-end}.cloud-create-modal .components-button.is-secondary{box-shadow:none}.cloud-create-modal .notice{margin-left:0;margin-right:0}.generate-button{align-items:center;display:flex;float:right}.generate-button .dashicons-warning{color:#b32d2e;margin-right:11px}.code-line-explanation{align-items:center;background-color:#fff;border:1px solid #bbb;border-left:0;border-right:0;color:#666;display:flex;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-style:italic;margin:0;padding:0 8px}.code-line-explanation img{height:1rem;padding-right:5px}.cloud-connect-modal .icons-group{align-items:center;display:flex;justify-content:center}.cloud-connect-modal .icons-group .dashicons{font-size:50px;height:50px;width:50px}.cloud-connect-modal .action-buttons{display:flex;justify-content:flex-end}.form-table th{width:auto}.notice.error blockquote{margin-bottom:0}h2{margin:25px 0 15px}h2 label{cursor:auto}.submit-inline,h2:first-of-type{margin:20px 0 10px}.saved-snippet.active-snippet #title,.saved-snippet.inactive-snippet #title{border-left-width:4px}.saved-snippet.active-snippet #title{border-left-color:#46b450}.saved-snippet.inactive-snippet #title{border-left-color:#bbb}.saved-snippet.erroneous-snippet #title{border-left-color:#dc3232}#snippet-form{margin-top:10px}#snippet-form #snippet-tags,#snippet-form textarea{font-family:monospace;width:100%}label[for=snippet_description] h3 div{position:absolute}.button+.button,.generate-button+.button{margin-left:.5em}h2 .button{font-weight:400}.button svg{height:1rem;line-height:1;margin:-2px 3px 0 0;vertical-align:middle}.submit,.submit-inline{display:flex}.submit-inline{float:right;margin-bottom:0}.snippet-scope p,p.snippet-scope{margin-top:15px}.snippet-description-container{margin-top:25px}.snippet-description-container .wp-editor-tools{padding-top:5px}.snippet-description-container .wp-editor-tabs{float:left}.html-shortcode-options strong,.snippet-scope label{display:inline-block;margin-right:1.5em}.below-snippet-editor{display:flex;flex-flow:row wrap;justify-content:space-between;padding-top:1px}.snippet-priority label{cursor:help;font-size:1.1em;font-weight:700;padding-right:.5em}.snippet-priority input{width:4em}.snippet-editor{position:relative}.CodeMirror{width:100%}.wrap h2.nav-tab-wrapper{border-bottom:none}.code-snippets-copy-text{color:inherit}.wrap .notice{scroll-margin:.75em}#edit-snippet-form-container .cs-sticky-notice{position:sticky;top:40px;z-index:100}
dist/edit.js 0000644 00000271254 15153464547 0007023 0 ustar 00 /*! For license information please see edit.js.LICENSE.txt */
(self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[8739],{2374:(e,t,n)=>{"use strict";var r={};n.r(r),n.d(r,{hasBrowserEnv:()=>Ee,hasStandardBrowserEnv:()=>ke,hasStandardBrowserWebWorkerEnv:()=>Ce,navigator:()=>Pe,origin:()=>Re});var o=n(1609),i=n(5338),s=n(3453),a=n(6942),c=n.n(a),l=function(){return window.pagenow.endsWith("-network")},u=function(){return null!==/mac/i.exec(window.navigator.userAgent)},p=function(){var e;return!(null===(e=window.CODE_SNIPPETS)||void 0===e||!e.isLicensed)},d=["css","js"],f=function(){return{id:0,name:"",desc:"",code:"",tags:[],scope:"global",modified:"",active:!1,network:l(),shared_network:null,priority:10}},h=function(e){var t="string"==typeof e?e:e.scope;switch(!0){case t.endsWith("-css"):return"css";case t.endsWith("-js"):return"js";case t.endsWith("content"):return"html";default:return"php"}},m=function(e){return d.includes(e)},y=n(2284);function b(e,t){return function(){return e.apply(t,arguments)}}const{toString:g}=Object.prototype,{getPrototypeOf:v}=Object,w=(j=Object.create(null),e=>{const t=g.call(e);return j[t]||(j[t]=t.slice(8,-1).toLowerCase())});var j;const O=e=>(e=e.toLowerCase(),t=>w(t)===e),_=e=>t=>typeof t===e,{isArray:x}=Array,S=_("undefined"),E=O("ArrayBuffer"),P=_("string"),k=_("function"),C=_("number"),R=e=>null!==e&&"object"==typeof e,T=e=>{if("object"!==w(e))return!1;const t=v(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},A=O("Date"),N=O("File"),D=O("Blob"),L=O("FileList"),F=O("URLSearchParams"),[B,I,U,q]=["ReadableStream","Request","Response","Headers"].map(O);function M(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),x(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function W(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,H=e=>!S(e)&&e!==z,J=(K="undefined"!=typeof Uint8Array&&v(Uint8Array),e=>K&&e instanceof K);var K;const $=O("HTMLFormElement"),G=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),V=O("RegExp"),X=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};M(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)},Y="abcdefghijklmnopqrstuvwxyz",Z="0123456789",Q={DIGIT:Z,ALPHA:Y,ALPHA_DIGIT:Y+Y.toUpperCase()+Z},ee=O("AsyncFunction"),te=(ne="function"==typeof setImmediate,re=k(z.postMessage),ne?setImmediate:re?(oe=`axios@${Math.random()}`,ie=[],z.addEventListener("message",(({source:e,data:t})=>{e===z&&t===oe&&ie.length&&ie.shift()()}),!1),e=>{ie.push(e),z.postMessage(oe,"*")}):e=>setTimeout(e));var ne,re,oe,ie;const se="undefined"!=typeof queueMicrotask?queueMicrotask.bind(z):"undefined"!=typeof process&&process.nextTick||te,ae={isArray:x,isArrayBuffer:E,isBuffer:function(e){return null!==e&&!S(e)&&null!==e.constructor&&!S(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||k(e.append)&&("formdata"===(t=w(e))||"object"===t&&k(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&E(e.buffer),t},isString:P,isNumber:C,isBoolean:e=>!0===e||!1===e,isObject:R,isPlainObject:T,isReadableStream:B,isRequest:I,isResponse:U,isHeaders:q,isUndefined:S,isDate:A,isFile:N,isBlob:D,isRegExp:V,isFunction:k,isStream:e=>R(e)&&k(e.pipe),isURLSearchParams:F,isTypedArray:J,isFileList:L,forEach:M,merge:function e(){const{caseless:t}=H(this)&&this||{},n={},r=(r,o)=>{const i=t&&W(n,o)||o;T(n[i])&&T(r)?n[i]=e(n[i],r):T(r)?n[i]=e({},r):x(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&M(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(M(t,((t,r)=>{n&&k(t)?e[r]=b(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&v(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:O,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(x(e))return e;let t=e.length;if(!C(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:$,hasOwnProperty:G,hasOwnProp:G,reduceDescriptors:X,freezeMethods:e=>{X(e,((t,n)=>{if(k(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];k(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return x(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:W,global:z,isContextDefined:H,ALPHABET:Q,generateString:(e=16,t=Q.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&k(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(R(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=x(e)?[]:{};return M(e,((e,t)=>{const i=n(e,r+1);!S(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:ee,isThenable:e=>e&&(R(e)||k(e))&&k(e.then)&&k(e.catch),setImmediate:te,asap:se};function ce(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}ae.inherits(ce,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const le=ce.prototype,ue={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{ue[e]={value:e}})),Object.defineProperties(ce,ue),Object.defineProperty(le,"isAxiosError",{value:!0}),ce.from=(e,t,n,r,o,i)=>{const s=Object.create(le);return ae.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ce.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const pe=ce;function de(e){return ae.isPlainObject(e)||ae.isArray(e)}function fe(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function he(e,t,n){return e?e.concat(t).map((function(e,t){return e=fe(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const me=ae.toFlatObject(ae,{},null,(function(e){return/^is[A-Z]/.test(e)})),ye=function(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!ae.isUndefined(t[e])}))).metaTokens,o=n.visitor||l,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ae.isDate(e))return e.toISOString();if(!a&&ae.isBlob(e))throw new pe("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(e)||ae.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(ae.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(ae.isArray(e)&&function(e){return ae.isArray(e)&&!e.some(de)}(e)||(ae.isFileList(e)||ae.endsWith(n,"[]"))&&(a=ae.toArray(e)))return n=fe(n),a.forEach((function(e,r){!ae.isUndefined(e)&&null!==e&&t.append(!0===s?he([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!de(e)||(t.append(he(o,n,i),c(e)),!1)}const u=[],p=Object.assign(me,{defaultVisitor:l,convertValue:c,isVisitable:de});if(!ae.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!ae.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),ae.forEach(n,(function(n,i){!0===(!(ae.isUndefined(n)||null===n)&&o.call(t,n,ae.isString(i)?i.trim():i,r,p))&&e(n,r?r.concat(i):[i])})),u.pop()}}(e),t};function be(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ge(e,t){this._pairs=[],e&&ye(e,this,t)}const ve=ge.prototype;ve.append=function(e,t){this._pairs.push([e,t])},ve.toString=function(e){const t=e?function(t){return e.call(this,t,be)}:be;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const we=ge;function je(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Oe(e,t,n){if(!t)return e;const r=n&&n.encode||je;ae.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):ae.isURLSearchParams(t)?t.toString():new we(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}const _e=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ae.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Se={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:we,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ee="undefined"!=typeof window&&"undefined"!=typeof document,Pe="object"==typeof navigator&&navigator||void 0,ke=Ee&&(!Pe||["ReactNative","NativeScript","NS"].indexOf(Pe.product)<0),Ce="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Re=Ee&&window.location.href||"http://localhost",Te={...r,...Se},Ae=function(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;return i=!i&&ae.isArray(r)?r.length:i,a?(ae.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&ae.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&ae.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,((e,r)=>{t(function(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},Ne={transitional:xe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=ae.isObject(e);if(o&&ae.isHTMLForm(e)&&(e=new FormData(e)),ae.isFormData(e))return r?JSON.stringify(Ae(e)):e;if(ae.isArrayBuffer(e)||ae.isBuffer(e)||ae.isStream(e)||ae.isFile(e)||ae.isBlob(e)||ae.isReadableStream(e))return e;if(ae.isArrayBufferView(e))return e.buffer;if(ae.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ye(e,new Te.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Te.isNode&&ae.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=ae.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ye(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e){if(ae.isString(e))try{return(0,JSON.parse)(e),ae.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(ae.isResponse(e)||ae.isReadableStream(e))return e;if(e&&ae.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw pe.from(e,pe.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Te.classes.FormData,Blob:Te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],(e=>{Ne.headers[e]={}}));const De=Ne,Le=ae.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Fe=Symbol("internals");function Be(e){return e&&String(e).trim().toLowerCase()}function Ie(e){return!1===e||null==e?e:ae.isArray(e)?e.map(Ie):String(e)}function Ue(e,t,n,r,o){return ae.isFunction(r)?r.call(this,t,n):(o&&(t=n),ae.isString(t)?ae.isString(r)?-1!==t.indexOf(r):ae.isRegExp(r)?r.test(t):void 0:void 0)}class qe{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Be(t);if(!o)throw new Error("header name must be a non-empty string");const i=ae.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ie(e))}const i=(e,t)=>ae.forEach(e,((e,n)=>o(e,n,t)));if(ae.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(ae.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&Le[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(ae.isHeaders(e))for(const[t,r]of e.entries())o(r,t,n);else null!=e&&o(t,e,n);return this}get(e,t){if(e=Be(e)){const n=ae.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(ae.isFunction(t))return t.call(this,e,n);if(ae.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Be(e)){const n=ae.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ue(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Be(e)){const o=ae.findKey(n,e);!o||t&&!Ue(0,n[o],o,t)||(delete n[o],r=!0)}}return ae.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ue(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return ae.forEach(this,((r,o)=>{const i=ae.findKey(n,o);if(i)return t[i]=Ie(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ie(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ae.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&ae.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Fe]=this[Fe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Be(e);t[r]||(function(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return ae.isArray(e)?e.forEach(r):r(e),this}}qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ae.reduceDescriptors(qe.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),ae.freezeMethods(qe);const Me=qe;function We(e,t){const n=this||De,r=t||n,o=Me.from(r.headers);let i=r.data;return ae.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function ze(e){return!(!e||!e.__CANCEL__)}function He(e,t,n){pe.call(this,null==e?"canceled":e,pe.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(He,pe,{__CANCEL__:!0});const Je=He;function Ke(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new pe("Request failed with status code "+n.status,[pe.ERR_BAD_REQUEST,pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const $e=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=r[s];o||(o=c),n[i]=a,r[i]=c;let u=s,p=0;for(;u!==i;)p+=n[u++],u%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=l&&c-l;return d?Math.round(1e3*p/d):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i,e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Ge=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ve=e=>(...t)=>ae.asap((()=>e(...t))),Xe=Te.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Te.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,Ye=Te.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];ae.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),ae.isString(r)&&s.push("path="+r),ae.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ze(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Qe=e=>e instanceof Me?{...e}:e;function et(e,t){t=t||{};const n={};function r(e,t,n,r){return ae.isPlainObject(e)&&ae.isPlainObject(t)?ae.merge.call({caseless:r},e,t):ae.isPlainObject(t)?ae.merge({},t):ae.isArray(t)?t.slice():t}function o(e,t,n,o){return ae.isUndefined(t)?ae.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!ae.isUndefined(t))return r(void 0,t)}function s(e,t){return ae.isUndefined(t)?ae.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Qe(e),Qe(t),0,!0)};return ae.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);ae.isUndefined(s)&&i!==a||(n[r]=s)})),n}const tt=e=>{const t=et({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:a,auth:c}=t;if(t.headers=a=Me.from(a),t.url=Oe(Ze(t.baseURL,t.url),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ae.isFormData(r))if(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Te.hasStandardBrowserEnv&&(o&&ae.isFunction(o)&&(o=o(t)),o||!1!==o&&Xe(t.url))){const e=i&&s&&Ye.read(s);e&&a.set(i,e)}return t},nt="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=tt(e);let o=r.data;const i=Me.from(r.headers).normalize();let s,a,c,l,u,{responseType:p,onUploadProgress:d,onDownloadProgress:f}=r;function h(){l&&l(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function y(){if(!m)return;const r=Me.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ke((function(e){t(e),h()}),(function(e){n(e),h()}),{data:p&&"text"!==p&&"json"!==p?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new pe("Request aborted",pe.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new pe("Network Error",pe.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||xe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new pe(t,o.clarifyTimeoutError?pe.ETIMEDOUT:pe.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&ae.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),ae.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),p&&"json"!==p&&(m.responseType=r.responseType),f&&([c,u]=$e(f,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,l]=$e(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new Je(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Te.protocols.indexOf(b)?n(new pe("Unsupported protocol "+b+":",pe.ERR_BAD_REQUEST,e)):m.send(o||null)}))},rt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof pe?t:new Je(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new pe(`timeout ${t} of ms exceeded`,pe.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>ae.asap(s),a}},ot=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},it=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}}(e))yield*ot(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},st="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,at=st&&"function"==typeof ReadableStream,ct=st&&("function"==typeof TextEncoder?(lt=new TextEncoder,e=>lt.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var lt;const ut=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},pt=at&&ut((()=>{let e=!1;const t=new Request(Te.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),dt=at&&ut((()=>ae.isReadableStream(new Response("").body))),ft={stream:dt&&(e=>e.body)};var ht;st&&(ht=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!ft[e]&&(ft[e]=ae.isFunction(ht[e])?t=>t[e]():(t,n)=>{throw new pe(`Response type '${e}' is not supported`,pe.ERR_NOT_SUPPORT,n)})})));const mt=st&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:u,withCredentials:p="same-origin",fetchOptions:d}=tt(e);l=l?(l+"").toLowerCase():"text";let f,h=rt([o,i&&i.toAbortSignal()],s);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let y;try{if(c&&pt&&"get"!==n&&"head"!==n&&0!==(y=await(async(e,t)=>{const n=ae.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(ae.isBlob(e))return e.size;if(ae.isSpecCompliantForm(e)){const t=new Request(Te.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ae.isArrayBufferView(e)||ae.isArrayBuffer(e)?e.byteLength:(ae.isURLSearchParams(e)&&(e+=""),ae.isString(e)?(await ct(e)).byteLength:void 0)})(t):n})(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(ae.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Ge(y,$e(Ve(c)));r=it(n.body,65536,e,t)}}ae.isString(p)||(p=p?"include":"omit");const o="credentials"in Request.prototype;f=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:o?p:void 0});let i=await fetch(f);const s=dt&&("stream"===l||"response"===l);if(dt&&(a||s&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=ae.toFiniteNumber(i.headers.get("content-length")),[n,r]=a&&Ge(t,$e(Ve(a),!0))||[];i=new Response(it(i.body,65536,n,(()=>{r&&r(),m&&m()})),e)}l=l||"text";let b=await ft[ae.findKey(ft,l)||"text"](i,e);return!s&&m&&m(),await new Promise(((t,n)=>{Ke(t,n,{data:b,headers:Me.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:f})}))}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new pe("Network Error",pe.ERR_NETWORK,e,f),{cause:t.cause||t});throw pe.from(t,t&&t.code,e,f)}}),yt={http:null,xhr:nt,fetch:mt};ae.forEach(yt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const bt=e=>`- ${e}`,gt=e=>ae.isFunction(e)||null===e||!1===e,vt=e=>{e=ae.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!gt(n)&&(r=yt[(t=String(n)).toLowerCase()],void 0===r))throw new pe(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+i]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(bt).join("\n"):" "+bt(e[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function wt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Je(null,e)}function jt(e){return wt(e),e.headers=Me.from(e.headers),e.data=We.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),vt(e.adapter||De.adapter)(e).then((function(t){return wt(e),t.data=We.call(e,e.transformResponse,t),t.headers=Me.from(t.headers),t}),(function(t){return ze(t)||(wt(e),t&&t.response&&(t.response.data=We.call(e,e.transformResponse,t.response),t.response.headers=Me.from(t.response.headers))),Promise.reject(t)}))}const Ot={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ot[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const _t={};Ot.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.9] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new pe(r(o," has been removed"+(t?" in "+t:"")),pe.ERR_DEPRECATED);return t&&!_t[o]&&(_t[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Ot.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const xt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new pe("option "+i+" must be "+n,pe.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new pe("Unknown option "+i,pe.ERR_BAD_OPTION)}},validators:Ot},St=xt.validators;class Et{constructor(e){this.defaults=e,this.interceptors={request:new _e,response:new _e}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=et(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&xt.assertOptions(n,{silentJSONParsing:St.transitional(St.boolean),forcedJSONParsing:St.transitional(St.boolean),clarifyTimeoutError:St.transitional(St.boolean)},!1),null!=r&&(ae.isFunction(r)?t.paramsSerializer={serialize:r}:xt.assertOptions(r,{encode:St.function,serialize:St.function},!0)),xt.assertOptions(t,{baseUrl:St.spelling("baseURL"),withXsrfToken:St.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&ae.merge(o.common,o[t.method]);o&&ae.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Me.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let u,p=0;if(!a){const e=[jt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),u=e.length,l=Promise.resolve(t);p<u;)l=l.then(e[p++],e[p++]);return l}u=s.length;let d=t;for(p=0;p<u;){const e=s[p++],t=s[p++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=jt.call(this,d)}catch(e){return Promise.reject(e)}for(p=0,u=c.length;p<u;)l=l.then(c[p++],c[p++]);return l}getUri(e){return Oe(Ze((e=et(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}ae.forEach(["delete","get","head","options"],(function(e){Et.prototype[e]=function(t,n){return this.request(et(n||{},{method:e,url:t,data:(n||{}).data}))}})),ae.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(et(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Et.prototype[e]=t(),Et.prototype[e+"Form"]=t(!0)}));const Pt=Et;class kt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Je(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new kt((function(t){e=t})),cancel:e}}}const Ct=kt,Rt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Rt).forEach((([e,t])=>{Rt[t]=e}));const Tt=Rt,At=function e(t){const n=new Pt(t),r=b(Pt.prototype.request,n);return ae.extend(r,Pt.prototype,n,{allOwnKeys:!0}),ae.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(et(t,n))},r}(De);At.Axios=Pt,At.CanceledError=Je,At.CancelToken=Ct,At.isCancel=ze,At.VERSION="1.7.9",At.toFormData=ye,At.AxiosError=pe,At.Cancel=At.CanceledError,At.all=function(e){return Promise.all(e)},At.spread=function(e){return function(t){return e.apply(null,t)}},At.isAxiosError=function(e){return ae.isObject(e)&&!0===e.isAxiosError},At.mergeConfig=et,At.AxiosHeaders=Me,At.formToJSON=e=>Ae(ae.isHTMLForm(e)?new FormData(e):e),At.getAdapter=vt,At.HttpStatusCode=Tt,At.default=At;const Nt=At,{Axios:Dt,AxiosError:Lt,CanceledError:Ft,isCancel:Bt,CancelToken:It,VERSION:Ut,all:qt,Cancel:Mt,isAxiosError:Wt,spread:zt,toFormData:Ht,AxiosHeaders:Jt,HttpStatusCode:Kt,formToJSON:$t,getAdapter:Gt,mergeConfig:Vt}=Nt;var Xt=n(816);function Yt(e,t,n){return(t=(0,Xt.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zt(e,t,n,r,o,i,s){try{var a=e[i](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}function Qt(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function s(e){Zt(i,r,o,s,a,"next",e)}function a(e){Zt(i,r,o,s,a,"throw",e)}s(void 0)}))}}var en=n(4756),tn=n.n(en);const nn=window.wp.i18n;function rn(e){try{return decodeURIComponent(e)}catch(t){return e}}function on(e="",t){if(!t||!Object.keys(t).length)return e;let n=e;const r=e.indexOf("?");return-1!==r&&(t=Object.assign(function(e){return(function(e){let t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce(((e,t)=>{const[n,r=""]=t.split("=").filter(Boolean).map(rn);return n&&function(e,t,n){const r=t.length,o=r-1;for(let i=0;i<r;i++){let r=t[i];!r&&Array.isArray(e)&&(r=e.length.toString()),r=["__proto__","constructor","prototype"].includes(r)?r.toUpperCase():r;const s=!isNaN(Number(t[i+1]));e[r]=i===o?n:e[r]||(s?[]:{}),Array.isArray(e[r])&&!s&&(e[r]={...e[r]}),e=e[r]}}(e,n.replace(/\]/g,"").split("["),r),e}),Object.create(null))}(e),t),n=n.substr(0,r)),n+"?"+function(e){let t="";const n=Object.entries(e);let r;for(;r=n.shift();){let[e,o]=r;if(Array.isArray(o)||o&&o.constructor===Object){const t=Object.entries(o).reverse();for(const[r,o]of t)n.unshift([`${e}[${r}]`,o])}else void 0!==o&&(null===o&&(o=""),t+="&"+[e,o].map(encodeURIComponent).join("="))}return t.substr(1)}(t)}var sn=n(3145),an=n(7800);function cn(e){return function(e){if(Array.isArray(e))return(0,sn.A)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,an.A)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ln,un,pn=function(){var e=Qt(tn().mark((function e(t,n,r,o){var i,s;return tn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=console).debug.apply(i,["".concat(t," ").concat(n)].concat(cn(o?[o]:[]))),e.next=3,r;case 3:return s=e.sent,console.debug("Response",s),e.abrupt("return",s);case 6:case"end":return e.stop()}}),e)})));return function(t,n,r,o){return e.apply(this,arguments)}}(),dn=null===(ln=window.CODE_SNIPPETS)||void 0===ln?void 0:ln.restAPI.snippets,fn={headers:{"X-WP-Nonce":null===(un=window.CODE_SNIPPETS)||void 0===un?void 0:un.restAPI.nonce}},hn=function(e,t){var n=e.id,r=e.network;return on([dn,n,t].filter(Boolean).join("/"),{network:!!r||void 0})},mn=function(){var e,t,n=(e=fn,t=(0,o.useMemo)((function(){return Nt.create(e)}),[e]),(0,o.useMemo)((function(){return{get:function(e){return pn("GET",e,t.get(e))},post:function(e,n){return pn("POST",e,t.post(e,n),n)},del:function(e){return pn("DELETE",e,t.delete(e))},axiosInstance:t}}),[t])),r=n.get,i=n.post,s=n.del;return(0,o.useMemo)((function(){return{fetchAll:function(e){return r(on(dn,{network:e}))},fetch:function(e,t){return r(on("".concat(dn,"/").concat(e),{network:t}))},create:function(e){return i("".concat(dn),e)},update:function(e){return i(hn(e),e)},delete:function(e){return s(hn(e))},activate:function(e){return i(hn(e,"activate"))},deactivate:function(e){return i(hn(e,"deactivate"))},export:function(e){return r(hn(e,"export"))},exportCode:function(e){return r(hn(e,"export-code"))}}}),[r,i,s])};function yn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yn(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var gn=function(e,t,n){return void 0===n?0===e.id?(0,nn.__)("Snippet created.","code-snippets"):(0,nn.__)("Snippet updated.","code-snippets"):0===e.id&&n?(0,nn.__)("Snippet created and activated.","code-snippets"):n?"single-use"===t.scope?(0,nn.__)("Snippet updated and executed.","code-snippets"):(0,nn.__)("Snippet updated and activated.","code-snippets"):(0,nn.__)("Snippet updated and deactivated")},vn=n(4848),wn=(0,o.createContext)(void 0),jn=function(){var e=(0,o.useContext)(wn);if(void 0===e)throw Error("useSnippetForm can only be used within a SnippetForm context provider");return e},On=function(e){var t=e.children,n=e.initialSnippet,r=(0,o.useState)(n),i=(0,s.A)(r,2),a=i[0],c=i[1],l=(0,o.useState)(!1),u=(0,s.A)(l,2),f=u[0],m=u[1],b=(0,o.useState)(),g=(0,s.A)(b,2),v=g[0],w=g[1],j=(0,o.useState)(),O=(0,s.A)(j,2),_=O[0],x=O[1],S=function(e,t,n){var r=mn();return(0,o.useCallback)(function(){var o=Qt(tn().mark((function o(i,s){var a,c,l;return tn().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return t(!0),n(void 0),o.next=4,Qt(tn().mark((function e(){var n,o,a;return tn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=bn(bn({},i),{},{active:null!=s?s:i.active}),e.next=4,0===i.id?r.create(n):r.update(n);case 4:return o=e.sent,a=o.data,t(!1),e.abrupt("return",a.id?a:void 0);case 10:return e.prev=10,e.t0=e.catch(0),t(!1),e.abrupt("return",Wt(e.t0)?e.t0.message:void 0);case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))();case 4:if(void 0!==(a=o.sent)&&"string"!=typeof a){o.next=11;break}return c=[i.id?(0,nn.__)("Could not create snippet.","code-snippets"):(0,nn.__)("Could not update snippet.","code-snippets"),null!=a?a:(0,nn.__)("The server did not send a valid response.","code-snippets")],n(["error",c.filter(Boolean).join(" ")]),o.abrupt("return",void 0);case 11:return e(bn({},a)),n(["updated",gn(i,a,s)]),i.id&&a.id&&(window.document.title=window.document.title.replace((0,nn.__)("Add New Snippet","code-snippets"),(0,nn.__)("Edit Snippet","code-snippets")),window.history.replaceState({},"",on(null===(l=window.CODE_SNIPPETS)||void 0===l?void 0:l.urls.edit,{id:a.id}))),o.abrupt("return",a);case 15:case"end":return o.stop()}}),o)})));return function(e,t){return o.apply(this,arguments)}}(),[r,n,t,e])}(c,m,w),E=(0,o.useMemo)((function(){return!p()&&function(e){return d.includes(h(e))}(a.scope)}),[a.scope]),P=(0,o.useCallback)((function(e,t){console.error("Request failed",e),m(!1),w(["error",[t,Wt(e)?e.message:""].filter(Boolean).join(" ")])}),[m,w]),k=(0,o.useCallback)((function(e){c((function(t){var n,r="object"===(0,y.A)(e)?e:e(t);return null==_||_.codemirror.setValue(r.code),null===(n=window.tinymce)||void 0===n||n.activeEditor.setContent(r.desc),r}))}),[null==_?void 0:_.codemirror]),C={snippet:a,setSnippet:c,updateSnippet:k,isReadOnly:E,isWorking:f,setIsWorking:m,currentNotice:v,setCurrentNotice:w,codeEditorInstance:_,setCodeEditorInstance:x,handleRequestError:P,submitSnippet:function(){return S(a)},submitAndActivateSnippet:function(){return S(a,!0)},submitAndDeactivateSnippet:function(){return S(a,!1)}};return(0,vn.jsx)(wn.Provider,{value:C,children:t})};const _n=window.wp.components;function xn(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Sn=["id","children","className","name","primary","small","large","type","onClick"];function En(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?En(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):En(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var kn=function(e){var t=e.id,n=e.children,r=e.className,o=e.name,i=void 0===o?"submit":o,s=e.primary,a=void 0!==s&&s,l=e.small,u=void 0!==l&&l,p=e.large,d=void 0!==p&&p,f=e.type,h=void 0===f?"button":f,m=e.onClick,y=xn(e,Sn);return(0,vn.jsx)("button",Pn(Pn({id:null!=t?t:i,name:i,type:h},y),{},{onClick:function(e){m&&(e.preventDefault(),m(e))},className:c()("button",r,{"button-primary":a,"button-large":d,"button-small":u}),children:n}))},Cn=function(e){var t=e.open,n=e.title,r=e.onConfirm,o=e.onCancel,i=e.children,s=e.confirmLabel,a=void 0===s?(0,nn.__)("OK","code-snippets"):s,c=e.cancelLabel,l=void 0===c?(0,nn.__)("Cancel","code-snippets"):c,u=e.confirmButtonClassName;return t?(0,vn.jsxs)(_n.Modal,{title:n,onRequestClose:o,closeButtonLabel:l,isDismissible:!0,onKeyDown:function(e){"Enter"===e.key&&(null==r||r())},children:[i,(0,vn.jsxs)(_n.Flex,{direction:"row",justify:"flex-end",children:[(0,vn.jsx)(_n.Button,{variant:"tertiary",onClick:o,children:l}),(0,vn.jsx)(_n.Button,{variant:"primary",onClick:r,className:u,children:a})]})]}):null},Rn=function(){var e=mn(),t=jn(),n=t.snippet,r=t.setIsWorking,i=t.isWorking,a=t.handleRequestError,c=(0,o.useState)(!1),l=(0,s.A)(c,2),u=l[0],p=l[1];return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)(kn,{name:"delete_snippet",onClick:function(){return p(!0)},disabled:i,children:(0,nn.__)("Delete","code-snippets")}),(0,vn.jsxs)(Cn,{open:u,title:(0,nn.__)("Permanently delete?","code-snippets"),confirmLabel:(0,nn.__)("Delete","code-snippets"),confirmButtonClassName:"is-destructive",onCancel:function(){return p(!1)},onConfirm:function(){p(!1),r(!0),e.delete(n).then((function(){var e;r(!1),window.location.replace(on(null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.manage,{result:"deleted"}))})).catch((function(e){return a(e,(0,nn.__)("Could not delete snippet.","code-snippets"))}))},children:[(0,vn.jsxs)("p",{children:[(0,nn.__)("You are about to permanently delete this snippet.","code-snippets")," ",(0,nn.__)("Are you sure?","code-snippets")]}),(0,vn.jsx)("p",{children:(0,vn.jsx)("strong",{children:(0,nn.__)("This action cannot be undone.","code-snippets")})})]})]})},Tn={php:["php","text/php"],html:["php","text/php"],css:["css","text/css"],js:["js","text/javascript"],json:["json","application/json"]},An=function(e,t,n){var r=t.id,o=t.name,i=t.scope,a=(0,s.A)(Tn[null!=n?n:h(i)],2),c=a[0],l=a[1],u=o.toLowerCase().replace(/[^\w-]+/g,"-").trim(),p=""===u?"snippet-".concat(r):u;!function(e,t,n){var r=document.createElement("a");r.download=t,r.href=URL.createObjectURL(new Blob([e],{type:n})),setTimeout((function(){return URL.revokeObjectURL(r.href)}),4e4),setTimeout((function(){return r.click()}),0)}(e,"".concat(p,".code-snippets.").concat(c),l)},Nn=function(){var e,t=mn(),n=jn(),r=n.snippet,o=n.isWorking,i=n.setIsWorking,s=n.handleRequestError,a=function(e){var t=e.data;i(!1),console.info("file response",e),"string"==typeof t?An(t,r):An(JSON.stringify(t,void 0,2),r,"json")};return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)(kn,{name:"export_snippet",onClick:function(){i(!0),t.export(r).then(a).catch((function(e){return s(e,(0,nn.__)("Could not download export file.","code-snippets"))}))},disabled:o,children:(0,nn.__)("Export","code-snippets")}),null!==(e=window.CODE_SNIPPETS_EDIT)&&void 0!==e&&e.enableDownloads?(0,vn.jsx)(kn,{name:"export_snippet_code",onClick:function(){t.exportCode(r).then(a).catch((function(e){return s(e,(0,nn.__)("Could not download file.","code-snippets"))}))},disabled:o,children:(0,nn.__)("Export Code","code-snippets")}):""]})},Dn=function(e){console.error(e)},Ln=["inlineButtons"],Fn=["inlineButtons"],Bn=["inlineButtons"],In=["inlineButtons"];function Un(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Un(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Mn=function(e){var t=e.inlineButtons,n=xn(e,Ln);return(0,vn.jsx)(kn,qn(qn({name:"save_snippet",type:"submit",small:t,title:t?(0,nn.__)("Save Snippet","code-snippets"):void 0},n),{},{children:(0,nn.__)("Save Changes","code-snippets")}))},Wn=function(e){var t=e.inlineButtons,n=xn(e,Fn);return(0,vn.jsx)(kn,qn(qn({name:"save_snippet_execute",title:t?(0,nn.__)("Save Snippet and Execute Once","code-snippets"):void 0},n),{},{children:t?(0,nn.__)("Execute Once","code-snippets"):(0,nn.__)("Save Changes and Execute Once","code-snippets")}))},zn=function(e){var t=e.inlineButtons,n=xn(e,Bn);return(0,vn.jsx)(kn,qn(qn({name:"save_snippet_deactivate",title:t?(0,nn.__)("Save Snippet and Deactivate","code-snippets"):void 0},n),{},{children:t?(0,nn.__)("Deactivate","code-snippets"):(0,nn.__)("Save Changes and Deactivate","code-snippets")}))},Hn=function(e){var t=e.inlineButtons,n=xn(e,In);return(0,vn.jsx)(kn,qn(qn({name:"save_snippet_activate",title:t?(0,nn.__)("Save Snippet and Activate","code-snippets"):void 0},n),{},{children:t?(0,nn.__)("Activate","code-snippets"):(0,nn.__)("Save Changes and Activate","code-snippets")}))},Jn=function(e){var t=e.snippet,n=e.disabled,r=e.onActivate,o=e.onDeactivate,i=e.inlineButtons,s=e.primaryActivate,a={small:i,type:"submit",disabled:n,inlineButtons:i};switch(!0){case t.shared_network&&l():return null;case"single-use"===t.scope:return(0,vn.jsx)(Wn,qn({onClick:r},a));case t.active:return(0,vn.jsx)(zn,qn({onClick:o},a));default:case!t.active:return(0,vn.jsx)(Hn,qn({onClick:r,primary:s},a))}},Kn=function(e){var t=e.isOpen,n=e.onClose,r=e.onSubmit,o=e.validationWarning;return(0,vn.jsx)(Cn,{open:t,title:(0,nn.__)("Snippet incomplete","code-snippets"),confirmLabel:(0,nn.__)("Continue","code-snippets"),onCancel:n,onConfirm:function(){null==r||r(),n()},children:(0,vn.jsx)("p",{children:"".concat(o," ").concat((0,nn.__)("Continue?","code-snippets"))})})},$n=function(e){var t=e.inlineButtons,n=jn(),r=n.snippet,i=n.isWorking,a=n.submitSnippet,c=n.submitAndActivateSnippet,u=n.submitAndDeactivateSnippet,p=(0,o.useState)(!1),d=(0,s.A)(p,2),f=d[0],h=d[1],m=(0,o.useState)(),y=(0,s.A)(m,2),b=y[0],g=y[1],v=function(e){var t=""===e.code.trim(),n=""===e.name.trim();switch(!0){case t&&n:return(0,nn.__)("This snippet has no code or title.","code-snippets");case t:return(0,nn.__)("This snippet has no snippet code.","code-snippets");case n:return(0,nn.__)("This snippet has no title.","code-snippets");default:return}}(r),w=function(e,t){var n;return!(t||null===(n=window.CODE_SNIPPETS_EDIT)||void 0===n||!n.activateByDefault||e.active||"single-use"===e.scope||e.shared_network&&l())}(r,t),j=function(e){v?(h(!0),g((function(){return e}))):e().then((function(){})).catch(Dn)};return(0,vn.jsxs)(vn.Fragment,{children:[w?null:(0,vn.jsx)(Mn,{primary:!t,onClick:function(){return j(a)},disabled:i,inlineButtons:t}),(0,vn.jsx)(Jn,{snippet:r,disabled:i,inlineButtons:t,primaryActivate:w,onActivate:function(){return j(c)},onDeactivate:function(){return j(u)}}),w?(0,vn.jsx)(Mn,{onClick:function(){return j(a)},disabled:i,inlineButtons:t}):null,(0,vn.jsx)(Kn,{isOpen:f,validationWarning:v,onSubmit:b,onClose:function(){h(!1),g(void 0)}})]})},Gn=function(){var e=jn(),t=e.snippet,n=e.isWorking;return(0,vn.jsxs)("p",{className:"submit",children:[(0,vn.jsx)($n,{}),t.id?(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)(Nn,{}),(0,vn.jsx)(Rn,{})]}):"",n?(0,vn.jsx)(_n.Spinner,{}):""]})},Vn=Yt(Yt(Yt({},"2",39),"6",69),"200",119),Xn=function(){var e=(0,o.useState)("6"),t=(0,s.A)(e,2),n=t[0],r=t[1];return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("p",{children:(0,vn.jsx)("strong",{children:(0,nn.__)("How many websites do you plan to use Code Snippets on?","code-snippets")})}),(0,vn.jsx)("p",{children:(0,nn.__)("We offer three distinct plans, each tailored to meet your needs.","code-snippets")}),(0,vn.jsx)("p",{className:"upgrade-plans",children:Object.keys(Vn).map((function(e){return(0,vn.jsxs)("label",{children:[(0,vn.jsx)("input",{type:"radio",checked:e===n.toString(),onClick:function(){return r(e)}})," ",(0,nn.sprintf)((0,nn._n)("%d site","%d sites",Number(e),"code-snippets"),e)]},"".concat(e,"-sites"))}))}),(0,vn.jsxs)("p",{className:"action-buttons",children:[(0,vn.jsx)("span",{className:"current-plan-cost",children:(0,nn.sprintf)((0,nn.__)("$%s per year","code-snippets"),Vn[n])}),(0,vn.jsx)(_n.ExternalLink,{className:"button button-primary button-large",href:"https://checkout.freemius.com/mode/dialog/plugin/10565/plan/17873/licenses/".concat(n,"/"),children:(0,nn.__)("Upgrade Now","code-snippets")})]})]})},Yn=function(e){var t=e.nextTab;return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsxs)("p",{children:[(0,nn.__)("You are using the free version of Code Snippets.","code-snippets")," ",(0,nn.__)("Upgrade to Code Snippets Pro to unleash its full potential:","code-snippets"),(0,vn.jsxs)("ul",{children:[(0,vn.jsxs)("li",{children:[(0,vn.jsx)("strong",{children:(0,nn.__)("CSS stylesheet snippets: ","code-snippets")}),(0,nn.__)("Craft impeccable websites with advanced CSS snippets.","code-snippets")]}),(0,vn.jsxs)("li",{children:[(0,vn.jsx)("strong",{children:(0,nn.__)("JavaScript snippets: ","code-snippets")}),(0,nn.__)("Enhance user interaction with the power of JavaScript.","code-snippets")]}),(0,vn.jsxs)("li",{children:[(0,vn.jsx)("strong",{children:(0,nn.__)("Specialized Elementor widgets: ","code-snippets")}),(0,nn.__)("Easily customize your site with Elementor widgets.","code-snippets")]}),(0,vn.jsxs)("li",{children:[(0,vn.jsx)("strong",{children:(0,nn.__)("Integration with block editor: ","code-snippets")}),(0,nn.__)("Seamlessly incorporate your snippets within the block editor.","code-snippets")]}),(0,vn.jsxs)("li",{children:[(0,vn.jsx)("strong",{children:(0,nn.__)("WP-CLI snippet commands: ","code-snippets")}),(0,nn.__)("Access and control your snippets directly from the command line.","code-snippets")]}),(0,vn.jsxs)("li",{children:[(0,vn.jsx)("strong",{children:(0,nn.__)("Premium support: ","code-snippets")}),(0,nn.__)("Direct access to our team. We're happy to help!","code-snippets")]})]}),(0,nn.__)("…and so much more!","code-snippets")]}),(0,vn.jsxs)("p",{className:"action-buttons",children:[(0,vn.jsx)(_n.ExternalLink,{className:"button button-secondary",href:"https://codesnippets.pro/pricing/",children:(0,nn.__)("Learn More","code-snippets")}),(0,vn.jsxs)("button",{className:"button button-primary button-large",onClick:t,children:[(0,nn.__)("See Plans","code-snippets"),(0,vn.jsx)("span",{className:"dashicons dashicons-arrow-right"})]})]})]})},Zn=function(e){var t,n=e.isOpen,r=e.setIsOpen,i=(0,o.useState)(0),a=(0,s.A)(i,2),c=a[0],l=a[1];return n?(0,vn.jsxs)(_n.Modal,{title:"",className:"code-snippets-upgrade-dialog",onRequestClose:function(){r(!1),l(0)},children:[(0,vn.jsxs)("h1",{className:"logo",children:[(0,vn.jsx)("img",{src:"".concat(null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.plugin,"/assets/icon.svg"),alt:""}),(0,nn.__)("Code Snippets Pro","code-snippets")]}),0===c?(0,vn.jsx)(Yn,{nextTab:function(){return l(1)}}):(0,vn.jsx)(Xn,{})]}):null};const Qn=window.wp.domReady;var er=n.n(Qn);function tr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var rr="snippet_description",or=[["bold","italic","underline","strikethrough","blockquote","bullist","numlist","alignleft","aligncenter","alignright","link","wp_adv","code_snippets"],["formatselect","forecolor","pastetext","removeformat","charmap","outdent","indent","undo","redo","spellchecker"]],ir=function(){var e,t=jn(),n=t.snippet,r=t.setSnippet,i=t.isReadOnly,s=(0,o.useCallback)((function(e){return r((function(t){return nr(nr({},t),{},{desc:e})}))}),[r]);return(0,o.useEffect)((function(){er()((function(){return function(e){var t,n;null===(t=window.wp.editor)||void 0===t||t.initialize(rr,{mediaButtons:null===(n=window.CODE_SNIPPETS_EDIT)||void 0===n?void 0:n.descEditorOptions.mediaButtons,quicktags:!0,tinymce:{toolbar:or.map((function(e){return e.join(" ")})),setup:function(t){t.on("change",(function(){return e(t.getContent())}))}}})}(s)}))}),[s]),null!==(e=window.CODE_SNIPPETS_EDIT)&&void 0!==e&&e.enableDescription?(0,vn.jsxs)("div",{className:"snippet-description-container",children:[(0,vn.jsx)("h2",{children:(0,vn.jsx)("label",{htmlFor:rr,children:(0,nn.__)("Description","code-snippets")})}),(0,vn.jsx)("textarea",{id:rr,className:"wp-editor-area",onChange:function(e){return s(e.target.value)},autoComplete:"off",disabled:i,rows:window.CODE_SNIPPETS_EDIT.descEditorOptions.rows,cols:40,children:n.desc})]}):null};function sr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var cr=function(){var e=jn(),t=e.snippet,n=e.setSnippet,r=e.isReadOnly;return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("h2",{className:"screen-reader-text",children:(0,nn.__)("Sharing Settings","code-snippets")}),(0,vn.jsx)("p",{className:"snippet-sharing-setting",children:(0,vn.jsxs)("label",{htmlFor:"snippet_sharing",children:[(0,vn.jsx)("input",{id:"snippet_sharing",name:"snippet_sharing",type:"checkbox",checked:Boolean(t.shared_network),disabled:r,onChange:function(e){return n((function(t){return ar(ar({},t),{},{shared_network:e.target.checked})}))}}),(0,nn.__)("Allow this snippet to be activated on individual sites on the network","code-snippets")]})})]})};function lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ur(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var pr=function(){var e=jn(),t=e.snippet,n=e.setSnippet,r=e.isReadOnly;return(0,vn.jsx)("div",{id:"titlediv",children:(0,vn.jsxs)("div",{id:"titlewrap",children:[(0,vn.jsx)("label",{htmlFor:"title",className:"screen-reader-text",children:(0,nn.__)("Name","code-snippets")}),(0,vn.jsx)("input",{id:"title",type:"text",name:"snippet_name",autoComplete:"off",value:t.name,disabled:r,placeholder:(0,nn.__)("Enter title here","code-snippets"),onChange:function(e){return n((function(t){return ur(ur({},t),{},{name:e.target.value})}))}})]})})};function dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hr=function(){var e=jn(),t=e.snippet,n=e.setSnippet,r=e.isReadOnly;return"html"===h(t)?null:(0,vn.jsxs)("p",{className:"snippet-priority",title:(0,nn.__)("Snippets with a lower priority number will run before those with a higher number.","code-snippets"),children:[(0,vn.jsx)("label",{htmlFor:"snippet_priority",children:"".concat((0,nn.__)("Priority","code-snippets")," ")}),(0,vn.jsx)("input",{type:"number",id:"snippet_priority",name:"snippet_priority",value:t.priority,disabled:r,onChange:function(e){return n((function(t){return fr(fr({},t),{},{priority:parseInt(e.target.value,10)})}))}})]})},mr=["php","html","css","js"],yr={php:["global","admin","front-end","single-use"],html:["content","head-content","footer-content"],css:["admin-css","site-css"],js:["site-head-js","site-footer-js"]},br=function(e,t){return"[".concat([e].concat(cn(Object.entries(t).filter((function(e){var t=(0,s.A)(e,2)[1];return Boolean(t)})).map((function(e){var t=(0,s.A)(e,2),n=t[0],r=t[1];return"boolean"==typeof r?n:"".concat(n,"=").concat(JSON.stringify(r))})))).filter(Boolean).join(" "),"]")},gr=["text","copyIcon","successIcon"];function vr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var wr=function(e){var t=e.text,n=e.copyIcon,r=void 0===n?"clipboard":n,i=e.successIcon,a=void 0===i?"yes":i,c=xn(e,gr),l=(0,o.useState)(!1),u=(0,s.A)(l,2),p=u[0],d=u[1],f=window.navigator.clipboard;return f?(0,vn.jsx)("a",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({href:"#",className:"code-snippets-copy-text dashicons dashicons-".concat(p?a:r),onClick:function(e){e.preventDefault(),null==f||f.writeText(t).then((function(){d(!0),setTimeout((function(){return d(!1)}),3e3)})).catch(Dn)}},c)):null};function jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _r="code_snippet",xr={global:"admin-site",admin:"admin-tools","front-end":"admin-appearance","single-use":"clock",content:"shortcode","head-content":"editor-code","footer-content":"editor-code","admin-css":"dashboard","site-css":"admin-customizer","site-head-js":"media-code","site-footer-js":"media-code"},Sr={global:(0,nn.__)("Run snippet everywhere","code-snippets"),admin:(0,nn.__)("Only run in administration area","code-snippets"),"front-end":(0,nn.__)("Only run on site front-end","code-snippets"),"single-use":(0,nn.__)("Only run once","code-snippets"),content:(0,nn.__)("Only display when inserted into a post or page.","code-snippets"),"head-content":(0,nn.__)("Display in site <head> section.","code-snippets"),"footer-content":(0,nn.__)("Display at the end of the <body> section, in the footer.","code-snippets"),"site-css":(0,nn.__)("Site front-end styles","code-snippets"),"admin-css":(0,nn.__)("Administration area styles","code-snippets"),"site-footer-js":(0,nn.__)("Load JS at the end of the <body> section","code-snippets"),"site-head-js":(0,nn.__)("Load JS in the <head> section","code-snippets")},Er=function(e){var t=e.atts;return(0,vn.jsxs)("p",{children:[(0,vn.jsx)("code",{className:"shortcode-tag",children:br(_r,t)}),(0,vn.jsx)(wr,{title:(0,nn.__)("Copy shortcode to clipboard","code-snippets"),text:br(_r,t)})]})},Pr=function(e){var t=e.optionLabels,n=e.options,r=e.setOptions,o=e.isReadOnly;return(0,vn.jsxs)("p",{className:"html-shortcode-options",children:[(0,vn.jsx)("strong",{children:(0,nn.__)("Shortcode Options: ","code-snippets")}),t.map((function(e){var t=(0,s.A)(e,2),i=t[0],a=t[1];return(0,vn.jsxs)("label",{children:[(0,vn.jsx)("input",{type:"checkbox",value:i,checked:n[i],disabled:o,onChange:function(e){return r((function(t){return Or(Or({},t),{},Yt({},i,e.target.checked))}))}})," ".concat(a)]},i)}))]})},kr=function(){var e,t,n,r=jn(),i=r.snippet,a=r.isReadOnly,c=(0,o.useState)((function(){return{php:i.code.includes("<?"),format:!0,shortcodes:!1}})),u=(0,s.A)(c,2),p=u[0],d=u[1];return"content"===i.scope?(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsxs)("p",{className:"description",children:[(0,nn.__)("There are multiple options for inserting this snippet into a post, page or other content.","code-snippets")," ",i.id?(0,nn.__)("You can copy the below shortcode, or use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).","code-snippets"):(0,nn.__)("After saving, you can copy a shortcode, or use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).","code-snippets")," ",(0,vn.jsx)(_n.ExternalLink,{href:(0,nn.__)("https://help.codesnippets.pro/article/50-inserting-snippets","code-snippets"),children:(0,nn.__)("Learn more","code-snippets")})]}),i.id?(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)(Er,{atts:Or({id:i.id,name:(t=i.name,n=t.trim().split(/\s+/),n.length>3?"".concat(n.slice(0,3).join(" "),"…"):t),network:null!==(e=i.network)&&void 0!==e?e:l()},p)}),(0,vn.jsx)(Pr,{options:p,setOptions:d,isReadOnly:a,optionLabels:[["php",(0,nn.__)("Evaluate PHP code","code-snippets")],["format",(0,nn.__)("Add paragraphs and formatting","code-snippets")],["shortcodes",(0,nn.__)("Evaluate additional shortcode tags","code-snippets")]]})]}):null]}):null},Cr=function(){var e=jn(),t=e.snippet,n=e.setSnippet,r=e.isReadOnly;return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("h2",{className:"screen-reader-text",children:(0,nn.__)("Scope","code-snippets")}),mr.filter((function(e){return!t.id||e===h(t)})).map((function(e){return(0,vn.jsxs)("p",{className:"snippet-scope ".concat(e,"-scopes-list"),children:[yr[e].map((function(e){return(0,vn.jsxs)("label",{children:[(0,vn.jsx)("input",{type:"radio",name:"snippet_scope",value:e,checked:e===t.scope,onChange:function(t){return t.target.checked&&n((function(t){return Or(Or({},t),{},{scope:e})}))},disabled:r})," ",(0,vn.jsx)("span",{className:"dashicons dashicons-".concat(xr[e])})," ".concat(Sr[e])]},e)})),"html"===e?(0,vn.jsx)(kr,{}):null]},e)}))]})},Rr=n(5501),Tr=n(3662),Ar=function(e){var t=e.id,n=e.suggestions,r=e.onSelect;return(0,vn.jsx)("div",{className:"tagger-completion",children:(0,vn.jsx)("datalist",{id:t,children:n.map((function(e){return(0,vn.jsx)("option",{value:e,onClick:function(){return r(e)}},e)}))})})},Nr=function(e){var t=e.tags,n=e.onRemove;return(0,vn.jsx)(vn.Fragment,{children:t.map((function(e){return(0,vn.jsx)("li",{children:(0,vn.jsxs)("span",{children:[(0,vn.jsx)("span",{className:"label",children:e}),(0,vn.jsx)("a",{href:"#",className:"close",onClick:function(t){n(e),t.preventDefault()},children:"×"})]})},e)}))})},Dr=["id","tags","onChange","tagLimit","completions","addOnBlur","allowSpaces","allowDuplicates","completionMinLength"];function Lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Br(){Br=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,o){var i=RegExp(e,r);return t.set(i,o||t.get(e)),(0,Tr.A)(i,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce((function(t,n){var o=r[n];if("number"==typeof o)t[n]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1<o.length;)i++;t[n]=e[o[i]]}return t}),Object.create(null))}return(0,Rr.A)(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var o=n.indices;o&&(o.groups=r(o,this))}return n},n.prototype[Symbol.replace]=function(n,o){if("string"==typeof o){var i=t.get(this);return e[Symbol.replace].call(this,n,o.replace(/\$<([^>]+)>/g,(function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof o){var s=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=(0,y.A)(e[e.length-1])&&(e=[].slice.call(e)).push(r(e,s)),o.apply(this,e)}))}return e[Symbol.replace].call(this,n,o)},Br.apply(this,arguments)}var Ir,Ur=Br(/([-\\^$[\]()+{}?*.|])/g,{specialChar:1}),qr=function(e){var t=e.id,n=e.tags,r=e.onChange,i=e.tagLimit,a=e.completions,c=e.addOnBlur,l=void 0!==c&&c,u=e.allowSpaces,p=void 0===u||u,d=e.allowDuplicates,f=void 0!==d&&d,h=e.completionMinLength,m=void 0===h?2:h,y=xn(e,Dr),b=(0,o.useRef)(null),g=(0,o.useState)(""),v=(0,s.A)(g,2),w=v[0],j=v[1],O=(0,o.useState)(!1),_=(0,s.A)(O,2),x=_[0],S=_[1],E=(0,o.useState)([]),P=(0,s.A)(E,2),k=P[0],C=P[1],R=(0,o.useState)(),T=(0,s.A)(R,2),A=T[0],N=T[1],D=function(){return Boolean(i&&0<i&&n.length>=i)},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.trim(),t=!["",'""',"''","``",void 0,null].includes(e)&&!D()&&(f||!n.includes(e));return t&&r([].concat(cn(n),[e])),j(""),t},F=function(e){return r(e?n.filter((function(t){return t!==e})):n.slice(0,-1))},B=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.length>=m;e&&function(e,t){return e?"function"==typeof e?e(t):Promise.resolve(e):Promise.resolve(void 0)}(a,w).then((function(e){N(k),null!=e&&e.length&&C(f?e:e.filter((function(e){return!n.includes(e)})))})).catch(Dn),S(e)};return(0,vn.jsx)("div",{className:"tagger",children:(0,vn.jsxs)("ul",{onClick:function(){var e;return null===(e=b.current)||void 0===e?void 0:e.focus()},children:[(0,vn.jsx)(Nr,{tags:n,onRemove:F}),(0,vn.jsxs)("li",{className:"tagger-new",children:[(0,vn.jsx)("input",Fr(Fr({},y),{},{id:t,type:"text",ref:b,value:w,list:"tagger-completion-".concat(x?"":"-disabled").concat(t),onBlur:function(){return l?L():void 0},onChange:function(e){return j(e.target.value)},onKeyDown:function(e){var t=e.key,n=e.ctrlKey,r=e.metaKey;switch(t){case"Enter":case",":e.preventDefault(),L();break;case"Backspace":w||(e.preventDefault(),F());break;case" ":n||r?(e.preventDefault(),B(!0)):p||(e.preventDefault(),L());break;case"Tab":D()||e.preventDefault()}},onInput:function(){x&&A&&function(e,t){if(!e.includes(t))return!1;var n=new RegExp("^".concat(t.replace(Ur,"\\$1")));return 1===e.filter((function(e){return n.test(e)})).length}(A,w.trim())?L()&&S(!1):B()}})),(0,vn.jsx)(Ar,{id:"tagger-completion-".concat(t),suggestions:k.filter((function(e){return!n.includes(e)})),onSelect:function(e){L(e),C([]),S(!1)}})]})]})})};function Mr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var zr=null===(Ir=window.CODE_SNIPPETS_EDIT)||void 0===Ir?void 0:Ir.tagOptions,Hr=function(){var e=jn(),t=e.snippet,n=e.setSnippet,r=e.isReadOnly;return null!=zr&&zr.enabled?(0,vn.jsxs)("div",{className:"snippet-tags-container",children:[(0,vn.jsx)("h2",{children:(0,vn.jsx)("label",{htmlFor:"snippet_tags",children:(0,nn.__)("Tags","code-snippets")})}),(0,vn.jsx)(qr,{id:"snippet_tags",tags:t.tags,addOnBlur:!0,disabled:r,onChange:function(e){return n((function(t){return Wr(Wr({},t),{},{tags:e})}))},completions:zr.availableTags,allowSpaces:zr.allowSpaces,placeholder:(0,nn.__)("Enter a list of tags; separated by commas.","code-snippets")})]}):null};function Jr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jr(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $r=function(e){var t=e.classNames,n=e.onRemove,r=e.children,i=e.autoHide,s=void 0===i||i;return(0,o.useEffect)((function(){if(s){var e=setTimeout(n,5e3);return function(){return clearTimeout(e)}}}),[s,n]),(0,vn.jsxs)("div",{id:"message",className:c()("cs-sticky-notice notice fade is-dismissible",t),children:[(0,vn.jsx)(vn.Fragment,{children:r}),(0,vn.jsx)("button",{type:"button",className:"notice-dismiss",onClick:function(e){e.preventDefault(),n()},children:(0,vn.jsx)("span",{className:"screen-reader-text",children:(0,nn.__)("Dismiss notice.","code-snippets")})})]})},Gr=function(){var e=jn(),t=e.currentNotice,n=e.setCurrentNotice,r=e.snippet,o=e.setSnippet;return(0,vn.jsxs)(vn.Fragment,{children:[t?(0,vn.jsx)($r,{classNames:t[0],onRemove:function(){return n(void 0)},children:(0,vn.jsx)("p",{children:t[1]})}):null,r.code_error?(0,vn.jsx)($r,{classNames:"error",onRemove:function(){return o((function(e){return Kr(Kr({},e),{},{code_error:null})}))},autoHide:!1,children:(0,vn.jsxs)("p",{children:[(0,vn.jsx)("strong",{children:(0,nn.sprintf)((0,nn.__)("Snippet automatically deactivated due to an error on line %d:","code-snippets"),r.code_error[1])}),(0,vn.jsx)("blockquote",{children:r.code_error[0]})]})}):null]})},Vr=window.CODE_SNIPPETS_EDIT,Xr=function(){var e,t=jn(),n=t.snippet,r=t.updateSnippet,o=t.setCurrentNotice;return(0,vn.jsxs)("h1",{children:[n.id?(0,nn.__)("Edit Snippet","code-snippets"):(0,nn.__)("Add New Snippet","code-snippets"),n.id?(0,vn.jsxs)(vn.Fragment,{children:[" ",(0,vn.jsx)("a",{href:null===(e=window.CODE_SNIPPETS)||void 0===e?void 0:e.urls.addNew,className:"page-title-action",onClick:function(e){var t;e.preventDefault(),r((function(){return f()})),o(void 0),window.document.title=window.document.title.replace((0,nn.__)("Edit Snippet","code-snippets"),(0,nn.__)("Add New Snippet","code-snippets")),window.history.replaceState({},"",null===(t=window.CODE_SNIPPETS)||void 0===t?void 0:t.urls.addNew)},children:(0,nn._x)("Add New","snippet","code-snippets")})]}):null,(null==Vr?void 0:Vr.pageTitleActions)&&Object.entries(Vr.pageTitleActions).map((function(e){var t=(0,s.A)(e,2),n=t[0],r=t[1];return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("a",{href:r,className:"page-title-action",children:n},n)," "]})}))]})},Yr=(n(2949),{Cmd:(0,nn._x)("Cmd","keyboard key","code-snippets"),Ctrl:(0,nn._x)("Ctrl","keyboard key","code-snippets"),Shift:(0,nn._x)("Shift","keyboard key","code-snippets"),Option:(0,nn._x)("Option","keyboard key","code-snippets"),Alt:(0,nn._x)("Alt","keyboard key","code-snippets"),Tab:(0,nn._x)("Tab","keyboard key","code-snippets"),Up:(0,nn._x)("Up","keyboard key","code-snippets"),Down:(0,nn._x)("Down","keyboard key","code-snippets"),A:(0,nn._x)("A","keyboard key","code-snippets"),D:(0,nn._x)("D","keyboard key","code-snippets"),F:(0,nn._x)("F","keyboard key","code-snippets"),G:(0,nn._x)("G","keyboard key","code-snippets"),R:(0,nn._x)("R","keyboard key","code-snippets"),S:(0,nn._x)("S","keyboard key","code-snippets"),Y:(0,nn._x)("Y","keyboard key","code-snippets"),Z:(0,nn._x)("Z","keyboard key","code-snippets"),"/":(0,nn._x)("/","keyboard key","code-snippets"),"[":(0,nn._x)("]","keyboard key","code-snippets"),"]":(0,nn._x)("]","keyboard key","code-snippets")}),Zr={saveChanges:{label:(0,nn.__)("Save changes","code-snippets"),mod:"Cmd",key:"S"},selectAll:{label:(0,nn.__)("Select all","code-snippets"),mod:"Cmd",key:"A"},beginSearch:{label:(0,nn.__)("Begin searching","code-snippets"),mod:"Cmd",key:"F"},findNext:{label:(0,nn.__)("Find next","code-snippets"),mod:"Cmd",key:"G"},findPrevious:{label:(0,nn.__)("Find previous","code-snippets"),mod:["Shift","Cmd"],key:"G"},replace:{label:(0,nn.__)("Replace","code-snippets"),mod:["Shift","Cmd"],key:"F"},replaceAll:{label:(0,nn.__)("Replace all","code-snippets"),mod:["Shift","Cmd","Option"],key:"R"},search:{label:(0,nn.__)("Persistent search","code-snippets"),mod:"Alt",key:"F"},toggleComment:{label:(0,nn.__)("Toggle comment","code-snippets"),mod:"Cmd",key:"/"},swapLineUp:{label:(0,nn.__)("Swap line up","code-snippets"),mod:"Option",key:"Up"},swapLineDown:{label:(0,nn.__)("Swap line down","code-snippets"),mod:"Option",key:"Down"},autoIndent:{label:(0,nn.__)("Auto-indent current line or selection","code-snippets"),mod:"Shift",key:"Tab"}},Qr=(0,nn._x)("-","keyboard shortcut separator","code-snippets"),eo=function(e){var t=e.modifier;switch(t){case"Ctrl":case"Cmd":return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("kbd",{className:"pc-key",children:Yr.Ctrl}),(0,vn.jsx)("kbd",{className:"mac-key",children:Yr.Cmd}),Qr]});case"Option":return(0,vn.jsxs)("span",{className:"mac-key",children:[(0,vn.jsx)("kbd",{className:"mac-key",children:Yr.Option}),Qr]});default:return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("kbd",{children:Yr[t]}),Qr]})}},to=function(e){var t=e.editorTheme;return(0,vn.jsxs)("div",{className:"snippet-editor-help",children:[(0,vn.jsx)("div",{className:"editor-help-tooltip cm-s-".concat(t),children:(0,nn._x)("?","help tooltip","code-snippets")}),(0,vn.jsx)("div",{className:c()("editor-help-text",{"platform-mac":u()}),children:(0,vn.jsx)("table",{children:Object.entries(Zr).map((function(e){var t=(0,s.A)(e,2),n=t[0],r=t[1],o=r.label,i=r.mod,a=r.key;return(0,vn.jsxs)("tr",{children:[(0,vn.jsx)("td",{children:o}),(0,vn.jsxs)("td",{children:[(Array.isArray(i)?i:[i]).map((function(e){return(0,vn.jsx)("span",{children:(0,vn.jsx)(eo,{modifier:e})},e)})),(0,vn.jsx)("kbd",{children:Yr[a]})]})]},n)}))})})]})};function no(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ro(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?no(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var oo=function(){var e,t,n=jn(),r=n.snippet,i=n.setSnippet,s=n.codeEditorInstance,a=n.setCodeEditorInstance,c=n.submitSnippet,l=(0,o.useRef)(null);return(0,o.useEffect)((function(){a((function(e){return l.current&&!e&&(e=window.wp.codeEditor.initialize(l.current)).codemirror.on("changes",(function(e){i((function(t){return ro(ro({},t),{},{code:e.getValue()})}))})),e}))}),[a,l,i]),(0,o.useEffect)((function(){if(s){var e=s.codemirror.getOption("extraKeys"),t=u()?"Cmd":"Ctrl";s.codemirror.setOption("extraKeys",ro(ro({},"object"===(0,y.A)(e)?e:void 0),{},Yt(Yt({},"".concat(t,"-S"),c),"".concat(t,"-Enter"),c)))}}),[c,s,r]),(0,vn.jsxs)("div",{className:"snippet-editor",children:[(0,vn.jsx)("textarea",{ref:l,id:"snippet_code",name:"snippet_code",rows:200,spellCheck:!1,onChange:function(e){i((function(t){return ro(ro({},t),{},{code:e.target.value})}))},children:r.code}),(0,vn.jsx)(to,{editorTheme:null!==(e=null===(t=window.CODE_SNIPPETS_EDIT)||void 0===t?void 0:t.editorTheme)&&void 0!==e?e:"default"})]})};function io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function so(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?io(Object(n),!0).forEach((function(t){Yt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):io(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ao=function(e){var t=e.tabType,n=e.label,r=e.currentType,o=e.updateScope,i=e.openUpgradeDialog;return(0,vn.jsxs)("a",so(so({"data-snippet-type":t,className:c()({"nav-tab":!0,"nav-tab-active":t===r,"nav-tab-inactive":m(t)&&!p()})},m(t)&&!p()?{title:(0,nn.__)("Learn more about Code Snippets Pro.","code-snippets"),href:"https://codesnippets.pro/pricing/",target:"_blank",onClick:function(e){e.preventDefault(),i()}}:{href:on(window.location.href,{type:t}),onClick:function(e){e.preventDefault();var n=yr[t][0];o(n)}}),{},{children:["".concat(n," "),(0,vn.jsx)("span",{className:"badge",children:t})]}))},co={php:(0,nn.__)("Functions","code-snippets"),html:(0,nn.__)("Content","code-snippets"),css:(0,nn.__)("Styles","code-snippets"),js:(0,nn.__)("Scripts","code-snippets")},lo={css:"text/css",js:"javascript",php:"text/x-php",html:"application/x-httpd-php"},uo=function(e){var t=e.codeEditor,n=e.updateScope,r=e.snippetType,i=e.openUpgradeDialog;return(0,o.useEffect)((function(){t.setOption("lint","php"===r||"css"===r),r in lo&&(t.setOption("mode",lo[r]),t.refresh())}),[t,r]),(0,vn.jsxs)("h2",{className:"nav-tab-wrapper",id:"snippet-type-tabs",children:[mr.map((function(e){return(0,vn.jsx)(ao,{tabType:e,label:co[e],currentType:r,updateScope:n,openUpgradeDialog:i},e)})),p()?null:(0,vn.jsxs)("a",{className:"button button-large nav-tab-button nav-tab-inactive go-pro-button",href:"https://codesnippets.pro/pricing/",title:"Find more about Pro",onClick:function(e){e.preventDefault(),i()},children:[(0,nn._x)("Upgrade to ","Upgrade to Pro","code-snippets"),(0,vn.jsx)("span",{className:"badge",children:(0,nn._x)("Pro","Upgrade to Pro","code-snippets")})]})]})},po=function(e){var t,n=e.openUpgradeDialog,r=jn(),o=r.snippet,i=r.setSnippet,s=r.codeEditorInstance,a=h(o);return(0,vn.jsxs)("div",{className:"snippet-code-container",children:[(0,vn.jsx)("h2",{children:(0,vn.jsxs)("label",{htmlFor:"snippet_code",children:["".concat((0,nn.__)("Code","code-snippets")," "),o.id?(0,vn.jsx)("span",{className:"snippet-type-badge","data-snippet-type":a,children:a}):null]})}),o.id||null!==(t=window.CODE_SNIPPETS_EDIT)&&void 0!==t&&t.isPreview||!s?"":(0,vn.jsx)(uo,{snippetType:a,codeEditor:s.codemirror,openUpgradeDialog:n,updateScope:function(e){i((function(t){return so(so({},t),{},{scope:e})}))}}),(0,vn.jsx)(oo,{})]})},fo=function(){var e=jn().isWorking;return(0,vn.jsxs)(vn.Fragment,{children:[e?(0,vn.jsx)(_n.Spinner,{}):"",(0,vn.jsx)($n,{inlineButtons:!0})]})},ho=function(){var e=jn().codeEditorInstance;return(0,vn.jsxs)(vn.Fragment,{children:[(0,vn.jsx)("label",{htmlFor:"snippet-code-direction",className:"screen-reader-text",children:(0,nn.__)("Code Direction","code-snippets")}),(0,vn.jsxs)("select",{id:"snippet-code-direction",onChange:function(t){return null==e?void 0:e.codemirror.setOption("direction","rtl"===t.target.value?"rtl":"ltr")},children:[(0,vn.jsx)("option",{value:"ltr",children:(0,nn.__)("LTR","code-snippets")}),(0,vn.jsx)("option",{value:"rtl",children:(0,nn.__)("RTL","code-snippets")})]})]})},mo=function(){var e;return(0,vn.jsxs)("div",{className:"submit-inline",children:[null!==(e=window.CODE_SNIPPETS_EDIT)&&void 0!==e&&e.extraSaveButtons?(0,vn.jsx)(fo,{}):null,(0,nn.isRTL)()?(0,vn.jsx)(ho,{}):null]})},yo=window.CODE_SNIPPETS_EDIT,bo=function(){var e=(0,o.useState)(!1),t=(0,s.A)(e,2),n=t[0],r=t[1],i=jn(),a=i.snippet,u=i.isReadOnly;return(0,vn.jsxs)("div",{className:"wrap",children:[(0,vn.jsx)(Xr,{}),(0,vn.jsx)(Gr,{}),(0,vn.jsxs)("div",{id:"snippet-form",className:c()("snippet-form","".concat(a.scope,"-snippet"),"".concat(h(a.scope),"-snippet"),"".concat(a.id?"saved":"new","-snippet"),"".concat(a.active?"active":"inactive","-snippet"),{"erroneous-snippet":!!a.code_error,"read-only-snippet":u}),children:[(0,vn.jsx)(pr,{}),(0,vn.jsx)(mo,{}),(0,vn.jsx)(po,{openUpgradeDialog:function(){return r(!0)}}),(0,vn.jsxs)("div",{className:"below-snippet-editor",children:[(0,vn.jsx)(Cr,{}),(0,vn.jsx)(hr,{})]}),l()?(0,vn.jsx)(cr,{}):null,null!=yo&&yo.enableDescription?(0,vn.jsx)(ir,{}):null,null!=yo&&yo.tagOptions.enabled?(0,vn.jsx)(Hr,{}):null,(0,vn.jsx)(Gn,{})]}),(0,vn.jsx)(Zn,{isOpen:n,setIsOpen:r})]})},go=function(){return(0,vn.jsx)(On,{initialSnippet:function(){var e;return null!==(e=null==yo?void 0:yo.snippet)&&void 0!==e?e:f()},children:(0,vn.jsx)(bo,{})})},vo=document.getElementById("edit-snippet-form-container");vo?(0,i.H)(vo).render((0,vn.jsx)(go,{})):console.error("Could not find snippet edit form container.")},5338:(e,t,n)=>{"use strict";var r=n(5795);t.H=r.createRoot,r.hydrateRoot},1020:(e,t,n)=>{"use strict";var r=n(1609),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var r,i={},l=null,u=null;for(r in void 0!==n&&(l=""+n),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)s.call(t,r)&&!c.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===i[r]&&(i[r]=t[r]);return{$$typeof:o,type:e,key:l,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=l,t.jsxs=l},4848:(e,t,n)=>{"use strict";e.exports=n(1020)},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM},4633:(e,t,n)=>{var r=n(3738).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,s=i.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},c="function"==typeof Symbol?Symbol:{},l=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var o=t&&t.prototype instanceof w?t:w,i=Object.create(o.prototype),s=new N(r||[]);return a(i,"_invoke",{value:C(e,n,s)}),i}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var m="suspendedStart",y="suspendedYield",b="executing",g="completed",v={};function w(){}function j(){}function O(){}var _={};d(_,l,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(D([])));S&&S!==i&&s.call(S,l)&&(_=S);var E=O.prototype=w.prototype=Object.create(_);function P(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(o,i,a,c){var l=h(e[o],e,i);if("throw"!==l.type){var u=l.arg,p=u.value;return p&&"object"==r(p)&&s.call(p,"__await")?t.resolve(p.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function C(e,n,r){var o=m;return function(i,s){if(o===b)throw Error("Generator is already running");if(o===g){if("throw"===i)throw s;return{value:t,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var c=R(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=b;var l=h(e,n,r);if("normal"===l.type){if(o=r.done?g:y,l.arg===v)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(o=g,r.method="throw",r.arg=l.arg)}}}function R(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,R(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=h(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(s.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return j.prototype=O,a(E,"constructor",{value:O,configurable:!0}),a(O,"constructor",{value:j,configurable:!0}),j.displayName=d(O,p,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===j||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,O):(e.__proto__=O,d(e,p,"GeneratorFunction")),e.prototype=Object.create(E),e},n.awrap=function(e){return{__await:e}},P(k.prototype),d(k.prototype,u,(function(){return this})),n.AsyncIterator=k,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var s=new k(f(e,t,r,o),i);return n.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},P(E),d(E,p,"Generator"),d(E,l,(function(){return this})),d(E,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=D,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return a.type="throw",a.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=s.call(i,"catchLoc"),l=s.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},3738:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4756:(e,t,n)=>{var r=n(4633)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},6942:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return o.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},5501:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(3662);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,r.A)(e,t)}},3662:(e,t,n)=>{"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:()=>r})}},e=>{e(e.s=2374)}]); dist/edit.js.LICENSE.txt 0000644 00000001011 15153464547 0010700 0 ustar 00 /*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
dist/editor-themes/3024-day.css 0000644 00000002747 15153464547 0012165 0 ustar 00 .cm-s-3024-day.CodeMirror{background:#f7f7f7;color:#3a3432}.cm-s-3024-day div.CodeMirror-selected{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::selection,.cm-s-3024-day .CodeMirror-line>span::selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d6d5d4}.cm-s-3024-day .CodeMirror-line::-moz-selection,.cm-s-3024-day .CodeMirror-line>span::-moz-selection,.cm-s-3024-day .CodeMirror-line>span>span::selection{background:#d9d9d9}.cm-s-3024-day .CodeMirror-gutters{background:#f7f7f7;border-right:0}.cm-s-3024-day .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-day .CodeMirror-guttermarker-subtle,.cm-s-3024-day .CodeMirror-linenumber{color:#807d7c}.cm-s-3024-day .CodeMirror-cursor{border-left:1px solid #5c5855}.cm-s-3024-day span.cm-comment{color:#cdab53}.cm-s-3024-day span.cm-atom,.cm-s-3024-day span.cm-number{color:#a16a94}.cm-s-3024-day span.cm-attribute,.cm-s-3024-day span.cm-property{color:#01a252}.cm-s-3024-day span.cm-keyword{color:#db2d20}.cm-s-3024-day span.cm-string{color:#fded02}.cm-s-3024-day span.cm-variable{color:#01a252}.cm-s-3024-day span.cm-variable-2{color:#01a0e4}.cm-s-3024-day span.cm-def{color:#e8bbd0}.cm-s-3024-day span.cm-bracket{color:#3a3432}.cm-s-3024-day span.cm-tag{color:#db2d20}.cm-s-3024-day span.cm-link{color:#a16a94}.cm-s-3024-day span.cm-error{background:#db2d20;color:#5c5855}.cm-s-3024-day .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-3024-day .CodeMirror-matchingbracket{color:#a16a94!important;text-decoration:underline}
dist/editor-themes/3024-night.css 0000644 00000003071 15153464547 0012510 0 ustar 00 .cm-s-3024-night.CodeMirror{background:#090300;color:#d6d5d4}.cm-s-3024-night div.CodeMirror-selected{background:#3a3432}.cm-s-3024-night .CodeMirror-line::selection,.cm-s-3024-night .CodeMirror-line>span::selection,.cm-s-3024-night .CodeMirror-line>span>span::selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-line::-moz-selection,.cm-s-3024-night .CodeMirror-line>span::-moz-selection,.cm-s-3024-night .CodeMirror-line>span>span::-moz-selection{background:rgba(58,52,50,.99)}.cm-s-3024-night .CodeMirror-gutters{background:#090300;border-right:0}.cm-s-3024-night .CodeMirror-guttermarker{color:#db2d20}.cm-s-3024-night .CodeMirror-guttermarker-subtle,.cm-s-3024-night .CodeMirror-linenumber{color:#5c5855}.cm-s-3024-night .CodeMirror-cursor{border-left:1px solid #807d7c}.cm-s-3024-night span.cm-comment{color:#cdab53}.cm-s-3024-night span.cm-atom,.cm-s-3024-night span.cm-number{color:#a16a94}.cm-s-3024-night span.cm-attribute,.cm-s-3024-night span.cm-property{color:#01a252}.cm-s-3024-night span.cm-keyword{color:#db2d20}.cm-s-3024-night span.cm-string{color:#fded02}.cm-s-3024-night span.cm-variable{color:#01a252}.cm-s-3024-night span.cm-variable-2{color:#01a0e4}.cm-s-3024-night span.cm-def{color:#e8bbd0}.cm-s-3024-night span.cm-bracket{color:#d6d5d4}.cm-s-3024-night span.cm-tag{color:#db2d20}.cm-s-3024-night span.cm-link{color:#a16a94}.cm-s-3024-night span.cm-error{background:#db2d20;color:#807d7c}.cm-s-3024-night .CodeMirror-activeline-background{background:#2f2f2f}.cm-s-3024-night .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/abbott.css 0000644 00000006014 15153464547 0012264 0 ustar 00 .cm-s-abbott.CodeMirror{background:#231c14;color:#d8ff84}.cm-s-abbott .CodeMirror-gutters{background:#231c14;border:none}.cm-s-abbott .CodeMirror-linenumber{color:#fbec5d}.cm-s-abbott .CodeMirror-guttermarker{color:#f63f05}.cm-s-abbott .CodeMirror-guttermarker-subtle{color:#fbb32f}.cm-s-abbott .CodeMirror-ruler{border-color:#745d42}.cm-s-abbott .CodeMirror-cursor{border-color:#a0ea00}.cm-s-abbott .cm-animate-fat-cursor,.cm-s-abbott.cm-fat-cursor .CodeMirror-cursor{background:rgba(160,234,0,.5)}.cm-s-abbott.cm-fat-cursor .CodeMirror-cursors{z-index:3}.cm-s-abbott .CodeMirror-overwrite .CodeMirror-cursor{border-bottom:1px solid #a0ea00;border-left:none;width:auto}.cm-s-abbott .CodeMirror-secondarycursor{border-color:#00ff7f}.cm-s-abbott .CodeMirror-selected,.cm-s-abbott.CodeMirror-focused .CodeMirror-selected{background:#273900}.cm-s-abbott .CodeMirror-line::selection,.cm-s-abbott .CodeMirror-line>span::selection,.cm-s-abbott .CodeMirror-line>span>span::selection{background:#273900}.cm-s-abbott .CodeMirror-line::-moz-selection,.cm-s-abbott .CodeMirror-line>span::-moz-selection,.cm-s-abbott .CodeMirror-line>span>span::-moz-selection{background:#273900}.cm-s-abbott .cm-tab{color:#00ff7f}.cm-s-abbott .cm-searching{background:#fef3b4!important;color:#231c14!important}.cm-s-abbott span.cm-comment{color:#fbb32f;font-style:italic}.cm-s-abbott span.cm-string,.cm-s-abbott span.cm-string-2{color:#e6a2f3}.cm-s-abbott span.cm-number,.cm-s-abbott span.cm-string.cm-url{color:#f63f05}.cm-s-abbott span.cm-invalidchar{color:#00ff7f}.cm-s-abbott span.cm-atom,.cm-s-abbott span.cm-bracket,.cm-s-abbott span.cm-punctuation{color:#fef3b4}.cm-s-abbott span.cm-operator{font-weight:700}.cm-s-abbott span.cm-def,.cm-s-abbott span.cm-variable,.cm-s-abbott span.cm-variable-2,.cm-s-abbott span.cm-variable-3{color:#8ccdf0}.cm-s-abbott span.cm-builtin,.cm-s-abbott span.cm-property,.cm-s-abbott span.cm-qualifier{color:#3f91f1}.cm-s-abbott span.cm-type{color:#24a507}.cm-s-abbott span.cm-keyword{color:#d80450;font-weight:700}.cm-s-abbott span.cm-meta{color:#ec6c99}.cm-s-abbott span.cm-tag{color:#d80450;font-weight:700}.cm-s-abbott span.cm-attribute{color:#24a507}.cm-s-abbott span.cm-header{color:#d80450;font-weight:700}.cm-s-abbott span.cm-hr{color:#ec6c99}.cm-s-abbott span.cm-link{color:#e6a2f3}.cm-s-abbott span.cm-negative{background:#d80450;color:#231c14}.cm-s-abbott span.cm-positive{background:#a0ea00;color:#231c14;font-weight:700}.cm-s-abbott span.cm-error{background:#d80450;color:#231c14}.cm-s-abbott span.CodeMirror-matchingbracket{background:#745d42!important;color:#231c14!important;font-weight:700}.cm-s-abbott span.CodeMirror-nonmatchingbracket{background:#d80450!important;color:#231c14!important}.cm-s-abbott .CodeMirror-matchingtag,.cm-s-abbott .cm-matchhighlight{outline:1px solid #39a78d}.cm-s-abbott .CodeMirror-activeline-background,.cm-s-abbott .CodeMirror-activeline-gutter{background:#3c3022}.cm-s-abbott .CodeMirror-activeline-gutter .CodeMirror-linenumber{color:#d8ff84;font-weight:700}.cm-s-abbott .CodeMirror-foldmarker{color:#f63f05;text-shadow:none}
dist/editor-themes/abcdef.css 0000644 00000003274 15153464547 0012222 0 ustar 00 .cm-s-abcdef.CodeMirror{background:#0f0f0f;color:#defdef}.cm-s-abcdef div.CodeMirror-selected{background:#515151}.cm-s-abcdef .CodeMirror-line::selection,.cm-s-abcdef .CodeMirror-line>span::selection,.cm-s-abcdef .CodeMirror-line>span>span::selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-line::-moz-selection,.cm-s-abcdef .CodeMirror-line>span::-moz-selection,.cm-s-abcdef .CodeMirror-line>span>span::-moz-selection{background:rgba(56,56,56,.99)}.cm-s-abcdef .CodeMirror-gutters{background:#555;border-right:2px solid #314151}.cm-s-abcdef .CodeMirror-guttermarker{color:#222}.cm-s-abcdef .CodeMirror-guttermarker-subtle{color:azure}.cm-s-abcdef .CodeMirror-linenumber{color:#fff}.cm-s-abcdef .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-abcdef span.cm-keyword{color:#b8860b;font-weight:700}.cm-s-abcdef span.cm-atom{color:#77f}.cm-s-abcdef span.cm-number{color:violet}.cm-s-abcdef span.cm-def{color:#fffabc}.cm-s-abcdef span.cm-variable{color:#abcdef}.cm-s-abcdef span.cm-variable-2{color:#cacbcc}.cm-s-abcdef span.cm-type,.cm-s-abcdef span.cm-variable-3{color:#def}.cm-s-abcdef span.cm-property{color:#fedcba}.cm-s-abcdef span.cm-operator{color:#ff0}.cm-s-abcdef span.cm-comment{color:#7a7b7c;font-style:italic}.cm-s-abcdef span.cm-string{color:#2b4}.cm-s-abcdef span.cm-meta{color:#c9f}.cm-s-abcdef span.cm-qualifier{color:#fff700}.cm-s-abcdef span.cm-builtin{color:#30aabc}.cm-s-abcdef span.cm-bracket{color:#8a8a8a}.cm-s-abcdef span.cm-tag{color:#fd4}.cm-s-abcdef span.cm-attribute{color:#df0}.cm-s-abcdef span.cm-error{color:red}.cm-s-abcdef span.cm-header{color:#7fffd4;font-weight:700}.cm-s-abcdef span.cm-link{color:#8a2be2}.cm-s-abcdef .CodeMirror-activeline-background{background:#314151}
dist/editor-themes/ambiance-mobile.css 0000644 00000000130 15153464547 0014006 0 ustar 00 .cm-s-ambiance.CodeMirror{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}
dist/editor-themes/ambiance.css 0000644 00000062717 15153464547 0012564 0 ustar 00 .cm-s-ambiance .cm-header{color:blue}.cm-s-ambiance .cm-quote{color:#24c2c7}.cm-s-ambiance .cm-keyword{color:#cda869}.cm-s-ambiance .cm-atom{color:#cf7ea9}.cm-s-ambiance .cm-number{color:#78cf8a}.cm-s-ambiance .cm-def{color:#aac6e3}.cm-s-ambiance .cm-variable{color:#ffb795}.cm-s-ambiance .cm-variable-2{color:#eed1b3}.cm-s-ambiance .cm-type,.cm-s-ambiance .cm-variable-3{color:#faded3}.cm-s-ambiance .cm-property{color:#eed1b3}.cm-s-ambiance .cm-operator{color:#fa8d6a}.cm-s-ambiance .cm-comment{color:#555;font-style:italic}.cm-s-ambiance .cm-string{color:#8f9d6a}.cm-s-ambiance .cm-string-2{color:#9d937c}.cm-s-ambiance .cm-meta{color:#d2a8a1}.cm-s-ambiance .cm-qualifier{color:#ff0}.cm-s-ambiance .cm-builtin{color:#99c}.cm-s-ambiance .cm-bracket{color:#24c2c7}.cm-s-ambiance .cm-tag{color:#fee4ff}.cm-s-ambiance .cm-attribute{color:#9b859d}.cm-s-ambiance .cm-hr{color:pink}.cm-s-ambiance .cm-link{color:#f4c20b}.cm-s-ambiance .cm-special{color:#ff9d00}.cm-s-ambiance .cm-error{color:#af2018}.cm-s-ambiance .CodeMirror-matchingbracket{color:#0f0}.cm-s-ambiance .CodeMirror-nonmatchingbracket{color:#f22}.cm-s-ambiance div.CodeMirror-selected{background:hsla(0,0%,100%,.15)}.cm-s-ambiance.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-ambiance .CodeMirror-line::selection,.cm-s-ambiance .CodeMirror-line>span::selection,.cm-s-ambiance .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-ambiance .CodeMirror-line::-moz-selection,.cm-s-ambiance .CodeMirror-line>span::-moz-selection,.cm-s-ambiance .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-ambiance.CodeMirror{background-color:#202020;-webkit-box-shadow:inset 0 0 10px #000;-moz-box-shadow:inset 0 0 10px #000;box-shadow:inset 0 0 10px #000;color:#e6e1dc;line-height:1.4em}.cm-s-ambiance .CodeMirror-gutters{background:#3d3d3d;border-right:1px solid #4d4d4d;box-shadow:0 10px 20px #000}.cm-s-ambiance .CodeMirror-linenumber{color:#111;padding:0 5px;text-shadow:0 1px 1px #4d4d4d}.cm-s-ambiance .CodeMirror-guttermarker{color:#aaa}.cm-s-ambiance .CodeMirror-guttermarker-subtle{color:#111}.cm-s-ambiance .CodeMirror-cursor{border-left:1px solid #7991e8}.cm-s-ambiance .CodeMirror-activeline-background{background:none repeat scroll 0 0 hsla(0,0%,100%,.031)}.cm-s-ambiance .CodeMirror-gutters,.cm-s-ambiance.CodeMirror{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAQAAAAHUWYVAABFFUlEQVQYGbzBCeDVU/74/6fj9HIcx/FRHx9JCFmzMyGRURhLZIkUsoeRfUjS2FNDtr6WkMhO9sm+S8maJfu+Jcsg+/o/c+Z4z/t97/vezy3z+z8ekGlnYICG/o7gdk+wmSHZ1z4pJItqapjoKXWahm8NmV6eOTbWUOp6/6a/XIg6GQqmenJ2lDHyvCFZ2cBDbmtHA043VFhHwXxClWmeYAdLhV00Bd85go8VmaFCkbVkzlQENzfBDZ5gtN7HwF0KDrTwJ0dypSOzpaKCMwQHKTIreYIxlmhXTzTWkVm+LTynZhiSBT3RZQ7aGfjGEd3qyXQ1FDymqbKxpspERQN2MiRjNZlFFQXfCNFm9nM1zpAsoYjmtRTc5ajwuaXc5xrWskT97RaKzAGe5ARHhVUsDbjKklziiX5WROcJwSNCNI+9w1Jwv4Zb2r7lCMZ4oq5C0EdTx+2GzNuKpJ+iFf38JEWkHJn9DNF7mmBDITrWEg0VWL3pHU20tSZnuqWu+R3BtYa8XxV1HO7GyD32UkOpL/yDloINFTmvtId+nmAjxRw40VMwVKiwrKLE4bK5UOVntYwhOcSSXKrJHKPJedocpGjVz/ZMIbnYUPB10/eKCrs5apqpgVmWzBYWpmtKHecJPjaUuEgRDDaU0oZghCJ6zNMQ5ZhDYx05r5v2muQdM0EILtXUsaKiQX9WMEUotagQzFbUNN6NUPC2nm5pxEWGCjMc3GdJHjSU2kORLK/JGSrkfGEIjncU/CYUnOipoYemwj8tST9NsJmB7TUVXtbUtXATJVZXBMvYeTXJfobgJUPmGMP/yFaWonaa6BcFO3nqcIqCozSZoZoSr1g4zJOzuyGnxTEX3lUEJ7WcZgme8ddaWvWJo2AJR9DZU3CUIbhCSG6ybSwN6qtJVnCU2svDTP2ZInOw2cBTrqtQahtNZn9NcJ4l2NaSmSkkP1noZWnVwkLmdUPOwLZEwy2Z3S3R+4rIG9hcbpPXHFVWcQdZkn2FOta3cKWQnNRC5g1LsJah4GCzSVsKnCOY5OAFRTBekyyryeyilhFKva75r4Mc0aWanGEaThcy31s439KKxTzJYY5WTHPU1FtIHjQU3Oip4xlNzj/lBw23dYZVliQa7WAXf4shetcQfatI+jWRDBPmyNeW6A1P5kdDgyYJlba0BIM8BZu1JfrFwItyjcAMR3K0BWOIrtMEXyhyrlVEx3ui5dUBjmB/Q3CXW85R4mBD0s7B+4q5tKUjOlb9qqmhi5AZ6GFIC5HXtOobdYGlVdMVbNJ8toNTFcHxnoL+muBagcctjWnbNMuR00uI7nQESwg5q2qqrKWIfrNUmeQocY6HuyxJV02wj36w00yhpmUFenv4p6fUkZYqLyuinx2RGOjhCXYyJF84oiU00YMOOhhquNdfbOB7gU88pY4xJO8LVdp6/q2voeB4R04vIdhSE40xZObx1HGGJ/ja0LBthFInKaLPPFzuCaYaoj8JjPME8yoyxo6zlBqkiUZYgq00OYMswbWO5NGmq+xhipxHLRW29ARjNKXO0wRnear8XSg4XFPLKEPUS1GqvyLwiuBUoa7zpZ0l5xxFwWmWZC1H5h5FwU8eQ7K+g8UcVY6TMQreVQT/8uQ8Z+ALIXnSEa2pYZQneE9RZbSBNYXfWYJzW/h/4j4Dp1tYVcFIC5019Vyi4ThPqSFCzjGWaHQTBU8q6vrVwgxP9Lkm840imWKpcLCjYTtrKuwvsKSnrvHCXGkSMk9p6lhckfRpIeis+N2PiszT+mFLspyGleUhDwcLrZqmyeylxwjBcKHEapqkmyangyLZRVOijwOtCY5SsG5zL0OwlCJ4y5KznF3EUNDDrinwiyLZRzOXtlBbK5ITHFGLp8Q0R6ab6mS7enI2cFrxOyHvOCFaT1HThS1krjCwqWeurCkk+willhCC+RSZnRXBiZaC5RXRIZYKp2lyfrHwiKPKR0JDzrdU2EFgpidawlFDR6FgXUMNa+g1FY3bUQh2cLCwosRdnuQTS/S+JVrGLeWIvtQUvONJxlqSQYYKpwoN2kaocLjdVsis4Mk80ESF2YpSkzwldjHkjFCUutI/r+EHDU8oCs6yzL3PhWiEooZdFMkymlas4AcI3KmoMMNSQ3tHzjGWCrcJJdYyZC7QFGwjRL9p+MrRkAGWzIaWCn9W0F3TsK01c2ZvQw0byvxuQU0r1lM0qJO7wW0kRIMdDTtXEdzi4VIh+EoIHm0mWtAtpCixlabgn83fKTI7anJe9ST7WIK1DMGpQmYeA58ImV6ezOGOzK2Kgq01pd60cKWiUi9Lievb/0vIDPHQ05Kzt4ddPckQBQtoaurjyHnek/nKzpQLrVgKPjIkh2v4uyezpv+Xoo7fPFXaGFp1vaLKxQ4uUpQQS5VuQs7BCq4xRJv7fwpVvvFEB3j+620haOuocqMhWd6TTPAEx+mdFNGHdranFe95WrWmIvlY4F1Dle2ECgc6cto7SryuqGGGha0tFQ5V53migUKmg6XKAo4qS3mik+0OZpAhOLeZKicacgaYcyx5hypYQE02ZA4xi/pNhOQxR4klNKyqacj+mpxnLTnnGSo85++3ZCZq6lrZkXlGEX3o+C9FieccJbZWVFjC0Yo1FZnJhoYMFoI1hEZ9r6hwg75HwzBNhbZCdJEfJwTPGzJvaKImw1yYX1HDAmpXR+ZJQ/SmgqMNVQb5vgamGwLtt7VwvP7Qk1xpiM5x5Cyv93E06MZmgs0Nya2azIKOYKCGBQQW97RmhKNKF02JZqHEJ4o58qp7X5EcZmc56trXEqzjCBZ1MFGR87Ql2tSTs6CGxS05PTzRQorkbw7aKoKXFDXsYW42VJih/q+FP2BdTzDTwVqOYB13liM50vG7wy28qagyuIXMeQI/Oqq8bcn5wJI50xH00CRntyfpL1T4hydYpoXgNiFzoIUTDZnLNRzh4TBHwbYGDvZkxmlyJloyr6tRihpeUG94GnKtIznREF0tzJG/OOr73JBcrSh1k6WuTprgLU+mnSGnv6Zge0NNz+kTDdH8nuAuTdJDCNb21LCiIuqlYbqGzT3RAoZofQfjFazkqeNWdYaGvYTM001EW2oKPvVk1ldUGSgUtHFwjKM1h9jnFcmy5lChoLNaQMGGDsYbKixlaMBmmsx1QjCfflwTfO/gckW0ruZ3jugKR3R5W9hGUWqCgxuFgsuaCHorotGKzGaeZB9DMsaTnKCpMtwTvOzhYk0rdrArKCqcaWmVk1+F372ur1YkKxgatI8Qfe1gIX9wE9FgS8ESmuABIXnRUbCapcKe+nO7slClSZFzpV/LkLncEb1qiO42fS3R855Su2mCLh62t1SYZZYVmKwIHjREF2uihTzB20JOkz7dkxzYQnK0UOU494wh+VWRc6Un2kpTaVgLDFEkJ/uhzRcI0YKGgpGWOlocBU/a4fKoJ/pEaNV6jip3+Es9VXY078rGnmAdf7t9ylPXS34RBSuYPs1UecZTU78WanhBCHpZ5sAoTz0LGZKjPf9TRypqWEiTvOFglL1fCEY3wY/++rbk7C8bWebA6p6om6PgOL2kp44TFJlVNBXae2rqqdZztOJpT87GQsE9jqCPIe9VReZuQ/CIgacsyZdCpIScSYqcZk8r+nsyCzhyfhOqHGOIvrLknC8wTpFcaYiGC/RU1NRbUeUpocQOnkRpGOrIOcNRx+1uA0UrzhSSt+VyS3SJpnFWkzNDqOFGIWcfR86DnmARTQ1HKIL33ExPiemeOhYSSjzlSUZZuE4TveoJLnBUOFof6KiysCbnAEcZgcUNTDOwkqWu3RWtmGpZwlHhJENdZ3miGz0lJlsKnjbwqSHQjpxnFDlTLLwqJPMZMjd7KrzkSG7VsxXBZE+F8YZkb01Oe00yyRK9psh5SYh29ySPKBo2ylNht7ZkZnsKenjKNJu9PNEyZpaCHv4Kt6RQsLvAVp7M9kIimmCUwGeWqLMmGuIotYMmWNpSahkhZw9FqZsVnKJhsjAHvtHMsTM9fCI06Dx/u3vfUXCqfsKRc4oFY2jMsoo/7DJDwZ1CsIKnJu+J9ldkpmiCxQx1rWjI+T9FwcWWzOuaYH0Hj7klNRVWEQpmaqosakiGNTFHdjS/qnUdmf0NJW5xsL0HhimCCZZSRzmSPTXJQ4aaztAwtZnoabebJ+htCaZ7Cm535ByoqXKbX1WRc4Eh2MkRXWzImVc96Cj4VdOKVxR84VdQsIUM8Psoou2byVHyZFuq7O8otbSQ2UAoeEWTudATLGSpZzVLlXVkPU2Jc+27lsw2jmg5T5VhbeE3BT083K9WsTTkFU/Osi0rC5lRlpwRHUiesNS0sOvmqGML1aRbPAxTJD9ZKtxuob+hhl8cwYGWpJ8nub7t5p6coYbMovZ1BTdaKn1jYD6h4GFDNFyT/Kqe1XCXphXHOKLZmuRSRdBPEfVUXQzJm5YGPGGJdvAEr7hHNdGZnuBvrpciGmopOLf5N0uVMy0FfYToJk90uUCbJupaVpO53UJXR2bVpoU00V2KOo4zMFrBd0Jtz2pa0clT5Q5L8IpQ177mWQejPMEJhuQjS10ref6HHjdEhy1P1EYR7GtO0uSsKJQYLiTnG1rVScj5lyazpqWGl5uBbRWl7m6ixGOOnEsMJR7z8J0n6KMnCdxhiNYQCoZ6CmYLnO8omC3MkW3bktlPmEt/VQQHejL3+dOE5FlPdK/Mq8hZxxJtLyRrepLThYKbLZxkSb5W52vYxNOaOxUF0yxMUPwBTYqCzy01XayYK0sJyWBLqX0MwU5CzoymRzV0EjjeUeLgDpTo6ij42ZAzvD01dHUUTPLU96MdLbBME8nFBn7zJCMtJcZokn8YoqU0FS5WFKyniHobguMcmW8N0XkWZjkyN3hqOMtS08r+/xTBwpZSZ3qiVRX8SzMHHjfUNFjgHEPmY9PL3ykEzxkSre/1ZD6z/NuznuB0RcE1TWTm9zRgfUWVJiG6yrzgmWPXC8EAR4Wxhlad0ZbgQyEz3pG5RVEwwDJH2mgKpjcTiCOzn1lfUWANFbZ2BA8balnEweJC9J0iuaeZoI+ippFCztEKVvckR2iice1JvhVytrQwUAZpgsubCPaU7xUe9vWnaOpaSBEspalykhC9bUlOMpT42ZHca6hyrqKmw/wMR8H5ZmdFoBVJb03O4UL0tSNnvIeRmkrLWqrs78gcrEn2tpcboh0UPOW3UUR9PMk4T4nnNKWmCjlrefhCwxRNztfmIQVdDElvS4m1/WuOujoZCs5XVOjtKPGokJzsYCtFYoWonSPT21DheU/wWhM19FcElwqNGOsp9Q8N/cwXaiND1MmeL1Q5XROtYYgGeFq1aTMsoMmcrKjQrOFQTQ1fmBYhmW6o8Jkjc7iDJRTBIo5kgJD5yMEYA3srCg7VFKwiVJkmRCc5ohGOKhsYMn/XBLdo5taZjlb9YAlGWRimqbCsoY7HFAXLa5I1HPRxMMsQDHFkWtRNniqT9UEeNjcE7RUlrCJ4R2CSJuqlKHWvJXjAUNcITYkenuBRB84TbeepcqTj3zZyFJzgYQdHnqfgI0ddUwS6GqWpsKWhjq9cV0vBAEMN2znq+EBfIWT+pClYw5xsTlJU6GeIBsjGmmANTzJZiIYpgrM0Oa8ZMjd7NP87jxhqGOhJlnQtjuQpB+8aEE00wZFznSJPyHxgH3HkPOsJFvYk8zqCHzTs1BYOa4J3PFU+UVRZxlHDM4YavlNUuMoRveiZA2d7grMNc2g+RbSCEKzmgYsUmWmazFJyoiOZ4KnyhKOGRzWJa0+moyV4TVHDzn51Awtqaphfk/lRQ08FX1iiqxTB/kLwd0VynKfEvI6cd4XMV5bMhZ7gZUWVzYQ6Nm2BYzxJbw3bGthEUUMfgbGeorae6DxHtJoZ6alhZ0+ytiVoK1R4z5PTrOECT/SugseEOlb1MMNR4VRNcJy+V1Hg9ONClSZFZjdHlc6W6FBLdJja2MC5hhpu0DBYEY1TFGwiFAxRRCsYkiM9JRb0JNMVkW6CZYT/2EiTGWmo8k+h4FhDNE7BvppoTSFnmCV5xZKzvcCdDo7VVPnIU+I+Rc68juApC90MwcFCsJ5hDqxgScYKreruyQwTqrzoqDCmhWi4IbhB0Yrt3RGa6GfDv52rKXWhh28dyZaWUvcZeMTBaZoSGyiCtRU5J8iviioHaErs7Jkj61syVzTTgOcUOQ8buFBTYWdL5g3T4qlpe0+wvD63heAXRfCCIed9RbCsp2CiI7raUOYOTU13N8PNHvpaGvayo4a3LLT1lDrVEPT2zLUlheB1R+ZTRfKWJ+dcocLJfi11vyJ51lLqJ0WD7tRwryezjiV5W28uJO9qykzX8JDe2lHl/9oyBwa2UMfOngpXCixvKdXTk3wrsKmiVYdZIqsoWEERjbcUNDuiaQomGoIbFdEHmsyWnuR+IeriKDVLnlawlyNHKwKlSU631PKep8J4Q+ayjkSLKYLhalNHlYvttb6fHm0p6OApsZ4l2VfdqZkjuysy6ysKLlckf1KUutCTs39bmCgEyyoasIWlVaMF7mgmWtBT8Kol5xpH9IGllo8cJdopcvZ2sImlDmMIbtDk3KIpeNiS08lQw11NFPTwVFlPP6pJ2gvRfI7gQUfmNAtf6Gs0wQxDsKGlVBdF8rCa3jzdwMaGHOsItrZk7hAyOzpK9VS06j5F49b0VNGOOfKs3lDToMsMBe9ZWtHFEgxTJLs7qrygKZjUnmCYoeAqeU6jqWuLJup4WghOdvCYJnrSkSzoyRkm5M2StQwVltPkfCAk58tET/CSg+8MUecmotMEnhBKfWBIZsg2ihruMJQaoIm+tkTLKEqspMh00w95gvFCQRtDwTT1gVDDSEVdlwqZfxoQRbK0g+tbiBZxzKlpnpypejdDwTaeOvorMk/IJE10h9CqRe28hhLbe0pMsdSwv4ZbhKivo2BjDWfL8UKJgeavwlwb5KlwhyE4u4XkGE2ytZCznKLCDZZq42VzT8HLCrpruFbIfOIINmh/qCdZ1ZBc65kLHR1Bkyf5zn6pN3SvGKIlFNGplhrO9QSXanLOMQTLCa0YJCRrCZm/CZmrLTm7WzCK4GJDiWUdFeYx1LCFg3NMd0XmCuF3Y5rITLDUsYS9zoHVzwnJoYpSTQoObyEzr4cFBNqYTopoaU/wkyLZ2lPhX/5Y95ulxGTV7KjhWrOZgl8MyUUafjYraNjNU1N3IWcjT5WzWqjwtoarHSUObGYO3GCJZpsBlnJGPd6ZYLyl1GdCA2625IwwJDP8GUKymbzuyPlZlvTUsaUh5zFDhRWFzPKKZLAlWdcQbObgF9tOqOsmB1dqcqYJmWstFbZRRI9poolmqiLnU0POvxScpah2iSL5UJNzgScY5+AuIbpO0YD3NCW+dLMszFSdFCWGqG6eVq2uYVNDdICGD6W7EPRWZEY5gpsE9rUkS3mijzzJnm6UpUFXG1hCUeVoS5WfNcFpblELL2qqrCvMvRfd45oalvKU2tiQ6ePJOVMRXase9iTtLJztPxJKLWpo2CRDcJwn2sWSLKIO1WQWNTCvpVUvOZhgSC40JD0dOctaSqzkCRbXsKlb11Oip6PCJ0IwSJM31j3akRxlP7Rwn6aGaUL0qiLnJkvB3xWZ2+Q1TfCwpQH3G0o92UzmX4o/oJNQMMSQc547wVHhdk+VCw01DFYEnTxzZKAm74QmeNNR1w6WzEhNK15VJzuCdxQ53dRUDws5KvwgBMOEgpcVNe0hZI6RXT1Jd0cyj5nsaEAHgVmGaJIlWdsc5Ui2ElrRR6jrRAttNMEAIWrTDFubkZaok7/AkzfIwfuWVq0jHzuCK4QabtLUMVPB3kJ0oyHTSVFlqMALilJf2Rf8k5aaHtMfayocLBS8L89oKoxpJvnAkDPa0qp5DAUTHKWmCcnthlou8iCKaFFLHWcINd1nyIwXqrSxMNmSs6KmoL2QrKuWtlQ5V0120xQ5vRyZS1rgFkWwhiOwiuQbR0OOVhQM9iS3tiXp4RawRPMp5tDletOOBL95MpM01dZTBM9pkn5qF010rIeHFcFZhmSGpYpTsI6nwhqe5C9ynhlpp5ophuRb6WcJFldkVnVEwwxVfrVkvnWUuNLCg5bgboFHPDlDPDmnK7hUrWiIbjadDclujlZcaokOFup4Ri1kacV6jmrrK1hN9bGwpKEBQ4Q6DvIUXOmo6U5LqQM6EPyiKNjVkPnJkDPNEaxhiFay5ExW1NXVUGqcpYYdPcGiCq7z/TSlbhL4pplWXKd7NZO5QQFrefhRQW/NHOsqcIglc4UhWklR8K0QzbAw08CBDnpbgqXdeD/QUsM4RZXDFBW6WJKe/mFPdH0LtBgiq57wFLzlyQzz82qYx5D5WJP5yVJDW01BfyHnS6HKO/reZqId1WGa4Hkh2kWodJ8i6KoIPlAj2hPt76CzXsVR6koPRzWTfKqIentatYpQw2me4AA3y1Kind3SwoOKZDcFXTwl9tWU6mfgRk9d71sKtlNwrjnYw5tC5n5LdKiGry3JKNlHEd3oaMCFHrazBPMp/uNJ+V7IudcSbeOIdjUEdwl0VHCOZo5t6YluEuaC9mQeMgSfOyKnYGFHcIeQ84yQWbuJYJpZw5CzglDH7gKnWqqM9ZTaXcN0TeYhR84eQtJT76JJ1lREe7WnnvsMmRc9FQ7SBBM9mV3lCUdmHk/S2RAMt0QjFNFqQpWjDPQ01DXWUdDBkXziKPjGEP3VP+zIWU2t7im41FOloyWzn/L6dkUy3VLDaZ6appgDLHPjJEsyvJngWEPUyVBiAaHCTEXwrLvSEbV1e1gKJniicWorC1MUrVjB3uDhJE/wgSOzk1DXpk0k73qCM8xw2UvD5kJmDUfOomqMpWCkJRlvKXGmoeBm18USjVIk04SClxTB6YrgLAPLWYK9HLUt5cmc0vYES8GnTeRc6skZbQkWdxRsIcyBRzx1DbTk9FbU0caTPOgJHhJKnOGIVhQqvKmo0llRw9sabrZkDtdg3PqaKi9oatjY8B+G371paMg6+mZFNNtQ04mWBq3rYLOmtWWQp8KJnpy9DdFensyjdqZ+yY40VJlH8wcdLzC8PZnvHMFUTZUrDTkLyQaGus5X5LzpYAf3i+e/ZlhqGqWhh6Ou6xTR9Z6oi5AZZtp7Mj2EEm8oSpxiYZCHU/1fbGdNNNRRoZMhmilEb2gqHOEJDtXkHK/JnG6IrvbPCwV3NhONVdS1thBMs1T4QOBcTWa2IzhMk2nW5Kyn9tXUtpv9RsG2msxk+ZsQzRQacJncpgke0+T8y5Fzj8BiGo7XlJjaTIlpQs7KFjpqGnKuoyEPeIKnFMkZHvopgh81ySxNFWvJWcKRs70j2FOT012IllEEO1n4pD1513Yg2ssQPOThOkvyrqHUdEXOSEsihmBbTbKX1kLBPWqWkLOqJbjB3GBIZmoa8qWl4CG/iZ7oiA72ZL7TJNeZUY7kFQftDcHHluBzRbCegzMtrRjVQpX2lgoPKKLJAkcbMl01XK2p7yhL8pCBbQ3BN2avJgKvttcrWDK3CiUOVxQ8ZP+pqXKyIxnmBymCg5vJjNfkPK4+c8cIfK8ocVt7kmfd/I5SR1hKvCzUtb+lhgc00ZaO6CyhIQP1Uv4yIZjload72PXX0OIJvnFU+0Zf6MhsJwTfW0r0UwQfW4LNLZl5HK261JCZ4qnBaAreVAS3WrjV0LBnNDUNNDToCEeFfwgcb4gOEqLRhirWkexrCEYKVV711DLYEE1XBEsp5tpTGjorkomKYF9FDXv7fR3BGwbettSxnyL53MBPjsxDZjMh+VUW9NRxq1DhVk+FSxQcaGjV9Pawv6eGByw5qzoy7xk4RsOShqjJwWKe/1pEEfzkobeD/dQJmpqedcyBTy2sr4nGNRH0c0SPWTLrqAc0OQcb/gemKgqucQT7ySWKCn2EUotoCvpZct7RO2sy/QW0IWcXd7pQRQyZVwT2USRO87uhjioTLKV2brpMUcMQRbKH/N2T+UlTpaMls6cmc6CCNy3JdYYSUzzJQ4oSD3oKLncULOiJvjBEC2oqnCJkJluCYy2ZQ5so9YYlZ1VLlQU1mXEW1jZERwj/MUSRc24TdexlqLKfQBtDTScJUV8FszXBEY5ktpD5Ur9hYB4Nb1iikw3JoYpkKX+RodRKFt53MMuRnKSpY31PwYaGaILh3wxJGz9TkTPEETxoCWZrgvOlmyMzxFEwVJE5xZKzvyJ4WxEc16Gd4Xe3Weq4XH2jKRikqOkGQ87hQnC7wBmGYLAnesX3M+S87eFATauuN+Qcrh7xIxXJbUIdMw3JGE3ylCWzrieaqCn4zhGM19TQ3z1oH1AX+pWEqIc7wNGAkULBo/ZxRaV9NNyh4Br3rCHZzbzmSfawBL0dNRwpW1kK9mxPXR9povcdrGSZK9c2k0xwFGzjuniCtRSZCZ6ccZ7gaktmgAOtKbG/JnOkJrjcQTdFMsxRQ2cLY3WTIrlCw1eWKn8R6pvt4GFDso3QoL4a3nLk3G6JrtME3dSenpx7PNFTmga0EaJTLQ061sEeQoWXhSo9LTXsaSjoJQRXeZLtDclbCrYzfzHHeaKjHCVOUkQHO3JeEepr56mhiyaYYKjjNU+Fed1wS5VlhWSqI/hYUdDOkaxiKehoyOnrCV5yBHtbWFqTHCCwtpDcYolesVR5yUzTZBb3RNMd0d6WP+SvhuBmRcGxnuQzT95IC285cr41cLGQ6aJJhmi4TMGempxeimBRQw1tFKV+8jd6KuzoSTqqDxzRtpZkurvKEHxlqXKRIjjfUNNXQsNOsRScoWFLT+YeRZVD3GRN0MdQcKqQjHDMrdGGVu3iYJpQx3WGUvfbmxwFfR20WBq0oYY7LMFhhgYtr8jpaEnaOzjawWWaTP8mMr0t/EPDPoqcnxTBI5o58L7uoWnMrpoqPwgVrlAUWE+V+TQl9rawoyP6QGAlQw2TPRX+YSkxyBC8Z6jhHkXBgQL7WII3DVFnRfCrBfxewv9D6xsyjys4VkhWb9pUU627JllV0YDNHMku/ldNMMXDEo4aFnAkk4U6frNEU4XgZUPmEKHUl44KrzmYamjAbh0JFvGnaTLPu1s9jPCwjFpYiN7z1DTOk/nc07CfDFzmCf7i+bfNHXhDtLeBXzTBT5rkMvWOIxpl4EMh2LGJBu2syDnAEx2naEhHDWMMzPZEhygyS1mS5RTJr5ZkoKbEUoYqr2kqdDUE8ztK7OaIntJkFrIECwv8LJTaVx5XJE86go8dFeZ3FN3rjabCAYpoYEeC9zzJVULBbmZhDyd7ko09ydpNZ3nm2Kee4FPPXHnYEF1nqOFEC08LUVcDvYXkJHW8gTaKCk9YGOeIJhqiE4ToPEepdp7IWFjdwnWaufGMwJJCMtUTTBBK9BGCOy2tGGrJTHIwyEOzp6aPzNMOtlZkDvcEWpP5SVNhfkvDxhmSazTJXYrM9U1E0xwFVwqZQwzJxw6+kGGGUj2FglGGmnb1/G51udRSMNlTw6GGnCcUwVcOpmsqTHa06o72sw1RL02p9z0VbnMLOaIX3QKaYKSCFQzBKEUNHTSc48k53RH9wxGMtpQa5KjjW0W0n6XCCCG4yxNNdhQ4R4l1Ff+2sSd6UFHiIEOyqqFgT01mEUMD+joy75jPhOA+oVVLm309FR4yVOlp4RhLiScNmSmaYF5Pw0STrOIoWMSR2UkRXOMp+M4SHW8o8Zoi6OZgjKOaFar8zZDzkWzvKOjkKBjmCXby8JahhjXULY4KlzgKLvAwxVGhvyd4zxB1d9T0piazmKLCVZY5sKiD0y2ZSYrkUEPUbIk+dlQ4SJHTR50k1DPaUWIdTZW9NJwnJMOECgd7ou/MnppMJ02O1VT4Wsh85MnZzcFTngpXGKo84qmwgKbCL/orR/SzJ2crA+t6Mp94KvxJUeIbT3CQu1uIdlQEOzlKfS3UMcrTiFmOuroocrZrT2AcmamOKg8YomeEKm/rlT2sociMaybaUlFhuqHCM2qIJ+rg4EcDFymiDSxzaHdPcpE62pD5kyM5SBMoA1PaUtfIthS85ig1VPiPPYXgYEMNk4Qq7TXBgo7oT57gPUdwgCHzhIVFPFU6OYJzHAX9m5oNrVjeE61miDrqQ4VSa1oiURTsKHC0IfjNwU2WzK6eqK8jWln4g15TVBnqmDteCJ501PGAocJhhqjZdtBEB6lnhLreFJKxmlKbeGrqLiSThVIbCdGzloasa6lpMQXHCME2boLpJgT7yWaemu6wBONbqGNVRS0PKIL7LckbjmQtR7K8I5qtqel+T/ChJTNIKLjdUMNIRyvOEko9YYl2cwQveBikCNawJKcLBbc7+JM92mysNvd/Fqp8a0k6CNEe7cnZrxlW0wQXaXjaktnRwNOGZKYiONwS7a1JVheq3WgJHlQUGKHKmp4KAxXR/ULURcNgoa4zhKSLpZR3kxRRb0NmD0OFn+UCS7CzI1nbP6+o4x47QZE5xRCt3ZagnYcvmpYQktXdk5YKXTzBC57kKEe0VVuiSYqapssMS3C9p2CKkHOg8B8Pa8p5atrIw3qezIWanMGa5HRDNF6RM9wcacl0N+Q8Z8hsIkSnaIIdHRUOEebAPy1zbCkhM062FCJtif7PU+UtoVXzWKqM1PxXO8cfdruhFQ/a6x3JKYagvVDhQEtNiyiiSQ7OsuRsZUku0CRNDs4Sog6KKjsZgk2bYJqijgsEenoKeniinRXBn/U3lgpPdyDZynQx8IiioMnCep5Ky8mjGs6Wty0l1hUQTcNWswS3WRp2kCNZwJG8omG8JphPUaFbC8lEfabwP7VtM9yoaNCAjpR41VNhrD9LkbN722v0CoZMByFzhaW+MyzRYEWFDQwN2M4/JiT76PuljT3VU/A36eaIThb+R9oZGOAJ9tewkgGvqOMNRWYjT/Cwu99Q8LqDE4TgbLWxJ1jaDDAERsFOFrobgjUsBScaguXU8kKm2RL19tRypSHnHNlHiIZqgufs4opgQdVdwxBNNFBR6kVFqb8ogimOzB6a6HTzrlDHEpYaxjiiA4TMQobkDg2vejjfwJGWmnbVFAw3H3hq2NyQfG7hz4aC+w3BbwbesG0swYayvpAs6++Ri1Vfzx93mFChvyN5xVHTS+0p9aqCAxyZ6ZacZyw5+7uuQkFPR9DDk9NOiE7X1PCYJVjVUqq7JlrHwWALF5nfHNGjApdpqgzx5OwilDhCiDYTgnc9waGW4BdLNNUQvOtpzDOWHDH8D7TR/A/85KljEQu3NREc4Pl/6B1Hhc8Umb5CsKMmGC9EPcxoT2amwHNCmeOEnOPbklnMkbOgIvO5UMOpQrS9UGVdt6iH/fURjhI/WOpaW9OKLYRod6HCUEdOX000wpDZQ6hwg6LgZfOqo1RfT/CrJzjekXOGhpc1VW71ZLbXyyp+93ILbC1kPtIEYx0FIx1VDrLoVzXRKRYWk809yYlC9ImcrinxtabKnzRJk3lAU1OLEN1j2zrYzr2myHRXJFf4h4QKT1qSTzTB5+ZNTzTRkAxX8FcLV2uS8eoQQ2aAkFzvCM72sJIcJET3WPjRk5wi32uSS9rfZajpWEvj9hW42F4o5NytSXYy8IKHay10VYdrcl4SkqscrXpMwyGOgtkajheSxdQqmpxP1L3t4R5PqasFnrQEjytq6qgp9Y09Qx9o4S1FzhUCn1kyHSzBWLemoSGvOqLNhZyBjmCaAUYpMgt4Ck7wBBMMwWKWgjsUwTaGVsxWC1mYoKiyqqeGKYqonSIRQ3KIkHO0pmAxTdBHkbOvfllfr+AA+7gnc50huVKYK393FOyg7rbPO/izI7hE4CnHHHnJ0ogNPRUGeUpsrZZTBJcrovUcJe51BPsr6GkJdhCCsZ6aTtMEb2pqWkqeVtDXE/QVggsU/Nl86d9RMF3DxvZTA58agu810RWawCiSzzXBeU3MMW9oyJUedvNEvQyNu1f10BSMddR1vaLCYpYa/mGocLSiYDcLbQz8aMn5iyF4xBNMs1P0QEOV7o5gaWGuzSeLue4tt3ro7y4Tgm4G/mopdZgl6q0o6KzJWE3mMksNr3r+a6CbT8g5wZNzT9O7fi/zpaOmnz3BRoqos+tv9zMbdpxsqDBOEewtJLt7cg5wtKKbvldpSzRRCD43VFheCI7yZLppggMVBS/KMAdHODJvOwq2NQSbKKKPLdFWQs7Fqo+mpl01JXYRgq8dnGLhTiFzqmWsUMdpllZdbKlyvSdYxhI9YghOtxR8LgSLWHK62mGGVoxzBE8LNWzqH9CUesQzFy5RQzTc56mhi6fgXEWwpKfE5Z7M05ZgZUPmo6auiv8YKzDYwWBLMErIbKHJvOwIrvEdhOBcQ9JdU1NHQ7CXn2XIDFBKU2WAgcX9UAUzDXWd5alwuyJ41Z9rjKLCL4aCp4WarhPm2rH+SaHUYE001JDZ2ZAzXPjdMpZWvC9wmqIB2lLhQ01D5jO06hghWMndbM7yRJMsoCj1vYbnFQVrW9jak3OlEJ3s/96+p33dEPRV5GxiqaGjIthUU6FFEZyqCa5qJrpBdzSw95IUnOPIrCUUjRZQFrbw5PR0R1qiYx3cb6nrWUMrBmmiBQxVHtTew5ICP/ip6g4hed/Akob/32wvBHsIOX83cI8hGeNeNPCIkPmXe8fPKx84OMSRM1MTdXSwjCZ4S30jVGhvqTRak/OVhgGazHuOCud5onEO1lJr6ecVyaOK6H7zqlBlIaHE0oroCgfvGJIdPcmfLNGLjpz7hZwZQpUbFME0A1cIJa7VNORkgfsMBatbKgwwJM9bSvQXeNOvbIjelg6WWvo5kvbKaJJNHexkKNHL9xRyFlH8Ti2riB5wVPhUk7nGkJnoCe428LR/wRGdYIlmWebCyxou1rCk4g/ShugBDX0V0ZQWkh0dOVsagkM0yV6OoLd5ye+pRlsCr0n+KiQrGuq5yJDzrTAXHtLUMduTDBVKrSm3eHL+6ijxhFDX9Z5gVU/wliHYTMiMFpKLNMEywu80wd3meoFmt6VbRMPenhrOc6DVe4pgXU8DnnHakLOIIrlF4FZPIw6R+zxBP0dyq6OOZ4Q5sLKCcz084ok+VsMMyQhNZmmBgX5xIXOEJTmi7VsGTvMTNdHHhpzdbE8Du2oKxgvBqQKdDDnTFOylCFaxR1syz2iqrOI/FEpNc3C6f11/7+ASS6l2inq2ciTrCCzgyemrCL5SVPjQkdPZUmGy2c9Sw9FtR1sS30RmsKPCS4rkIC/2U0MduwucYolGaPjKEyhzmiPYXagyWbYz8LWBDdzRimAXzxx4z8K9hpzlhLq+NiQ97HuKorMUfK/OVvC2JfiHUPCQI/q7J2gjK+tTDNxkCc4TMssqCs4TGtLVwQihyoAWgj9bosU80XGW6Ac9TJGziaUh5+hnFcHOnlaM1iRn29NaqGENTTTSUHCH2tWTeV0osUhH6psuVLjRUmGWhm6OZEshGeNowABHcJ2Bpy2ZszRcKkRXd2QuKVEeXnbfaEq825FguqfgfE2whlChSRMdron+LATTPQ2Z369t4B9C5gs/ylzv+CMmepIDPclFQl13W0rspPd1JOcbghGOEutqCv5qacURQl3dDKyvyJlqKXGPgcM9FfawJAMVmdcspcYKOZc4GjDYkFlK05olNMHyHn4zFNykyOxt99RkHlfwmiHo60l2EKI+mhreEKp080Tbug08BVPcgoqC5zWt+NLDTZ7oNSF51N1qie7Va3uCCwyZbkINf/NED6jzOsBdZjFN8oqG3wxVunqCSYYKf3EdhJyf9YWGf7tRU2oH3VHgPr1fe5J9hOgHd7xQ0y7qBwXr23aGErP0cm64JVjZwsOGqL+mhNgZmhJLW2oY4UhedsyBgzrCKrq7BmcpNVhR6jBPq64Vgi+kn6XE68pp8J5/+0wRHGOpsKenQn9DZntPzjRLZpDAdD2fnSgkG9tmIXnUwQ6WVighs7Yi2MxQ0N3CqYaCXkJ0oyOztMDJjmSSpcpvlrk0RMMOjmArQ04PRV1DO1FwhCVaUVPpKUM03JK5SxPsIWRu8/CGHi8UHChiqGFDTbSRJWeYUDDcH6vJWUxR4k1FXbMUwV6e4AJFXS8oMqsZKqzvYQ9DDQdZckY4aGsIhtlubbd2r3j4QBMoTamdPZk7O/Bf62lacZwneNjQoGcdVU7zJOd7ghsUHOkosagic6cnWc8+4gg285R6zZP5s1/LUbCKIznTwK36PkdwlOrl4U1LwfdCCa+IrvFkmgw1PCAUXKWo0sURXWcI2muKJlgyFzhynCY4RBOsqCjoI1R5zREco0n2Vt09BQtYSizgKNHfUmUrQ5UOCh51BFcLmY7umhYqXKQomOop8bUnWNNQcIiBcYaC6xzMNOS8JQQfeqKBmmglB+97ok/lfk3ygaHSyZaCRTzRxQo6GzLfa2jWBPepw+UmT7SQEJyiyRkhBLMVOfcoMjcK0eZChfUNzFAUzCsEN5vP/X1uP/n/aoMX+K+nw/Hjr/9xOo7j7Pju61tLcgvJpTWXNbfN5jLpi6VfCOviTktKlFusQixdEKWmEBUKNaIpjZRSSOXSgzaaKLdabrm1/9nZ+/f+vd/vz/v9+Xy+zZ7PRorYoZqyLrCwQdEAixxVOEXNNnjX2nUSRlkqGmWowk8lxR50JPy9Bo6qJXaXwNvREBvnThPEPrewryLhcAnj5WE15Fqi8W7R1sAuEu86S4ENikItFN4xkv9Af4nXSnUVcLiA9xzesFpivRRVeFKtsMRaKBhuSbjOELnAUtlSQUpXgdfB4Z1oSbnFEetbQ0IrAe+Y+pqnDcEJFj6S8LDZzZHwY4e3XONNlARraomNEt2bkvGsosA3ioyHm+6jCMbI59wqt4eeara28IzEmyPgoRaUOEDhTVdEJhmCoTWfC0p8aNkCp0oYqih2iqGi4yXeMkOsn4LdLLnmKfh/YogjNsPebeFGR4m9BJHLzB61XQ3BtpISfS2FugsK9FAtLWX1dCRcrCnUp44CNzuCowUZmxSRgYaE6Za0W2u/E7CVXCiI/UOR8aAm1+OSyE3mOUcwyc1zBBeoX1kiKy0Zfxck1Gsyulti11i83QTBF5Kg3pDQThFMVHiPSlK+0cSedng/VaS8bOZbtsBcTcZAR8JP5KeqQ1OYKAi20njdNNRpgnsU//K+JnaXJaGTomr7aYIphoRn9aeShJWKEq9LcozSF7QleEfDI5LYm5bgVkFkRwVDBCVu0DDIkGupo8TZBq+/pMQURYErJQmPKGKjNDkWOLx7Jd5QizdUweIaKrlP7SwJDhZvONjLkOsBBX9UpGxnydhXkfBLQ8IxgojQbLFnJf81JytSljclYYyEFyx0kVBvKWOFJmONpshGAcsduQY5giVNCV51eOdJYo/pLhbvM0uDHSevNKRcrKZIqnCtJeEsO95RoqcgGK4ocZcho1tTYtcZvH41pNQ7vA0WrhIfOSraIIntIAi+NXWCErdbkvrWwjRLrt0NKUdL6KSOscTOdMSOUtBHwL6OLA0vNSdynaWQEnCpIvKaIrJJEbvHkmuNhn6OjM8VkSGSqn1uYJCGHnq9I3aLhNME3t6GjIkO7xrNFumpyTNX/NrwX7CrIRiqqWijI9JO4d1iieykyfiposQIQ8YjjsjlBh6oHWbwRjgYJQn2NgSnNycmJAk3NiXhx44Sxykihxm8ybUwT1OVKySc7vi3OXVkdBJ4AyXBeksDXG0IhgtYY0lY5ahCD0ehborIk5aUWRJviMA7Xt5kyRjonrXENkm8yYqgs8VzgrJmClK20uMM3jRJ0FiQICQF9hdETlLQWRIb5ki6WDfWRPobvO6a4GP5mcOrNzDFELtTkONLh9dXE8xypEg7z8A9jkhrQ6Fhjlg/QVktJXxt4WXzT/03Q8IaQWSqIuEvloQ2mqC9Jfi7wRul4RX3pSPlzpoVlmCtI2jvKHCFhjcM3sN6lqF6HxnKelLjXWbwrpR4xzuCrTUZx2qq9oAh8p6ixCUGr78g8oyjRAtB5CZFwi80VerVpI0h+IeBxa6Zg6kWvpDHaioYYuEsRbDC3eOmC2JvGYLeioxGknL2UATNJN6hmtj1DlpLvDVmocYbrGCVJKOrg4X6DgddLA203BKMFngdJJFtFd7vJLm6KEpc5yjQrkk7M80SGe34X24nSex1Ra5Omgb71JKyg8SrU3i/kARKwWpH0kOGhKkObyfd0ZGjvyXlAkVZ4xRbYJ2irFMkFY1SwyWxr2oo4zlNiV+7zmaweFpT4kR3kaDAFW6xpSqzJay05FtYR4HmZhc9UxKbbfF2V8RG1MBmSaE+kmC6JnaRXK9gsiXhJHl/U0qM0WTcbyhwkYIvFGwjSbjfwhiJt8ZSQU+Bd5+marPMOkVkD0muxYLIfEuhh60x/J92itguihJSEMySVPQnTewnEm+620rTQEMsOfo4/kP/0ARvWjitlpSX7GxBgcMEsd3EEeYWvdytd+Saawi6aCIj1CkGb6Aj9rwhx16Cf3vAwFy5pyLhVonXzy51FDpdEblbkdJbUcEPDEFzQ8qNmhzzLTmmKWKbFCXeEuRabp6rxbvAtLF442QjQ+wEA9eL1xSR7Q0JXzlSHjJ4exq89yR0laScJ/FW6z4a73pFMEfDiRZvuvijIt86RaSFOl01riV2mD1UEvxGk/Geg5aWwGki1zgKPG9J2U8PEg8qYvMsZeytiTRXBMslCU8JSlxi8EabjwUldlDNLfzTUmCgxWsjqWCOHavYAqsknKFIO0yQ61VL5AVFxk6WhEaCAkdJgt9aSkzXlKNX2jEa79waYuc7gq0N3GDJGCBhoiTXUEPsdknCUE1CK0fwsiaylSF2uiDyO4XX3pFhNd7R4itFGc0k/ElBZwWvq+GC6szVeEoS/MZ+qylwpKNKv9Z469UOjqCjwlusicyTxG6VpNxcQ8IncoR4RhLbR+NdpGGmJWOcIzJGUuKPGpQg8rrG21dOMqQssJQ4RxH5jaUqnZuQ0F4Q+cjxLwPtpZbIAk3QTJHQWBE5S1BokoVtDd6lhqr9UpHSUxMcIYl9pojsb8h4SBOsMQcqvOWC2E8EVehqiJ1hrrAEbQxeK0NGZ0Gkq+guSRgniM23bIHVkqwx4hiHd7smaOyglyIyQuM978j4VS08J/A2G1KeMBRo4fBaSNhKUEZfQewVQ/C1I+MgfbEleEzCUw7mKXI0M3hd1EESVji8x5uQ41nxs1q4RMJCCXs7Iq9acpxn22oSDnQ/sJTxsCbHIYZiLyhY05TY0ZLIOQrGaSJDDN4t8pVaIrsqqFdEegtizc1iTew5Q4ayBDMUsQMkXocaYkc0hZua412siZ1rSXlR460zRJ5SlHGe5j801RLMlJTxtaOM3Q1pvxJ45zUlWFD7rsAbpfEm1JHxG0eh8w2R7QQVzBUw28FhFp5QZzq8t2rx2joqulYTWSuJdTYfWwqMFMcovFmSyJPNyLhE4E10pHzYjOC3huArRa571ZsGajQpQx38SBP5pyZB6lMU3khDnp0MBV51BE9o2E+TY5Ml2E8S7C0o6w1xvCZjf0HkVEHCzFoyNmqC+9wdcqN+Tp7jSDheE9ws8Y5V0NJCn2bk2tqSY4okdrEhx1iDN8cSudwepWmAGXKcJXK65H9to8jYQRH7SBF01ESUJdd0TayVInaWhLkOjlXE5irKGOnI6GSWGCJa482zBI9rCr0jyTVcEuzriC1vcr6mwFGSiqy5zMwxBH/TJHwjSPhL8+01kaaSUuMFKTcLEvaUePcrSmwn8DZrgikWb7CGPxkSjhQwrRk57tctmxLsb9sZvL9LSlyuSLlWkqOjwduo8b6Uv1DkmudIeFF2dHCgxVtk8dpIvHpBxhEOdhKk7OLIUSdJ+cSRY57B+0DgGUUlNfpthTfGkauzxrvTsUUaCVhlKeteTXCoJDCa2NOKhOmC4G1H8JBd4OBZReSRGkqcb/CO1PyLJTLB4j1q8JYaIutEjSLX8YKM+a6phdMsdLFUoV5RTm9JSkuDN8WcIon0NZMNZWh1q8C7SJEwV5HxrmnnTrf3KoJBlmCYI2ilSLlfEvlE4011NNgjgthzEua0oKK7JLE7HZHlEl60BLMVFewg4EWNt0ThrVNEVkkiTwpKXSWJzdRENgvKGq4IhjsiezgSFtsfCUq8qki5S1LRQeYQQ4nemmCkImWMw3tFUoUBZk4NOeZYEp4XRKTGa6wJjrWNHBVJR4m3FCnbuD6aak2WsMTh3SZImGCIPKNgsDpVwnsa70K31lCFJZYcwwSMFcQulGTsZuEaSdBXkPGZhu0FsdUO73RHjq8MPGGIfaGIbVTk6iuI3GFgucHrIQkmWSJdBd7BBu+uOryWAhY7+Lki9rK5wtEQzWwvtbqGhIMFwWRJsElsY4m9IIg9L6lCX0VklaPAYkfkZEGDnOWowlBJjtMUkcGK4Lg6EtoZInMUBVYLgn0UsdmCyCz7gIGHFfk+k1QwTh5We7A9x+IdJ6CvIkEagms0hR50eH9UnTQJ+2oiKyVlLFUE+8gBGu8MQ3CppUHesnjTHN4QB/UGPhCTHLFPHMFrCqa73gqObUJGa03wgbhHkrCfpEpzNLE7JDS25FMKhlhKKWKfCgqstLCPu1zBXy0J2ztwjtixBu8UTRn9LVtkmCN2iyFhtME70JHRQ1KVZXqKI/KNIKYMCYs1GUMEKbM1bKOI9LDXC7zbHS+bt+1MTWS9odA9DtrYtpbImQJ2VHh/lisEwaHqUk1kjKTAKknkBEXkbkdMGwq0dnhzLJF3NJH3JVwrqOB4Sca2hti75nmJN0WzxS6UxDYoEpxpa4htVlRjkYE7DZGzJVU72uC9IyhQL4i8YfGWSYLLNcHXloyz7QhNifmKSE9JgfGmuyLhc403Xm9vqcp6gXe3xuuv8F6VJNxkyTHEkHG2g0aKXL0MsXc1bGfgas2//dCONXiNLCX+5mB7eZIl1kHh7ajwpikyzlUUWOVOsjSQlsS+M0R+pPje/dzBXRZGO0rMtgQrLLG9VSu9n6CMXS3BhwYmSoIBhsjNBmZbgusE9BCPCP5triU4VhNbJfE+swSP27aayE8tuTpYYjtrYjMVGZdp2NpS1s6aBnKSHDsbKuplKbHM4a0wMFd/5/DmGyKrJSUaW4IBrqUhx0vyfzTBBLPIUcnZdrAkNsKR0sWRspumSns6Ch0v/qqIbBYUWKvPU/CFoyrDJGwSNFhbA/MlzKqjrO80hRbpKx0Jewsi/STftwGSlKc1JZyAzx05dhLEdnfQvhZOqiHWWEAHC7+30FuRcZUgaO5gpaIK+xsiHRUsqaPElTV40xQZQ107Q9BZE1nryDVGU9ZSQ47bmhBpLcYpUt7S+xuK/FiT8qKjwXYw5ypS2iuCv7q1gtgjhuBuB8LCFY5cUuCNtsQOFcT+4Ih9JX+k8Ea6v0iCIRZOtCT0Et00JW5UeC85Cg0ScK0k411HcG1zKtre3SeITBRk7WfwDhEvaYLTHP9le0m8By0JDwn4TlLW/aJOvGHxdjYUes+ScZigCkYQdNdEOhkiezgShqkx8ueKjI8lDfK2oNiOFvrZH1hS+tk7NV7nOmLHicGWEgubkXKdwdtZknCLJXaCpkrjZBtLZFsDP9CdxWsSr05Sxl6CMmoFbCOgryX40uDtamB7SVmXW4Ihlgpmq+00tBKUUa83WbjLUNkzDmY7cow1JDygyPGlhgGKYKz4vcV7QBNbJIgM11TUqZaMdwTeSguH6rOaw1JRKzaaGyxVm2EJ/uCIrVWUcZUkcp2grMsEjK+DMwS59jQk3Kd6SEq1d0S6uVmO4Bc1lDXTUcHjluCXEq+1OlBDj1pi9zgiXxnKuE0SqTXwhqbETW6RggMEnGl/q49UT2iCzgJvRwVXS2K/d6+ZkyUl7jawSVLit46EwxVljDZwoSQ20sDBihztHfk2yA8NVZghiXwrYHQdfKAOtzsayjhY9bY0yE2CWEeJ9xfzO423xhL5syS2TFJofO2pboHob0nY4GiAgRrvGQEDa/FWSsoaaYl0syRsEt3kWoH3B01shCXhTUWe9w3Bt44SC9QCh3eShQctwbaK2ApLroGCMlZrYqvlY3qYhM0aXpFkPOuoqJ3Dm6fxXrGwVF9gCWZagjPqznfkuMKQ8DPTQRO8ZqG1hPGKEm9IgpGW4DZDgTNriTxvFiq+Lz+0cKfp4wj6OCK9JSnzNSn9LFU7UhKZZMnYwcJ8s8yRsECScK4j5UOB95HFO0CzhY4xJxuCix0lDlEUeMdS6EZBkTsUkZ4K74dugyTXS7aNgL8aqjDfkCE0ZbwkCXpaWCKhl8P7VD5jxykivSyxyZrYERbe168LYu9ZYh86IkscgVLE7tWPKmJv11CgoyJltMEbrohtVAQfO4ImltiHEroYEs7RxAarVpY8AwXMcMReFOTYWe5iiLRQxJ5Q8DtJ8LQhWOhIeFESPGsILhbNDRljNbHzNRlTFbk2S3L0NOS6V1KFJYKUbSTcIIhM0wQ/s2TM0SRMNcQmSap3jCH4yhJZKSkwyRHpYYgsFeQ4U7xoCB7VVOExhXepo9ABBsYbvGWKXPME3lyH95YioZ0gssQRWWbI+FaSMkXijZXwgiTlYdPdkNLaETxlyDVIwqeaEus0aTcYcg0RVOkpR3CSJqIddK+90JCxzsDVloyrFd5ZAr4TBKfaWa6boEA7C7s6EpYaeFPjveooY72mjIccLHJ9HUwVlDhKkmutJDJBwnp1rvulJZggKDRfbXAkvC/4l3ozQOG9a8lxjx0i7nV4jSXc7vhe3OwIxjgSHjdEhhsif9YkPGlus3iLFDnWOFhtCZbJg0UbQcIaR67JjthoCyMEZRwhiXWyxO5QxI6w5NhT4U1WsJvDO60J34fW9hwzwlKij6ZAW9ne4L0s8C6XeBMEkd/LQy1VucBRot6QMlbivaBhoBgjqGiCJNhsqVp/S2SsG6DIONCR0dXhvWbJ+MRRZJkkuEjgDXJjFQW6SSL7GXK8Z2CZg7cVsbWGoKmEpzQ5elpiy8Ryg7dMkLLUEauzeO86CuwlSOlgYLojZWeJ9xM3S1PWfEfKl5ISLQ0MEKR8YOB2QfCxJBjrKPCN4f9MkaSsqoVXJBmP7EpFZ9UQfOoOFwSzBN4MQ8LsGrymlipcJQhmy0GaQjPqCHaXRwuCZwRbqK2Fg9wlClZqYicrIgMdZfxTQ0c7TBIbrChxmuzoKG8XRaSrIhhiyNFJkrC7oIAWMEOQa5aBekPCRknCo4IKPrYkvCDI8aYmY7WFtprgekcJZ3oLIqssCSMtFbQTJKwXYy3BY5oCh2iKPCpJOE+zRdpYgi6O2KmOAgvVCYaU4ySRek1sgyFhJ403QFHiVEmJHwtybO1gs8Hr5+BETQX3War0qZngYGgtVZtoqd6vFSk/UwdZElYqyjrF4HXUeFspIi9IGKf4j92pKGAdCYMVsbcV3kRF0N+R8LUd5PCsIGWoxDtBkCI0nKofdJQxT+LtZflvuc8Q3CjwWkq8KwUpHzkK/NmSsclCL0nseQdj5FRH5CNHSgtLiW80Of5HU9Hhlsga9bnBq3fEVltKfO5IaSTmGjjc4J0otcP7QsJUSQM8pEj5/wCuUuC2DWz8AAAAAElFTkSuQmCC)}
dist/editor-themes/ayu-dark.css 0000644 00000003722 15153464547 0012531 0 ustar 00 .cm-s-ayu-dark.CodeMirror{background:#0a0e14;color:#b3b1ad}.cm-s-ayu-dark div.CodeMirror-selected{background:#273747}.cm-s-ayu-dark .CodeMirror-line::selection,.cm-s-ayu-dark .CodeMirror-line>span::selection,.cm-s-ayu-dark .CodeMirror-line>span>span::selection{background:#273747}.cm-s-ayu-dark .CodeMirror-line::-moz-selection,.cm-s-ayu-dark .CodeMirror-line>span::-moz-selection,.cm-s-ayu-dark .CodeMirror-line>span>span::-moz-selection{background:#273747}.cm-s-ayu-dark .CodeMirror-gutters{background:#0a0e14;border-right:0}.cm-s-ayu-dark .CodeMirror-guttermarker{color:#fff}.cm-s-ayu-dark .CodeMirror-guttermarker-subtle,.cm-s-ayu-dark .CodeMirror-linenumber{color:#3d424d}.cm-s-ayu-dark .CodeMirror-cursor{border-left:1px solid #e6b450}.cm-s-ayu-dark .cm-animate-fat-cursor,.cm-s-ayu-dark.cm-fat-cursor .CodeMirror-cursor{background-color:#a2a8a175!important}.cm-s-ayu-dark span.cm-comment{color:#626a73}.cm-s-ayu-dark span.cm-atom{color:#ae81ff}.cm-s-ayu-dark span.cm-number{color:#e6b450}.cm-s-ayu-dark span.cm-comment.cm-attribute{color:#ffb454}.cm-s-ayu-dark span.cm-comment.cm-def,.cm-s-ayu-dark span.cm-comment.cm-tag{color:#39bae6}.cm-s-ayu-dark span.cm-comment.cm-type{color:#5998a6}.cm-s-ayu-dark span.cm-attribute,.cm-s-ayu-dark span.cm-property{color:#ffb454}.cm-s-ayu-dark span.cm-keyword{color:#ff8f40}.cm-s-ayu-dark span.cm-builtin{color:#e6b450}.cm-s-ayu-dark span.cm-string{color:#c2d94c}.cm-s-ayu-dark span.cm-variable{color:#b3b1ad}.cm-s-ayu-dark span.cm-variable-2{color:#f07178}.cm-s-ayu-dark span.cm-variable-3{color:#39bae6}.cm-s-ayu-dark span.cm-type{color:#ff8f40}.cm-s-ayu-dark span.cm-def{color:#fe9}.cm-s-ayu-dark span.cm-bracket{color:#f8f8f2}.cm-s-ayu-dark span.cm-tag{color:#39bae6}.cm-s-ayu-dark span.cm-header{color:#c2d94c}.cm-s-ayu-dark span.cm-link{color:#39bae6}.cm-s-ayu-dark span.cm-error{color:#f33}.cm-s-ayu-dark .CodeMirror-activeline-background{background:#01060e}.cm-s-ayu-dark .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/ayu-mirage.css 0000644 00000004110 15153464547 0013044 0 ustar 00 .cm-s-ayu-mirage.CodeMirror{background:#1f2430;color:#cbccc6}.cm-s-ayu-mirage div.CodeMirror-selected{background:#34455a}.cm-s-ayu-mirage .CodeMirror-line::selection,.cm-s-ayu-mirage .CodeMirror-line>span::selection,.cm-s-ayu-mirage .CodeMirror-line>span>span::selection{background:#34455a}.cm-s-ayu-mirage .CodeMirror-line::-moz-selection,.cm-s-ayu-mirage .CodeMirror-line>span::-moz-selection,.cm-s-ayu-mirage .CodeMirror-line>span>span::-moz-selection{background:#191e2a}.cm-s-ayu-mirage .CodeMirror-gutters{background:#1f2430;border-right:0}.cm-s-ayu-mirage .CodeMirror-guttermarker{color:#fff}.cm-s-ayu-mirage .CodeMirror-guttermarker-subtle{color:#707a8c}.cm-s-ayu-mirage .CodeMirror-linenumber{color:#3d424d}.cm-s-ayu-mirage .CodeMirror-cursor{border-left:1px solid #fc6}.cm-s-ayu-mirage .cm-animate-fat-cursor,.cm-s-ayu-mirage.cm-fat-cursor .CodeMirror-cursor{background-color:#a2a8a175!important}.cm-s-ayu-mirage span.cm-comment{color:#5c6773;font-style:italic}.cm-s-ayu-mirage span.cm-atom{color:#ae81ff}.cm-s-ayu-mirage span.cm-number{color:#fc6}.cm-s-ayu-mirage span.cm-comment.cm-attribute{color:#ffd580}.cm-s-ayu-mirage span.cm-comment.cm-def{color:#d4bfff}.cm-s-ayu-mirage span.cm-comment.cm-tag{color:#5ccfe6}.cm-s-ayu-mirage span.cm-comment.cm-type{color:#5998a6}.cm-s-ayu-mirage span.cm-property{color:#f29e74}.cm-s-ayu-mirage span.cm-attribute{color:#ffd580}.cm-s-ayu-mirage span.cm-keyword{color:#ffa759}.cm-s-ayu-mirage span.cm-builtin{color:#fc6}.cm-s-ayu-mirage span.cm-string{color:#bae67e}.cm-s-ayu-mirage span.cm-variable{color:#cbccc6}.cm-s-ayu-mirage span.cm-variable-2{color:#f28779}.cm-s-ayu-mirage span.cm-variable-3{color:#5ccfe6}.cm-s-ayu-mirage span.cm-type{color:#ffa759}.cm-s-ayu-mirage span.cm-def{color:#ffd580}.cm-s-ayu-mirage span.cm-bracket,.cm-s-ayu-mirage span.cm-tag{color:#5ccfe6}.cm-s-ayu-mirage span.cm-header{color:#bae67e}.cm-s-ayu-mirage span.cm-link{color:#5ccfe6}.cm-s-ayu-mirage span.cm-error{color:#f33}.cm-s-ayu-mirage .CodeMirror-activeline-background{background:#191e2a}.cm-s-ayu-mirage .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/base16-dark.css 0000644 00000003327 15153464547 0013015 0 ustar 00 .cm-s-base16-dark.CodeMirror{background:#151515;color:#e0e0e0}.cm-s-base16-dark div.CodeMirror-selected{background:#303030}.cm-s-base16-dark .CodeMirror-line::selection,.cm-s-base16-dark .CodeMirror-line>span::selection,.cm-s-base16-dark .CodeMirror-line>span>span::selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-line::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span::-moz-selection,.cm-s-base16-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(48,48,48,.99)}.cm-s-base16-dark .CodeMirror-gutters{background:#151515;border-right:0}.cm-s-base16-dark .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-dark .CodeMirror-guttermarker-subtle,.cm-s-base16-dark .CodeMirror-linenumber{color:#505050}.cm-s-base16-dark .CodeMirror-cursor{border-left:1px solid #b0b0b0}.cm-s-base16-dark .cm-animate-fat-cursor,.cm-s-base16-dark.cm-fat-cursor .CodeMirror-cursor{background-color:#8e8d8875!important}.cm-s-base16-dark span.cm-comment{color:#8f5536}.cm-s-base16-dark span.cm-atom,.cm-s-base16-dark span.cm-number{color:#aa759f}.cm-s-base16-dark span.cm-attribute,.cm-s-base16-dark span.cm-property{color:#90a959}.cm-s-base16-dark span.cm-keyword{color:#ac4142}.cm-s-base16-dark span.cm-string{color:#f4bf75}.cm-s-base16-dark span.cm-variable{color:#90a959}.cm-s-base16-dark span.cm-variable-2{color:#6a9fb5}.cm-s-base16-dark span.cm-def{color:#d28445}.cm-s-base16-dark span.cm-bracket{color:#e0e0e0}.cm-s-base16-dark span.cm-tag{color:#ac4142}.cm-s-base16-dark span.cm-link{color:#aa759f}.cm-s-base16-dark span.cm-error{background:#ac4142;color:#b0b0b0}.cm-s-base16-dark .CodeMirror-activeline-background{background:#202020}.cm-s-base16-dark .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/base16-light.css 0000644 00000003151 15153464547 0013176 0 ustar 00 .cm-s-base16-light.CodeMirror{background:#f5f5f5;color:#202020}.cm-s-base16-light div.CodeMirror-selected{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::selection,.cm-s-base16-light .CodeMirror-line>span::selection,.cm-s-base16-light .CodeMirror-line>span>span::selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-line::-moz-selection,.cm-s-base16-light .CodeMirror-line>span::-moz-selection,.cm-s-base16-light .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-base16-light .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-base16-light .CodeMirror-guttermarker{color:#ac4142}.cm-s-base16-light .CodeMirror-guttermarker-subtle,.cm-s-base16-light .CodeMirror-linenumber{color:#b0b0b0}.cm-s-base16-light .CodeMirror-cursor{border-left:1px solid #505050}.cm-s-base16-light span.cm-comment{color:#8f5536}.cm-s-base16-light span.cm-atom,.cm-s-base16-light span.cm-number{color:#aa759f}.cm-s-base16-light span.cm-attribute,.cm-s-base16-light span.cm-property{color:#90a959}.cm-s-base16-light span.cm-keyword{color:#ac4142}.cm-s-base16-light span.cm-string{color:#f4bf75}.cm-s-base16-light span.cm-variable{color:#90a959}.cm-s-base16-light span.cm-variable-2{color:#6a9fb5}.cm-s-base16-light span.cm-def{color:#d28445}.cm-s-base16-light span.cm-bracket{color:#202020}.cm-s-base16-light span.cm-tag{color:#ac4142}.cm-s-base16-light span.cm-link{color:#aa759f}.cm-s-base16-light span.cm-error{background:#ac4142;color:#505050}.cm-s-base16-light .CodeMirror-activeline-background{background:#dddcdc}.cm-s-base16-light .CodeMirror-matchingbracket{background-color:#6a9fb5!important;color:#f5f5f5!important}
dist/editor-themes/bespin.css 0000644 00000002026 15153464547 0012270 0 ustar 00 .cm-s-bespin.CodeMirror{background:#28211c;color:#9d9b97}.cm-s-bespin div.CodeMirror-selected{background:#59554f!important}.cm-s-bespin .CodeMirror-gutters{background:#28211c;border-right:0}.cm-s-bespin .CodeMirror-linenumber{color:#666}.cm-s-bespin .CodeMirror-cursor{border-left:1px solid #797977!important}.cm-s-bespin span.cm-comment{color:#937121}.cm-s-bespin span.cm-atom,.cm-s-bespin span.cm-number{color:#9b859d}.cm-s-bespin span.cm-attribute,.cm-s-bespin span.cm-property{color:#54be0d}.cm-s-bespin span.cm-keyword{color:#cf6a4c}.cm-s-bespin span.cm-string{color:#f9ee98}.cm-s-bespin span.cm-variable{color:#54be0d}.cm-s-bespin span.cm-variable-2{color:#5ea6ea}.cm-s-bespin span.cm-def{color:#cf7d34}.cm-s-bespin span.cm-error{background:#cf6a4c;color:#797977}.cm-s-bespin span.cm-bracket{color:#9d9b97}.cm-s-bespin span.cm-tag{color:#cf6a4c}.cm-s-bespin span.cm-link{color:#9b859d}.cm-s-bespin .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}.cm-s-bespin .CodeMirror-activeline-background{background:#404040}
dist/editor-themes/blackboard.css 0000644 00000003127 15153464547 0013077 0 ustar 00 .cm-s-blackboard.CodeMirror{background:#0c1021;color:#f8f8f8}.cm-s-blackboard div.CodeMirror-selected{background:#253b76}.cm-s-blackboard .CodeMirror-line::selection,.cm-s-blackboard .CodeMirror-line>span::selection,.cm-s-blackboard .CodeMirror-line>span>span::selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-line::-moz-selection,.cm-s-blackboard .CodeMirror-line>span::-moz-selection,.cm-s-blackboard .CodeMirror-line>span>span::-moz-selection{background:rgba(37,59,118,.99)}.cm-s-blackboard .CodeMirror-gutters{background:#0c1021;border-right:0}.cm-s-blackboard .CodeMirror-guttermarker{color:#fbde2d}.cm-s-blackboard .CodeMirror-guttermarker-subtle,.cm-s-blackboard .CodeMirror-linenumber{color:#888}.cm-s-blackboard .CodeMirror-cursor{border-left:1px solid #a7a7a7}.cm-s-blackboard .cm-keyword{color:#fbde2d}.cm-s-blackboard .cm-atom,.cm-s-blackboard .cm-number{color:#d8fa3c}.cm-s-blackboard .cm-def{color:#8da6ce}.cm-s-blackboard .cm-variable{color:#ff6400}.cm-s-blackboard .cm-operator{color:#fbde2d}.cm-s-blackboard .cm-comment{color:#aeaeae}.cm-s-blackboard .cm-string,.cm-s-blackboard .cm-string-2{color:#61ce3c}.cm-s-blackboard .cm-meta{color:#d8fa3c}.cm-s-blackboard .cm-attribute,.cm-s-blackboard .cm-builtin,.cm-s-blackboard .cm-tag{color:#8da6ce}.cm-s-blackboard .cm-header{color:#ff6400}.cm-s-blackboard .cm-hr{color:#aeaeae}.cm-s-blackboard .cm-link{color:#8da6ce}.cm-s-blackboard .cm-error{background:#9d1e15;color:#f8f8f8}.cm-s-blackboard .CodeMirror-activeline-background{background:#3c3636}.cm-s-blackboard .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/cobalt.css 0000644 00000003002 15153464547 0012247 0 ustar 00 .cm-s-cobalt.CodeMirror{background:#002240;color:#fff}.cm-s-cobalt div.CodeMirror-selected{background:#b36539}.cm-s-cobalt .CodeMirror-line::selection,.cm-s-cobalt .CodeMirror-line>span::selection,.cm-s-cobalt .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-line::-moz-selection,.cm-s-cobalt .CodeMirror-line>span::-moz-selection,.cm-s-cobalt .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-cobalt .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-cobalt .CodeMirror-guttermarker{color:#ffee80}.cm-s-cobalt .CodeMirror-guttermarker-subtle,.cm-s-cobalt .CodeMirror-linenumber{color:#d0d0d0}.cm-s-cobalt .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-cobalt span.cm-comment{color:#08f}.cm-s-cobalt span.cm-atom{color:#845dc4}.cm-s-cobalt span.cm-attribute,.cm-s-cobalt span.cm-number{color:#ff80e1}.cm-s-cobalt span.cm-keyword{color:#ffee80}.cm-s-cobalt span.cm-string{color:#3ad900}.cm-s-cobalt span.cm-meta{color:#ff9d00}.cm-s-cobalt span.cm-tag,.cm-s-cobalt span.cm-variable-2{color:#9effff}.cm-s-cobalt .cm-type,.cm-s-cobalt span.cm-def,.cm-s-cobalt span.cm-variable-3{color:#fff}.cm-s-cobalt span.cm-bracket{color:#d8d8d8}.cm-s-cobalt span.cm-builtin,.cm-s-cobalt span.cm-special{color:#ff9e59}.cm-s-cobalt span.cm-link{color:#845dc4}.cm-s-cobalt span.cm-error{color:#9d1e15}.cm-s-cobalt .CodeMirror-activeline-background{background:#002d57}.cm-s-cobalt .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/colorforth.css 0000644 00000002510 15153464547 0013167 0 ustar 00 .cm-s-colorforth.CodeMirror{background:#000;color:#f8f8f8}.cm-s-colorforth .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-colorforth .CodeMirror-guttermarker{color:#ffbd40}.cm-s-colorforth .CodeMirror-guttermarker-subtle{color:#78846f}.cm-s-colorforth .CodeMirror-linenumber{color:#bababa}.cm-s-colorforth .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-colorforth span.cm-comment{color:#ededed}.cm-s-colorforth span.cm-def{color:#ff1c1c;font-weight:700}.cm-s-colorforth span.cm-keyword{color:#ffd900}.cm-s-colorforth span.cm-builtin{color:#00d95a}.cm-s-colorforth span.cm-variable{color:#73ff00}.cm-s-colorforth span.cm-string{color:#007bff}.cm-s-colorforth span.cm-number{color:#00c4ff}.cm-s-colorforth span.cm-atom{color:#606060}.cm-s-colorforth span.cm-variable-2{color:#eee}.cm-s-colorforth span.cm-type,.cm-s-colorforth span.cm-variable-3{color:#ddd}.cm-s-colorforth span.cm-meta{color:#ff0}.cm-s-colorforth span.cm-qualifier{color:#fff700}.cm-s-colorforth span.cm-bracket{color:#cc7}.cm-s-colorforth span.cm-tag{color:#ffbd40}.cm-s-colorforth span.cm-attribute{color:#fff700}.cm-s-colorforth span.cm-error{color:red}.cm-s-colorforth div.CodeMirror-selected{background:#333d53}.cm-s-colorforth span.cm-compilation{background:hsla(0,0%,100%,.12)}.cm-s-colorforth .CodeMirror-activeline-background{background:#253540}
dist/editor-themes/darcula.css 0000644 00000004263 15153464547 0012430 0 ustar 00 .cm-s-darcula{font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif}.cm-s-darcula.CodeMirror{background:#2b2b2b;color:#a9b7c6}.cm-s-darcula span.cm-meta{color:#bbb529}.cm-s-darcula span.cm-number{color:#6897bb}.cm-s-darcula span.cm-keyword{color:#cc7832;font-weight:700;line-height:1em}.cm-s-darcula span.cm-def{color:#a9b7c6;font-style:italic}.cm-s-darcula span.cm-variable,.cm-s-darcula span.cm-variable-2{color:#a9b7c6}.cm-s-darcula span.cm-variable-3{color:#9876aa}.cm-s-darcula span.cm-type{color:#abc;font-weight:700}.cm-s-darcula span.cm-property{color:#ffc66d}.cm-s-darcula span.cm-operator{color:#a9b7c6}.cm-s-darcula span.cm-string,.cm-s-darcula span.cm-string-2{color:#6a8759}.cm-s-darcula span.cm-comment{color:#61a151;font-style:italic}.cm-s-darcula span.cm-atom,.cm-s-darcula span.cm-link{color:#cc7832}.cm-s-darcula span.cm-error{color:#bc3f3c}.cm-s-darcula span.cm-tag{color:#629755;font-style:italic;font-weight:700;text-decoration:underline}.cm-s-darcula span.cm-attribute{color:#6897bb}.cm-s-darcula span.cm-qualifier{color:#6a8759}.cm-s-darcula span.cm-bracket{color:#a9b7c6}.cm-s-darcula span.cm-builtin,.cm-s-darcula span.cm-special{color:#ff9e59}.cm-s-darcula span.cm-matchhighlight{background-color:rgba(50,89,48,.7);color:#fff;font-weight:400}.cm-s-darcula span.cm-searching{background-color:rgba(61,115,59,.7);color:#fff;font-weight:400}.cm-s-darcula .CodeMirror-cursor{border-left:1px solid #a9b7c6}.cm-s-darcula .CodeMirror-activeline-background{background:#323232}.cm-s-darcula .CodeMirror-gutters{background:#313335;border-right:1px solid #313335}.cm-s-darcula .CodeMirror-guttermarker{color:#ffee80}.cm-s-darcula .CodeMirror-guttermarker-subtle{color:#d0d0d0}.cm-s-darcula .CodeMirrir-linenumber{color:#606366}.cm-s-darcula .CodeMirror-matchingbracket{background-color:#3b514d;color:#ffef28!important;font-weight:700}.cm-s-darcula div.CodeMirror-selected{background:#214283}.CodeMirror-hints.darcula{background-color:#3b3e3f!important;color:#9c9e9e;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.CodeMirror-hints.darcula .CodeMirror-hint-active{background-color:#494d4e!important;color:#9c9e9e!important}
dist/editor-themes/dracula.css 0000644 00000003113 15153464547 0012421 0 ustar 00 .cm-s-dracula .CodeMirror-gutters,.cm-s-dracula.CodeMirror{background-color:#282a36!important;border:none;color:#f8f8f2!important}.cm-s-dracula .CodeMirror-gutters{color:#282a36}.cm-s-dracula .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-dracula .CodeMirror-linenumber{color:#6d8a88}.cm-s-dracula .CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::selection,.cm-s-dracula .CodeMirror-line>span::selection,.cm-s-dracula .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-line::-moz-selection,.cm-s-dracula .CodeMirror-line>span::-moz-selection,.cm-s-dracula .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-dracula span.cm-comment{color:#6272a4}.cm-s-dracula span.cm-string,.cm-s-dracula span.cm-string-2{color:#f1fa8c}.cm-s-dracula span.cm-number{color:#bd93f9}.cm-s-dracula span.cm-variable{color:#50fa7b}.cm-s-dracula span.cm-variable-2{color:#fff}.cm-s-dracula span.cm-def{color:#50fa7b}.cm-s-dracula span.cm-keyword,.cm-s-dracula span.cm-operator{color:#ff79c6}.cm-s-dracula span.cm-atom{color:#bd93f9}.cm-s-dracula span.cm-meta{color:#f8f8f2}.cm-s-dracula span.cm-tag{color:#ff79c6}.cm-s-dracula span.cm-attribute,.cm-s-dracula span.cm-qualifier{color:#50fa7b}.cm-s-dracula span.cm-property{color:#66d9ef}.cm-s-dracula span.cm-builtin{color:#50fa7b}.cm-s-dracula span.cm-type,.cm-s-dracula span.cm-variable-3{color:#ffb86c}.cm-s-dracula .CodeMirror-activeline-background{background:hsla(0,0%,100%,.1)}.cm-s-dracula .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/duotone-dark.css 0000644 00000003477 15153464547 0013417 0 ustar 00 .cm-s-duotone-dark.CodeMirror{background:#2a2734;color:#6c6783}.cm-s-duotone-dark div.CodeMirror-selected{background:#545167!important}.cm-s-duotone-dark .CodeMirror-gutters{background:#2a2734;border-right:0}.cm-s-duotone-dark .CodeMirror-linenumber{color:#545167}.cm-s-duotone-dark .CodeMirror-cursor{border-left:1px solid #ffad5c;border-right:.5em solid #ffad5c;opacity:.5}.cm-s-duotone-dark .CodeMirror-activeline-background{background:#363342;opacity:.5}.cm-s-duotone-dark .cm-fat-cursor .CodeMirror-cursor{background:#ffad5c;opacity:.5}.cm-s-duotone-dark span.cm-atom,.cm-s-duotone-dark span.cm-attribute,.cm-s-duotone-dark span.cm-hr,.cm-s-duotone-dark span.cm-keyword,.cm-s-duotone-dark span.cm-link,.cm-s-duotone-dark span.cm-number,.cm-s-duotone-dark span.cm-quote,.cm-s-duotone-dark span.cm-variable{color:#fc9}.cm-s-duotone-dark span.cm-property{color:#9a86fd}.cm-s-duotone-dark span.cm-negative,.cm-s-duotone-dark span.cm-punctuation,.cm-s-duotone-dark span.cm-unit{color:#e09142}.cm-s-duotone-dark span.cm-string{color:#ffb870}.cm-s-duotone-dark span.cm-operator{color:#ffad5c}.cm-s-duotone-dark span.cm-positive{color:#6a51e6}.cm-s-duotone-dark span.cm-string-2,.cm-s-duotone-dark span.cm-type,.cm-s-duotone-dark span.cm-url,.cm-s-duotone-dark span.cm-variable-2,.cm-s-duotone-dark span.cm-variable-3{color:#7a63ee}.cm-s-duotone-dark span.cm-builtin,.cm-s-duotone-dark span.cm-def,.cm-s-duotone-dark span.cm-em,.cm-s-duotone-dark span.cm-header,.cm-s-duotone-dark span.cm-qualifier,.cm-s-duotone-dark span.cm-tag{color:#eeebff}.cm-s-duotone-dark span.cm-bracket,.cm-s-duotone-dark span.cm-comment{color:#6c6783}.cm-s-duotone-dark span.cm-error,.cm-s-duotone-dark span.cm-invalidchar{color:red}.cm-s-duotone-dark span.cm-header{font-weight:400}.cm-s-duotone-dark .CodeMirror-matchingbracket{color:#eeebff!important;text-decoration:underline}
dist/editor-themes/duotone-light.css 0000644 00000003531 15153464547 0013574 0 ustar 00 .cm-s-duotone-light.CodeMirror{background:#faf8f5;color:#b29762}.cm-s-duotone-light div.CodeMirror-selected{background:#e3dcce!important}.cm-s-duotone-light .CodeMirror-gutters{background:#faf8f5;border-right:0}.cm-s-duotone-light .CodeMirror-linenumber{color:#cdc4b1}.cm-s-duotone-light .CodeMirror-cursor{border-left:1px solid #93abdc;border-right:.5em solid #93abdc;opacity:.5}.cm-s-duotone-light .CodeMirror-activeline-background{background:#e3dcce;opacity:.5}.cm-s-duotone-light .cm-fat-cursor .CodeMirror-cursor{background:#93abdc;opacity:.5}.cm-s-duotone-light span.cm-atom,.cm-s-duotone-light span.cm-attribute,.cm-s-duotone-light span.cm-keyword,.cm-s-duotone-light span.cm-number,.cm-s-duotone-light span.cm-quote,.cm-s-duotone-light span.cm-variable,.cm-s-duotone-light-light span.cm-hr,.cm-s-duotone-light-light span.cm-link{color:#063289}.cm-s-duotone-light span.cm-property{color:#b29762}.cm-s-duotone-light span.cm-negative,.cm-s-duotone-light span.cm-punctuation,.cm-s-duotone-light span.cm-unit{color:#063289}.cm-s-duotone-light span.cm-operator,.cm-s-duotone-light span.cm-string{color:#1659df}.cm-s-duotone-light span.cm-positive,.cm-s-duotone-light span.cm-string-2,.cm-s-duotone-light span.cm-type,.cm-s-duotone-light span.cm-url,.cm-s-duotone-light span.cm-variable-2,.cm-s-duotone-light span.cm-variable-3{color:#896724}.cm-s-duotone-light span.cm-builtin,.cm-s-duotone-light span.cm-def,.cm-s-duotone-light span.cm-em,.cm-s-duotone-light span.cm-header,.cm-s-duotone-light span.cm-qualifier,.cm-s-duotone-light span.cm-tag{color:#2d2006}.cm-s-duotone-light span.cm-bracket,.cm-s-duotone-light span.cm-comment{color:#b6ad9a}.cm-s-duotone-light span.cm-error,.cm-s-duotone-light span.cm-invalidchar{color:red}.cm-s-duotone-light span.cm-header{font-weight:400}.cm-s-duotone-light .CodeMirror-matchingbracket{color:#faf8f5!important;text-decoration:underline}
dist/editor-themes/eclipse.css 0000644 00000001772 15153464547 0012443 0 ustar 00 .cm-s-eclipse span.cm-meta{color:#ff1717}.cm-s-eclipse span.cm-keyword{color:#7f0055;font-weight:700;line-height:1em}.cm-s-eclipse span.cm-atom{color:#219}.cm-s-eclipse span.cm-number{color:#164}.cm-s-eclipse span.cm-def{color:#00f}.cm-s-eclipse span.cm-variable{color:#000}.cm-s-eclipse span.cm-type,.cm-s-eclipse span.cm-variable-2,.cm-s-eclipse span.cm-variable-3{color:#0000c0}.cm-s-eclipse span.cm-operator,.cm-s-eclipse span.cm-property{color:#000}.cm-s-eclipse span.cm-comment{color:#3f7f5f}.cm-s-eclipse span.cm-string{color:#2a00ff}.cm-s-eclipse span.cm-string-2{color:#f50}.cm-s-eclipse span.cm-qualifier{color:#555}.cm-s-eclipse span.cm-builtin{color:#30a}.cm-s-eclipse span.cm-bracket{color:#cc7}.cm-s-eclipse span.cm-tag{color:#170}.cm-s-eclipse span.cm-attribute{color:#00c}.cm-s-eclipse span.cm-link{color:#219}.cm-s-eclipse span.cm-error{color:red}.cm-s-eclipse .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-eclipse .CodeMirror-matchingbracket{color:#000!important;outline:1px solid grey}
dist/editor-themes/elegant.css 0000644 00000001270 15153464547 0012427 0 ustar 00 .cm-s-elegant span.cm-atom,.cm-s-elegant span.cm-number,.cm-s-elegant span.cm-string{color:#762}.cm-s-elegant span.cm-comment{color:#262;font-style:italic;line-height:1em}.cm-s-elegant span.cm-meta{color:#555;font-style:italic;line-height:1em}.cm-s-elegant span.cm-variable{color:#000}.cm-s-elegant span.cm-variable-2{color:#b11}.cm-s-elegant span.cm-qualifier{color:#555}.cm-s-elegant span.cm-keyword{color:#730}.cm-s-elegant span.cm-builtin{color:#30a}.cm-s-elegant span.cm-link{color:#762}.cm-s-elegant span.cm-error{background-color:#fdd}.cm-s-elegant .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-elegant .CodeMirror-matchingbracket{color:#000!important;outline:1px solid grey}
dist/editor-themes/erlang-dark.css 0000644 00000003654 15153464547 0013207 0 ustar 00 .cm-s-erlang-dark.CodeMirror{background:#002240;color:#fff}.cm-s-erlang-dark div.CodeMirror-selected{background:#b36539}.cm-s-erlang-dark .CodeMirror-line::selection,.cm-s-erlang-dark .CodeMirror-line>span::selection,.cm-s-erlang-dark .CodeMirror-line>span>span::selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-line::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span::-moz-selection,.cm-s-erlang-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(179,101,57,.99)}.cm-s-erlang-dark .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-erlang-dark .CodeMirror-guttermarker{color:#fff}.cm-s-erlang-dark .CodeMirror-guttermarker-subtle,.cm-s-erlang-dark .CodeMirror-linenumber{color:#d0d0d0}.cm-s-erlang-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-erlang-dark span.cm-quote{color:#ccc}.cm-s-erlang-dark span.cm-atom{color:#f133f1}.cm-s-erlang-dark span.cm-attribute{color:#ff80e1}.cm-s-erlang-dark span.cm-bracket{color:#ff9d00}.cm-s-erlang-dark span.cm-builtin{color:#eaa}.cm-s-erlang-dark span.cm-comment{color:#77f}.cm-s-erlang-dark span.cm-def{color:#e7a}.cm-s-erlang-dark span.cm-keyword{color:#ffee80}.cm-s-erlang-dark span.cm-meta{color:#50fefe}.cm-s-erlang-dark span.cm-number{color:#ffd0d0}.cm-s-erlang-dark span.cm-operator{color:#d55}.cm-s-erlang-dark span.cm-property,.cm-s-erlang-dark span.cm-qualifier{color:#ccc}.cm-s-erlang-dark span.cm-special{color:#fbb}.cm-s-erlang-dark span.cm-string{color:#3ad900}.cm-s-erlang-dark span.cm-string-2{color:#ccc}.cm-s-erlang-dark span.cm-tag{color:#9effff}.cm-s-erlang-dark span.cm-variable{color:#50fe50}.cm-s-erlang-dark span.cm-variable-2{color:#e0e}.cm-s-erlang-dark span.cm-type,.cm-s-erlang-dark span.cm-variable-3{color:#ccc}.cm-s-erlang-dark span.cm-error{color:#9d1e15}.cm-s-erlang-dark .CodeMirror-activeline-background{background:#013461}.cm-s-erlang-dark .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/gruvbox-dark.css 0000644 00000002641 15153464547 0013426 0 ustar 00 .cm-s-gruvbox-dark .CodeMirror-gutters,.cm-s-gruvbox-dark.CodeMirror{background-color:#282828;color:#bdae93}.cm-s-gruvbox-dark .CodeMirror-gutters{background:#282828;border-right:0}.cm-s-gruvbox-dark .CodeMirror-linenumber{color:#7c6f64}.cm-s-gruvbox-dark .CodeMirror-cursor{border-left:1px solid #ebdbb2}.cm-s-gruvbox-dark .cm-animate-fat-cursor,.cm-s-gruvbox-dark.cm-fat-cursor .CodeMirror-cursor{background-color:#8e8d8875!important}.cm-s-gruvbox-dark div.CodeMirror-selected{background:#928374}.cm-s-gruvbox-dark span.cm-meta{color:#83a598}.cm-s-gruvbox-dark span.cm-comment{color:#928374}.cm-s-gruvbox-dark span.cm-number,span.cm-atom{color:#d3869b}.cm-s-gruvbox-dark span.cm-keyword{color:#f84934}.cm-s-gruvbox-dark span.cm-variable,.cm-s-gruvbox-dark span.cm-variable-2{color:#ebdbb2}.cm-s-gruvbox-dark span.cm-type,.cm-s-gruvbox-dark span.cm-variable-3{color:#fabd2f}.cm-s-gruvbox-dark span.cm-callee,.cm-s-gruvbox-dark span.cm-def,.cm-s-gruvbox-dark span.cm-operator,.cm-s-gruvbox-dark span.cm-property{color:#ebdbb2}.cm-s-gruvbox-dark span.cm-string{color:#b8bb26}.cm-s-gruvbox-dark span.cm-attribute,.cm-s-gruvbox-dark span.cm-qualifier,.cm-s-gruvbox-dark span.cm-string-2{color:#8ec07c}.cm-s-gruvbox-dark .CodeMirror-activeline-background{background:#3c3836}.cm-s-gruvbox-dark .CodeMirror-matchingbracket{background:#928374;color:#282828!important}.cm-s-gruvbox-dark span.cm-builtin,.cm-s-gruvbox-dark span.cm-tag{color:#fe8019}
dist/editor-themes/hopscotch.css 0000644 00000002130 15153464547 0012776 0 ustar 00 .cm-s-hopscotch.CodeMirror{background:#322931;color:#d5d3d5}.cm-s-hopscotch div.CodeMirror-selected{background:#433b42!important}.cm-s-hopscotch .CodeMirror-gutters{background:#322931;border-right:0}.cm-s-hopscotch .CodeMirror-linenumber{color:#797379}.cm-s-hopscotch .CodeMirror-cursor{border-left:1px solid #989498!important}.cm-s-hopscotch span.cm-comment{color:#b33508}.cm-s-hopscotch span.cm-atom,.cm-s-hopscotch span.cm-number{color:#c85e7c}.cm-s-hopscotch span.cm-attribute,.cm-s-hopscotch span.cm-property{color:#8fc13e}.cm-s-hopscotch span.cm-keyword{color:#dd464c}.cm-s-hopscotch span.cm-string{color:#fdcc59}.cm-s-hopscotch span.cm-variable{color:#8fc13e}.cm-s-hopscotch span.cm-variable-2{color:#1290bf}.cm-s-hopscotch span.cm-def{color:#fd8b19}.cm-s-hopscotch span.cm-error{background:#dd464c;color:#989498}.cm-s-hopscotch span.cm-bracket{color:#d5d3d5}.cm-s-hopscotch span.cm-tag{color:#dd464c}.cm-s-hopscotch span.cm-link{color:#c85e7c}.cm-s-hopscotch .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}.cm-s-hopscotch .CodeMirror-activeline-background{background:#302020}
dist/editor-themes/icecoder.css 0000644 00000002741 15153464547 0012571 0 ustar 00 .cm-s-icecoder{background:#1d1d1b;color:#666}.cm-s-icecoder span.cm-keyword{color:#eee;font-weight:700}.cm-s-icecoder span.cm-atom{color:#e1c76e}.cm-s-icecoder span.cm-number{color:#6cb5d9}.cm-s-icecoder span.cm-def{color:#b9ca4a}.cm-s-icecoder span.cm-variable{color:#6cb5d9}.cm-s-icecoder span.cm-variable-2{color:#cc1e5c}.cm-s-icecoder span.cm-type,.cm-s-icecoder span.cm-variable-3{color:#f9602c}.cm-s-icecoder span.cm-property{color:#eee}.cm-s-icecoder span.cm-operator{color:#9179bb}.cm-s-icecoder span.cm-comment{color:#97a3aa}.cm-s-icecoder span.cm-string{color:#b9ca4a}.cm-s-icecoder span.cm-string-2{color:#6cb5d9}.cm-s-icecoder span.cm-meta,.cm-s-icecoder span.cm-qualifier{color:#555}.cm-s-icecoder span.cm-builtin{color:#214e7b}.cm-s-icecoder span.cm-bracket{color:#cc7}.cm-s-icecoder span.cm-tag{color:#e8e8e8}.cm-s-icecoder span.cm-attribute{color:#099}.cm-s-icecoder span.cm-header{color:#6a0d6a}.cm-s-icecoder span.cm-quote{color:#186718}.cm-s-icecoder span.cm-hr{color:#888}.cm-s-icecoder span.cm-link{color:#e1c76e}.cm-s-icecoder span.cm-error{color:#d00}.cm-s-icecoder .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-icecoder div.CodeMirror-selected{background:#037;color:#fff}.cm-s-icecoder .CodeMirror-gutters{background:#1d1d1b;border-right:0;min-width:41px}.cm-s-icecoder .CodeMirror-linenumber{color:#555;cursor:default}.cm-s-icecoder .CodeMirror-matchingbracket{background:#555!important;color:#fff!important}.cm-s-icecoder .CodeMirror-activeline-background{background:#000}
dist/editor-themes/idea.css 0000644 00000002410 15153464547 0011707 0 ustar 00 .cm-s-idea span.cm-meta{color:olive}.cm-s-idea span.cm-number{color:#00f}.cm-s-idea span.cm-keyword{color:navy;font-weight:700;line-height:1em}.cm-s-idea span.cm-atom{color:navy;font-weight:700}.cm-s-idea span.cm-def,.cm-s-idea span.cm-operator,.cm-s-idea span.cm-property,.cm-s-idea span.cm-type,.cm-s-idea span.cm-variable,.cm-s-idea span.cm-variable-2,.cm-s-idea span.cm-variable-3{color:#000}.cm-s-idea span.cm-comment{color:grey}.cm-s-idea span.cm-string,.cm-s-idea span.cm-string-2{color:green}.cm-s-idea span.cm-qualifier{color:#555}.cm-s-idea span.cm-error{color:red}.cm-s-idea span.cm-attribute{color:#00f}.cm-s-idea span.cm-tag{color:navy}.cm-s-idea span.cm-link{color:#00f}.cm-s-idea .CodeMirror-activeline-background{background:#fffae3}.cm-s-idea span.cm-builtin{color:#30a}.cm-s-idea span.cm-bracket{color:#cc7}.cm-s-idea{font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,serif}.cm-s-idea .CodeMirror-matchingbracket{color:#000!important;outline:1px solid grey}.CodeMirror-hints.idea{background-color:#ebf3fd!important;color:#616569;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.CodeMirror-hints.idea .CodeMirror-hint-active{background-color:#a2b8c9!important;color:#5c6065!important}
dist/editor-themes/isotope.css 0000644 00000001777 15153464547 0012506 0 ustar 00 .cm-s-isotope.CodeMirror{background:#000;color:#e0e0e0}.cm-s-isotope div.CodeMirror-selected{background:#404040!important}.cm-s-isotope .CodeMirror-gutters{background:#000;border-right:0}.cm-s-isotope .CodeMirror-linenumber{color:grey}.cm-s-isotope .CodeMirror-cursor{border-left:1px solid silver!important}.cm-s-isotope span.cm-comment{color:#30f}.cm-s-isotope span.cm-atom,.cm-s-isotope span.cm-number{color:#c0f}.cm-s-isotope span.cm-attribute,.cm-s-isotope span.cm-property{color:#3f0}.cm-s-isotope span.cm-keyword{color:red}.cm-s-isotope span.cm-string{color:#f09}.cm-s-isotope span.cm-variable{color:#3f0}.cm-s-isotope span.cm-variable-2{color:#06f}.cm-s-isotope span.cm-def{color:#f90}.cm-s-isotope span.cm-error{background:red;color:silver}.cm-s-isotope span.cm-bracket{color:#e0e0e0}.cm-s-isotope span.cm-tag{color:red}.cm-s-isotope span.cm-link{color:#c0f}.cm-s-isotope .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}.cm-s-isotope .CodeMirror-activeline-background{background:#202020}
dist/editor-themes/juejin.css 0000644 00000000700 15153464547 0012271 0 ustar 00 .cm-s-juejin.CodeMirror{background:#f8f9fa}.cm-s-juejin .cm-def,.cm-s-juejin .cm-header{color:#1ba2f0}.cm-s-juejin .cm-comment{color:#009e9d}.cm-s-juejin .cm-attribute,.cm-s-juejin .cm-link,.cm-s-juejin .cm-quote,.cm-s-juejin .cm-strong{color:#fd7741}.cm-s-juejin .cm-builtin,.cm-s-juejin .cm-keyword,.cm-s-juejin .cm-url{color:#bb51b8}.cm-s-juejin .cm-hr{color:#909090}.cm-s-juejin .cm-tag{color:#107000}.cm-s-juejin .cm-variable-2{color:#0050a0}
dist/editor-themes/lesser-dark.css 0000644 00000004272 15153464547 0013231 0 ustar 00 .cm-s-lesser-dark{line-height:1.3em}.cm-s-lesser-dark.CodeMirror{background:#262626;color:#ebefe7;text-shadow:0 -1px 1px #262626}.cm-s-lesser-dark div.CodeMirror-selected{background:#45443b}.cm-s-lesser-dark .CodeMirror-line::selection,.cm-s-lesser-dark .CodeMirror-line>span::selection,.cm-s-lesser-dark .CodeMirror-line>span>span::selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-line::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span::-moz-selection,.cm-s-lesser-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(69,68,59,.99)}.cm-s-lesser-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-lesser-dark pre{padding:0 8px}.cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket{color:#7efc7e}.cm-s-lesser-dark .CodeMirror-gutters{background:#262626;border-right:1px solid #aaa}.cm-s-lesser-dark .CodeMirror-guttermarker{color:#599eff}.cm-s-lesser-dark .CodeMirror-guttermarker-subtle,.cm-s-lesser-dark .CodeMirror-linenumber{color:#777}.cm-s-lesser-dark span.cm-header{color:#a0a}.cm-s-lesser-dark span.cm-quote{color:#090}.cm-s-lesser-dark span.cm-keyword{color:#599eff}.cm-s-lesser-dark span.cm-atom{color:#c2b470}.cm-s-lesser-dark span.cm-number{color:#b35e4d}.cm-s-lesser-dark span.cm-def{color:#fff}.cm-s-lesser-dark span.cm-variable{color:#d9bf8c}.cm-s-lesser-dark span.cm-variable-2{color:#669199}.cm-s-lesser-dark span.cm-type,.cm-s-lesser-dark span.cm-variable-3{color:#fff}.cm-s-lesser-dark span.cm-operator,.cm-s-lesser-dark span.cm-property{color:#92a75c}.cm-s-lesser-dark span.cm-comment{color:#666}.cm-s-lesser-dark span.cm-string{color:#bcd279}.cm-s-lesser-dark span.cm-string-2{color:#f50}.cm-s-lesser-dark span.cm-meta{color:#738c73}.cm-s-lesser-dark span.cm-qualifier{color:#555}.cm-s-lesser-dark span.cm-builtin{color:#ff9e59}.cm-s-lesser-dark span.cm-bracket{color:#ebefe7}.cm-s-lesser-dark span.cm-tag{color:#669199}.cm-s-lesser-dark span.cm-attribute{color:#81a4d5}.cm-s-lesser-dark span.cm-hr{color:#999}.cm-s-lesser-dark span.cm-link{color:#7070e6}.cm-s-lesser-dark span.cm-error{color:#9d1e15}.cm-s-lesser-dark .CodeMirror-activeline-background{background:#3c3a3a}.cm-s-lesser-dark .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/liquibyte.css 0000644 00000006365 15153464547 0013031 0 ustar 00 .cm-s-liquibyte.CodeMirror{background-color:#000;color:#fff;font-size:1em;line-height:1.2em}.cm-s-liquibyte .CodeMirror-focused .cm-matchhighlight{text-decoration:underline;text-decoration-color:#0f0;text-decoration-style:wavy}.cm-s-liquibyte .cm-trailingspace{text-decoration:line-through;text-decoration-color:red;text-decoration-style:dotted}.cm-s-liquibyte .cm-tab{text-decoration:line-through;text-decoration-color:#404040;text-decoration-style:dotted}.cm-s-liquibyte .CodeMirror-gutters{background-color:#262626;border-right:1px solid #505050;padding-right:.8em}.cm-s-liquibyte .CodeMirror-gutter-elt div{font-size:1.2em}.cm-s-liquibyte .CodeMirror-linenumber{color:#606060;padding-left:0}.cm-s-liquibyte .CodeMirror-cursor{border-left:1px solid #eee}.cm-s-liquibyte span.cm-comment{color:green}.cm-s-liquibyte span.cm-def{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-keyword{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-builtin{color:#ffaf40;font-weight:700}.cm-s-liquibyte span.cm-variable{color:#5967ff;font-weight:700}.cm-s-liquibyte span.cm-string{color:#ff8000}.cm-s-liquibyte span.cm-number{color:#0f0;font-weight:700}.cm-s-liquibyte span.cm-atom{color:#bf3030;font-weight:700}.cm-s-liquibyte span.cm-variable-2{color:#007f7f;font-weight:700}.cm-s-liquibyte span.cm-type,.cm-s-liquibyte span.cm-variable-3{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-property{color:#999;font-weight:700}.cm-s-liquibyte span.cm-operator{color:#fff}.cm-s-liquibyte span.cm-meta{color:#0f0}.cm-s-liquibyte span.cm-qualifier{color:#fff700;font-weight:700}.cm-s-liquibyte span.cm-bracket{color:#cc7}.cm-s-liquibyte span.cm-tag{color:#ff0;font-weight:700}.cm-s-liquibyte span.cm-attribute{color:#c080ff;font-weight:700}.cm-s-liquibyte span.cm-error{color:red}.cm-s-liquibyte div.CodeMirror-selected{background-color:rgba(255,0,0,.25)}.cm-s-liquibyte span.cm-compilation{background-color:hsla(0,0%,100%,.12)}.cm-s-liquibyte .CodeMirror-activeline-background{background-color:rgba(0,255,0,.15)}.cm-s-liquibyte .CodeMirror span.CodeMirror-matchingbracket{color:#0f0;font-weight:700}.cm-s-liquibyte .CodeMirror span.CodeMirror-nonmatchingbracket{color:red;font-weight:700}.CodeMirror-matchingtag{background-color:rgba(150,255,0,.3)}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover,.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div:hover{background-color:rgba(80,80,80,.7)}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div,.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div{background-color:rgba(80,80,80,.3);border:1px solid #404040;border-radius:5px}.cm-s-liquibyte div.CodeMirror-simplescroll-vertical div{border-bottom:1px solid #404040;border-top:1px solid #404040}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div{border-left:1px solid #404040;border-right:1px solid #404040}.cm-s-liquibyte div.CodeMirror-simplescroll-vertical{background-color:#262626}.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal{background-color:#262626;border-top:1px solid #404040}.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div,div.CodeMirror-overlayscroll-vertical div{background-color:#404040;border-radius:5px}.cm-s-liquibyte div.CodeMirror-overlayscroll-horizontal div,.cm-s-liquibyte div.CodeMirror-overlayscroll-vertical div{border:1px solid #404040}
dist/editor-themes/lucario.css 0000644 00000003060 15153464547 0012445 0 ustar 00 .cm-s-lucario .CodeMirror-gutters,.cm-s-lucario.CodeMirror{background-color:#2b3e50!important;border:none;color:#f8f8f2!important}.cm-s-lucario .CodeMirror-gutters{color:#2b3e50}.cm-s-lucario .CodeMirror-cursor{border-left:thin solid #e6c845}.cm-s-lucario .CodeMirror-linenumber{color:#f8f8f2}.cm-s-lucario .CodeMirror-selected{background:#243443}.cm-s-lucario .CodeMirror-line::selection,.cm-s-lucario .CodeMirror-line>span::selection,.cm-s-lucario .CodeMirror-line>span>span::selection{background:#243443}.cm-s-lucario .CodeMirror-line::-moz-selection,.cm-s-lucario .CodeMirror-line>span::-moz-selection,.cm-s-lucario .CodeMirror-line>span>span::-moz-selection{background:#243443}.cm-s-lucario span.cm-comment{color:#5c98cd}.cm-s-lucario span.cm-string,.cm-s-lucario span.cm-string-2{color:#e6db74}.cm-s-lucario span.cm-number{color:#ca94ff}.cm-s-lucario span.cm-variable,.cm-s-lucario span.cm-variable-2{color:#f8f8f2}.cm-s-lucario span.cm-def{color:#72c05d}.cm-s-lucario span.cm-operator{color:#66d9ef}.cm-s-lucario span.cm-keyword{color:#ff6541}.cm-s-lucario span.cm-atom{color:#bd93f9}.cm-s-lucario span.cm-meta{color:#f8f8f2}.cm-s-lucario span.cm-tag{color:#ff6541}.cm-s-lucario span.cm-attribute{color:#66d9ef}.cm-s-lucario span.cm-qualifier{color:#72c05d}.cm-s-lucario span.cm-property{color:#f8f8f2}.cm-s-lucario span.cm-builtin{color:#72c05d}.cm-s-lucario span.cm-type,.cm-s-lucario span.cm-variable-3{color:#ffb86c}.cm-s-lucario .CodeMirror-activeline-background{background:#243443}.cm-s-lucario .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/material-darker.css 0000644 00000004035 15153464547 0014056 0 ustar 00 .cm-s-material-darker.CodeMirror{background-color:#212121;color:#eff}.cm-s-material-darker .CodeMirror-gutters{background:#212121;border:none;color:#545454}.cm-s-material-darker .CodeMirror-guttermarker,.cm-s-material-darker .CodeMirror-guttermarker-subtle,.cm-s-material-darker .CodeMirror-linenumber{color:#545454}.cm-s-material-darker .CodeMirror-cursor{border-left:1px solid #fc0}.cm-s-material-darker div.CodeMirror-selected,.cm-s-material-darker.CodeMirror-focused div.CodeMirror-selected{background:rgba(97,97,97,.2)}.cm-s-material-darker .CodeMirror-line::selection,.cm-s-material-darker .CodeMirror-line>span::selection,.cm-s-material-darker .CodeMirror-line>span>span::selection{background:rgba(128,203,196,.2)}.cm-s-material-darker .CodeMirror-line::-moz-selection,.cm-s-material-darker .CodeMirror-line>span::-moz-selection,.cm-s-material-darker .CodeMirror-line>span>span::-moz-selection{background:rgba(128,203,196,.2)}.cm-s-material-darker .CodeMirror-activeline-background{background:rgba(0,0,0,.5)}.cm-s-material-darker .cm-keyword{color:#c792ea}.cm-s-material-darker .cm-operator{color:#89ddff}.cm-s-material-darker .cm-variable-2{color:#eff}.cm-s-material-darker .cm-type,.cm-s-material-darker .cm-variable-3{color:#f07178}.cm-s-material-darker .cm-builtin{color:#ffcb6b}.cm-s-material-darker .cm-atom{color:#f78c6c}.cm-s-material-darker .cm-number{color:#ff5370}.cm-s-material-darker .cm-def{color:#82aaff}.cm-s-material-darker .cm-string{color:#c3e88d}.cm-s-material-darker .cm-string-2{color:#f07178}.cm-s-material-darker .cm-comment{color:#545454}.cm-s-material-darker .cm-variable{color:#f07178}.cm-s-material-darker .cm-tag{color:#ff5370}.cm-s-material-darker .cm-meta{color:#ffcb6b}.cm-s-material-darker .cm-attribute,.cm-s-material-darker .cm-property{color:#c792ea}.cm-s-material-darker .cm-qualifier,.cm-s-material-darker .cm-type,.cm-s-material-darker .cm-variable-3{color:#decb6b}.cm-s-material-darker .cm-error{background-color:#ff5370;color:#fff}.cm-s-material-darker .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/material-ocean.css 0000644 00000004205 15153464547 0013672 0 ustar 00 .cm-s-material-ocean.CodeMirror{background-color:#0f111a;color:#8f93a2}.cm-s-material-ocean .CodeMirror-gutters{background:#0f111a;border:none;color:#464b5d}.cm-s-material-ocean .CodeMirror-guttermarker,.cm-s-material-ocean .CodeMirror-guttermarker-subtle,.cm-s-material-ocean .CodeMirror-linenumber{color:#464b5d}.cm-s-material-ocean .CodeMirror-cursor{border-left:1px solid #fc0}.cm-s-material-ocean .cm-animate-fat-cursor,.cm-s-material-ocean.cm-fat-cursor .CodeMirror-cursor{background-color:#a2a8a175!important}.cm-s-material-ocean div.CodeMirror-selected,.cm-s-material-ocean.CodeMirror-focused div.CodeMirror-selected{background:rgba(113,124,180,.2)}.cm-s-material-ocean .CodeMirror-line::selection,.cm-s-material-ocean .CodeMirror-line>span::selection,.cm-s-material-ocean .CodeMirror-line>span>span::selection{background:rgba(128,203,196,.2)}.cm-s-material-ocean .CodeMirror-line::-moz-selection,.cm-s-material-ocean .CodeMirror-line>span::-moz-selection,.cm-s-material-ocean .CodeMirror-line>span>span::-moz-selection{background:rgba(128,203,196,.2)}.cm-s-material-ocean .CodeMirror-activeline-background{background:rgba(0,0,0,.5)}.cm-s-material-ocean .cm-keyword{color:#c792ea}.cm-s-material-ocean .cm-operator{color:#89ddff}.cm-s-material-ocean .cm-variable-2{color:#eff}.cm-s-material-ocean .cm-type,.cm-s-material-ocean .cm-variable-3{color:#f07178}.cm-s-material-ocean .cm-builtin{color:#ffcb6b}.cm-s-material-ocean .cm-atom{color:#f78c6c}.cm-s-material-ocean .cm-number{color:#ff5370}.cm-s-material-ocean .cm-def{color:#82aaff}.cm-s-material-ocean .cm-string{color:#c3e88d}.cm-s-material-ocean .cm-string-2{color:#f07178}.cm-s-material-ocean .cm-comment{color:#464b5d}.cm-s-material-ocean .cm-variable{color:#f07178}.cm-s-material-ocean .cm-tag{color:#ff5370}.cm-s-material-ocean .cm-meta{color:#ffcb6b}.cm-s-material-ocean .cm-attribute,.cm-s-material-ocean .cm-property{color:#c792ea}.cm-s-material-ocean .cm-qualifier,.cm-s-material-ocean .cm-type,.cm-s-material-ocean .cm-variable-3{color:#decb6b}.cm-s-material-ocean .cm-error{background-color:#ff5370;color:#fff}.cm-s-material-ocean .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/material-palenight.css 0000644 00000004441 15153464547 0014562 0 ustar 00 .cm-s-material-palenight.CodeMirror{background-color:#292d3e;color:#a6accd}.cm-s-material-palenight .CodeMirror-gutters{background:#292d3e;border:none;color:#676e95}.cm-s-material-palenight .CodeMirror-guttermarker,.cm-s-material-palenight .CodeMirror-guttermarker-subtle,.cm-s-material-palenight .CodeMirror-linenumber{color:#676e95}.cm-s-material-palenight .CodeMirror-cursor{border-left:1px solid #fc0}.cm-s-material-palenight .cm-animate-fat-cursor,.cm-s-material-palenight.cm-fat-cursor .CodeMirror-cursor{background-color:#607c8b80!important}.cm-s-material-palenight div.CodeMirror-selected,.cm-s-material-palenight.CodeMirror-focused div.CodeMirror-selected{background:rgba(113,124,180,.2)}.cm-s-material-palenight .CodeMirror-line::selection,.cm-s-material-palenight .CodeMirror-line>span::selection,.cm-s-material-palenight .CodeMirror-line>span>span::selection{background:rgba(128,203,196,.2)}.cm-s-material-palenight .CodeMirror-line::-moz-selection,.cm-s-material-palenight .CodeMirror-line>span::-moz-selection,.cm-s-material-palenight .CodeMirror-line>span>span::-moz-selection{background:rgba(128,203,196,.2)}.cm-s-material-palenight .CodeMirror-activeline-background{background:rgba(0,0,0,.5)}.cm-s-material-palenight .cm-keyword{color:#c792ea}.cm-s-material-palenight .cm-operator{color:#89ddff}.cm-s-material-palenight .cm-variable-2{color:#eff}.cm-s-material-palenight .cm-type,.cm-s-material-palenight .cm-variable-3{color:#f07178}.cm-s-material-palenight .cm-builtin{color:#ffcb6b}.cm-s-material-palenight .cm-atom{color:#f78c6c}.cm-s-material-palenight .cm-number{color:#ff5370}.cm-s-material-palenight .cm-def{color:#82aaff}.cm-s-material-palenight .cm-string{color:#c3e88d}.cm-s-material-palenight .cm-string-2{color:#f07178}.cm-s-material-palenight .cm-comment{color:#676e95}.cm-s-material-palenight .cm-variable{color:#f07178}.cm-s-material-palenight .cm-tag{color:#ff5370}.cm-s-material-palenight .cm-meta{color:#ffcb6b}.cm-s-material-palenight .cm-attribute,.cm-s-material-palenight .cm-property{color:#c792ea}.cm-s-material-palenight .cm-qualifier,.cm-s-material-palenight .cm-type,.cm-s-material-palenight .cm-variable-3{color:#decb6b}.cm-s-material-palenight .cm-error{background-color:#ff5370;color:#fff}.cm-s-material-palenight .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/material.css 0000644 00000003630 15153464547 0012610 0 ustar 00 .cm-s-material.CodeMirror{background-color:#263238;color:#eff}.cm-s-material .CodeMirror-gutters{background:#263238;border:none;color:#546e7a}.cm-s-material .CodeMirror-guttermarker,.cm-s-material .CodeMirror-guttermarker-subtle,.cm-s-material .CodeMirror-linenumber{color:#546e7a}.cm-s-material .CodeMirror-cursor{border-left:1px solid #fc0}.cm-s-material .cm-animate-fat-cursor,.cm-s-material.cm-fat-cursor .CodeMirror-cursor{background-color:#5d6d5c80!important}.cm-s-material div.CodeMirror-selected,.cm-s-material.CodeMirror-focused div.CodeMirror-selected{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-line::selection,.cm-s-material .CodeMirror-line>span::selection,.cm-s-material .CodeMirror-line>span>span::selection{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-line::-moz-selection,.cm-s-material .CodeMirror-line>span::-moz-selection,.cm-s-material .CodeMirror-line>span>span::-moz-selection{background:rgba(128,203,196,.2)}.cm-s-material .CodeMirror-activeline-background{background:rgba(0,0,0,.5)}.cm-s-material .cm-keyword{color:#c792ea}.cm-s-material .cm-operator{color:#89ddff}.cm-s-material .cm-variable-2{color:#eff}.cm-s-material .cm-type,.cm-s-material .cm-variable-3{color:#f07178}.cm-s-material .cm-builtin{color:#ffcb6b}.cm-s-material .cm-atom{color:#f78c6c}.cm-s-material .cm-number{color:#ff5370}.cm-s-material .cm-def{color:#82aaff}.cm-s-material .cm-string{color:#c3e88d}.cm-s-material .cm-string-2{color:#f07178}.cm-s-material .cm-comment{color:#546e7a}.cm-s-material .cm-variable{color:#f07178}.cm-s-material .cm-tag{color:#ff5370}.cm-s-material .cm-meta{color:#ffcb6b}.cm-s-material .cm-attribute,.cm-s-material .cm-property{color:#c792ea}.cm-s-material .cm-qualifier,.cm-s-material .cm-type,.cm-s-material .cm-variable-3{color:#decb6b}.cm-s-material .cm-error{background-color:#ff5370;color:#fff}.cm-s-material .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/mbo.css 0000644 00000003004 15153464547 0011562 0 ustar 00 .cm-s-mbo.CodeMirror{background:#2c2c2c;color:#ffffec}.cm-s-mbo div.CodeMirror-selected{background:#716c62}.cm-s-mbo .CodeMirror-line::selection,.cm-s-mbo .CodeMirror-line>span::selection,.cm-s-mbo .CodeMirror-line>span>span::selection{background:hsla(40,7%,41%,.99)}.cm-s-mbo .CodeMirror-line::-moz-selection,.cm-s-mbo .CodeMirror-line>span::-moz-selection,.cm-s-mbo .CodeMirror-line>span>span::-moz-selection{background:hsla(40,7%,41%,.99)}.cm-s-mbo .CodeMirror-gutters{background:#4e4e4e;border-right:0}.cm-s-mbo .CodeMirror-guttermarker{color:#fff}.cm-s-mbo .CodeMirror-guttermarker-subtle{color:grey}.cm-s-mbo .CodeMirror-linenumber{color:#dadada}.cm-s-mbo .CodeMirror-cursor{border-left:1px solid #ffffec}.cm-s-mbo span.cm-comment{color:#95958a}.cm-s-mbo span.cm-atom,.cm-s-mbo span.cm-number{color:#00a8c6}.cm-s-mbo span.cm-attribute,.cm-s-mbo span.cm-property{color:#9ddfe9}.cm-s-mbo span.cm-keyword{color:#ffb928}.cm-s-mbo span.cm-string{color:#ffcf6c}.cm-s-mbo span.cm-string.cm-property,.cm-s-mbo span.cm-variable{color:#ffffec}.cm-s-mbo span.cm-variable-2{color:#00a8c6}.cm-s-mbo span.cm-def{color:#ffffec}.cm-s-mbo span.cm-bracket{color:#fffffc;font-weight:700}.cm-s-mbo span.cm-tag{color:#9ddfe9}.cm-s-mbo span.cm-link{color:#f54b07}.cm-s-mbo span.cm-error{border-bottom:#636363;color:#ffffec}.cm-s-mbo span.cm-qualifier{color:#ffffec}.cm-s-mbo .CodeMirror-activeline-background{background:#494b41}.cm-s-mbo .CodeMirror-matchingbracket{color:#ffb928!important}.cm-s-mbo .CodeMirror-matchingtag{background:hsla(0,0%,100%,.37)}
dist/editor-themes/mdn-like.css 0000644 00000011013 15153464547 0012504 0 ustar 00 .cm-s-mdn-like.CodeMirror{background-color:#fff;color:#999}.cm-s-mdn-like div.CodeMirror-selected{background:#cfc}.cm-s-mdn-like .CodeMirror-line::selection,.cm-s-mdn-like .CodeMirror-line>span::selection,.cm-s-mdn-like .CodeMirror-line>span>span::selection{background:#cfc}.cm-s-mdn-like .CodeMirror-line::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span::-moz-selection,.cm-s-mdn-like .CodeMirror-line>span>span::-moz-selection{background:#cfc}.cm-s-mdn-like .CodeMirror-gutters{background:#f8f8f8;border-left:6px solid rgba(0,83,159,.65);color:#333}.cm-s-mdn-like .CodeMirror-linenumber{color:#aaa;padding-left:8px}.cm-s-mdn-like .CodeMirror-cursor{border-left:2px solid #222}.cm-s-mdn-like .cm-keyword{color:#6262ff}.cm-s-mdn-like .cm-atom{color:#f90}.cm-s-mdn-like .cm-number{color:#ca7841}.cm-s-mdn-like .cm-def{color:#8da6ce}.cm-s-mdn-like span.cm-tag,.cm-s-mdn-like span.cm-variable-2{color:#690}.cm-s-mdn-like .cm-variable,.cm-s-mdn-like span.cm-def,.cm-s-mdn-like span.cm-type,.cm-s-mdn-like span.cm-variable-3{color:#07a}.cm-s-mdn-like .cm-property{color:#905}.cm-s-mdn-like .cm-qualifier{color:#690}.cm-s-mdn-like .cm-operator{color:#cda869}.cm-s-mdn-like .cm-comment{color:#777;font-weight:400}.cm-s-mdn-like .cm-string{color:#07a;font-style:italic}.cm-s-mdn-like .cm-string-2{color:#bd6b18}.cm-s-mdn-like .cm-meta{color:#000}.cm-s-mdn-like .cm-builtin{color:#9b7536}.cm-s-mdn-like .cm-tag{color:#997643}.cm-s-mdn-like .cm-attribute{color:#d6bb6d}.cm-s-mdn-like .cm-header{color:#ff6400}.cm-s-mdn-like .cm-hr{color:#aeaeae}.cm-s-mdn-like .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-mdn-like .cm-error{border-bottom:1px solid red}div.cm-s-mdn-like .CodeMirror-activeline-background{background:#efefff}div.cm-s-mdn-like span.CodeMirror-matchingbracket{color:inherit;outline:1px solid grey}.cm-s-mdn-like.CodeMirror{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAAAyCAYAAAAp8UeFAAAHvklEQVR42s2b63bcNgyEQZCSHCdt2vd/0tWF7I+Q6XgMXiTtuvU5Pl57ZQKkKHzEAOtF5KeIJBGJ8uvL599FRFREZhFx8DeXv8trn68RuGaC8TRfo3SNp9dlDDHedyLyTUTeRWStXKPZrjtpZxaRw5hPqozRs1N8/enzIiQRWcCgy4MUA0f+XWliDhyL8Lfyvx7ei/Ae3iQFHyw7U/59pQVIMEEPEz0G7XiwdRjzSfC3UTtz9vchIntxvry5iMgfIhJoEflOz2CQr3F5h/HfeFe+GTdLaKcu9L8LTeQb/R/7GgbsfKedyNdoHsN31uRPWrfZ5wsj/NzzRQHuToIdU3ahwnsKPxXCjJITuOsi7XLc7SG/v5GdALs7wf8JjTFiB5+QvTEfRyGOfX3Lrx8wxyQi3sNq46O7QahQiCsRFgqddjBouVEHOKDgXAQHD9gJCr5sMKkEdjwsarG/ww3BMHBU7OBjXnzdyY7SfCxf5/z6ATccrwlKuwC/jhznnPF4CgVzhhVf4xp2EixcBActO75iZ8/fM9zAs2OMzKdslgXWJ9XG8PQoOAMA5fGcsvORgv0doBXyHrCwfLJAOwo71QLNkb8n2Pl6EWiR7OCibtkPaz4Kc/0NNAze2gju3zOwekALDaCFPI5vjPFmgGY5AZqyGEvH1x7QfIb8YtxMnA/b+QQ0aQDAwc6JMFg8CbQZ4qoYEEHbRwNojuK3EHwd7VALSgq+MNDKzfT58T8qdpADrgW0GmgcAS1lhzztJmkAzcPNOQbsWEALBDSlMKUG0Eq4CLAQWvEVQ9WU57gZJwZtgPO3r9oBTQ9WO8TjqXINx8R0EYpiZEUWOF3FxkbJkgU9B2f41YBrIj5ZfsQa0M5kTgiAAqM3ShXLgu8XMqcrQBvJ0CL5pnTsfMB13oB8athpAq2XOQmcGmoACCLydx7nToa23ATaSIY2ichfOdPTGxlasXMLaL0MLZAOwAKIM+y8CmicobGdCcbbK9DzN+yYGVoNNI5iUKTMyYOjPse4A8SM1MmcXgU0toOq1yO/v8FOxlASyc7TgeYaAMBJHcY1CcCwGI/TK4AmDbDyKYBBtFUkRwto8gygiQEaByFgJ00BH2M8JWwQS1nafDXQCidWyOI8AcjDCSjCLk8ngObuAm3JAHAdubAmOaK06V8MNEsKPJOhobSprwQa6gD7DclRQdqcwL4zxqgBrQcabUiBLclRDKAlWp+etPkBaNMA0AKlrHwTdEByZAA4GM+SNluSY6wAzcMNewxmgig5Ks0nkrSpBvSaQHMdKTBAnLojOdYyGpQ254602ZILPdTD1hdlggdIm74jbTp8vDwF5ZYUeLWGJpWsh6XNyXgcYwVoJQTEhhTYkxzZjiU5npU2TaB979TQehlaAVq4kaGpiPwwwLkYUuBbQwocyQTv1tA0+1UFWoJF3iv1oq+qoSk8EQdJmwHkziIF7oOZk14EGitibAdjLYYK78H5vZOhtWpoI0ATGHs0Q8OMb4Ey+2bU2UYztCtA0wFAs7TplGLRVQCcqaFdGSPCeTI1QNIC52iWNzof6Uib7xjEp07mNNoUYmVosVItHrHzRlLgBn9LFyRHaQCtVUMbtTNhoXWiTOO9k/V8BdAc1Oq0ArSQs6/5SU0hckNy9NnXqQY0PGYo5dWJ7nINaN6o958FWin27aBaWRka1r5myvLOAm0j30eBJqCxHLReVclxhxOEN2JfDWjxBtAC7MIH1fVaGdoOp4qJYDgKtKPSFNID2gSnGldrCqkFZ+5UeQXQBIRrSwocbdZYQT/2LwRahBPBXoHrB8nxaGROST62DKUbQOMMzZIC9abkuELfQzQALWTnDNAm8KHWFOJgJ5+SHIvTPcmx1xQyZRhNL5Qci689aXMEaN/uNIWkEwDAvFpOZmgsBaaGnbs1NPa1Jm32gBZAIh1pCtG7TSH4aE0y1uVY4uqoFPisGlpP2rSA5qTecWn5agK6BzSpgAyD+wFaqhnYoSZ1Vwr8CmlTQbrcO3ZaX0NAEyMbYaAlyquFoLKK3SPby9CeVUPThrSJmkCAE0CrKUQadi4DrdSlWhmah0YL9z9vClH59YGbHx1J8VZTyAjQepJjmXwAKTDQI3omc3p1U4gDUf6RfcdYfrUp5ClAi2J3Ba6UOXGo+K+bQrjjssitG2SJzshaLwMtXgRagUNpYYoVkMSBLM+9GGiJZMvduG6DRZ4qc04DMPtQQxOjEtACmhO7K1AbNbQDEggZyJwscFpAGwENhoBeUwh3bWolhe8BTYVKxQEWrSUn/uhcM5KhvUu/+eQu0Lzhi+VrK0PrZZNDQKs9cpYUuFYgMVpD4/NxenJTiMCNqdUEUf1qZWjppLT5qSkkUZbCwkbZMSuVnu80hfSkzRbQeqCZSAh6huR4VtoM2gHAlLf72smuWgE+VV7XpE25Ab2WFDgyhnSuKbs4GuGzCjR+tIoUuMFg3kgcWKLTwRqanJQ2W00hAsenfaApRC42hbCvK1SlE0HtE9BGgneJO+ELamitD1YjjOYnNYVcraGhtKkW0EqVVeDx733I2NH581k1NNxNLG0i0IJ8/NjVaOZ0tYZ2Vtr0Xv7tPV3hkWp9EFkgS/J0vosngTaSoaG06WHi+xObQkaAdlbanP8B2+2l0f90LmUAAAAASUVORK5CYII=)}
dist/editor-themes/midnight.css 0000644 00000003000 15153464547 0012604 0 ustar 00 .cm-s-midnight .CodeMirror-activeline-background{background:#253540}.cm-s-midnight.CodeMirror{background:#0f192a;color:#d1edff}.cm-s-midnight div.CodeMirror-selected{background:#314d67}.cm-s-midnight .CodeMirror-line::selection,.cm-s-midnight .CodeMirror-line>span::selection,.cm-s-midnight .CodeMirror-line>span>span::selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-line::-moz-selection,.cm-s-midnight .CodeMirror-line>span::-moz-selection,.cm-s-midnight .CodeMirror-line>span>span::-moz-selection{background:rgba(49,77,103,.99)}.cm-s-midnight .CodeMirror-gutters{background:#0f192a;border-right:1px solid}.cm-s-midnight .CodeMirror-guttermarker{color:#fff}.cm-s-midnight .CodeMirror-guttermarker-subtle,.cm-s-midnight .CodeMirror-linenumber{color:#d0d0d0}.cm-s-midnight .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-midnight span.cm-comment{color:#428bdd}.cm-s-midnight span.cm-atom{color:#ae81ff}.cm-s-midnight span.cm-number{color:#d1edff}.cm-s-midnight span.cm-attribute,.cm-s-midnight span.cm-property{color:#a6e22e}.cm-s-midnight span.cm-keyword{color:#e83737}.cm-s-midnight span.cm-string{color:#1dc116}.cm-s-midnight span.cm-variable,.cm-s-midnight span.cm-variable-2{color:#ffaa3e}.cm-s-midnight span.cm-def{color:#4dd}.cm-s-midnight span.cm-bracket{color:#d1edff}.cm-s-midnight span.cm-tag{color:#449}.cm-s-midnight span.cm-link{color:#ae81ff}.cm-s-midnight span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-midnight .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/monokai.css 0000644 00000003505 15153464547 0012450 0 ustar 00 .cm-s-monokai.CodeMirror{background:#272822;color:#f8f8f2}.cm-s-monokai div.CodeMirror-selected{background:#49483e}.cm-s-monokai .CodeMirror-line::selection,.cm-s-monokai .CodeMirror-line>span::selection,.cm-s-monokai .CodeMirror-line>span>span::selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-line::-moz-selection,.cm-s-monokai .CodeMirror-line>span::-moz-selection,.cm-s-monokai .CodeMirror-line>span>span::-moz-selection{background:rgba(73,72,62,.99)}.cm-s-monokai .CodeMirror-gutters{background:#272822;border-right:0}.cm-s-monokai .CodeMirror-guttermarker{color:#fff}.cm-s-monokai .CodeMirror-guttermarker-subtle,.cm-s-monokai .CodeMirror-linenumber{color:#d0d0d0}.cm-s-monokai .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-monokai span.cm-comment{color:#75715e}.cm-s-monokai span.cm-atom,.cm-s-monokai span.cm-number{color:#ae81ff}.cm-s-monokai span.cm-comment.cm-attribute{color:#97b757}.cm-s-monokai span.cm-comment.cm-def{color:#bc9262}.cm-s-monokai span.cm-comment.cm-tag{color:#bc6283}.cm-s-monokai span.cm-comment.cm-type{color:#5998a6}.cm-s-monokai span.cm-attribute,.cm-s-monokai span.cm-property{color:#a6e22e}.cm-s-monokai span.cm-keyword{color:#f92672}.cm-s-monokai span.cm-builtin{color:#66d9ef}.cm-s-monokai span.cm-string{color:#e6db74}.cm-s-monokai span.cm-variable{color:#f8f8f2}.cm-s-monokai span.cm-variable-2{color:#9effff}.cm-s-monokai span.cm-type,.cm-s-monokai span.cm-variable-3{color:#66d9ef}.cm-s-monokai span.cm-def{color:#fd971f}.cm-s-monokai span.cm-bracket{color:#f8f8f2}.cm-s-monokai span.cm-tag{color:#f92672}.cm-s-monokai span.cm-header,.cm-s-monokai span.cm-link{color:#ae81ff}.cm-s-monokai span.cm-error{background:#f92672;color:#f8f8f0}.cm-s-monokai .CodeMirror-activeline-background{background:#373831}.cm-s-monokai .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/moxer.css 0000644 00000003474 15153464547 0012152 0 ustar 00 .cm-s-moxer.CodeMirror{background-color:#090a0f;color:#8e95b4;line-height:1.8}.cm-s-moxer .CodeMirror-gutters{background:#090a0f;border:none;color:#35394b}.cm-s-moxer .CodeMirror-guttermarker,.cm-s-moxer .CodeMirror-guttermarker-subtle,.cm-s-moxer .CodeMirror-linenumber{color:#35394b}.cm-s-moxer .CodeMirror-cursor{border-left:1px solid #fc0}.cm-s-moxer div.CodeMirror-selected{background:rgba(128,203,196,.2)}.cm-s-moxer.CodeMirror-focused div.CodeMirror-selected{background:#212431}.cm-s-moxer .CodeMirror-line::selection,.cm-s-moxer .CodeMirror-line>span::selection,.cm-s-moxer .CodeMirror-line>span>span::selection{background:#212431}.cm-s-moxer .CodeMirror-line::-moz-selection,.cm-s-moxer .CodeMirror-line>span::-moz-selection,.cm-s-moxer .CodeMirror-line>span>span::-moz-selection{background:#212431}.cm-s-moxer .CodeMirror-activeline-background,.cm-s-moxer .CodeMirror-activeline-gutter .CodeMirror-linenumber{background:rgba(33,36,49,.5)}.cm-s-moxer .cm-keyword,.cm-s-moxer .cm-operator{color:#d46c6c}.cm-s-moxer .cm-variable-2{color:#81c5da}.cm-s-moxer .cm-type,.cm-s-moxer .cm-variable-3{color:#f07178}.cm-s-moxer .cm-builtin{color:#ffcb6b}.cm-s-moxer .cm-atom{color:#a99be2}.cm-s-moxer .cm-number{color:#7ca4c0}.cm-s-moxer .cm-def{color:#f5dfa5}.cm-s-moxer .CodeMirror-line .cm-def~.cm-def{color:#81c5da}.cm-s-moxer .cm-string{color:#b2e4ae}.cm-s-moxer .cm-string-2{color:#f07178}.cm-s-moxer .cm-comment{color:#3f445a}.cm-s-moxer .cm-variable{color:#8e95b4}.cm-s-moxer .cm-tag{color:#ff5370}.cm-s-moxer .cm-meta{color:#ffcb6b}.cm-s-moxer .cm-attribute{color:#c792ea}.cm-s-moxer .cm-property{color:#81c5da}.cm-s-moxer .cm-qualifier,.cm-s-moxer .cm-type,.cm-s-moxer .cm-variable-3{color:#decb6b}.cm-s-moxer .cm-error{background-color:#ff5370;color:#fff}.cm-s-moxer .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/neat.css 0000644 00000001133 15153464547 0011735 0 ustar 00 .cm-s-neat span.cm-comment{color:#a86}.cm-s-neat span.cm-keyword{color:blue;font-weight:700;line-height:1em}.cm-s-neat span.cm-string{color:#a22}.cm-s-neat span.cm-builtin{color:#077;font-weight:700;line-height:1em}.cm-s-neat span.cm-special{color:#0aa;font-weight:700;line-height:1em}.cm-s-neat span.cm-variable{color:#000}.cm-s-neat span.cm-atom,.cm-s-neat span.cm-number{color:#3a3}.cm-s-neat span.cm-meta{color:#555}.cm-s-neat span.cm-link{color:#3a3}.cm-s-neat .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-neat .CodeMirror-matchingbracket{color:#000!important;outline:1px solid grey}
dist/editor-themes/neo.css 0000644 00000001365 15153464547 0011576 0 ustar 00 .cm-s-neo.CodeMirror{background-color:#fff;color:#2e383c;line-height:1.4375}.cm-s-neo .cm-comment{color:#75787b}.cm-s-neo .cm-keyword,.cm-s-neo .cm-property{color:#1d75b3}.cm-s-neo .cm-atom,.cm-s-neo .cm-number{color:#75438a}.cm-s-neo .cm-node,.cm-s-neo .cm-tag{color:#9c3328}.cm-s-neo .cm-string{color:#b35e14}.cm-s-neo .cm-qualifier,.cm-s-neo .cm-variable{color:#047d65}.cm-s-neo pre{padding:0}.cm-s-neo .CodeMirror-gutters{background-color:transparent;border:none;border-right:10px solid transparent}.cm-s-neo .CodeMirror-linenumber{color:#e0e2e5;padding:0}.cm-s-neo .CodeMirror-guttermarker{color:#1d75b3}.cm-s-neo .CodeMirror-guttermarker-subtle{color:#e0e2e5}.cm-s-neo .CodeMirror-cursor{background:hsla(223,4%,62%,.37);border:0;width:auto;z-index:1}
dist/editor-themes/night.css 0000644 00000002757 15153464547 0012134 0 ustar 00 .cm-s-night.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-night div.CodeMirror-selected{background:#447}.cm-s-night .CodeMirror-line::selection,.cm-s-night .CodeMirror-line>span::selection,.cm-s-night .CodeMirror-line>span>span::selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-line::-moz-selection,.cm-s-night .CodeMirror-line>span::-moz-selection,.cm-s-night .CodeMirror-line>span>span::-moz-selection{background:rgba(68,68,119,.99)}.cm-s-night .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-night .CodeMirror-guttermarker{color:#fff}.cm-s-night .CodeMirror-guttermarker-subtle{color:#bbb}.cm-s-night .CodeMirror-linenumber{color:#f8f8f8}.cm-s-night .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-night span.cm-comment{color:#8900d1}.cm-s-night span.cm-atom{color:#845dc4}.cm-s-night span.cm-attribute,.cm-s-night span.cm-number{color:#ffd500}.cm-s-night span.cm-keyword{color:#599eff}.cm-s-night span.cm-string{color:#37f14a}.cm-s-night span.cm-meta{color:#7678e2}.cm-s-night span.cm-tag,.cm-s-night span.cm-variable-2{color:#99b2ff}.cm-s-night span.cm-def,.cm-s-night span.cm-type,.cm-s-night span.cm-variable-3{color:#fff}.cm-s-night span.cm-bracket{color:#8da6ce}.cm-s-night span.cm-builtin,.cm-s-night span.cm-special{color:#ff9e59}.cm-s-night span.cm-link{color:#845dc4}.cm-s-night span.cm-error{color:#9d1e15}.cm-s-night .CodeMirror-activeline-background{background:#1c005a}.cm-s-night .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/nord.css 0000644 00000003213 15153464547 0011751 0 ustar 00 .cm-s-nord.CodeMirror{background:#2e3440;color:#d8dee9}.cm-s-nord div.CodeMirror-selected{background:#434c5e}.cm-s-nord .CodeMirror-line::selection,.cm-s-nord .CodeMirror-line>span::selection,.cm-s-nord .CodeMirror-line>span>span::selection{background:#3b4252}.cm-s-nord .CodeMirror-line::-moz-selection,.cm-s-nord .CodeMirror-line>span::-moz-selection,.cm-s-nord .CodeMirror-line>span>span::-moz-selection{background:#3b4252}.cm-s-nord .CodeMirror-gutters{background:#2e3440;border-right:0}.cm-s-nord .CodeMirror-guttermarker,.cm-s-nord .CodeMirror-guttermarker-subtle,.cm-s-nord .CodeMirror-linenumber{color:#4c566a}.cm-s-nord .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-nord span.cm-comment{color:#4c566a}.cm-s-nord span.cm-atom,.cm-s-nord span.cm-number{color:#b48ead}.cm-s-nord span.cm-comment.cm-attribute{color:#97b757}.cm-s-nord span.cm-comment.cm-def{color:#bc9262}.cm-s-nord span.cm-comment.cm-tag{color:#bc6283}.cm-s-nord span.cm-comment.cm-type{color:#5998a6}.cm-s-nord span.cm-attribute,.cm-s-nord span.cm-property{color:#8fbcbb}.cm-s-nord span.cm-builtin,.cm-s-nord span.cm-keyword{color:#81a1c1}.cm-s-nord span.cm-string{color:#a3be8c}.cm-s-nord span.cm-type,.cm-s-nord span.cm-variable,.cm-s-nord span.cm-variable-2,.cm-s-nord span.cm-variable-3{color:#d8dee9}.cm-s-nord span.cm-def{color:#8fbcbb}.cm-s-nord span.cm-bracket{color:#81a1c1}.cm-s-nord span.cm-tag{color:#bf616a}.cm-s-nord span.cm-header,.cm-s-nord span.cm-link{color:#b48ead}.cm-s-nord span.cm-error{background:#bf616a;color:#f8f8f0}.cm-s-nord .CodeMirror-activeline-background{background:#3b4252}.cm-s-nord .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/oceanic-next.css 0000644 00000003600 15153464547 0013364 0 ustar 00 .cm-s-oceanic-next.CodeMirror{background:#304148;color:#f8f8f2}.cm-s-oceanic-next div.CodeMirror-selected{background:rgba(101,115,126,.33)}.cm-s-oceanic-next .CodeMirror-line::selection,.cm-s-oceanic-next .CodeMirror-line>span::selection,.cm-s-oceanic-next .CodeMirror-line>span>span::selection{background:rgba(101,115,126,.33)}.cm-s-oceanic-next .CodeMirror-line::-moz-selection,.cm-s-oceanic-next .CodeMirror-line>span::-moz-selection,.cm-s-oceanic-next .CodeMirror-line>span>span::-moz-selection{background:rgba(101,115,126,.33)}.cm-s-oceanic-next .CodeMirror-gutters{background:#304148;border-right:10px}.cm-s-oceanic-next .CodeMirror-guttermarker{color:#fff}.cm-s-oceanic-next .CodeMirror-guttermarker-subtle,.cm-s-oceanic-next .CodeMirror-linenumber{color:#d0d0d0}.cm-s-oceanic-next .CodeMirror-cursor{border-left:1px solid #f8f8f0}.cm-s-oceanic-next .cm-animate-fat-cursor,.cm-s-oceanic-next.cm-fat-cursor .CodeMirror-cursor{background-color:#a2a8a175!important}.cm-s-oceanic-next span.cm-comment{color:#65737e}.cm-s-oceanic-next span.cm-atom{color:#c594c5}.cm-s-oceanic-next span.cm-number{color:#f99157}.cm-s-oceanic-next span.cm-property{color:#99c794}.cm-s-oceanic-next span.cm-attribute,.cm-s-oceanic-next span.cm-keyword{color:#c594c5}.cm-s-oceanic-next span.cm-builtin{color:#66d9ef}.cm-s-oceanic-next span.cm-string{color:#99c794}.cm-s-oceanic-next span.cm-variable,.cm-s-oceanic-next span.cm-variable-2,.cm-s-oceanic-next span.cm-variable-3{color:#f8f8f2}.cm-s-oceanic-next span.cm-def{color:#69c}.cm-s-oceanic-next span.cm-bracket{color:#5fb3b3}.cm-s-oceanic-next span.cm-header,.cm-s-oceanic-next span.cm-link,.cm-s-oceanic-next span.cm-tag{color:#c594c5}.cm-s-oceanic-next span.cm-error{background:#c594c5;color:#f8f8f0}.cm-s-oceanic-next .CodeMirror-activeline-background{background:rgba(101,115,126,.33)}.cm-s-oceanic-next .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/panda-syntax.css 0000644 00000002521 15153464547 0013417 0 ustar 00 .cm-s-panda-syntax{background:#292a2b;color:#e6e6e6;font-family:Operator Mono,Source Code Pro,Menlo,Monaco,Consolas,Courier New,monospace;line-height:1.5}.cm-s-panda-syntax .CodeMirror-cursor{border-color:#ff2c6d}.cm-s-panda-syntax .CodeMirror-activeline-background{background:rgba(99,123,156,.1)}.cm-s-panda-syntax .CodeMirror-selected{background:#fff}.cm-s-panda-syntax .cm-comment{color:#676b79;font-style:italic}.cm-s-panda-syntax .cm-operator{color:#f3f3f3}.cm-s-panda-syntax .cm-string{color:#19f9d8}.cm-s-panda-syntax .cm-string-2{color:#ffb86c}.cm-s-panda-syntax .cm-tag{color:#ff2c6d}.cm-s-panda-syntax .cm-meta{color:#b084eb}.cm-s-panda-syntax .cm-number{color:#ffb86c}.cm-s-panda-syntax .cm-atom{color:#ff2c6d}.cm-s-panda-syntax .cm-keyword{color:#ff75b5}.cm-s-panda-syntax .cm-variable{color:#ffb86c}.cm-s-panda-syntax .cm-type,.cm-s-panda-syntax .cm-variable-2,.cm-s-panda-syntax .cm-variable-3{color:#ff9ac1}.cm-s-panda-syntax .cm-def{color:#e6e6e6}.cm-s-panda-syntax .cm-property{color:#f3f3f3}.cm-s-panda-syntax .cm-attribute,.cm-s-panda-syntax .cm-unit{color:#ffb86c}.cm-s-panda-syntax .CodeMirror-matchingbracket{border-bottom:1px dotted #19f9d8;color:#e6e6e6;padding-bottom:2px}.cm-s-panda-syntax .CodeMirror-gutters{background:#292a2b;border-right-color:hsla(0,0%,100%,.1)}.cm-s-panda-syntax .CodeMirror-linenumber{color:#e6e6e6;opacity:.6}
dist/editor-themes/paraiso-dark.css 0000644 00000003163 15153464547 0013370 0 ustar 00 .cm-s-paraiso-dark.CodeMirror{background:#2f1e2e;color:#b9b6b0}.cm-s-paraiso-dark div.CodeMirror-selected{background:#41323f}.cm-s-paraiso-dark .CodeMirror-line::selection,.cm-s-paraiso-dark .CodeMirror-line>span::selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-line::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(65,50,63,.99)}.cm-s-paraiso-dark .CodeMirror-gutters{background:#2f1e2e;border-right:0}.cm-s-paraiso-dark .CodeMirror-guttermarker{color:#ef6155}.cm-s-paraiso-dark .CodeMirror-guttermarker-subtle,.cm-s-paraiso-dark .CodeMirror-linenumber{color:#776e71}.cm-s-paraiso-dark .CodeMirror-cursor{border-left:1px solid #8d8687}.cm-s-paraiso-dark span.cm-comment{color:#e96ba8}.cm-s-paraiso-dark span.cm-atom,.cm-s-paraiso-dark span.cm-number{color:#815ba4}.cm-s-paraiso-dark span.cm-attribute,.cm-s-paraiso-dark span.cm-property{color:#48b685}.cm-s-paraiso-dark span.cm-keyword{color:#ef6155}.cm-s-paraiso-dark span.cm-string{color:#fec418}.cm-s-paraiso-dark span.cm-variable{color:#48b685}.cm-s-paraiso-dark span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-dark span.cm-def{color:#f99b15}.cm-s-paraiso-dark span.cm-bracket{color:#b9b6b0}.cm-s-paraiso-dark span.cm-tag{color:#ef6155}.cm-s-paraiso-dark span.cm-link{color:#815ba4}.cm-s-paraiso-dark span.cm-error{background:#ef6155;color:#8d8687}.cm-s-paraiso-dark .CodeMirror-activeline-background{background:#4d344a}.cm-s-paraiso-dark .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/paraiso-light.css 0000644 00000003167 15153464547 0013562 0 ustar 00 .cm-s-paraiso-light.CodeMirror{background:#e7e9db;color:#41323f}.cm-s-paraiso-light div.CodeMirror-selected{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::selection,.cm-s-paraiso-light .CodeMirror-line>span::selection,.cm-s-paraiso-light .CodeMirror-line>span>span::selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-line::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span::-moz-selection,.cm-s-paraiso-light .CodeMirror-line>span>span::-moz-selection{background:#b9b6b0}.cm-s-paraiso-light .CodeMirror-gutters{background:#e7e9db;border-right:0}.cm-s-paraiso-light .CodeMirror-guttermarker{color:#000}.cm-s-paraiso-light .CodeMirror-guttermarker-subtle,.cm-s-paraiso-light .CodeMirror-linenumber{color:#8d8687}.cm-s-paraiso-light .CodeMirror-cursor{border-left:1px solid #776e71}.cm-s-paraiso-light span.cm-comment{color:#e96ba8}.cm-s-paraiso-light span.cm-atom,.cm-s-paraiso-light span.cm-number{color:#815ba4}.cm-s-paraiso-light span.cm-attribute,.cm-s-paraiso-light span.cm-property{color:#48b685}.cm-s-paraiso-light span.cm-keyword{color:#ef6155}.cm-s-paraiso-light span.cm-string{color:#fec418}.cm-s-paraiso-light span.cm-variable{color:#48b685}.cm-s-paraiso-light span.cm-variable-2{color:#06b6ef}.cm-s-paraiso-light span.cm-def{color:#f99b15}.cm-s-paraiso-light span.cm-bracket{color:#41323f}.cm-s-paraiso-light span.cm-tag{color:#ef6155}.cm-s-paraiso-light span.cm-link{color:#815ba4}.cm-s-paraiso-light span.cm-error{background:#ef6155;color:#776e71}.cm-s-paraiso-light .CodeMirror-activeline-background{background:#cfd1c4}.cm-s-paraiso-light .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/pastel-on-dark.css 0000644 00000003722 15153464547 0013635 0 ustar 00 .cm-s-pastel-on-dark.CodeMirror{background:#2c2827;color:#8f938f;line-height:1.5}.cm-s-pastel-on-dark div.CodeMirror-selected{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::selection,.cm-s-pastel-on-dark .CodeMirror-line>span::selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-line::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span::-moz-selection,.cm-s-pastel-on-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(221,240,255,.2)}.cm-s-pastel-on-dark .CodeMirror-gutters{background:#34302f;border-right:0;padding:0 3px}.cm-s-pastel-on-dark .CodeMirror-guttermarker{color:#fff}.cm-s-pastel-on-dark .CodeMirror-guttermarker-subtle,.cm-s-pastel-on-dark .CodeMirror-linenumber{color:#8f938f}.cm-s-pastel-on-dark .CodeMirror-cursor{border-left:1px solid #a7a7a7}.cm-s-pastel-on-dark span.cm-comment{color:#a6c6ff}.cm-s-pastel-on-dark span.cm-atom{color:#de8e30}.cm-s-pastel-on-dark span.cm-number{color:#ccc}.cm-s-pastel-on-dark span.cm-property{color:#8f938f}.cm-s-pastel-on-dark span.cm-attribute{color:#a6e22e}.cm-s-pastel-on-dark span.cm-keyword{color:#aeb2f8}.cm-s-pastel-on-dark span.cm-string{color:#66a968}.cm-s-pastel-on-dark span.cm-variable{color:#aeb2f8}.cm-s-pastel-on-dark span.cm-variable-2{color:#bebf55}.cm-s-pastel-on-dark span.cm-type,.cm-s-pastel-on-dark span.cm-variable-3{color:#de8e30}.cm-s-pastel-on-dark span.cm-def{color:#757ad8}.cm-s-pastel-on-dark span.cm-bracket{color:#f8f8f2}.cm-s-pastel-on-dark span.cm-tag{color:#c1c144}.cm-s-pastel-on-dark span.cm-link{color:#ae81ff}.cm-s-pastel-on-dark span.cm-builtin,.cm-s-pastel-on-dark span.cm-qualifier{color:#c1c144}.cm-s-pastel-on-dark span.cm-error{background:#757ad8;color:#f8f8f0}.cm-s-pastel-on-dark .CodeMirror-activeline-background{background:hsla(0,0%,100%,.031)}.cm-s-pastel-on-dark .CodeMirror-matchingbracket{border:1px solid hsla(0,0%,100%,.25);color:#8f938f!important;margin:-1px -1px 0}
dist/editor-themes/railscasts.css 0000644 00000002155 15153464547 0013163 0 ustar 00 .cm-s-railscasts.CodeMirror{background:#2b2b2b;color:#f4f1ed}.cm-s-railscasts div.CodeMirror-selected{background:#272935!important}.cm-s-railscasts .CodeMirror-gutters{background:#2b2b2b;border-right:0}.cm-s-railscasts .CodeMirror-linenumber{color:#5a647e}.cm-s-railscasts .CodeMirror-cursor{border-left:1px solid #d4cfc9!important}.cm-s-railscasts span.cm-comment{color:#bc9458}.cm-s-railscasts span.cm-atom,.cm-s-railscasts span.cm-number{color:#b6b3eb}.cm-s-railscasts span.cm-attribute,.cm-s-railscasts span.cm-property{color:#a5c261}.cm-s-railscasts span.cm-keyword{color:#da4939}.cm-s-railscasts span.cm-string{color:#ffc66d}.cm-s-railscasts span.cm-variable{color:#a5c261}.cm-s-railscasts span.cm-variable-2{color:#6d9cbe}.cm-s-railscasts span.cm-def{color:#cc7833}.cm-s-railscasts span.cm-error{background:#da4939;color:#d4cfc9}.cm-s-railscasts span.cm-bracket{color:#f4f1ed}.cm-s-railscasts span.cm-tag{color:#da4939}.cm-s-railscasts span.cm-link{color:#b6b3eb}.cm-s-railscasts .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}.cm-s-railscasts .CodeMirror-activeline-background{background:#303040}
dist/editor-themes/rubyblue.css 0000644 00000003125 15153464547 0012642 0 ustar 00 .cm-s-rubyblue.CodeMirror{background:#112435;color:#fff}.cm-s-rubyblue div.CodeMirror-selected{background:#38566f}.cm-s-rubyblue .CodeMirror-line::selection,.cm-s-rubyblue .CodeMirror-line>span::selection,.cm-s-rubyblue .CodeMirror-line>span>span::selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-line::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span::-moz-selection,.cm-s-rubyblue .CodeMirror-line>span>span::-moz-selection{background:rgba(56,86,111,.99)}.cm-s-rubyblue .CodeMirror-gutters{background:#1f4661;border-right:7px solid #3e7087}.cm-s-rubyblue .CodeMirror-guttermarker{color:#fff}.cm-s-rubyblue .CodeMirror-guttermarker-subtle{color:#3e7087}.cm-s-rubyblue .CodeMirror-linenumber{color:#fff}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-rubyblue span.cm-comment{color:#999;font-style:italic;line-height:1em}.cm-s-rubyblue span.cm-atom{color:#f4c20b}.cm-s-rubyblue span.cm-attribute,.cm-s-rubyblue span.cm-number{color:#82c6e0}.cm-s-rubyblue span.cm-keyword{color:#f0f}.cm-s-rubyblue span.cm-string{color:#f08047}.cm-s-rubyblue span.cm-meta{color:#f0f}.cm-s-rubyblue span.cm-tag,.cm-s-rubyblue span.cm-variable-2{color:#7bd827}.cm-s-rubyblue span.cm-def,.cm-s-rubyblue span.cm-type,.cm-s-rubyblue span.cm-variable-3{color:#fff}.cm-s-rubyblue span.cm-bracket{color:#f0f}.cm-s-rubyblue span.cm-link{color:#f4c20b}.cm-s-rubyblue span.CodeMirror-matchingbracket{color:#f0f!important}.cm-s-rubyblue span.cm-builtin,.cm-s-rubyblue span.cm-special{color:#ff9d00}.cm-s-rubyblue span.cm-error{color:#af2018}.cm-s-rubyblue .CodeMirror-activeline-background{background:#173047}
dist/editor-themes/seti.css 0000644 00000003032 15153464547 0011752 0 ustar 00 .cm-s-seti.CodeMirror{background-color:#151718!important;border:none;color:#cfd2d1!important}.cm-s-seti .CodeMirror-gutters{background-color:#0e1112;border:none;color:#404b53}.cm-s-seti .CodeMirror-cursor{border-left:thin solid #f8f8f0}.cm-s-seti .CodeMirror-linenumber{color:#6d8a88}.cm-s-seti.CodeMirror-focused div.CodeMirror-selected{background:hsla(0,0%,100%,.1)}.cm-s-seti .CodeMirror-line::selection,.cm-s-seti .CodeMirror-line>span::selection,.cm-s-seti .CodeMirror-line>span>span::selection{background:hsla(0,0%,100%,.1)}.cm-s-seti .CodeMirror-line::-moz-selection,.cm-s-seti .CodeMirror-line>span::-moz-selection,.cm-s-seti .CodeMirror-line>span>span::-moz-selection{background:hsla(0,0%,100%,.1)}.cm-s-seti span.cm-comment{color:#41535b}.cm-s-seti span.cm-string,.cm-s-seti span.cm-string-2{color:#55b5db}.cm-s-seti span.cm-number{color:#cd3f45}.cm-s-seti span.cm-variable{color:#55b5db}.cm-s-seti span.cm-variable-2{color:#a074c4}.cm-s-seti span.cm-def{color:#55b5db}.cm-s-seti span.cm-keyword{color:#ff79c6}.cm-s-seti span.cm-operator{color:#9fca56}.cm-s-seti span.cm-keyword{color:#e6cd69}.cm-s-seti span.cm-atom{color:#cd3f45}.cm-s-seti span.cm-meta,.cm-s-seti span.cm-tag{color:#55b5db}.cm-s-seti span.cm-attribute,.cm-s-seti span.cm-qualifier{color:#9fca56}.cm-s-seti span.cm-property{color:#a074c4}.cm-s-seti span.cm-builtin,.cm-s-seti span.cm-type,.cm-s-seti span.cm-variable-3{color:#9fca56}.cm-s-seti .CodeMirror-activeline-background{background:#101213}.cm-s-seti .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/shadowfox.css 0000644 00000003510 15153464547 0013011 0 ustar 00 .cm-s-shadowfox.CodeMirror{background:#2a2a2e;color:#b1b1b3}.cm-s-shadowfox div.CodeMirror-selected{background:#353b48}.cm-s-shadowfox .CodeMirror-line::selection,.cm-s-shadowfox .CodeMirror-line>span::selection,.cm-s-shadowfox .CodeMirror-line>span>span::selection{background:#353b48}.cm-s-shadowfox .CodeMirror-line::-moz-selection,.cm-s-shadowfox .CodeMirror-line>span::-moz-selection,.cm-s-shadowfox .CodeMirror-line>span>span::-moz-selection{background:#353b48}.cm-s-shadowfox .CodeMirror-gutters{background:#0c0c0d;border-right:1px solid #0c0c0d}.cm-s-shadowfox .CodeMirror-guttermarker{color:#555}.cm-s-shadowfox .CodeMirror-linenumber{color:#939393}.cm-s-shadowfox .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-shadowfox span.cm-comment{color:#939393}.cm-s-shadowfox span.cm-atom,.cm-s-shadowfox span.cm-attribute,.cm-s-shadowfox span.cm-builtin,.cm-s-shadowfox span.cm-error,.cm-s-shadowfox span.cm-keyword,.cm-s-shadowfox span.cm-quote{color:#ff7de9}.cm-s-shadowfox span.cm-number,.cm-s-shadowfox span.cm-string,.cm-s-shadowfox span.cm-string-2{color:#6b89ff}.cm-s-shadowfox span.cm-hr,.cm-s-shadowfox span.cm-meta{color:#939393}.cm-s-shadowfox span.cm-header,.cm-s-shadowfox span.cm-qualifier,.cm-s-shadowfox span.cm-variable-2{color:#75bfff}.cm-s-shadowfox span.cm-property{color:#86de74}.cm-s-shadowfox span.cm-bracket,.cm-s-shadowfox span.cm-def,.cm-s-shadowfox span.cm-link:visited,.cm-s-shadowfox span.cm-tag{color:#75bfff}.cm-s-shadowfox span.cm-variable{color:#b98eff}.cm-s-shadowfox span.cm-variable-3{color:#d7d7db}.cm-s-shadowfox span.cm-link{color:#737373}.cm-s-shadowfox span.cm-operator{color:#b1b1b3}.cm-s-shadowfox span.cm-special{color:#d7d7db}.cm-s-shadowfox .CodeMirror-activeline-background{background:rgba(185,215,253,.15)}.cm-s-shadowfox .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid hsla(0,0%,100%,.25)}
dist/editor-themes/solarized.css 0000644 00000010246 15153464547 0013007 0 ustar 00 .solarized.base03{color:#002b36}.solarized.base02{color:#073642}.solarized.base01{color:#586e75}.solarized.base00{color:#657b83}.solarized.base0{color:#839496}.solarized.base1{color:#93a1a1}.solarized.base2{color:#eee8d5}.solarized.base3{color:#fdf6e3}.solarized.solar-yellow{color:#b58900}.solarized.solar-orange{color:#cb4b16}.solarized.solar-red{color:#dc322f}.solarized.solar-magenta{color:#d33682}.solarized.solar-violet{color:#6c71c4}.solarized.solar-blue{color:#268bd2}.solarized.solar-cyan{color:#2aa198}.solarized.solar-green{color:#859900}.cm-s-solarized{line-height:1.45em;color-profile:sRGB;rendering-intent:auto}.cm-s-solarized.cm-s-dark{background-color:#002b36;color:#839496}.cm-s-solarized.cm-s-light{background-color:#fdf6e3;color:#657b83}.cm-s-solarized .CodeMirror-widget{text-shadow:none}.cm-s-solarized .cm-header{color:#586e75}.cm-s-solarized .cm-quote{color:#93a1a1}.cm-s-solarized .cm-keyword{color:#cb4b16}.cm-s-solarized .cm-atom,.cm-s-solarized .cm-number{color:#d33682}.cm-s-solarized .cm-def{color:#2aa198}.cm-s-solarized .cm-variable{color:#839496}.cm-s-solarized .cm-variable-2{color:#b58900}.cm-s-solarized .cm-type,.cm-s-solarized .cm-variable-3{color:#6c71c4}.cm-s-solarized .cm-property{color:#2aa198}.cm-s-solarized .cm-operator{color:#6c71c4}.cm-s-solarized .cm-comment{color:#586e75;font-style:italic}.cm-s-solarized .cm-string{color:#859900}.cm-s-solarized .cm-string-2{color:#b58900}.cm-s-solarized .cm-meta{color:#859900}.cm-s-solarized .cm-qualifier{color:#b58900}.cm-s-solarized .cm-builtin{color:#d33682}.cm-s-solarized .cm-bracket{color:#cb4b16}.cm-s-solarized .CodeMirror-matchingbracket{color:#859900}.cm-s-solarized .CodeMirror-nonmatchingbracket{color:#dc322f}.cm-s-solarized .cm-tag{color:#93a1a1}.cm-s-solarized .cm-attribute{color:#2aa198}.cm-s-solarized .cm-hr{border-top:1px solid #586e75;color:transparent;display:block}.cm-s-solarized .cm-link{color:#93a1a1;cursor:pointer}.cm-s-solarized .cm-special{color:#6c71c4}.cm-s-solarized .cm-em{color:#999;text-decoration:underline;text-decoration-style:dotted}.cm-s-solarized .cm-error,.cm-s-solarized .cm-invalidchar{border-bottom:1px dotted #dc322f;color:#586e75}.cm-s-solarized.cm-s-dark div.CodeMirror-selected{background:#073642}.cm-s-solarized.cm-s-dark.CodeMirror ::selection{background:rgba(7,54,66,.99)}.cm-s-dark .CodeMirror-line>span::-moz-selection,.cm-s-dark .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-dark .CodeMirror-line::-moz-selection{background:rgba(7,54,66,.99)}.cm-s-solarized.cm-s-light div.CodeMirror-selected{background:#eee8d5}.cm-s-light .CodeMirror-line>span::selection,.cm-s-light .CodeMirror-line>span>span::selection,.cm-s-solarized.cm-s-light .CodeMirror-line::selection{background:#eee8d5}.cm-s-light .CodeMirror-line>span::-moz-selection,.cm-s-light .CodeMirror-line>span>span::-moz-selection,.cm-s-solarized.cm-s-light .CodeMirror-line::-moz-selection{background:#eee8d5}.cm-s-solarized.CodeMirror{-moz-box-shadow:inset 7px 0 12px -6px #000;-webkit-box-shadow:inset 7px 0 12px -6px #000;box-shadow:inset 7px 0 12px -6px #000}.cm-s-solarized .CodeMirror-gutters{border-right:0}.cm-s-solarized.cm-s-dark .CodeMirror-gutters{background-color:#073642}.cm-s-solarized.cm-s-dark .CodeMirror-linenumber{color:#586e75}.cm-s-solarized.cm-s-light .CodeMirror-gutters{background-color:#eee8d5}.cm-s-solarized.cm-s-light .CodeMirror-linenumber{color:#839496}.cm-s-solarized .CodeMirror-linenumber{padding:0 5px}.cm-s-solarized .CodeMirror-guttermarker-subtle{color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-guttermarker{color:#ddd}.cm-s-solarized.cm-s-light .CodeMirror-guttermarker{color:#cb4b16}.cm-s-solarized .CodeMirror-gutter .CodeMirror-gutter-text{color:#586e75}.cm-s-solarized .CodeMirror-cursor{border-left:1px solid #819090}.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor{background:#7e7}.cm-s-solarized.cm-s-light .cm-animate-fat-cursor{background-color:#7e7}.cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor{background:#586e75}.cm-s-solarized.cm-s-dark .cm-animate-fat-cursor{background-color:#586e75}.cm-s-solarized.cm-s-dark .CodeMirror-activeline-background{background:hsla(0,0%,100%,.06)}.cm-s-solarized.cm-s-light .CodeMirror-activeline-background{background:rgba(0,0,0,.06)}
dist/editor-themes/ssms.css 0000644 00000001165 15153464547 0012000 0 ustar 00 .cm-s-ssms span.cm-keyword{color:blue}.cm-s-ssms span.cm-comment{color:#006400}.cm-s-ssms span.cm-string{color:red}.cm-s-ssms span.cm-def,.cm-s-ssms span.cm-variable,.cm-s-ssms span.cm-variable-2{color:#000}.cm-s-ssms span.cm-atom{color:#a9a9a9}.cm-s-ssms .CodeMirror-linenumber{color:teal}.cm-s-ssms .CodeMirror-activeline-background{background:#fff}.cm-s-ssms span.cm-string-2{color:#f0f}.cm-s-ssms span.cm-bracket,.cm-s-ssms span.cm-operator,.cm-s-ssms span.cm-punctuation{color:#a9a9a9}.cm-s-ssms .CodeMirror-gutters{background-color:#fff;border-right:3px solid #ffee62}.cm-s-ssms div.CodeMirror-selected{background:#add6ff}
dist/editor-themes/the-matrix.css 0000644 00000003251 15153464547 0013073 0 ustar 00 .cm-s-the-matrix.CodeMirror{background:#000;color:#0f0}.cm-s-the-matrix div.CodeMirror-selected{background:#2d2d2d}.cm-s-the-matrix .CodeMirror-line::selection,.cm-s-the-matrix .CodeMirror-line>span::selection,.cm-s-the-matrix .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-line::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span::-moz-selection,.cm-s-the-matrix .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-the-matrix .CodeMirror-gutters{background:#060;border-right:2px solid #0f0}.cm-s-the-matrix .CodeMirror-guttermarker{color:#0f0}.cm-s-the-matrix .CodeMirror-guttermarker-subtle,.cm-s-the-matrix .CodeMirror-linenumber{color:#fff}.cm-s-the-matrix .CodeMirror-cursor{border-left:1px solid #0f0}.cm-s-the-matrix span.cm-keyword{color:#008803;font-weight:700}.cm-s-the-matrix span.cm-atom{color:#3ff}.cm-s-the-matrix span.cm-number{color:#ffb94f}.cm-s-the-matrix span.cm-def{color:#99c}.cm-s-the-matrix span.cm-variable{color:#f6c}.cm-s-the-matrix span.cm-variable-2{color:#c6f}.cm-s-the-matrix span.cm-type,.cm-s-the-matrix span.cm-variable-3{color:#96f}.cm-s-the-matrix span.cm-property{color:#62ffa0}.cm-s-the-matrix span.cm-operator{color:#999}.cm-s-the-matrix span.cm-comment{color:#ccc}.cm-s-the-matrix span.cm-string{color:#39c}.cm-s-the-matrix span.cm-meta{color:#c9f}.cm-s-the-matrix span.cm-qualifier{color:#fff700}.cm-s-the-matrix span.cm-builtin{color:#30a}.cm-s-the-matrix span.cm-bracket{color:#cc7}.cm-s-the-matrix span.cm-tag{color:#ffbd40}.cm-s-the-matrix span.cm-attribute{color:#fff700}.cm-s-the-matrix span.cm-error{color:red}.cm-s-the-matrix .CodeMirror-activeline-background{background:#040}
dist/editor-themes/tomorrow-night-bright.css 0000644 00000002701 15153464547 0015264 0 ustar 00 .cm-s-tomorrow-night-bright.CodeMirror{background:#000;color:#eaeaea}.cm-s-tomorrow-night-bright div.CodeMirror-selected{background:#424242}.cm-s-tomorrow-night-bright .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker{color:#e78c45}.cm-s-tomorrow-night-bright .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-bright .CodeMirror-linenumber{color:#424242}.cm-s-tomorrow-night-bright .CodeMirror-cursor{border-left:1px solid #6a6a6a}.cm-s-tomorrow-night-bright span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-bright span.cm-atom,.cm-s-tomorrow-night-bright span.cm-number{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-attribute,.cm-s-tomorrow-night-bright span.cm-property{color:#9c9}.cm-s-tomorrow-night-bright span.cm-keyword{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-string{color:#e7c547}.cm-s-tomorrow-night-bright span.cm-variable{color:#b9ca4a}.cm-s-tomorrow-night-bright span.cm-variable-2{color:#7aa6da}.cm-s-tomorrow-night-bright span.cm-def{color:#e78c45}.cm-s-tomorrow-night-bright span.cm-bracket{color:#eaeaea}.cm-s-tomorrow-night-bright span.cm-tag{color:#d54e53}.cm-s-tomorrow-night-bright span.cm-link{color:#a16a94}.cm-s-tomorrow-night-bright span.cm-error{background:#d54e53;color:#6a6a6a}.cm-s-tomorrow-night-bright .CodeMirror-activeline-background{background:#2a2a2a}.cm-s-tomorrow-night-bright .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/tomorrow-night-eighties.css 0000644 00000003645 15153464547 0015616 0 ustar 00 .cm-s-tomorrow-night-eighties.CodeMirror{background:#000;color:#ccc}.cm-s-tomorrow-night-eighties div.CodeMirror-selected{background:#2d2d2d}.cm-s-tomorrow-night-eighties .CodeMirror-line::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span::-moz-selection,.cm-s-tomorrow-night-eighties .CodeMirror-line>span>span::-moz-selection{background:rgba(45,45,45,.99)}.cm-s-tomorrow-night-eighties .CodeMirror-gutters{background:#000;border-right:0}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker{color:#f2777a}.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle{color:#777}.cm-s-tomorrow-night-eighties .CodeMirror-linenumber{color:#515151}.cm-s-tomorrow-night-eighties .CodeMirror-cursor{border-left:1px solid #6a6a6a}.cm-s-tomorrow-night-eighties span.cm-comment{color:#d27b53}.cm-s-tomorrow-night-eighties span.cm-atom,.cm-s-tomorrow-night-eighties span.cm-number{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-attribute,.cm-s-tomorrow-night-eighties span.cm-property{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-keyword{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-string{color:#fc6}.cm-s-tomorrow-night-eighties span.cm-variable{color:#9c9}.cm-s-tomorrow-night-eighties span.cm-variable-2{color:#69c}.cm-s-tomorrow-night-eighties span.cm-def{color:#f99157}.cm-s-tomorrow-night-eighties span.cm-bracket{color:#ccc}.cm-s-tomorrow-night-eighties span.cm-tag{color:#f2777a}.cm-s-tomorrow-night-eighties span.cm-link{color:#a16a94}.cm-s-tomorrow-night-eighties span.cm-error{background:#f2777a;color:#6a6a6a}.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background{background:#343600}.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket{color:#fff!important;text-decoration:underline}
dist/editor-themes/ttcn.css 0000644 00000003477 15153464547 0011773 0 ustar 00 .cm-s-ttcn .cm-quote{color:#090}.cm-s-ttcn .cm-header,.cm-strong{font-weight:700}.cm-s-ttcn .cm-header{color:#00f;font-weight:700}.cm-s-ttcn .cm-atom{color:#219}.cm-s-ttcn .cm-attribute{color:#00c}.cm-s-ttcn .cm-bracket{color:#997}.cm-s-ttcn .cm-comment{color:#333}.cm-s-ttcn .cm-def{color:#00f}.cm-s-ttcn .cm-em{font-style:italic}.cm-s-ttcn .cm-error{color:red}.cm-s-ttcn .cm-hr{color:#999}.cm-s-ttcn .cm-keyword{font-weight:700}.cm-s-ttcn .cm-link{color:#00c;text-decoration:underline}.cm-s-ttcn .cm-meta{color:#555}.cm-s-ttcn .cm-negative{color:#d44}.cm-s-ttcn .cm-positive{color:#292}.cm-s-ttcn .cm-qualifier{color:#555}.cm-s-ttcn .cm-strikethrough{text-decoration:line-through}.cm-s-ttcn .cm-string{color:#006400}.cm-s-ttcn .cm-string-2{color:#f50}.cm-s-ttcn .cm-strong{font-weight:700}.cm-s-ttcn .cm-tag{color:#170}.cm-s-ttcn .cm-variable{color:#8b2252}.cm-s-ttcn .cm-variable-2{color:#05a}.cm-s-ttcn .cm-type,.cm-s-ttcn .cm-variable-3{color:#085}.cm-s-ttcn .cm-invalidchar{color:red}.cm-s-ttcn .cm-accessTypes,.cm-s-ttcn .cm-compareTypes{color:#27408b}.cm-s-ttcn .cm-cmipVerbs{color:#8b2252}.cm-s-ttcn .cm-modifier{color:#d2691e}.cm-s-ttcn .cm-status{color:#8b4545}.cm-s-ttcn .cm-storage{color:#a020f0}.cm-s-ttcn .cm-tags{color:#006400}.cm-s-ttcn .cm-externalCommands{color:#8b4545;font-weight:700}.cm-s-ttcn .cm-fileNCtrlMaskOptions,.cm-s-ttcn .cm-sectionTitle{color:#2e8b57;font-weight:700}.cm-s-ttcn .cm-booleanConsts,.cm-s-ttcn .cm-otherConsts,.cm-s-ttcn .cm-verdictConsts{color:#006400}.cm-s-ttcn .cm-configOps,.cm-s-ttcn .cm-functionOps,.cm-s-ttcn .cm-portOps,.cm-s-ttcn .cm-sutOps,.cm-s-ttcn .cm-timerOps,.cm-s-ttcn .cm-verdictOps{color:#00f}.cm-s-ttcn .cm-preprocessor,.cm-s-ttcn .cm-templateMatch,.cm-s-ttcn .cm-ttcn3Macros{color:#27408b}.cm-s-ttcn .cm-types{color:brown;font-weight:700}.cm-s-ttcn .cm-visibilityModifiers{font-weight:700}
dist/editor-themes/twilight.css 0000644 00000003464 15153464547 0012652 0 ustar 00 .cm-s-twilight.CodeMirror{background:#141414;color:#f7f7f7}.cm-s-twilight div.CodeMirror-selected{background:#323232}.cm-s-twilight .CodeMirror-line::selection,.cm-s-twilight .CodeMirror-line>span::selection,.cm-s-twilight .CodeMirror-line>span>span::selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-line::-moz-selection,.cm-s-twilight .CodeMirror-line>span::-moz-selection,.cm-s-twilight .CodeMirror-line>span>span::-moz-selection{background:rgba(50,50,50,.99)}.cm-s-twilight .CodeMirror-gutters{background:#222;border-right:1px solid #aaa}.cm-s-twilight .CodeMirror-guttermarker{color:#fff}.cm-s-twilight .CodeMirror-guttermarker-subtle,.cm-s-twilight .CodeMirror-linenumber{color:#aaa}.cm-s-twilight .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-twilight .cm-keyword{color:#f9ee98}.cm-s-twilight .cm-atom{color:#fc0}.cm-s-twilight .cm-number{color:#ca7841}.cm-s-twilight .cm-def{color:#8da6ce}.cm-s-twilight span.cm-def,.cm-s-twilight span.cm-tag,.cm-s-twilight span.cm-type,.cm-s-twilight span.cm-variable-2,.cm-s-twilight span.cm-variable-3{color:#607392}.cm-s-twilight .cm-operator{color:#cda869}.cm-s-twilight .cm-comment{color:#777;font-style:italic;font-weight:400}.cm-s-twilight .cm-string{color:#8f9d6a;font-style:italic}.cm-s-twilight .cm-string-2{color:#bd6b18}.cm-s-twilight .cm-meta{background-color:#141414;color:#f7f7f7}.cm-s-twilight .cm-builtin{color:#cda869}.cm-s-twilight .cm-tag{color:#997643}.cm-s-twilight .cm-attribute{color:#d6bb6d}.cm-s-twilight .cm-header{color:#ff6400}.cm-s-twilight .cm-hr{color:#aeaeae}.cm-s-twilight .cm-link{color:#ad9361;font-style:italic;text-decoration:none}.cm-s-twilight .cm-error{border-bottom:1px solid red}.cm-s-twilight .CodeMirror-activeline-background{background:#27282e}.cm-s-twilight .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/vibrant-ink.css 0000644 00000003415 15153464547 0013237 0 ustar 00 .cm-s-vibrant-ink.CodeMirror{background:#000;color:#fff}.cm-s-vibrant-ink div.CodeMirror-selected{background:#35493c}.cm-s-vibrant-ink .CodeMirror-line::selection,.cm-s-vibrant-ink .CodeMirror-line>span::selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-line::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span::-moz-selection,.cm-s-vibrant-ink .CodeMirror-line>span>span::-moz-selection{background:rgba(53,73,60,.99)}.cm-s-vibrant-ink .CodeMirror-gutters{background:#002240;border-right:1px solid #aaa}.cm-s-vibrant-ink .CodeMirror-guttermarker{color:#fff}.cm-s-vibrant-ink .CodeMirror-guttermarker-subtle,.cm-s-vibrant-ink .CodeMirror-linenumber{color:#d0d0d0}.cm-s-vibrant-ink .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-vibrant-ink .cm-keyword{color:#cc7832}.cm-s-vibrant-ink .cm-atom{color:#fc0}.cm-s-vibrant-ink .cm-number{color:#ffee98}.cm-s-vibrant-ink .cm-def{color:#8da6ce}.cm-s-vibrant span.cm-def,.cm-s-vibrant span.cm-tag,.cm-s-vibrant span.cm-type,.cm-s-vibrant-ink span.cm-variable-2,.cm-s-vibrant-ink span.cm-variable-3{color:#ffc66d}.cm-s-vibrant-ink .cm-operator{color:#888}.cm-s-vibrant-ink .cm-comment{color:gray;font-weight:700}.cm-s-vibrant-ink .cm-string{color:#a5c25c}.cm-s-vibrant-ink .cm-string-2{color:red}.cm-s-vibrant-ink .cm-meta{color:#d8fa3c}.cm-s-vibrant-ink .cm-attribute,.cm-s-vibrant-ink .cm-builtin,.cm-s-vibrant-ink .cm-tag{color:#8da6ce}.cm-s-vibrant-ink .cm-header{color:#ff6400}.cm-s-vibrant-ink .cm-hr{color:#aeaeae}.cm-s-vibrant-ink .cm-link{color:#5656f3}.cm-s-vibrant-ink .cm-error{border-bottom:1px solid red}.cm-s-vibrant-ink .CodeMirror-activeline-background{background:#27282e}.cm-s-vibrant-ink .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/xq-dark.css 0000644 00000003144 15153464547 0012361 0 ustar 00 .cm-s-xq-dark.CodeMirror{background:#0a001f;color:#f8f8f8}.cm-s-xq-dark div.CodeMirror-selected{background:#27007a}.cm-s-xq-dark .CodeMirror-line::selection,.cm-s-xq-dark .CodeMirror-line>span::selection,.cm-s-xq-dark .CodeMirror-line>span>span::selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-line::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span::-moz-selection,.cm-s-xq-dark .CodeMirror-line>span>span::-moz-selection{background:rgba(39,0,122,.99)}.cm-s-xq-dark .CodeMirror-gutters{background:#0a001f;border-right:1px solid #aaa}.cm-s-xq-dark .CodeMirror-guttermarker{color:#ffbd40}.cm-s-xq-dark .CodeMirror-guttermarker-subtle,.cm-s-xq-dark .CodeMirror-linenumber{color:#f8f8f8}.cm-s-xq-dark .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-xq-dark span.cm-keyword{color:#ffbd40}.cm-s-xq-dark span.cm-atom{color:#6c8cd5}.cm-s-xq-dark span.cm-number{color:#164}.cm-s-xq-dark span.cm-def{color:#fff;text-decoration:underline}.cm-s-xq-dark span.cm-variable{color:#fff}.cm-s-xq-dark span.cm-variable-2{color:#eee}.cm-s-xq-dark span.cm-type,.cm-s-xq-dark span.cm-variable-3{color:#ddd}.cm-s-xq-dark span.cm-comment{color:gray}.cm-s-xq-dark span.cm-string{color:#9fee00}.cm-s-xq-dark span.cm-meta{color:#ff0}.cm-s-xq-dark span.cm-qualifier{color:#fff700}.cm-s-xq-dark span.cm-builtin{color:#30a}.cm-s-xq-dark span.cm-bracket{color:#cc7}.cm-s-xq-dark span.cm-tag{color:#ffbd40}.cm-s-xq-dark span.cm-attribute{color:#fff700}.cm-s-xq-dark span.cm-error{color:red}.cm-s-xq-dark .CodeMirror-activeline-background{background:#27282e}.cm-s-xq-dark .CodeMirror-matchingbracket{color:#fff!important;outline:1px solid grey}
dist/editor-themes/xq-light.css 0000644 00000001634 15153464547 0012551 0 ustar 00 .cm-s-xq-light span.cm-keyword{color:#5a5cad;font-weight:700;line-height:1em}.cm-s-xq-light span.cm-atom{color:#6c8cd5}.cm-s-xq-light span.cm-number{color:#164}.cm-s-xq-light span.cm-def{text-decoration:underline}.cm-s-xq-light span.cm-type,.cm-s-xq-light span.cm-variable,.cm-s-xq-light span.cm-variable-2,.cm-s-xq-light span.cm-variable-3{color:#000}.cm-s-xq-light span.cm-comment{color:#0080ff;font-style:italic}.cm-s-xq-light span.cm-string{color:red}.cm-s-xq-light span.cm-meta{color:#ff0}.cm-s-xq-light span.cm-qualifier{color:grey}.cm-s-xq-light span.cm-builtin{color:#7ea656}.cm-s-xq-light span.cm-bracket{color:#cc7}.cm-s-xq-light span.cm-tag{color:#3f7f7f}.cm-s-xq-light span.cm-attribute{color:#7f007f}.cm-s-xq-light span.cm-error{color:red}.cm-s-xq-light .CodeMirror-activeline-background{background:#e8f2ff}.cm-s-xq-light .CodeMirror-matchingbracket{background:#ff0;color:#000!important;outline:1px solid grey}
dist/editor-themes/yeti.css 0000644 00000002673 15153464547 0011772 0 ustar 00 .cm-s-yeti.CodeMirror{background-color:#eceae8!important;border:none;color:#d1c9c0!important}.cm-s-yeti .CodeMirror-gutters{background-color:#e5e1db;border:none;color:#adaba6}.cm-s-yeti .CodeMirror-cursor{border-left:thin solid #d1c9c0}.cm-s-yeti .CodeMirror-linenumber{color:#adaba6}.cm-s-yeti.CodeMirror-focused div.CodeMirror-selected{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::selection,.cm-s-yeti .CodeMirror-line>span::selection,.cm-s-yeti .CodeMirror-line>span>span::selection{background:#dcd8d2}.cm-s-yeti .CodeMirror-line::-moz-selection,.cm-s-yeti .CodeMirror-line>span::-moz-selection,.cm-s-yeti .CodeMirror-line>span>span::-moz-selection{background:#dcd8d2}.cm-s-yeti span.cm-comment{color:#d4c8be}.cm-s-yeti span.cm-string,.cm-s-yeti span.cm-string-2{color:#96c0d8}.cm-s-yeti span.cm-number{color:#a074c4}.cm-s-yeti span.cm-variable{color:#55b5db}.cm-s-yeti span.cm-variable-2{color:#a074c4}.cm-s-yeti span.cm-def{color:#55b5db}.cm-s-yeti span.cm-keyword,.cm-s-yeti span.cm-operator{color:#9fb96e}.cm-s-yeti span.cm-atom{color:#a074c4}.cm-s-yeti span.cm-meta,.cm-s-yeti span.cm-tag{color:#96c0d8}.cm-s-yeti span.cm-attribute{color:#9fb96e}.cm-s-yeti span.cm-qualifier{color:#96c0d8}.cm-s-yeti span.cm-builtin,.cm-s-yeti span.cm-property{color:#a074c4}.cm-s-yeti span.cm-type,.cm-s-yeti span.cm-variable-3{color:#96c0d8}.cm-s-yeti .CodeMirror-activeline-background{background:#e7e4e0}.cm-s-yeti .CodeMirror-matchingbracket{text-decoration:underline}
dist/editor-themes/yonce.css 0000644 00000004656 15153464547 0012140 0 ustar 00 .cm-s-yonce.CodeMirror{background:#1c1c1c;color:#d4d4d4}.cm-s-yonce div.CodeMirror-selected{background:rgba(252,69,133,.478)}.cm-s-yonce .CodeMirror-line::-moz-selection,.cm-s-yonce .CodeMirror-line::selection,.cm-s-yonce .CodeMirror-line>span::-moz-selection,.cm-s-yonce .CodeMirror-line>span::selection,.cm-s-yonce .CodeMirror-line>span>span::-moz-selection,.cm-s-yonce .CodeMirror-line>span>span::selection,.cm-s-yonce .CodeMirror-selected,.cm-s-yonce .CodeMirror-selectedtext{background:rgba(252,67,132,.47)}.cm-s-yonce.CodeMirror pre{padding-left:0}.cm-s-yonce .CodeMirror-gutters{background:#1c1c1c;border-right:0}.cm-s-yonce .CodeMirror-linenumber{padding-right:10px}.cm-s-yonce .CodeMirror-activeline .CodeMirror-linenumber.CodeMirror-gutter-elt{background:#1c1c1c;color:#fc4384}.cm-s-yonce .CodeMirror-linenumber{color:#777}.cm-s-yonce .CodeMirror-cursor{border-left:2px solid #fc4384}.cm-s-yonce .cm-searching{background:rgba(243,155,53,.3)!important;outline:1px solid #f39b35}.cm-s-yonce .cm-searching.CodeMirror-selectedtext{background:rgba(243,155,53,.7)!important;color:#fff}.cm-s-yonce .cm-keyword{color:#00a7aa}.cm-s-yonce .cm-atom{color:#f39b35}.cm-s-yonce .cm-number,.cm-s-yonce span.cm-type{color:#a06fca}.cm-s-yonce .cm-def{color:#98e342}.cm-s-yonce .cm-property,.cm-s-yonce span.cm-variable{color:#d4d4d4;font-style:italic}.cm-s-yonce span.cm-variable-2{color:#da7dae;font-style:italic}.cm-s-yonce span.cm-variable-3{color:#a06fca}.cm-s-yonce .cm-type.cm-def{text-decoration:underline}.cm-s-yonce .cm-callee,.cm-s-yonce .cm-property.cm-def,.cm-s-yonce .cm-type.cm-def{color:#fc4384;font-style:normal}.cm-s-yonce .cm-operator,.cm-s-yonce .cm-qualifier,.cm-s-yonce .cm-tag{color:#fc4384}.cm-s-yonce .cm-tag.cm-bracket{color:#d4d4d4}.cm-s-yonce .cm-attribute{color:#a06fca}.cm-s-yonce .cm-comment{color:#696d70;font-style:italic;font-weight:400}.cm-s-yonce .cm-comment.cm-tag{color:#fc4384}.cm-s-yonce .cm-comment.cm-attribute{color:#d4d4d4}.cm-s-yonce .cm-string{color:#e6db74}.cm-s-yonce .cm-string-2{color:#f39b35}.cm-s-yonce .cm-meta{background:inherit;color:#d4d4d4}.cm-s-yonce .cm-builtin{color:#fc4384}.cm-s-yonce .cm-header{color:#da7dae}.cm-s-yonce .cm-hr{color:#98e342}.cm-s-yonce .cm-link{color:#696d70;font-style:italic;text-decoration:none}.cm-s-yonce .cm-error{border-bottom:1px solid #c42412}.cm-s-yonce .CodeMirror-activeline-background{background:#272727}.cm-s-yonce .CodeMirror-matchingbracket{color:#d4d4d4!important;outline:1px solid grey}
dist/editor-themes/zenburn.css 0000644 00000002642 15153464547 0012477 0 ustar 00 .cm-s-zenburn .CodeMirror-gutters{background:#3f3f3f!important}.CodeMirror-foldgutter-folded,.cm-s-zenburn .CodeMirror-foldgutter-open{color:#999}.cm-s-zenburn .CodeMirror-cursor{border-left:1px solid #fff}.cm-s-zenburn.CodeMirror{background-color:#3f3f3f;color:#dcdccc}.cm-s-zenburn span.cm-builtin{color:#dcdccc;font-weight:700}.cm-s-zenburn span.cm-comment{color:#7f9f7f}.cm-s-zenburn span.cm-keyword{color:#f0dfaf;font-weight:700}.cm-s-zenburn span.cm-atom{color:#bfebbf}.cm-s-zenburn span.cm-def{color:#dcdccc}.cm-s-zenburn span.cm-variable{color:#dfaf8f}.cm-s-zenburn span.cm-variable-2{color:#dcdccc}.cm-s-zenburn span.cm-string,.cm-s-zenburn span.cm-string-2{color:#cc9393}.cm-s-zenburn span.cm-number{color:#dcdccc}.cm-s-zenburn span.cm-tag{color:#93e0e3}.cm-s-zenburn span.cm-attribute,.cm-s-zenburn span.cm-property{color:#dfaf8f}.cm-s-zenburn span.cm-qualifier{color:#7cb8bb}.cm-s-zenburn span.cm-meta{color:#f0dfaf}.cm-s-zenburn span.cm-header,.cm-s-zenburn span.cm-operator{color:#f0efd0}.cm-s-zenburn span.CodeMirror-matchingbracket{background:transparent;border-bottom:1px solid;box-sizing:border-box}.cm-s-zenburn span.CodeMirror-nonmatchingbracket{background:none;border-bottom:1px solid}.cm-s-zenburn .CodeMirror-activeline,.cm-s-zenburn .CodeMirror-activeline-background{background:#000}.cm-s-zenburn div.CodeMirror-selected{background:#545454}.cm-s-zenburn .CodeMirror-focused div.CodeMirror-selected{background:#4f4f4f}
dist/editor.js 0000644 00000404157 15153464547 0007364 0 ustar 00 /*! For license information please see editor.js.LICENSE.txt */
(()=>{var t,e={2949:(t,e,i)=>{"use strict";const s=window.wp.CodeMirror;var n=i.n(s),r=i(3453),h=i(816);function o(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,(0,h.A)(s.key),s)}}var a=i(4776);function _(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return l(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?l(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var s=0,n=function(){};return{s:n,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,h=!0,o=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return h=t.done,t},e:function(t){o=!0,r=t},f:function(){try{h||null==i.return||i.return()}finally{if(o)throw r}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}var c=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.code=e,this.annotations=[],this.function_names=new Set,this.class_names=new Set},e=[{key:"lint",value:function(){var t=new a.Engine({parser:{suppressErrors:!0,version:800},ast:{withPositions:!0}});try{var e=t.parseEval(this.code);if(0<e.errors.length){var i,s=_(e.errors);try{for(s.s();!(i=s.n()).done;){var n=i.value;this.annotate(n.message,n.loc)}}catch(t){s.e(t)}finally{s.f()}}this.visit(e)}catch(n){console.error(n)}}},{key:"visit",value:function(t){if(t.kind&&this.validate(t),"children"in t){var e,i=_(t.children);try{for(i.s();!(e=i.n()).done;){var s=e.value;this.visit(s)}}catch(t){i.e(t)}finally{i.f()}}}},{key:"checkDuplicateIdentifier",value:function(t,e,i){e.has(t.name)?this.annotate("Cannot redeclare ".concat(i," ").concat(t.name,"()"),t.loc):e.add(t.name)}},{key:"validate",value:function(t){var e=t,i=e.name;"name"in e&&"name"in i&&"identifier"===i.kind&&("function"===t.kind?this.checkDuplicateIdentifier(i,this.function_names,"function"):"class"===t.kind&&this.checkDuplicateIdentifier(i,this.class_names,"class"))}},{key:"annotate",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"error",s=e?e.end.offset<e.start.offset?[e.end,e.start]:[e.start,e.end]:[{line:0,column:0},{line:0,column:0}],h=(0,r.A)(s,2),o=h[0],a=h[1];this.annotations.push({message:t,severity:i,from:n().Pos(o.line-1,o.column),to:n().Pos(a.line-1,a.column)})}}],e&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),u={name:"application/x-httpd-php",startOpen:!0};(0,s.defineMode)("php-snippet",(function(t){return(0,s.getMode)(t,u)})),(0,s.registerHelper)("lint","php",(function(t){var e=new c(t);return e.lint(),e.annotations}))},4776:t=>{var e;self,e=()=>(()=>{"use strict";var t={8938:(t,e,i)=>{var s=i(4778),n=i(8822),r=function(t,e){this.withPositions=t,this.withSource=e};r.precedence={},[["or"],["xor"],["and"],["="],["?"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","!=","===","!==","<=>"],["<","<=",">",">="],["<<",">>"],["+","-","."],["*","/","%"],["!"],["instanceof"],["cast","silent"],["**"]].forEach((function(t,e){t.forEach((function(t){r.precedence[t]=e+1}))})),r.prototype.isRightAssociative=function(t){return"**"===t||"??"===t},r.prototype.swapLocations=function(t,e,i,s){this.withPositions&&(t.loc.start=e.loc.start,t.loc.end=i.loc.end,this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},r.prototype.resolveLocations=function(t,e,i,s){this.withPositions&&(t.loc.start.offset>e.loc.start.offset&&(t.loc.start=e.loc.start),t.loc.end.offset<i.loc.end.offset&&(t.loc.end=i.loc.end),this.withSource&&(t.loc.source=s.lexer._input.substring(t.loc.start.offset,t.loc.end.offset)))},r.prototype.resolvePrecedence=function(t,e){var i,s,n;return"call"===t.kind?this.resolveLocations(t,t.what,t,e):"propertylookup"===t.kind||"staticlookup"===t.kind||"offsetlookup"===t.kind&&t.offset?this.resolveLocations(t,t.what,t.offset,e):"bin"===t.kind?t.right&&!t.right.parenthesizedExpression&&("bin"===t.right.kind?(s=r.precedence[t.type],n=r.precedence[t.right.type],s&&n&&n<=s&&(t.type!==t.right.type||!this.isRightAssociative(t.type))&&(i=t.right,t.right=t.right.left,this.swapLocations(t,t.left,t.right,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i)):"retif"===t.right.kind&&(s=r.precedence[t.type],n=r.precedence["?"],s&&n&&n<=s&&(i=t.right,t.right=t.right.test,this.swapLocations(t,t.left,t.right,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i))):"silent"!==t.kind&&"cast"!==t.kind||!t.expr||t.expr.parenthesizedExpression?"unary"===t.kind?t.what&&!t.what.parenthesizedExpression&&("bin"===t.what.kind?(i=t.what,t.what=t.what.left,this.swapLocations(t,t,t.what,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.what.kind&&(i=t.what,t.what=t.what.test,this.swapLocations(t,t,t.what,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i)):"retif"===t.kind?t.falseExpr&&"retif"===t.falseExpr.kind&&!t.falseExpr.parenthesizedExpression&&(i=t.falseExpr,t.falseExpr=i.test,this.swapLocations(t,t.test,t.falseExpr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i):"assign"===t.kind?t.right&&"bin"===t.right.kind&&!t.right.parenthesizedExpression&&(s=r.precedence["="],n=r.precedence[t.right.type],s&&n&&n<s&&(i=t.right,t.right=t.right.left,i.left=t,this.swapLocations(i,i.left,t.right,e),t=i)):"expressionstatement"===t.kind&&this.swapLocations(t,t.expression,t,e):"bin"===t.expr.kind?(i=t.expr,t.expr=t.expr.left,this.swapLocations(t,t,t.expr,e),i.left=this.resolvePrecedence(t,e),this.swapLocations(i,i.left,i.right,e),t=i):"retif"===t.expr.kind&&(i=t.expr,t.expr=t.expr.test,this.swapLocations(t,t,t.expr,e),i.test=this.resolvePrecedence(t,e),this.swapLocations(i,i.test,i.falseExpr,e),t=i),t},r.prototype.prepare=function(t,e,i){var r=null;(this.withPositions||this.withSource)&&(r=i.position());var h=this,o=function(){var a=null,_=Array.prototype.slice.call(arguments);if(_.push(e),h.withPositions||h.withSource){var l=null;h.withSource&&(l=i.lexer._input.substring(r.offset,i.prev[2])),a=new s(l,r,new n(i.prev[0],i.prev[1],i.prev[2])),_.push(a)}t||(t=_.shift());var c=h[t];if("function"!=typeof c)throw new Error('Undefined node "'+t+'"');var u=Object.create(c.prototype);return c.apply(u,_),o.instance=u,o.trailingComments&&(u.trailingComments=o.trailingComments),"function"==typeof o.postBuild&&o.postBuild(u),i.debug&&delete h.stack[o.stackUid],h.resolvePrecedence(u,i)};return i.debug&&(this.stack||(this.stack={},this.stackUid=1),this.stack[++this.stackUid]={position:r,stack:(new Error).stack.split("\n").slice(3,5)},o.stackUid=this.stackUid),o.setTrailingComments=function(t){o.instance?o.instance.setTrailingComments(t):o.trailingComments=t},o.destroy=function(t){e&&(t?t.leadingComments?t.leadingComments=e.concat(t.leadingComments):t.leadingComments=e:i._docIndex=i._docs.length-e.length),i.debug&&delete h.stack[o.stackUid]},o},r.prototype.checkNodes=function(){var t=[];for(var e in this.stack)Object.prototype.hasOwnProperty.call(this.stack,e)&&(this.stack[e].key=e,t.push(this.stack[e]));return this.stack={},t},[i(3160),i(1654),i(1240),i(3979),i(5553),i(2207),i(2916),i(4628),i(7509),i(2906),i(5723),i(7561),i(6473),i(9626),i(4782),i(8477),i(5045),i(900),i(4824),i(1020),i(9847),i(2790),i(1333),i(2112),i(9960),i(8533),i(5947),i(7786),i(5436),i(1136),i(380),i(6129),i(9723),i(5125),i(9632),i(4300),i(1515),i(3411),i(9781),i(839),i(8374),i(9754),i(4251),i(6553),i(8630),i(9786),i(9742),i(1234),i(6),i(8861),i(7860),i(9834),i(2724),i(6025),i(2687),i(7633),i(5514),i(7427),i(1122),i(7256),i(7416),i(8140),i(6258),i(9474),i(6827),i(4427),i(4065),i(4297),i(5859),i(6985),i(9302),i(8212),i(864),i(8268),i(7190),i(8519),i(4835),i(2056),i(4838),i(7869),i(1908),i(170),i(1091),i(8276),i(1842),i(5739),i(1274),i(4352),i(9672),i(711),i(1231),i(1865),i(1102),i(7472),i(6133),i(1197),i(6649),i(1837),i(2277),i(8010),i(7579),i(3460),i(2702),i(514),i(5684),i(8019),i(7721),i(4369),i(40),i(4919),i(7676),i(2596),i(6744)].forEach((function(t){r.prototype[t.kind]=t})),t.exports=r},3160:(t,e,i)=>{var s=i(839),n="array";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.items=e,this.shortForm=t}))},1654:(t,e,i)=>{var s=i(839),n="arrowfunc";t.exports=s.extends(n,(function(t,e,i,r,h,o,a,_){s.apply(this,[n,a,_]),this.arguments=t,this.byref=e,this.body=i,this.type=r,this.nullable=h,this.isStatic=o||!1}))},1240:(t,e,i)=>{var s=i(839),n="assign";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.left=t,this.right=e,this.operator=i}))},3979:(t,e,i)=>{var s=i(839),n="assignref";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.left=t,this.right=e}))},2207:(t,e,i)=>{var s=i(4065),n="attrgroup";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.attrs=t||[]}))},5553:(t,e,i)=>{var s=i(4065),n="attribute";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t,this.args=e}))},2916:(t,e,i)=>{var s=i(8268);t.exports=s.extends("bin",(function(t,e,i,n,r){s.apply(this,["bin",n,r]),this.type=t,this.left=e,this.right=i}))},4628:(t,e,i)=>{var s=i(9672),n="block";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[t||n,i,r]),this.children=e.filter(Boolean)}))},7509:(t,e,i)=>{var s=i(5514),n="boolean";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},2906:(t,e,i)=>{var s=i(9672),n="break";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.level=t}))},5723:(t,e,i)=>{var s=i(839),n="byref";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.what=t}))},7561:(t,e,i)=>{var s=i(839),n="call";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.what=t,this.arguments=e}))},6473:(t,e,i)=>{var s=i(9672),n="case";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.test=t,this.body=e}))},9626:(t,e,i)=>{var s=i(8268),n="cast";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.type=t,this.raw=e,this.expr=i}))},4782:(t,e,i)=>{var s=i(9672),n="catch";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.body=t,this.what=e,this.variable=i}))},8477:(t,e,i)=>{var s=i(8533),n="class";t.exports=s.extends(n,(function(t,e,i,r,h,o,a){s.apply(this,[n,t,o,a]),this.isAnonymous=!t,this.extends=e,this.implements=i,this.body=r,this.attrGroups=[],this.parseFlags(h)}))},5045:(t,e,i)=>{var s=i(2112),n="classconstant",r=s.extends(n,(function(t,e,i,r,h,o,a,_){s.apply(this,[t||n,e,a,_]),this.parseFlags(i),this.nullable=r,this.type=h,this.attrGroups=o}));r.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.final=2===t[2]},t.exports=r},900:(t,e,i)=>{var s=i(839),n="clone";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.what=t}))},4824:(t,e,i)=>{var s=i(839),n="closure";t.exports=s.extends(n,(function(t,e,i,r,h,o,a,_){s.apply(this,[n,a,_]),this.uses=i,this.arguments=t,this.byref=e,this.type=r,this.nullable=h,this.isStatic=o||!1,this.body=null,this.attrGroups=[]}))},1020:(t,e,i)=>{var s=i(4065);t.exports=s.extends("comment",(function(t,e,i,n){s.apply(this,[t,i,n]),this.value=e}))},9847:(t,e,i)=>{var s=i(1020),n="commentblock";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,t,e,i])}))},2790:(t,e,i)=>{var s=i(1020),n="commentline";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,t,e,i])}))},1333:(t,e,i)=>{var s=i(4065),n="constant";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t,this.value=e}))},2112:(t,e,i)=>{var s=i(9672),n="constantstatement";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[t||n,i,r]),this.constants=e}))},9960:(t,e,i)=>{var s=i(9672),n="continue";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.level=t}))},8533:(t,e,i)=>{var s=i(9672),n="declaration",r=s.extends(n,(function(t,e,i,r){s.apply(this,[t||n,i,r]),this.name=e}));r.prototype.parseFlags=function(t){this.isAbstract=1===t[2],this.isFinal=2===t[2],this.isReadonly=1===t[3],"class"!==this.kind&&(-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1])},t.exports=r},5947:(t,e,i)=>{var s=i(4628),n="declare",r=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,e,r,h]),this.directives=t,this.mode=i}));r.MODE_SHORT="short",r.MODE_BLOCK="block",r.MODE_NONE="none",t.exports=r},7786:(t,e,i)=>{var s=i(4065),n="declaredirective";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.key=t,this.value=e}))},5436:(t,e,i)=>{var s=i(9672);t.exports=s.extends("do",(function(t,e,i,n){s.apply(this,["do",i,n]),this.test=t,this.body=e}))},1136:(t,e,i)=>{var s=i(9672),n="echo";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.shortForm=e,this.expressions=t}))},380:(t,e,i)=>{var s=i(839),n="empty";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.expression=t}))},6129:(t,e,i)=>{var s=i(5514),n="encapsed",r=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,t,e,r,h]),this.type=i}));r.TYPE_STRING="string",r.TYPE_SHELL="shell",r.TYPE_HEREDOC="heredoc",r.TYPE_OFFSET="offset",t.exports=r},9723:(t,e,i)=>{var s=i(839),n="encapsedpart";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.expression=t,this.syntax=e,this.curly=i}))},5125:(t,e,i)=>{var s=i(839),n="entry";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,h,o]),this.key=t,this.value=e,this.byRef=i,this.unpack=r}))},9632:(t,e,i)=>{var s=i(8533),n="enum";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,t,h,o]),this.valueType=e,this.implements=i,this.body=r,this.attrGroups=[]}))},4300:(t,e,i)=>{var s=i(4065),n="enumcase";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t,this.value=e}))},1515:(t,e,i)=>{var s=i(4065),n="error";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,h,o]),this.message=t,this.token=e,this.line=i,this.expected=r}))},3411:(t,e,i)=>{var s=i(839),n="eval";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.source=t}))},9781:(t,e,i)=>{var s=i(839),n="exit";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.expression=t,this.useDie=e}))},839:(t,e,i)=>{var s=i(4065),n="expression";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[t||n,e,i])}))},8374:(t,e,i)=>{var s=i(9672),n="expressionstatement";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.expression=t}))},9754:(t,e,i)=>{var s=i(9672);t.exports=s.extends("for",(function(t,e,i,n,r,h,o){s.apply(this,["for",h,o]),this.init=t,this.test=e,this.increment=i,this.shortForm=r,this.body=n}))},4251:(t,e,i)=>{var s=i(9672),n="foreach";t.exports=s.extends(n,(function(t,e,i,r,h,o,a){s.apply(this,[n,o,a]),this.source=t,this.key=e,this.value=i,this.shortForm=h,this.body=r}))},6553:(t,e,i)=>{var s=i(8533),n="function";t.exports=s.extends(n,(function(t,e,i,r,h,o,a){s.apply(this,[n,t,o,a]),this.arguments=e,this.byref=i,this.type=r,this.nullable=h,this.body=null,this.attrGroups=[]}))},8630:(t,e,i)=>{var s=i(9672),n="global";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.items=t}))},9786:(t,e,i)=>{var s=i(9672),n="goto";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.label=t}))},9742:(t,e,i)=>{var s=i(9672),n="halt";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.after=t}))},1234:(t,e,i)=>{var s=i(4065),n="identifier",r=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.name=t}));t.exports=r},6:(t,e,i)=>{var s=i(9672);t.exports=s.extends("if",(function(t,e,i,n,r,h){s.apply(this,["if",r,h]),this.test=t,this.body=e,this.alternate=i,this.shortForm=n}))},8861:(t,e,i)=>{var s=i(839),n="include";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.once=t,this.require=e,this.target=i}))},7860:(t,e,i)=>{var s=i(5514),n="inline";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},9834:(t,e,i)=>{var s=i(8533),n="interface";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,t,h,o]),this.extends=e,this.body=i,this.attrGroups=r}))},2724:(t,e,i)=>{var s=i(8533),n="intersectiontype";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,null,e,i]),this.types=t}))},6025:(t,e,i)=>{var s=i(839),n="isset";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.variables=t}))},2687:(t,e,i)=>{var s=i(9672),n="label";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.name=t}))},7633:(t,e,i)=>{var s=i(839),n="list";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.items=t,this.shortForm=e}))},5514:(t,e,i)=>{var s=i(839),n="literal";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[t||n,r,h]),this.value=e,i&&(this.raw=i)}))},4778:t=>{t.exports=function(t,e,i){this.source=t,this.start=e,this.end=i}},7427:(t,e,i)=>{var s=i(839),n="lookup";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[t||n,r,h]),this.what=e,this.offset=i}))},1122:(t,e,i)=>{var s=i(5514),n="magic";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},7256:(t,e,i)=>{var s=i(839),n="match";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.cond=t,this.arms=e}))},7416:(t,e,i)=>{var s=i(839),n="matcharm";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.conds=t,this.body=e}))},8140:(t,e,i)=>{var s=i(6553),n="method";t.exports=s.extends(n,(function(){s.apply(this,arguments),this.kind=n}))},6258:(t,e,i)=>{var s=i(8276),n="name",r=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t.replace(/\\$/,""),this.resolution=e}));r.UNQUALIFIED_NAME="uqn",r.QUALIFIED_NAME="qn",r.FULL_QUALIFIED_NAME="fqn",r.RELATIVE_NAME="rn",t.exports=r},6827:(t,e,i)=>{var s=i(839),n="namedargument";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t,this.value=e}))},9474:(t,e,i)=>{var s=i(4628),n="namespace";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,e,r,h]),this.name=t,this.withBrackets=i||!1}))},4427:(t,e,i)=>{var s=i(839);t.exports=s.extends("new",(function(t,e,i,n){s.apply(this,["new",i,n]),this.what=t,this.arguments=e}))},4065:t=>{var e=function(t,e,i){this.kind=t,e&&(this.leadingComments=e),i&&(this.loc=i)};e.prototype.setTrailingComments=function(t){this.trailingComments=t},e.prototype.destroy=function(t){if(!t)throw new Error("Node already initialized, you must swap with another node");return this.leadingComments&&(t.leadingComments?t.leadingComments=Array.concat(this.leadingComments,t.leadingComments):t.leadingComments=this.leadingComments),this.trailingComments&&(t.trailingComments?t.trailingComments=Array.concat(this.trailingComments,t.trailingComments):t.trailingComments=this.trailingComments),t},e.prototype.includeToken=function(t){return this.loc&&(this.loc.end&&(this.loc.end.line=t.lexer.yylloc.last_line,this.loc.end.column=t.lexer.yylloc.last_column,this.loc.end.offset=t.lexer.offset),t.ast.withSource&&(this.loc.source=t.lexer._input.substring(this.loc.start.offset,t.lexer.offset))),this},e.extends=function(t,e){return e.prototype=Object.create(this.prototype),e.extends=this.extends,e.prototype.constructor=e,e.kind=t,e},t.exports=e},4297:(t,e,i)=>{var s=i(4065),n="noop";t.exports=s.extends(n,(function(t,e){s.apply(this,[n,t,e])}))},5859:(t,e,i)=>{var s=i(5514),n="nowdoc";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,t,e,r,h]),this.label=i}))},6985:(t,e,i)=>{var s=i(4065),n="nullkeyword";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.raw=t}))},9302:(t,e,i)=>{var s=i(7427),n="nullsafepropertylookup";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},8212:(t,e,i)=>{var s=i(5514),n="number";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},864:(t,e,i)=>{var s=i(7427),n="offsetlookup";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},8268:(t,e,i)=>{var s=i(839),n="operation";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[t||n,e,i])}))},7190:(t,e,i)=>{var s=i(8533),n="parameter";t.exports=s.extends(n,(function(t,e,i,r,h,o,a,_,l,c){s.apply(this,[n,t,l,c]),this.value=i,this.type=e,this.byref=r,this.variadic=h,this.readonly=o,this.nullable=a,this.flags=_||0,this.attrGroups=[]}))},8519:(t,e,i)=>{var s=i(8276),n="parentreference",r=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.raw=t}));t.exports=r},8822:t=>{t.exports=function(t,e,i){this.line=t,this.column=e,this.offset=i}},4835:(t,e,i)=>{var s=i(8268),n="post";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.type=t,this.what=e}))},2056:(t,e,i)=>{var s=i(8268);t.exports=s.extends("pre",(function(t,e,i,n){s.apply(this,["pre",i,n]),this.type=t,this.what=e}))},4838:(t,e,i)=>{var s=i(839),n="print";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.expression=t}))},7869:(t,e,i)=>{var s=i(4628),n="program";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,t,h,o]),this.errors=e,i&&(this.comments=i),r&&(this.tokens=r)}))},1908:(t,e,i)=>{var s=i(9672),n="property";t.exports=s.extends(n,(function(t,e,i,r,h,o,a,_){s.apply(this,[n,a,_]),this.name=t,this.value=e,this.readonly=i,this.nullable=r,this.type=h,this.attrGroups=o}))},170:(t,e,i)=>{var s=i(7427),n="propertylookup";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},1091:(t,e,i)=>{var s=i(9672),n="propertystatement",r=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.properties=e,this.parseFlags(i)}));r.prototype.parseFlags=function(t){-1===t[0]?this.visibility="":null===t[0]?this.visibility=null:0===t[0]?this.visibility="public":1===t[0]?this.visibility="protected":2===t[0]&&(this.visibility="private"),this.isStatic=1===t[1]},t.exports=r},8276:(t,e,i)=>{var s=i(4065),n="reference",r=s.extends(n,(function(t,e,i){s.apply(this,[t||n,e,i])}));t.exports=r},1842:(t,e,i)=>{var s=i(839),n="retif";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.test=t,this.trueExpr=e,this.falseExpr=i}))},5739:(t,e,i)=>{var s=i(9672),n="return";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.expr=t}))},1274:(t,e,i)=>{var s=i(8276),n="selfreference",r=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.raw=t}));t.exports=r},4352:(t,e,i)=>{var s=i(839),n="silent";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.expr=t}))},9672:(t,e,i)=>{var s=i(4065),n="statement";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[t||n,e,i])}))},711:(t,e,i)=>{var s=i(9672),n="static";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.variables=t}))},1865:(t,e,i)=>{var s=i(7427),n="staticlookup";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,e,i,r])}))},1102:(t,e,i)=>{var s=i(8276),n="staticreference",r=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.raw=t}));t.exports=r},1231:(t,e,i)=>{var s=i(4065),n="staticvariable";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.variable=t,this.defaultValue=e}))},7472:(t,e,i)=>{var s=i(5514),n="string";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,e,r,h,o]),this.unicode=i,this.isDoubleQuote=t}))},6133:(t,e,i)=>{var s=i(9672),n="switch";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.test=t,this.body=e,this.shortForm=i}))},1197:(t,e,i)=>{var s=i(9672),n="throw";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.what=t}))},6649:(t,e,i)=>{var s=i(8533),n="trait";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,t,i,r]),this.body=e}))},1837:(t,e,i)=>{var s=i(4065),n="traitalias";t.exports=s.extends(n,(function(t,e,i,r,h,o){s.apply(this,[n,h,o]),this.trait=t,this.method=e,this.as=i,this.visibility="",r&&(0===r[0]?this.visibility="public":1===r[0]?this.visibility="protected":2===r[0]&&(this.visibility="private"))}))},2277:(t,e,i)=>{var s=i(4065),n="traitprecedence";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.trait=t,this.method=e,this.instead=i}))},8010:(t,e,i)=>{var s=i(4065),n="traituse";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.traits=t,this.adaptations=e}))},7579:(t,e,i)=>{var s=i(9672);t.exports=s.extends("try",(function(t,e,i,n,r){s.apply(this,["try",n,r]),this.body=t,this.catches=e,this.always=i}))},3460:(t,e,i)=>{var s=i(8276),n="typereference",r=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t,this.raw=e}));r.types=["int","float","string","bool","object","array","callable","iterable","void","static"],t.exports=r},2702:(t,e,i)=>{var s=i(8268),n="unary";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.type=t,this.what=e}))},514:(t,e,i)=>{var s=i(8533),n="uniontype";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,null,e,i]),this.types=t}))},5684:(t,e,i)=>{var s=i(9672),n="unset";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.variables=t}))},8019:(t,e,i)=>{var s=i(9672),n="usegroup";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.name=t,this.type=e,this.items=i}))},7721:(t,e,i)=>{var s=i(9672),n="useitem",r=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.name=t,this.alias=e,this.type=i}));r.TYPE_CONST="const",r.TYPE_FUNCTION="function",t.exports=r},4369:(t,e,i)=>{var s=i(839),n="variable";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.name=t,this.curly=e||!1}))},40:(t,e,i)=>{var s=i(839),n="variadic";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.what=t}))},4919:(t,e,i)=>{var s=i(4065),n="variadicplaceholder";t.exports=s.extends(n,(function(t,e){s.apply(this,[n,t,e])}))},7676:(t,e,i)=>{var s=i(9672),n="while";t.exports=s.extends(n,(function(t,e,i,r,h){s.apply(this,[n,r,h]),this.test=t,this.body=e,this.shortForm=i}))},2596:(t,e,i)=>{var s=i(839),n="yield";t.exports=s.extends(n,(function(t,e,i,r){s.apply(this,[n,i,r]),this.value=t,this.key=e}))},6744:(t,e,i)=>{var s=i(839),n="yieldfrom";t.exports=s.extends(n,(function(t,e,i){s.apply(this,[n,e,i]),this.value=t}))},5362:(t,e,i)=>{function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var n=i(9108),r=i(7259),h=i(1906),o=i(8938);function a(t,e){for(var i=Object.keys(t),n=i.length;n--;){var r=i[n],h=t[r];null===h?delete e[r]:"function"==typeof h?e[r]=h.bind(e):Array.isArray(h)?e[r]=Array.isArray(e[r])?e[r].concat(h):h:"object"===s(h)?e[r]="object"===s(e[r])?a(h,e[r]):h:e[r]=h}return e}var _=function(t){if("function"==typeof this)return new this(t);if(this.tokens=h,this.lexer=new n(this),this.ast=new o,this.parser=new r(this.lexer,this.ast),t&&"object"===s(t)){if(t.parser&&(t.lexer||(t.lexer={}),t.parser.version)){if("string"==typeof t.parser.version){var e=t.parser.version.split(".");if(e=100*parseInt(e[0])+parseInt(e[1]),isNaN(e))throw new Error("Bad version number : "+t.parser.version);t.parser.version=e}else if("number"!=typeof t.parser.version)throw new Error("Expecting a number for version");if(t.parser.version<500||t.parser.version>900)throw new Error("Can only handle versions between 5.x to 8.x")}a(t,this),this.lexer.version=this.parser.version}},l=function(t){return"function"==typeof t.write?t.toString():t};_.create=function(t){return new _(t)},_.parseEval=function(t,e){return new _(e).parseEval(t)},_.prototype.parseEval=function(t){return this.lexer.mode_eval=!0,this.lexer.all_tokens=!1,t=l(t),this.parser.parse(t,"eval")},_.parseCode=function(t,e,i){return"object"!==s(e)||i||(i=e,e="unknown"),new _(i).parseCode(t,e)},_.prototype.parseCode=function(t,e){return this.lexer.mode_eval=!1,this.lexer.all_tokens=!1,t=l(t),this.parser.parse(t,e)},_.tokenGetAll=function(t,e){return new _(e).tokenGetAll(t)},_.prototype.tokenGetAll=function(t){this.lexer.mode_eval=!1,this.lexer.all_tokens=!0,t=l(t);var e=this.lexer.EOF,i=this.tokens.values;this.lexer.setInput(t);for(var s=this.lexer.lex()||e,n=[];s!=e;){var r=this.lexer.yytext;Object.prototype.hasOwnProperty.call(i,s)&&(r=[i[s],r,this.lexer.yylloc.first_line]),n.push(r),s=this.lexer.lex()||e}return n},t.exports=_,t.exports.tokens=h,t.exports.lexer=n,t.exports.AST=o,t.exports.parser=r,t.exports.combine=a,t.exports.Engine=_,t.exports.default=_},9108:(t,e,i)=>{function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var n=function(t){this.engine=t,this.tok=this.engine.tokens.names,this.EOF=1,this.debug=!1,this.all_tokens=!0,this.comment_tokens=!1,this.mode_eval=!1,this.asp_tags=!1,this.short_tags=!1,this.version=803,this.yyprevcol=0,this.keywords={__class__:this.tok.T_CLASS_C,__trait__:this.tok.T_TRAIT_C,__function__:this.tok.T_FUNC_C,__method__:this.tok.T_METHOD_C,__line__:this.tok.T_LINE,__file__:this.tok.T_FILE,__dir__:this.tok.T_DIR,__namespace__:this.tok.T_NS_C,exit:this.tok.T_EXIT,die:this.tok.T_EXIT,function:this.tok.T_FUNCTION,const:this.tok.T_CONST,return:this.tok.T_RETURN,try:this.tok.T_TRY,catch:this.tok.T_CATCH,finally:this.tok.T_FINALLY,throw:this.tok.T_THROW,if:this.tok.T_IF,elseif:this.tok.T_ELSEIF,endif:this.tok.T_ENDIF,else:this.tok.T_ELSE,while:this.tok.T_WHILE,endwhile:this.tok.T_ENDWHILE,do:this.tok.T_DO,for:this.tok.T_FOR,endfor:this.tok.T_ENDFOR,foreach:this.tok.T_FOREACH,endforeach:this.tok.T_ENDFOREACH,declare:this.tok.T_DECLARE,enddeclare:this.tok.T_ENDDECLARE,instanceof:this.tok.T_INSTANCEOF,as:this.tok.T_AS,switch:this.tok.T_SWITCH,endswitch:this.tok.T_ENDSWITCH,case:this.tok.T_CASE,default:this.tok.T_DEFAULT,break:this.tok.T_BREAK,continue:this.tok.T_CONTINUE,goto:this.tok.T_GOTO,echo:this.tok.T_ECHO,print:this.tok.T_PRINT,class:this.tok.T_CLASS,interface:this.tok.T_INTERFACE,trait:this.tok.T_TRAIT,enum:this.tok.T_ENUM,extends:this.tok.T_EXTENDS,implements:this.tok.T_IMPLEMENTS,new:this.tok.T_NEW,clone:this.tok.T_CLONE,var:this.tok.T_VAR,eval:this.tok.T_EVAL,include:this.tok.T_INCLUDE,include_once:this.tok.T_INCLUDE_ONCE,require:this.tok.T_REQUIRE,require_once:this.tok.T_REQUIRE_ONCE,namespace:this.tok.T_NAMESPACE,use:this.tok.T_USE,insteadof:this.tok.T_INSTEADOF,global:this.tok.T_GLOBAL,isset:this.tok.T_ISSET,empty:this.tok.T_EMPTY,__halt_compiler:this.tok.T_HALT_COMPILER,static:this.tok.T_STATIC,abstract:this.tok.T_ABSTRACT,final:this.tok.T_FINAL,private:this.tok.T_PRIVATE,protected:this.tok.T_PROTECTED,public:this.tok.T_PUBLIC,unset:this.tok.T_UNSET,list:this.tok.T_LIST,array:this.tok.T_ARRAY,callable:this.tok.T_CALLABLE,or:this.tok.T_LOGICAL_OR,and:this.tok.T_LOGICAL_AND,xor:this.tok.T_LOGICAL_XOR,match:this.tok.T_MATCH,readonly:this.tok.T_READ_ONLY},this.castKeywords={int:this.tok.T_INT_CAST,integer:this.tok.T_INT_CAST,real:this.tok.T_DOUBLE_CAST,double:this.tok.T_DOUBLE_CAST,float:this.tok.T_DOUBLE_CAST,string:this.tok.T_STRING_CAST,binary:this.tok.T_STRING_CAST,array:this.tok.T_ARRAY_CAST,object:this.tok.T_OBJECT_CAST,bool:this.tok.T_BOOL_CAST,boolean:this.tok.T_BOOL_CAST,unset:this.tok.T_UNSET_CAST}};n.prototype.setInput=function(t){return this._input=t,this.size=t.length,this.yylineno=1,this.offset=0,this.yyprevcol=0,this.yytext="",this.yylloc={first_offset:0,first_line:1,first_column:0,prev_offset:0,prev_line:1,prev_column:0,last_line:1,last_column:0},this.tokens=[],this.version>703?this.keywords.fn=this.tok.T_FN:delete this.keywords.fn,this.done=this.offset>=this.size,!this.all_tokens&&this.mode_eval?(this.conditionStack=["INITIAL"],this.begin("ST_IN_SCRIPTING")):(this.conditionStack=[],this.begin("INITIAL")),this.heredoc_label={label:"",length:0,indentation:0,indentation_uses_spaces:!1,finished:!1,first_encaps_node:!1,toString:function(){this.label}},this},n.prototype.input=function(){var t=this._input[this.offset];return t?(this.yytext+=t,this.offset++,"\r"===t&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++),"\n"===t||"\r"===t?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++,t):""},n.prototype.unput=function(t){if(1===t)this.offset--,"\n"===this._input[this.offset]&&"\r"===this._input[this.offset-1]&&(this.offset--,t++),"\r"===this._input[this.offset]||"\n"===this._input[this.offset]?(this.yylloc.last_line--,this.yylineno--,this.yylloc.last_column=this.yyprevcol):this.yylloc.last_column--,this.yytext=this.yytext.substring(0,this.yytext.length-t);else if(t>0)if(this.offset-=t,t<this.yytext.length){this.yytext=this.yytext.substring(0,this.yytext.length-t),this.yylloc.last_line=this.yylloc.first_line,this.yylloc.last_column=this.yyprevcol=this.yylloc.first_column;for(var e=0;e<this.yytext.length;e++){var i=this.yytext[e];"\r"===i?(i=this.yytext[++e],this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0,"\n"!==i&&("\r"===i?this.yylloc.last_line++:this.yylloc.last_column++)):"\n"===i?(this.yyprevcol=this.yylloc.last_column,this.yylloc.last_line++,this.yylloc.last_column=0):this.yylloc.last_column++}this.yylineno=this.yylloc.last_line}else this.yytext="",this.yylloc.last_line=this.yylineno=this.yylloc.first_line,this.yylloc.last_column=this.yylloc.first_column;return this},n.prototype.tryMatch=function(t){return t===this.ahead(t.length)},n.prototype.tryMatchCaseless=function(t){return t===this.ahead(t.length).toLowerCase()},n.prototype.ahead=function(t){var e=this._input.substring(this.offset,this.offset+t);return"\r"===e[e.length-1]&&"\n"===this._input[this.offset+t+1]&&(e+="\n"),e},n.prototype.consume=function(t){for(var e=0;e<t;e++){var i=this._input[this.offset];if(!i)break;this.yytext+=i,this.offset++,"\r"===i&&"\n"===this._input[this.offset]&&(this.yytext+="\n",this.offset++,e++),"\n"===i||"\r"===i?(this.yylloc.last_line=++this.yylineno,this.yyprevcol=this.yylloc.last_column,this.yylloc.last_column=0):this.yylloc.last_column++}return this},n.prototype.getState=function(){return{yytext:this.yytext,offset:this.offset,yylineno:this.yylineno,yyprevcol:this.yyprevcol,yylloc:{first_offset:this.yylloc.first_offset,first_line:this.yylloc.first_line,first_column:this.yylloc.first_column,last_line:this.yylloc.last_line,last_column:this.yylloc.last_column},heredoc_label:this.heredoc_label}},n.prototype.setState=function(t){return this.yytext=t.yytext,this.offset=t.offset,this.yylineno=t.yylineno,this.yyprevcol=t.yyprevcol,this.yylloc=t.yylloc,t.heredoc_label&&(this.heredoc_label=t.heredoc_label),this},n.prototype.appendToken=function(t,e){return this.tokens.push([t,e]),this},n.prototype.lex=function(){this.yylloc.prev_offset=this.offset,this.yylloc.prev_line=this.yylloc.last_line,this.yylloc.prev_column=this.yylloc.last_column;var t=this.next()||this.lex();if(!this.all_tokens){for(;t===this.tok.T_WHITESPACE||!this.comment_tokens&&(t===this.tok.T_COMMENT||t===this.tok.T_DOC_COMMENT)||t===this.tok.T_OPEN_TAG;)t=this.next()||this.lex();if(t==this.tok.T_OPEN_TAG_WITH_ECHO)return this.tok.T_ECHO;if(t===this.tok.T_CLOSE_TAG)return";"}return this.yylloc.prev_offset||(this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column),t},n.prototype.begin=function(t){if(this.conditionStack.push(t),this.curCondition=t,this.stateCb=this["match"+t],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+t+'"');return this},n.prototype.popState=function(){var t=this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0];if(this.curCondition=this.conditionStack[this.conditionStack.length-1],this.stateCb=this["match"+this.curCondition],"function"!=typeof this.stateCb)throw new Error('Undefined condition state "'+this.curCondition+'"');return t},n.prototype.next=function(){var t;if(this._input||(this.done=!0),this.yylloc.first_offset=this.offset,this.yylloc.first_line=this.yylloc.last_line,this.yylloc.first_column=this.yylloc.last_column,this.yytext="",this.done)return this.yylloc.prev_offset=this.yylloc.first_offset,this.yylloc.prev_line=this.yylloc.first_line,this.yylloc.prev_column=this.yylloc.first_column,this.EOF;if(this.tokens.length>0?("object"===s((t=this.tokens.shift())[1])?this.setState(t[1]):this.consume(t[1]),t=t[0]):t=this.stateCb.apply(this,[]),this.offset>=this.size&&0===this.tokens.length&&(this.done=!0),this.debug){var e=t;e="number"==typeof e?this.engine.tokens.values[e]:'"'+e+'"';var i=new Error(e+"\tfrom "+this.yylloc.first_line+","+this.yylloc.first_column+"\t - to "+this.yylloc.last_line+","+this.yylloc.last_column+'\t"'+this.yytext+'"');console.error(i.stack)}return t},[i(9671),i(2429),i(3683),i(6545),i(3810),i(8510),i(4401),i(4349),i(8582)].forEach((function(t){for(var e in t)n.prototype[e]=t[e]})),t.exports=n},9671:t=>{t.exports={attributeIndex:0,attributeListDepth:{},matchST_ATTRIBUTE:function(){var t=this.input();if(this.is_WHITESPACE()){do{t=this.input()}while(this.is_WHITESPACE());return this.unput(1),null}switch(t){case"]":return 0===this.attributeListDepth[this.attributeIndex]?(delete this.attributeListDepth[this.attributeIndex],this.attributeIndex--,this.popState()):this.attributeListDepth[this.attributeIndex]--,"]";case"(":case")":case":":case"=":case"|":case"&":case"^":case"-":case"+":case"*":case"%":case"~":case"<":case">":case"!":case".":return this.consume_TOKEN();case"[":return this.attributeListDepth[this.attributeIndex]++,"[";case",":return",";case'"':return this.ST_DOUBLE_QUOTES();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN()}if(this.is_LABEL_START()||"\\"===t){for(;this.offset<this.size;){var e=this.input();if(!this.is_LABEL()&&"\\"!==e){e&&this.unput(1);break}}return this.T_STRING()}if(this.is_NUM())return this.consume_NUM();throw new Error('Bad terminal sequence "'.concat(t,'" at line ').concat(this.yylineno," (offset ").concat(this.offset,")"))}}},2429:t=>{t.exports={T_COMMENT:function(){for(;this.offset<this.size;){var t=this.input();if("\n"===t||"\r"===t)return this.tok.T_COMMENT;if("?"===t&&!this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT;if("%"===t&&this.aspTagMode&&">"===this._input[this.offset])return this.unput(1),this.tok.T_COMMENT}return this.tok.T_COMMENT},T_DOC_COMMENT:function(){var t=this.input(),e=this.tok.T_COMMENT;if("*"===t){if(t=this.input(),this.is_WHITESPACE()&&(e=this.tok.T_DOC_COMMENT),"/"===t)return e;this.unput(1)}for(;this.offset<this.size;)if("*"===(t=this.input())&&"/"===this._input[this.offset]){this.input();break}return e}}},3683:t=>{t.exports={nextINITIAL:function(){return this.conditionStack.length>1&&"INITIAL"===this.conditionStack[this.conditionStack.length-1]?this.popState():this.begin("ST_IN_SCRIPTING"),this},matchINITIAL:function(){for(;this.offset<this.size;){var t=this.input();if("<"==t)if("?"==(t=this.ahead(1))){if(this.tryMatch("?=")){this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}if(this.tryMatchCaseless("?php")&&(" "===(t=this._input[this.offset+4])||"\t"===t||"\n"===t||"\r"===t)){this.unput(1).appendToken(this.tok.T_OPEN_TAG,6).nextINITIAL();break}if(this.short_tags){this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}else if(this.asp_tags&&"%"==t){if(this.tryMatch("%=")){this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG_WITH_ECHO,3).nextINITIAL();break}this.aspTagMode=!0,this.unput(1).appendToken(this.tok.T_OPEN_TAG,2).nextINITIAL();break}}return this.yytext.length>0&&this.tok.T_INLINE_HTML}}},6545:t=>{t.exports={consume_NUM:function(){var t=this.yytext[0],e="."===t;if("0"===t)if("x"===(t=this.input())||"X"===t){if("_"!==(t=this.input())&&this.is_HEX())return this.consume_HNUM();this.unput(t?2:1)}else if("b"===t||"B"===t){if("_"!==(t=this.input())&&"0"===t||"1"===t)return this.consume_BNUM();this.unput(t?2:1)}else if("o"===t||"O"===t){if("_"!==(t=this.input())&&this.is_OCTAL())return this.consume_ONUM();this.unput(t?2:1)}else this.is_NUM()||t&&this.unput(1);for(;this.offset<this.size;){var i=t;if("_"===(t=this.input())){if("_"===i){this.unput(2);break}if("."===i){this.unput(1);break}if("e"===i||"E"===i){this.unput(2);break}}else{if("."===t){if(e){this.unput(1);break}if("_"===i){this.unput(2);break}e=!0;continue}if("e"===t||"E"===t){if("_"===i){this.unput(1);break}var s=2;if("+"!==(t=this.input())&&"-"!==t||(s=3,t=this.input()),this.is_NUM_START())return this.consume_LNUM(),this.tok.T_DNUMBER;this.unput(t?s:s-1);break}}if(!this.is_NUM()){t&&this.unput(1);break}}return e?this.tok.T_DNUMBER:this.yytext.length<18||this.yytext.length<19||19==this.yytext.length&&this.yytext<"9223372036854775808"?this.tok.T_LNUMBER:this.tok.T_DNUMBER},consume_HNUM:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_HEX()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_LNUM:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_NUM()){t&&this.unput(1);break}}return this.tok.T_LNUMBER},consume_BNUM:function(){for(var t;this.offset<this.size;)if("0"!==(t=this.input())&&"1"!==t&&"_"!==t){t&&this.unput(1);break}return this.tok.T_LNUMBER},consume_ONUM:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_OCTAL()){t&&this.unput(1);break}}return this.tok.T_LNUMBER}}},3810:t=>{t.exports={matchST_LOOKING_FOR_PROPERTY:function(){var t=this.input();if("-"===t){if(">"===(t=this.input()))return this.tok.T_OBJECT_OPERATOR;t&&this.unput(1)}else{if(this.is_WHITESPACE())return this.tok.T_WHITESPACE;if(this.is_LABEL_START())return this.consume_LABEL(),this.popState(),this.tok.T_STRING}return this.popState(),t&&this.unput(1),!1},matchST_LOOKING_FOR_VARNAME:function(){var t=this.input();if(this.popState(),this.begin("ST_IN_SCRIPTING"),this.is_LABEL_START()){if(this.consume_LABEL(),"["===(t=this.input())||"}"===t)return this.unput(1),this.tok.T_STRING_VARNAME;this.unput(this.yytext.length)}else t&&this.unput(1);return!1},matchST_VAR_OFFSET:function(){var t=this.input();if(this.is_NUM_START())return this.consume_NUM(),this.tok.T_NUM_STRING;if("]"===t)return this.popState(),"]";if("$"===t){if(this.input(),this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_VARIABLE;throw new Error("Unexpected terminal")}if(this.is_LABEL_START())return this.consume_LABEL(),this.tok.T_STRING;if(this.is_WHITESPACE()||"\\"===t||"'"===t||"#"===t)return this.tok.T_ENCAPSED_AND_WHITESPACE;if("["===t||"{"===t||"}"===t||'"'===t||"`"===t||this.is_TOKEN())return t;throw new Error("Unexpected terminal")}}},8510:t=>{t.exports={matchST_IN_SCRIPTING:function(){var t=this.input();switch(t){case" ":case"\t":case"\n":case"\r":case"\r\n":return this.T_WHITESPACE();case"#":return this.version>=800&&"["===this._input[this.offset]?(this.input(),this.attributeListDepth[++this.attributeIndex]=0,this.begin("ST_ATTRIBUTE"),this.tok.T_ATTRIBUTE):this.T_COMMENT();case"/":return"/"===this._input[this.offset]?this.T_COMMENT():"*"===this._input[this.offset]?(this.input(),this.T_DOC_COMMENT()):this.consume_TOKEN();case"'":return this.T_CONSTANT_ENCAPSED_STRING();case'"':return this.ST_DOUBLE_QUOTES();case"`":return this.begin("ST_BACKQUOTE"),"`";case"?":if(!this.aspTagMode&&this.tryMatch(">")){this.input();var e=this._input[this.offset];return"\n"!==e&&"\r"!==e||this.input(),this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG}return this.consume_TOKEN();case"%":return this.aspTagMode&&">"===this._input[this.offset]?(this.input(),"\n"!==(t=this._input[this.offset])&&"\r"!==t||this.input(),this.aspTagMode=!1,this.conditionStack.length>1&&this.begin("INITIAL"),this.tok.T_CLOSE_TAG):this.consume_TOKEN();case"{":return this.begin("ST_IN_SCRIPTING"),"{";case"}":return this.conditionStack.length>2&&this.popState(),"}";default:if("."===t){if(t=this.input(),this.is_NUM_START())return this.consume_NUM();t&&this.unput(1)}if(this.is_NUM_START())return this.consume_NUM();if(this.is_LABEL_START())return this.consume_LABEL().T_STRING();if(this.is_TOKEN())return this.consume_TOKEN()}throw new Error('Bad terminal sequence "'+t+'" at line '+this.yylineno+" (offset "+this.offset+")")},T_WHITESPACE:function(){for(;this.offset<this.size;){var t=this.input();if(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t){t&&this.unput(1);break}}return this.tok.T_WHITESPACE}}},4401:t=>{var e=["\n","\r"],i=["\n","\r",";"],s=i.concat(["\t"," ",",","]",")","/","=","!"]);t.exports={T_CONSTANT_ENCAPSED_STRING:function(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else if("'"==t)break;return this.tok.T_CONSTANT_ENCAPSED_STRING},is_HEREDOC:function(){var t=this.offset;if("<"===this._input[this.offset-1]&&"<"===this._input[this.offset]&&"<"===this._input[this.offset+1]){if(this.offset+=3,this.is_TABSPACE())for(;this.offset<this.size&&(this.offset++,this.is_TABSPACE()););var i=this._input[this.offset-1];if("'"===i||'"'===i?this.offset++:i=null,this.is_LABEL_START()){for(var s=this.offset-1;this.offset<this.size&&(this.offset++,this.is_LABEL()););var n=this._input.substring(s,this.offset-1);if((!i||i===this._input[this.offset-1])&&(i&&this.offset++,e.includes(this._input[this.offset-1])))return this.heredoc_label.label=n,this.heredoc_label.length=n.length,this.heredoc_label.finished=!1,s=this.offset-t,this.offset=t,this.consume(s),"'"===i?this.begin("ST_NOWDOC"):this.begin("ST_HEREDOC"),this.prematch_ENDOFDOC(),this.tok.T_START_HEREDOC}}return this.offset=t,!1},ST_DOUBLE_QUOTES:function(){for(var t;this.offset<this.size;)if("\\"==(t=this.input()))this.input();else{if('"'==t)break;if("$"==t){if("{"==(t=this.input())||this.is_LABEL_START()){this.unput(2);break}t&&this.unput(1)}else if("{"==t){if("$"==(t=this.input())){this.unput(2);break}t&&this.unput(1)}}if('"'==t)return this.tok.T_CONSTANT_ENCAPSED_STRING;var e=1;return"b"!==this.yytext[0]&&"B"!==this.yytext[0]||(e=2),this.yytext.length>2&&this.appendToken(this.tok.T_ENCAPSED_AND_WHITESPACE,this.yytext.length-e),this.unput(this.yytext.length-e),this.begin("ST_DOUBLE_QUOTES"),this.yytext},isDOC_MATCH:function(t,n){var r=this._input[t-2];if(!e.includes(r))return!1;var h=!1,o=!1,a=0,_=this._input[t-1];if(this.version>=703){for(;"\t"===_||" "===_;)" "===_?h=!0:"\t"===_&&(o=!0),_=this._input[t+a],a++;if(t+=a,e.includes(this._input[t-1]))return!1}if(this._input.substring(t-1,t-1+this.heredoc_label.length)===this.heredoc_label.label){var l=this._input[t-1+this.heredoc_label.length];if((this.version>=703?s:i).includes(l)){if(n){if(this.consume(a),h&&o)throw new Error("Parse error: mixing spaces and tabs in ending marker at line "+this.yylineno+" (offset "+this.offset+")")}else this.heredoc_label.indentation=a,this.heredoc_label.indentation_uses_spaces=h,this.heredoc_label.first_encaps_node=!0;return!0}}return!1},prematch_ENDOFDOC:function(){this.heredoc_label.indentation_uses_spaces=!1,this.heredoc_label.indentation=0,this.heredoc_label.first_encaps_node=!0;for(var t=this.offset+1;t<this._input.length;){if(this.isDOC_MATCH(t,!1))return;if(!e.includes(this._input[t-1]))for(;!e.includes(this._input[t++])&&t<this._input.length;);t++}},matchST_NOWDOC:function(){if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length),this.popState(),this.tok.T_END_HEREDOC;for(var t=this._input[this.offset-1];this.offset<this.size;)if(e.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_HEREDOC:function(){var t=this.input();if(this.isDOC_MATCH(this.offset,!0))return this.consume(this.heredoc_label.length-1),this.popState(),this.tok.T_END_HEREDOC;for(;this.offset<this.size;)if("\\"===t&&(t=this.input(),e.includes(t)||(t=this.input())),e.includes(t)){if(t=this.input(),this.isDOC_MATCH(this.offset,!0))return this.unput(1).popState(),this.appendToken(this.tok.T_END_HEREDOC,this.heredoc_label.length),this.tok.T_ENCAPSED_AND_WHITESPACE}else if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var i=this.offset,s=this.consume_VARIABLE();return this.yytext.length>this.offset-i+2?(this.appendToken(s,this.offset-i+2),this.unput(this.offset-i+2),this.tok.T_ENCAPSED_AND_WHITESPACE):s}}else if("{"===t){if("$"===(t=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN)}else t=this.input();return this.tok.T_ENCAPSED_AND_WHITESPACE},consume_VARIABLE:function(){this.consume_LABEL();var t=this.input();if("["==t)return this.unput(1),this.begin("ST_VAR_OFFSET"),this.tok.T_VARIABLE;if("-"===t){if(">"===this.input())return this.input(),this.is_LABEL_START()&&this.begin("ST_LOOKING_FOR_PROPERTY"),this.unput(3),this.tok.T_VARIABLE;this.unput(2)}else t&&this.unput(1);return this.tok.T_VARIABLE},matchST_BACKQUOTE:function(){var t=this.input();if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if("`"===t)return this.popState(),"`";for(;this.offset<this.size;){if("\\"===t)this.input();else{if("`"===t){this.unput(1),this.popState(),this.appendToken("`",1);break}if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}continue}if("{"===t){if("$"===(t=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);continue}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE},matchST_DOUBLE_QUOTES:function(){var t=this.input();if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START())return this.consume_VARIABLE()}else if("{"===t){if("$"===this._input[this.offset])return this.begin("ST_IN_SCRIPTING"),this.tok.T_CURLY_OPEN}else if('"'===t)return this.popState(),'"';for(;this.offset<this.size;){if("\\"===t)this.input();else{if('"'===t){this.unput(1),this.popState(),this.appendToken('"',1);break}if("$"===t){if("{"===(t=this.input()))return this.begin("ST_LOOKING_FOR_VARNAME"),this.yytext.length>2?(this.appendToken(this.tok.T_DOLLAR_OPEN_CURLY_BRACES,2),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):this.tok.T_DOLLAR_OPEN_CURLY_BRACES;if(this.is_LABEL_START()){var e=this.offset,i=this.consume_VARIABLE();return this.yytext.length>this.offset-e+2?(this.appendToken(i,this.offset-e+2),this.unput(this.offset-e+2),this.tok.T_ENCAPSED_AND_WHITESPACE):i}t&&this.unput(1)}else if("{"===t){if("$"===(t=this.input()))return this.begin("ST_IN_SCRIPTING"),this.yytext.length>2?(this.appendToken(this.tok.T_CURLY_OPEN,1),this.unput(2),this.tok.T_ENCAPSED_AND_WHITESPACE):(this.unput(1),this.tok.T_CURLY_OPEN);t&&this.unput(1)}}t=this.input()}return this.tok.T_ENCAPSED_AND_WHITESPACE}}},4349:t=>{t.exports={T_STRING:function(){var t=this.yytext.toLowerCase(),e=this.keywords[t];if("number"!=typeof e)if("yield"===t)this.version>=700&&this.tryMatch(" from")?(this.consume(5),e=this.tok.T_YIELD_FROM):e=this.tok.T_YIELD;else if(e=this.tok.T_STRING,"b"===t||"B"===t){var i=this.input();if('"'===i)return this.ST_DOUBLE_QUOTES();if("'"===i)return this.T_CONSTANT_ENCAPSED_STRING();i&&this.unput(1)}if(e===this.tok.T_ENUM){if(this.version<801)return this.tok.T_STRING;for(var s=this.offset,n=this.input();" "==n;)n=this.input();var r=!1;if(this.is_LABEL_START()){for(;this.is_LABEL();)n+=this.input();var h=n.slice(0,-1).toLowerCase();r="extends"!==h&&"implements"!==h}return this.unput(this.offset-s),r?this.tok.T_ENUM:this.tok.T_STRING}if(this.offset<this.size&&e!==this.tok.T_YIELD_FROM){var o=this.input();if("\\"===o){e="namespace"===t?this.tok.T_NAME_RELATIVE:this.tok.T_NAME_QUALIFIED;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),o=this.input()}while("\\"===o)}o&&this.unput(1)}return e},consume_TOKEN:function(){var t=this._input[this.offset-1],e=this.tokenTerminals[t];return e?e.apply(this,[]):this.yytext},tokenTerminals:{$:function(){return this.offset++,this.is_LABEL_START()?(this.offset--,this.consume_LABEL(),this.tok.T_VARIABLE):(this.offset--,"$")},"-":function(){var t=this._input[this.offset];return">"===t?(this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_OBJECT_OPERATOR):"-"===t?(this.input(),this.tok.T_DEC):"="===t?(this.input(),this.tok.T_MINUS_EQUAL):"-"},"\\":function(){if(this.offset<this.size){if(this.input(),this.is_LABEL_START()){var t;do{if("{"===this._input[this.offset]){this.input();break}this.consume_LABEL(),t=this.input()}while("\\"===t);return this.unput(1),this.tok.T_NAME_FULLY_QUALIFIED}this.unput(1)}return this.tok.T_NS_SEPARATOR},"/":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_DIV_EQUAL):"/"},":":function(){return":"===this._input[this.offset]?(this.input(),this.tok.T_DOUBLE_COLON):":"},"(":function(){var t=this.offset;if(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),this.is_LABEL_START()){var e=this.yytext.length;this.consume_LABEL();var i=this.yytext.substring(e-1).toLowerCase(),s=this.castKeywords[i];if("number"==typeof s&&(this.input(),this.is_TABSPACE()&&this.consume_TABSPACE().input(),")"===this._input[this.offset-1]))return s}return this.unput(this.offset-t),"("},"=":function(){var t=this._input[this.offset];return">"===t?(this.input(),this.tok.T_DOUBLE_ARROW):"="===t?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_IDENTICAL):(this.input(),this.tok.T_IS_EQUAL):"="},"+":function(){var t=this._input[this.offset];return"+"===t?(this.input(),this.tok.T_INC):"="===t?(this.input(),this.tok.T_PLUS_EQUAL):"+"},"!":function(){return"="===this._input[this.offset]?"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_IS_NOT_IDENTICAL):(this.input(),this.tok.T_IS_NOT_EQUAL):"!"},"?":function(){return this.version>=700&&"?"===this._input[this.offset]?this.version>=704&&"="===this._input[this.offset+1]?(this.consume(2),this.tok.T_COALESCE_EQUAL):(this.input(),this.tok.T_COALESCE):this.version>=800&&"-"===this._input[this.offset]&&">"===this._input[this.offset+1]?(this.consume(1),this.begin("ST_LOOKING_FOR_PROPERTY").input(),this.tok.T_NULLSAFE_OBJECT_OPERATOR):"?"},"<":function(){var t=this._input[this.offset];return"<"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SL_EQUAL):"<"===t&&this.is_HEREDOC()?this.tok.T_START_HEREDOC:(this.input(),this.tok.T_SL):"="===t?(this.input(),this.version>=700&&">"===this._input[this.offset]?(this.input(),this.tok.T_SPACESHIP):this.tok.T_IS_SMALLER_OR_EQUAL):">"===t?(this.input(),this.tok.T_IS_NOT_EQUAL):"<"},">":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_IS_GREATER_OR_EQUAL):">"===t?"="===(t=this._input[this.offset+1])?(this.consume(2),this.tok.T_SR_EQUAL):(this.input(),this.tok.T_SR):">"},"*":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_MUL_EQUAL):"*"===t?(this.input(),"="===this._input[this.offset]?(this.input(),this.tok.T_POW_EQUAL):this.tok.T_POW):"*"},".":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_CONCAT_EQUAL):"."===t&&"."===this._input[this.offset+1]?(this.consume(2),this.tok.T_ELLIPSIS):"."},"%":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_MOD_EQUAL):"%"},"&":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_AND_EQUAL):"&"===t?(this.input(),this.tok.T_BOOLEAN_AND):"&"},"|":function(){var t=this._input[this.offset];return"="===t?(this.input(),this.tok.T_OR_EQUAL):"|"===t?(this.input(),this.tok.T_BOOLEAN_OR):"|"},"^":function(){return"="===this._input[this.offset]?(this.input(),this.tok.T_XOR_EQUAL):"^"}}}},8582:t=>{t.exports={is_NUM:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||95===t},is_NUM_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58},is_LABEL:function(){var t=this._input.charCodeAt(this.offset-1);return t>96&&t<123||t>64&&t<91||95===t||t>47&&t<58||t>126},is_LABEL_START:function(){var t=this._input.charCodeAt(this.offset-1);return t>64&&t<91||t>96&&t<123||95===t||t>126},consume_LABEL:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_LABEL()){t&&this.unput(1);break}}return this},is_TOKEN:function(){var t=this._input[this.offset-1];return-1!==";:,.\\[]()|^&+-/*=%!~$<>?@".indexOf(t)},is_WHITESPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t||"\n"===t||"\r"===t},is_TABSPACE:function(){var t=this._input[this.offset-1];return" "===t||"\t"===t},consume_TABSPACE:function(){for(;this.offset<this.size;){var t=this.input();if(!this.is_TABSPACE()){t&&this.unput(1);break}}return this},is_HEX:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<58||t>64&&t<71||t>96&&t<103||95===t},is_OCTAL:function(){var t=this._input.charCodeAt(this.offset-1);return t>47&&t<56||95===t}}},7259:(t,e,i)=>{var s=i(8822);function n(t){return"."!=t&&","!=t&&!isNaN(parseFloat(t))&&isFinite(t)}var r=function(t,e){this.lexer=t,this.ast=e,this.tok=t.tok,this.EOF=t.EOF,this.token=null,this.prev=null,this.debug=!1,this.version=803,this.extractDoc=!1,this.extractTokens=!1,this.suppressErrors=!1;var i=function(t){return[t,null]};this.entries={IDENTIFIER:new Map([this.tok.T_ABSTRACT,this.tok.T_ARRAY,this.tok.T_AS,this.tok.T_BREAK,this.tok.T_CALLABLE,this.tok.T_CASE,this.tok.T_CATCH,this.tok.T_CLASS,this.tok.T_CLASS_C,this.tok.T_CLONE,this.tok.T_CONST,this.tok.T_CONTINUE,this.tok.T_DECLARE,this.tok.T_DEFAULT,this.tok.T_DIR,this.tok.T_DO,this.tok.T_ECHO,this.tok.T_ELSE,this.tok.T_ELSEIF,this.tok.T_EMPTY,this.tok.T_ENDDECLARE,this.tok.T_ENDFOR,this.tok.T_ENDFOREACH,this.tok.T_ENDIF,this.tok.T_ENDSWITCH,this.tok.T_ENDWHILE,this.tok.T_ENUM,this.tok.T_EVAL,this.tok.T_EXIT,this.tok.T_EXTENDS,this.tok.T_FILE,this.tok.T_FINAL,this.tok.T_FINALLY,this.tok.T_FN,this.tok.T_FOR,this.tok.T_FOREACH,this.tok.T_FUNC_C,this.tok.T_FUNCTION,this.tok.T_GLOBAL,this.tok.T_GOTO,this.tok.T_IF,this.tok.T_IMPLEMENTS,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_INSTANCEOF,this.tok.T_INSTEADOF,this.tok.T_INTERFACE,this.tok.T_ISSET,this.tok.T_LINE,this.tok.T_LIST,this.tok.T_LOGICAL_AND,this.tok.T_LOGICAL_OR,this.tok.T_LOGICAL_XOR,this.tok.T_MATCH,this.tok.T_METHOD_C,this.tok.T_NAMESPACE,this.tok.T_NEW,this.tok.T_NS_C,this.tok.T_PRINT,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_PUBLIC,this.tok.T_READ_ONLY,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_RETURN,this.tok.T_STATIC,this.tok.T_SWITCH,this.tok.T_THROW,this.tok.T_TRAIT,this.tok.T_TRY,this.tok.T_UNSET,this.tok.T_USE,this.tok.T_VAR,this.tok.T_WHILE,this.tok.T_YIELD].map(i)),VARIABLE:new Map([this.tok.T_VARIABLE,"$","&",this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE,this.tok.T_STATIC].map(i)),SCALAR:new Map([this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(i)),T_MAGIC_CONST:new Map([this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C].map(i)),T_MEMBER_FLAGS:new Map([this.tok.T_PUBLIC,this.tok.T_PRIVATE,this.tok.T_PROTECTED,this.tok.T_STATIC,this.tok.T_ABSTRACT,this.tok.T_FINAL].map(i)),EOS:new Map([";",this.EOF,this.tok.T_INLINE_HTML].map(i)),EXPR:new Map(["@","-","+","!","~","(","`",this.tok.T_LIST,this.tok.T_CLONE,this.tok.T_INC,this.tok.T_DEC,this.tok.T_NEW,this.tok.T_ISSET,this.tok.T_EMPTY,this.tok.T_MATCH,this.tok.T_INCLUDE,this.tok.T_INCLUDE_ONCE,this.tok.T_REQUIRE,this.tok.T_REQUIRE_ONCE,this.tok.T_EVAL,this.tok.T_INT_CAST,this.tok.T_DOUBLE_CAST,this.tok.T_STRING_CAST,this.tok.T_ARRAY_CAST,this.tok.T_OBJECT_CAST,this.tok.T_BOOL_CAST,this.tok.T_UNSET_CAST,this.tok.T_EXIT,this.tok.T_PRINT,this.tok.T_YIELD,this.tok.T_STATIC,this.tok.T_FUNCTION,this.tok.T_FN,this.tok.T_VARIABLE,"$",this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_STRING,this.tok.T_CONSTANT_ENCAPSED_STRING,this.tok.T_START_HEREDOC,this.tok.T_LNUMBER,this.tok.T_DNUMBER,this.tok.T_ARRAY,"[",this.tok.T_CLASS_C,this.tok.T_TRAIT_C,this.tok.T_FUNC_C,this.tok.T_METHOD_C,this.tok.T_LINE,this.tok.T_FILE,this.tok.T_DIR,this.tok.T_NS_C,'"','b"','B"',"-",this.tok.T_NS_SEPARATOR].map(i))}};r.prototype.getTokenName=function(t){return n(t)?t==this.EOF?"the end of file (EOF)":this.lexer.engine.tokens.values[t]:"'"+t+"'"},r.prototype.parse=function(t,e){this._errors=[],this.filename=e||"eval",this.currentNamespace=[""],this.extractDoc?this._docs=[]:this._docs=null,this.extractTokens?this._tokens=[]:this._tokens=null,this._docIndex=0,this._lastNode=null,this.lexer.setInput(t),this.lexer.all_tokens=this.extractTokens,this.lexer.comment_tokens=this.extractDoc,this.length=this.lexer._input.length,this.innerList=!1,this.innerListForm=!1;var i=this.node("program"),s=[];for(this.next();this.token!=this.EOF;)s.push(this.read_start());0===s.length&&this.extractDoc&&this._docs.length>this._docIndex&&s.push(this.node("noop")()),this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset];var n=i(s,this._errors,this._docs,this._tokens);if(this.debug){var r=this.ast.checkNodes();if(r.length>0)throw r.forEach((function(t){t.position&&console.log("Node at line "+t.position.line+", column "+t.position.column),console.log(t.stack.join("\n"))})),new Error("Some nodes are not closed")}return n},r.prototype.raiseError=function(t,e,i,s){if(t+=" on line "+this.lexer.yylloc.first_line,!this.suppressErrors){var n=new SyntaxError(t,this.filename,this.lexer.yylloc.first_line);throw n.lineNumber=this.lexer.yylloc.first_line,n.fileName=this.filename,n.columnNumber=this.lexer.yylloc.first_column,n}var r=this.ast.prepare("error",null,this)(t,s,this.lexer.yylloc.first_line,i);return this._errors.push(r),r},r.prototype.error=function(t){var e="Parse Error : syntax error",i=this.getTokenName(this.token),s="";if(this.token!==this.EOF){if(n(this.token)){var r=this.text();r.length>10&&(r=r.substring(0,7)+"..."),i="'"+r+"' ("+i+")"}e+=", unexpected "+i}return t&&!Array.isArray(t)&&((n(t)||1===t.length)&&(s=", expecting "+this.getTokenName(t)),e+=s),this.raiseError(e,s,t,i)},r.prototype.position=function(){return new s(this.lexer.yylloc.first_line,this.lexer.yylloc.first_column,this.lexer.yylloc.first_offset)},r.prototype.node=function(t){if(this.extractDoc){var e=null;this._docIndex<this._docs.length&&(e=this._docs.slice(this._docIndex),this._docIndex=this._docs.length,this.debug&&(console.log(new Error("Append docs on "+t)),console.log(e)));var i=this.ast.prepare(t,e,this);return i.postBuild=function(t){if(this._docIndex<this._docs.length)if(this._lastNode){for(var e=this.prev[2],i=this._docIndex;i<this._docs.length&&!(this._docs[i].offset>e);i++);i>this._docIndex&&(this._lastNode.setTrailingComments(this._docs.slice(this._docIndex,i)),this._docIndex=i)}else this.token===this.EOF&&(t.setTrailingComments(this._docs.slice(this._docIndex)),this._docIndex=this._docs.length);this._lastNode=t}.bind(this),i}return this.ast.prepare(t,null,this)},r.prototype.expectEndOfStatement=function(t){if(";"===this.token)t&&";"===this.lexer.yytext&&t.includeToken(this);else if(this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF)return this.error(";"),!1;return this.next(),!0};var h=["parser.next","parser.node","parser.showlog"];r.prototype.showlog=function(){for(var t,e=(new Error).stack.split("\n"),i=2;i<e.length;i++){t=e[i].trim();for(var s=!1,n=0;n<h.length;n++)if(t.substring(3,3+h[n].length)===h[n]){s=!0;break}if(!s)break}return console.log("Line "+this.lexer.yylloc.first_line+" : "+this.getTokenName(this.token)+">"+this.lexer.yytext+"< @--\x3e"+t),this},r.prototype.expect=function(t){if(Array.isArray(t)){if(-1===t.indexOf(this.token))return this.error(t),!1}else if(this.token!=t)return this.error(t),!1;return!0},r.prototype.text=function(){return this.lexer.yytext},r.prototype.next=function(){if(";"===this.token&&";"!==this.lexer.yytext||(this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset]),this.lex(),this.debug&&this.showlog(),this.extractDoc)for(;this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT;)this.token===this.tok.T_COMMENT?this._docs.push(this.read_comment()):this._docs.push(this.read_doc_comment());return this},r.prototype.peek=function(){var t=this.lexer.getState(),e=this.lexer.lex();return this.lexer.setState(t),e},r.prototype.lex=function(){if(this.extractTokens)do{if(this.token=this.lexer.lex()||this.EOF,this.token===this.EOF)return this;var t=this.lexer.yytext;if(t=Object.prototype.hasOwnProperty.call(this.lexer.engine.tokens.values,this.token)?[this.lexer.engine.tokens.values[this.token],t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset]:[null,t,this.lexer.yylloc.first_line,this.lexer.yylloc.first_offset,this.lexer.offset],this._tokens.push(t),this.token===this.tok.T_CLOSE_TAG)return this.token=";",this;if(this.token===this.tok.T_OPEN_TAG_WITH_ECHO)return this.token=this.tok.T_ECHO,this}while(this.token===this.tok.T_WHITESPACE||!this.extractDoc&&(this.token===this.tok.T_COMMENT||this.token===this.tok.T_DOC_COMMENT)||this.token===this.tok.T_OPEN_TAG);else this.token=this.lexer.lex()||this.EOF;return this},r.prototype.is=function(t){return Array.isArray(t)?-1!==t.indexOf(this.token):this.entries[t].has(this.token)},[i(5525),i(7072),i(3997),i(6477),i(979),i(8214),i(9461),i(5931),i(9147),i(9219),i(7170),i(6261),i(2478),i(77),i(6077),i(1130)].forEach((function(t){for(var e in t){if(Object.prototype.hasOwnProperty.call(r.prototype,e))throw new Error("Function "+e+" is already defined - collision");r.prototype[e]=t[e]}})),t.exports=r},5525:t=>{t.exports={read_array:function(){var t=null,e=!1,i=this.node("array");this.token===this.tok.T_ARRAY?(this.next().expect("("),t=")"):(e=!0,t="]");var s=[];return this.next().token!==t&&(s=this.read_array_pair_list(e)),this.expect(t),this.next(),i(e,s)},read_array_pair_list:function(t){var e=this;return this.read_list((function(){return e.read_array_pair(t)}),",",!0)},read_array_pair:function(t){if(!(!t&&")"===this.token||t&&"]"===this.token)){if(","===this.token)return this.node("noop")();var e=this.node("entry"),i=null,s=null,n=!1,r=!1;if("&"===this.token)this.next(),n=!0,s=this.read_variable(!0,!1);else if(this.token===this.tok.T_ELLIPSIS&&this.version>=704)this.next(),"&"===this.token&&this.error(),r=!0,s=this.read_expr();else{var h=this.read_expr();this.token===this.tok.T_DOUBLE_ARROW?(this.next(),i=h,"&"===this.token?(this.next(),n=!0,s=this.read_variable(!0,!1)):s=this.read_expr()):s=h}return e(i,s,n,r)}}}},7072:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var s,n,r,h,o=[],a=!0,_=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;a=!1}else for(;!(a=(s=r.call(i)).done)&&(o.push(s.value),o.length!==e);a=!0);}catch(t){_=!0,n=t}finally{try{if(!a&&null!=i.return&&(h=i.return(),Object(h)!==h))return}finally{if(_)throw n}}return o}}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){if(t){if("string"==typeof t)return n(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}t.exports={read_class_declaration_statement:function(t){var e=this.node("class"),i=this.read_class_modifiers();if(this.token!==this.tok.T_CLASS)return this.error(this.tok.T_CLASS),this.next(),null;this.next().expect(this.tok.T_STRING);var s=this.node("identifier"),n=this.text();this.next(),s=s(n);var r=this.read_extends_from(),h=this.read_implements_list();this.expect("{");var o=e(s,r,h,this.next().read_class_body(!0,!1),i);return t&&(o.attrGroups=t),o},read_class_modifiers:function(){var t=this.read_class_modifier({readonly:0,final_or_abstract:0});return[0,0,t.final_or_abstract,t.readonly]},read_class_modifier:function(t){return this.token===this.tok.T_READ_ONLY?(this.next(),t.readonly=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_ABSTRACT?(this.next(),t.final_or_abstract=1,t=this.read_class_modifier(t)):0===t.final_or_abstract&&this.token===this.tok.T_FINAL&&(this.next(),t.final_or_abstract=2,t=this.read_class_modifier(t)),t},read_class_body:function(t,e){for(var s=[],n=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT)if(this.token!==this.tok.T_USE)if(e&&this.token===this.tok.T_CASE){var r=this.read_enum_case();this.expect(";")&&this.next(),s=s.concat(r)}else{this.token===this.tok.T_ATTRIBUTE&&(n=this.read_attr_list());var h=this.position(),o=this.read_member_flags(!1);if(this.token!==this.tok.T_CONST)if(t&&this.token===this.tok.T_VAR&&(this.next().expect(this.tok.T_VARIABLE),o[0]=null,o[1]=0),this.token===this.tok.T_FUNCTION)s.push(this.read_function(!1,o,n,h)),n=[];else if(t&&(this.token===this.tok.T_VARIABLE||this.version>=801&&this.token===this.tok.T_READ_ONLY||this.version>=704&&("?"===this.token||this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE||this.token===this.tok.T_NAMESPACE||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_STRING))){var a=this.read_variable_list(o,n);n=[],this.expect(";"),this.next(),s=s.concat(a)}else this.error([this.tok.T_CONST].concat(i(t?[this.tok.T_VARIABLE]:[]),i(e?[this.tok.T_CASE]:[]),[this.tok.T_FUNCTION])),this.next();else{var _=this.read_constant_list(o,n);this.expect(";")&&this.next(),s=s.concat(_)}}else s=s.concat(this.read_trait_use_statement());else s.push(this.read_doc_comment());else s.push(this.read_comment());return this.expect("}"),this.next(),s},read_variable_list:function(t,i){var s=this.node("propertystatement"),n=this.read_list((function(){var t=this.node("property"),s=!1;this.token===this.tok.T_READ_ONLY&&(s=!0,this.next());var n=e(this.read_optional_type(),2),r=n[0],h=n[1];this.expect(this.tok.T_VARIABLE);var o=this.node("identifier"),a=this.text().substring(1);this.next(),o=o(a);var _=null;return this.expect([",",";","="]),"="===this.token&&(_=this.next().read_expr()),t(o,_,s,r,h,i||[])}),",");return s(null,n,t)},read_constant_list:function(t,i){this.expect(this.tok.T_CONST)&&this.next();var s=e(this.version>=803?this.read_optional_type():[!1,null],2),n=s[0],r=s[1],h=this.node("classconstant"),o=this.read_list((function(){var t=this.node("constant"),e=null,i=null;if(this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){e=this.node("identifier");var s=this.text();this.next(),e=e(s)}else this.expect("IDENTIFIER");return this.expect("=")&&(i=this.next().read_expr()),t(e,i)}),",");return h(null,o,t,n,r,i||[])},read_member_flags:function(t){var e=[-1,-1,-1];if(this.is("T_MEMBER_FLAGS")){var i=0,s=0;do{switch(this.token){case this.tok.T_PUBLIC:i=0,s=0;break;case this.tok.T_PROTECTED:i=0,s=1;break;case this.tok.T_PRIVATE:i=0,s=2;break;case this.tok.T_STATIC:i=1,s=1;break;case this.tok.T_ABSTRACT:i=2,s=1;break;case this.tok.T_FINAL:i=2,s=2}t&&(0===i&&2===s?(this.expect([this.tok.T_PUBLIC,this.tok.T_PROTECTED]),s=-1):2===i&&1===s&&(this.error(),s=-1)),-1!==e[i]?this.error():-1!==s&&(e[i]=s)}while(this.next().is("T_MEMBER_FLAGS"))}return-1===e[1]&&(e[1]=0),-1===e[2]&&(e[2]=0),e},read_optional_type:function(){var t="?"===this.token;if(t&&this.next(),"="===this.peek())return[!1,null];var e=this.read_types();if(t&&!e&&this.raiseError("Expecting a type definition combined with nullable operator"),!t&&!e)return[!1,null];if("|"===this.token){e=[e];do{this.next();var i=this.read_type();if(!i){this.raiseError("Expecting a type definition");break}e.push(i)}while("|"===this.token)}return[t,e]},read_interface_declaration_statement:function(t){var e=this.node("interface");if(this.token!==this.tok.T_INTERFACE)return this.error(this.tok.T_INTERFACE),this.next(),null;this.next().expect(this.tok.T_STRING);var i=this.node("identifier"),s=this.text();this.next(),i=i(s);var n=this.read_interface_extends_list();return this.expect("{"),e(i,n,this.next().read_interface_body(),t||[])},read_interface_body:function(){for(var t=[],e=[];this.token!==this.EOF&&"}"!==this.token;)if(this.token!==this.tok.T_COMMENT)if(this.token!==this.tok.T_DOC_COMMENT){var i=this.position();e=this.read_attr_list();var s=this.read_member_flags(!0);if(this.token===this.tok.T_CONST){var n=this.read_constant_list(s,e);this.expect(";")&&this.next(),t=t.concat(n),e=[]}else if(this.token===this.tok.T_FUNCTION){var r=this.read_function_declaration(2,s,e,i);r.parseFlags(s),t.push(r),this.expect(";")&&this.next(),e=[]}else this.error([this.tok.T_CONST,this.tok.T_FUNCTION]),this.next()}else t.push(this.read_doc_comment());else t.push(this.read_comment());return this.expect("}")&&this.next(),t},read_trait_declaration_statement:function(){var t=this.node("trait");if(this.token!==this.tok.T_TRAIT)return this.error(this.tok.T_TRAIT),this.next(),null;this.next().expect(this.tok.T_STRING);var e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("{"),t(e,this.next().read_class_body(!0,!1))},read_trait_use_statement:function(){var t=this.node("traituse");this.expect(this.tok.T_USE)&&this.next();for(var e=[this.read_namespace_name()],i=null;","===this.token;)e.push(this.next().read_namespace_name());if("{"===this.token){for(i=[];this.next().token!==this.EOF&&"}"!==this.token;)i.push(this.read_trait_use_alias()),this.expect(";");this.expect("}")&&this.next()}else this.expect(";")&&this.next();return t(e,i)},read_trait_use_alias:function(){var t,e=this.node(),i=null;if(this.is("IDENTIFIER")){t=this.node("identifier");var s=this.text();this.next(),t=t(s)}else if(t=this.read_namespace_name(),this.token===this.tok.T_DOUBLE_COLON)if(this.next(),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){i=t,t=this.node("identifier");var n=this.text();this.next(),t=t(n)}else this.expect(this.tok.T_STRING);else t=t.name;if(this.token===this.tok.T_INSTEADOF)return e("traitprecedence",i,t,this.next().read_name_list());if(this.token===this.tok.T_AS){var r=null,h=null;if(this.next().is("T_MEMBER_FLAGS")&&(r=this.read_member_flags()),this.token===this.tok.T_STRING||this.version>=700&&this.is("IDENTIFIER")){h=this.node("identifier");var o=this.text();this.next(),h=h(o)}else!1===r&&this.expect(this.tok.T_STRING);return e("traitalias",i,t,h,r)}return this.expect([this.tok.T_AS,this.tok.T_INSTEADOF]),e("traitalias",i,t,null,null)}}},3997:t=>{t.exports={read_comment:function(){var t=this.text(),e=this.ast.prepare("/*"===t.substring(0,2)?"commentblock":"commentline",null,this),i=this.lexer.yylloc.first_offset,s=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(e=e(t)).offset=i,this.prev=s,e},read_doc_comment:function(){var t=this.ast.prepare("commentblock",null,this),e=this.lexer.yylloc.first_offset,i=this.text(),s=this.prev;return this.prev=[this.lexer.yylloc.last_line,this.lexer.yylloc.last_column,this.lexer.offset],this.lex(),(t=t(i)).offset=e,this.prev=s,t}}},979:t=>{t.exports={read_enum_declaration_statement:function(t){var e=this.node("enum");if(!this.expect(this.tok.T_ENUM))return null;this.next().expect(this.tok.T_STRING);var i=this.node("identifier"),s=this.text();this.next(),i=i(s);var n=this.read_enum_value_type(),r=this.read_implements_list();this.expect("{");var h=e(i,n,r,this.next().read_class_body(!1,!0));return t&&(h.attrGroups=t),h},read_enum_value_type:function(){return":"===this.token?this.next().read_namespace_name():null},read_enum_case:function(){this.expect(this.tok.T_CASE);var t=this.node("enumcase"),e=this.node("identifier"),i=this.next().text();this.next(),e=e(i);var s="="===this.token?this.next().read_expr():null;return this.expect(";"),t(e,s)}}},6477:t=>{t.exports={read_expr:function(t){var e=this.node();if("@"===this.token)return t||(t=this.next().read_expr()),e("silent",t);if(t||(t=this.read_expr_item()),"|"===this.token)return e("bin","|",t,this.next().read_expr());if("&"===this.token)return e("bin","&",t,this.next().read_expr());if("^"===this.token)return e("bin","^",t,this.next().read_expr());if("."===this.token)return e("bin",".",t,this.next().read_expr());if("+"===this.token)return e("bin","+",t,this.next().read_expr());if("-"===this.token)return e("bin","-",t,this.next().read_expr());if("*"===this.token)return e("bin","*",t,this.next().read_expr());if("/"===this.token)return e("bin","/",t,this.next().read_expr());if("%"===this.token)return e("bin","%",t,this.next().read_expr());if(this.token===this.tok.T_POW)return e("bin","**",t,this.next().read_expr());if(this.token===this.tok.T_SL)return e("bin","<<",t,this.next().read_expr());if(this.token===this.tok.T_SR)return e("bin",">>",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_OR)return e("bin","||",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_OR)return e("bin","or",t,this.next().read_expr());if(this.token===this.tok.T_BOOLEAN_AND)return e("bin","&&",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_AND)return e("bin","and",t,this.next().read_expr());if(this.token===this.tok.T_LOGICAL_XOR)return e("bin","xor",t,this.next().read_expr());if(this.token===this.tok.T_IS_IDENTICAL)return e("bin","===",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_IDENTICAL)return e("bin","!==",t,this.next().read_expr());if(this.token===this.tok.T_IS_EQUAL)return e("bin","==",t,this.next().read_expr());if(this.token===this.tok.T_IS_NOT_EQUAL)return e("bin","!=",t,this.next().read_expr());if("<"===this.token)return e("bin","<",t,this.next().read_expr());if(">"===this.token)return e("bin",">",t,this.next().read_expr());if(this.token===this.tok.T_IS_SMALLER_OR_EQUAL)return e("bin","<=",t,this.next().read_expr());if(this.token===this.tok.T_IS_GREATER_OR_EQUAL)return e("bin",">=",t,this.next().read_expr());if(this.token===this.tok.T_SPACESHIP)return e("bin","<=>",t,this.next().read_expr());if(this.token===this.tok.T_INSTANCEOF&&(t=e("bin","instanceof",t,this.next().read_class_name_reference()),";"!==this.token&&this.token!==this.tok.T_INLINE_HTML&&this.token!==this.EOF&&(t=this.read_expr(t))),this.token===this.tok.T_COALESCE)return e("bin","??",t,this.next().read_expr());if("?"===this.token){var i=null;return":"!==this.next().token&&(i=this.read_expr()),this.expect(":")&&this.next(),e("retif",t,i,this.read_expr())}return e.destroy(t),t},read_expr_cast:function(t){return this.node("cast")(t,this.text(),this.next().read_expr())},read_isset_variable:function(){return this.read_expr()},read_isset_variables:function(){return this.read_function_list(this.read_isset_variable,",")},read_internal_functions_in_yacc:function(){var t=null;switch(this.token){case this.tok.T_ISSET:t=this.node("isset"),this.next().expect("(")&&this.next();var e=this.read_isset_variables();this.expect(")")&&this.next(),t=t(e);break;case this.tok.T_EMPTY:t=this.node("empty"),this.next().expect("(")&&this.next();var i=this.read_expr();this.expect(")")&&this.next(),t=t(i);break;case this.tok.T_INCLUDE:t=this.node("include")(!1,!1,this.next().read_expr());break;case this.tok.T_INCLUDE_ONCE:t=this.node("include")(!0,!1,this.next().read_expr());break;case this.tok.T_EVAL:t=this.node("eval"),this.next().expect("(")&&this.next();var s=this.read_expr();this.expect(")")&&this.next(),t=t(s);break;case this.tok.T_REQUIRE:t=this.node("include")(!1,!0,this.next().read_expr());break;case this.tok.T_REQUIRE_ONCE:t=this.node("include")(!0,!0,this.next().read_expr())}return t},read_optional_expr:function(t){return this.token!==t?this.read_expr():null},read_exit_expr:function(){var t=null;return"("===this.token&&(this.next(),t=this.read_optional_expr(")"),this.expect(")")&&this.next()),t},read_expr_item:function(){var t,e,i=[];if("+"===this.token)return this.node("unary")("+",this.next().read_expr());if("-"===this.token)return this.node("unary")("-",this.next().read_expr());if("!"===this.token)return this.node("unary")("!",this.next().read_expr());if("~"===this.token)return this.node("unary")("~",this.next().read_expr());if("("===this.token)return(e=this.next().read_expr()).parenthesizedExpression=!0,this.expect(")")&&this.next(),this.handleDereferencable(e);if("`"===this.token)return this.read_encapsed_string("`");if(this.token===this.tok.T_LIST){var s=null,n=this.innerList;t=this.node("list"),n||(s=this.node("assign")),this.next().expect("(")&&this.next(),this.innerList||(this.innerList=!0);var r=this.read_array_pair_list(!1);this.expect(")")&&this.next();for(var h=!1,o=0;o<r.length;o++)if(null!==r[o]&&"noop"!==r[o].kind){h=!0;break}return h||this.raiseError("Fatal Error : Cannot use empty list on line "+this.lexer.yylloc.first_line),n?t(r,!1):(this.innerList=!1,this.expect("=")?s(t(r,!1),this.next().read_expr(),"="):t(r,!1))}if(this.token===this.tok.T_ATTRIBUTE&&(i=this.read_attr_list()),this.token===this.tok.T_CLONE)return this.node("clone")(this.next().read_expr());switch(this.token){case this.tok.T_INC:return this.node("pre")("+",this.next().read_variable(!1,!1));case this.tok.T_DEC:return this.node("pre")("-",this.next().read_variable(!1,!1));case this.tok.T_NEW:return this.read_new_expr();case this.tok.T_ISSET:case this.tok.T_EMPTY:case this.tok.T_INCLUDE:case this.tok.T_INCLUDE_ONCE:case this.tok.T_EVAL:case this.tok.T_REQUIRE:case this.tok.T_REQUIRE_ONCE:return this.read_internal_functions_in_yacc();case this.tok.T_MATCH:return this.read_match_expression();case this.tok.T_INT_CAST:return this.read_expr_cast("int");case this.tok.T_DOUBLE_CAST:return this.read_expr_cast("float");case this.tok.T_STRING_CAST:return this.read_expr_cast(-1!==this.text().indexOf("binary")?"binary":"string");case this.tok.T_ARRAY_CAST:return this.read_expr_cast("array");case this.tok.T_OBJECT_CAST:return this.read_expr_cast("object");case this.tok.T_BOOL_CAST:return this.read_expr_cast("bool");case this.tok.T_UNSET_CAST:return this.read_expr_cast("unset");case this.tok.T_THROW:return this.version<800&&this.raiseError("PHP 8+ is required to use throw as an expression"),this.node("throw")(this.next().read_expr());case this.tok.T_EXIT:var a="die"===this.lexer.yytext.toLowerCase();return t=this.node("exit"),this.next(),t(this.read_exit_expr(),a);case this.tok.T_PRINT:return this.node("print")(this.next().read_expr());case this.tok.T_YIELD:var _=null,l=null;return t=this.node("yield"),this.next().is("EXPR")&&(_=this.read_expr(),this.token===this.tok.T_DOUBLE_ARROW&&(l=_,_=this.next().read_expr())),t(_,l);case this.tok.T_YIELD_FROM:return(t=this.node("yieldfrom"))(e=this.next().read_expr());case this.tok.T_FN:case this.tok.T_FUNCTION:return this.read_inline_function(void 0,i);case this.tok.T_STATIC:var c=[this.token,this.lexer.getState()];if(this.next(),this.token===this.tok.T_FUNCTION||this.version>=704&&this.token===this.tok.T_FN)return this.read_inline_function([0,1,0],i);this.lexer.tokens.push(c),this.next()}if(this.is("VARIABLE")){t=this.node();var u="identifier"===(e=this.read_variable(!1,!1)).kind||"staticlookup"===e.kind&&"identifier"===e.offset.kind;switch(this.token){case"=":return u&&this.error("VARIABLE"),"&"==this.next().token?this.read_assignref(t,e):t("assign",e,this.read_expr(),"=");case this.tok.T_PLUS_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"+=");case this.tok.T_MINUS_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"-=");case this.tok.T_MUL_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"*=");case this.tok.T_POW_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"**=");case this.tok.T_DIV_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"/=");case this.tok.T_CONCAT_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),".=");case this.tok.T_MOD_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"%=");case this.tok.T_AND_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"&=");case this.tok.T_OR_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"|=");case this.tok.T_XOR_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"^=");case this.tok.T_SL_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"<<=");case this.tok.T_SR_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),">>=");case this.tok.T_COALESCE_EQUAL:return u&&this.error("VARIABLE"),t("assign",e,this.next().read_expr(),"??=");case this.tok.T_INC:return u&&this.error("VARIABLE"),this.next(),t("post","+",e);case this.tok.T_DEC:return u&&this.error("VARIABLE"),this.next(),t("post","-",e);default:t.destroy(e)}}else{if(this.is("SCALAR")){if(t=this.node(),"array"===(e=this.read_scalar()).kind&&e.shortForm&&"="===this.token){var p=this.convertToList(e);return e.loc&&(p.loc=e.loc),t("assign",p,this.next().read_expr(),"=")}return t.destroy(e),this.handleDereferencable(e)}this.error("EXPR"),this.next()}return e},convertToList:function(t){var e=this,i=t.items.map((function(t){return t.value&&"array"===t.value.kind&&t.value.shortForm&&(t.value=e.convertToList(t.value)),t})),s=this.node("list")(i,!0);return t.loc&&(s.loc=t.loc),t.leadingComments&&(s.leadingComments=t.leadingComments),t.trailingComments&&(s.trailingComments=t.trailingComments),s},read_assignref:function(t,e){var i;return this.next(),this.token===this.tok.T_NEW?(this.version>=700&&this.error(),i=this.read_new_expr()):i=this.read_variable(!1,!1),t("assignref",e,i)},read_inline_function:function(t,e){if(this.token===this.tok.T_FUNCTION){var i=this.read_function(!0,t,e);return i.attrGroups=e,i}!this.version>=704&&this.raiseError("Arrow Functions are not allowed");var s=this.node("arrowfunc");this.expect(this.tok.T_FN)&&this.next();var n=this.is_reference();this.expect("(")&&this.next();var r=this.read_parameter_list();this.expect(")")&&this.next();var h=!1,o=null;":"===this.token&&("?"===this.next().token&&(h=!0,this.next()),o=this.read_types()),this.expect(this.tok.T_DOUBLE_ARROW)&&this.next();var a=s(r,n,this.read_expr(),o,h,!!t);return a.attrGroups=e,a},read_match_expression:function(){var t,e,i=this.node("match");return this.expect(this.tok.T_MATCH)&&this.next(),this.version<800&&this.raiseError("Match statements are not allowed before PHP 8"),this.expect("(")&&this.next(),t=this.read_expr(),this.expect(")")&&this.next(),this.expect("{")&&this.next(),e=this.read_match_arms(),this.expect("}")&&this.next(),i(t,e)},read_match_arms:function(){var t=this;return this.read_list((function(){return t.read_match_arm()}),",",!0)},read_match_arm:function(){if("}"!==this.token)return this.node("matcharm")(this.read_match_arm_conds(),this.read_expr())},read_match_arm_conds:function(){var t=[];if(this.token===this.tok.T_DEFAULT)t=null,this.next();else for(t.push(this.read_expr());","===this.token;){if(this.next(),this.token===this.tok.T_DOUBLE_ARROW)return this.next(),t;t.push(this.read_expr())}return this.expect(this.tok.T_DOUBLE_ARROW)&&this.next(),t},read_attribute:function(){var t=this.text(),e=[];return this.next(),"("===this.token&&(e=this.read_argument_list()),this.node("attribute")(t,e)},read_attr_list:function(){var t=[];if(this.token===this.tok.T_ATTRIBUTE)do{var e=this.node("attrgroup")([]);for(this.next(),e.attrs.push(this.read_attribute());","===this.token;)this.next(),"]"!==this.token&&e.attrs.push(this.read_attribute());t.push(e),this.expect("]"),this.next()}while(this.token===this.tok.T_ATTRIBUTE);return t},read_new_expr:function(){var t=this.node("new");this.expect(this.tok.T_NEW)&&this.next();var e=[];if("("===this.token){this.next();var i=this.read_expr();return this.expect(")"),this.next(),"("===this.token&&(e=this.read_argument_list()),t(i,e)}var s=this.read_attr_list();if(this.token===this.tok.T_CLASS){var n=this.node("class");"("===this.next().token&&(e=this.read_argument_list());var r=this.read_extends_from(),h=this.read_implements_list(),o=null;this.expect("{")&&(o=this.next().read_class_body(!0,!1));var a=n(null,r,h,o,[0,0,0]);return a.attrGroups=s,t(a,e)}for(var _=this.read_new_class_name();"["===this.token;){var l=this.node("offsetlookup"),c=this.next().read_encaps_var_offset();this.expect("]")&&this.next(),_=l(_,c)}return"("===this.token&&(e=this.read_argument_list()),t(_,e)},read_new_class_name:function(){if(this.token===this.tok.T_NS_SEPARATOR||this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_NAMESPACE){var t=this.read_namespace_name(!0);return this.token===this.tok.T_DOUBLE_COLON&&(t=this.read_static_getter(t)),t}if(this.is("VARIABLE"))return this.read_variable(!0,!1);this.expect([this.tok.T_STRING,"VARIABLE"])},handleDereferencable:function(t){for(;this.token!==this.EOF;)if(this.token===this.tok.T_OBJECT_OPERATOR||this.token===this.tok.T_DOUBLE_COLON)t=this.recursive_variable_chain_scan(t,!1,!1,!0);else if(this.token===this.tok.T_CURLY_OPEN||"["===this.token)t=this.read_dereferencable(t);else{if("("!==this.token)return t;t=this.node("call")(t,this.read_argument_list())}return t}}},8214:t=>{t.exports={is_reference:function(){return"&"===this.token&&(this.next(),!0)},is_variadic:function(){return this.token===this.tok.T_ELLIPSIS&&(this.next(),!0)},read_function:function(t,e,i,s){var n=this.read_function_declaration(t?1:e?2:0,e&&1===e[1],i||[],s);return e&&1==e[2]?(n.parseFlags(e),this.expect(";")&&this.next()):(this.expect("{")&&(n.body=this.read_code_block(!1),n.loc&&n.body.loc&&(n.loc.end=n.body.loc.end)),!t&&e&&n.parseFlags(e)),n},read_function_declaration:function(t,e,i,s){var n=this,r="function";1===t?r="closure":2===t&&(r="method");var h=this.node(r);this.expect(this.tok.T_FUNCTION)&&this.next();var o=this.is_reference(),a=!1,_=[],l=null,c=!1;if(1!==t){var u=this.node("identifier");2===t?this.version>=700?this.token===this.tok.T_STRING||this.is("IDENTIFIER")?(a=this.text(),this.next()):this.version<704&&this.error("IDENTIFIER"):this.token===this.tok.T_STRING?(a=this.text(),this.next()):this.error("IDENTIFIER"):this.version>=700?this.token===this.tok.T_STRING?(a=this.text(),this.next()):this.version>=704?this.expect("(")||this.next():(this.error(this.tok.T_STRING),this.next()):(this.expect(this.tok.T_STRING)&&(a=this.text()),this.next()),a=u(a)}this.expect("(")&&this.next();var p=this.read_parameter_list("__construct"===a.name);this.expect(")")&&this.next(),1===t&&(_=this.read_lexical_vars()),":"===this.token&&("?"===this.next().token&&(c=!0,this.next()),l=this.read_types());var f;return(f=1===t?h(p,o,_,l,c,e):h(a,p,o,l,c)).attrGroups=i||[],s&&f.loc&&(f.loc.start=s,f.loc.source&&(f.loc.source=n.lexer._input.substr(f.loc.start.offset,f.loc.end.offset-f.loc.start.offset))),f},read_lexical_vars:function(){var t=[];return this.token===this.tok.T_USE&&(this.next(),this.expect("(")&&this.next(),t=this.read_lexical_var_list(),this.expect(")")&&this.next()),t},read_list_with_dangling_comma:function(t){for(var e=[];this.token!=this.EOF;){if(e.push(t()),","!=this.token){if(")"==this.token)break;this.error([",",")"]);break}if(this.next(),this.version>=800&&")"===this.token)return e}return e},read_lexical_var_list:function(){return this.read_list_with_dangling_comma(this.read_lexical_var.bind(this))},read_lexical_var:function(){if("&"===this.token)return this.read_byref(this.read_lexical_var.bind(this));var t=this.node("variable");this.expect(this.tok.T_VARIABLE);var e=this.text().substring(1);return this.next(),t(e,!1)},read_parameter_list:function(t){if(")"!==this.token){var e=!1;return this.read_list_with_dangling_comma(function(){var i=this.read_parameter(t);return i&&(e&&this.raiseError("Unexpected parameter after a variadic parameter"),i.variadic&&(e=!0)),i}.bind(this),",")}return[]},read_parameter:function(t){var e,i=this.node("parameter"),s=null,n=null,r=!1,h=!1,o=[];this.token===this.tok.T_ATTRIBUTE&&(o=this.read_attr_list()),this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),h=!0):this.raiseError("readonly properties can be used only on class constructor"));var a=this.read_promoted();!h&&this.version>=801&&this.token===this.tok.T_READ_ONLY&&(t?(this.next(),h=!0):this.raiseError("readonly properties can be used only on class constructor")),"?"===this.token&&(this.next(),r=!0),e=this.read_types(),r&&!e&&this.raiseError("Expecting a type definition combined with nullable operator");var _=this.is_reference(),l=this.is_variadic();if(this.expect(this.tok.T_VARIABLE)){s=this.node("identifier");var c=this.text().substring(1);this.next(),s=s(c)}"="==this.token&&(n=this.next().read_expr());var u=i(s,e,n,_,l,h,r,a);return o&&(u.attrGroups=o),u},read_types:function(){var t="unset",e="union",i="intersection",s=[],n=t,r=this.read_type();if(!r)return null;for(s.push(r);"|"===this.token||this.version>=801&&"&"===this.token;){var h=this.peek();if(h===this.tok.T_ELLIPSIS||h===this.tok.T_VARIABLE)break;n===t?n="|"===this.token?e:i:(n===e&&"|"!==this.token||n===i&&"&"!==this.token)&&this.raiseError('Unexpect token "'+this.token+'", "|" and "&" can not be mixed'),this.next(),s.push(this.read_type())}return 1===s.length?s[0]:n===i?this.node("intersectiontype")(s):this.node("uniontype")(s)},read_promoted:function(){return this.token===this.tok.T_PUBLIC?(this.next(),1):this.token===this.tok.T_PROTECTED?(this.next(),2):this.token===this.tok.T_PRIVATE?(this.next(),4):0},read_argument_list:function(){var t=[];return this.expect("(")&&this.next(),this.version>=801&&this.token===this.tok.T_ELLIPSIS&&")"===this.peek()?(t.push(this.node("variadicplaceholder")()),this.next()):")"!==this.token&&(t=this.read_non_empty_argument_list()),this.expect(")")&&this.next(),t},read_non_empty_argument_list:function(){var t=!1;return this.read_function_list(function(){var e=this.read_argument();if(e){var i="variadic"===e.kind;t&&!i&&this.raiseError("Unexpected non-variadic argument after a variadic argument"),i&&(t=!0)}return e}.bind(this),",")},read_argument:function(){return this.token===this.tok.T_ELLIPSIS?this.node("variadic")(this.next().read_expr()):this.token!==this.tok.T_STRING&&!Object.values(this.lexer.keywords).includes(this.token)||":"!==this.peek()?this.read_expr():(this.version<800&&this.raiseError("PHP 8+ is required to use named arguments"),this.node("namedargument")(this.text(),this.next().next().read_expr()))},read_type:function(){var t=this.node();if(this.token===this.tok.T_ARRAY||this.token===this.tok.T_CALLABLE){var e=this.text();return this.next(),t("typereference",e.toLowerCase(),e)}if(this.token===this.tok.T_NAME_RELATIVE||this.token===this.tok.T_NAME_QUALIFIED||this.token===this.tok.T_NAME_FULLY_QUALIFIED||this.token===this.tok.T_STRING||this.token===this.tok.T_STATIC){var i=this.text(),s=[this.token,this.lexer.getState()];return this.next(),this.token!==this.tok.T_NS_SEPARATOR&&this.ast.typereference.types.indexOf(i.toLowerCase())>-1?t("typereference",i.toLowerCase(),i):(this.lexer.tokens.push(s),this.next(),t.destroy(),this.read_namespace_name())}return t.destroy(),null}}},9461:t=>{t.exports={read_if:function(){var t=this.node("if"),e=this.next().read_if_expr(),i=null,s=null,n=!1;if(":"===this.token){n=!0,this.next(),i=this.node("block");for(var r=[];this.token!==this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){s=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){s=this.read_else_short();break}r.push(this.read_inner_statement())}i=i(null,r),this.expect(this.tok.T_ENDIF)&&this.next(),this.expectEndOfStatement()}else i=this.read_statement(),this.token===this.tok.T_ELSEIF?s=this.read_if():this.token===this.tok.T_ELSE&&(s=this.next().read_statement());return t(e,i,s,n)},read_if_expr:function(){this.expect("(")&&this.next();var t=this.read_expr();return this.expect(")")&&this.next(),t},read_elseif_short:function(){var t=null,e=this.node("if"),i=this.next().read_if_expr();this.expect(":")&&this.next();for(var s=this.node("block"),n=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;){if(this.token===this.tok.T_ELSEIF){t=this.read_elseif_short();break}if(this.token===this.tok.T_ELSE){t=this.read_else_short();break}n.push(this.read_inner_statement())}return e(i,s(null,n),t,!0)},read_else_short:function(){this.next().expect(":")&&this.next();for(var t=this.node("block"),e=[];this.token!=this.EOF&&this.token!==this.tok.T_ENDIF;)e.push(this.read_inner_statement());return t(null,e)}}},5931:t=>{t.exports={read_while:function(){var t=this.node("while");this.expect(this.tok.T_WHILE)&&this.next();var e,i=null,s=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(")")&&this.next(),":"===this.token?(s=!0,i=this.read_short_form(this.tok.T_ENDWHILE)):i=this.read_statement(),t(e,i,s)},read_do:function(){var t=this.node("do");this.expect(this.tok.T_DO)&&this.next();var e,i=null;return e=this.read_statement(),this.expect(this.tok.T_WHILE)&&(this.next().expect("(")&&this.next(),i=this.read_expr(),this.expect(")")&&this.next(),this.expect(";")&&this.next()),t(i,e)},read_for:function(){var t=this.node("for");this.expect(this.tok.T_FOR)&&this.next();var e=[],i=[],s=[],n=null,r=!1;return this.expect("(")&&this.next(),";"!==this.token?(e=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),";"!==this.token?(i=this.read_list(this.read_expr,","),this.expect(";")&&this.next()):this.next(),")"!==this.token?(s=this.read_list(this.read_expr,","),this.expect(")")&&this.next()):this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOR)):n=this.read_statement(),t(e,i,s,n,r)},read_foreach:function(){var t=this.node("foreach");this.expect(this.tok.T_FOREACH)&&this.next();var e,i=null,s=null,n=null,r=!1;return this.expect("(")&&this.next(),e=this.read_expr(),this.expect(this.tok.T_AS)&&(this.next(),s=this.read_foreach_variable(),this.token===this.tok.T_DOUBLE_ARROW&&(i=s,s=this.next().read_foreach_variable())),i&&"list"===i.kind&&this.raiseError("Fatal Error : Cannot use list as key element"),this.expect(")")&&this.next(),":"===this.token?(r=!0,n=this.read_short_form(this.tok.T_ENDFOREACH)):n=this.read_statement(),t(e,i,s,n,r)},read_foreach_variable:function(){if(this.token===this.tok.T_LIST||"["===this.token){var t="["===this.token,e=this.node("list");this.next(),!t&&this.expect("(")&&this.next();var i=this.read_array_pair_list(t);return this.expect(t?"]":")")&&this.next(),e(i,t)}return this.read_variable(!1,!1)}}},9147:t=>{t.exports={read_start:function(){return this.token==this.tok.T_NAMESPACE?this.read_namespace():this.read_top_statement()}}},9219:t=>{t.exports={read_namespace:function(){var t,e,i=this.node("namespace");return this.expect(this.tok.T_NAMESPACE)&&this.next(),e="{"===this.token?{name:[""]}:this.read_namespace_name(),this.currentNamespace=e,";"===this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect(this.EOF),i(e.name,t,!1)):"{"===this.token?(this.currentNamespace=e,t=this.next().read_top_statements(),this.expect("}")&&this.next(),0===t.length&&this.extractDoc&&this._docs.length>this._docIndex&&t.push(this.node("noop")()),i(e.name,t,!0)):(this.error(["{",";"]),this.currentNamespace=e,t=this.read_top_statements(),this.expect(this.EOF),i(e,t,!1))},read_namespace_name:function(t){var e,i=this.node(),s=this.text();switch(this.token){case this.tok.T_NAME_RELATIVE:e=this.ast.name.RELATIVE_NAME,s=s.replace(/^namespace\\/,"");break;case this.tok.T_NAME_QUALIFIED:e=this.ast.name.QUALIFIED_NAME;break;case this.tok.T_NAME_FULLY_QUALIFIED:e=this.ast.name.FULL_QUALIFIED_NAME;break;default:if(e=this.ast.name.UNQUALIFIED_NAME,!this.expect(this.tok.T_STRING))return i("name","",this.ast.name.FULL_QUALIFIED_NAME)}if(this.next(),t||"("!==this.token){if("parent"===s.toLowerCase())return i("parentreference",s);if("self"===s.toLowerCase())return i("selfreference",s)}return i("name",s,e)},read_use_statement:function(){var t=this.node("usegroup"),e=[],i=null;this.expect(this.tok.T_USE)&&this.next();var s=this.read_use_type();return e.push(this.read_use_declaration(!1)),","===this.token?e=e.concat(this.next().read_use_declarations(!1)):"{"===this.token&&(i=e[0].name,e=this.next().read_use_declarations(null===s),this.expect("}")&&this.next()),t=t(i,s,e),this.expect(";")&&this.next(),t},read_class_name_reference:function(){return this.read_variable(!0,!1)},read_use_declaration:function(t){var e=this.node("useitem"),i=null;t&&(i=this.read_use_type());var s=this.read_namespace_name(),n=this.read_use_alias();return e(s.name,n,i)},read_use_declarations:function(t){for(var e=[this.read_use_declaration(t)];","===this.token;){if(this.next(),t){if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_FUNCTION&&this.token!==this.tok.T_CONST&&this.token!==this.tok.T_STRING)break}else if(this.token!==this.tok.T_NAME_RELATIVE&&this.token!==this.tok.T_NAME_QUALIFIED&&this.token!==this.tok.T_NAME_FULLY_QUALIFIED&&this.token!==this.tok.T_STRING&&this.token!==this.tok.T_NS_SEPARATOR)break;e.push(this.read_use_declaration(t))}return e},read_use_alias:function(){var t=null;if(this.token===this.tok.T_AS&&this.next().expect(this.tok.T_STRING)){var e=this.node("identifier"),i=this.text();this.next(),t=e(i)}return t},read_use_type:function(){return this.token===this.tok.T_FUNCTION?(this.next(),this.ast.useitem.TYPE_FUNCTION):this.token===this.tok.T_CONST?(this.next(),this.ast.useitem.TYPE_CONST):null}}},7170:t=>{var e={"\\":"\\",$:"$",n:"\n",r:"\r",t:"\t",f:String.fromCharCode(12),v:String.fromCharCode(11),e:String.fromCharCode(27)};t.exports={resolve_special_chars:function(t,i){return i?t.replace(/\\"/,'"').replace(/\\([\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}|u{([0-9a-fA-F]+)})/g,(function(t,i,s){return e[i]?e[i]:"x"===i[0]||"X"===i[0]?String.fromCodePoint(parseInt(i.substr(1),16)):"u"===i[0]?String.fromCodePoint(parseInt(s,16)):String.fromCodePoint(parseInt(i,8))})):t.replace(/\\\\/g,"\\").replace(/\\'/g,"'")},remove_heredoc_leading_whitespace_chars:function(t,e,i,s){if(0===e)return t;this.check_heredoc_indentation_level(t,e,i,s);var n=i?" ":"\t",r=new RegExp("\\n".concat(n,"{").concat(e,"}"),"g"),h=new RegExp("^".concat(n,"{").concat(e,"}"));return s&&(t=t.replace(h,"")),t.replace(r,"\n")},check_heredoc_indentation_level:function(t,e,i,s){var n=t.length,r=0,h=0,o=!0,a=i?" ":"\t",_=!1;if(!s){if(-1===(r=t.indexOf("\n")))return;r++}for(;r<n;)o?t[r]===a?h++:_=!0:o=!1,"\n"!==t[r]&&_&&h<e?this.raiseError("Invalid body indentation level (expecting an indentation at least ".concat(e,")")):_=!1,"\n"===t[r]&&(o=!0,h=0),r++},read_dereferencable_scalar:function(){var t=null;switch(this.token){case this.tok.T_CONSTANT_ENCAPSED_STRING:var e=this.node("string"),i=this.text(),s=0;"b"!==i[0]&&"B"!==i[0]||(s=1);var n='"'===i[s];this.next(),e=e(n,this.resolve_special_chars(i.substring(s+1,i.length-1),n),1===s,i),t=this.token===this.tok.T_DOUBLE_COLON?this.read_static_getter(e):e;break;case this.tok.T_ARRAY:case"[":t=this.read_array()}return t},read_scalar:function(){if(this.is("T_MAGIC_CONST"))return this.get_magic_constant();var t,e;switch(this.token){case this.tok.T_LNUMBER:case this.tok.T_DNUMBER:var i=this.node("number");return t=this.text(),this.next(),i(t,null);case this.tok.T_START_HEREDOC:if("ST_NOWDOC"===this.lexer.curCondition){var s=this.lexer.yylloc.first_offset;e=this.node("nowdoc"),t=this.next().text(),this.lexer.heredoc_label.indentation>0&&(t=t.substring(0,t.length-this.lexer.heredoc_label.indentation));var n=t[t.length-1];"\n"===n?t="\r"===t[t.length-2]?t.substring(0,t.length-2):t.substring(0,t.length-1):"\r"===n&&(t=t.substring(0,t.length-1)),this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE)&&this.next(),this.expect(this.tok.T_END_HEREDOC)&&this.next();var r=this.lexer._input.substring(s,this.lexer.yylloc.first_offset);return e=e(this.remove_heredoc_leading_whitespace_chars(t,this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node),r,this.lexer.heredoc_label.label),this.lexer.heredoc_label.finished=!0,e}return this.read_encapsed_string(this.tok.T_END_HEREDOC);case'"':return this.read_encapsed_string('"');case'b"':case'B"':return this.read_encapsed_string('"',!0);case this.tok.T_CONSTANT_ENCAPSED_STRING:case this.tok.T_ARRAY:case"[":return this.read_dereferencable_scalar();default:var h=this.error("SCALAR");return this.next(),h}},read_dereferencable:function(t){var e,i,s=this.node("offsetlookup");return"["===this.token?(i=this.next().read_expr(),this.expect("]")&&this.next(),e=s(t,i)):this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES&&(e=s(t,i=this.read_encapsed_string_item(!1))),e},read_encapsed_string_item:function(t){var e,i,s,n=this.node("encapsedpart"),r=null,h=!1,o=this.node();if(this.token===this.tok.T_ENCAPSED_AND_WHITESPACE){var a=this.text();this.next(),o=o("string",!1,this.version>=703&&!this.lexer.heredoc_label.finished?this.remove_heredoc_leading_whitespace_chars(this.resolve_special_chars(a,t),this.lexer.heredoc_label.indentation,this.lexer.heredoc_label.indentation_uses_spaces,this.lexer.heredoc_label.first_encaps_node):a,!1,a)}else if(this.token===this.tok.T_DOLLAR_OPEN_CURLY_BRACES){if(r="simple",h=!0,s=null,this.next().token===this.tok.T_STRING_VARNAME){s=this.node("variable");var _=this.text();this.next(),o.destroy(),"["===this.token?(s=s(_,!1),i=this.node("offsetlookup"),e=this.next().read_expr(),this.expect("]")&&this.next(),o=i(s,e)):o=s(_,!1)}else o=o("variable",this.read_expr(),!1);this.expect("}")&&this.next()}else if(this.token===this.tok.T_CURLY_OPEN)r="complex",o.destroy(),o=this.next().read_variable(!1,!1),this.expect("}")&&this.next();else if(this.token===this.tok.T_VARIABLE){if(r="simple",o.destroy(),o=this.read_simple_variable(),"["===this.token&&(i=this.node("offsetlookup"),e=this.next().read_encaps_var_offset(),this.expect("]")&&this.next(),o=i(o,e)),this.token===this.tok.T_OBJECT_OPERATOR){i=this.node("propertylookup"),this.next().expect(this.tok.T_STRING);var l=this.node("identifier");s=this.text(),this.next(),o=i(o,l(s))}}else{this.expect(this.tok.T_ENCAPSED_AND_WHITESPACE);var c=this.text();this.next(),o.destroy(),o=o("string",!1,c,!1,c)}return this.lexer.heredoc_label.first_encaps_node=!1,n(o,r,h)},read_encapsed_string:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.lexer.yylloc.first_offset,s=this.node("encapsed");this.next();var n,r=this.lexer.yylloc.prev_offset-(e?1:0),h=[];for(n="`"===t?this.ast.encapsed.TYPE_SHELL:'"'===t?this.ast.encapsed.TYPE_STRING:this.ast.encapsed.TYPE_HEREDOC;this.token!==t&&this.token!==this.EOF;)h.push(this.read_encapsed_string_item(!0));if(h.length>0&&"encapsedpart"===h[h.length-1].kind&&"string"===h[h.length-1].expression.kind){var o=h[h.length-1].expression,a=o.value[o.value.length-1];"\n"===a?"\r"===o.value[o.value.length-2]?o.value=o.value.substring(0,o.value.length-2):o.value=o.value.substring(0,o.value.length-1):"\r"===a&&(o.value=o.value.substring(0,o.value.length-1))}return this.expect(t)&&this.next(),s=s(h,this.lexer._input.substring("heredoc"===n?i:r-1,this.lexer.yylloc.first_offset),n),t===this.tok.T_END_HEREDOC&&(s.label=this.lexer.heredoc_label.label,this.lexer.heredoc_label.finished=!0),s},get_magic_constant:function(){var t=this.node("magic"),e=this.text();return this.next(),t(e.toUpperCase(),e)}}},6261:t=>{t.exports={read_top_statements:function(){for(var t=[];this.token!==this.EOF&&"}"!==this.token;){var e=this.read_top_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_top_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:return this.read_function(!1,!1,t);case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_READ_ONLY:case this.tok.T_CLASS:return this.read_class_declaration_statement(t);case this.tok.T_INTERFACE:return this.read_interface_declaration_statement(t);case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement(t);case this.tok.T_USE:return this.read_use_statement();case this.tok.T_CONST:var e=this.node("constantstatement"),i=this.next().read_const_list();return this.expectEndOfStatement(),e(null,i);case this.tok.T_NAMESPACE:return this.read_namespace();case this.tok.T_HALT_COMPILER:var s=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),this.expect(";"),this.lexer.done=!0,s(this.lexer._input.substring(this.lexer.offset));default:return this.read_statement()}},read_inner_statements:function(){for(var t=[];this.token!=this.EOF&&"}"!==this.token;){var e=this.read_inner_statement();e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t},read_const_list:function(){return this.read_list((function(){this.expect(this.tok.T_STRING);var t=this.node("constant"),e=this.node("identifier"),i=this.text();return this.next(),e=e(i),this.expect("=")?t(e,this.next().read_expr()):t(e,null)}),",",!1)},read_declare_list:function(){for(var t=[];this.token!=this.EOF&&")"!==this.token;){this.expect(this.tok.T_STRING);var e=this.node("declaredirective"),i=this.node("identifier"),s=this.text();this.next(),i=i(s);var n=null;if(this.expect("=")&&(n=this.next().read_expr()),t.push(e(i,n)),","!==this.token)break;this.next()}return t},read_inner_statement:function(){var t=[];switch(this.token===this.tok.T_ATTRIBUTE&&(t=this.read_attr_list()),this.token){case this.tok.T_FUNCTION:var e=this.read_function(!1,!1);return e.attrGroups=t,e;case this.tok.T_ABSTRACT:case this.tok.T_FINAL:case this.tok.T_CLASS:return this.read_class_declaration_statement();case this.tok.T_INTERFACE:return this.read_interface_declaration_statement();case this.tok.T_TRAIT:return this.read_trait_declaration_statement();case this.tok.T_ENUM:return this.read_enum_declaration_statement();case this.tok.T_HALT_COMPILER:this.raiseError("__HALT_COMPILER() can only be used from the outermost scope");var i=this.node("halt");return this.next().expect("(")&&this.next(),this.expect(")")&&this.next(),i=i(this.lexer._input.substring(this.lexer.offset)),this.expect(";")&&this.next(),i;default:return this.read_statement()}},read_statement:function(){switch(this.token){case"{":return this.read_code_block(!1);case this.tok.T_IF:return this.read_if();case this.tok.T_SWITCH:return this.read_switch();case this.tok.T_FOR:return this.read_for();case this.tok.T_FOREACH:return this.read_foreach();case this.tok.T_WHILE:return this.read_while();case this.tok.T_DO:return this.read_do();case this.tok.T_COMMENT:return this.read_comment();case this.tok.T_DOC_COMMENT:return this.read_doc_comment();case this.tok.T_RETURN:var t=this.node("return");this.next();var e=this.read_optional_expr(";");return this.expectEndOfStatement(),t(e);case this.tok.T_BREAK:case this.tok.T_CONTINUE:var i=this.node(this.token===this.tok.T_CONTINUE?"continue":"break");this.next();var s=this.read_optional_expr(";");return this.expectEndOfStatement(),i(s);case this.tok.T_GLOBAL:var n=this.node("global"),r=this.next().read_list(this.read_simple_variable,",");return this.expectEndOfStatement(),n(r);case this.tok.T_STATIC:var h=[this.token,this.lexer.getState()],o=this.node();if(this.next().token===this.tok.T_DOUBLE_COLON){this.lexer.tokens.push(h);var a=this.next().read_expr();return this.expectEndOfStatement(a),o("expressionstatement",a)}if(this.token===this.tok.T_FUNCTION)return this.read_function(!0,[0,1,0]);var _=this.read_variable_declarations();return this.expectEndOfStatement(),o("static",_);case this.tok.T_ECHO:var l=this.node("echo"),c=this.text(),u="<?="===c||"<%="===c,p=this.next().read_function_list(this.read_expr,",");return this.expectEndOfStatement(),l(p,u);case this.tok.T_INLINE_HTML:var f=this.text(),T=this.lexer.yylloc.first_offset>0?this.lexer._input[this.lexer.yylloc.first_offset-1]:null,d="\r"===T||"\n"===T;d&&"\n"===T&&this.lexer.yylloc.first_offset>1&&"\r"===this.lexer._input[this.lexer.yylloc.first_offset-2]&&(T="\r\n");var k=this.node("inline");return this.next(),k(f,d?T+f:f);case this.tok.T_UNSET:var x=this.node("unset");this.next().expect("(")&&this.next();var E=this.read_function_list(this.read_variable,",");return this.expect(")")&&this.next(),this.expect(";")&&this.next(),x(E);case this.tok.T_DECLARE:var y,A=this.node("declare"),v=[];this.next().expect("(")&&this.next();var m=this.read_declare_list();if(this.expect(")")&&this.next(),":"===this.token){for(this.next();this.token!=this.EOF&&this.token!==this.tok.T_ENDDECLARE;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect(this.tok.T_ENDDECLARE)&&this.next(),this.expectEndOfStatement(),y=this.ast.declare.MODE_SHORT}else if("{"===this.token){for(this.next();this.token!=this.EOF&&"}"!==this.token;)v.push(this.read_top_statement());0===v.length&&this.extractDoc&&this._docs.length>this._docIndex&&v.push(this.node("noop")()),this.expect("}")&&this.next(),y=this.ast.declare.MODE_BLOCK}else this.expect(";")&&this.next(),y=this.ast.declare.MODE_NONE;return A(m,v,y);case this.tok.T_TRY:return this.read_try();case this.tok.T_THROW:var N=this.node("throw"),I=this.next().read_expr();return this.expectEndOfStatement(),N(I);case";":return this.next(),null;case this.tok.T_STRING:var L=this.node(),S=[this.token,this.lexer.getState()],C=this.text(),O=this.node("identifier");if(":"===this.next().token)return O=O(C),this.next(),L("label",O);O.destroy(),L.destroy(),this.lexer.tokens.push(S);var b=this.node("expressionstatement"),R=this.next().read_expr();return this.expectEndOfStatement(R),b(R);case this.tok.T_GOTO:var g=this.node("goto"),D=null;if(this.next().expect(this.tok.T_STRING)){D=this.node("identifier");var U=this.text();this.next(),D=D(U),this.expectEndOfStatement()}return g(D);default:var P=this.node("expressionstatement"),M=this.read_expr();return this.expectEndOfStatement(M),P(M)}},read_code_block:function(t){var e=this.node("block");this.expect("{")&&this.next();var i=t?this.read_top_statements():this.read_inner_statements();return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect("}")&&this.next(),e(null,i)}}},2478:t=>{t.exports={read_switch:function(){var t=this.node("switch");this.expect(this.tok.T_SWITCH)&&this.next(),this.expect("(")&&this.next();var e=this.read_expr();this.expect(")")&&this.next();var i=":"===this.token;return t(e,this.read_switch_case_list(),i)},read_switch_case_list:function(){var t=null,e=this.node("block"),i=[];for("{"===this.token?t="}":":"===this.token?t=this.tok.T_ENDSWITCH:this.expect(["{",":"]),this.next(),";"===this.token&&this.next();this.token!==this.EOF&&this.token!==t;)i.push(this.read_case_list(t));return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),t===this.tok.T_ENDSWITCH&&this.expectEndOfStatement(),e(null,i)},read_case_list:function(t){var e=this.node("case"),i=null;this.token===this.tok.T_CASE?i=this.next().read_expr():this.token===this.tok.T_DEFAULT?this.next():this.expect([this.tok.T_CASE,this.tok.T_DEFAULT]),this.expect([":",";"])&&this.next();for(var s=this.node("block"),n=[];this.token!==this.EOF&&this.token!==t&&this.token!==this.tok.T_CASE&&this.token!==this.tok.T_DEFAULT;)n.push(this.read_inner_statement());return e(i,s(null,n))}}},77:t=>{t.exports={read_try:function(){this.expect(this.tok.T_TRY);for(var t=this.node("try"),e=null,i=[],s=this.next().read_statement();this.token===this.tok.T_CATCH;){var n=this.node("catch");this.next().expect("(")&&this.next();var r=this.read_list(this.read_namespace_name,"|",!1),h=null;(this.version<800||this.token===this.tok.T_VARIABLE)&&(h=this.read_variable(!0,!1)),this.expect(")"),i.push(n(this.next().read_statement(),r,h))}return this.token===this.tok.T_FINALLY&&(e=this.next().read_statement()),t(s,i,e)}}},6077:t=>{t.exports={read_short_form:function(t){var e=this.node("block"),i=[];for(this.expect(":")&&this.next();this.token!=this.EOF&&this.token!==t;)i.push(this.read_inner_statement());return 0===i.length&&this.extractDoc&&this._docs.length>this._docIndex&&i.push(this.node("noop")()),this.expect(t)&&this.next(),this.expectEndOfStatement(),e(null,i)},read_function_list:function(t,e){var i=[];do{if(this.token==e&&this.version>=703&&i.length>0){i.push(this.node("noop")());break}if(i.push(t.apply(this,[])),this.token!=e)break;if(")"==this.next().token&&this.version>=703)break}while(this.token!=this.EOF);return i},read_list:function(t,e,i){var s=[];if(this.token==e&&(i&&s.push("function"==typeof t?this.node("noop")():null),this.next()),"function"==typeof t)do{var n=t.apply(this,[]);if(n&&s.push(n),this.token!=e)break}while(this.next().token!=this.EOF);else{if(!this.expect(t))return[];for(s.push(this.text());this.next().token!=this.EOF&&this.token==e&&this.next().token==t;)s.push(this.text())}return s},read_name_list:function(){return this.read_list(this.read_namespace_name,",",!1)},read_byref:function(t){var e=this.node("byref");this.next(),e=e(null);var i=t();return i&&(this.ast.swapLocations(i,e,i,this),i.byref=!0),i},read_variable_declarations:function(){return this.read_list((function(){var t=this.node("staticvariable"),e=this.node("variable");if(this.expect(this.tok.T_VARIABLE)){var i=this.text().substring(1);this.next(),e=e(i,!1)}else e=e("#ERR",!1);return"="===this.token?t(e,this.next().read_expr()):e}),",")},read_extends_from:function(){return this.token===this.tok.T_EXTENDS?this.next().read_namespace_name():null},read_interface_extends_list:function(){return this.token===this.tok.T_EXTENDS?this.next().read_name_list():null},read_implements_list:function(){return this.token===this.tok.T_IMPLEMENTS?this.next().read_name_list():null}}},1130:t=>{t.exports={read_variable:function(t,e){var i;if("&"===this.token)return this.read_byref(this.read_variable.bind(this,t,e));if(this.is([this.tok.T_VARIABLE,"$"]))i=this.read_reference_variable(e);else if(this.is([this.tok.T_NS_SEPARATOR,this.tok.T_STRING,this.tok.T_NAME_RELATIVE,this.tok.T_NAME_QUALIFIED,this.tok.T_NAME_FULLY_QUALIFIED,this.tok.T_NAMESPACE])){i=this.node();var s=this.read_namespace_name();if(this.token!=this.tok.T_DOUBLE_COLON&&"("!=this.token&&-1===["parentreference","selfreference"].indexOf(s.kind)){var n=s.name.toLowerCase();"true"===n?i=s.destroy(i("boolean",!0,s.name)):"false"===n?i=s.destroy(i("boolean",!1,s.name)):"null"===n?i=s.destroy(i("nullkeyword",s.name)):(i.destroy(s),i=s)}else i.destroy(s),i=s}else if(this.token===this.tok.T_STATIC){i=this.node("staticreference");var r=this.text();this.next(),i=i(r)}else this.expect("VARIABLE");return this.token===this.tok.T_DOUBLE_COLON&&(i=this.read_static_getter(i,e)),this.recursive_variable_chain_scan(i,t,e)},read_static_getter:function(t,e){var i,s,n=this.node("staticlookup");return this.next().is([this.tok.T_VARIABLE,"$"])?i=this.read_reference_variable(e):this.token===this.tok.T_STRING||this.token===this.tok.T_CLASS||this.version>=700&&this.is("IDENTIFIER")?(i=this.node("identifier"),s=this.text(),this.next(),i=i(s)):"{"===this.token?(i=this.node("literal"),s=this.next().read_expr(),this.expect("}")&&this.next(),i=i("literal",s,null),this.expect("(")):(this.error([this.tok.T_VARIABLE,this.tok.T_STRING]),i=this.node("identifier"),s=this.text(),this.next(),i=i(s)),n(t,i)},read_what:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=null,i=null;switch(this.next().token){case this.tok.T_STRING:e=this.node("identifier"),i=this.text(),this.next(),e=e(i),t&&this.token===this.tok.T_OBJECT_OPERATOR&&this.error();break;case this.tok.T_VARIABLE:e=this.node("variable"),i=this.text().substring(1),this.next(),e=e(i,!1);break;case"$":e=this.node(),this.next().expect(["$","{",this.tok.T_VARIABLE]),"{"===this.token?(i=this.next().read_expr(),this.expect("}")&&this.next(),e=e("variable",i,!0)):e=e("variable",i=this.read_expr(),!1);break;case"{":e=this.node("encapsedpart"),i=this.next().read_expr(),this.expect("}")&&this.next(),e=e(i,"complex",!1);break;default:this.error([this.tok.T_STRING,this.tok.T_VARIABLE,"$","{"]),e=this.node("identifier"),i=this.text(),this.next(),e=e(i)}return e},recursive_variable_chain_scan:function(t,e,i){var s,n;t:for(;this.token!=this.EOF;)switch(this.token){case"(":if(e)return t;t=this.node("call")(t,this.read_argument_list());break;case"[":case"{":var r="["===this.token;s=this.node("offsetlookup"),this.next(),n=!1,i?(n=this.read_encaps_var_offset(),this.expect(r?"]":"}")&&this.next()):(r?"]"!==this.token:"}"!==this.token)?(n=this.read_expr(),this.expect(r?"]":"}")&&this.next()):this.next(),t=s(t,n);break;case this.tok.T_DOUBLE_COLON:"staticlookup"===t.kind&&"identifier"===t.offset.kind&&this.error(),t=(s=this.node("staticlookup"))(t,this.read_what(!0));break;case this.tok.T_OBJECT_OPERATOR:t=(s=this.node("propertylookup"))(t,this.read_what());break;case this.tok.T_NULLSAFE_OBJECT_OPERATOR:t=(s=this.node("nullsafepropertylookup"))(t,this.read_what());break;default:break t}return t},read_encaps_var_offset:function(){var t=this.node();if(this.token===this.tok.T_STRING){var e=this.text();this.next(),t=t("identifier",e)}else if(this.token===this.tok.T_NUM_STRING){var i=this.text();this.next(),t=t("number",i,null)}else if("-"===this.token){this.next();var s=-1*this.text();this.expect(this.tok.T_NUM_STRING)&&this.next(),t=t("number",s,null)}else if(this.token===this.tok.T_VARIABLE){var n=this.text().substring(1);this.next(),t=t("variable",n,!1)}else{this.expect([this.tok.T_STRING,this.tok.T_NUM_STRING,"-",this.tok.T_VARIABLE]);var r=this.text();this.next(),t=t("identifier",r)}return t},read_reference_variable:function(t){for(var e,i=this.read_simple_variable();this.token!=this.EOF;){var s=this.node();if("{"!=this.token||t){s.destroy();break}e=this.next().read_expr(),this.expect("}")&&this.next(),i=s("offsetlookup",i,e)}return i},read_simple_variable:function(){var t,e=this.node("variable");if(this.expect([this.tok.T_VARIABLE,"$"])&&this.token===this.tok.T_VARIABLE)t=this.text().substring(1),this.next(),e=e(t,!1);else switch("$"===this.token&&this.next(),this.token){case"{":var i=this.next().read_expr();this.expect("}")&&this.next(),e=e(i,!0);break;case"$":e=e(this.read_simple_variable(),!1);break;case this.tok.T_VARIABLE:t=this.text().substring(1);var s=this.node("variable");this.next(),e=e(s(t,!1),!1);break;default:this.error(["{","$",this.tok.T_VARIABLE]),t=this.text(),this.next(),e=e(t,!1)}return e}}},1906:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,s)}return i}function s(t){for(var e=1;e<arguments.length;e++){var s=null!=arguments[e]?arguments[e]:{};e%2?i(Object(s),!0).forEach((function(e){n(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):i(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function n(t,i,s){return(i=function(t){var i=function(t){if("object"!=e(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var s=i.call(t,"string");if("object"!=e(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(i)?i:i+""}(i))in t?Object.defineProperty(t,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[i]=s,t}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}var h={T_HALT_COMPILER:101,T_USE:102,T_ENCAPSED_AND_WHITESPACE:103,T_OBJECT_OPERATOR:104,T_STRING:105,T_DOLLAR_OPEN_CURLY_BRACES:106,T_STRING_VARNAME:107,T_CURLY_OPEN:108,T_NUM_STRING:109,T_ISSET:110,T_EMPTY:111,T_INCLUDE:112,T_INCLUDE_ONCE:113,T_EVAL:114,T_REQUIRE:115,T_REQUIRE_ONCE:116,T_NAMESPACE:117,T_NS_SEPARATOR:118,T_AS:119,T_IF:120,T_ENDIF:121,T_WHILE:122,T_DO:123,T_FOR:124,T_SWITCH:125,T_BREAK:126,T_CONTINUE:127,T_RETURN:128,T_GLOBAL:129,T_STATIC:130,T_ECHO:131,T_INLINE_HTML:132,T_UNSET:133,T_FOREACH:134,T_DECLARE:135,T_TRY:136,T_THROW:137,T_GOTO:138,T_FINALLY:139,T_CATCH:140,T_ENDDECLARE:141,T_LIST:142,T_CLONE:143,T_PLUS_EQUAL:144,T_MINUS_EQUAL:145,T_MUL_EQUAL:146,T_DIV_EQUAL:147,T_CONCAT_EQUAL:148,T_MOD_EQUAL:149,T_AND_EQUAL:150,T_OR_EQUAL:151,T_XOR_EQUAL:152,T_SL_EQUAL:153,T_SR_EQUAL:154,T_INC:155,T_DEC:156,T_BOOLEAN_OR:157,T_BOOLEAN_AND:158,T_LOGICAL_OR:159,T_LOGICAL_AND:160,T_LOGICAL_XOR:161,T_SL:162,T_SR:163,T_IS_IDENTICAL:164,T_IS_NOT_IDENTICAL:165,T_IS_EQUAL:166,T_IS_NOT_EQUAL:167,T_IS_SMALLER_OR_EQUAL:168,T_IS_GREATER_OR_EQUAL:169,T_INSTANCEOF:170,T_INT_CAST:171,T_DOUBLE_CAST:172,T_STRING_CAST:173,T_ARRAY_CAST:174,T_OBJECT_CAST:175,T_BOOL_CAST:176,T_UNSET_CAST:177,T_EXIT:178,T_PRINT:179,T_YIELD:180,T_YIELD_FROM:181,T_FUNCTION:182,T_DOUBLE_ARROW:183,T_DOUBLE_COLON:184,T_ARRAY:185,T_CALLABLE:186,T_CLASS:187,T_ABSTRACT:188,T_TRAIT:189,T_FINAL:190,T_EXTENDS:191,T_INTERFACE:192,T_IMPLEMENTS:193,T_VAR:194,T_PUBLIC:195,T_PROTECTED:196,T_PRIVATE:197,T_CONST:198,T_NEW:199,T_INSTEADOF:200,T_ELSEIF:201,T_ELSE:202,T_ENDSWITCH:203,T_CASE:204,T_DEFAULT:205,T_ENDFOR:206,T_ENDFOREACH:207,T_ENDWHILE:208,T_CONSTANT_ENCAPSED_STRING:209,T_LNUMBER:210,T_DNUMBER:211,T_LINE:212,T_FILE:213,T_DIR:214,T_TRAIT_C:215,T_METHOD_C:216,T_FUNC_C:217,T_NS_C:218,T_START_HEREDOC:219,T_END_HEREDOC:220,T_CLASS_C:221,T_VARIABLE:222,T_OPEN_TAG:223,T_OPEN_TAG_WITH_ECHO:224,T_CLOSE_TAG:225,T_WHITESPACE:226,T_COMMENT:227,T_DOC_COMMENT:228,T_ELLIPSIS:229,T_COALESCE:230,T_POW:231,T_POW_EQUAL:232,T_SPACESHIP:233,T_COALESCE_EQUAL:234,T_FN:235,T_NULLSAFE_OBJECT_OPERATOR:236,T_MATCH:237,T_ATTRIBUTE:238,T_ENUM:239,T_READ_ONLY:240,T_NAME_RELATIVE:241,T_NAME_QUALIFIED:242,T_NAME_FULLY_QUALIFIED:243},o={values:Object.entries(h).reduce((function(t,e){var i,h,o=(h=2,function(t){if(Array.isArray(t))return t}(i=e)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var s,n,r,h,o=[],a=!0,_=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;a=!1}else for(;!(a=(s=r.call(i)).done)&&(o.push(s.value),o.length!==e);a=!0);}catch(t){_=!0,n=t}finally{try{if(!a&&null!=i.return&&(h=i.return(),Object(h)!==h))return}finally{if(_)throw n}}return o}}(i,h)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(t,e):void 0}}(i,h)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],_=o[1];return s(s({},t),{},n({},_,a))}),{}),names:h};t.exports=Object.freeze(o)}},e={},i=function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s](r,r.exports,i),r.exports}(5362);return i.default})(),t.exports=e()},3145:(t,e,i)=>{"use strict";function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=Array(e);i<e;i++)s[i]=t[i];return s}i.d(e,{A:()=>s})},6369:(t,e,i)=>{"use strict";function s(t){if(Array.isArray(t))return t}i.d(e,{A:()=>s})},6986:(t,e,i)=>{"use strict";function s(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var s,n,r,h,o=[],a=!0,_=!1;try{if(r=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;a=!1}else for(;!(a=(s=r.call(i)).done)&&(o.push(s.value),o.length!==e);a=!0);}catch(t){_=!0,n=t}finally{try{if(!a&&null!=i.return&&(h=i.return(),Object(h)!==h))return}finally{if(_)throw n}}return o}}i.d(e,{A:()=>s})},6562:(t,e,i)=>{"use strict";function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}i.d(e,{A:()=>s})},3453:(t,e,i)=>{"use strict";i.d(e,{A:()=>o});var s=i(6369),n=i(6986),r=i(7800),h=i(6562);function o(t,e){return(0,s.A)(t)||(0,n.A)(t,e)||(0,r.A)(t,e)||(0,h.A)()}},816:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});var s=i(2284);function n(t){var e=function(t){if("object"!=(0,s.A)(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=(0,s.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==(0,s.A)(e)?e:e+""}},2284:(t,e,i)=>{"use strict";function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}i.d(e,{A:()=>s})},7800:(t,e,i)=>{"use strict";i.d(e,{A:()=>n});var s=i(3145);function n(t,e){if(t){if("string"==typeof t)return(0,s.A)(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?(0,s.A)(t,e):void 0}}}},i={};function s(t){var n=i[t];if(void 0!==n)return n.exports;var r=i[t]={exports:{}};return e[t](r,r.exports,s),r.exports}s.m=e,t=[],s.O=(e,i,n,r)=>{if(!i){var h=1/0;for(l=0;l<t.length;l++){for(var[i,n,r]=t[l],o=!0,a=0;a<i.length;a++)(!1&r||h>=r)&&Object.keys(s.O).every((t=>s.O[t](i[a])))?i.splice(a--,1):(o=!1,r<h&&(h=r));if(o){t.splice(l--,1);var _=n();void 0!==_&&(e=_)}}return e}r=r||0;for(var l=t.length;l>0&&t[l-1][2]>r;l--)t[l]=t[l-1];t[l]=[i,n,r]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={6008:0};s.O.j=e=>0===t[e];var e=(e,i)=>{var n,r,[h,o,a]=i,_=0;if(h.some((e=>0!==t[e]))){for(n in o)s.o(o,n)&&(s.m[n]=o[n]);if(a)var l=a(s)}for(e&&e(i);_<h.length;_++)r=h[_],s.o(t,r)&&t[r]&&t[r][0](),t[r]=0;return s.O(l)},i=self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var n=s(2949);n=s.O(n)})(); dist/editor.js.LICENSE.txt 0000644 00000000435 15153464547 0011252 0 ustar 00 /*!
*
* Package: php-parser
* Parse PHP code from JS and returns its AST
* Build: 546cb0da384f6fc5d54c - 12/31/2024
* Copyright (C) 2021 Glayzzle (BSD-3-Clause)
* @authors https://github.com/glayzzle/php-parser/graphs/contributors
* @url http://glayzzle.com
*
*/
dist/manage-rtl.css 0000644 00000032223 15153464547 0010270 0 ustar 00 .button .badge,.go-pro-button .badge,.nav-tab .badge,.snippet-type-badge{border:1px solid;border-radius:5px;font-size:10px;padding:1px 2px;text-transform:uppercase}.button .snippet-type-badge,.go-pro-button .badge,.nav-tab .badge,h1 .snippet-type-badge,h2 .snippet-type-badge,h3 .snippet-type-badge{margin-right:3px}.button .badge{font-size:8px;text-transform:lowercase}.nav-tab .badge,.nav-tab span{vertical-align:middle}.nav-tab[data-snippet-type=php] .badge,.snippet-type-badge[data-snippet-type=php]{border-color:currentColor;color:#0073aa}.nav-tab-inactive[data-snippet-type=php]:hover .badge{color:#0073aa}.nav-tab[data-snippet-type=css] .badge,.snippet-type-badge[data-snippet-type=css]{border-color:currentColor;color:#8000ff}.nav-tab-inactive[data-snippet-type=css]:hover .badge{color:#8000ff}.nav-tab[data-snippet-type=js] .badge,.snippet-type-badge[data-snippet-type=js]{border-color:currentColor;color:#cd6600}.nav-tab-inactive[data-snippet-type=js]:hover .badge{color:#cd6600}.nav-tab[data-snippet-type=html] .badge,.snippet-type-badge[data-snippet-type=html]{border-color:currentColor;color:#548b54}.nav-tab-inactive[data-snippet-type=html]:hover .badge{color:#548b54}.nav-tab-button .dashicons-external{color:#666;font-size:15px;vertical-align:middle}.nav-tab.nav-tab-inactive{background:transparent;text-shadow:0 1px 0 #fff}.nav-tab.nav-tab-inactive,.nav-tab.nav-tab-inactive .badge{color:#a7aaad}.nav-tab.nav-tab-inactive:hover{color:#50575e}.core-badge,.go-pro-badge,.pro-badge{border:1px solid;border-radius:5px;font-size:10px;margin-right:3px;padding:1px 2px;text-transform:uppercase}.go-pro-badge,.pro-badge{color:#ce0000}.core-badge{color:#0073aa}.go-pro-badge,.go-pro-button .badge{border-color:#ce0000;color:#ce0000;margin-right:1px}.wp-core-ui .button.nav-tab-button{background:#f6f7f7;border-color:#f6f7f7;color:#a7aaad;float:left;margin-right:.5em}.wp-core-ui .button.nav-tab-button:hover{background-color:#fff;color:#3c434a}.cloud-search-info{text-align:justify}.cloud-search-info small{color:#646970;float:left}.thickbox-code-viewer{background-color:#f6f6f6;border-radius:10px;min-height:250px;padding:20px}#snippet-code-thickbox{display:block;width:100%}.cloud-icon{margin-left:3px}.nav-tab-inactive .cloud-badge{color:#a7aaad}.cloud-synced,.cloud-synced-legend,.nav-tab-inactive[data-snippet-type=cloud]:hover .cloud-badge{color:#00bcd4}.cloud-downloaded,.nav-tab-inactive[data-snippet-type=cloud_search]:hover .cloud-badge{color:#e91e63}.nav-tab-inactive[data-snippet-type=bundles]:hover .cloud-badge{color:#50575e}.cloud-not-downloaded{color:#9e9e9e}.cloud-update,.cloud_update a{color:#ff9800!important}.cloud_update a{text-decoration:underline}.cloud-table>tbody>tr{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);height:80px}.cloud-table>tbody>tr>td{max-width:250px}.cloud-table tbody .active-snippet .column-name{font-weight:400;max-width:400px;white-space:normal!important}.cloud-table td .no-results{color:#e32121;margin-top:15px;text-align:center}.updated.column-updated span{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.action-button-link,.column-download a{background:transparent;border:1px solid;border-radius:5px;display:block;margin-bottom:5px;padding:5px;text-align:center}.cloud-snippet-download{color:#2271b1!important}.cloud-snippet-downloaded,.cloud-snippet-preview-style{color:#616161!important}.cloud-snippet-update{color:#ff9800!important}.snippet-type-badge{white-space:nowrap}.cloud-badge{border:1px solid;border-radius:5px;font-size:15px;line-height:19px;margin-right:10px}#cloud-search-form{margin-bottom:30px;margin-top:30px;text-align:center}.input-group{align-items:stretch;display:flex;flex-wrap:wrap;margin:0 auto;max-width:900px;position:relative}#cloud_search{background-clip:padding-box;border-radius:0;color:#495057;display:block;flex:1 1 auto;font-size:1rem;margin-bottom:0;padding:.375rem .75rem;position:relative;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:1%}#cloud_search:focus{border:1px solid #8c8f94;box-shadow:none;outline:0}#cloud-select-prepend{background-color:#f6f7f7;border-bottom-left-radius:0;border-color:#2271b1;border-top-left-radius:0;color:#2271b1;margin-left:-3px;position:relative;z-index:2}#cloud-select-prepend:hover{background-color:#f0f0f1;border-color:#0a4b78;color:#0a4b78}#cloud-search-submit{align-items:center;display:flex;justify-content:center;margin-right:-3px;padding:0 15px}.cloud-search{margin-right:5px}.bundle-group{display:flex;flex-wrap:nowrap;gap:5px;justify-content:space-between;margin-top:10px}#cloud-bundles{color:#495057;display:flex;flex:1 1 auto;font-size:1rem;padding:.375rem .75rem;position:relative;width:50%}#cloud-bundle-show{width:10%}#cloud-bundle-run{width:15%}#bundle_share_name{color:#495057;font-size:1rem;width:25%}.heading-box{margin:auto;max-width:900px;padding-bottom:1rem}.cloud-search-heading{font-size:23px;font-weight:400;line-height:1.3;margin-bottom:0;padding:9px 0 4px;text-align:center}.cloud-badge.ai-icon{color:#b22222;font-size:12px;margin-right:5px;padding:3px}.cloud-search-card-bottom{min-height:40px}#cloud-search-results .cloud-snippets #the-list{display:flex;flex-wrap:wrap;justify-content:center}.cloud-snippets .plugin-card{display:flex;flex-direction:column;justify-content:space-between}.cloud-connect-wrap{align-items:center;display:flex;float:left;gap:5px;justify-content:space-between;margin:0 3px;max-height:35px}.cloud-status-dot{background-color:#ce0000;border-radius:50%;height:10px;width:10px}.cloud-connect-active .cloud-status-dot{background-color:#25a349}.cloud-connect-text{color:#ce0000}.cloud-connect-active .cloud-connect-text{color:#2e7d32}.voted-info{align-items:center;display:inline-flex;gap:3px;margin-bottom:6px!important}.voted-info:hover .thumbs-up{stroke:#059669;fill:#6ee7b7;animation:thumb 1s ease-in-out infinite}.thumbs-up{height:1.25rem;transform-origin:bottom right;width:1.25rem}.thumbs-up:hover{stroke:#059669;fill:#6ee7b7}.ai-verified-snippet .badge,.snippet-type-badge[data-type=ai-verified]{background-color:#ccfbf1;color:#0f766e}.private-snippet .badge,.snippet-type-badge[data-type=private]{background-color:#eff6ff;color:#1d4ed8}.public-snippet .badge,.snippet-type-badge[data-type=public]{background-color:#fefce8;color:#a16207}.snippet-type-badge[data-type=unverified],.unverified-snippet .badge{background-color:#fff1f2;color:#be123c}.snippet-type-badge[data-type=unverified]:hover,.unverified-snippet .badge:hover{background-color:#fde2e4;color:#be123c}.no-results{font-size:15px}.css-badge{color:#8000ff!important}.js-badge{color:#cd6600!important}.php-badge{color:#0073aa!important}.html-badge{color:#548b54!important}.tooltip-box{display:inline-block;position:relative}.tooltip-box .tooltip-text{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:rgba(0,0,0,.7);border-radius:5px;padding:6px;position:absolute;visibility:hidden;width:400px;z-index:5}.tooltip-box:hover .tooltip-text{visibility:visible}.tooltip-text-item,.tooltip-text-link,.tooltip-text-title{color:#fff!important;text-align:center}.tooltip-text-title{font-weight:700}.tooltip-text-link,.tooltip-text-title{text-decoration:underline}.tooltip-box .cloud-key{color:#fff;left:0;width:450px}.plugin-card-bottom{overflow:visible!important}.beta-test-notice{margin-top:20px}.highlight-yellow{background:#ffee58;border-radius:3px;padding:3px}@keyframes thumb{0%{transform:rotate(0)}33%{transform:rotate(-7deg)}66%{transform:rotate(15deg)}90%{transform:rotate(-5deg)}to{transform:rotate(0)}}.column-name .dashicons,.column-type .dashicons{font-size:16px;height:16px;vertical-align:middle;width:16px}.column-name .dashicons-clock,.column-type .dashicons-clock{vertical-align:middle}.active-snippet .column-name>a{font-weight:600}.column-priority input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;box-shadow:none;color:#666;text-align:center;width:4em}.column-priority input:active,.column-priority input:focus,.column-priority input:hover{background-color:#f5f5f5;background-color:rgba(0,0,0,.1);border-radius:6px;color:#000}.column-priority input:disabled{color:inherit}.snippet-activation-switch,.snippet-execution-button{display:block;position:relative}.snippet-activation-switch{background-color:#ccc;border-radius:34px;height:17px;margin-top:5px;width:30px}.snippet-activation-switch:before{background-color:#fff;border-radius:50%;content:"";display:inline-block;height:13px;margin:2px;transition:all .4s;width:13px}.snippets .active-snippet .snippet-activation-switch{background-color:#2196f3}.snippets .active-snippet .snippet-activation-switch:before{transform:translateX(-100%)}.snippets .erroneous-snippet .snippet-activation-switch:before{color:#bbb;content:"!";font-weight:700;line-height:1;text-align:center;transform:translateX(-50%)}.snippet-execution-button{border-bottom:9px solid transparent;border-right:10px solid #ccc;border-top:9px solid transparent;height:0;margin-right:10px;margin-top:9px;transition:all .3s;width:0}.snippet-execution-button:before{border:1.8px solid #ccc;border-radius:50%;bottom:-14px;content:"";right:-21px;position:absolute;left:-8px;top:-14px;transition:all .3s;z-index:2}.snippet-execution-button:focus,.snippet-execution-button:hover{border-right-color:#579}.snippet-execution-button:focus:before,.snippet-execution-button:hover:before{border-color:#579;transform:scale(1.1)}.clear-filters{vertical-align:baseline!important}.snippets tr{background:#fff}.snippets ol,.snippets ul{margin:0 1.5em 1.5em 0}.snippets ul{list-style:disc}.snippets th.sortable a,.snippets th.sorted a{display:flex;flex-direction:row}.snippets .row-actions{color:#ddd;right:0;position:relative}.snippets .column-activate{padding-left:0!important}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th.check-column{padding:13px 3px 0 0}.snippets .inactive-snippet th.check-column,.snippets tfoot th.check-column,.snippets thead th.check-column{padding-right:5px}.snippets td.column-description{max-width:700px}.snippets .active-snippet td,.snippets .active-snippet th,.snippets .inactive-snippet td,.snippets .inactive-snippet th{border:none;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);padding:10px 9px}.snippets .badge{background-color:#e0e0e0;background-color:rgba(0,0,0,.08);border:none;border-radius:2px;font-size:smaller;line-height:1.2;margin-right:4px;padding:3px 6px;text-decoration:none}.rtl .snippets .badge{float:right}.snippets tr.active-snippet+tr.inactive-snippet td,.snippets tr.active-snippet+tr.inactive-snippet th{border-top:1px solid rgba(0,0,0,.03);box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover,.snippets a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}.inactive-snippet a{color:#579}.inactive-snippet a:active,.inactive-snippet a:focus,.inactive-snippet a:hover{color:#819db9}.active-snippet td,.active-snippet th{background-color:rgba(120,200,230,.06)}.active-snippet th.check-column{border-right:2px solid #2ea2cc}.active-snippet .snippet-activation-switch{background-color:#2196f3}.css-snippet a{color:#b452cd}.css-snippet a:active,.css-snippet a:focus,.css-snippet a:hover{color:#ce8dde}.css-snippet.active-snippet a{color:#7d26cd}.css-snippet.active-snippet a:active,.css-snippet.active-snippet a:focus,.css-snippet.active-snippet a:hover{color:#a25ee1}.css-snippet.active-snippet td,.css-snippet.active-snippet th{background-color:rgba(85,26,139,.06)}.css-snippet.active-snippet .snippet-activation-switch{background-color:#8000ff}.css-snippet.active-snippet th.check-column{border-right-color:#8000ff}.html-snippet a{color:#548b54}.html-snippet a:active,.html-snippet a:focus,.html-snippet a:hover{color:#7cb07c}.html-snippet.active-snippet a{color:#548b54}.html-snippet.active-snippet a:active,.html-snippet.active-snippet a:focus,.html-snippet.active-snippet a:hover{color:#7cb07c}.html-snippet.active-snippet td,.html-snippet.active-snippet th{background-color:rgba(84,139,84,.06)}.html-snippet.active-snippet .snippet-activation-switch{background-color:#548b54}.html-snippet.active-snippet th.check-column{border-right-color:#548b54}.js-snippet a{color:#cd6600}.js-snippet a:active,.js-snippet a:focus,.js-snippet a:hover{color:#ff8c1b}.js-snippet.active-snippet a{color:#d44500}.js-snippet.active-snippet a:active,.js-snippet.active-snippet a:focus,.js-snippet.active-snippet a:hover{color:#ff6a22}.js-snippet.active-snippet td,.js-snippet.active-snippet th{background-color:rgba(205,102,0,.06)}.js-snippet.active-snippet .snippet-activation-switch{background-color:#cd6600}.js-snippet.active-snippet th.check-column{border-right-color:#cd6600}@media screen and (max-width:782px){p.search-box{float:right;height:auto;margin:1em 0 0;position:static}}.wp-list-table .is-expanded td.column-activate.activate{display:table-cell!important}.nav-tab-wrapper+.subsubsub,p.search-box{margin:10px 0 0}.snippet-type-description{border-bottom:1px solid #ccc;margin:0;padding:1em 0}.code-snippets-notice a.notice-dismiss{text-decoration:none}.refresh-button-container{align-items:center;display:flex;gap:7px;justify-content:flex-start;margin-bottom:-39px;margin-top:15px}#refresh-button{font-size:20px;line-height:1.4;padding:0;width:30px}@media screen and (max-width:1190px){.nav-tab .snippet-label{display:none}.nav-tab .cloud-badge{margin-left:10px}}
dist/manage.css 0000644 00000032205 15153464547 0007471 0 ustar 00 .button .badge,.go-pro-button .badge,.nav-tab .badge,.snippet-type-badge{border:1px solid;border-radius:5px;font-size:10px;padding:1px 2px;text-transform:uppercase}.button .snippet-type-badge,.go-pro-button .badge,.nav-tab .badge,h1 .snippet-type-badge,h2 .snippet-type-badge,h3 .snippet-type-badge{margin-left:3px}.button .badge{font-size:8px;text-transform:lowercase}.nav-tab .badge,.nav-tab span{vertical-align:middle}.nav-tab[data-snippet-type=php] .badge,.snippet-type-badge[data-snippet-type=php]{border-color:currentColor;color:#0073aa}.nav-tab-inactive[data-snippet-type=php]:hover .badge{color:#0073aa}.nav-tab[data-snippet-type=css] .badge,.snippet-type-badge[data-snippet-type=css]{border-color:currentColor;color:#8000ff}.nav-tab-inactive[data-snippet-type=css]:hover .badge{color:#8000ff}.nav-tab[data-snippet-type=js] .badge,.snippet-type-badge[data-snippet-type=js]{border-color:currentColor;color:#cd6600}.nav-tab-inactive[data-snippet-type=js]:hover .badge{color:#cd6600}.nav-tab[data-snippet-type=html] .badge,.snippet-type-badge[data-snippet-type=html]{border-color:currentColor;color:#548b54}.nav-tab-inactive[data-snippet-type=html]:hover .badge{color:#548b54}.nav-tab-button .dashicons-external{color:#666;font-size:15px;vertical-align:middle}.nav-tab.nav-tab-inactive{background:transparent;text-shadow:0 1px 0 #fff}.nav-tab.nav-tab-inactive,.nav-tab.nav-tab-inactive .badge{color:#a7aaad}.nav-tab.nav-tab-inactive:hover{color:#50575e}.core-badge,.go-pro-badge,.pro-badge{border:1px solid;border-radius:5px;font-size:10px;margin-left:3px;padding:1px 2px;text-transform:uppercase}.go-pro-badge,.pro-badge{color:#ce0000}.core-badge{color:#0073aa}.go-pro-badge,.go-pro-button .badge{border-color:#ce0000;color:#ce0000;margin-left:1px}.wp-core-ui .button.nav-tab-button{background:#f6f7f7;border-color:#f6f7f7;color:#a7aaad;float:right;margin-left:.5em}.wp-core-ui .button.nav-tab-button:hover{background-color:#fff;color:#3c434a}.cloud-search-info{text-align:justify}.cloud-search-info small{color:#646970;float:right}.thickbox-code-viewer{background-color:#f6f6f6;border-radius:10px;min-height:250px;padding:20px}#snippet-code-thickbox{display:block;width:100%}.cloud-icon{margin-right:3px}.nav-tab-inactive .cloud-badge{color:#a7aaad}.cloud-synced,.cloud-synced-legend,.nav-tab-inactive[data-snippet-type=cloud]:hover .cloud-badge{color:#00bcd4}.cloud-downloaded,.nav-tab-inactive[data-snippet-type=cloud_search]:hover .cloud-badge{color:#e91e63}.nav-tab-inactive[data-snippet-type=bundles]:hover .cloud-badge{color:#50575e}.cloud-not-downloaded{color:#9e9e9e}.cloud-update,.cloud_update a{color:#ff9800!important}.cloud_update a{text-decoration:underline}.cloud-table>tbody>tr{box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);height:80px}.cloud-table>tbody>tr>td{max-width:250px}.cloud-table tbody .active-snippet .column-name{font-weight:400;max-width:400px;white-space:normal!important}.cloud-table td .no-results{color:#e32121;margin-top:15px;text-align:center}.updated.column-updated span{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.action-button-link,.column-download a{background:transparent;border:1px solid;border-radius:5px;display:block;margin-bottom:5px;padding:5px;text-align:center}.cloud-snippet-download{color:#2271b1!important}.cloud-snippet-downloaded,.cloud-snippet-preview-style{color:#616161!important}.cloud-snippet-update{color:#ff9800!important}.snippet-type-badge{white-space:nowrap}.cloud-badge{border:1px solid;border-radius:5px;font-size:15px;line-height:19px;margin-left:10px}#cloud-search-form{margin-bottom:30px;margin-top:30px;text-align:center}.input-group{align-items:stretch;display:flex;flex-wrap:wrap;margin:0 auto;max-width:900px;position:relative}#cloud_search{background-clip:padding-box;border-radius:0;color:#495057;display:block;flex:1 1 auto;font-size:1rem;margin-bottom:0;padding:.375rem .75rem;position:relative;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:1%}#cloud_search:focus{border:1px solid #8c8f94;box-shadow:none;outline:0}#cloud-select-prepend{background-color:#f6f7f7;border-bottom-right-radius:0;border-color:#2271b1;border-top-right-radius:0;color:#2271b1;margin-right:-3px;position:relative;z-index:2}#cloud-select-prepend:hover{background-color:#f0f0f1;border-color:#0a4b78;color:#0a4b78}#cloud-search-submit{align-items:center;display:flex;justify-content:center;margin-left:-3px;padding:0 15px}.cloud-search{margin-left:5px}.bundle-group{display:flex;flex-wrap:nowrap;gap:5px;justify-content:space-between;margin-top:10px}#cloud-bundles{color:#495057;display:flex;flex:1 1 auto;font-size:1rem;padding:.375rem .75rem;position:relative;width:50%}#cloud-bundle-show{width:10%}#cloud-bundle-run{width:15%}#bundle_share_name{color:#495057;font-size:1rem;width:25%}.heading-box{margin:auto;max-width:900px;padding-bottom:1rem}.cloud-search-heading{font-size:23px;font-weight:400;line-height:1.3;margin-bottom:0;padding:9px 0 4px;text-align:center}.cloud-badge.ai-icon{color:#b22222;font-size:12px;margin-left:5px;padding:3px}.cloud-search-card-bottom{min-height:40px}#cloud-search-results .cloud-snippets #the-list{display:flex;flex-wrap:wrap;justify-content:center}.cloud-snippets .plugin-card{display:flex;flex-direction:column;justify-content:space-between}.cloud-connect-wrap{align-items:center;display:flex;float:right;gap:5px;justify-content:space-between;margin:0 3px;max-height:35px}.cloud-status-dot{background-color:#ce0000;border-radius:50%;height:10px;width:10px}.cloud-connect-active .cloud-status-dot{background-color:#25a349}.cloud-connect-text{color:#ce0000}.cloud-connect-active .cloud-connect-text{color:#2e7d32}.voted-info{align-items:center;display:inline-flex;gap:3px;margin-bottom:6px!important}.voted-info:hover .thumbs-up{stroke:#059669;fill:#6ee7b7;animation:thumb 1s ease-in-out infinite}.thumbs-up{height:1.25rem;transform-origin:bottom left;width:1.25rem}.thumbs-up:hover{stroke:#059669;fill:#6ee7b7}.ai-verified-snippet .badge,.snippet-type-badge[data-type=ai-verified]{background-color:#ccfbf1;color:#0f766e}.private-snippet .badge,.snippet-type-badge[data-type=private]{background-color:#eff6ff;color:#1d4ed8}.public-snippet .badge,.snippet-type-badge[data-type=public]{background-color:#fefce8;color:#a16207}.snippet-type-badge[data-type=unverified],.unverified-snippet .badge{background-color:#fff1f2;color:#be123c}.snippet-type-badge[data-type=unverified]:hover,.unverified-snippet .badge:hover{background-color:#fde2e4;color:#be123c}.no-results{font-size:15px}.css-badge{color:#8000ff!important}.js-badge{color:#cd6600!important}.php-badge{color:#0073aa!important}.html-badge{color:#548b54!important}.tooltip-box{display:inline-block;position:relative}.tooltip-box .tooltip-text{-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:rgba(0,0,0,.7);border-radius:5px;padding:6px;position:absolute;visibility:hidden;width:400px;z-index:5}.tooltip-box:hover .tooltip-text{visibility:visible}.tooltip-text-item,.tooltip-text-link,.tooltip-text-title{color:#fff!important;text-align:center}.tooltip-text-title{font-weight:700}.tooltip-text-link,.tooltip-text-title{text-decoration:underline}.tooltip-box .cloud-key{color:#fff;right:0;width:450px}.plugin-card-bottom{overflow:visible!important}.beta-test-notice{margin-top:20px}.highlight-yellow{background:#ffee58;border-radius:3px;padding:3px}@keyframes thumb{0%{transform:rotate(0)}33%{transform:rotate(7deg)}66%{transform:rotate(-15deg)}90%{transform:rotate(5deg)}to{transform:rotate(0)}}.column-name .dashicons,.column-type .dashicons{font-size:16px;height:16px;vertical-align:middle;width:16px}.column-name .dashicons-clock,.column-type .dashicons-clock{vertical-align:middle}.active-snippet .column-name>a{font-weight:600}.column-priority input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;box-shadow:none;color:#666;text-align:center;width:4em}.column-priority input:active,.column-priority input:focus,.column-priority input:hover{background-color:#f5f5f5;background-color:rgba(0,0,0,.1);border-radius:6px;color:#000}.column-priority input:disabled{color:inherit}.snippet-activation-switch,.snippet-execution-button{display:block;position:relative}.snippet-activation-switch{background-color:#ccc;border-radius:34px;height:17px;margin-top:5px;width:30px}.snippet-activation-switch:before{background-color:#fff;border-radius:50%;content:"";display:inline-block;height:13px;margin:2px;transition:all .4s;width:13px}.snippets .active-snippet .snippet-activation-switch{background-color:#2196f3}.snippets .active-snippet .snippet-activation-switch:before{transform:translateX(100%)}.snippets .erroneous-snippet .snippet-activation-switch:before{color:#bbb;content:"!";font-weight:700;line-height:1;text-align:center;transform:translateX(50%)}.snippet-execution-button{border-bottom:9px solid transparent;border-left:10px solid #ccc;border-top:9px solid transparent;height:0;margin-left:10px;margin-top:9px;transition:all .3s;width:0}.snippet-execution-button:before{border:1.8px solid #ccc;border-radius:50%;bottom:-14px;content:"";left:-21px;position:absolute;right:-8px;top:-14px;transition:all .3s;z-index:2}.snippet-execution-button:focus,.snippet-execution-button:hover{border-left-color:#579}.snippet-execution-button:focus:before,.snippet-execution-button:hover:before{border-color:#579;transform:scale(1.1)}.clear-filters{vertical-align:baseline!important}.snippets tr{background:#fff}.snippets ol,.snippets ul{margin:0 0 1.5em 1.5em}.snippets ul{list-style:disc}.snippets th.sortable a,.snippets th.sorted a{display:flex;flex-direction:row}.snippets .row-actions{color:#ddd;left:0;position:relative}.snippets .column-activate{padding-right:0!important}.snippets .clear-filters{vertical-align:middle}.snippets tfoot th.check-column{padding:13px 0 0 3px}.snippets .inactive-snippet th.check-column,.snippets tfoot th.check-column,.snippets thead th.check-column{padding-left:5px}.snippets td.column-description{max-width:700px}.snippets .active-snippet td,.snippets .active-snippet th,.snippets .inactive-snippet td,.snippets .inactive-snippet th{border:none;box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);padding:10px 9px}.snippets .badge{background-color:#e0e0e0;background-color:rgba(0,0,0,.08);border:none;border-radius:2px;font-size:smaller;line-height:1.2;margin-left:4px;padding:3px 6px;text-decoration:none}.rtl .snippets .badge{float:left}.snippets tr.active-snippet+tr.inactive-snippet td,.snippets tr.active-snippet+tr.inactive-snippet th{border-top:1px solid rgba(0,0,0,.03);box-shadow:inset 0 1px 0 rgba(0,0,0,.02),inset 0 -1px 0 #e1e1e1}.snippets #all-snippets-table a.delete:hover,.snippets #search-snippets-table a.delete:hover,.snippets a.delete:hover{border-bottom:1px solid red;color:red}#wpbody-content .snippets .column-name{white-space:nowrap}.inactive-snippet a{color:#579}.inactive-snippet a:active,.inactive-snippet a:focus,.inactive-snippet a:hover{color:#819db9}.active-snippet td,.active-snippet th{background-color:rgba(120,200,230,.06)}.active-snippet th.check-column{border-left:2px solid #2ea2cc}.active-snippet .snippet-activation-switch{background-color:#2196f3}.css-snippet a{color:#b452cd}.css-snippet a:active,.css-snippet a:focus,.css-snippet a:hover{color:#ce8dde}.css-snippet.active-snippet a{color:#7d26cd}.css-snippet.active-snippet a:active,.css-snippet.active-snippet a:focus,.css-snippet.active-snippet a:hover{color:#a25ee1}.css-snippet.active-snippet td,.css-snippet.active-snippet th{background-color:rgba(85,26,139,.06)}.css-snippet.active-snippet .snippet-activation-switch{background-color:#8000ff}.css-snippet.active-snippet th.check-column{border-left-color:#8000ff}.html-snippet a{color:#548b54}.html-snippet a:active,.html-snippet a:focus,.html-snippet a:hover{color:#7cb07c}.html-snippet.active-snippet a{color:#548b54}.html-snippet.active-snippet a:active,.html-snippet.active-snippet a:focus,.html-snippet.active-snippet a:hover{color:#7cb07c}.html-snippet.active-snippet td,.html-snippet.active-snippet th{background-color:rgba(84,139,84,.06)}.html-snippet.active-snippet .snippet-activation-switch{background-color:#548b54}.html-snippet.active-snippet th.check-column{border-left-color:#548b54}.js-snippet a{color:#cd6600}.js-snippet a:active,.js-snippet a:focus,.js-snippet a:hover{color:#ff8c1b}.js-snippet.active-snippet a{color:#d44500}.js-snippet.active-snippet a:active,.js-snippet.active-snippet a:focus,.js-snippet.active-snippet a:hover{color:#ff6a22}.js-snippet.active-snippet td,.js-snippet.active-snippet th{background-color:rgba(205,102,0,.06)}.js-snippet.active-snippet .snippet-activation-switch{background-color:#cd6600}.js-snippet.active-snippet th.check-column{border-left-color:#cd6600}@media screen and (max-width:782px){p.search-box{float:left;height:auto;margin:1em 0 0;position:static}}.wp-list-table .is-expanded td.column-activate.activate{display:table-cell!important}.nav-tab-wrapper+.subsubsub,p.search-box{margin:10px 0 0}.snippet-type-description{border-bottom:1px solid #ccc;margin:0;padding:1em 0}.code-snippets-notice a.notice-dismiss{text-decoration:none}.refresh-button-container{align-items:center;display:flex;gap:7px;justify-content:flex-start;margin-bottom:-39px;margin-top:15px}#refresh-button{font-size:20px;line-height:1.4;padding:0;width:30px}@media screen and (max-width:1190px){.nav-tab .snippet-label{display:none}.nav-tab .cloud-badge{margin-right:10px}}
dist/manage.js 0000644 00000117540 15153464547 0007323 0 ustar 00 /*! For license information please see manage.js.LICENSE.txt */
(()=>{var e={5624:()=>{Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},1983:(e,t,n)=>{var r=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,r={},a={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var r,i;switch(n=n||{},a.util.type(t)){case"Object":if(i=a.util.objId(t),n[i])return n[i];for(var s in r={},n[i]=r,t)t.hasOwnProperty(s)&&(r[s]=e(t[s],n));return r;case"Array":return i=a.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach((function(t,a){r[a]=e(t,n)})),r);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var r="no-"+t;e;){var a=e.classList;if(a.contains(t))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(e,t){var n=a.util.clone(a.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var i=(r=r||a.languages)[e],s={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(o)||(s[o]=i[o])}var u=r[e];return r[e]=s,a.languages.DFS(a.languages,(function(t,n){n===u&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,r,i){i=i||{};var s=a.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],u=a.util.type(l);"Object"!==u||i[s(l)]?"Array"!==u||i[s(l)]||(i[s(l)]=!0,e(l,n,o,i)):(i[s(l)]=!0,e(l,n,null,i))}}},plugins:{},highlightAll:function(e,t){a.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var r={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),a.hooks.run("before-all-elements-highlight",r);for(var i,s=0;i=r.elements[s++];)a.highlightElement(i,!0===t,r.callback)},highlightElement:function(t,n,r){var i=a.util.getLanguage(t),s=a.languages[i];a.util.setLanguage(t,i);var o=t.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&a.util.setLanguage(o,i);var l={element:t,language:i,grammar:s,code:t.textContent};function u(e){l.highlightedCode=e,a.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,a.hooks.run("after-highlight",l),a.hooks.run("complete",l),r&&r.call(l.element)}if(a.hooks.run("before-sanity-check",l),(o=l.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!l.code)return a.hooks.run("complete",l),void(r&&r.call(l.element));if(a.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var c=new Worker(a.filename);c.onmessage=function(e){u(e.data)},c.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else u(a.highlight(l.code,l.grammar,l.language));else u(a.util.encode(l.code))},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(a.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=a.tokenize(r.code,r.grammar),a.hooks.run("after-tokenize",r),i.stringify(a.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new l;return u(a,a.head,e),o(e,a,t,a.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(a)},hooks:{all:{},add:function(e,t){var n=a.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=a.hooks.all[e];if(n&&n.length)for(var r,i=0;r=n[i++];)r(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function s(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var i=a[1].length;a.index+=i,a[0]=a[0].slice(i)}return a}function o(e,t,n,r,l,d){for(var p in n)if(n.hasOwnProperty(p)&&n[p]){var g=n[p];g=Array.isArray(g)?g:[g];for(var f=0;f<g.length;++f){if(d&&d.cause==p+","+f)return;var m=g[f],h=m.inside,b=!!m.lookbehind,y=!!m.greedy,v=m.alias;if(y&&!m.pattern.global){var w=m.pattern.toString().match(/[imsuy]*$/)[0];m.pattern=RegExp(m.pattern.source,w+"g")}for(var k=m.pattern||m,x=r.next,A=l;x!==t.tail&&!(d&&A>=d.reach);A+=x.value.length,x=x.next){var S=x.value;if(t.length>e.length)return;if(!(S instanceof i)){var P,F=1;if(y){if(!(P=s(k,A,e,b))||P.index>=e.length)break;var _=P.index,E=P.index+P[0].length,$=A;for($+=x.value.length;_>=$;)$+=(x=x.next).value.length;if(A=$-=x.value.length,x.value instanceof i)continue;for(var C=x;C!==t.tail&&($<E||"string"==typeof C.value);C=C.next)F++,$+=C.value.length;F--,S=e.slice(A,$),P.index-=A}else if(!(P=s(k,0,S,b)))continue;_=P.index;var z=P[0],j=S.slice(0,_),T=S.slice(_+z.length),L=A+S.length;d&&L>d.reach&&(d.reach=L);var O=x.prev;if(j&&(O=u(t,O,j),A+=j.length),c(t,O,F),x=u(t,O,new i(p,h?a.tokenize(z,h):z,v,z)),T&&u(t,x,T),F>1){var N={cause:p+","+f,reach:L};o(e,t,n,x.prev,A,N),d&&N.reach>d.reach&&(d.reach=N.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a<n&&r!==e.tail;a++)r=r.next;t.next=r,r.prev=t,e.length-=a}if(e.Prism=a,i.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var r="";return t.forEach((function(t){r+=e(t,n)})),r}var i={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(i.classes,s):i.classes.push(s)),a.hooks.run("wrap",i);var o="";for(var l in i.attributes)o+=" "+l+'="'+(i.attributes[l]||"").replace(/"/g,""")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+o+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener?(a.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),r=n.language,i=n.code,s=n.immediateClose;e.postMessage(a.highlight(i,a.languages[r],r)),s&&e.close()}),!1),a):a;var d=a.util.currentScript();function p(){a.manual||a.highlightAll()}if(d&&(a.filename=d.src,d.hasAttribute("data-manual")&&(a.manual=!0)),!a.manual){var g=document.readyState;"loading"===g||"interactive"===g&&d&&d.defer?document.addEventListener("DOMContentLoaded",p):window.requestAnimationFrame?window.requestAnimationFrame(p):window.setTimeout(p,16)}return a}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=r),void 0!==n.g&&(n.g.Prism=r)},1113:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)},5723:()=>{Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,i){if(n.language===r){var s=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof i&&!i(e))return e;for(var a,o=s.length;-1!==n.code.indexOf(a=t(r,o));)++o;return s[o]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,i=Object.keys(n.tokenStack);!function s(o){for(var l=0;l<o.length&&!(a>=i.length);l++){var u=o[l];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=i[a],d=n.tokenStack[c],p="string"==typeof u?u:u.content,g=t(r,c),f=p.indexOf(g);if(f>-1){++a;var m=p.substring(0,f),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=p.substring(f+g.length),y=[];m&&y.push.apply(y,s([m])),y.push(h),b&&y.push.apply(y,s([b])),"string"==typeof u?o.splice.apply(o,[l,1].concat(y)):u.content=y}}else u.content&&s(u.content)}return o}(n.tokens)}}}})}(Prism)},4312:()=>{Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var a={};a[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},5248:()=>{Prism.languages.insertBefore("php","variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}})},3554:()=>{!function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,a=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,i=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:a,punctuation:i};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:r,operator:a,punctuation:i}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism)},4173:()=>{"undefined"!=typeof Prism&&"undefined"!=typeof document&&document.createRange&&(Prism.plugins.KeepMarkup=!0,Prism.hooks.add("before-highlight",(function(e){if(e.element.children.length&&Prism.util.isActive(e.element,"keep-markup",!0)){var t=Prism.util.isActive(e.element,"drop-tokens",!1),n=0,r=[];i(e.element),r.length&&(e.keepMarkup=r)}function a(e){if(function(e){return!t||"span"!==e.nodeName.toLowerCase()||!e.classList.contains("token")}(e)){var a={element:e,posOpen:n};r.push(a),i(e),a.posClose=n}else i(e)}function i(e){for(var t=0,r=e.childNodes.length;t<r;t++){var i=e.childNodes[t];1===i.nodeType?a(i):3===i.nodeType&&(n+=i.data.length)}}})),Prism.hooks.add("after-highlight",(function(e){if(e.keepMarkup&&e.keepMarkup.length){var t=function(e,n){for(var r=0,a=e.childNodes.length;r<a;r++){var i=e.childNodes[r];if(1===i.nodeType){if(!t(i,n))return!1}else 3===i.nodeType&&(!n.nodeStart&&n.pos+i.data.length>n.node.posOpen&&(n.nodeStart=i,n.nodeStartPos=n.node.posOpen-n.pos),n.nodeStart&&n.pos+i.data.length>=n.node.posClose&&(n.nodeEnd=i,n.nodeEndPos=n.node.posClose-n.pos),n.pos+=i.data.length);if(n.nodeStart&&n.nodeEnd){var s=document.createRange();return s.setStart(n.nodeStart,n.nodeStartPos),s.setEnd(n.nodeEnd,n.nodeEndPos),n.node.element.innerHTML="",n.node.element.appendChild(s.extractContents()),s.insertNode(n.node.element),s.detach(),!1}}return!0};e.keepMarkup.forEach((function(n){t(e.element,{node:n,pos:0})})),e.highlightedCode=e.element.innerHTML}})))},6285:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",n="linkable-line-numbers",r=/\n(?!$)/g,a=!0;Prism.plugins.lineHighlight={highlightLines:function(i,u,c){var d=(u="string"==typeof u?u:i.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),p=+i.getAttribute("data-line-offset")||0,g=(function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML=" <br /> ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}()?parseInt:parseFloat)(getComputedStyle(i).lineHeight),f=Prism.util.isActive(i,t),m=i.querySelector("code"),h=f?i:m||i,b=[],y=m.textContent.match(r),v=y?y.length+1:1,w=m&&h!=m?function(e,t){var n=getComputedStyle(e),r=getComputedStyle(t);function a(e){return+e.substr(0,e.length-2)}return t.offsetTop+a(r.borderTopWidth)+a(r.paddingTop)-a(n.paddingTop)}(i,m):0;d.forEach((function(e){var t=e.split("-"),n=+t[0],r=+t[1]||n;if(!((r=Math.min(v+p,r))<n)){var a=i.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(b.push((function(){a.setAttribute("aria-hidden","true"),a.setAttribute("data-range",e),a.className=(c||"")+" line-highlight"})),f&&Prism.plugins.lineNumbers){var s=Prism.plugins.lineNumbers.getLine(i,n),o=Prism.plugins.lineNumbers.getLine(i,r);if(s){var l=s.offsetTop+w+"px";b.push((function(){a.style.top=l}))}if(o){var u=o.offsetTop-s.offsetTop+o.offsetHeight+"px";b.push((function(){a.style.height=u}))}}else b.push((function(){a.setAttribute("data-start",String(n)),r>n&&a.setAttribute("data-end",String(r)),a.style.top=(n-p-1)*g+w+"px",a.textContent=new Array(r-n+2).join(" \n")}));b.push((function(){a.style.width=i.scrollWidth+"px"})),b.push((function(){h.appendChild(a)}))}}));var k=i.id;if(f&&Prism.util.isActive(i,n)&&k){o(i,n)||b.push((function(){i.classList.add(n)}));var x=parseInt(i.getAttribute("data-start")||"1");s(".line-numbers-rows > span",i).forEach((function(e,t){var n=t+x;e.onclick=function(){var e=k+"."+n;a=!1,location.hash=e,setTimeout((function(){a=!0}),1)}}))}return function(){b.forEach(l)}}};var i=0;Prism.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var n=0;s(".line-highlight",t).forEach((function(e){n+=e.textContent.length,e.parentNode.removeChild(e)})),n&&/^(?: \n)+$/.test(e.code.slice(-n))&&(e.code=e.code.slice(0,-n))}})),Prism.hooks.add("complete",(function e(n){var r=n.element.parentElement;if(u(r)){clearTimeout(i);var a=Prism.plugins.lineNumbers,s=n.plugins&&n.plugins.lineNumbers;o(r,t)&&a&&!s?Prism.hooks.add("line-numbers",e):(Prism.plugins.lineHighlight.highlightLines(r)(),i=setTimeout(c,1))}})),window.addEventListener("hashchange",c),window.addEventListener("resize",(function(){s("pre").filter(u).map((function(e){return Prism.plugins.lineHighlight.highlightLines(e)})).forEach(l)}))}function s(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function o(e,t){return e.classList.contains(t)}function l(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&Prism.util.isActive(e,n)))}function c(){var e=location.hash.slice(1);s(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),r=document.getElementById(n);r&&(r.hasAttribute("data-line")||r.setAttribute("data-line",""),Prism.plugins.lineHighlight.highlightLines(r,t,"temporary ")(),a&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}()},6837:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e="line-numbers",t=/\n(?!$)/g,n=Prism.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var r=t.querySelector(".line-numbers-rows");if(r){var a=parseInt(t.getAttribute("data-start"),10)||1,i=a+(r.children.length-1);n<a&&(n=a),n>i&&(n=i);var s=n-a;return r.children[s]}}},resize:function(e){a([e])},assumeViewportIndependence:!0},r=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&r===window.innerWidth||(r=window.innerWidth,a(Array.prototype.slice.call(document.querySelectorAll("pre."+e))))})),Prism.hooks.add("complete",(function(n){if(n.code){var r=n.element,i=r.parentNode;if(i&&/pre/i.test(i.nodeName)&&!r.querySelector(".line-numbers-rows")&&Prism.util.isActive(r,e)){r.classList.remove(e),i.classList.add(e);var s,o=n.code.match(t),l=o?o.length+1:1,u=new Array(l+1).join("<span></span>");(s=document.createElement("span")).setAttribute("aria-hidden","true"),s.className="line-numbers-rows",s.innerHTML=u,i.hasAttribute("data-start")&&(i.style.counterReset="linenumber "+(parseInt(i.getAttribute("data-start"),10)-1)),n.element.appendChild(s),a([i]),Prism.hooks.run("line-numbers",n)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function a(e){if(0!=(e=e.filter((function(e){var t,n=(t=e,t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null)["white-space"];return"pre-wrap"===n||"pre-line"===n}))).length){var n=e.map((function(e){var n=e.querySelector("code"),r=e.querySelector(".line-numbers-rows");if(n&&r){var a=e.querySelector(".line-numbers-sizer"),i=n.textContent.split(t);a||((a=document.createElement("span")).className="line-numbers-sizer",n.appendChild(a)),a.innerHTML="0",a.style.display="block";var s=a.getBoundingClientRect().height;return a.innerHTML="",{element:e,lines:i,lineHeights:[],oneLinerHeight:s,sizer:a}}})).filter(Boolean);n.forEach((function(e){var t=e.sizer,n=e.lines,r=e.lineHeights,a=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var i=t.appendChild(document.createElement("span"));i.style.display="block",i.textContent=e}else r[n]=a}))})),n.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,r=0,a=0;a<n.length;a++)void 0===n[a]&&(n[a]=t.children[r++].getBoundingClientRect().height)})),n.forEach((function(e){var t=e.sizer,n=e.element.querySelector(".line-numbers-rows");t.style.display="none",t.innerHTML="",e.lineHeights.forEach((function(e,t){n.children[t].style.height=e+"px"}))}))}}}()}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,n)}const r=window.wp.i18n;var a=function(e,t,n,r){var a,i,s,o,l=document.getElementById("code_snippets_ajax_nonce"),u=t.querySelector(".column-id");l&&null!=u&&u.textContent&&parseInt(u.textContent,10)&&(n.id=parseInt(u.textContent,10),n.shared_network=null!==/\bshared-network-snippet\b/.exec(t.className),n.network=n.shared_network||window.pagenow.endsWith("-network"),n.scope=null!==(a=t.getAttribute("data-snippet-scope"))&&void 0!==a?a:n.scope,i="action=update_code_snippet&_ajax_nonce=".concat(l.value,"&field=").concat(e,"&snippet=").concat(JSON.stringify(n)),s=r,(o=new XMLHttpRequest).open("POST",window.ajaxurl,!0),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded charset=UTF-8"),o.onload=function(){200>o.status||400<=o.status||(console.info(o.responseText),null==s||s(JSON.parse(o.responseText)))},o.send(i))};function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(){s=function(e,t){return new a(e,void 0,t)};var n=RegExp.prototype,r=new WeakMap;function a(e,n,i){var s=RegExp(e,n);return r.set(s,i||r.get(e)),t(s,a.prototype)}function i(e,t){var n=r.get(t);return Object.keys(n).reduce((function(t,r){var a=n[r];if("number"==typeof a)t[r]=e[a];else{for(var i=0;void 0===e[a[i]]&&i+1<a.length;)i++;t[r]=e[a[i]]}return t}),Object.create(null))}return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)}(a,RegExp),a.prototype.exec=function(e){var t=n.exec.call(this,e);if(t){t.groups=i(t,this);var r=t.indices;r&&(r.groups=i(r,this))}return t},a.prototype[Symbol.replace]=function(t,a){if("string"==typeof a){var s=r.get(this);return n[Symbol.replace].call(this,t,a.replace(/\$<([^>]+)>/g,(function(e,t){var n=s[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof a){var o=this;return n[Symbol.replace].call(this,t,(function(){var t=arguments;return"object"!=e(t[t.length-1])&&(t=[].slice.call(t)).push(i(t,o)),a.apply(this,t)}))}return n[Symbol.replace].call(this,t,a)},s.apply(this,arguments)}var o=function(e,t){if(null!=e&&e.textContent){var n=parseInt(e.textContent.replace(s(/\((\d+)\)/,{count:1}),"$1"),10);n+=t?1:-1,e.textContent="(".concat(n,")")}else console.error("Could not update view count.",e)};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c=n(1983),d=n.n(c);n(4312),n(9700),n(3554),n(5248),n(6285),n(6837),n(5624),n(5723),n(1113),n(4173),function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){l=!0,s=e},f:function(){try{o||null==n.return||n.return()}finally{if(l)throw s}}}}(document.getElementsByClassName("snippet-activation-switch"));try{var n=function(){var t=e.value;t.addEventListener("click",(function(e){return function(e,t){var n,i=null===(n=e.parentElement)||void 0===n?void 0:n.parentElement;if(i){var s=/\b(?:in)?active-snippet\b/.exec(i.className);if(s){t.preventDefault();var l="inactive-snippet"===s[0];a("active",i,{active:l},(function(e){var t=i.querySelector(".snippet-activation-switch");if(e.success){i.className=l?i.className.replace(/\binactive-snippet\b/,"active-snippet"):i.className.replace(/\bactive-snippet\b/,"inactive-snippet");var n=document.querySelector(".subsubsub"),a=null==n?void 0:n.querySelector(".active .count"),s=null==n?void 0:n.querySelector(".inactive .count");a&&o(a,l),s&&o(s,l),t&&(t.title=l?(0,r.__)("Deactivate","code-snippets"):(0,r.__)("Activate","code-snippets"))}else i.className+=" erroneous-snippet",t&&(t.title=(0,r.__)("An error occurred when attempting to activate","code-snippets"))}))}}else console.error("Could not toggle snippet active status.",i)}(t,e)}))};for(t.s();!(e=t.n()).done;)n()}catch(e){t.e(e)}finally{t.f()}}(),function(){var e,t=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){o=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(o)throw i}}}}(document.getElementsByClassName("snippet-priority"));try{var n=function(){var t=e.value;t.addEventListener("input",(function(){return r=null===(n=(e=t).parentElement)||void 0===n?void 0:n.parentElement,i={priority:parseFloat(e.value)},void(r?a("priority",r,i):console.error("Could not update snippet information.",i,r));var e,n,r,i})),t.disabled=!1};for(t.s();!(e=t.n()).done;)n()}catch(e){t.e(e)}finally{t.f()}}(),document.querySelectorAll(".cloud-snippet-preview").forEach((function(e){e.addEventListener("click",(function(){var t,n,r=e.getAttribute("data-snippet"),a=e.getAttribute("data-lang"),i=document.getElementById("cloud-snippet-code-".concat(r)),s=document.getElementById("snippet-code-thickbox");s&&i&&((t=s.classList).remove.apply(t,function(e){if(Array.isArray(e))return u(e)}(n=s.classList)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s.classList.add("language-".concat(a)),s.textContent=i.value,"markup"===a&&(s.innerHTML="<xmp>".concat(i.value,"</xmp>")),"php"===a&&(i.value.startsWith("<?php")||(s.textContent="<?php\n".concat(i.value))),d().highlightElement(s))}))}))})()})(); dist/manage.js.LICENSE.txt 0000644 00000000301 15153464547 0011204 0 ustar 00 /**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/
dist/mce.js 0000644 00000005607 15153464547 0006637 0 ustar 00 (()=>{"use strict";var e={};function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}e.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},e.d=(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const n=window.tinymce;var r=e.n(n),o=function(e){return Object.keys(e).map((function(t){return{text:e[Number(t)],value:t}}))},a=function(e,t){return{text:t.getLang("code_snippets.insert_source_menu"),onclick:function(){e.windowManager.open({title:t.getLang("code_snippets.insert_source_title"),body:[{type:"listbox",name:"id",label:t.getLang("code_snippets.snippet_label"),values:o(t.getLang("code_snippets.all_snippets"))},{type:"checkbox",name:"line_numbers",label:t.getLang("code_snippets.show_line_numbers_label")}],onsubmit:function(t){var n=parseInt(t.data.id,10);if(n){var r="";t.data.line_numbers&&(r+=" line_numbers=true"),e.insertContent("[code_snippet_source id=".concat(n).concat(r,"]"))}}},{})}}},i=function(e,n){return{text:n.getLang("code_snippets.insert_content_menu"),onclick:function(){e.windowManager.open({title:n.getLang("code_snippets.insert_content_title"),body:[{type:"listbox",name:"id",label:n.getLang("code_snippets.snippet_label"),values:o(n.getLang("code_snippets.content_snippets"))},{type:"checkbox",name:"php",label:n.getLang("code_snippets.php_att_label")},{type:"checkbox",name:"format",label:n.getLang("code_snippets.format_att_label")},{type:"checkbox",name:"shortcodes",label:n.getLang("code_snippets.shortcodes_att_label")}],onsubmit:function(n){var r,o,a=parseInt(n.data.id,10);if(a){for(var i="",c=0,s=Object.entries(n.data);c<s.length;c++){var l=(r=s[c],o=2,function(e){if(Array.isArray(e))return e}(r)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],s=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);s=!0);}catch(e){l=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(r,o)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(r,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=l[0],u=l[1];"id"!==p&&u&&(i+=" ".concat(p,"=").concat(u))}e.insertContent("[code_snippet id=".concat(a).concat(i,"]"))}}},{})}}};r().PluginManager.add("code_snippets",(function(e){var t=r().activeEditor;e.addButton("code_snippets",{icon:"code",menu:[a(e,t),i(e,t)],type:"menubutton"})}))})(); dist/menu-button.css 0000644 00000000772 15153464547 0010522 0 ustar 00 #adminmenu .code-snippets-upgrade-button{align-items:center;background-color:#d46f4d;border:none;color:#fff;display:flex;font-weight:700;justify-content:center;line-height:inherit;text-align:center;transition:background-color .1s linear;white-space:break-spaces}#adminmenu .code-snippets-upgrade-button:hover{background-color:#08c5d1}#adminmenu .code-snippets-upgrade-button .dashicons{vertical-align:text-bottom}#adminmenu .wp-submenu a[href="admin.php?page=code_snippets_upgrade"]:hover{box-shadow:none}
dist/prism.css 0000644 00000020466 15153464547 0007401 0 ustar 00 code[class*=language-],pre[class*=language-]{background:none;color:#000;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;text-shadow:0 1px #fff;white-space:pre;word-break:normal;word-spacing:normal;word-wrap:normal;-webkit-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{background:#b3d4fc;text-shadow:none}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{background:#b3d4fc;text-shadow:none}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{border-radius:.3em;padding:.1em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{background:hsla(0,0%,100%,.5);color:#9a6e3a}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
pre[class*=language-].line-numbers{counter-reset:linenumber;padding-left:3.8em;position:relative}pre[class*=language-].line-numbers>code{position:relative;white-space:inherit}.line-numbers .line-numbers-rows{border-right:1px solid #999;font-size:100%;left:-3.8em;letter-spacing:-1px;pointer-events:none;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:3em}.line-numbers-rows>span{counter-increment:linenumber;display:block}.line-numbers-rows>span:before{color:#999;content:counter(linenumber);display:block;padding-right:.8em;text-align:right}
div.code-toolbar{position:relative}div.code-toolbar>.toolbar{opacity:0;position:absolute;right:.2em;top:.3em;transition:opacity .3s ease-in-out;z-index:10}div.code-toolbar:hover>.toolbar{opacity:1}div.code-toolbar:focus-within>.toolbar{opacity:1}div.code-toolbar>.toolbar>.toolbar-item{display:inline-block}div.code-toolbar>.toolbar>.toolbar-item>a{cursor:pointer}div.code-toolbar>.toolbar>.toolbar-item>button{background:none;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}div.code-toolbar>.toolbar>.toolbar-item>a,div.code-toolbar>.toolbar>.toolbar-item>button,div.code-toolbar>.toolbar>.toolbar-item>span{background:#f5f2f0;background:hsla(0,0%,88%,.2);border-radius:.5em;box-shadow:0 2px 0 0 rgba(0,0,0,.2);color:#bbb;font-size:.8em;padding:0 .5em}div.code-toolbar>.toolbar>.toolbar-item>a:focus,div.code-toolbar>.toolbar>.toolbar-item>a:hover,div.code-toolbar>.toolbar>.toolbar-item>button:focus,div.code-toolbar>.toolbar>.toolbar-item>button:hover,div.code-toolbar>.toolbar>.toolbar-item>span:focus,div.code-toolbar>.toolbar>.toolbar-item>span:hover{color:inherit;text-decoration:none}
span.inline-color-wrapper{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyIDIiPjxwYXRoIGZpbGw9ImdyYXkiIGQ9Ik0wIDBoMnYySDB6Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTAgMGgxdjFIMHptMSAxaDF2MUgxeiIvPjwvc3ZnPg==);background-position:50%;background-size:110%;border:1px solid #fff;box-sizing:border-box;display:inline-block;height:1.333ch;margin:0 .333ch;outline:1px solid rgba(0,0,0,.5);overflow:hidden;width:1.333ch}span.inline-color{display:block;height:120%;width:120%}
.prism-previewer,.prism-previewer:after,.prism-previewer:before{pointer-events:none;position:absolute}.prism-previewer,.prism-previewer:after{left:50%}.prism-previewer{height:32px;margin-left:-16px;margin-top:-48px;opacity:0;transition:opacity .25s;width:32px;z-index:10}.prism-previewer.flipped{margin-bottom:-48px;margin-top:0}.prism-previewer:after,.prism-previewer:before{content:"";pointer-events:none;position:absolute}.prism-previewer:before{border:5px solid #fff;border-radius:10px;bottom:-5px;box-shadow:inset 0 0 3px rgba(0,0,0,.5),0 0 10px rgba(0,0,0,.75);left:-5px;right:-5px;top:-5px}.prism-previewer:after{border:7px solid rgba(255,0,0,0);border-top-color:#fff;height:0;margin:5px 0 0 -7px;top:100%;width:0}.prism-previewer.flipped:after{border-bottom-color:#fff;border-top-color:rgba(255,0,0,0);bottom:100%;margin-bottom:5px;margin-top:0;top:auto}.prism-previewer.active{opacity:1}.prism-previewer-angle:before{background:#fff;border-radius:50%}.prism-previewer-angle:after{margin-top:4px}.prism-previewer-angle svg{height:32px;transform:rotate(-90deg);width:32px}.prism-previewer-angle[data-negative] svg{transform:scaleX(-1) rotate(-90deg)}.prism-previewer-angle circle{fill:transparent;stroke:#2e3538;stroke-opacity:.9;stroke-width:32;stroke-dasharray:0,500}.prism-previewer-gradient{background-image:linear-gradient(45deg,#bbb 25%,transparent 0,transparent 75%,#bbb 0,#bbb),linear-gradient(45deg,#bbb 25%,#eee 0,#eee 75%,#bbb 0,#bbb);background-position:0 0,5px 5px;background-size:10px 10px;margin-left:-32px;width:64px}.prism-previewer-gradient:before{content:none}.prism-previewer-gradient div{border:5px solid #fff;border-radius:10px;bottom:-5px;box-shadow:inset 0 0 3px rgba(0,0,0,.5),0 0 10px rgba(0,0,0,.75);left:-5px;position:absolute;right:-5px;top:-5px}.prism-previewer-color{background-image:linear-gradient(45deg,#bbb 25%,transparent 0,transparent 75%,#bbb 0,#bbb),linear-gradient(45deg,#bbb 25%,#eee 0,#eee 75%,#bbb 0,#bbb);background-position:0 0,5px 5px;background-size:10px 10px}.prism-previewer-color:before{background-clip:padding-box;background-color:inherit}.prism-previewer-easing{background:#333;height:60px;margin-left:-30px;margin-top:-76px;width:60px}.prism-previewer-easing.flipped{margin-bottom:-116px}.prism-previewer-easing svg{height:60px;width:60px}.prism-previewer-easing circle{fill:#2e3538;stroke:#fff}.prism-previewer-easing path{fill:none;stroke:#fff;stroke-linecap:round;stroke-width:4}.prism-previewer-easing line{stroke:#fff;stroke-opacity:.5;stroke-width:2}@keyframes prism-previewer-time{0%{stroke-dasharray:0,500;stroke-dashoffset:0}50%{stroke-dasharray:100,500;stroke-dashoffset:0}to{stroke-dasharray:0,500;stroke-dashoffset:-100}}.prism-previewer-time:before{background:#fff;border-radius:50%}.prism-previewer-time:after{margin-top:4px}.prism-previewer-time svg{height:32px;transform:rotate(-90deg);width:32px}.prism-previewer-time circle{fill:transparent;stroke:#2e3538;stroke-opacity:.9;stroke-width:32;stroke-dasharray:0,500;stroke-dashoffset:0;animation:prism-previewer-time 3s linear infinite}
.token a{color:inherit}
pre[data-line]{padding:1em 0 1em 3em;position:relative}.line-highlight{background:hsla(24,20%,50%,.08);background:linear-gradient(90deg,hsla(24,20%,50%,.1) 70%,hsla(24,20%,50%,0));left:0;line-height:inherit;margin-top:1em;padding:inherit;pointer-events:none;position:absolute;right:0;white-space:pre}@media print{.line-highlight{-webkit-print-color-adjust:exact;print-color-adjust:exact}}.line-highlight:before,.line-highlight[data-end]:after{background-color:hsla(24,20%,50%,.4);border-radius:999px;box-shadow:0 1px #fff;color:#f5f2f0;content:attr(data-start);font:700 65%/1.5 sans-serif;left:.6em;min-width:1em;padding:0 .5em;position:absolute;text-align:center;text-shadow:none;top:.4em;vertical-align:.3em}.line-highlight[data-end]:after{bottom:.4em;content:attr(data-end);top:auto}.line-numbers .line-highlight:after,.line-numbers .line-highlight:before{content:none}:not(.is-style-prism-shades-of-purple) pre[class*=language-].line-numbers .line-highlight{box-sizing:border-box;margin:1em 0 0;padding:0}.is-style-prism-coy-without-shadows pre[class*=language-] .line-highlight{margin-top:0}pre[id].linkable-line-numbers span.line-numbers-rows{pointer-events:all}pre[id].linkable-line-numbers span.line-numbers-rows>span:before{cursor:pointer}pre[id].linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:hsla(0,0%,50%,.2)}
dist/prism.js 0000644 00000150664 15153464547 0007231 0 ustar 00 /*! For license information please see prism.js.LICENSE.txt */
(()=>{var e={5624:()=>{Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},1983:(e,t,n)=>{var a=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,a={},i={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof r?new r(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function e(t,n){var a,r;switch(n=n||{},i.util.type(t)){case"Object":if(r=i.util.objId(t),n[r])return n[r];for(var s in a={},n[r]=a,t)t.hasOwnProperty(s)&&(a[s]=e(t[s],n));return a;case"Array":return r=i.util.objId(t),n[r]?n[r]:(a=[],n[r]=a,t.forEach((function(t,i){a[i]=e(t,n)})),a);default:return t}},getLanguage:function(e){for(;e;){var n=t.exec(e.className);if(n)return n[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,n){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+n)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(a){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var n in t)if(t[n].src==e)return t[n]}return null}},isActive:function(e,t,n){for(var a="no-"+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(a))return!1;e=e.parentElement}return!!n}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(e,t){var n=i.util.clone(i.languages[e]);for(var a in t)n[a]=t[a];return n},insertBefore:function(e,t,n,a){var r=(a=a||i.languages)[e],s={};for(var o in r)if(r.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);n.hasOwnProperty(o)||(s[o]=r[o])}var u=a[e];return a[e]=s,i.languages.DFS(i.languages,(function(t,n){n===u&&t!=e&&(this[t]=s)})),s},DFS:function e(t,n,a,r){r=r||{};var s=i.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],a||o);var l=t[o],u=i.util.type(l);"Object"!==u||r[s(l)]?"Array"!==u||r[s(l)]||(r[s(l)]=!0,e(l,n,o,r)):(r[s(l)]=!0,e(l,n,null,r))}}},plugins:{},highlightAll:function(e,t){i.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,n){var a={callback:n,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};i.hooks.run("before-highlightall",a),a.elements=Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)),i.hooks.run("before-all-elements-highlight",a);for(var r,s=0;r=a.elements[s++];)i.highlightElement(r,!0===t,a.callback)},highlightElement:function(t,n,a){var r=i.util.getLanguage(t),s=i.languages[r];i.util.setLanguage(t,r);var o=t.parentElement;o&&"pre"===o.nodeName.toLowerCase()&&i.util.setLanguage(o,r);var l={element:t,language:r,grammar:s,code:t.textContent};function u(e){l.highlightedCode=e,i.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,i.hooks.run("after-highlight",l),i.hooks.run("complete",l),a&&a.call(l.element)}if(i.hooks.run("before-sanity-check",l),(o=l.element.parentElement)&&"pre"===o.nodeName.toLowerCase()&&!o.hasAttribute("tabindex")&&o.setAttribute("tabindex","0"),!l.code)return i.hooks.run("complete",l),void(a&&a.call(l.element));if(i.hooks.run("before-highlight",l),l.grammar)if(n&&e.Worker){var c=new Worker(i.filename);c.onmessage=function(e){u(e.data)},c.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else u(i.highlight(l.code,l.grammar,l.language));else u(i.util.encode(l.code))},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};if(i.hooks.run("before-tokenize",a),!a.grammar)throw new Error('The language "'+a.language+'" has no grammar.');return a.tokens=i.tokenize(a.code,a.grammar),i.hooks.run("after-tokenize",a),r.stringify(i.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var a in n)t[a]=n[a];delete t.rest}var i=new l;return u(i,i.head,e),o(e,i,t,i.head,0),function(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}(i)},hooks:{all:{},add:function(e,t){var n=i.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=i.hooks.all[e];if(n&&n.length)for(var a,r=0;a=n[r++];)a(t)}},Token:r};function r(e,t,n,a){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length}function s(e,t,n,a){e.lastIndex=t;var i=e.exec(n);if(i&&a&&i[1]){var r=i[1].length;i.index+=r,i[0]=i[0].slice(r)}return i}function o(e,t,n,a,l,d){for(var g in n)if(n.hasOwnProperty(g)&&n[g]){var p=n[g];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==g+","+m)return;var f=p[m],h=f.inside,b=!!f.lookbehind,y=!!f.greedy,v=f.alias;if(y&&!f.pattern.global){var k=f.pattern.toString().match(/[imsuy]*$/)[0];f.pattern=RegExp(f.pattern.source,k+"g")}for(var P=f.pattern||f,w=a.next,x=l;w!==t.tail&&!(d&&x>=d.reach);x+=w.value.length,w=w.next){var A=w.value;if(t.length>e.length)return;if(!(A instanceof r)){var S,L=1;if(y){if(!(S=s(P,x,e,b))||S.index>=e.length)break;var F=S.index,C=S.index+S[0].length,_=x;for(_+=w.value.length;F>=_;)_+=(w=w.next).value.length;if(x=_-=w.value.length,w.value instanceof r)continue;for(var E=w;E!==t.tail&&(_<C||"string"==typeof E.value);E=E.next)L++,_+=E.value.length;L--,A=e.slice(x,_),S.index-=x}else if(!(S=s(P,0,A,b)))continue;F=S.index;var T=S[0],$=A.slice(0,F),z=A.slice(F+T.length),j=x+A.length;d&&j>d.reach&&(d.reach=j);var N=w.prev;if($&&(N=u(t,N,$),x+=$.length),c(t,N,L),w=u(t,N,new r(g,h?i.tokenize(T,h):T,v,T)),z&&u(t,w,z),L>1){var O={cause:g+","+m,reach:j};o(e,t,n,w.prev,x,O),d&&O.reach>d.reach&&(d.reach=O.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function u(e,t,n){var a=t.next,i={value:n,prev:t,next:a};return t.next=i,a.prev=i,e.length++,i}function c(e,t,n){for(var a=t.next,i=0;i<n&&a!==e.tail;i++)a=a.next;t.next=a,a.prev=t,e.length-=i}if(e.Prism=i,r.stringify=function e(t,n){if("string"==typeof t)return t;if(Array.isArray(t)){var a="";return t.forEach((function(t){a+=e(t,n)})),a}var r={type:t.type,content:e(t.content,n),tag:"span",classes:["token",t.type],attributes:{},language:n},s=t.alias;s&&(Array.isArray(s)?Array.prototype.push.apply(r.classes,s):r.classes.push(s)),i.hooks.run("wrap",r);var o="";for(var l in r.attributes)o+=" "+l+'="'+(r.attributes[l]||"").replace(/"/g,""")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+o+">"+r.content+"</"+r.tag+">"},!e.document)return e.addEventListener?(i.disableWorkerMessageHandler||e.addEventListener("message",(function(t){var n=JSON.parse(t.data),a=n.language,r=n.code,s=n.immediateClose;e.postMessage(i.highlight(r,i.languages[a],a)),s&&e.close()}),!1),i):i;var d=i.util.currentScript();function g(){i.manual||i.highlightAll()}if(d&&(i.filename=d.src,d.hasAttribute("data-manual")&&(i.manual=!0)),!i.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",g):window.requestAnimationFrame?window.requestAnimationFrame(g):window.setTimeout(g,16)}return i}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=a),void 0!==n.g&&(n.g.Prism=a)},1113:()=>{!function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)},5723:()=>{Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript},9700:()=>{!function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,a,i,r){if(n.language===a){var s=n.tokenStack=[];n.code=n.code.replace(i,(function(e){if("function"==typeof r&&!r(e))return e;for(var i,o=s.length;-1!==n.code.indexOf(i=t(a,o));)++o;return s[o]=e,i})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,a){if(n.language===a&&n.tokenStack){n.grammar=e.languages[a];var i=0,r=Object.keys(n.tokenStack);!function s(o){for(var l=0;l<o.length&&!(i>=r.length);l++){var u=o[l];if("string"==typeof u||u.content&&"string"==typeof u.content){var c=r[i],d=n.tokenStack[c],g="string"==typeof u?u:u.content,p=t(a,c),m=g.indexOf(p);if(m>-1){++i;var f=g.substring(0,m),h=new e.Token(a,e.tokenize(d,n.grammar),"language-"+a,d),b=g.substring(m+p.length),y=[];f&&y.push.apply(y,s([f])),y.push(h),b&&y.push.apply(y,s([b])),"string"==typeof u?o.splice.apply(o,[l,1].concat(y)):u.content=y}}else u.content&&s(u.content)}return o}(n.tokens)}}}})}(Prism)},4312:()=>{Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};a["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:a},Prism.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},5248:()=>{Prism.languages.insertBefore("php","variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}})},3554:()=>{!function(e){var t=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,n=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,r=/[{}\[\](),:;]/;e.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:t,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:i,punctuation:r};var s={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:e.languages.php},o=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:s}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:s}}];e.languages.insertBefore("php","variable",{string:o,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:t,string:o,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:n,number:a,operator:i,punctuation:r}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),e.hooks.add("before-tokenize",(function(t){/<\?/.test(t.code)&&e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(Prism)},635:()=>{!function(){if("undefined"!=typeof Prism){var e=/\b([a-z]{3,7}:\/\/|tel:)[\w\-+%~/.:=&!$'()*,;@]+(?:\?[\w\-+%~/.:=?&!$'()*,;@]*)?(?:#[\w\-+%~/.:#=?&!$'()*,;@]*)?/,t=/\b\S+@[\w.]+[a-z]{2}/,n=/\[([^\]]+)\]\(([^)]+)\)/,a=["comment","url","attr-value","string"];Prism.plugins.autolinker={processGrammar:function(i){i&&!i["url-link"]&&(Prism.languages.DFS(i,(function(i,r,s){a.indexOf(s)>-1&&!Array.isArray(r)&&(r.pattern||(r=this[i]={pattern:r}),r.inside=r.inside||{},"comment"==s&&(r.inside["md-link"]=n),"attr-value"==s?Prism.languages.insertBefore("inside","punctuation",{"url-link":e},r):r.inside["url-link"]=e,r.inside["email-link"]=t)})),i["url-link"]=e,i["email-link"]=t)}},Prism.hooks.add("before-highlight",(function(e){Prism.plugins.autolinker.processGrammar(e.grammar)})),Prism.hooks.add("wrap",(function(e){if(/-link$/.test(e.type)){e.tag="a";var t=e.content;if("email-link"==e.type&&0!=t.indexOf("mailto:"))t="mailto:"+t;else if("md-link"==e.type){var a=e.content.match(n);t=a[2],e.content=a[1]}e.attributes.href=t;try{e.content=decodeURIComponent(e.content)}catch(e){}}}))}}()},9445:()=>{!function(){function e(e){var t=document.createElement("textarea");t.value=e.getText(),t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy");setTimeout((function(){n?e.success():e.error()}),1)}catch(t){setTimeout((function(){e.error(t)}),1)}document.body.removeChild(t)}"undefined"!=typeof Prism&&"undefined"!=typeof document&&(Prism.plugins.toolbar?Prism.plugins.toolbar.registerButton("copy-to-clipboard",(function(t){var n=t.element,a=function(e){var t={copy:"Copy","copy-error":"Press Ctrl+C to copy","copy-success":"Copied!","copy-timeout":5e3};for(var n in t){for(var a="data-prismjs-"+n,i=e;i&&!i.hasAttribute(a);)i=i.parentElement;i&&(t[n]=i.getAttribute(a))}return t}(n),i=document.createElement("button");i.className="copy-to-clipboard-button",i.setAttribute("type","button");var r=document.createElement("span");return i.appendChild(r),o("copy"),function(t,n){t.addEventListener("click",(function(){!function(t){navigator.clipboard?navigator.clipboard.writeText(t.getText()).then(t.success,(function(){e(t)})):e(t)}(n)}))}(i,{getText:function(){return n.textContent},success:function(){o("copy-success"),s()},error:function(){o("copy-error"),setTimeout((function(){!function(e){window.getSelection().selectAllChildren(e)}(n)}),1),s()}}),i;function s(){setTimeout((function(){o("copy")}),a["copy-timeout"])}function o(e){r.textContent=a[e],i.setAttribute("data-copy-state",e)}})):console.warn("Copy to Clipboard plugin loaded before Toolbar plugin."))}()},1793:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/g,t=/^#?((?:[\da-f]){3,4}|(?:[\da-f]{2}){3,4})$/i,n=[function(e){var n=t.exec(e);if(n){for(var a=(e=n[1]).length>=6?2:1,i=e.length/a,r=1==a?1/15:1/255,s=[],o=0;o<i;o++){var l=parseInt(e.substr(o*a,a),16);s.push(l*r)}return 3==i&&s.push(1),"rgba("+s.slice(0,3).map((function(e){return String(Math.round(255*e))})).join(",")+","+String(Number(s[3].toFixed(3)))+")"}},function(e){var t=(new Option).style;return t.color=e,t.color?e:void 0}];Prism.hooks.add("wrap",(function(t){if("color"===t.type||t.classes.indexOf("color")>=0){for(var a,i=t.content,r=i.split(e).join(""),s=0,o=n.length;s<o&&!a;s++)a=n[s](r);if(!a)return;var l='<span class="inline-color-wrapper"><span class="inline-color" style="background-color:'+a+';"></span></span>';t.content=l+i}}))}}()},6285:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&document.querySelector){var e,t="line-numbers",n="linkable-line-numbers",a=/\n(?!$)/g,i=!0;Prism.plugins.lineHighlight={highlightLines:function(r,u,c){var d=(u="string"==typeof u?u:r.getAttribute("data-line")||"").replace(/\s+/g,"").split(",").filter(Boolean),g=+r.getAttribute("data-line-offset")||0,p=(function(){if(void 0===e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding="0",t.style.border="0",t.innerHTML=" <br /> ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}()?parseInt:parseFloat)(getComputedStyle(r).lineHeight),m=Prism.util.isActive(r,t),f=r.querySelector("code"),h=m?r:f||r,b=[],y=f.textContent.match(a),v=y?y.length+1:1,k=f&&h!=f?function(e,t){var n=getComputedStyle(e),a=getComputedStyle(t);function i(e){return+e.substr(0,e.length-2)}return t.offsetTop+i(a.borderTopWidth)+i(a.paddingTop)-i(n.paddingTop)}(r,f):0;d.forEach((function(e){var t=e.split("-"),n=+t[0],a=+t[1]||n;if(!((a=Math.min(v+g,a))<n)){var i=r.querySelector('.line-highlight[data-range="'+e+'"]')||document.createElement("div");if(b.push((function(){i.setAttribute("aria-hidden","true"),i.setAttribute("data-range",e),i.className=(c||"")+" line-highlight"})),m&&Prism.plugins.lineNumbers){var s=Prism.plugins.lineNumbers.getLine(r,n),o=Prism.plugins.lineNumbers.getLine(r,a);if(s){var l=s.offsetTop+k+"px";b.push((function(){i.style.top=l}))}if(o){var u=o.offsetTop-s.offsetTop+o.offsetHeight+"px";b.push((function(){i.style.height=u}))}}else b.push((function(){i.setAttribute("data-start",String(n)),a>n&&i.setAttribute("data-end",String(a)),i.style.top=(n-g-1)*p+k+"px",i.textContent=new Array(a-n+2).join(" \n")}));b.push((function(){i.style.width=r.scrollWidth+"px"})),b.push((function(){h.appendChild(i)}))}}));var P=r.id;if(m&&Prism.util.isActive(r,n)&&P){o(r,n)||b.push((function(){r.classList.add(n)}));var w=parseInt(r.getAttribute("data-start")||"1");s(".line-numbers-rows > span",r).forEach((function(e,t){var n=t+w;e.onclick=function(){var e=P+"."+n;i=!1,location.hash=e,setTimeout((function(){i=!0}),1)}}))}return function(){b.forEach(l)}}};var r=0;Prism.hooks.add("before-sanity-check",(function(e){var t=e.element.parentElement;if(u(t)){var n=0;s(".line-highlight",t).forEach((function(e){n+=e.textContent.length,e.parentNode.removeChild(e)})),n&&/^(?: \n)+$/.test(e.code.slice(-n))&&(e.code=e.code.slice(0,-n))}})),Prism.hooks.add("complete",(function e(n){var a=n.element.parentElement;if(u(a)){clearTimeout(r);var i=Prism.plugins.lineNumbers,s=n.plugins&&n.plugins.lineNumbers;o(a,t)&&i&&!s?Prism.hooks.add("line-numbers",e):(Prism.plugins.lineHighlight.highlightLines(a)(),r=setTimeout(c,1))}})),window.addEventListener("hashchange",c),window.addEventListener("resize",(function(){s("pre").filter(u).map((function(e){return Prism.plugins.lineHighlight.highlightLines(e)})).forEach(l)}))}function s(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function o(e,t){return e.classList.contains(t)}function l(e){e()}function u(e){return!!(e&&/pre/i.test(e.nodeName)&&(e.hasAttribute("data-line")||e.id&&Prism.util.isActive(e,n)))}function c(){var e=location.hash.slice(1);s(".temporary.line-highlight").forEach((function(e){e.parentNode.removeChild(e)}));var t=(e.match(/\.([\d,-]+)$/)||[,""])[1];if(t&&!document.getElementById(e)){var n=e.slice(0,e.lastIndexOf(".")),a=document.getElementById(n);a&&(a.hasAttribute("data-line")||a.setAttribute("data-line",""),Prism.plugins.lineHighlight.highlightLines(a,t,"temporary ")(),i&&document.querySelector(".temporary.line-highlight").scrollIntoView())}}}()},6837:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e="line-numbers",t=/\n(?!$)/g,n=Prism.plugins.lineNumbers={getLine:function(t,n){if("PRE"===t.tagName&&t.classList.contains(e)){var a=t.querySelector(".line-numbers-rows");if(a){var i=parseInt(t.getAttribute("data-start"),10)||1,r=i+(a.children.length-1);n<i&&(n=i),n>r&&(n=r);var s=n-i;return a.children[s]}}},resize:function(e){i([e])},assumeViewportIndependence:!0},a=void 0;window.addEventListener("resize",(function(){n.assumeViewportIndependence&&a===window.innerWidth||(a=window.innerWidth,i(Array.prototype.slice.call(document.querySelectorAll("pre."+e))))})),Prism.hooks.add("complete",(function(n){if(n.code){var a=n.element,r=a.parentNode;if(r&&/pre/i.test(r.nodeName)&&!a.querySelector(".line-numbers-rows")&&Prism.util.isActive(a,e)){a.classList.remove(e),r.classList.add(e);var s,o=n.code.match(t),l=o?o.length+1:1,u=new Array(l+1).join("<span></span>");(s=document.createElement("span")).setAttribute("aria-hidden","true"),s.className="line-numbers-rows",s.innerHTML=u,r.hasAttribute("data-start")&&(r.style.counterReset="linenumber "+(parseInt(r.getAttribute("data-start"),10)-1)),n.element.appendChild(s),i([r]),Prism.hooks.run("line-numbers",n)}}})),Prism.hooks.add("line-numbers",(function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0}))}function i(e){if(0!=(e=e.filter((function(e){var t,n=(t=e,t?window.getComputedStyle?getComputedStyle(t):t.currentStyle||null:null)["white-space"];return"pre-wrap"===n||"pre-line"===n}))).length){var n=e.map((function(e){var n=e.querySelector("code"),a=e.querySelector(".line-numbers-rows");if(n&&a){var i=e.querySelector(".line-numbers-sizer"),r=n.textContent.split(t);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var s=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:s,sizer:i}}})).filter(Boolean);n.forEach((function(e){var t=e.sizer,n=e.lines,a=e.lineHeights,i=e.oneLinerHeight;a[n.length-1]=void 0,n.forEach((function(e,n){if(e&&e.length>1){var r=t.appendChild(document.createElement("span"));r.style.display="block",r.textContent=e}else a[n]=i}))})),n.forEach((function(e){for(var t=e.sizer,n=e.lineHeights,a=0,i=0;i<n.length;i++)void 0===n[i]&&(n[i]=t.children[a++].getBoundingClientRect().height)})),n.forEach((function(e){var t=e.sizer,n=e.element.querySelector(".line-numbers-rows");t.style.display="none",t.innerHTML="",e.lineHeights.forEach((function(e,t){n.children[t].style.height=e+"px"}))}))}}}()},7555:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document&&Function.prototype.bind){var e,t,n={gradient:{create:(e={},t=function(t){if(e[t])return e[t];var n=t.match(/^(\b|\B-[a-z]{1,10}-)((?:repeating-)?(?:linear|radial)-gradient)/),a=n&&n[1],i=n&&n[2],r=t.replace(/^(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\(|\)$/g,"").split(/\s*,\s*/);return i.indexOf("linear")>=0?e[t]=function(e,t,n){var a="180deg";return/^(?:-?(?:\d+(?:\.\d+)?|\.\d+)(?:deg|rad)|to\b|top|right|bottom|left)/.test(n[0])&&(a=n.shift()).indexOf("to ")<0&&(a.indexOf("top")>=0?a=a.indexOf("left")>=0?"to bottom right":a.indexOf("right")>=0?"to bottom left":"to bottom":a.indexOf("bottom")>=0?a=a.indexOf("left")>=0?"to top right":a.indexOf("right")>=0?"to top left":"to top":a.indexOf("left")>=0?a="to right":a.indexOf("right")>=0?a="to left":e&&(a.indexOf("deg")>=0?a=90-parseFloat(a)+"deg":a.indexOf("rad")>=0&&(a=Math.PI/2-parseFloat(a)+"rad"))),t+"("+a+","+n.join(",")+")"}(a,i,r):i.indexOf("radial")>=0?e[t]=function(e,t,n){if(n[0].indexOf("at")<0){var a="center",i="ellipse",r="farthest-corner";if(/\b(?:bottom|center|left|right|top)\b|^\d+/.test(n[0])&&(a=n.shift().replace(/\s*-?\d+(?:deg|rad)\s*/,"")),/\b(?:circle|closest|contain|cover|ellipse|farthest)\b/.test(n[0])){var s=n.shift().split(/\s+/);!s[0]||"circle"!==s[0]&&"ellipse"!==s[0]||(i=s.shift()),s[0]&&(r=s.shift()),"cover"===r?r="farthest-corner":"contain"===r&&(r="clothest-side")}return t+"("+i+" "+r+" at "+a+","+n.join(",")+")"}return t+"("+n.join(",")+")"}(0,i,r):e[t]=i+"("+r.join(",")+")"},function(){new Prism.plugins.Previewer("gradient",(function(e){return this.firstChild.style.backgroundImage="",this.firstChild.style.backgroundImage=t(e),!!this.firstChild.style.backgroundImage}),"*",(function(){this._elt.innerHTML="<div></div>"}))}),tokens:{gradient:{pattern:/(?:\b|\B-[a-z]{1,10}-)(?:repeating-)?(?:linear|radial)-gradient\((?:(?:hsl|rgb)a?\(.+?\)|[^\)])+\)/gi,inside:{function:/[\w-]+(?=\()/,punctuation:/[(),]/}}},languages:{css:!0,less:!0,sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},angle:{create:function(){new Prism.plugins.Previewer("angle",(function(e){var t,n,a=parseFloat(e),i=e.match(/[a-z]+$/i);if(!a||!i)return!1;switch(i=i[0]){case"deg":t=360;break;case"grad":t=400;break;case"rad":t=2*Math.PI;break;case"turn":t=1}return n=100*a/t,n%=100,this[(a<0?"set":"remove")+"Attribute"]("data-negative",""),this.querySelector("circle").style.strokeDasharray=Math.abs(n)+",500",!0}),"*",(function(){this._elt.innerHTML='<svg viewBox="0 0 64 64"><circle r="16" cy="32" cx="32"></circle></svg>'}))},tokens:{angle:/(?:\b|\B-|(?=\B\.))(?:\d+(?:\.\d+)?|\.\d+)(?:deg|g?rad|turn)\b/i},languages:{css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"func",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},color:{create:function(){new Prism.plugins.Previewer("color",(function(e){return this.style.backgroundColor="",this.style.backgroundColor=e,!!this.style.backgroundColor}))},tokens:{color:[Prism.languages.css.hexcode].concat(Prism.languages.css.color)},languages:{css:!1,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",before:"punctuation",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!1,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},easing:{create:function(){new Prism.plugins.Previewer("easing",(function(e){var t=(e={linear:"0,0,1,1",ease:".25,.1,.25,1","ease-in":".42,0,1,1","ease-out":"0,0,.58,1","ease-in-out":".42,0,.58,1"}[e]||e).match(/-?(?:\d+(?:\.\d+)?|\.\d+)/g);if(4===t.length){t=t.map((function(e,t){return 100*(t%2?1-e:e)})),this.querySelector("path").setAttribute("d","M0,100 C"+t[0]+","+t[1]+", "+t[2]+","+t[3]+", 100,0");var n=this.querySelectorAll("line");return n[0].setAttribute("x2",t[0]),n[0].setAttribute("y2",t[1]),n[1].setAttribute("x2",t[2]),n[1].setAttribute("y2",t[3]),!0}return!1}),"*",(function(){this._elt.innerHTML='<svg viewBox="-20 -20 140 140" width="100" height="100"><defs><marker id="prism-previewer-easing-marker" viewBox="0 0 4 4" refX="2" refY="2" markerUnits="strokeWidth"><circle cx="2" cy="2" r="1.5" /></marker></defs><path d="M0,100 C20,50, 40,30, 100,0" /><line x1="0" y1="100" x2="20" y2="50" marker-start="url(#prism-previewer-easing-marker)" marker-end="url(#prism-previewer-easing-marker)" /><line x1="100" y1="0" x2="40" y2="30" marker-start="url(#prism-previewer-easing-marker)" marker-end="url(#prism-previewer-easing-marker)" /></svg>'}))},tokens:{easing:{pattern:/\bcubic-bezier\((?:-?(?:\d+(?:\.\d+)?|\.\d+),\s*){3}-?(?:\d+(?:\.\d+)?|\.\d+)\)\B|\b(?:ease(?:-in)?(?:-out)?|linear)(?=\s|[;}]|$)/i,inside:{function:/[\w-]+(?=\()/,punctuation:/[(),]/}}},languages:{css:!0,less:!0,sass:[{lang:"sass",inside:"inside",before:"punctuation",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]},{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}},time:{create:function(){new Prism.plugins.Previewer("time",(function(e){var t=parseFloat(e),n=e.match(/[a-z]+$/i);return!(!t||!n||(n=n[0],this.querySelector("circle").style.animationDuration=2*t+n,0))}),"*",(function(){this._elt.innerHTML='<svg viewBox="0 0 64 64"><circle r="16" cy="32" cx="32"></circle></svg>'}))},tokens:{time:/(?:\b|\B-|(?=\B\.))(?:\d+(?:\.\d+)?|\.\d+)m?s\b/i},languages:{css:!0,less:!0,markup:{lang:"markup",before:"punctuation",inside:"inside",root:Prism.languages.markup&&Prism.languages.markup.tag.inside["attr-value"]},sass:[{lang:"sass",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["property-line"]},{lang:"sass",before:"operator",inside:"inside",root:Prism.languages.sass&&Prism.languages.sass["variable-line"]}],scss:!0,stylus:[{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["property-declaration"].inside},{lang:"stylus",before:"hexcode",inside:"rest",root:Prism.languages.stylus&&Prism.languages.stylus["variable-declaration"].inside}]}}},a="token",i="active",r="flipped",s=function(e,t,n,a){this._elt=null,this._type=e,this._token=null,this.updater=t,this._mouseout=this.mouseout.bind(this),this.initializer=a;var i=this;n||(n=["*"]),Array.isArray(n)||(n=[n]),n.forEach((function(e){"string"!=typeof e&&(e=e.lang),s.byLanguages[e]||(s.byLanguages[e]=[]),s.byLanguages[e].indexOf(i)<0&&s.byLanguages[e].push(i)})),s.byType[e]=this};for(var o in s.prototype.init=function(){this._elt||(this._elt=document.createElement("div"),this._elt.className="prism-previewer prism-previewer-"+this._type,document.body.appendChild(this._elt),this.initializer&&this.initializer())},s.prototype.isDisabled=function(e){do{if(e.hasAttribute&&e.hasAttribute("data-previewers"))return-1===(e.getAttribute("data-previewers")||"").split(/\s+/).indexOf(this._type)}while(e=e.parentNode);return!1},s.prototype.check=function(e){if(!e.classList.contains(a)||!this.isDisabled(e)){do{if(e.classList&&e.classList.contains(a)&&e.classList.contains(this._type))break}while(e=e.parentNode);e&&e!==this._token&&(this._token=e,this.show())}},s.prototype.mouseout=function(){this._token.removeEventListener("mouseout",this._mouseout,!1),this._token=null,this.hide()},s.prototype.show=function(){var e,t,n,a;if(this._elt||this.init(),this._token)if(this.updater.call(this._elt,this._token.textContent)){this._token.addEventListener("mouseout",this._mouseout,!1);var s=(t=(e=this._token.getBoundingClientRect()).left,n=e.top,t-=(a=document.documentElement.getBoundingClientRect()).left,{top:n-=a.top,right:innerWidth-t-e.width,bottom:innerHeight-n-e.height,left:t,width:e.width,height:e.height});this._elt.classList.add(i),s.top-this._elt.offsetHeight>0?(this._elt.classList.remove(r),this._elt.style.top=s.top+"px",this._elt.style.bottom=""):(this._elt.classList.add(r),this._elt.style.bottom=s.bottom+"px",this._elt.style.top=""),this._elt.style.left=s.left+Math.min(200,s.width/2)+"px"}else this.hide()},s.prototype.hide=function(){this._elt.classList.remove(i)},s.byLanguages={},s.byType={},s.initEvents=function(e,t){var n=[];s.byLanguages[t]&&(n=n.concat(s.byLanguages[t])),s.byLanguages["*"]&&(n=n.concat(s.byLanguages["*"])),e.addEventListener("mouseover",(function(e){var t=e.target;n.forEach((function(e){e.check(t)}))}),!1)},Prism.plugins.Previewer=s,Prism.hooks.add("before-highlight",(function(e){for(var t in n){var a=n[t].languages;if(e.language&&a[e.language]&&!a[e.language].initialized){var i=a[e.language];Array.isArray(i)||(i=[i]),i.forEach((function(i){var r,s,o,l;!0===i?(r="important",s=e.language,i=e.language):(r=i.before||"important",s=i.inside||i.lang,o=i.root||Prism.languages,l=i.skip,i=e.language),!l&&Prism.languages[i]&&(Prism.languages.insertBefore(s,r,n[t].tokens,o),e.grammar=Prism.languages[i],a[e.language]={initialized:!0})}))}}})),Prism.hooks.add("after-highlight",(function(e){(s.byLanguages["*"]||s.byLanguages[e.language])&&s.initEvents(e.element,e.language)})),n)n[o].create()}}()},2461:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document)if(Prism.plugins.toolbar){var e={none:"Plain text",plain:"Plain text",plaintext:"Plain text",text:"Plain text",txt:"Plain text",html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",rss:"RSS",css:"CSS",clike:"C-like",js:"JavaScript",abap:"ABAP",abnf:"ABNF",al:"AL",antlr4:"ANTLR4",g4:"ANTLR4",apacheconf:"Apache Configuration",apl:"APL",aql:"AQL",ino:"Arduino",arff:"ARFF",armasm:"ARM Assembly","arm-asm":"ARM Assembly",art:"Arturo",asciidoc:"AsciiDoc",adoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",asmatmel:"Atmel AVR Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",avisynth:"AviSynth",avs:"AviSynth","avro-idl":"Avro IDL",avdl:"Avro IDL",awk:"AWK",gawk:"GAWK",sh:"Shell",basic:"BASIC",bbcode:"BBcode",bbj:"BBj",bnf:"BNF",rbnf:"RBNF",bqn:"BQN",bsl:"BSL (1C:Enterprise)",oscript:"OneScript",csharp:"C#",cs:"C#",dotnet:"C#",cpp:"C++",cfscript:"CFScript",cfc:"CFScript",cil:"CIL",cilkc:"Cilk/C","cilk-c":"Cilk/C",cilkcpp:"Cilk/C++","cilk-cpp":"Cilk/C++",cilk:"Cilk/C++",cmake:"CMake",cobol:"COBOL",coffee:"CoffeeScript",conc:"Concurnas",csp:"Content-Security-Policy","css-extras":"CSS Extras",csv:"CSV",cue:"CUE",dataweave:"DataWeave",dax:"DAX",django:"Django/Jinja2",jinja2:"Django/Jinja2","dns-zone-file":"DNS zone file","dns-zone":"DNS zone file",dockerfile:"Docker",dot:"DOT (Graphviz)",gv:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",ejs:"EJS",etlua:"Embedded Lua templating",erb:"ERB","excel-formula":"Excel Formula",xlsx:"Excel Formula",xls:"Excel Formula",fsharp:"F#","firestore-security-rules":"Firestore security rules",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gamemakerlanguage:"GameMaker Language",gap:"GAP (CAS)",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",gettext:"gettext",po:"gettext",glsl:"GLSL",gn:"GN",gni:"GN","linker-script":"GNU Linker Script",ld:"GNU Linker Script","go-module":"Go module","go-mod":"Go module",graphql:"GraphQL",hbs:"Handlebars",hs:"Haskell",hcl:"HCL",hlsl:"HLSL",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam","icu-message-format":"ICU Message Format",idr:"Idris",ignore:".ignore",gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore",inform7:"Inform 7",javadoc:"JavaDoc",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jq:"JQ",jsdoc:"JSDoc","js-extras":"JS Extras",json:"JSON",webmanifest:"Web App Manifest",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace","js-templates":"JS Templates",keepalived:"Keepalived Configure",kts:"Kotlin Script",kt:"Kotlin",kumir:"KuMir (КуМир)",kum:"KuMir (КуМир)",latex:"LaTeX",tex:"TeX",context:"ConTeXt",lilypond:"LilyPond",ly:"LilyPond",emacs:"Lisp",elisp:"Lisp","emacs-lisp":"Lisp",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",magma:"Magma (CAS)",md:"Markdown","markup-templating":"Markup templating",matlab:"MATLAB",maxscript:"MAXScript",mel:"MEL",metafont:"METAFONT",mongodb:"MongoDB",moon:"MoonScript",n1ql:"N1QL",n4js:"N4JS",n4jsd:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nani:"Naninovel Script",nasm:"NASM",neon:"NEON",nginx:"nginx",nsis:"NSIS",objectivec:"Objective-C",objc:"Objective-C",ocaml:"OCaml",opencl:"OpenCL",openqasm:"OpenQasm",qasm:"OpenQasm",parigp:"PARI/GP",objectpascal:"Object Pascal",psl:"PATROL Scripting Language",pcaxis:"PC-Axis",px:"PC-Axis",peoplecode:"PeopleCode",pcode:"PeopleCode",php:"PHP",phpdoc:"PHPDoc","php-extras":"PHP Extras","plant-uml":"PlantUML",plantuml:"PlantUML",plsql:"PL/SQL",powerquery:"PowerQuery",pq:"PowerQuery",mscript:"PowerQuery",powershell:"PowerShell",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",purebasic:"PureBasic",pbfasm:"PureBasic",purs:"PureScript",py:"Python",qsharp:"Q#",qs:"Q#",q:"Q (kdb+ database)",qml:"QML",rkt:"Racket",cshtml:"Razor C#",razor:"Razor C#",jsx:"React JSX",tsx:"React TSX",renpy:"Ren'py",rpy:"Ren'py",res:"ReScript",rest:"reST (reStructuredText)",robotframework:"Robot Framework",robot:"Robot Framework",rb:"Ruby",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (SCSS)","shell-session":"Shell session","sh-session":"Shell session",shellsession:"Shell session",sml:"SML",smlnj:"SML/NJ",solidity:"Solidity (Ethereum)",sol:"Solidity (Ethereum)","solution-file":"Solution file",sln:"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL",rq:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF: Status Quo Function (Arma 3)",sql:"SQL",stata:"Stata Ado",iecst:"Structured Text (IEC 61131-3)",supercollider:"SuperCollider",sclang:"SuperCollider",systemd:"Systemd configuration file","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)",t4:"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tt2:"Template Toolkit 2",toml:"TOML",trickle:"trickle",troy:"troy",trig:"TriG",ts:"TypeScript",tsconfig:"TSConfig",uscript:"UnrealScript",uc:"UnrealScript",uorazor:"UO Razor Script",uri:"URI",url:"URL",vbnet:"VB.Net",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",vba:"VBA",vb:"Visual Basic",wasm:"WebAssembly","web-idl":"Web IDL",webidl:"Web IDL",wgsl:"WGSL",wiki:"Wiki markup",wolfram:"Wolfram language",nb:"Mathematica Notebook",wl:"Wolfram language",xeoracube:"XeoraCube","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yml:"YAML",yang:"YANG"};Prism.plugins.toolbar.registerButton("show-language",(function(t){var n=t.element.parentNode;if(n&&/pre/i.test(n.nodeName)){var a,i=n.getAttribute("data-language")||e[t.language]||((a=t.language)?(a.substring(0,1).toUpperCase()+a.substring(1)).replace(/s(?=cript)/,"S"):a);if(i){var r=document.createElement("span");return r.textContent=i,r}}}))}else console.warn("Show Languages plugin loaded before Toolbar plugin.")}()},301:()=>{!function(){if("undefined"!=typeof Prism&&"undefined"!=typeof document){var e=[],t={},n=function(){};Prism.plugins.toolbar={};var a=Prism.plugins.toolbar.registerButton=function(n,a){var i;i="function"==typeof a?a:function(e){var t;return"function"==typeof a.onClick?((t=document.createElement("button")).type="button",t.addEventListener("click",(function(){a.onClick.call(this,e)}))):"string"==typeof a.url?(t=document.createElement("a")).href=a.url:t=document.createElement("span"),a.className&&t.classList.add(a.className),t.textContent=a.text,t},n in t?console.warn('There is a button with the key "'+n+'" registered already.'):e.push(t[n]=i)},i=Prism.plugins.toolbar.hook=function(a){var i=a.element.parentNode;if(i&&/pre/i.test(i.nodeName)&&!i.parentNode.classList.contains("code-toolbar")){var r=document.createElement("div");r.classList.add("code-toolbar"),i.parentNode.insertBefore(r,i),r.appendChild(i);var s=document.createElement("div");s.classList.add("toolbar");var o=e,l=function(e){for(;e;){var t=e.getAttribute("data-toolbar-order");if(null!=t)return(t=t.trim()).length?t.split(/\s*,\s*/g):[];e=e.parentElement}}(a.element);l&&(o=l.map((function(e){return t[e]||n}))),o.forEach((function(e){var t=e(a);if(t){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(t),s.appendChild(n)}})),r.appendChild(s)}};a("label",(function(e){var t=e.element.parentNode;if(t&&/pre/i.test(t.nodeName)&&t.hasAttribute("data-label")){var n,a,i=t.getAttribute("data-label");try{a=document.querySelector("template#"+i)}catch(e){}return a?n=a.content:(t.hasAttribute("data-url")?(n=document.createElement("a")).href=t.getAttribute("data-url"):n=document.createElement("span"),n.textContent=i),n}})),Prism.hooks.add("complete",i)}}()}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(1983),t=n.n(e);n(4312),n(9700),n(3554),n(5248),n(6285),n(6837),n(5624),n(1113),n(5723),n(301),n(2461),n(9445),n(1793),n(7555),n(635),document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&t().highlightAll()})),window.CODE_SNIPPETS_PRISM=t()})()})(); dist/prism.js.LICENSE.txt 0000644 00000000301 15153464547 0011106 0 ustar 00 /**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/
dist/settings.css 0000644 00000107073 15153464547 0010107 0 ustar 00 .codemirror-colorview{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;border:1px solid #cecece;box-sizing:border-box;cursor:pointer;display:inline-block;height:10px;margin:0 2px;position:relative;vertical-align:middle;width:10px}.codemirror-colorview .codemirror-colorview-background{bottom:0;content:"";left:0;position:absolute;right:0;top:0}.codemirror-colorview:hover{border-color:#494949}.codemirror-colorpicker{background-color:#fff;border:1px solid rgba(0,0,0,.2);border-radius:3px;box-shadow:0 0 10px 2px rgba(0,0,0,.12);display:inline-block;position:relative;width:224px;z-index:1000}.codemirror-colorpicker>.arrow{border-bottom:10px solid rgba(0,0,0,.2);border-left:10px solid transparent;border-right:10px solid transparent;display:none;height:0;left:7px;pointer-events:none;position:absolute;top:-10px;width:0}.codemirror-colorpicker>.arrow:after{border-bottom:9px solid #fff;border-left:9px solid transparent;border-right:9px solid transparent;content:"";height:0;left:-9px;position:absolute;top:1px;width:0}.codemirror-colorpicker .colorpicker-body .arrow-button{background-color:transparent;height:12px;padding:0;position:relative;width:10px}.codemirror-colorpicker .colorpicker-body .arrow-button:before{border-bottom:3px solid #000;height:50%;top:0}.codemirror-colorpicker .colorpicker-body .arrow-button:after,.codemirror-colorpicker .colorpicker-body .arrow-button:before{border-left:3px solid transparent;border-right:3px solid transparent;box-sizing:border-box;content:"";display:inline-block;height:0;left:0;margin:2px;pointer-events:none;position:absolute;right:0;width:0}.codemirror-colorpicker .colorpicker-body .arrow-button:after{border-top:3px solid #000;bottom:0;top:50%}.codemirror-colorpicker .colorpicker-body .color{cursor:pointer;height:120px;overflow:hidden;position:relative}.codemirror-colorpicker .colorpicker-body .color>.saturation,.codemirror-colorpicker .colorpicker-body .color>.saturation>.value{height:100%;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value>.drag-pointer{border-radius:50%;height:10px;position:absolute;transform:translateX(-50%) translateY(-50%);width:10px}.codemirror-colorpicker .colorpicker-body .color>.saturation{background-color:hsla(20,42%,65%,0);background-image:linear-gradient(90deg,#fff,hsla(20,42%,65%,0));background-repeat:repeat-x}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value{background-image:linear-gradient(0deg,#000,hsla(20,42%,65%,0))}.codemirror-colorpicker .colorpicker-body .color>.saturation>.value>.drag-pointer{border:1px solid #fff;box-shadow:0 0 2px 0 rgba(0,0,0,.05)}.codemirror-colorpicker .colorpicker-body .control{padding:10px 0;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper{padding-left:30px}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper .el-cp-color-control__left{border-radius:50%;box-sizing:border-box;height:30px;left:12px;position:absolute;top:20px;width:30px}.codemirror-colorpicker .colorpicker-body .control.has-eyedropper>.color,.codemirror-colorpicker .colorpicker-body .control.has-eyedropper>.empty{left:45px}.codemirror-colorpicker .colorpicker-body .control>.color,.codemirror-colorpicker .colorpicker-body .control>.empty{border-radius:50%;box-sizing:border-box;height:30px;left:12px;position:absolute;top:14px;width:30px}.codemirror-colorpicker .colorpicker-body .control>.color{border:1px solid rgba(0,0,0,.1)}.codemirror-colorpicker .colorpicker-body .control>.hue{box-sizing:border-box;cursor:pointer;margin:0 0 0 42px;padding:6px 16px;position:relative}.codemirror-colorpicker .colorpicker-body .control>.hue>.hue-container{border-radius:3px;height:10px;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .control>.opacity{box-sizing:border-box;cursor:pointer;margin:0 0 0 42px;padding:3px 16px;position:relative}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container{border-radius:3px;height:10px;position:relative;width:100%}.codemirror-colorpicker .colorpicker-body .control .drag-bar,.codemirror-colorpicker .colorpicker-body .control .drag-bar2{border-radius:50%;cursor:pointer;height:12px;left:0;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:12px}.codemirror-colorpicker .colorpicker-body .control>.hue>.hue-container{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat}.codemirror-colorpicker .colorpicker-body .control>.opacity>.opacity-container>.color-bar{bottom:0;content:"";display:block;left:0;position:absolute;right:0;top:0}.codemirror-colorpicker .colorpicker-body .control>.empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat}.codemirror-colorpicker .colorpicker-body .control .drag-bar,.codemirror-colorpicker .colorpicker-body .control .drag-bar2{background-color:#fefefe;border:1px solid rgba(0,0,0,.05);box-shadow:2px 2px 2px 0 rgba(0,0,0,.2)}.codemirror-colorpicker .colorpicker-body .information{box-sizing:padding-box;position:relative}.codemirror-colorpicker .colorpicker-body .information>input{bottom:20px;box-sizing:border-box;font-size:10px;height:20px;padding:0 0 0 2px;position:absolute;-webkit-user-select:text;-moz-user-select:text;user-select:text}.codemirror-colorpicker .colorpicker-body .information>input[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.codemirror-colorpicker .colorpicker-body .information>input[type=number]::-webkit-inner-spin-button,.codemirror-colorpicker .colorpicker-body .information>input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.codemirror-colorpicker .colorpicker-body .information.hex>.information-item.hex,.codemirror-colorpicker .colorpicker-body .information.hsl>.information-item.hsl,.codemirror-colorpicker .colorpicker-body .information.rgb>.information-item.rgb{display:flex}.codemirror-colorpicker .colorpicker-body .information>.information-item{box-sizing:border-box;display:none;margin-right:40px;padding:0 5px 0 9px;position:relative}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field{box-sizing:border-box;display:block;flex:1;padding:3px;position:relative}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field>.title{color:#a9a9a9;cursor:pointer;font-size:12px;padding-top:2px;text-align:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input{border:1px solid #cbcbcb;border-radius:2px;box-sizing:border-box;color:#333;font-size:11px;height:21px;padding:3px;text-align:center;-webkit-user-select:text;-moz-user-select:text;user-select:text;width:100%}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]::-webkit-inner-spin-button,.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field.hsl-l input[type=number],.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field.hsl-s input[type=number]{padding-left:1px;padding-right:10px}.codemirror-colorpicker .colorpicker-body .information>.information-item>.input-field .postfix{box-sizing:border-box;display:inline-block;font-size:11px;height:21px;line-height:2;padding:2px;position:absolute;right:3px;text-align:center;top:2px}.codemirror-colorpicker .colorpicker-body .information>.information-change{bottom:0;box-sizing:border-box;display:block;padding-top:5px;position:absolute;right:0;text-align:center;top:0;width:40px}.codemirror-colorpicker .colorpicker-body .information>.information-change>.format-change-button{background:transparent;border:0;box-sizing:border-box;cursor:pointer;outline:none}.codemirror-colorpicker .colorpicker-body .information>.title{color:#a3a3a3}.codemirror-colorpicker .colorpicker-body .information>.input{color:#333}.codemirror-colorpicker .colorpicker-body .colorsets{border-top:1px solid #e2e2e2}.codemirror-colorpicker .colorpicker-body .colorsets>.menu{float:right;padding:10px 15px 10px 5px}.codemirror-colorpicker .colorpicker-body .colorsets>.menu button{border:0;cursor:pointer;font-family:serif,sans-serif;font-size:14px;font-weight:300;outline:none}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list{box-sizing:border-box;display:block;line-height:0;margin-right:30px;padding:12px 0 0 12px}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item{background-size:contain;border-radius:2px;box-sizing:border-box;cursor:pointer;display:inline-block;height:13px;margin-bottom:12px;margin-right:12px;overflow:hidden;position:relative;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item:hover{transform:scale(1.2)}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item .empty{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;height:100%;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .color-item .color-view{border:1px solid rgba(0,0,0,.1);box-sizing:border-box;height:100%;left:0;margin:0;padding:0;pointer-events:none;position:absolute;top:0;width:100%}.codemirror-colorpicker .colorpicker-body .colorsets>.color-list .add-color-item{color:#8e8e8e;cursor:pointer;display:inline-block;font-family:serif,sans-serif;font-size:16px;font-weight:400;height:13px;line-height:1;margin-bottom:12px;margin-right:12px;text-align:center;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .color-chooser{background-color:rgba(0,0,0,.5);bottom:0;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .05s ease-out}.codemirror-colorpicker .colorpicker-body .color-chooser.open{opacity:1;pointer-events:all}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container{background-color:#fff;bottom:0;left:0;position:absolute;right:0;top:120px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header{border-bottom:1px solid rgba(0,0,0,.2);box-sizing:border-box;display:flex;height:34px;left:0;padding:3px 0;position:absolute;right:0;top:0}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header .title{box-sizing:border-box;color:#000;flex:2;font-size:15px;font-weight:700;margin:0;overflow:hidden;padding:5px 5px 5px 14px;text-align:left;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-item-header .items{cursor:pointer;display:block;flex:1;height:100%;line-height:2;padding-right:10px;text-align:right}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list{bottom:0;left:0;overflow:auto;position:absolute;right:0;top:34px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item{border-bottom:1px solid rgba(0,0,0,.1);cursor:pointer;display:flex;padding:3px 0}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item:hover{background-color:rgba(0,0,0,.05)}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .title{box-sizing:border-box;color:#000;flex:2;font-size:14px;font-size:13px;font-weight:400;margin:0;overflow:hidden;padding:5px 5px 5px 14px;pointer-events:none;text-align:left;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items{cursor:pointer;display:block;flex:3;height:100%;line-height:1.6;pointer-events:none}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;background-size:contain;border:1px solid #ddd;border-radius:3px;box-sizing:border-box;cursor:pointer;display:inline-block;height:13px;margin-right:10px;overflow:hidden;vertical-align:middle;width:13px}.codemirror-colorpicker .colorpicker-body .color-chooser .color-chooser-container .colorsets-list .colorsets-item .items .color-item .color-view{height:100%;margin:0;padding:0;pointer-events:none;width:100%}.codemirror-colorpicker.sketch{border-radius:5px}.codemirror-colorpicker.sketch>.colorpicker-body>.color{box-sizing:border-box;height:150px;margin:10px 10px 2px}.codemirror-colorpicker.sketch>.colorpicker-body>.control{padding:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control.has-eyedropper{padding-left:30px}.codemirror-colorpicker.sketch>.colorpicker-body>.control.has-eyedropper .el-cp-color-control__left{top:4px}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.color,.codemirror-colorpicker.sketch>.colorpicker-body>.control>.empty{border-radius:2px;box-sizing:border-box;height:26px;left:auto;position:absolute;right:10px;top:1px;width:26px}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.color{box-shadow:inset 0 0 1px 0 rgba(0,0,0,.5)}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.hue{margin:0 38px 0 0;padding:2px 2px 2px 10px;position:relative}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.hue>.hue-container{border-radius:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.opacity{margin:0 38px 0 0;padding:2px 2px 2px 10px;position:relative}.codemirror-colorpicker.sketch>.colorpicker-body>.control>.opacity>.opacity-container{border-radius:0}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2{border-radius:0;border-radius:1px;bottom:1px!important;height:50%;left:0;top:50%;transform:translateX(-50%) translateY(-50%);width:2px}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar.first,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2.first{left:0;transform:translateX(50%) translateY(-50%)!important}.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar.last,.codemirror-colorpicker.sketch>.colorpicker-body>.control .drag-bar2.last{transform:translateX(-150%) translateY(-50%)!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-change{display:none}.codemirror-colorpicker.sketch>.colorpicker-body>.information.rgb .information-item.rgb{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information.rgb .information-item.hsl{display:none!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hex .information-item.hex{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hex .information-item.hsl,.codemirror-colorpicker.sketch>.colorpicker-body>.information.hsl .information-item.rgb{display:none!important}.codemirror-colorpicker.sketch>.colorpicker-body>.information.hsl .information-item.hsl{display:inherit}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item{display:inline-flex!important;margin-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field{padding-left:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field:last-child{padding-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field>.title{color:#000;cursor:pointer;font-size:11px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item>.input-field:last-child:not(:first-child){padding-right:0}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.hex{padding-left:5px;padding-right:0;width:74px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.rgb{padding-left:0;padding-right:0;width:140px}.codemirror-colorpicker.sketch>.colorpicker-body>.information .information-item.hsl{display:none;padding-left:0;padding-right:0;width:140px}.codemirror-colorpicker.sketch>.colorpicker-body>.colorsets>.color-list{margin-right:0;padding-right:12px}.codemirror-colorpicker.sketch>.colorpicker-body>.colorsets>.color-list .color-item{border-radius:3px;height:16px;margin-bottom:10px;margin-right:9px;width:16px}.codemirror-colorpicker.palette{border-radius:3px;box-shadow:none}.codemirror-colorpicker.palette>.colorpicker-body>.color,.codemirror-colorpicker.palette>.colorpicker-body>.control,.codemirror-colorpicker.palette>.colorpicker-body>.information{display:none}.codemirror-colorpicker.palette>.colorpicker-body>.colorsets{border-top:0;box-sizing:border-box}.codemirror-colorpicker.palette>.colorpicker-body>.colorsets>.color-list .color-item{height:15px;margin-bottom:10px;margin-right:10px;width:15px}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser{box-sizing:border-box;display:none}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open{border:1px solid #d8d8d8;border-radius:3px;bottom:auto;box-shadow:0 0 10px 2px rgba(0,0,0,.12);display:block;left:-1px;right:-1px;top:-1px}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container{background-color:#fff;border-radius:2px;bottom:auto;box-sizing:border-box;left:auto;position:relative;right:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-item-header{border-top-left-radius:3px;border-top-right-radius:3px;bottom:auto;left:auto;position:relative;right:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-list{bottom:auto;left:auto;overflow:auto;position:relative;right:auto;top:auto}.codemirror-colorpicker.palette>.colorpicker-body>.color-chooser.open .color-chooser-container .colorsets-list .colorsets-item:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.codemirror-colorpicker.macos .colorpicker-body .wheel{box-sizing:border-box;height:224px;position:relative;width:224px}.codemirror-colorpicker.macos .colorpicker-body .wheel .wheel-canvas{border-radius:50%;height:214px;left:5px;position:absolute;top:5px;width:214px}.codemirror-colorpicker.macos .colorpicker-body .wheel .drag-pointer{border:1px solid #fff;border-radius:50%;display:inline-block;height:10px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:10px;z-index:2}.codemirror-colorpicker.macos .control{padding-top:0}.codemirror-colorpicker.macos .control>.color,.codemirror-colorpicker.macos .control>.empty{top:4px}.codemirror-colorpicker.macos .control.has-eyedropper{padding-left:30px}.codemirror-colorpicker.macos .control.has-eyedropper .el-cp-color-control__left{top:9px}.codemirror-colorpicker.macos .value{box-sizing:border-box;cursor:pointer;margin:0 0 0 42px;padding:6px 16px;position:relative}.codemirror-colorpicker.macos .value>.value-container{background-image:linear-gradient(90deg,#000 0,hsla(0,0%,100%,0));border-radius:3px;box-sizing:border-box;height:10px;position:relative;width:100%}.codemirror-colorpicker.macos .value>.value-container .drag-bar{border-radius:50%;cursor:pointer;height:12px;left:0;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:12px}.codemirror-colorpicker.mini{display:inline-block;width:180px}.codemirror-colorpicker.mini .control{padding:0}.codemirror-colorpicker.mini .control .hue,.codemirror-colorpicker.mini .control .opacity{margin:0;padding:0}.codemirror-colorpicker.mini .control .hue>.hue-container,.codemirror-colorpicker.mini .control .opacity>.opacity-container{border-radius:0;height:20px;overflow:hidden}.codemirror-colorpicker.mini .control .drag-bar,.codemirror-colorpicker.mini .control .drag-bar2{background-color:transparent;border:0;box-shadow:none;box-sizing:border-box;height:100%;width:5px}.codemirror-colorpicker.mini .control .drag-bar.last:before,.codemirror-colorpicker.mini .control .drag-bar.lastafter,.codemirror-colorpicker.mini .control .drag-bar2.last:before,.codemirror-colorpicker.mini .control .drag-bar2.lastafter{left:1px}.codemirror-colorpicker.mini .control .drag-bar.first:after,.codemirror-colorpicker.mini .control .drag-bar.first:before,.codemirror-colorpicker.mini .control .drag-bar2.first:after,.codemirror-colorpicker.mini .control .drag-bar2.first:before{left:3px}.codemirror-colorpicker.mini .control .drag-bar2:before,.codemirror-colorpicker.mini .control .drag-bar:before{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000;content:"";height:0;left:2px;position:absolute;top:0;transform:translateX(-50%);width:0}.codemirror-colorpicker.mini .control .drag-bar2:after,.codemirror-colorpicker.mini .control .drag-bar:after{border-bottom:4px solid #000;border-left:4px solid transparent;border-right:4px solid transparent;bottom:0;content:"";height:0;left:2px;position:absolute;transform:translateX(-50%);width:0}.codemirror-colorpicker.mini-vertical{display:inline-block;width:180px}.codemirror-colorpicker.mini-vertical .color{display:inline-block;height:160px;vertical-align:middle;width:140px}.codemirror-colorpicker.mini-vertical .control{display:inline-block;height:160px;padding:0;vertical-align:middle}.codemirror-colorpicker.mini-vertical .control .hue,.codemirror-colorpicker.mini-vertical .control .opacity{display:inline-block;height:100%;margin:0;padding:0;position:relative;vertical-align:middle;width:20px}.codemirror-colorpicker.mini-vertical .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.mini-vertical .control .opacity>.opacity-container{border-radius:0;height:100%;overflow:hidden;width:20px}.codemirror-colorpicker.mini-vertical .control .drag-bar,.codemirror-colorpicker.mini-vertical .control .drag-bar2{background-color:transparent;border:0;box-shadow:none;box-sizing:border-box;height:2px;transform:none;width:100%}.codemirror-colorpicker.mini-vertical .control .drag-bar.last:after,.codemirror-colorpicker.mini-vertical .control .drag-bar.last:before,.codemirror-colorpicker.mini-vertical .control .drag-bar2.last:after,.codemirror-colorpicker.mini-vertical .control .drag-bar2.last:before{top:2px}.codemirror-colorpicker.mini-vertical .control .drag-bar.first:after,.codemirror-colorpicker.mini-vertical .control .drag-bar.first:before,.codemirror-colorpicker.mini-vertical .control .drag-bar2.first:after,.codemirror-colorpicker.mini-vertical .control .drag-bar2.first:before{top:-1px}.codemirror-colorpicker.mini-vertical .control .drag-bar2:before,.codemirror-colorpicker.mini-vertical .control .drag-bar:before{border-bottom:4px solid transparent;border-left:4px solid #000;border-top:4px solid transparent;content:"";height:0;left:0;position:absolute;top:2px;transform:translateY(-50%);width:0}.codemirror-colorpicker.mini-vertical .control .drag-bar2:after,.codemirror-colorpicker.mini-vertical .control .drag-bar:after{border-bottom:4px solid transparent;border-right:4px solid #000;border-top:4px solid transparent;content:"";height:0;position:absolute;right:0;top:2px;transform:translateY(-50%);width:0}.codemirror-colorpicker.ring .colorpicker-body>.color{height:120px;left:52px;position:absolute;top:52px;width:120px}.codemirror-colorpicker.ring .colorpicker-body .wheel{box-sizing:border-box;height:224px;position:relative;width:224px}.codemirror-colorpicker.ring .colorpicker-body .wheel .wheel-canvas{border-radius:50%;height:214px;left:5px;position:absolute;top:5px;width:214px}.codemirror-colorpicker.ring .colorpicker-body .wheel .drag-pointer{border:1px solid #fff;border-radius:50%;display:inline-block;height:10px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:10px;z-index:2}.codemirror-colorpicker.ring .control{padding-top:0}.codemirror-colorpicker.ring .control .value{display:none}.codemirror-colorpicker.ring .control>.color,.codemirror-colorpicker.ring .control>.empty{border-radius:2px;height:30px;top:-17px;width:30px}.codemirror-colorpicker.ring .control.has-eyedropper{padding-left:30px;padding-top:10px}.codemirror-colorpicker.ring .control.has-eyedropper>.color,.codemirror-colorpicker.ring .control.has-eyedropper>.empty{top:-2px}.codemirror-colorpicker.ring .control.has-eyedropper .el-cp-color-control__left{top:4px}.codemirror-colorpicker.xd{display:inline-block;padding-top:12px;width:245px}.codemirror-colorpicker.xd .color{border:1px solid #cecece;border-radius:3px;box-sizing:border-box;display:inline-block;height:170px;margin-bottom:12px;margin-left:12px;overflow:hidden;vertical-align:middle;width:170px}.codemirror-colorpicker.xd .color>.saturation>.value>.drag-pointer{border:2px solid #fff;box-shadow:0 0 1px 0 #000,inset 0 0 1px 0 #000;height:7px;width:7px}.codemirror-colorpicker.xd .control{display:inline-block;height:170px;margin-bottom:12px;margin-right:12px;padding:0;vertical-align:middle}.codemirror-colorpicker.xd .control .hue,.codemirror-colorpicker.xd .control .opacity{border-radius:3px;display:inline-block;height:100%;margin:0 0 0 8px;overflow:hidden;padding:0;position:relative;vertical-align:middle;width:13px}.codemirror-colorpicker.xd .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.xd .control .opacity>.opacity-container{border-radius:0;height:100%;overflow:hidden}.codemirror-colorpicker.xd .control .drag-bar,.codemirror-colorpicker.xd .control .drag-bar2{background-color:transparent;border:2px solid #fff;box-shadow:0 0 1px 0 #000,inset 0 0 1px 0 #000;box-sizing:border-box;height:10px;left:50%;overflow:hidden;transform:none;transform:translateX(-50%) translateY(-50%);width:10px}.codemirror-colorpicker.xd .information{margin-top:5px}.codemirror-colorpicker.vscode{background-color:#333;border:1px solid #ececec;box-sizing:border-box;width:336px}.codemirror-colorpicker.vscode,.codemirror-colorpicker.vscode .colorpicker-body{border-radius:0;display:inline-block}.codemirror-colorpicker.vscode .colorpicker-body .color-view{height:34px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper{display:flex}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .color-view-container{display:inline-block;width:254px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left{float:right;padding:6px 0;text-align:center;width:80px}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left button{display:inline-block}.codemirror-colorpicker.vscode .colorpicker-body .color-view.has-eyedropper .el-cp-color-control__left button svg path{fill:#fff}.codemirror-colorpicker.vscode .colorpicker-body .color-view .color-view-container{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJElEQVQYV2NctWrVfwYkEBYWxojMZ6SDAmT7QGx0K1EcRBsFAADeG/3M/HteAAAAAElFTkSuQmCC) repeat;cursor:pointer;font-size:14px;height:100%;line-height:34px;text-align:center;text-shadow:0 0 3px #535353;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.codemirror-colorpicker.vscode .colorpicker-body .color-view .color-view-container .preview{display:block;height:100%}.codemirror-colorpicker.vscode .colorpicker-body .color-tool{padding:8px}.codemirror-colorpicker.vscode .color{display:inline-block;height:160px;vertical-align:middle;width:240px}.codemirror-colorpicker.vscode .control{display:inline-block;height:160px;padding:0 0 0 4px;vertical-align:middle}.codemirror-colorpicker.vscode .control .hue,.codemirror-colorpicker.vscode .control .opacity{display:inline-block;height:100%;margin:0;padding:0;position:relative;vertical-align:middle;width:30px}.codemirror-colorpicker.vscode .control .hue{padding-left:5px;width:35px}.codemirror-colorpicker.vscode .control .hue>.hue-container{background:linear-gradient(0deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);border-radius:0;height:100%}.codemirror-colorpicker.vscode .control .opacity>.opacity-container{border-radius:0;height:100%;width:30px}.codemirror-colorpicker.vscode .control .drag-bar,.codemirror-colorpicker.vscode .control .drag-bar2{background-color:transparent;border:1px solid #fff;border-radius:0;box-shadow:none;box-shadow:0 0 2px 0 #000,inset 0 0 0 0 #000;box-sizing:border-box;height:5px;transform:translateY(-50%) translateX(-2px);width:33px}.codemirror-colorpicker.box{border-radius:10px;width:420px}.codemirror-colorpicker.box .colorpicker-body{-moz-column-gap:10px;column-gap:10px;display:grid;grid-template-columns:200px 1fr;grid-template-rows:auto;padding:10px 20px 10px 10px}.codemirror-colorpicker.box .colorpicker-body>.color{border-radius:8px;height:100%;overflow:hidden}.codemirror-colorpicker.box .control{padding:0!important}.codemirror-colorpicker.box .control>*{vertical-align:middle}.codemirror-colorpicker.box .control .color-info{display:inline-block;height:30px;position:relative;width:30px}.codemirror-colorpicker.box .control .color-info>.color,.codemirror-colorpicker.box .control .color-info>.empty{border-radius:50%;box-sizing:border-box;height:100%;position:absolute;width:100%}.codemirror-colorpicker.box .control .color-info>.color{border:1px solid rgba(0,0,0,.1)}.codemirror-colorpicker.box .control>.color,.codemirror-colorpicker.box .control>.empty{top:4px}.codemirror-colorpicker.box .control.has-eyedropper{padding-left:30px}.codemirror-colorpicker.box .control.has-eyedropper .el-cp-color-control__left{display:inline-block;height:30px;left:auto;position:relative;top:auto;width:30px}.codemirror-colorpicker.box .control .hue,.codemirror-colorpicker.box .control .opacity{margin-left:0!important;padding-left:0!important;padding-right:0!important}.codemirror-colorpicker.box .value{box-sizing:border-box;cursor:pointer;position:relative}.codemirror-colorpicker.box .value>.value-container{background-image:linear-gradient(90deg,#000 0,hsla(0,0%,100%,0));border-radius:3px;box-sizing:border-box;height:10px;position:relative;width:100%}.codemirror-colorpicker.box .value>.value-container .drag-bar{border-radius:50%;cursor:pointer;height:12px;left:0;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:12px}.codemirror-colorpicker.box .information{margin-top:6px}.codemirror-colorpicker.box .information .information-change{display:none}.codemirror-colorpicker.box .information>.information-item{margin:0!important;padding:0!important}.codemirror-colorpicker.box .colorsets{border:0;position:relative}.codemirror-colorpicker.box .colorsets .color-list{margin-right:0!important;padding:0!important}.codemirror-colorpicker.box .colorsets .color-list .current-color-sets .color-item{height:20px;margin-bottom:4px!important;margin-right:4px!important;width:20px}.codemirror-colorpicker.box .colorsets .menu{float:none;position:absolute;right:-20px;top:-15px}.codemirror-colorpicker.box .color-chooser .color-chooser-container{left:200px;top:0}.colorsets-contextmenu{background-color:#ececec;border:1px solid #ccc;border-radius:6px;display:none;font-size:13px;list-style:none;padding:4px 0;position:fixed}.colorsets-contextmenu.show{display:inline-block}.colorsets-contextmenu .menu-item{cursor:default;padding:2px 20px}.colorsets-contextmenu .menu-item:hover{background-color:#5ea3fb;color:#fff}.colorsets-contextmenu.small .menu-item.small-hide{display:none}.el-cp-color-eyedropper button{background:none;border:none;border-radius:var(--size-radius);box-sizing:border-box;cursor:pointer;display:block;font-size:0;height:30px;margin:-4px;outline:none;padding:0;transition:box-shadow var(--speed-focus) ease-out,opacity var(--speed-focus) ease-out;width:30px}.el-cp-color-eyedropper button:focus-visible{box-shadow:0 0 0 2px var(--color-key)}.el-cp-color-eyedropper button:active{opacity:.5}.el-cp-color-eyedropper svg{color:var(--color-fill);display:block;margin:0 auto}
.CodeMirror{background-color:#fff;border:1px solid #dfdfdf;border-radius:3px;height:auto!important}.CodeMirror-code{outline:none}.CodeMirror-focused .cm-matchhighlight{color:#fff!important;outline:1px solid green}.CodeMirror-sizer:after,.CodeMirror-sizer:before{color:#bbb;display:block}.CodeMirror-sizer:before{content:"";padding-bottom:5px}.cm-s-rubyblue .CodeMirror-cursor{border-left:1px solid #fff!important}.CodeMirror-lint-marker-multiple,[class*=CodeMirror-lint-marker],[class*=CodeMirror-lint-message]{background-image:none}.CodeMirror-lint-marker-error,.CodeMirror-lint-marker-warning{cursor:help}.CodeMirror-lint-marker-multiple{position:absolute;top:0}[class*=CodeMirror-lint-marker]:before{font:normal 18px/1 dashicons;position:relative;top:-2px}[class*=CodeMirror-lint-message]:before{font:normal 16px/1 dashicons;left:16px;position:absolute}.CodeMirror-lint-message-error,.CodeMirror-lint-message-warning{box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 0 2px;padding:3px 12px 3px 28px}.CodeMirror-lint-message-warning{background-color:#fff8e5;border-left:4px solid #ffb900}.CodeMirror-lint-marker-warning:before,.CodeMirror-lint-message-warning:before{color:#f6a306;content:""}.CodeMirror-lint-message-error{background-color:#fbeaea;border-left:4px solid #dc3232}.CodeMirror-lint-marker-error:before,.CodeMirror-lint-message-error:before{color:#dc3232;content:""}.CodeMirror-lint-tooltip{background:none;border:none;border-radius:0;direction:ltr}.CodeMirror .CodeMirror-matchingbracket{background:rgba(255,150,0,.3);color:inherit}.CodeMirror .CodeMirror-linenumber{color:#666}.CodeMirror-foldmarker{color:inherit;font-weight:700;margin-left:.25em;margin-right:.25em}p.submit{display:flex;justify-content:space-between}.settings-section,p.submit{max-width:1020px}.nav-tab-wrapper{margin-bottom:1em}input[type=number]{width:4em}.CodeMirror{max-width:800px;padding-right:1em;width:100%}.CodeMirror-sizer:before{content:"<?php"}body.no-js .nav-tab-wrapper{display:none}body.no-js .settings-section{display:block!important}body.js .settings-section-title{border:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal!important}body.js .nav-tab:not(.nav-tab-active){cursor:pointer}body.js .settings-section{display:none}body.js .wrap[data-active-tab=debug] .debug-settings,body.js .wrap[data-active-tab=editor] .editor-settings,body.js .wrap[data-active-tab=general] .general-settings{display:block}.license-status{color:#aaa;display:inline-block;line-height:2;padding-right:2em}.license-status-valid{color:#2ecc40}.license-status-expired{color:#dc3232}.wrap[data-active-tab=license] .submit{display:none}#code_snippets_remove_license{border-color:#b32d2e;color:#b32d2e}#code_snippets_license_key{font-family:Consolas,Monaco,monospace}#cloud_token{max-width:450px;width:90vw}.cloud-message{border-radius:5px;font-weight:600;padding:5px;width:-moz-fit-content;width:fit-content}.cloud-error{background:#e53935;color:#ffebee}.cloud-success{background:#43a047;color:#e8f5e9}.refresh-success{background:#2271b1;color:#ffeb3b}.cloud-settings tbody tr:nth-child(n+5){display:none}
dist/settings.js 0000644 00000012610 15153464547 0007723 0 ustar 00 "use strict";(self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[6472],{6658:(e,t,r)=>{var n=r(2284),o=r(5501),i=r(3662);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(){c=function(e,t){return new r(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function r(e,n,o){var a=RegExp(e,n);return t.set(a,o||t.get(e)),(0,i.A)(a,r.prototype)}function a(e,r){var n=t.get(r);return Object.keys(n).reduce((function(t,r){var o=n[r];if("number"==typeof o)t[r]=e[o];else{for(var i=0;void 0===e[o[i]]&&i+1<o.length;)i++;t[r]=e[o[i]]}return t}),Object.create(null))}return(0,o.A)(r,RegExp),r.prototype.exec=function(t){var r=e.exec.call(this,t);if(r){r.groups=a(r,this);var n=r.indices;n&&(n.groups=a(n,this))}return r},r.prototype[Symbol.replace]=function(r,o){if("string"==typeof o){var i=t.get(this);return e[Symbol.replace].call(this,r,o.replace(/\$<([^>]+)>/g,(function(e,t){var r=i[t];return"$"+(Array.isArray(r)?r.join("$"):r)})))}if("function"==typeof o){var c=this;return e[Symbol.replace].call(this,r,(function(){var e=arguments;return"object"!=(0,n.A)(e[e.length-1])&&(e=[].slice.call(e)).push(a(e,c)),o.apply(this,e)}))}return e[Symbol.replace].call(this,r,o)},c.apply(this,arguments)}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}r(2949),function(){var e=document.getElementById("settings-sections-tabs");if(e){var t,r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){u=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}(e.querySelectorAll(".nav-tab"));try{var n=function(){var r=t.value;r.addEventListener("click",(function(t){t.preventDefault();var n=r.getAttribute("data-section");n&&(function(e,t,r){var n,o;null===(n=e.querySelector(".nav-tab-active"))||void 0===n||n.classList.remove("nav-tab-active"),t.classList.add("nav-tab-active"),null===(o=e.closest(".wrap"))||void 0===o||o.setAttribute("data-active-tab",r)}(e,r,n),function(e){var t;"editor"===e&&(null===(t=window.code_snippets_editor_preview)||void 0===t||t.codemirror.refresh())}(n),function(e){var t=document.querySelector("input[name=_wp_http_referer]");if(t){var r=t.value.replace(c(/([&?]section=)[^&]+/,{base:1}),"$1".concat(e));t.value=r+(r===t.value?"§ion=".concat(e):"")}else console.error("could not find http referer")}(n))}))};for(r.s();!(t=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}else console.error("Could not find snippets tabs")}(),function(){var e,t=function(){var e=window.wp.codeEditor,t=document.getElementById("code_snippets_editor_preview");if(t)return window.code_snippets_editor_preview=e.initialize(t),window.code_snippets_editor_preview.codemirror;console.error("Could not initialise CodeMirror on textarea.",t)}(),r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}(window.code_snippets_editor_settings);try{var n=function(){var r=e.value,n=document.querySelector('[name="code_snippets_settings[editor]['.concat(r.name,']"]'));null==n||n.addEventListener("change",(function(){var e=r.codemirror,o=function(){switch(r.type){case"select":return(e=n).options[e.selectedIndex].value;case"checkbox":return n.checked;case"number":return parseInt(n.value,10);default:return null}var e}();null!==o&&(null==t||t.setOption(e,o))}))};for(r.s();!(e=r.n()).done;)n()}catch(e){r.e(e)}finally{r.f()}}()},5501:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(3662);function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,n.A)(e,t)}},3662:(e,t,r)=>{function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}r.d(t,{A:()=>n})}},e=>{e(e.s=6658)}]); dist/welcome.css 0000644 00000017405 15153464547 0007701 0 ustar 00 .button .badge,.go-pro-button .badge,.nav-tab .badge,.snippet-type-badge{border:1px solid;border-radius:5px;font-size:10px;padding:1px 2px;text-transform:uppercase}.button .snippet-type-badge,.go-pro-button .badge,.nav-tab .badge,h1 .snippet-type-badge,h2 .snippet-type-badge,h3 .snippet-type-badge{margin-left:3px}.button .badge{font-size:8px;text-transform:lowercase}.nav-tab .badge,.nav-tab span{vertical-align:middle}.nav-tab[data-snippet-type=php] .badge,.snippet-type-badge[data-snippet-type=php]{border-color:currentColor;color:#0073aa}.nav-tab-inactive[data-snippet-type=php]:hover .badge{color:#0073aa}.nav-tab[data-snippet-type=css] .badge,.snippet-type-badge[data-snippet-type=css]{border-color:currentColor;color:#8000ff}.nav-tab-inactive[data-snippet-type=css]:hover .badge{color:#8000ff}.nav-tab[data-snippet-type=js] .badge,.snippet-type-badge[data-snippet-type=js]{border-color:currentColor;color:#cd6600}.nav-tab-inactive[data-snippet-type=js]:hover .badge{color:#cd6600}.nav-tab[data-snippet-type=html] .badge,.snippet-type-badge[data-snippet-type=html]{border-color:currentColor;color:#548b54}.nav-tab-inactive[data-snippet-type=html]:hover .badge{color:#548b54}.nav-tab-button .dashicons-external{color:#666;font-size:15px;vertical-align:middle}.nav-tab.nav-tab-inactive{background:transparent;text-shadow:0 1px 0 #fff}.nav-tab.nav-tab-inactive,.nav-tab.nav-tab-inactive .badge{color:#a7aaad}.nav-tab.nav-tab-inactive:hover{color:#50575e}.core-badge,.go-pro-badge,.pro-badge{border:1px solid;border-radius:5px;font-size:10px;margin-left:3px;padding:1px 2px;text-transform:uppercase}.go-pro-badge,.pro-badge{color:#ce0000}.core-badge{color:#0073aa}.go-pro-badge,.go-pro-button .badge{border-color:#ce0000;color:#ce0000;margin-left:1px}.wp-core-ui .button.nav-tab-button{background:#f6f7f7;border-color:#f6f7f7;color:#a7aaad;float:right;margin-left:.5em}.wp-core-ui .button.nav-tab-button:hover{background-color:#fff;color:#3c434a}.csp-welcome-wrap{padding:25px}.csp-welcome-wrap h1,.csp-welcome-wrap h2,.csp-welcome-wrap h3{font-weight:700;margin-bottom:10px;margin-top:10px}.csp-welcome-wrap h1 .dashicons,.csp-welcome-wrap h2 .dashicons,.csp-welcome-wrap h3 .dashicons{font-size:90%;line-height:inherit;width:auto}.csp-welcome-wrap h1{font-size:1.6rem}.csp-welcome-wrap h2{font-size:1.4rem}.csp-welcome-wrap .dashicons-external{color:#666;float:right}.csp-welcome-header{align-items:center;display:flex;flex-flow:row wrap;justify-content:space-between}.csp-welcome-header .csp-welcome-logo{align-items:center;display:flex;flex-direction:row;gap:10px}.csp-welcome-header .csp-welcome-logo h1{font-size:1.4rem;font-weight:700;line-height:1;margin:0}.csp-welcome-header .csp-welcome-logo h1 span{-webkit-text-decoration:underline #03c7d2 wavy 3px;text-decoration:underline #03c7d2 wavy 3px;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none;text-transform:capitalize;text-underline-offset:11px}.csp-welcome-nav{-moz-column-gap:15px;column-gap:15px;display:flex;flex-flow:row wrap;justify-content:space-evenly;margin:0}.csp-welcome-nav li{margin-bottom:0}.csp-welcome-nav li a{align-items:center;border-radius:3px;border-style:solid;border-width:1px;color:#fff;cursor:pointer;display:flex;font-weight:400;gap:3px;margin-bottom:10px;margin-top:10px;padding:8px;text-decoration:none;transition:all .1s ease-in-out}.csp-welcome-nav li a:hover{background:transparent}.csp-welcome-nav li a .dashicons,.csp-welcome-nav li a svg{margin-left:3px;margin-top:-1px;text-decoration:none}.csp-welcome-nav li a svg{fill:#fff;font-size:20px;height:20px;vertical-align:top;width:20px}.csp-welcome-nav li a:hover svg{fill:currentColor}.csp-welcome-nav .csp-link-pro{background:#d46f4d;border-color:#d46f4d}.csp-welcome-nav .csp-link-pro:hover{color:#d46f4d}.csp-welcome-nav .csp-link-cloud{background:#08c5d1;border-color:#08c5d1}.csp-welcome-nav .csp-link-cloud:hover{color:#08c5d1}.csp-welcome-nav .csp-link-resources{background:#424242;border-color:#424242}.csp-welcome-nav .csp-link-resources:hover{color:#424242}.csp-welcome-nav .csp-link-discord{background:#5865f2;border-color:#5865f2}.csp-welcome-nav .csp-link-discord:hover{color:#5865f2}.csp-welcome-nav .csp-link-facebook{background:#3b5998;border-color:#3b5998}.csp-welcome-nav .csp-link-facebook:hover{color:#3b5998}.csp-cards{display:grid;grid-auto-rows:1fr;grid-template-columns:repeat(4,1fr);row-gap:40px;gap:15px}@media(max-width:1060px){.csp-cards{grid-template-columns:1fr!important}}.csp-card{background:#fff;border:1px solid #9e9e9e;border-radius:10px;display:flex;flex-flow:column}a.csp-card{text-decoration:none}a.csp-card:hover{background:#effeff;box-shadow:0 1px 1px hsla(0,0%,100%,.5);transition:background-color .5s}a.csp-card:hover .dashicons-external{color:#000}.csp-section-changes{border:1px solid #9e9e9e;border-left:0;border-right:0;display:flex;flex-direction:column;margin-top:30px;padding:40px 0 50px;row-gap:20px}.csp-section-changes .csp-cards{gap:20px;grid-template-columns:2fr 1fr}.csp-section-changes .csp-card{box-shadow:0 1px 1px rgba(0,0,0,.05);padding:20px}.csp-section-changes .csp-card h2{color:#03c7d2}.csp-section-changes .csp-card:last-child{overflow-y:scroll}.csp-section-changes .csp-section-changelog{color:#333;font-size:.9rem;height:400px;line-height:1.5}.csp-section-changes .csp-section-changelog h3{color:#666;float:right}.csp-section-changes .csp-section-changelog h4{margin:30px 0 10px}.csp-section-changes .csp-section-changelog ul{margin-top:5px}.csp-section-changes .csp-section-changelog li{align-items:baseline;display:grid;gap:7px;grid-template-columns:40px 1fr;grid-template-rows:1fr}.csp-section-changes .csp-section-changelog li .badge{text-align:center}.csp-section-changes .csp-section-changelog>article:after{border-bottom:1px solid #666;content:" ";display:block;margin:3em auto 0;width:50%}.csp-section-changes .csp-section-changelog>article:last-child{padding-bottom:1px}.csp-section-changes .csp-section-changelog>article:last-child:after{border:0}.csp-section-changes figure{background:#646970;border:1px solid gray;border-radius:.5rem;height:auto;margin:1em 0 0;overflow:hidden;position:relative}.csp-section-changes figure img{height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden;width:100%}.csp-section-changes .dashicons-lightbulb{color:#f1c40f}.csp-section-changes .dashicons-chart-line{color:#85144b}.csp-section-changes .dashicons-buddicons-replies{color:#3d9970}.csp-section-articles figure img{aspect-ratio:1}.csp-section-links{padding:40px 0 50px}.csp-section-links .csp-card{color:#000;justify-content:flex-start;margin-top:20px;overflow:hidden;padding:1rem;position:relative;row-gap:10px;width:85%}.csp-section-links .csp-card header{flex:1}.csp-section-links .csp-card figure{margin:1em 0 0}.csp-section-links .csp-card figure img{border-radius:5px;height:100%;max-height:300px;-o-object-fit:cover;object-fit:cover;overflow:hidden;width:100%}.csp-section-links .csp-card .csp-card-item-category{background:#d46f4d;border-radius:50px;color:#fff;display:block;font-size:.9rem;letter-spacing:1px;margin-bottom:0;margin-top:0;padding:5px 15px;text-transform:uppercase;width:-moz-fit-content;width:fit-content}.csp-section-links .csp-card h3{color:#03c7d2;font-size:1.7rem;line-height:normal}.csp-section-links .csp-card .csp-card-item-description{color:#51525c;font-size:1rem;font-weight:300}.csp-section-links .csp-card footer{align-items:center;display:flex;flex-direction:row;justify-content:space-between}.csp-section-articles h2{font-size:1.1rem}.csp-section-partners{border-top:1px solid #9e9e9e}.csp-section-partners header{align-items:center;display:flex;flex-direction:row-reverse;justify-content:space-between}.csp-loading-spinner{animation:loading-rotate 1s linear infinite;border:6px solid #e7c0b3;border-radius:22px;border-right-color:#d46f4d;height:0;left:47%;padding:15px;position:absolute;top:45%;width:0}@keyframes loading-rotate{to{transform:rotate(1turn)}}
js/components/SnippetForm/SnippetEditor/CodeEditor.tsx 0000644 00000003231 15153464547 0017202 0 ustar 00 import React, { useEffect, useRef } from 'react'
import { isMacOS } from '../../../utils/general'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import { CodeEditorShortcuts } from './CodeEditorShortcuts'
export const CodeEditor: React.FC = () => {
const { snippet, setSnippet, codeEditorInstance, setCodeEditorInstance, submitSnippet } = useSnippetForm()
const textareaRef = useRef<HTMLTextAreaElement>(null)
useEffect(() => {
setCodeEditorInstance(editorInstance => {
if (textareaRef.current && !editorInstance) {
editorInstance = window.wp.codeEditor.initialize(textareaRef.current)
editorInstance.codemirror.on('changes', instance => {
setSnippet(previous => ({ ...previous, code: instance.getValue() }))
})
}
return editorInstance
})
}, [setCodeEditorInstance, textareaRef, setSnippet])
useEffect(() => {
if (codeEditorInstance) {
const extraKeys = codeEditorInstance.codemirror.getOption('extraKeys')
const controlKey = isMacOS() ? 'Cmd' : 'Ctrl'
codeEditorInstance.codemirror.setOption('extraKeys', {
...'object' === typeof extraKeys ? extraKeys : undefined,
[`${controlKey}-S`]: submitSnippet,
[`${controlKey}-Enter`]: submitSnippet
})
}
}, [submitSnippet, codeEditorInstance, snippet])
return (
<div className="snippet-editor">
<textarea
ref={textareaRef}
id="snippet_code"
name="snippet_code"
rows={200}
spellCheck={false}
onChange={event => {
setSnippet(previous => ({ ...previous, code: event.target.value }))
}}
>{snippet.code}</textarea>
<CodeEditorShortcuts editorTheme={window.CODE_SNIPPETS_EDIT?.editorTheme ?? 'default'} />
</div>
)
}
js/components/SnippetForm/SnippetEditor/CodeEditorShortcuts.tsx 0000644 00000005500 15153464547 0021122 0 ustar 00 import { __, _x } from '@wordpress/i18n'
import classnames from 'classnames'
import React from 'react'
import { KEYBOARD_KEYS } from '../../../types/KeyboardShortcut'
import { isMacOS } from '../../../utils/general'
import type { KeyboardKey, KeyboardShortcut } from '../../../types/KeyboardShortcut'
const shortcuts: Record<string, KeyboardShortcut> = {
saveChanges: {
label: __('Save changes', 'code-snippets'),
mod: 'Cmd',
key: 'S'
},
selectAll: {
label: __('Select all', 'code-snippets'),
mod: 'Cmd',
key: 'A'
},
beginSearch: {
label: __('Begin searching', 'code-snippets'),
mod: 'Cmd',
key: 'F'
},
findNext: {
label: __('Find next', 'code-snippets'),
mod: 'Cmd',
key: 'G'
},
findPrevious: {
label: __('Find previous', 'code-snippets'),
mod: ['Shift', 'Cmd'],
key: 'G'
},
replace: {
label: __('Replace', 'code-snippets'),
mod: ['Shift', 'Cmd'],
key: 'F'
},
replaceAll: {
label: __('Replace all', 'code-snippets'),
mod: ['Shift', 'Cmd', 'Option'],
key: 'R'
},
search: {
label: __('Persistent search', 'code-snippets'),
mod: 'Alt',
key: 'F'
},
toggleComment: {
label: __('Toggle comment', 'code-snippets'),
mod: 'Cmd',
key: '/'
},
swapLineUp: {
label: __('Swap line up', 'code-snippets'),
mod: 'Option',
key: 'Up'
},
swapLineDown: {
label: __('Swap line down', 'code-snippets'),
mod: 'Option',
key: 'Down'
},
autoIndent: {
label: __('Auto-indent current line or selection', 'code-snippets'),
mod: 'Shift',
key: 'Tab'
}
}
const SEP = _x('-', 'keyboard shortcut separator', 'code-snippets')
const ModifierKey: React.FC<{ modifier: KeyboardKey }> = ({ modifier }) => {
switch (modifier) {
case 'Ctrl':
case 'Cmd':
return (
<>
<kbd className="pc-key">{KEYBOARD_KEYS.Ctrl}</kbd>
<kbd className="mac-key">{KEYBOARD_KEYS.Cmd}</kbd>
{SEP}
</>
)
case 'Option':
return (
<span className="mac-key">
<kbd className="mac-key">{KEYBOARD_KEYS.Option}</kbd>{SEP}
</span>
)
default:
return <><kbd>{KEYBOARD_KEYS[modifier]}</kbd>{SEP}</>
}
}
export interface CodeEditorShortcutsProps {
editorTheme: string
}
export const CodeEditorShortcuts: React.FC<CodeEditorShortcutsProps> = ({ editorTheme }) =>
<div className="snippet-editor-help">
<div className={`editor-help-tooltip cm-s-${editorTheme}`}>
{_x('?', 'help tooltip', 'code-snippets')}
</div>
<div className={classnames('editor-help-text', { 'platform-mac': isMacOS() })}>
<table>
{Object.entries(shortcuts).map(([name, { label, mod, key }]) =>
<tr key={name}>
<td>{label}</td>
<td>
{(Array.isArray(mod) ? mod : [mod]).map(modifier =>
<span key={modifier}>
<ModifierKey modifier={modifier} />
</span>
)}
<kbd>{KEYBOARD_KEYS[key]}</kbd>
</td>
</tr>
)}
</table>
</div>
</div>
js/components/SnippetForm/SnippetEditor/SnippetEditor.tsx 0000644 00000010324 15153464547 0017753 0 ustar 00 import React, { useEffect } from 'react'
import { __, _x } from '@wordpress/i18n'
import { addQueryArgs } from '@wordpress/url'
import classnames from 'classnames'
import { SNIPPET_TYPES, SNIPPET_TYPE_SCOPES } from '../../../types/Snippet'
import '../../../editor'
import { isLicensed } from '../../../utils/general'
import { getSnippetType, isProType } from '../../../utils/snippets'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import { CodeEditor } from './CodeEditor'
import type { SnippetScope, SnippetType } from '../../../types/Snippet'
import type { Editor, EditorConfiguration } from 'codemirror'
interface SnippetTypeTabProps {
tabType: SnippetType
label: string
currentType: SnippetType
updateScope: (scope: SnippetScope) => void
openUpgradeDialog: VoidFunction
}
const SnippetTypeTab: React.FC<SnippetTypeTabProps> = ({
tabType,
label,
currentType,
updateScope,
openUpgradeDialog
}) =>
<a
data-snippet-type={tabType}
className={classnames({
'nav-tab': true,
'nav-tab-active': tabType === currentType,
'nav-tab-inactive': isProType(tabType) && !isLicensed()
})}
{...isProType(tabType) && !isLicensed()
? {
title: __('Learn more about Code Snippets Pro.', 'code-snippets'),
href: 'https://codesnippets.pro/pricing/',
target: '_blank',
onClick: event => {
event.preventDefault()
openUpgradeDialog()
}
}
: {
href: addQueryArgs(window.location.href, { type: tabType }),
onClick: event => {
event.preventDefault()
const scope = SNIPPET_TYPE_SCOPES[tabType][0]
updateScope(scope)
}
}
}>
{`${label} `}
<span className="badge">{tabType}</span>
</a>
export const TYPE_LABELS: Record<SnippetType, string> = {
php: __('Functions', 'code-snippets'),
html: __('Content', 'code-snippets'),
css: __('Styles', 'code-snippets'),
js: __('Scripts', 'code-snippets')
}
const EDITOR_MODES: Partial<Record<SnippetType, string>> = {
css: 'text/css',
js: 'javascript',
php: 'text/x-php',
html: 'application/x-httpd-php'
}
interface SnippetTypeTabsProps {
codeEditor: Editor
snippetType: SnippetType
updateScope: (scope: SnippetScope) => void
openUpgradeDialog: VoidFunction
}
const SnippetTypeTabs: React.FC<SnippetTypeTabsProps> = ({
codeEditor,
updateScope,
snippetType,
openUpgradeDialog
}) => {
useEffect(() => {
codeEditor.setOption('lint' as keyof EditorConfiguration, 'php' === snippetType || 'css' === snippetType)
if (snippetType in EDITOR_MODES) {
codeEditor.setOption('mode', EDITOR_MODES[snippetType])
codeEditor.refresh()
}
}, [codeEditor, snippetType])
return (
<h2 className="nav-tab-wrapper" id="snippet-type-tabs">
{SNIPPET_TYPES.map(type =>
<SnippetTypeTab
key={type}
tabType={type}
label={TYPE_LABELS[type]}
currentType={snippetType}
updateScope={updateScope}
openUpgradeDialog={openUpgradeDialog}
/>)}
{!isLicensed()
? <a
className="button button-large nav-tab-button nav-tab-inactive go-pro-button"
href="https://codesnippets.pro/pricing/"
title="Find more about Pro"
onClick={event => {
event.preventDefault()
openUpgradeDialog()
}}
>
{_x('Upgrade to ', 'Upgrade to Pro', 'code-snippets')}
<span className="badge">{_x('Pro', 'Upgrade to Pro', 'code-snippets')}</span>
</a>
: null}
</h2>
)
}
export interface SnippetEditorProps {
openUpgradeDialog: VoidFunction
}
export const SnippetEditor: React.FC<SnippetEditorProps> = ({ openUpgradeDialog }) => {
const { snippet, setSnippet, codeEditorInstance } = useSnippetForm()
const snippetType = getSnippetType(snippet)
return (
<div className="snippet-code-container">
<h2>
<label htmlFor="snippet_code">
{`${__('Code', 'code-snippets')} `}
{snippet.id
? <span className="snippet-type-badge" data-snippet-type={snippetType}>{snippetType}</span>
: null}
</label>
</h2>
{snippet.id || window.CODE_SNIPPETS_EDIT?.isPreview || !codeEditorInstance
? ''
: <SnippetTypeTabs
snippetType={snippetType}
codeEditor={codeEditorInstance.codemirror}
openUpgradeDialog={openUpgradeDialog}
updateScope={scope => {
setSnippet(previous => ({ ...previous, scope }))
}}
/>}
<CodeEditor />
</div>
)
}
js/components/SnippetForm/SnippetEditor/SnippetEditorToolbar.tsx 0000644 00000002235 15153464547 0021300 0 ustar 00 import React from 'react'
import { Spinner } from '@wordpress/components'
import { __, isRTL } from '@wordpress/i18n'
import { SubmitButton } from '../buttons/SubmitButtons'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
const InlineActionButtons: React.FC = () => {
const { isWorking } = useSnippetForm()
return (
<>
{isWorking ? <Spinner /> : ''}
<SubmitButton inlineButtons />
</>
)
}
const RTLControl: React.FC = () => {
const { codeEditorInstance } = useSnippetForm()
return (
<>
<label htmlFor="snippet-code-direction" className="screen-reader-text">
{__('Code Direction', 'code-snippets')}
</label>
<select id="snippet-code-direction" onChange={event =>
codeEditorInstance?.codemirror.setOption('direction', 'rtl' === event.target.value ? 'rtl' : 'ltr')
}>
<option value="ltr">{__('LTR', 'code-snippets')}</option>
<option value="rtl">{__('RTL', 'code-snippets')}</option>
</select>
</>
)
}
export const SnippetEditorToolbar: React.FC = () =>
<div className="submit-inline">
{window.CODE_SNIPPETS_EDIT?.extraSaveButtons ? <InlineActionButtons /> : null}
{isRTL() ? <RTLControl /> : null}
</div>
js/components/SnippetForm/SnippetForm.tsx 0000644 00000004401 15153464547 0014636 0 ustar 00 import React, { useState } from 'react'
import classnames from 'classnames'
import { isNetworkAdmin } from '../../utils/general'
import { createEmptySnippet, getSnippetType } from '../../utils/snippets'
import { WithSnippetFormContext, useSnippetForm } from '../../hooks/useSnippetForm'
import { ActionButtons } from './buttons/ActionButtons'
import { UpgradeDialog } from './page/UpgradeDialog'
import { DescriptionEditor } from './fields/DescriptionEditor'
import { MultisiteSharingSettings } from './fields/MultisiteSharingSettings'
import { NameInput } from './fields/NameInput'
import { PriorityInput } from './fields/PriorityInput'
import { ScopeInput } from './fields/ScopeInput'
import { TagsInput } from './fields/TagsInput'
import { Notices } from './page/Notices'
import { PageHeading } from './page/PageHeading'
import { SnippetEditor } from './SnippetEditor/SnippetEditor'
import { SnippetEditorToolbar } from './SnippetEditor/SnippetEditorToolbar'
const OPTIONS = window.CODE_SNIPPETS_EDIT
const EditForm: React.FC = () => {
const [isUpgradeDialogOpen, setIsUpgradeDialogOpen] = useState(false)
const { snippet, isReadOnly } = useSnippetForm()
return (
<div className="wrap">
<PageHeading />
<Notices />
<div id="snippet-form" className={classnames(
'snippet-form',
`${snippet.scope}-snippet`,
`${getSnippetType(snippet.scope)}-snippet`,
`${snippet.id ? 'saved' : 'new'}-snippet`,
`${snippet.active ? 'active' : 'inactive'}-snippet`,
{
'erroneous-snippet': !!snippet.code_error,
'read-only-snippet': isReadOnly
}
)}>
<NameInput />
<SnippetEditorToolbar />
<SnippetEditor openUpgradeDialog={() => setIsUpgradeDialogOpen(true)} />
<div className="below-snippet-editor">
<ScopeInput />
<PriorityInput />
</div>
{isNetworkAdmin() ? <MultisiteSharingSettings /> : null}
{OPTIONS?.enableDescription ? <DescriptionEditor /> : null}
{OPTIONS?.tagOptions.enabled ? <TagsInput /> : null}
<ActionButtons />
</div>
<UpgradeDialog isOpen={isUpgradeDialogOpen} setIsOpen={setIsUpgradeDialogOpen} />
</div>
)
}
export const SnippetForm: React.FC = () =>
<WithSnippetFormContext initialSnippet={() => OPTIONS?.snippet ?? createEmptySnippet()}>
<EditForm />
</WithSnippetFormContext>
js/components/SnippetForm/buttons/ActionButtons.tsx 0000644 00000001066 15153464547 0016666 0 ustar 00 import React from 'react'
import { Spinner } from '@wordpress/components'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import { DeleteButton } from './DeleteButton'
import { ExportButtons } from './ExportButtons'
import { SubmitButton } from './SubmitButtons'
export const ActionButtons: React.FC = () => {
const { snippet, isWorking } = useSnippetForm()
return (
<p className="submit">
<SubmitButton />
{snippet.id
? <>
<ExportButtons />
<DeleteButton />
</>
: ''}
{isWorking ? <Spinner /> : ''}
</p>
)
}
js/components/SnippetForm/buttons/DeleteButton.tsx 0000644 00000003122 15153464547 0016463 0 ustar 00 import { addQueryArgs } from '@wordpress/url'
import React, { useState } from 'react'
import { __ } from '@wordpress/i18n'
import { Button } from '../../common/Button'
import { ConfirmDialog } from '../../common/ConfirmDialog'
import { useSnippetsAPI } from '../../../hooks/useSnippets'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
export const DeleteButton: React.FC = () => {
const api = useSnippetsAPI()
const { snippet, setIsWorking, isWorking, handleRequestError } = useSnippetForm()
const [isDialogOpen, setIsDialogOpen] = useState(false)
return (
<>
<Button
name="delete_snippet"
onClick={() => setIsDialogOpen(true)}
disabled={isWorking}
>
{__('Delete', 'code-snippets')}
</Button>
<ConfirmDialog
open={isDialogOpen}
title={__('Permanently delete?', 'code-snippets')}
confirmLabel={__('Delete', 'code-snippets')}
confirmButtonClassName="is-destructive"
onCancel={() => setIsDialogOpen(false)}
onConfirm={() => {
setIsDialogOpen(false)
setIsWorking(true)
api.delete(snippet)
.then(() => {
setIsWorking(false)
window.location.replace(addQueryArgs(window.CODE_SNIPPETS?.urls.manage, { result: 'deleted' }))
})
.catch((error: unknown) => handleRequestError(error, __('Could not delete snippet.', 'code-snippets')))
}}
>
<p>
{__('You are about to permanently delete this snippet.', 'code-snippets')}{' '}
{__('Are you sure?', 'code-snippets')}
</p>
<p><strong>{__('This action cannot be undone.', 'code-snippets')}</strong></p>
</ConfirmDialog>
</>
)
}
js/components/SnippetForm/buttons/ExportButtons.tsx 0000644 00000003435 15153464547 0016734 0 ustar 00 import React from 'react'
import { __ } from '@wordpress/i18n'
import { Button } from '../../common/Button'
import { useSnippetsAPI } from '../../../hooks/useSnippets'
import { downloadSnippetExportFile } from '../../../utils/files'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import type { SnippetsExport } from '../../../types/SnippetsExport'
import type { AxiosResponse } from 'axios'
export const ExportButtons: React.FC = () => {
const api = useSnippetsAPI()
const { snippet, isWorking, setIsWorking, handleRequestError } = useSnippetForm()
const handleFileResponse = (response: AxiosResponse<string | SnippetsExport>) => {
const data = response.data
setIsWorking(false)
console.info('file response', response)
if ('string' === typeof data) {
downloadSnippetExportFile(data, snippet)
} else {
const JSON_INDENT_SPACES = 2
downloadSnippetExportFile(JSON.stringify(data, undefined, JSON_INDENT_SPACES), snippet, 'json')
}
}
return (
<>
<Button
name="export_snippet"
onClick={() => {
setIsWorking(true)
api.export(snippet)
.then(handleFileResponse)
// translators: %s: error message.
.catch((error: unknown) => handleRequestError(error, __('Could not download export file.', 'code-snippets')))
}}
disabled={isWorking}
>
{__('Export', 'code-snippets')}
</Button>
{window.CODE_SNIPPETS_EDIT?.enableDownloads
? <Button
name="export_snippet_code"
onClick={() => {
api.exportCode(snippet)
.then(handleFileResponse)
// translators: %s: error message.
.catch((error: unknown) => handleRequestError(error, __('Could not download file.', 'code-snippets')))
}}
disabled={isWorking}
>
{__('Export Code', 'code-snippets')}
</Button>
: ''}
</>
)
}
js/components/SnippetForm/buttons/SubmitButtons.tsx 0000644 00000013264 15153464547 0016717 0 ustar 00 import React, { useState } from 'react'
import { __ } from '@wordpress/i18n'
import { handleUnknownError } from '../../../utils/errors'
import { Button } from '../../common/Button'
import { ConfirmDialog } from '../../common/ConfirmDialog'
import { isNetworkAdmin } from '../../../utils/general'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import type { Snippet } from '../../../types/Snippet'
import type { ButtonProps } from '../../common/Button'
interface SubmitButtonProps extends ButtonProps {
inlineButtons?: boolean
}
const SaveChangesButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...props }) =>
<Button
name="save_snippet"
type="submit"
small={inlineButtons}
title={inlineButtons ? __('Save Snippet', 'code-snippets') : undefined}
{...props}
>
{__('Save Changes', 'code-snippets')}
</Button>
const SaveAndExecuteButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...props }) =>
<Button
name="save_snippet_execute"
title={inlineButtons ? __('Save Snippet and Execute Once', 'code-snippets') : undefined}
{...props}
>
{inlineButtons
? __('Execute Once', 'code-snippets')
: __('Save Changes and Execute Once', 'code-snippets')}
</Button>
const DeactivateButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...props }) =>
<Button
name="save_snippet_deactivate"
title={inlineButtons ? __('Save Snippet and Deactivate', 'code-snippets') : undefined}
{...props}
>
{inlineButtons
? __('Deactivate', 'code-snippets')
: __('Save Changes and Deactivate', 'code-snippets')}
</Button>
const ActivateButton: React.FC<SubmitButtonProps> = ({ inlineButtons, ...props }) =>
<Button
name="save_snippet_activate"
title={inlineButtons ? __('Save Snippet and Activate', 'code-snippets') : undefined}
{...props}
>
{inlineButtons
? __('Activate', 'code-snippets')
: __('Save Changes and Activate', 'code-snippets')}
</Button>
interface ActivateOrDeactivateButtonProps {
snippet: Snippet
onActivate: VoidFunction
onDeactivate: VoidFunction
primaryActivate: boolean
inlineButtons?: boolean
disabled: boolean
}
const ActivateOrDeactivateButton: React.FC<ActivateOrDeactivateButtonProps> = ({
snippet,
disabled,
onActivate,
onDeactivate,
inlineButtons,
primaryActivate
}) => {
const commonProps: SubmitButtonProps = { small: inlineButtons, type: 'submit', disabled, inlineButtons }
switch (true) {
case snippet.shared_network && isNetworkAdmin():
return null
case 'single-use' === snippet.scope:
return <SaveAndExecuteButton onClick={onActivate} {...commonProps} />
case snippet.active:
return <DeactivateButton onClick={onDeactivate} {...commonProps} />
default:
case !snippet.active:
return <ActivateButton onClick={onActivate} primary={primaryActivate} {...commonProps} />
}
}
const validateSnippet = (snippet: Snippet): undefined | string => {
const missingCode = '' === snippet.code.trim()
const missingTitle = '' === snippet.name.trim()
switch (true) {
case missingCode && missingTitle:
return __('This snippet has no code or title.', 'code-snippets')
case missingCode:
return __('This snippet has no snippet code.', 'code-snippets')
case missingTitle:
return __('This snippet has no title.', 'code-snippets')
default:
return undefined
}
}
const shouldActivateByDefault = (snippet: Snippet, inlineButtons?: boolean): boolean =>
!inlineButtons
&& !!window.CODE_SNIPPETS_EDIT?.activateByDefault
&& !snippet.active
&& 'single-use' !== snippet.scope
&& (!snippet.shared_network || !isNetworkAdmin())
interface SubmitConfirmDialogProps {
isOpen: boolean
onClose: VoidFunction
onSubmit?: VoidFunction
validationWarning?: string
}
const SubmitConfirmDialog: React.FC<SubmitConfirmDialogProps> = ({ isOpen, onClose, onSubmit, validationWarning }) =>
<ConfirmDialog
open={isOpen}
title={__('Snippet incomplete', 'code-snippets')}
confirmLabel={__('Continue', 'code-snippets')}
onCancel={onClose}
onConfirm={() => {
onSubmit?.()
onClose()
}}
>
<p>{`${validationWarning} ${__('Continue?', 'code-snippets')}`}</p>
</ConfirmDialog>
export interface SubmitButtonsProps {
inlineButtons?: boolean
}
export const SubmitButton: React.FC<SubmitButtonsProps> = ({ inlineButtons }) => {
const { snippet, isWorking, submitSnippet, submitAndActivateSnippet, submitAndDeactivateSnippet } = useSnippetForm()
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = useState(false)
const [submitAction, setSubmitAction] = useState<VoidFunction>()
const validationWarning = validateSnippet(snippet)
const activateByDefault = shouldActivateByDefault(snippet, inlineButtons)
const handleSubmit = (submitAction: () => Promise<Snippet | undefined>): void => {
if (validationWarning) {
setIsConfirmDialogOpen(true)
setSubmitAction(() => submitAction)
} else {
submitAction()
.then(() => undefined)
.catch(handleUnknownError)
}
}
return <>
{activateByDefault ? null
: <SaveChangesButton
primary={!inlineButtons}
onClick={() => handleSubmit(submitSnippet)}
disabled={isWorking}
inlineButtons={inlineButtons}
/>}
<ActivateOrDeactivateButton
snippet={snippet}
disabled={isWorking}
inlineButtons={inlineButtons}
primaryActivate={activateByDefault}
onActivate={() => handleSubmit(submitAndActivateSnippet)}
onDeactivate={() => handleSubmit(submitAndDeactivateSnippet)}
/>
{activateByDefault
? <SaveChangesButton
onClick={() => handleSubmit(submitSnippet)}
disabled={isWorking}
inlineButtons={inlineButtons}
/> : null}
<SubmitConfirmDialog
isOpen={isConfirmDialogOpen}
validationWarning={validationWarning}
onSubmit={submitAction}
onClose={() => {
setIsConfirmDialogOpen(false)
setSubmitAction(undefined)
}}
/>
</>
}
js/components/SnippetForm/fields/DescriptionEditor.tsx 0000644 00000003413 15153464547 0017272 0 ustar 00 import React, { useCallback, useEffect } from 'react'
import { __ } from '@wordpress/i18n'
import domReady from '@wordpress/dom-ready'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
export const EDITOR_ID = 'snippet_description'
const TOOLBAR_BUTTONS = [
[
'bold',
'italic',
'underline',
'strikethrough',
'blockquote',
'bullist',
'numlist',
'alignleft',
'aligncenter',
'alignright',
'link',
'wp_adv',
'code_snippets'
],
[
'formatselect',
'forecolor',
'pastetext',
'removeformat',
'charmap',
'outdent',
'indent',
'undo',
'redo',
'spellchecker'
]
]
const initializeEditor = (onChange: (content: string) => void) => {
window.wp.editor?.initialize(EDITOR_ID, {
mediaButtons: window.CODE_SNIPPETS_EDIT?.descEditorOptions.mediaButtons,
quicktags: true,
tinymce: {
toolbar: TOOLBAR_BUTTONS.map(line => line.join(' ')),
setup: editor => {
editor.on('change', () => onChange(editor.getContent()))
}
}
})
}
export const DescriptionEditor: React.FC = () => {
const { snippet, setSnippet, isReadOnly } = useSnippetForm()
const onChange = useCallback(
(desc: string) => setSnippet(previous => ({ ...previous, desc })),
[setSnippet]
)
useEffect(() => {
domReady(() => initializeEditor(onChange))
}, [onChange])
return window.CODE_SNIPPETS_EDIT?.enableDescription
? <div className="snippet-description-container">
<h2>
<label htmlFor={EDITOR_ID}>
{__('Description', 'code-snippets')}
</label>
</h2>
<textarea
id={EDITOR_ID}
className="wp-editor-area"
onChange={event => onChange(event.target.value)}
autoComplete="off"
disabled={isReadOnly}
rows={window.CODE_SNIPPETS_EDIT.descEditorOptions.rows}
cols={40}
>{snippet.desc}</textarea>
</div>
: null
}
js/components/SnippetForm/fields/MultisiteSharingSettings.tsx 0000644 00000001471 15153464547 0020656 0 ustar 00 import React from 'react'
import { __ } from '@wordpress/i18n'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
export const MultisiteSharingSettings: React.FC = () => {
const { snippet, setSnippet, isReadOnly } = useSnippetForm()
return <>
<h2 className="screen-reader-text">{__('Sharing Settings', 'code-snippets')}</h2>
<p className="snippet-sharing-setting">
<label htmlFor="snippet_sharing">
<input
id="snippet_sharing"
name="snippet_sharing"
type="checkbox"
checked={Boolean(snippet.shared_network)}
disabled={isReadOnly}
onChange={event =>
setSnippet(previous => ({ ...previous, shared_network: event.target.checked }))}
/>
{__('Allow this snippet to be activated on individual sites on the network', 'code-snippets')}
</label>
</p>
</>
}
js/components/SnippetForm/fields/NameInput.tsx 0000644 00000001333 15153464547 0015537 0 ustar 00 import React from 'react'
import { __ } from '@wordpress/i18n'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
export const NameInput: React.FC = () => {
const { snippet, setSnippet, isReadOnly } = useSnippetForm()
return (
<div id="titlediv">
<div id="titlewrap">
<label htmlFor="title" className="screen-reader-text">
{__('Name', 'code-snippets')}
</label>
<input
id="title"
type="text"
name="snippet_name"
autoComplete="off"
value={snippet.name}
disabled={isReadOnly}
placeholder={__('Enter title here', 'code-snippets')}
onChange={event =>
setSnippet(previous => ({ ...previous, name: event.target.value }))}
/>
</div>
</div>
)
}
js/components/SnippetForm/fields/PriorityInput.tsx 0000644 00000001542 15153464547 0016502 0 ustar 00 import React from 'react'
import { __ } from '@wordpress/i18n'
import { getSnippetType } from '../../../utils/snippets'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
export const PriorityInput: React.FC = () => {
const { snippet, setSnippet, isReadOnly } = useSnippetForm()
return 'html' === getSnippetType(snippet)
? null
: <p
className="snippet-priority"
title={__('Snippets with a lower priority number will run before those with a higher number.', 'code-snippets')}
>
<label htmlFor="snippet_priority">{`${__('Priority', 'code-snippets')} `}</label>
<input
type="number"
id="snippet_priority"
name="snippet_priority"
value={snippet.priority}
disabled={isReadOnly}
onChange={event => setSnippet(previous => ({
...previous,
priority: parseInt(event.target.value, 10)
}))}
/>
</p>
}
js/components/SnippetForm/fields/ScopeInput.tsx 0000644 00000013256 15153464550 0015731 0 ustar 00 import { ExternalLink } from '@wordpress/components'
import { __ } from '@wordpress/i18n'
import React, { useState } from 'react'
import { SNIPPET_TYPES, SNIPPET_TYPE_SCOPES } from '../../../types/Snippet'
import { isNetworkAdmin } from '../../../utils/general'
import { buildShortcodeTag } from '../../../utils/shortcodes'
import { getSnippetType } from '../../../utils/snippets'
import { CopyToClipboardButton } from '../../common/CopyToClipboardButton'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import { truncateWords } from '../../../utils/text'
import type { ShortcodeAtts } from '../../../utils/shortcodes'
import type { SnippetScope } from '../../../types/Snippet'
import type { Dispatch, SetStateAction } from 'react'
const MAX_SHORTCODE_NAME_WORDS = 3
const SHORTCODE_TAG = 'code_snippet'
const SCOPE_ICONS: Record<SnippetScope, string> = {
'global': 'admin-site',
'admin': 'admin-tools',
'front-end': 'admin-appearance',
'single-use': 'clock',
'content': 'shortcode',
'head-content': 'editor-code',
'footer-content': 'editor-code',
'admin-css': 'dashboard',
'site-css': 'admin-customizer',
'site-head-js': 'media-code',
'site-footer-js': 'media-code'
}
const SCOPE_DESCRIPTIONS: Record<SnippetScope, string> = {
'global': __('Run snippet everywhere', 'code-snippets'),
'admin': __('Only run in administration area', 'code-snippets'),
'front-end': __('Only run on site front-end', 'code-snippets'),
'single-use': __('Only run once', 'code-snippets'),
'content': __('Only display when inserted into a post or page.', 'code-snippets'),
'head-content': __('Display in site <head> section.', 'code-snippets'),
'footer-content': __('Display at the end of the <body> section, in the footer.', 'code-snippets'),
'site-css': __('Site front-end styles', 'code-snippets'),
'admin-css': __('Administration area styles', 'code-snippets'),
'site-footer-js': __('Load JS at the end of the <body> section', 'code-snippets'),
'site-head-js': __('Load JS in the <head> section', 'code-snippets')
}
interface ShortcodeOptions {
php: boolean
format: boolean
shortcodes: boolean
}
const ShortcodeTag: React.FC<{ atts: ShortcodeAtts }> = ({ atts }) =>
<p>
<code className="shortcode-tag">{buildShortcodeTag(SHORTCODE_TAG, atts)}</code>
<CopyToClipboardButton
title={__('Copy shortcode to clipboard', 'code-snippets')}
text={buildShortcodeTag(SHORTCODE_TAG, atts)}
/>
</p>
interface ShortcodeOptionsProps {
optionLabels: [keyof ShortcodeOptions, string][]
options: ShortcodeOptions
setOptions: Dispatch<SetStateAction<ShortcodeOptions>>
isReadOnly: boolean
}
const ShortcodeOptions: React.FC<ShortcodeOptionsProps> = ({
optionLabels,
options,
setOptions,
isReadOnly
}) =>
<p className="html-shortcode-options">
<strong>{__('Shortcode Options: ', 'code-snippets')}</strong>
{optionLabels.map(([option, label]) =>
<label key={option}>
<input
type="checkbox"
value={option}
checked={options[option]}
disabled={isReadOnly}
onChange={event =>
setOptions(previous => ({ ...previous, [option]: event.target.checked }))}
/>
{` ${label}`}
</label>
)}
</p>
const ShortcodeInfo: React.FC = () => {
const { snippet, isReadOnly } = useSnippetForm()
const [options, setOptions] = useState<ShortcodeOptions>(() => ({
php: snippet.code.includes('<?'),
format: true,
shortcodes: false
}))
return 'content' === snippet.scope
? <>
<p className="description">
{__('There are multiple options for inserting this snippet into a post, page or other content.', 'code-snippets')}
{' '}
{snippet.id
// eslint-disable-next-line @stylistic/max-len
? __('You can copy the below shortcode, or use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).', 'code-snippets')
// eslint-disable-next-line @stylistic/max-len
: __('After saving, you can copy a shortcode, or use the Classic Editor button, Block editor (Pro) or Elementor widget (Pro).', 'code-snippets')}
{' '}
<ExternalLink
href={__('https://help.codesnippets.pro/article/50-inserting-snippets', 'code-snippets')}
>
{__('Learn more', 'code-snippets')}
</ExternalLink>
</p>
{snippet.id
? <>
<ShortcodeTag atts={{
id: snippet.id,
name: truncateWords(snippet.name, MAX_SHORTCODE_NAME_WORDS),
network: snippet.network ?? isNetworkAdmin(),
...options
}} />
<ShortcodeOptions
options={options}
setOptions={setOptions}
isReadOnly={isReadOnly}
optionLabels={[
['php', __('Evaluate PHP code', 'code-snippets')],
['format', __('Add paragraphs and formatting', 'code-snippets')],
['shortcodes', __('Evaluate additional shortcode tags', 'code-snippets')]
]}
/>
</>
: null}
</>
: null
}
export const ScopeInput: React.FC = () => {
const { snippet, setSnippet, isReadOnly } = useSnippetForm()
return <>
<h2 className="screen-reader-text">{__('Scope', 'code-snippets')}</h2>
{SNIPPET_TYPES
.filter(type => !snippet.id || type === getSnippetType(snippet))
.map(type =>
<p key={type} className={`snippet-scope ${type}-scopes-list`}>
{SNIPPET_TYPE_SCOPES[type].map(scope =>
<label key={scope}>
<input
type="radio"
name="snippet_scope"
value={scope}
checked={scope === snippet.scope}
onChange={event =>
event.target.checked && setSnippet(previous => ({
...previous,
scope
}))
}
disabled={isReadOnly}
/>
{' '}
<span className={`dashicons dashicons-${SCOPE_ICONS[scope]}`}></span>
{` ${SCOPE_DESCRIPTIONS[scope]}`}
</label>)}
{'html' === type ? <ShortcodeInfo /> : null}
</p>
)}
</>
}
js/components/SnippetForm/fields/TagsInput.tsx 0000644 00000001536 15153464550 0015554 0 ustar 00 import React from 'react'
import { __ } from '@wordpress/i18n'
import { TagEditor } from '../../TagEditor'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
const options = window.CODE_SNIPPETS_EDIT?.tagOptions
export const TagsInput: React.FC = () => {
const { snippet, setSnippet, isReadOnly } = useSnippetForm()
return options?.enabled
? <div className="snippet-tags-container">
<h2>
<label htmlFor="snippet_tags">
{__('Tags', 'code-snippets')}
</label>
</h2>
<TagEditor
id="snippet_tags"
tags={snippet.tags}
addOnBlur
disabled={isReadOnly}
onChange={tags => setSnippet(previous => ({ ...previous, tags }))}
completions={options.availableTags}
allowSpaces={options.allowSpaces}
placeholder={__('Enter a list of tags; separated by commas.', 'code-snippets')}
/>
</div>
: null
}
js/components/SnippetForm/index.ts 0000644 00000000036 15153464550 0013301 0 ustar 00 export * from './SnippetForm'
js/components/SnippetForm/page/Notices.tsx 0000644 00000003522 15153464550 0014705 0 ustar 00 import classnames from 'classnames'
import React, { useEffect } from 'react'
import { __, sprintf } from '@wordpress/i18n'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
import type { ReactNode } from 'react'
const NOTICE_TIMEOUT_MS = 5000
interface DismissibleNoticeProps {
classNames?: classnames.Argument
onRemove: VoidFunction
children?: ReactNode
autoHide?: boolean
}
const DismissibleNotice: React.FC<DismissibleNoticeProps> = ({ classNames, onRemove, children, autoHide = true }) => {
useEffect(() => {
if (autoHide) {
const timer = setTimeout(onRemove, NOTICE_TIMEOUT_MS)
return () => clearTimeout(timer)
}
return undefined
}, [autoHide, onRemove])
return (
<div id="message" className={classnames('cs-sticky-notice notice fade is-dismissible', classNames)}>
<>{children}</>
<button type="button" className="notice-dismiss" onClick={event => {
event.preventDefault()
onRemove()
}}>
<span className="screen-reader-text">{__('Dismiss notice.', 'code-snippets')}</span>
</button>
</div>
)
}
export const Notices: React.FC = () => {
const { currentNotice, setCurrentNotice, snippet, setSnippet } = useSnippetForm()
return <>
{currentNotice
? <DismissibleNotice classNames={currentNotice[0]} onRemove={() => setCurrentNotice(undefined)}>
<p>{currentNotice[1]}</p>
</DismissibleNotice>
: null}
{snippet.code_error
? <DismissibleNotice
classNames="error"
onRemove={() => setSnippet(previous => ({ ...previous, code_error: null }))}
autoHide={false}
>
<p>
<strong>{sprintf(
// translators: %d: line number.
__('Snippet automatically deactivated due to an error on line %d:', 'code-snippets'),
snippet.code_error[1]
)}</strong>
<blockquote>{snippet.code_error[0]}</blockquote>
</p>
</DismissibleNotice>
: null}
</>
}
js/components/SnippetForm/page/PageHeading.tsx 0000644 00000002321 15153464550 0015431 0 ustar 00 import { __, _x } from '@wordpress/i18n'
import React from 'react'
import { createEmptySnippet } from '../../../utils/snippets'
import { useSnippetForm } from '../../../hooks/useSnippetForm'
const OPTIONS = window.CODE_SNIPPETS_EDIT
export const PageHeading: React.FC = () => {
const { snippet, updateSnippet, setCurrentNotice } = useSnippetForm()
return (
<h1>
{snippet.id
? __('Edit Snippet', 'code-snippets')
: __('Add New Snippet', 'code-snippets')}
{snippet.id ? <>{' '}
<a href={window.CODE_SNIPPETS?.urls.addNew} className="page-title-action" onClick={event => {
event.preventDefault()
updateSnippet(() => createEmptySnippet())
setCurrentNotice(undefined)
window.document.title = window.document.title.replace(
__('Edit Snippet', 'code-snippets'),
__('Add New Snippet', 'code-snippets')
)
window.history.replaceState({}, '', window.CODE_SNIPPETS?.urls.addNew)
}}>
{_x('Add New', 'snippet', 'code-snippets')}
</a>
</> : null}
{OPTIONS?.pageTitleActions && Object.entries(OPTIONS.pageTitleActions).map(([label, url]) =>
<>
<a key={label} href={url} className="page-title-action">{label}</a>
{' '}
</>
)}
</h1>
)
}
js/components/SnippetForm/page/UpgradeDialog.tsx 0000644 00000010047 15153464550 0016010 0 ustar 00 import React, { useState } from 'react'
import { ExternalLink, Modal } from '@wordpress/components'
import { __, _n, sprintf } from '@wordpress/i18n'
import type { Dispatch, SetStateAction } from 'react'
export interface UpgradeDialogProps {
isOpen: boolean
setIsOpen: Dispatch<SetStateAction<boolean>>
}
const SMALL_PLAN_SITES = '2'
const MID_PLAN_SITES = '6'
const LARGE_PLAN_SITES = '200'
const upgradePlanCosts: Record<string, number> = {
[SMALL_PLAN_SITES]: 39,
[MID_PLAN_SITES]: 69,
[LARGE_PLAN_SITES]: 119
}
const UpgradeDialogPlans = () => {
const [currentPlan, setCurrentPlan] = useState(MID_PLAN_SITES)
return (
<>
<p><strong>{__('How many websites do you plan to use Code Snippets on?', 'code-snippets')}</strong></p>
<p>{__('We offer three distinct plans, each tailored to meet your needs.', 'code-snippets')}</p>
<p className="upgrade-plans">
{Object.keys(upgradePlanCosts).map(planSites =>
<label key={`${planSites}-sites`}>
<input
type="radio"
checked={planSites === currentPlan.toString()}
onClick={() => setCurrentPlan(planSites)}
/>
{' '}
{sprintf(_n('%d site', '%d sites', Number(planSites), 'code-snippets'), planSites)}
</label>
)}
</p>
<p className="action-buttons">
<span className="current-plan-cost">
{sprintf(__('$%s per year', 'code-snippets'), upgradePlanCosts[currentPlan])}
</span>
<ExternalLink
className="button button-primary button-large"
href={`https://checkout.freemius.com/mode/dialog/plugin/10565/plan/17873/licenses/${currentPlan}/`}
>
{__('Upgrade Now', 'code-snippets')}
</ExternalLink>
</p>
</>
)
}
interface UpgradeInfoProps {
nextTab: VoidFunction
}
const UpgradeInfo: React.FC<UpgradeInfoProps> = ({ nextTab }) =>
<>
<p>
{__('You are using the free version of Code Snippets.', 'code-snippets')}{' '}
{__('Upgrade to Code Snippets Pro to unleash its full potential:', 'code-snippets')}
<ul>
<li>
<strong>{__('CSS stylesheet snippets: ', 'code-snippets')}</strong>
{__('Craft impeccable websites with advanced CSS snippets.', 'code-snippets')}
</li>
<li>
<strong>{__('JavaScript snippets: ', 'code-snippets')}</strong>
{__('Enhance user interaction with the power of JavaScript.', 'code-snippets')}
</li>
<li>
<strong>{__('Specialized Elementor widgets: ', 'code-snippets')}</strong>
{__('Easily customize your site with Elementor widgets.', 'code-snippets')}
</li>
<li>
<strong>{__('Integration with block editor: ', 'code-snippets')}</strong>
{__('Seamlessly incorporate your snippets within the block editor.', 'code-snippets')}
</li>
<li>
<strong>{__('WP-CLI snippet commands: ', 'code-snippets')}</strong>
{__('Access and control your snippets directly from the command line.', 'code-snippets')}
</li>
<li>
<strong>{__('Premium support: ', 'code-snippets')}</strong>
{__("Direct access to our team. We're happy to help!", 'code-snippets')}
</li>
</ul>
{__('…and so much more!', 'code-snippets')}
</p>
<p className="action-buttons">
<ExternalLink
className="button button-secondary"
href="https://codesnippets.pro/pricing/"
>
{__('Learn More', 'code-snippets')}
</ExternalLink>
<button
className="button button-primary button-large"
onClick={nextTab}
>
{__('See Plans', 'code-snippets')}
<span className="dashicons dashicons-arrow-right"></span>
</button>
</p>
</>
export const UpgradeDialog: React.FC<UpgradeDialogProps> = ({ isOpen, setIsOpen }) => {
const [currentTab, setCurrentTab] = useState(0)
return isOpen
? <Modal
title=""
className="code-snippets-upgrade-dialog"
onRequestClose={() => {
setIsOpen(false)
setCurrentTab(0)
}}
>
<h1 className="logo">
<img src={`${window.CODE_SNIPPETS?.urls.plugin}/assets/icon.svg`} alt="" />
{__('Code Snippets Pro', 'code-snippets')}
</h1>
{0 === currentTab
? <UpgradeInfo nextTab={() => setCurrentTab(1)} />
: <UpgradeDialogPlans />
}
</Modal>
: null
}
js/components/TagEditor/SuggestionList.tsx 0000644 00000000715 15153464550 0014765 0 ustar 00 import React from 'react'
export interface SuggestionListProps {
id: string
suggestions: string[]
onSelect: (item: string) => void
}
export const SuggestionList: React.FC<SuggestionListProps> = ({ id, suggestions, onSelect }) =>
<div className="tagger-completion">
<datalist id={id}>
{suggestions.map(suggestion =>
<option
key={suggestion}
value={suggestion}
onClick={() => onSelect(suggestion)}
/>
)}
</datalist>
</div>
js/components/TagEditor/TagEditor.tsx 0000644 00000011313 15153464550 0013660 0 ustar 00 /**
* Code based on Tagger, copyright (c) 2018-2022 Jakub T. Jankiewicz <https://jcubic.pl/me>
* Released under the MIT license.
*/
import React, { useRef, useState } from 'react'
import { handleUnknownError } from '../../utils/errors'
import { SuggestionList } from './SuggestionList'
import { TagList } from './TagList'
import type { InputHTMLAttributes, KeyboardEventHandler } from 'react'
const COMPLETION_MIN_LENGTH = 2
const SPECIAL_CHARS_RE = /(?<specialChar>[-\\^$[\]()+{}?*.|])/g
const escapeRegex = (str: string) =>
str.replace(SPECIAL_CHARS_RE, '\\$1')
const isNotEmpty = (value: string | null | undefined): value is string =>
!['', '""', "''", '``', undefined, null].includes(value)
const isTagSelected = (selected: string[], tag: string) => {
if (!selected.includes(tag)) {
return false
}
const re = new RegExp(`^${escapeRegex(tag)}`)
return 1 === selected.filter(test_tag => re.test(test_tag)).length
}
export type TagEditorCompletions = string[] | ((value?: string) => Promise<string[]>) | undefined
const buildCompletions = (completions: TagEditorCompletions, value: string | undefined): Promise<string[] | undefined> => {
if (!completions) {
return Promise.resolve(undefined)
} else if ('function' === typeof completions) {
return completions(value)
} else {
return Promise.resolve(completions)
}
}
export interface TagEditorProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
id: string
tags: string[]
onChange: (tags: string[]) => void
tagLimit?: number
completions?: TagEditorCompletions
addOnBlur?: boolean
allowSpaces?: boolean
allowDuplicates?: boolean
completionMinLength?: number
}
// eslint-disable-next-line max-lines-per-function
export const TagEditor: React.FC<TagEditorProps> = ({
id,
tags,
onChange,
tagLimit,
completions,
addOnBlur = false,
allowSpaces = true,
allowDuplicates = false,
completionMinLength = COMPLETION_MIN_LENGTH,
...inputProps
}) => {
const inputRef = useRef<HTMLInputElement>(null)
const [inputValue, setInputValue] = useState<string>('')
const [completionOpen, setCompletionOpen] = useState(false)
const [completionList, setCompletionList] = useState<string[]>([])
const [lastCompletionList, setLastCompletionList] = useState<string[]>()
const isTagLimit = () => Boolean(tagLimit && 0 < tagLimit && tags.length >= tagLimit)
const addTag = (tag: string = inputValue.trim()) => {
const isTagValid = isNotEmpty(tag) && !isTagLimit() && (allowDuplicates || !tags.includes(tag))
if (isTagValid) {
onChange([...tags, tag])
}
setInputValue('')
return isTagValid
}
const removeTag = (tag?: string) =>
onChange(tag ? tags.filter(item => item !== tag) : tags.slice(0, -1))
const triggerCompletion = (openList = inputValue.length >= completionMinLength) => {
if (openList) {
buildCompletions(completions, inputValue)
.then(list => {
setLastCompletionList(completionList)
if (list?.length) {
setCompletionList(allowDuplicates ? list : list.filter(item => !tags.includes(item)))
}
})
.catch(handleUnknownError)
}
setCompletionOpen(openList)
}
const keyboardHandler: KeyboardEventHandler<HTMLInputElement> = event => {
const { key, ctrlKey, metaKey } = event
switch (key) {
case 'Enter':
case ',':
event.preventDefault()
addTag()
break
case 'Backspace':
if (!inputValue) {
event.preventDefault()
removeTag()
}
break
case ' ':
if (ctrlKey || metaKey) {
event.preventDefault()
triggerCompletion(true)
} else if (!allowSpaces) {
event.preventDefault()
addTag()
}
break
case 'Tab':
if (!isTagLimit()) {
event.preventDefault()
}
break
}
}
const inputHandler = () => {
if (completionOpen && lastCompletionList && isTagSelected(lastCompletionList, inputValue.trim())) {
if (addTag()) {
setCompletionOpen(false)
}
} else {
triggerCompletion()
}
}
return (
<div className="tagger">
<ul onClick={() => inputRef.current?.focus()}>
<TagList tags={tags} onRemove={removeTag} />
<li className="tagger-new">
<input
{...inputProps}
id={id}
type="text"
ref={inputRef}
value={inputValue}
list={`tagger-completion-${completionOpen ? '' : '-disabled'}${id}`}
onBlur={() => addOnBlur ? addTag() : undefined}
onChange={event => setInputValue(event.target.value)}
onKeyDown={keyboardHandler}
onInput={inputHandler}
/>
<SuggestionList
id={`tagger-completion-${id}`}
suggestions={completionList.filter(suggestion => !tags.includes(suggestion))}
onSelect={suggestion => {
addTag(suggestion)
setCompletionList([])
setCompletionOpen(false)
}}
/>
</li>
</ul>
</div>
)
}
js/components/TagEditor/TagList.tsx 0000644 00000000652 15153464550 0013351 0 ustar 00 import React from 'react'
export interface TagListProps {
tags: string[]
onRemove: (tag: string) => void
}
export const TagList: React.FC<TagListProps> = ({ tags, onRemove }) =>
<>
{tags.map(tag =>
<li key={tag}>
<span>
<span className="label">{tag}</span>
<a href="#" className="close" onClick={event => {
onRemove(tag)
event.preventDefault()
}}>×</a>
</span>
</li>
)}
</>
js/components/TagEditor/index.ts 0000644 00000000034 15153464550 0012713 0 ustar 00 export * from './TagEditor'
js/components/common/Button.tsx 0000644 00000001452 15153464550 0012662 0 ustar 00 import React from 'react'
import classnames from 'classnames'
import type { ButtonHTMLAttributes } from 'react'
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'id' | 'name'> {
id?: string
name?: string
primary?: boolean
small?: boolean
large?: boolean
}
export const Button: React.FC<ButtonProps> = ({
id,
children,
className,
name = 'submit',
primary = false,
small = false,
large = false,
type = 'button',
onClick,
...props
}) =>
<button
id={id ?? name}
name={name}
type={type}
{...props}
onClick={event => {
if (onClick) {
event.preventDefault()
onClick(event)
}
}}
className={classnames('button', className, {
'button-primary': primary,
'button-large': large,
'button-small': small
})}
>
{children}
</button>
js/components/common/ConfirmDialog.tsx 0000644 00000002144 15153464550 0014123 0 ustar 00 import React from 'react'
import { __ } from '@wordpress/i18n'
import { Button, Flex, Modal } from '@wordpress/components'
import type { ReactNode } from 'react'
export interface ConfirmDialogProps {
open?: boolean
title: string
onConfirm?: VoidFunction
onCancel: VoidFunction
confirmLabel?: string
cancelLabel?: string
children?: ReactNode,
confirmButtonClassName?: string
}
export const ConfirmDialog: React.FC<ConfirmDialogProps> = ({
open,
title,
onConfirm,
onCancel,
children,
confirmLabel = __('OK', 'code-snippets'),
cancelLabel = __('Cancel', 'code-snippets'),
confirmButtonClassName
}) =>
open
? <Modal
title={title}
onRequestClose={onCancel}
closeButtonLabel={cancelLabel}
isDismissible={true}
onKeyDown={event => {
if ('Enter' === event.key) {
onConfirm?.()
}
}}
>
{children}
<Flex direction="row" justify="flex-end">
<Button variant="tertiary" onClick={onCancel}>
{cancelLabel}
</Button>
<Button variant="primary" onClick={onConfirm} className={confirmButtonClassName}>
{confirmLabel}
</Button>
</Flex>
</Modal>
: null
js/components/common/CopyToClipboardButton.tsx 0000644 00000002057 15153464550 0015642 0 ustar 00 import React, { useState } from 'react'
import { handleUnknownError } from '../../utils/errors'
import type { HTMLAttributes, MouseEventHandler } from 'react'
const TIMEOUT = 3000
export interface CopyToClipboardButtonProps extends HTMLAttributes<HTMLAnchorElement> {
text: string
copyIcon?: string
successIcon?: string
timeout?: number
}
export const CopyToClipboardButton: React.FC<CopyToClipboardButtonProps> = ({
text,
copyIcon = 'clipboard',
successIcon = 'yes',
...props
}) => {
const [isSuccess, setIsSuccess] = useState(false)
const clipboard = window.navigator.clipboard as Clipboard | undefined
const clickHandler: MouseEventHandler<HTMLAnchorElement> = event => {
event.preventDefault()
clipboard?.writeText(text)
.then(() => {
setIsSuccess(true)
setTimeout(() => setIsSuccess(false), TIMEOUT)
})
.catch(handleUnknownError)
}
return clipboard
? <a
href="#"
className={`code-snippets-copy-text dashicons dashicons-${isSuccess ? successIcon : copyIcon}`}
onClick={clickHandler}
{...props}
></a>
: null
}
js/edit.tsx 0000644 00000000546 15153464550 0006662 0 ustar 00 import React from 'react'
import { createRoot } from 'react-dom/client'
import { SnippetForm } from './components/SnippetForm'
const container = document.getElementById('edit-snippet-form-container')
if (container) {
const root = createRoot(container)
root.render(<SnippetForm />)
} else {
console.error('Could not find snippet edit form container.')
}
js/editor.ts 0000644 00000001021 15153464550 0007020 0 ustar 00 import { defineMode, getMode, registerHelper } from 'codemirror'
import { Linter } from './utils/Linter'
import type { EditorConfiguration, ModeSpec } from 'codemirror'
interface ModeSpecOptions {
startOpen: boolean
}
const mode: ModeSpec<ModeSpecOptions> = {
name: 'application/x-httpd-php',
startOpen: true
}
defineMode('php-snippet', (config: EditorConfiguration) => getMode(config, mode))
registerHelper('lint', 'php', (text: string) => {
const linter = new Linter(text)
linter.lint()
return linter.annotations
})
js/hooks/useAxios.ts 0000644 00000002530 15153464550 0010463 0 ustar 00 import { useMemo } from 'react'
import axios from 'axios'
import type { AxiosInstance, AxiosResponse, CreateAxiosDefaults } from 'axios'
export interface AxiosAPI {
get: <T>(url: string) => Promise<AxiosResponse<T, never>>
post: <T, D>(url: string, data?: D) => Promise<AxiosResponse<T, D>>
del: <T>(url: string) => Promise<AxiosResponse<T, never>>
axiosInstance: AxiosInstance
}
const debugRequest = async <T, D = never>(
method: 'GET' | 'POST' | 'PUT' | 'DELETE',
url: string,
doRequest: Promise<AxiosResponse<T, D>>,
data?: D
): Promise<AxiosResponse<T, D>> => {
console.debug(`${method} ${url}`, ...data ? [data] : [])
const response = await doRequest
console.debug('Response', response)
return response
}
export const useAxios = (defaultConfig: CreateAxiosDefaults): AxiosAPI => {
const axiosInstance = useMemo(() => axios.create(defaultConfig), [defaultConfig])
return useMemo((): AxiosAPI => ({
get: <T>(url: string): Promise<AxiosResponse<T, never>> =>
debugRequest('GET', url, axiosInstance.get<T, AxiosResponse<T, never>, never>(url)),
post: <T, D>(url: string, data?: D) =>
debugRequest('POST', url, axiosInstance.post<T, AxiosResponse<T, D>, D>(url, data), data),
del: <T>(url: string) =>
debugRequest('DELETE', url, axiosInstance.delete<T, AxiosResponse<T, never>, never>(url)),
axiosInstance
}), [axiosInstance])
}
js/hooks/useSnippetForm.tsx 0000644 00000006520 15153464550 0012041 0 ustar 00 import { isAxiosError } from 'axios'
import React, { createContext, useCallback, useContext, useMemo, useState } from 'react'
import { isLicensed } from '../utils/general'
import { isProSnippet } from '../utils/snippets'
import { useSnippetSubmit } from './useSnippetSubmit'
import type { Dispatch, PropsWithChildren, SetStateAction} from 'react'
import type { ScreenNotice } from '../types/ScreenNotice'
import type { Snippet } from '../types/Snippet'
import type { CodeEditorInstance } from '../types/WordPressCodeEditor'
export interface SnippetFormContext {
snippet: Snippet
setSnippet: Dispatch<SetStateAction<Snippet>>
updateSnippet: Dispatch<SetStateAction<Snippet>>
isReadOnly: boolean
isWorking: boolean
setIsWorking: Dispatch<SetStateAction<boolean>>
currentNotice: ScreenNotice | undefined
setCurrentNotice: Dispatch<SetStateAction<ScreenNotice | undefined>>
codeEditorInstance: CodeEditorInstance | undefined
setCodeEditorInstance: Dispatch<SetStateAction<CodeEditorInstance | undefined>>
handleRequestError: (error: unknown, message?: string) => void
submitSnippet: () => Promise<Snippet | undefined>
submitAndActivateSnippet: () => Promise<Snippet | undefined>
submitAndDeactivateSnippet: () => Promise<Snippet | undefined>
}
const SnippetFormContext = createContext<SnippetFormContext | undefined>(undefined)
export const useSnippetForm = () => {
const value = useContext(SnippetFormContext)
if (value === undefined) {
throw Error('useSnippetForm can only be used within a SnippetForm context provider')
}
return value
}
export interface WithSnippetFormContextProps extends PropsWithChildren {
initialSnippet: () => Snippet
}
export const WithSnippetFormContext: React.FC<WithSnippetFormContextProps> = ({ children, initialSnippet }) => {
const [snippet, setSnippet] = useState<Snippet>(initialSnippet)
const [isWorking, setIsWorking] = useState(false)
const [currentNotice, setCurrentNotice] = useState<ScreenNotice>()
const [codeEditorInstance, setCodeEditorInstance] = useState<CodeEditorInstance>()
const submitSnippet = useSnippetSubmit(setSnippet, setIsWorking, setCurrentNotice)
const isReadOnly = useMemo(() => !isLicensed() && isProSnippet(snippet.scope), [snippet.scope])
const handleRequestError = useCallback((error: unknown, message?: string) => {
console.error('Request failed', error)
setIsWorking(false)
setCurrentNotice(['error', [message, isAxiosError(error) ? error.message : ''].filter(Boolean).join(' ')])
}, [setIsWorking, setCurrentNotice])
const updateSnippet: Dispatch<SetStateAction<Snippet>> = useCallback((value: SetStateAction<Snippet>) => {
setSnippet(previous => {
const updated = 'object' === typeof value ? value : value(previous)
codeEditorInstance?.codemirror.setValue(updated.code)
window.tinymce?.activeEditor.setContent(updated.desc)
return updated
})
}, [codeEditorInstance?.codemirror])
const value: SnippetFormContext = {
snippet,
setSnippet,
updateSnippet,
isReadOnly,
isWorking,
setIsWorking,
currentNotice,
setCurrentNotice,
codeEditorInstance,
setCodeEditorInstance,
handleRequestError,
submitSnippet: () => submitSnippet(snippet),
submitAndActivateSnippet: () => submitSnippet(snippet, true),
submitAndDeactivateSnippet: () => submitSnippet(snippet, false)
}
return <SnippetFormContext.Provider value={value}>{children}</SnippetFormContext.Provider>
}
js/hooks/useSnippetSubmit.ts 0000644 00000005210 15153464550 0012204 0 ustar 00 import { __ } from '@wordpress/i18n'
import { addQueryArgs } from '@wordpress/url'
import { isAxiosError } from 'axios'
import { useCallback } from 'react'
import { useSnippetsAPI } from './useSnippets'
import type { Dispatch, SetStateAction } from 'react'
import type { ScreenNotice } from '../types/ScreenNotice'
import type { Snippet } from '../types/Snippet'
const getSuccessNotice = (request: Snippet, response: Snippet, active: boolean | undefined) => {
if (active === undefined) {
return 0 === request.id
? __('Snippet created.', 'code-snippets')
: __('Snippet updated.', 'code-snippets')
}
if (0 === request.id && active) {
return __('Snippet created and activated.', 'code-snippets')
}
if (active) {
return 'single-use' === response.scope
? __('Snippet updated and executed.', 'code-snippets')
: __('Snippet updated and activated.', 'code-snippets')
} else {
return __('Snippet updated and deactivated')
}
}
export const useSnippetSubmit = (
setSnippet: Dispatch<SetStateAction<Snippet>>,
setIsWorking: Dispatch<SetStateAction<boolean>>,
setCurrentNotice: Dispatch<SetStateAction<ScreenNotice | undefined>>
): (snippet: Snippet, active?: boolean) => Promise<Snippet | undefined> => {
const api = useSnippetsAPI()
return useCallback(async (snippet: Snippet, active?: boolean) => {
setIsWorking(true)
setCurrentNotice(undefined)
const result = await (async (): Promise<Snippet | string | undefined> => {
try {
const requestData: Snippet = { ...snippet, active: active ?? snippet.active }
const { data } = await (0 === snippet.id ? api.create(requestData) : api.update(requestData))
setIsWorking(false)
return data.id ? data : undefined
} catch (error) {
setIsWorking(false)
return isAxiosError(error) ? error.message : undefined
}
})()
if (undefined === result || 'string' === typeof result) {
const message = [
snippet.id
? __('Could not create snippet.', 'code-snippets')
: __('Could not update snippet.', 'code-snippets'),
result ?? __('The server did not send a valid response.', 'code-snippets')
]
setCurrentNotice(['error', message.filter(Boolean).join(' ')])
return undefined
} else {
setSnippet({ ...result })
setCurrentNotice(['updated', getSuccessNotice(snippet, result, active)])
if (snippet.id && result.id) {
window.document.title = window.document.title.replace(
__('Add New Snippet', 'code-snippets'),
__('Edit Snippet', 'code-snippets')
)
window.history.replaceState({}, '', addQueryArgs(window.CODE_SNIPPETS?.urls.edit, { id: result.id }))
}
return result
}
}, [api, setCurrentNotice, setIsWorking, setSnippet])
}
js/hooks/useSnippets.ts 0000644 00000005120 15153464550 0011203 0 ustar 00 import { useEffect, useMemo, useState } from 'react'
import { addQueryArgs } from '@wordpress/url'
import { handleUnknownError } from '../utils/errors'
import { isNetworkAdmin } from '../utils/general'
import { useAxios } from './useAxios'
import type { Snippet } from '../types/Snippet'
import type { SnippetsExport } from '../types/SnippetsExport'
import type { AxiosResponse, CreateAxiosDefaults } from 'axios'
const ROUTE_BASE = window.CODE_SNIPPETS?.restAPI.snippets
const AXIOS_CONFIG: CreateAxiosDefaults = {
headers: { 'X-WP-Nonce': window.CODE_SNIPPETS?.restAPI.nonce }
}
export interface SnippetsAPI {
fetchAll: (network?: boolean | null) => Promise<AxiosResponse<Snippet[]>>
fetch: (snippetId: number, network?: boolean | null) => Promise<AxiosResponse<Snippet>>
create: (snippet: Snippet) => Promise<AxiosResponse<Snippet>>
update: (snippet: Snippet) => Promise<AxiosResponse<Snippet>>
delete: (snippet: Snippet) => Promise<AxiosResponse<void>>
activate: (snippet: Snippet) => Promise<AxiosResponse<Snippet>>
deactivate: (snippet: Snippet) => Promise<AxiosResponse<Snippet>>
export: (snippet: Snippet) => Promise<AxiosResponse<SnippetsExport>>
exportCode: (snippet: Snippet) => Promise<AxiosResponse<string>>
}
const buildURL = ({ id, network }: Snippet, action?: string) =>
addQueryArgs(
[ROUTE_BASE, id, action].filter(Boolean).join('/'),
{ network: network ? true : undefined }
)
export const useSnippetsAPI = (): SnippetsAPI => {
const { get, post, del } = useAxios(AXIOS_CONFIG)
return useMemo((): SnippetsAPI => ({
fetchAll: network =>
get<Snippet[]>(addQueryArgs(ROUTE_BASE, { network })),
fetch: (snippetId, network) =>
get<Snippet>(addQueryArgs(`${ROUTE_BASE}/${snippetId}`, { network })),
create: snippet =>
post<Snippet, Snippet>(`${ROUTE_BASE}`, snippet),
update: snippet =>
post<Snippet, Snippet>(buildURL(snippet), snippet),
delete: (snippet: Snippet) =>
del(buildURL(snippet)),
activate: snippet =>
post<Snippet, never>(buildURL(snippet, 'activate')),
deactivate: snippet =>
post<Snippet, never>(buildURL(snippet, 'deactivate')),
export: snippet =>
get<SnippetsExport>(buildURL(snippet, 'export')),
exportCode: snippet =>
get<string>(buildURL(snippet, 'export-code'))
}), [get, post, del])
}
export const useSnippets = (): Snippet[] | undefined => {
const api = useSnippetsAPI()
const [snippets, setSnippets] = useState<Snippet[]>()
useEffect(() => {
if (!snippets) {
api.fetchAll(isNetworkAdmin())
.then(response => setSnippets(response.data))
.catch(handleUnknownError)
}
}, [api, snippets])
return snippets
}
js/manage.ts 0000644 00000000325 15153464550 0006770 0 ustar 00 import { handleShowCloudPreview, handleSnippetActivationSwitches, handleSnippetPriorityChanges } from './services/manage'
handleSnippetActivationSwitches()
handleSnippetPriorityChanges()
handleShowCloudPreview()
js/mce.ts 0000644 00000005337 15153464550 0006314 0 ustar 00 import tinymce from 'tinymce'
import type { Editor } from 'tinymce'
import type { ContentShortcodeAtts, SourceShortcodeAtts } from './types/Shortcodes'
import type { LocalisedEditor } from './types/WordPressEditor'
const convertToValues = (array: Record<string, string>) =>
Object.keys(array).map(key => ({
text: array[Number(key)],
value: key
}))
export const insertContentMenu = (editor: Editor, activeEditor: LocalisedEditor) => ({
text: activeEditor.getLang('code_snippets.insert_source_menu'),
onclick: () => {
editor.windowManager.open({
title: activeEditor.getLang('code_snippets.insert_source_title'),
body: [
{
type: 'listbox',
name: 'id',
label: activeEditor.getLang('code_snippets.snippet_label'),
values: convertToValues(<Record<string, string>> activeEditor.getLang('code_snippets.all_snippets'))
},
{
type: 'checkbox',
name: 'line_numbers',
label: activeEditor.getLang('code_snippets.show_line_numbers_label')
}
],
onsubmit: (event: { data: SourceShortcodeAtts }) => {
const id = parseInt(event.data.id, 10)
if (!id) {
return
}
let atts = ''
if (event.data.line_numbers) {
atts += ' line_numbers=true'
}
editor.insertContent(`[code_snippet_source id=${id}${atts}]`)
}
}, {})
}
})
export const insertSourceMenu = (editor: Editor, ed: LocalisedEditor) => ({
text: ed.getLang('code_snippets.insert_content_menu'),
onclick: () => {
editor.windowManager.open({
title: ed.getLang('code_snippets.insert_content_title'),
body: [
{
type: 'listbox',
name: 'id',
label: ed.getLang('code_snippets.snippet_label'),
values: convertToValues(<Record<string, string>> ed.getLang('code_snippets.content_snippets'))
},
{
type: 'checkbox',
name: 'php',
label: ed.getLang('code_snippets.php_att_label')
},
{
type: 'checkbox',
name: 'format',
label: ed.getLang('code_snippets.format_att_label')
},
{
type: 'checkbox',
name: 'shortcodes',
label: ed.getLang('code_snippets.shortcodes_att_label')
}
],
onsubmit: (event: { data: ContentShortcodeAtts }) => {
const id = parseInt(event.data.id, 10)
if (!id) {
return
}
let atts = ''
for (const [opt, val] of Object.entries(event.data)) {
if ('id' !== opt && val) {
atts += ` ${opt}=${val}`
}
}
editor.insertContent(`[code_snippet id=${id}${atts}]`)
}
}, {})
}
})
tinymce.PluginManager.add('code_snippets', editor => {
const activeEditor = <LocalisedEditor> tinymce.activeEditor
editor.addButton('code_snippets', {
icon: 'code',
menu: [insertContentMenu(editor, activeEditor), insertSourceMenu(editor, activeEditor)],
type: 'menubutton'
})
})
js/prism.ts 0000644 00000001603 15153464550 0006672 0 ustar 00 import Prism from 'prismjs'
import 'prismjs/components/prism-markup'
import 'prismjs/components/prism-markup-templating'
import 'prismjs/components/prism-clike'
import 'prismjs/components/prism-css'
import 'prismjs/components/prism-php'
import 'prismjs/components/prism-javascript'
import 'prismjs/plugins/line-highlight/prism-line-highlight'
import 'prismjs/plugins/line-numbers/prism-line-numbers'
import 'prismjs/plugins/toolbar/prism-toolbar'
import 'prismjs/plugins/show-language/prism-show-language'
import 'prismjs/plugins/copy-to-clipboard/prism-copy-to-clipboard'
import 'prismjs/plugins/inline-color/prism-inline-color'
import 'prismjs/plugins/previewers/prism-previewers'
import 'prismjs/plugins/autolinker/prism-autolinker'
document.addEventListener('readystatechange', () => {
if ('complete' === document.readyState) {
Prism.highlightAll()
}
})
window.CODE_SNIPPETS_PRISM = Prism
js/services/manage/activation.ts 0000644 00000004474 15153464550 0012765 0 ustar 00 import { __ } from '@wordpress/i18n'
import { updateSnippet } from './requests'
import type { Snippet } from '../../types/Snippet'
/**
* Update the snippet count of a specific view
* @param element
* @param increment
*/
const updateViewCount = (element: HTMLElement | null, increment: boolean) => {
if (element?.textContent) {
let count = parseInt(element.textContent.replace(/\((?<count>\d+)\)/, '$1'), 10)
count += increment ? 1 : -1
element.textContent = `(${count})`
} else {
console.error('Could not update view count.', element)
}
}
/**
* Activate an inactive snippet, or deactivate an active snippet
* @param link
* @param event
*/
export const toggleSnippetActive = (link: HTMLAnchorElement, event: Event) => {
const row = link.parentElement?.parentElement // Switch < cell < row
if (!row) {
console.error('Could not toggle snippet active status.', row)
return
}
const match = /\b(?:in)?active-snippet\b/.exec(row.className)
if (!match) {
return
}
event.preventDefault()
const activating = 'inactive-snippet' === match[0]
const snippet: Partial<Snippet> = { active: activating }
updateSnippet('active', row, snippet, response => {
const button: HTMLAnchorElement | null = row.querySelector('.snippet-activation-switch')
if (response.success) {
row.className = activating
? row.className.replace(/\binactive-snippet\b/, 'active-snippet')
: row.className.replace(/\bactive-snippet\b/, 'inactive-snippet')
const views = document.querySelector('.subsubsub')
const activeCount = views?.querySelector<HTMLElement>('.active .count')
const inactiveCount = views?.querySelector<HTMLElement>('.inactive .count')
if (activeCount) {
updateViewCount(activeCount, activating)
}
if (inactiveCount) {
updateViewCount(inactiveCount, activating)
}
if (button) {
button.title = activating ? __('Deactivate', 'code-snippets') : __('Activate', 'code-snippets')
}
} else {
row.className += ' erroneous-snippet'
if (button) {
button.title = __('An error occurred when attempting to activate', 'code-snippets')
}
}
})
}
export const handleSnippetActivationSwitches = () => {
for (const link of document.getElementsByClassName('snippet-activation-switch')) {
link.addEventListener('click', event => toggleSnippetActive(<HTMLAnchorElement> link, event))
}
}
js/services/manage/cloud.ts 0000644 00000003002 15153464550 0011714 0 ustar 00 import Prism from 'prismjs'
import 'prismjs/components/prism-clike'
import 'prismjs/components/prism-javascript'
import 'prismjs/components/prism-css'
import 'prismjs/components/prism-php'
import 'prismjs/components/prism-markup'
import 'prismjs/plugins/keep-markup/prism-keep-markup'
/**
* Handle clicks on snippet preview button.
*/
export const handleShowCloudPreview = () => {
const previewButtons = document.querySelectorAll('.cloud-snippet-preview')
previewButtons.forEach(button => {
button.addEventListener('click', () => {
const snippetId = button.getAttribute('data-snippet')
const snippetLanguage = button.getAttribute('data-lang')
const snippetCodeInput = <HTMLInputElement | null> document.getElementById(`cloud-snippet-code-${snippetId}`)
const snippetCodeModalTag = document.getElementById('snippet-code-thickbox')
if (!snippetCodeModalTag || !snippetCodeInput) {
return
}
snippetCodeModalTag.classList.remove(...snippetCodeModalTag.classList)
snippetCodeModalTag.classList.add(`language-${snippetLanguage}`)
snippetCodeModalTag.textContent = snippetCodeInput.value
if ('markup' === snippetLanguage) {
snippetCodeModalTag.innerHTML = `<xmp>${snippetCodeInput.value}</xmp>`
}
if ('php' === snippetLanguage) {
// Check if there is an opening php tag if not add it.
if (!snippetCodeInput.value.startsWith('<?php')) {
snippetCodeModalTag.textContent = `<?php\n${snippetCodeInput.value}`
}
}
Prism.highlightElement(snippetCodeModalTag)
})
})
}
js/services/manage/index.ts 0000644 00000000252 15153464550 0011721 0 ustar 00 export { handleSnippetActivationSwitches } from './activation'
export { handleSnippetPriorityChanges } from './priority'
export { handleShowCloudPreview } from './cloud'
js/services/manage/priority.ts 0000644 00000001344 15153464550 0012476 0 ustar 00 import { updateSnippet } from './requests'
import type { Snippet } from '../../types/Snippet'
/**
* Update the priority of a snippet
*/
export const updateSnippetPriority = (element: HTMLInputElement) => {
const row = element.parentElement?.parentElement
const snippet: Partial<Snippet> = { priority: parseFloat(element.value) }
if (row) {
updateSnippet('priority', row, snippet)
} else {
console.error('Could not update snippet information.', snippet, row)
}
}
export const handleSnippetPriorityChanges = () => {
for (const field of <HTMLCollectionOf<HTMLInputElement>> document.getElementsByClassName('snippet-priority')) {
field.addEventListener('input', () => updateSnippetPriority(field))
field.disabled = false
}
}
js/services/manage/requests.ts 0000644 00000003345 15153464550 0012473 0 ustar 00 import { isNetworkAdmin } from '../../utils/general'
import type { Snippet, SnippetScope } from '../../types/Snippet'
export interface ResponseData<T = unknown> {
success: boolean
data?: T
}
export type SuccessCallback = (response: ResponseData) => void
const sendSnippetRequest = (query: string, onSuccess?: SuccessCallback) => {
const request = new XMLHttpRequest()
request.open('POST', window.ajaxurl, true)
request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded charset=UTF-8')
request.onload = () => {
const success = 200
const errorStart = 400
if (success > request.status || errorStart <= request.status) {
return
}
console.info(request.responseText)
onSuccess?.(<ResponseData> JSON.parse(request.responseText))
}
request.send(query)
}
/**
* Update the data of a given snippet using AJAX
* @param field
* @param row
* @param snippet
* @param successCallback
*/
export const updateSnippet = (field: keyof Snippet, row: Element, snippet: Partial<Snippet>, successCallback?: SuccessCallback) => {
const nonce = <HTMLInputElement | null> document.getElementById('code_snippets_ajax_nonce')
const columnId = row.querySelector('.column-id')
if (!nonce || !columnId?.textContent || !parseInt(columnId.textContent, 10)) {
return
}
snippet.id = parseInt(columnId.textContent, 10)
snippet.shared_network = null !== /\bshared-network-snippet\b/.exec(row.className)
snippet.network = snippet.shared_network || isNetworkAdmin()
snippet.scope = <SnippetScope | null> row.getAttribute('data-snippet-scope') ?? snippet.scope
const queryString = `action=update_code_snippet&_ajax_nonce=${nonce.value}&field=${field}&snippet=${JSON.stringify(snippet)}`
sendSnippetRequest(queryString, successCallback)
}
js/services/settings/editor-preview.ts 0000644 00000002623 15153464550 0014173 0 ustar 00 import '../../editor'
const parseSelect = (select: HTMLSelectElement) => select.options[select.selectedIndex].value
const parseCheckbox = (checkbox: HTMLInputElement) => checkbox.checked
const parseNumber = (input: HTMLInputElement) => parseInt(input.value, 10)
const initialiseCodeMirror = () => {
const { codeEditor } = window.wp
const textarea = document.getElementById('code_snippets_editor_preview')
if (textarea) {
window.code_snippets_editor_preview = codeEditor.initialize(textarea)
return window.code_snippets_editor_preview.codemirror
}
console.error('Could not initialise CodeMirror on textarea.', textarea)
return undefined
}
export const handleEditorPreviewUpdates = () => {
const editor = initialiseCodeMirror()
const editorSettings = window.code_snippets_editor_settings
for (const setting of editorSettings) {
const element = document.querySelector(`[name="code_snippets_settings[editor][${setting.name}]"]`)
element?.addEventListener('change', () => {
const opt = setting.codemirror
const value = (() => {
switch (setting.type) {
case 'select':
return parseSelect(<HTMLSelectElement> element)
case 'checkbox':
return parseCheckbox(<HTMLInputElement> element)
case 'number':
return parseNumber(<HTMLInputElement> element)
default:
return null
}
})()
if (null !== value) {
editor?.setOption(opt, value)
}
})
}
}
js/services/settings/index.ts 0000644 00000000152 15153464550 0012330 0 ustar 00 export { handleSettingsTabs } from './tabs'
export { handleEditorPreviewUpdates } from './editor-preview'
js/services/settings/tabs.ts 0000644 00000003232 15153464550 0012154 0 ustar 00 const selectTab = (tabsWrapper: Element, tab: Element, section: string) => {
// Swap the active tab class from the previously active tab to the current one.
tabsWrapper.querySelector('.nav-tab-active')?.classList.remove('nav-tab-active')
tab.classList.add('nav-tab-active')
// Update the current active tab attribute so that only the active tab is displayed.
tabsWrapper.closest('.wrap')?.setAttribute('data-active-tab', section)
}
// Refresh the editor preview if we're viewing the editor section.
const refreshEditorPreview = (section: string) => {
if ('editor' === section) {
window.code_snippets_editor_preview?.codemirror.refresh()
}
}
// Update the http referer value so that any redirections lead back to this tab.
const updateHttpReferer = (section: string) => {
const httpReferer = document.querySelector<HTMLInputElement>('input[name=_wp_http_referer]')
if (!httpReferer) {
console.error('could not find http referer')
return
}
const newReferer = httpReferer.value.replace(/(?<base>[&?]section=)[^&]+/, `$1${section}`)
httpReferer.value = newReferer + (newReferer === httpReferer.value ? `§ion=${section}` : '')
}
export const handleSettingsTabs = () => {
const tabsWrapper = document.getElementById('settings-sections-tabs')
if (!tabsWrapper) {
console.error('Could not find snippets tabs')
return
}
const tabs = tabsWrapper.querySelectorAll('.nav-tab')
for (const tab of tabs) {
tab.addEventListener('click', event => {
event.preventDefault()
const section = tab.getAttribute('data-section')
if (section) {
selectTab(tabsWrapper, tab, section)
refreshEditorPreview(section)
updateHttpReferer(section)
}
})
}
}
js/settings.ts 0000644 00000000210 15153464550 0007371 0 ustar 00 import { handleEditorPreviewUpdates, handleSettingsTabs } from './services/settings'
handleSettingsTabs()
handleEditorPreviewUpdates()
js/types/KeyboardShortcut.ts 0000644 00000002252 15153464550 0012201 0 ustar 00 import { _x } from '@wordpress/i18n'
export const KEYBOARD_KEYS = <const> {
'Cmd': _x('Cmd', 'keyboard key', 'code-snippets'),
'Ctrl': _x('Ctrl', 'keyboard key', 'code-snippets'),
'Shift': _x('Shift', 'keyboard key', 'code-snippets'),
'Option': _x('Option', 'keyboard key', 'code-snippets'),
'Alt': _x('Alt', 'keyboard key', 'code-snippets'),
'Tab': _x('Tab', 'keyboard key', 'code-snippets'),
'Up': _x('Up', 'keyboard key', 'code-snippets'),
'Down': _x('Down', 'keyboard key', 'code-snippets'),
'A': _x('A', 'keyboard key', 'code-snippets'),
'D': _x('D', 'keyboard key', 'code-snippets'),
'F': _x('F', 'keyboard key', 'code-snippets'),
'G': _x('G', 'keyboard key', 'code-snippets'),
'R': _x('R', 'keyboard key', 'code-snippets'),
'S': _x('S', 'keyboard key', 'code-snippets'),
'Y': _x('Y', 'keyboard key', 'code-snippets'),
'Z': _x('Z', 'keyboard key', 'code-snippets'),
'/': _x('/', 'keyboard key', 'code-snippets'),
'[': _x(']', 'keyboard key', 'code-snippets'),
']': _x(']', 'keyboard key', 'code-snippets')
}
export type KeyboardKey = keyof typeof KEYBOARD_KEYS
export interface KeyboardShortcut {
label: string
mod: KeyboardKey | KeyboardKey[]
key: KeyboardKey
}
js/types/ScreenNotice.ts 0000644 00000000071 15153464550 0011263 0 ustar 00 export type ScreenNotice = ['error' | 'updated', string]
js/types/SelectOption.ts 0000644 00000000270 15153464550 0011313 0 ustar 00 import type { GroupBase } from 'react-select'
export interface SelectOption<T> {
readonly value: T
readonly label: string
}
export type SelectGroup<T> = GroupBase<SelectOption<T>>
js/types/Shortcodes.ts 0000644 00000000305 15153464550 0011017 0 ustar 00 export interface SourceShortcodeAtts {
id: string
line_numbers: boolean
}
export interface ContentShortcodeAtts {
id: string
name: string
php: boolean
format: boolean
shortcodes: boolean
}
js/types/Snippet.ts 0000644 00000001602 15153464550 0010325 0 ustar 00 export interface Snippet {
id: number
name: string
desc: string
code: string
tags: string[]
scope: SnippetScope
priority: number
active: boolean
network?: boolean
shared_network?: boolean | null
modified?: string
code_error?: [string, number] | null
}
export type SnippetType = typeof SNIPPET_TYPES[number]
export type SnippetScope = typeof SNIPPET_SCOPES[number]
export const SNIPPET_SCOPES = <const> [
'global', 'admin', 'front-end', 'single-use',
'content', 'head-content', 'footer-content',
'admin-css', 'site-css',
'site-head-js', 'site-footer-js'
]
export const SNIPPET_TYPES = <const> ['php', 'html', 'css', 'js']
export const SNIPPET_TYPE_SCOPES: Record<SnippetType, SnippetScope[]> = {
php: ['global', 'admin', 'front-end', 'single-use'],
html: ['content', 'head-content', 'footer-content'],
css: ['admin-css', 'site-css'],
js: ['site-head-js', 'site-footer-js']
}
js/types/SnippetsExport.ts 0000644 00000000214 15153464550 0011710 0 ustar 00 import type { Snippet } from './Snippet'
export interface SnippetsExport {
generator: string
date_created: string
snippets: Snippet[]
}
js/types/Window.ts 0000644 00000002662 15153464550 0010161 0 ustar 00 import type Prism from 'prismjs'
import type tinymce from 'tinymce'
import type { Snippet } from './Snippet'
import type { CodeEditorInstance, EditorOption, WordPressCodeEditor } from './WordPressCodeEditor'
import type { WordPressEditor } from './WordPressEditor'
declare global {
interface Window {
readonly wp: {
readonly editor?: WordPressEditor
readonly codeEditor: WordPressCodeEditor
}
readonly pagenow: string
readonly ajaxurl: string
readonly tinymce?: tinymce.EditorManager
readonly wpActiveEditor?: string
code_snippets_editor_preview?: CodeEditorInstance
readonly code_snippets_editor_settings: EditorOption[]
CODE_SNIPPETS_PRISM?: typeof Prism
readonly CODE_SNIPPETS?: {
isLicensed: boolean
restAPI: {
base: string
snippets: string
cloud: string
nonce: string
localToken: string
}
urls: {
plugin: string
manage: string
addNew: string
edit: string
connectCloud: string
}
}
readonly CODE_SNIPPETS_EDIT?: {
snippet: Snippet
pageTitleActions: Record<string, string>
isPreview: boolean
isLicensed: boolean
enableDownloads: boolean
scrollToNotices: boolean
extraSaveButtons: boolean
activateByDefault: boolean
enableDescription: boolean
editorTheme: string
tagOptions: {
enabled: boolean
allowSpaces: boolean
availableTags: string[]
}
descEditorOptions: {
rows: number
mediaButtons: boolean
}
}
}
}
js/types/WordPressCodeEditor.ts 0000644 00000001354 15153464550 0012601 0 ustar 00 import type { Editor, EditorConfiguration } from 'codemirror'
export interface EditorOption {
name: string
type: 'checkbox' | 'number' | 'select'
codemirror: keyof EditorConfiguration
}
export interface CodeEditorInstance {
codemirror: Editor
settings: CodeEditorSettings
}
export interface CodeEditorSettings {
codemirror: EditorConfiguration
csslint: Record<string, unknown>
htmlhint: Record<string, unknown>
jshint: Record<string, unknown>
onTabNext: () => void
onTabPrevious: () => void
onChangeLintingErrors: () => void
onUpdateErrorNotice: () => void
}
export interface WordPressCodeEditor {
initialize: (textarea: Element, options?: Partial<CodeEditorSettings>) => CodeEditorInstance
defaultSettings: CodeEditorSettings
}
js/types/WordPressEditor.ts 0000644 00000001144 15153464550 0012003 0 ustar 00 import type tinymce from 'tinymce'
export interface VisualEditorSettings {
tinymce: boolean | tinymce.Settings & {
toolbar1?: string | string[]
toolbar2?: string | string[]
toolbar3?: string | string[]
toolbar4?: string | string[]
}
quicktags: boolean | Record<string, string>
mediaButtons: boolean
}
export interface WordPressEditor {
initialize: (id: string, settings?: Partial<VisualEditorSettings>) => void
remove: (id: string) => void
getContent: (id: string) => string
}
export interface LocalisedEditor extends tinymce.Editor {
getLang: (s: string) => string | Record<string, string>
}
js/types/wp/Page.ts 0000644 00000000326 15153464550 0010207 0 ustar 00 import type { Post } from './Post'
export const PAGES_ENDPOINT = '/wp/v2/pages'
export interface Page extends Omit<Post, 'categories' | 'tags'> {
parent: number
menu_order: number
}
export type Pages = Page[]
js/types/wp/Post.ts 0000644 00000001735 15153464550 0010265 0 ustar 00 export const POSTS_ENDPOINT = '/wp/v2/posts'
export interface Post {
id: number
date: string | null
date_gmt?: string | null
readonly guid?: { rendered: string }
link: string
modified?: string
modified_gmt?: string
slug: string
status?: PostStatus
readonly type: string
password?: string
readonly permalink_template?: string
readonly generated_slug?: string
title: { rendered: string }
content?: {
rendered: string
protected: boolean
}
excerpt: {
rendered: string
protected: false
}
author: number
featured_media: number
comment_status?: 'open' | 'closed'
ping_status?: 'open' | 'closed'
format?: PostFormat
meta?: Record<string, unknown>
sticky?: boolean
template?: string
categories?: number[]
tags?: number[]
}
export type PostStatus = 'publish' | 'future' | 'draft' | 'pending' | 'private'
export type PostFormat =
'standard' | 'aside' | 'chat' | 'gallery' | 'link' | 'image' | 'quote' | 'status' | 'video' | 'audio'
export type Posts = Post[]
js/types/wp/PostType.ts 0000644 00000000460 15153464550 0011121 0 ustar 00 export const POST_TYPES_ENDPOINT = '/wp/v2/types'
export interface PostType {
description: string
hierarchical: boolean
has_archive: boolean
name: string
slug: string
icon: string
taxonomies: string[]
rest_base: string
rest_namespace: string
}
export type PostTypes = Record<string, PostType>
js/types/wp/Term.ts 0000644 00000001042 15153464550 0010236 0 ustar 00 export const TAGS_ENDPOINT = '/wp/v2/tags'
export const CATEGORIES_ENDPOINT = '/wp/v2/categories'
export interface Term {
id: number
count: number
description: string
link: string
name: string
slug: string
taxonomy: Taxonomy
meta: Record<string, unknown>
}
export type PostTag = Term
export interface Category extends Term {
parent: number
}
export type Taxonomy = 'category' | 'post_tag' | 'nav_menu' | 'link_category' | 'post_format'
export type Terms = Term[]
export type PostTags = PostTag[]
export type Categories = Category[]
js/types/wp/User.ts 0000644 00000001037 15153464550 0010251 0 ustar 00 export const USERS_ENDPOINT = '/wp/v2/users'
export interface User {
readonly id: number
username?: string
name: string
first_name?: string
last_name?: string
email?: string
url: string
description: string
readonly link: string
locale?: string
nickname?: string
slug: string
registered_date?: string
roles?: string[]
readonly capabilities?: Record<string, boolean>
readonly extra_capabilities?: Record<string, boolean>
readonly avatar_urls: Record<string, string>
meta: Record<string, unknown>
}
export type Users = User[]
js/utils/Linter.ts 0000644 00000010701 15153464550 0010134 0 ustar 00 /**
* Based on work licensed under the BSD 3-Clause license.
*
* Copyright (c) 2017, glayzzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import { Engine } from 'php-parser'
import CodeMirror from 'codemirror'
import type { Block, Location, Node } from 'php-parser'
export interface Annotation {
message: string
severity: string
from: CodeMirror.Position
to: CodeMirror.Position
}
export interface Identifier extends Node {
name: string
}
export interface Declaration extends Node {
name: Identifier | string
}
export class Linter {
private readonly code: string
private readonly function_names: Set<string>
private readonly class_names: Set<string>
public readonly annotations: Annotation[]
/**
* Constructor.
* @param code
*/
constructor(code: string) {
this.code = code
this.annotations = []
this.function_names = new Set()
this.class_names = new Set()
}
/**
* Lint the provided code.
*/
lint() {
const parser = new Engine({
parser: {
suppressErrors: true,
version: 800
},
ast: {
withPositions: true
}
})
try {
const program = parser.parseEval(this.code)
if (0 < program.errors.length) {
for (const error of program.errors) {
this.annotate(error.message, error.loc)
}
}
this.visit(program)
} catch (error) {
console.error(error)
}
}
/**
* Visit nodes recursively.
* @param node
*/
visit(node: Node) {
if (node.kind) {
this.validate(node)
}
if ('children' in node) {
const block = <Block> node
for (const child of block.children) {
this.visit(child)
}
}
}
/**
* Check whether a given identifier has already been defined, creating an annotation if so.
* @param identifier
* @param registry
* @param label
*/
checkDuplicateIdentifier(identifier: Identifier, registry: Set<string>, label: string) {
if (registry.has(identifier.name)) {
this.annotate(`Cannot redeclare ${label} ${identifier.name}()`, identifier.loc)
} else {
registry.add(identifier.name)
}
}
/**
* Perform additional validations on nodes.
* @param node
*/
validate(node: Node) {
const decl = <Declaration> node
const ident = <Identifier> decl.name
if (!('name' in decl && 'name' in ident) || 'identifier' !== ident.kind) {
return
}
if ('function' === node.kind) {
this.checkDuplicateIdentifier(ident, this.function_names, 'function')
} else if ('class' === node.kind) {
this.checkDuplicateIdentifier(ident, this.class_names, 'class')
}
}
/**
* Create a lint annotation.
* @param message
* @param location
* @param severity
*/
annotate(message: string, location: Location | null, severity = 'error') {
const [start, end] = location
? location.end.offset < location.start.offset ? [location.end, location.start] : [location.start, location.end]
: [{ line: 0, column: 0 }, { line: 0, column: 0 }]
this.annotations.push({
message,
severity,
from: CodeMirror.Pos(start.line - 1, start.column),
to: CodeMirror.Pos(end.line - 1, end.column)
})
}
}
js/utils/errors.ts 0000644 00000000120 15153464550 0010205 0 ustar 00 export const handleUnknownError = (error: unknown) => {
console.error(error)
}
js/utils/files.ts 0000644 00000002126 15153464550 0010003 0 ustar 00 import { getSnippetType } from './snippets'
import type { Snippet } from '../types/Snippet'
const SECOND_IN_MS = 1000
const TIMEOUT_SECONDS = 40
const MIME_INFO = <const> {
php: ['php', 'text/php'],
html: ['php', 'text/php'],
css: ['css', 'text/css'],
js: ['js', 'text/javascript'],
json: ['json', 'application/json']
}
export const downloadAsFile = (content: BlobPart, filename: string, type: string) => {
const link = document.createElement('a')
link.download = filename
link.href = URL.createObjectURL(new Blob([content], { type }))
setTimeout(() => URL.revokeObjectURL(link.href), TIMEOUT_SECONDS * SECOND_IN_MS)
setTimeout(() => link.click(), 0)
}
export const downloadSnippetExportFile = (
content: BlobPart,
{ id, name, scope }: Snippet,
type?: keyof typeof MIME_INFO
) => {
const [ext, mimeType] = MIME_INFO[type ?? getSnippetType(scope)]
const sanitizedName = name.toLowerCase().replace(/[^\w-]+/g, '-').trim()
const title = '' === sanitizedName ? `snippet-${id}` : sanitizedName
const filename = `${title}.code-snippets.${ext}`
downloadAsFile(content, filename, mimeType)
}
js/utils/general.ts 0000644 00000000371 15153464550 0010316 0 ustar 00 export const isNetworkAdmin = (): boolean =>
window.pagenow.endsWith('-network')
export const isMacOS = (): boolean =>
null !== /mac/i.exec(window.navigator.userAgent)
export const isLicensed = (): boolean =>
!!window.CODE_SNIPPETS?.isLicensed
js/utils/restAPI.ts 0000644 00000001431 15153464550 0010206 0 ustar 00 import axios from 'axios'
import { trimLeadingChar, trimTrailingChar } from './text'
import type { AxiosRequestConfig, AxiosResponse } from 'axios'
const REST_BASE = window.CODE_SNIPPETS?.restAPI.base ?? ''
const getRestUrl = (endpoint: string): string =>
`${trimTrailingChar(REST_BASE, '/')}/${trimLeadingChar(endpoint, '/')}`
const GET_CACHE: Record<string, AxiosResponse<unknown> | undefined> = {}
export const getCached = <T, D>(endpoint: string, refresh = false, config?: AxiosRequestConfig<D>): Promise<AxiosResponse<T, D>> =>
!refresh && GET_CACHE[endpoint]
? Promise.resolve(<AxiosResponse<T, D>> GET_CACHE[endpoint])
: axios
.get<T, AxiosResponse<T, D>, D>(getRestUrl(endpoint), config)
.then(response => {
GET_CACHE[endpoint] = response
return response
})
js/utils/shortcodes.ts 0000644 00000000532 15153464550 0011055 0 ustar 00 export type ShortcodeAtts = Record<string, unknown>
export const buildShortcodeTag = (tag: string, atts: ShortcodeAtts): string =>
`[${[
tag,
...Object.entries(atts)
.filter(([, value]) => Boolean(value))
.map(([att, value]) =>
'boolean' === typeof value ? att : `${att}=${JSON.stringify(value)}`)
].filter(Boolean).join(' ')}]`
js/utils/snippets.ts 0000644 00000001710 15153464550 0010544 0 ustar 00 import { isNetworkAdmin } from './general'
import type { Snippet, SnippetScope, SnippetType } from '../types/Snippet'
const PRO_TYPES: SnippetType[] = ['css', 'js']
export const createEmptySnippet = (): Snippet => ({
id: 0,
name: '',
desc: '',
code: '',
tags: [],
scope: 'global',
modified: '',
active: false,
network: isNetworkAdmin(),
shared_network: null,
priority: 10
})
export const getSnippetType = (snippetOrScope: Snippet | SnippetScope): SnippetType => {
const scope = 'string' === typeof snippetOrScope ? snippetOrScope : snippetOrScope.scope
switch (true) {
case scope.endsWith('-css'):
return 'css'
case scope.endsWith('-js'):
return 'js'
case scope.endsWith('content'):
return 'html'
default:
return 'php'
}
}
export const isProSnippet = (snippet: Snippet | SnippetScope): boolean =>
PRO_TYPES.includes(getSnippetType(snippet))
export const isProType = (type: SnippetType): boolean =>
PRO_TYPES.includes(type)
js/utils/text.ts 0000644 00000001157 15153464550 0007670 0 ustar 00 export const toCamelCase = (text: string): string =>
text.replace(/-(?<letter>[a-z])/g, (_, letter: string) => letter.toUpperCase())
export const trimLeadingChar = (text: string, character: string): string =>
character === text.charAt(0) ? text.slice(1) : text
export const trimTrailingChar = (text: string, character: string): string =>
character === text.charAt(text.length - 1) ? text.slice(0, -1) : text
export const truncateWords = (text: string, wordCount: number): string => {
const words = text.trim().split(/\s+/)
return words.length > wordCount
? `${words.slice(0, wordCount).join(' ')}…`
: text
}
license.txt 0000644 00000044647 15153464550 0006756 0 ustar 00 Code Snippets – WordPress Plugin
Copyright 2012-2022 Shea Bunge
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, see <https://www.gnu.org/licenses/>.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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.
<signature of Ty Coon>, 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.
php/admin-menus/class-admin-menu.php 0000644 00000011166 15153464550 0013433 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Base class for a plugin admin menu.
*/
abstract class Admin_Menu {
/**
* The snippet page short name.
*
* @var string
*/
public string $name;
/**
* The label shown in the admin menu.
*
* @var string
*/
public string $label;
/**
* The text used for the page title.
*
* @var string
*/
public string $title;
/**
* The base slug for the top-level admin menu.
*
* @var string
*/
protected string $base_slug;
/**
* The slug for this admin menu.
*
* @var string
*/
protected string $slug;
/**
* Constructor.
*
* @param string $name The snippet page short name.
* @param string $label The label shown in the admin menu.
* @param string $title The text used for the page title.
*/
public function __construct( string $name, string $label, string $title ) {
$this->name = $name;
$this->label = $label;
$this->title = $title;
$this->base_slug = code_snippets()->get_menu_slug();
$this->slug = code_snippets()->get_menu_slug( $name );
}
/**
* Register action and filter hooks.
*
* @return void
*/
public function run() {
if ( ! code_snippets()->is_compact_menu() ) {
add_action( 'admin_menu', array( $this, 'register' ) );
add_action( 'network_admin_menu', array( $this, 'register' ) );
}
}
/**
* Add a sub-menu to the Snippets menu.
*
* @param string $slug Menu slug.
* @param string $label Label shown in admin menu.
* @param string $title Page title.
*
* @return void
*/
public function add_menu( string $slug, string $label, string $title ) {
$hook = add_submenu_page(
$this->base_slug,
$title,
$label,
code_snippets()->get_cap(),
$slug,
array( $this, 'render' )
);
add_action( 'load-' . $hook, array( $this, 'load' ) );
}
/**
* Register the admin menu
*/
public function register() {
$this->add_menu( $this->slug, $this->label, $this->title );
}
/**
* Render the content of a vew template
*
* @param string $name Name of view template to render.
*/
protected function render_view( string $name ) {
include dirname( PLUGIN_FILE ) . '/php/views/' . $name . '.php';
}
/**
* Render the menu
*/
public function render() {
$this->render_view( $this->name );
}
/**
* Print the status and error messages
*/
protected function print_messages() {
// None required by default.
}
/**
* Executed when the admin page is loaded
*/
public function load() {
// Make sure the user has permission to be here.
if ( ! current_user_can( code_snippets()->get_cap() ) ) {
wp_die( esc_html__( 'You are not authorized to access this page.', 'code-snippets' ) );
}
// Create the snippet tables if they are missing.
$db = code_snippets()->db;
if ( is_multisite() ) {
$db->create_missing_table( $db->ms_table );
}
$db->create_missing_table( $db->table );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
}
/**
* Enqueue scripts and stylesheets for the admin page, if necessary
*/
abstract public function enqueue_assets();
/**
* Generate a list of page title links for passing to React.
*
* @param array<string> $actions List of actions to convert into links, as array values.
*
* @return array<string, string> Link labels keyed to link URLs.
*/
public function page_title_action_links( array $actions ): array {
$plugin = code_snippets();
$links = [];
foreach ( $actions as $action ) {
if ( 'settings' === $action && ! isset( $plugin->admin->menus['settings'] ) ) {
continue;
}
$url = $plugin->get_menu_url( $action );
if ( isset( $_GET['type'] ) && in_array( $_GET['type'], Snippet::get_types(), true ) ) {
$url = add_query_arg( 'type', sanitize_key( wp_unslash( $_GET['type'] ) ), $url );
}
switch ( $action ) {
case 'manage':
$label = _x( 'Manage', 'snippets', 'code-snippets' );
break;
case 'add':
$label = _x( 'Add New', 'snippet', 'code-snippets' );
break;
case 'import':
$label = _x( 'Import', 'snippets', 'code-snippets' );
break;
case 'settings':
$label = _x( 'Settings', 'snippets', 'code-snippets' );
break;
default:
$label = '';
}
if ( $label && $url ) {
$links[ $label ] = $url;
}
}
return $links;
}
/**
* Render a list of links to other pages in the page title
*
* @param array<string> $actions List of actions to render as links, as array values.
*/
public function render_page_title_actions( array $actions ) {
foreach ( $this->page_title_action_links( $actions ) as $label => $url ) {
printf( '<a href="%s" class="page-title-action">%s</a>', esc_url( $url ), esc_html( $label ) );
}
}
}
php/admin-menus/class-edit-menu.php 0000644 00000013577 15153464550 0013300 0 ustar 00 <?php
namespace Code_Snippets;
use function Code_Snippets\Settings\get_setting;
/**
* This class handles the add/edit menu.
*/
class Edit_Menu extends Admin_Menu {
/**
* Handle for JavaScript asset file.
*/
const JS_HANDLE = 'code-snippets-edit-menu';
/**
* Handle for CSS asset file.
*/
const CSS_HANDLE = 'code-snippets-edit';
/**
* The snippet object currently being edited
*
* @var Snippet|null
* @see Edit_Menu::load_snippet_data()
*/
protected ?Snippet $snippet = null;
/**
* Constructor.
*
* @return void
*/
public function __construct() {
parent::__construct(
'edit',
_x( 'Edit Snippet', 'menu label', 'code-snippets' ),
__( 'Edit Snippet', 'code-snippets' )
);
}
/**
* Register action and filter hooks.
*
* @return void
*/
public function run() {
parent::run();
$this->remove_debug_bar_codemirror();
}
/**
* Register the admin menu
*
* @return void
*/
public function register() {
parent::register();
// Only preserve the edit menu if we are currently editing a snippet.
if ( ! isset( $_REQUEST['page'] ) || $_REQUEST['page'] !== $this->slug ) {
remove_submenu_page( $this->base_slug, $this->slug );
}
// Add New Snippet menu.
$this->add_menu(
code_snippets()->get_menu_slug( 'add' ),
_x( 'Add New', 'menu label', 'code-snippets' ),
__( 'Add New Snippet', 'code-snippets' )
);
}
/**
* Executed when the menu is loaded.
*
* @return void
*/
public function load() {
parent::load();
$this->load_snippet_data();
$this->ensure_correct_page();
$contextual_help = new Contextual_Help( 'edit' );
$contextual_help->load();
}
/**
* Disallow vising the Edit Snippet page without a valid ID.
*
* @return void
*/
protected function ensure_correct_page() {
$screen = get_current_screen();
$edit_hook = get_plugin_page_hookname( $this->slug, $this->base_slug );
$edit_hook .= $screen->in_admin( 'network' ) ? '-network' : '';
// Disallow visiting the edit snippet page without a valid ID.
if ( $screen->base === $edit_hook && ( empty( $_REQUEST['id'] ) || 0 === $this->snippet->id || null === $this->snippet->id ) &&
! isset( $_REQUEST['preview'] ) ) {
wp_safe_redirect( code_snippets()->get_menu_url( 'add' ) );
exit;
}
}
/**
* Render the edit menu interface.
*
* @return void
*/
public function render() {
printf(
'<div id="edit-snippet-form-container">%s</div>',
esc_html__( 'Loading edit page…', 'code-snippets' )
);
}
/**
* Load the data for the snippet currently being edited.
*/
public function load_snippet_data() {
$edit_id = isset( $_REQUEST['id'] ) ? absint( $_REQUEST['id'] ) : 0;
$this->snippet = get_snippet( $edit_id );
if ( 0 === $edit_id && isset( $_GET['type'] ) && sanitize_key( $_GET['type'] ) !== $this->snippet->type ) {
$type = sanitize_key( $_GET['type'] );
$default_scopes = [
'php' => 'global',
'css' => 'site-css',
'html' => 'content',
'js' => 'site-head-js',
];
if ( isset( $default_scopes[ $type ] ) ) {
$this->snippet->scope = $default_scopes[ $type ];
}
}
$this->snippet = apply_filters( 'code_snippets/admin/load_snippet_data', $this->snippet );
}
/**
* Enqueue assets for the edit menu
*
* @return void
*/
public function enqueue_assets() {
$plugin = code_snippets();
$rtl = is_rtl() ? '-rtl' : '';
$settings = Settings\get_settings_values();
$tags_enabled = $settings['general']['enable_tags'];
$desc_enabled = $settings['general']['enable_description'];
enqueue_code_editor( $this->snippet->type );
wp_enqueue_style(
self::CSS_HANDLE,
plugins_url( "dist/edit$rtl.css", $plugin->file ),
[
'code-editor',
'wp-components',
],
$plugin->version
);
wp_enqueue_script(
self::JS_HANDLE,
plugins_url( 'dist/edit.js', $plugin->file ),
[
'code-snippets-code-editor',
'react',
'react-dom',
'wp-url',
'wp-i18n',
'wp-api-fetch',
'wp-components',
'wp-block-editor',
],
$plugin->version,
true
);
wp_set_script_translations( self::JS_HANDLE, 'code-snippets' );
if ( $desc_enabled ) {
remove_editor_styles();
wp_enqueue_editor();
}
$plugin->localize_script( self::JS_HANDLE );
wp_localize_script(
self::JS_HANDLE,
'CODE_SNIPPETS_EDIT',
[
'snippet' => $this->snippet->get_fields(),
'pageTitleActions' => $plugin->is_compact_menu() ? $this->page_title_action_links( [ 'manage', 'import', 'settings' ] ) : [],
'isPreview' => isset( $_REQUEST['preview'] ),
'activateByDefault' => get_setting( 'general', 'activate_by_default' ),
'editorTheme' => get_setting( 'editor', 'theme' ),
'scrollToNotices' => apply_filters( 'code_snippets/scroll_to_notices', true ),
'extraSaveButtons' => apply_filters( 'code_snippets/extra_save_buttons', true ),
'enableDownloads' => apply_filters( 'code_snippets/enable_downloads', true ),
'enableDescription' => $desc_enabled,
'tagOptions' => apply_filters(
'code_snippets/tag_editor_options',
[
'enabled' => $tags_enabled,
'allowSpaces' => true,
'availableTags' => $tags_enabled ? get_all_snippet_tags() : [],
]
),
'descEditorOptions' => [
'rows' => $settings['general']['visual_editor_rows'],
],
]
);
}
/**
* Remove the old CodeMirror version used by the Debug Bar Console plugin that is messing up the snippet editor.
*/
public function remove_debug_bar_codemirror() {
// Try to discern if we are on the single snippet page as good as we can at this early time.
$is_codemirror_page =
is_admin() && 'admin.php' === $GLOBALS['pagenow'] && isset( $_GET['page'] ) && (
code_snippets()->get_menu_slug( 'edit' ) === $_GET['page'] ||
code_snippets()->get_menu_slug( 'settings' ) === $_GET['page']
);
if ( $is_codemirror_page ) {
remove_action( 'debug_bar_enqueue_scripts', 'debug_bar_console_scripts' );
}
}
}
php/admin-menus/class-import-menu.php 0000644 00000010556 15153464550 0013657 0 ustar 00 <?php
namespace Code_Snippets;
/**
* This class handles the import admin menu.
*
* @since 2.4.0
* @package Code_Snippets
*/
class Import_Menu extends Admin_Menu {
/**
* Class constructor
*/
public function __construct() {
parent::__construct(
'import',
_x( 'Import', 'menu label', 'code-snippets' ),
__( 'Import Snippets', 'code-snippets' )
);
}
/**
* Register action and filter hooks
*/
public function run() {
parent::run();
add_action( 'admin_init', array( $this, 'register_importer' ) );
add_action( 'load-importer-code-snippets', array( $this, 'load' ) );
}
/**
* Executed when the menu is loaded
*/
public function load() {
parent::load();
$contextual_help = new Contextual_Help( 'import' );
$contextual_help->load();
$this->process_import_files();
}
/**
* Process the uploaded import files
*/
private function process_import_files() {
// Ensure the import file exists.
if ( ! isset(
$_FILES['code_snippets_import_files']['name'],
$_FILES['code_snippets_import_files']['type'],
$_FILES['code_snippets_import_files']['tmp_name']
) ) {
return;
}
check_admin_referer( 'import_code_snippets_file' );
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$upload_files = $_FILES['code_snippets_import_files']['tmp_name'];
// phpcs:disable WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$upload_filenames = $_FILES['code_snippets_import_files']['name'];
$upload_mime_types = array_map( 'sanitize_mime_type', wp_unslash( $_FILES['code_snippets_import_files']['type'] ) );
$count = 0;
$network = is_network_admin();
$error = false;
$dup_action = isset( $_POST['duplicate_action'] ) ? sanitize_key( $_POST['duplicate_action'] ) : 'ignore';
// Loop through the uploaded files and import the snippets.
foreach ( $upload_files as $i => $import_file ) {
$filename_info = pathinfo( $upload_filenames[ $i ] );
$ext = $filename_info['extension'];
$mime_type = $upload_mime_types[ $i ];
$import = new Import( $import_file, $network, $dup_action );
if ( 'json' === $ext || 'application/json' === $mime_type ) {
$result = $import->import_json();
} elseif ( 'xml' === $ext || 'text/xml' === $mime_type ) {
$result = $import->import_xml();
} else {
$result = false;
}
if ( false === $result ) {
$error = true;
} else {
$count += count( $result );
}
}
// Send the amount of imported snippets to the page.
$url = add_query_arg( $error ? array( 'error' => true ) : array( 'imported' => $count ) );
wp_safe_redirect( esc_url_raw( $url ) );
exit;
}
/**
* Add the importer to the Tools > Import menu
*/
public function register_importer() {
/* Only register the importer if the current user can manage snippets */
if ( ! defined( 'WP_LOAD_IMPORTERS' ) || ! code_snippets()->current_user_can() ) {
return;
}
/* Register the Code Snippets importer with WordPress */
register_importer(
'code-snippets',
__( 'Code Snippets', 'code-snippets' ),
__( 'Import snippets from a code snippets export file', 'code-snippets' ),
array( $this, 'render' )
);
}
/**
* Print the status and error messages
*/
protected function print_messages() {
if ( ! empty( $_REQUEST['error'] ) ) {
echo '<div id="message" class="error fade"><p>';
esc_html_e( 'An error occurred when processing the import files.', 'code-snippets' );
echo '</p></div>';
}
if ( isset( $_REQUEST['imported'] ) ) {
echo '<div id="message" class="updated fade"><p>';
$imported = intval( $_REQUEST['imported'] );
if ( 0 === $imported ) {
esc_html_e( 'No snippets were imported.', 'code-snippets' );
} else {
/* translators: 1: amount of snippets imported, 2: link to Snippets menu */
$text = _n(
'Successfully imported <strong>%1$d</strong> snippet. <a href="%2$s">Have fun!</a>',
'Successfully imported <strong>%1$d</strong> snippets. <a href="%2$s">Have fun!</a>',
$imported,
'code-snippets'
);
printf( wp_kses_post( $text ), esc_html( $imported ), esc_url( code_snippets()->get_menu_url( 'manage' ) ) );
}
echo '</p></div>';
}
}
/**
* Empty implementation for enqueue_assets.
*
* @return void
*/
public function enqueue_assets() {
// none required.
}
}
php/admin-menus/class-manage-menu.php 0000644 00000023512 15153464550 0013571 0 ustar 00 <?php
namespace Code_Snippets;
use Code_Snippets\Cloud\Cloud_Search_List_Table;
use function Code_Snippets\Settings\get_setting;
/**
* This class handles the manage snippets menu
*
* @since 2.4.0
* @package Code_Snippets
*/
class Manage_Menu extends Admin_Menu {
/**
* Instance of the list table class.
*
* @var List_Table
*/
public List_Table $list_table;
/**
* Instance of the cloud list table class for search results.
*
* @var Cloud_Search_List_Table
*/
public Cloud_Search_List_Table $cloud_search_list_table;
/**
* Class constructor
*/
public function __construct() {
parent::__construct(
'manage',
_x( 'All Snippets', 'menu label', 'code-snippets' ),
__( 'Snippets', 'code-snippets' )
);
}
/**
* Register action and filter hooks
*/
public function run() {
parent::run();
if ( code_snippets()->is_compact_menu() ) {
add_action( 'admin_menu', array( $this, 'register_compact_menu' ), 2 );
add_action( 'network_admin_menu', array( $this, 'register_compact_menu' ), 2 );
}
add_action( 'admin_menu', array( $this, 'register_upgrade_menu' ), 500 );
add_filter( 'set-screen-option', array( $this, 'save_screen_option' ), 10, 3 );
add_action( 'wp_ajax_update_code_snippet', array( $this, 'ajax_callback' ) );
}
/**
* Register the top-level 'Snippets' menu and associated 'Manage' subpage
*/
public function register() {
$icon_xml = '<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024"><path fill="transparent" d="M191.968 464.224H350.88c23.68 0 42.656 19.2 42.656 42.656 0 11.488-4.48 21.984-11.968 29.632l.192.448-108.768 108.736c-75.104 75.136-75.104 196.512 0 271.584 74.88 74.848 196.448 74.848 271.552 0 74.88-75.104 74.88-196.48 0-271.584-21.76-21.504-47.36-37.12-74.464-46.272l28.608-28.576h365.248c87.04 0 157.856-74.016 159.968-166.4 0-1.472.224-2.752 0-4.256-2.112-23.904-22.368-42.656-46.912-42.656h-264.96L903.36 166.208c17.504-17.504 18.56-45.024 3.2-63.36-1.024-1.28-2.08-2.144-3.2-3.2-66.528-63.552-169.152-65.92-230.56-4.48L410.432 357.536h-46.528c12.8-25.6 20.032-54.624 20.032-85.344 0-106.016-85.952-192-192-192-106.016 0-191.968 85.984-191.968 192 .032 106.08 85.984 192.032 192 192.032zm85.344-191.968c0 47.136-38.176 85.344-85.344 85.344-47.136 0-85.312-38.176-85.312-85.344s38.176-85.344 85.312-85.344c47.168 0 85.344 38.208 85.344 85.344zm191.776 449.056c33.28 33.248 33.28 87.264 0 120.512-33.28 33.472-87.264 33.472-120.736 0-33.28-33.248-33.28-87.264 0-120.512 33.472-33.504 87.456-33.504 120.736 0z"/></svg>';
// phpcs:disable WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
$encoded_icon = base64_encode( $icon_xml );
// Register the top-level menu.
add_menu_page(
__( 'Snippets', 'code-snippets' ),
_x( 'Snippets', 'top-level menu label', 'code-snippets' ),
code_snippets()->get_cap(),
code_snippets()->get_menu_slug(),
array( $this, 'render' ),
"data:image/svg+xml;base64,$encoded_icon",
apply_filters( 'code_snippets/admin/menu_position', is_network_admin() ? 21 : 67 )
);
// Register the sub-menu.
parent::register();
}
/**
* Register the 'upgrade' menu item.
*
* @return void
*/
public function register_upgrade_menu() {
if ( get_setting( 'general', 'hide_upgrade_menu' ) ) {
return;
}
$menu_title = sprintf(
'<span class="button button-primary code-snippets-upgrade-button">%s %s</span>',
_x( 'Go Pro', 'top-level menu label', 'code-snippets' ),
'<span class="dashicons dashicons-external"></span>'
);
$hook = add_submenu_page(
code_snippets()->get_menu_slug(),
__( 'Upgrade to Pro', 'code-snippets' ),
$menu_title,
code_snippets()->get_cap(),
'code_snippets_upgrade',
'__return_empty_string',
100
);
add_action( "load-$hook", [ $this, 'load_upgrade_menu' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_menu_button_css' ] );
}
/**
* Print CSS required for the upgrade button.
*
* @return void
*/
public function enqueue_menu_button_css() {
wp_enqueue_style(
'code-snippets-menu-button',
plugins_url( 'dist/menu-button.css', PLUGIN_FILE ),
[],
PLUGIN_VERSION
);
}
/**
* Redirect the user upon opening the upgrade menu.
*
* @return void
*/
public function load_upgrade_menu() {
wp_safe_redirect( 'https://snipco.de/JE2f' );
exit;
}
/**
* Add menu pages for the compact menu
*/
public function register_compact_menu() {
if ( ! code_snippets()->is_compact_menu() ) {
return;
}
$sub = code_snippets()->get_menu_slug( isset( $_GET['sub'] ) ? sanitize_key( $_GET['sub'] ) : 'snippets' );
$classmap = array(
'snippets' => 'manage',
'add-snippet' => 'edit',
'edit-snippet' => 'edit',
'import-code-snippets' => 'import',
'snippets-settings' => 'settings',
);
$menus = code_snippets()->admin->menus;
$class = isset( $classmap[ $sub ], $menus[ $classmap[ $sub ] ] ) ? $menus[ $classmap[ $sub ] ] : $this;
/* Add a submenu to the Tools menu */
$hook = add_submenu_page(
'tools.php',
__( 'Snippets', 'code-snippets' ),
_x( 'Snippets', 'tools submenu label', 'code-snippets' ),
code_snippets()->get_cap(),
code_snippets()->get_menu_slug(),
array( $class, 'render' )
);
add_action( 'load-' . $hook, array( $class, 'load' ) );
}
/**
* Executed when the admin page is loaded
*/
public function load() {
parent::load();
$contextual_help = new Contextual_Help( 'manage' );
$contextual_help->load();
$this->cloud_search_list_table = new Cloud_Search_List_Table();
$this->cloud_search_list_table->prepare_items();
$this->list_table = new List_Table();
$this->list_table->prepare_items();
}
/**
* Enqueue scripts and stylesheets for the admin page
*/
public function enqueue_assets() {
$plugin = code_snippets();
$rtl = is_rtl() ? '-rtl' : '';
wp_enqueue_style(
'code-snippets-manage',
plugins_url( "dist/manage$rtl.css", $plugin->file ),
[],
$plugin->version
);
wp_enqueue_script(
'code-snippets-manage-js',
plugins_url( 'dist/manage.js', $plugin->file ),
[ 'wp-i18n' ],
$plugin->version,
true
);
wp_set_script_translations( 'code-snippets-manage-js', 'code-snippets' );
if ( 'cloud' === $this->get_current_type() || 'cloud_search' === $this->get_current_type() ) {
Front_End::enqueue_all_prism_themes();
}
}
/**
* Get the currently displayed snippet type.
*
* @return string
*/
protected function get_current_type(): string {
$types = Plugin::get_types();
$current_type = isset( $_GET['type'] ) ? sanitize_key( wp_unslash( $_GET['type'] ) ) : 'all';
return isset( $types[ $current_type ] ) ? $current_type : 'all';
}
/**
* Display a Go Pro badge.
*
* @return void
*/
public function print_pro_message() {
if ( ! code_snippets()->licensing->is_licensed() ) {
echo '<span class="go-pro-badge">', esc_html_x( 'Pro', 'go pro badge', 'code-snippets' ), '</span>';
}
}
/**
* Print the status and error messages
*
* @return void
*/
protected function print_messages() {
$this->render_view( 'partials/list-table-notices' );
}
/**
* Handles saving the user's snippets per page preference
*
* @param mixed $status Current screen option status.
* @param string $option The screen option name.
* @param mixed $value Screen option value.
*
* @return mixed
*/
public function save_screen_option( $status, string $option, $value ) {
return 'snippets_per_page' === $option ? $value : $status;
}
/**
* Update the priority value for a snippet.
*
* @param Snippet $snippet Snippet to update.
*
* @return void
*/
private function update_snippet_priority( Snippet $snippet ) {
global $wpdb;
$table = code_snippets()->db->get_table_name( $snippet->network );
$wpdb->update(
$table,
array( 'priority' => $snippet->priority ),
array( 'id' => $snippet->id ),
array( '%d' ),
array( '%d' )
);
clean_snippets_cache( $table );
}
/**
* Handle AJAX requests
*/
public function ajax_callback() {
check_ajax_referer( 'code_snippets_manage_ajax' );
if ( ! isset( $_POST['field'], $_POST['snippet'] ) ) {
wp_send_json_error(
array(
'type' => 'param_error',
'message' => 'incomplete request',
)
);
}
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$snippet_data = array_map( 'sanitize_text_field', json_decode( wp_unslash( $_POST['snippet'] ), true ) );
$snippet = new Snippet( $snippet_data );
$field = sanitize_key( $_POST['field'] );
if ( 'priority' === $field ) {
if ( ! isset( $snippet_data['priority'] ) || ! is_numeric( $snippet_data['priority'] ) ) {
wp_send_json_error(
array(
'type' => 'param_error',
'message' => 'missing snippet priority data',
)
);
}
$this->update_snippet_priority( $snippet );
} elseif ( 'active' === $field ) {
if ( ! isset( $snippet_data['active'] ) ) {
wp_send_json_error(
array(
'type' => 'param_error',
'message' => 'missing snippet active data',
)
);
}
if ( $snippet->shared_network ) {
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
if ( in_array( $snippet->id, $active_shared_snippets, true ) !== $snippet->active ) {
$active_shared_snippets = $snippet->active ?
array_merge( $active_shared_snippets, array( $snippet->id ) ) :
array_diff( $active_shared_snippets, array( $snippet->id ) );
update_option( 'active_shared_network_snippets', $active_shared_snippets );
clean_active_snippets_cache( code_snippets()->db->ms_table );
}
} elseif ( $snippet->active ) {
$result = activate_snippet( $snippet->id, $snippet->network );
if ( is_string( $result ) ) {
wp_send_json_error(
array(
'type' => 'action_error',
'message' => $result,
)
);
}
} else {
deactivate_snippet( $snippet->id, $snippet->network );
}
}
wp_send_json_success();
}
}
php/admin-menus/class-settings-menu.php 0000644 00000013543 15153464550 0014204 0 ustar 00 <?php
namespace Code_Snippets;
use const Code_Snippets\Settings\CACHE_KEY;
use const Code_Snippets\Settings\OPTION_GROUP;
use const Code_Snippets\Settings\OPTION_NAME;
/**
* This class handles the settings admin menu
*
* @since 2.4.0
* @package Code_Snippets
*/
class Settings_Menu extends Admin_Menu {
/**
* Settings page name as registered with the Settings API.
*/
const SETTINGS_PAGE = 'code-snippets';
/**
* Constructor
*/
public function __construct() {
parent::__construct(
'settings',
_x( 'Settings', 'menu label', 'code-snippets' ),
__( 'Snippets Settings', 'code-snippets' )
);
}
/**
* Executed when the admin page is loaded
*/
public function load() {
parent::load();
if ( is_network_admin() ) {
if ( Settings\are_settings_unified() ) {
$this->update_network_options();
} else {
wp_safe_redirect( code_snippets()->get_menu_url( 'settings', 'admin' ) );
exit;
}
}
}
/**
* Enqueue the stylesheet for the settings menu
*/
public function enqueue_assets() {
$plugin = code_snippets();
Settings\enqueue_editor_preview_assets();
wp_enqueue_style(
'code-snippets-settings',
plugins_url( 'dist/settings.css', $plugin->file ),
[ 'code-editor' ],
$plugin->version
);
}
/**
* Retrieve the list of settings sections.
*
* @return array<string, array<string, mixed>>
*/
private function get_sections(): array {
global $wp_settings_sections;
if ( ! isset( $wp_settings_sections[ self::SETTINGS_PAGE ] ) ) {
return array();
}
return (array) $wp_settings_sections[ self::SETTINGS_PAGE ];
}
/**
* Retrieve the name of the settings section currently being viewed.
*
* @param string $default_section Name of the default tab displayed.
*
* @return string
*/
public function get_current_section( string $default_section = 'general' ): string {
$sections = $this->get_sections();
if ( ! $sections ) {
return $default_section;
}
$active_tab = isset( $_REQUEST['section'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['section'] ) ) : $default_section;
return isset( $sections[ $active_tab ] ) ? $active_tab : $default_section;
}
/**
* Render the admin screen
*/
public function render() {
$update_url = is_network_admin() ? add_query_arg( 'update_site_option', true ) : admin_url( 'options.php' );
$current_section = $this->get_current_section();
?>
<div class="code-snippets-settings wrap" data-active-tab="<?php echo esc_attr( $current_section ); ?>">
<h1>
<?php
esc_html_e( 'Settings', 'code-snippets' );
if ( code_snippets()->is_compact_menu() ) {
$actions = [
_x( 'Manage', 'snippets', 'code-snippets' ) => code_snippets()->get_menu_url(),
_x( 'Add New', 'snippet', 'code-snippets' ) => code_snippets()->get_menu_url( 'add' ),
_X( 'Import', 'snippets', 'code-snippets' ) => code_snippets()->get_menu_url( 'import' ),
];
foreach ( $actions as $label => $url ) {
printf(
'<a href="%s" class="page-title-action">%s</a>',
esc_url( $url ),
esc_html( $label )
);
}
}
?>
</h1>
<?php settings_errors( OPTION_NAME ); ?>
<form action="<?php echo esc_url( $update_url ); ?>" method="post">
<input type="hidden" name="section" value="<?php echo esc_attr( $current_section ); ?>">
<?php
settings_fields( OPTION_GROUP );
$this->do_settings_tabs();
?>
<p class="submit">
<?php
submit_button( null, 'primary', 'submit', false );
submit_button(
__( 'Reset to Default', 'code-snippets' ),
'secondary',
sprintf( '%s[%s]', OPTION_NAME, 'reset_settings' ),
false
);
?>
</p>
</form>
</div>
<?php
}
/**
* Output snippet settings in tabs
*/
protected function do_settings_tabs() {
$sections = $this->get_sections();
$active_tab = $this->get_current_section();
echo '<h2 class="nav-tab-wrapper" id="settings-sections-tabs">';
foreach ( $sections as $section ) {
printf(
'<a class="nav-tab%s" data-section="%s" href="%s">%s</a>',
esc_attr( $active_tab ) === $section['id'] ? ' nav-tab-active' : '',
esc_attr( $section['id'] ),
esc_url( add_query_arg( 'section', $section['id'] ) ),
esc_html( $section['title'] )
);
}
echo '</h2>';
foreach ( $sections as $section ) {
if ( $section['title'] ) {
printf(
'<h2 id="%s-settings" class="settings-section-title">%s</h2>' . "\n",
esc_attr( $section['id'] ),
esc_html( $section['title'] )
);
}
if ( $section['callback'] ) {
call_user_func( $section['callback'], $section );
}
printf( '<div class="settings-section %s-settings"><table class="form-table">', esc_attr( $section['id'] ) );
do_settings_fields( self::SETTINGS_PAGE, $section['id'] );
echo '</table></div>';
}
}
/**
* Fill in for the Settings API in the Network Admin
*/
public function update_network_options() {
// Ensure the settings have been saved.
if ( empty( $_GET['update_site_option'] ) || empty( $_POST[ OPTION_NAME ] ) ) {
return;
}
check_admin_referer( 'code-snippets-options' );
// Retrieve the saved options and save them to the database.
$value = map_deep( wp_unslash( $_POST[ OPTION_NAME ] ), 'sanitize_key' );
update_site_option( OPTION_NAME, $value );
wp_cache_delete( CACHE_KEY );
// Add an updated notice.
if ( ! count( get_settings_errors() ) ) {
add_settings_error( 'general', 'settings_updated', __( 'Settings saved.', 'code-snippets' ), 'updated' );
}
set_transient( 'settings_errors', get_settings_errors(), 30 );
// Redirect back to the settings menu.
$redirect = add_query_arg( 'settings-updated', 'true', remove_query_arg( 'update_site_option', wp_get_referer() ) );
wp_safe_redirect( esc_url_raw( $redirect ) );
exit;
}
/**
* Empty implementation for print_messages.
*
* @return void
*/
protected function print_messages() {
// none required.
}
}
php/admin-menus/class-welcome-menu.php 0000644 00000003522 15153464550 0013773 0 ustar 00 <?php
namespace Code_Snippets;
/**
* This class handles the welcome menu.
*
* @since 3.7.0
* @package Code_Snippets
*/
class Welcome_Menu extends Admin_Menu {
/**
* Instance of Welcome_API class.
*
* @var Welcome_API
*/
protected Welcome_API $api;
/**
* Class constructor
*
* @param Welcome_API $api Instance of API class.
*/
public function __construct( $api ) {
parent::__construct(
'welcome',
_x( "What's New", 'menu label', 'code-snippets' ),
__( 'Welcome to Code Snippets', 'code-snippets' )
);
$this->api = $api;
}
/**
* Enqueue assets necessary for the welcome menu.
*
* @return void
*/
public function enqueue_assets() {
wp_enqueue_style(
'code-snippets-welcome',
plugins_url( 'dist/welcome.css', PLUGIN_FILE ),
[],
PLUGIN_VERSION
);
}
/**
* Retrieve a list of links to display in the page header.
*
* @return array<string, array{url: string, icon: string, label: string}>
*/
protected function get_header_links(): array {
$links = [
'cloud' => [
'url' => 'https://codesnippets.cloud',
'icon' => 'cloud',
'label' => __( 'Cloud', 'code-snippets' ),
],
'resources' => [
'url' => 'https://help.codesnippets.pro/',
'icon' => 'sos',
'label' => __( 'Support', 'code-snippets' ),
],
'facebook' => [
'url' => 'https://www.facebook.com/groups/282962095661875/',
'icon' => 'facebook',
'label' => __( 'Community', 'code-snippets' ),
],
'discord' => [
'url' => 'https://snipco.de/discord',
'icon' => 'discord',
'label' => __( 'Discord', 'code-snippets' ),
],
];
if ( ! code_snippets()->licensing->is_licensed() ) {
$links['pro'] = [
'url' => 'https://codesnippets.pro/pricing/',
'icon' => 'cart',
'label' => __( 'Get Pro', 'code-snippets' ),
];
}
return $links;
}
}
php/class-active-snippets.php 0000644 00000003544 15153464550 0012303 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Class for loading active snippets of various types.
*
* @package Code_Snippets
*/
class Active_Snippets {
/**
* Cached list of active snippets.
*
* @var Snippet[]
*/
private array $active_snippets = [];
/**
* Class constructor.
*/
public function __construct() {
add_action( 'init', array( $this, 'init' ) );
}
/**
* Initialise class functions.
*/
public function init() {
add_action( 'wp_head', [ $this, 'load_head_content' ] );
add_action( 'wp_footer', [ $this, 'load_footer_content' ] );
}
/**
* Fetch active snippets for a given scope, and cache the data in this class.
*
* @param string|string[] $scope Snippet scope.
*
* @return array[][]
*/
protected function fetch_active_snippets( $scope ) {
$scope_key = is_array( $scope ) ? implode( '|', $scope ) : $scope;
if ( ! isset( $this->active_snippets[ $scope_key ] ) ) {
$this->active_snippets[ $scope_key ] = code_snippets()->db->fetch_active_snippets( $scope );
}
return $this->active_snippets[ $scope_key ];
}
/**
* Print snippet code fetched from the database from a certain scope.
*
* @param string $scope Name of scope to print.
*/
private function print_content_snippets( string $scope ) {
$snippets_list = $this->fetch_active_snippets( [ 'head-content', 'footer-content' ] );
foreach ( $snippets_list as $snippets ) {
foreach ( $snippets as $snippet ) {
if ( $scope === $snippet['scope'] ) {
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo "\n", $snippet['code'], "\n";
}
}
}
}
/**
* Print head content snippets.
*/
public function load_head_content() {
$this->print_content_snippets( 'head-content' );
}
/**
* Print footer content snippets.
*/
public function load_footer_content() {
$this->print_content_snippets( 'footer-content' );
}
}
php/class-admin.php 0000644 00000025133 15153464550 0010253 0 ustar 00 <?php
namespace Code_Snippets;
use DateTimeImmutable;
use DateTimeZone;
use Exception;
/**
* Functions specific to the administration interface
*
* @package Code_Snippets
*/
class Admin {
/**
* Admin_Menu class instances
*
* @var array<string, Admin_Menu>
*/
public array $menus = array();
/**
* Welcome_API class instance.
*
* @var Welcome_API
*/
public Welcome_API $welcome_api;
/**
* Class constructor
*/
public function __construct() {
if ( is_admin() ) {
$this->welcome_api = new Welcome_API();
$this->run();
}
}
/**
* Initialise classes
*/
public function load_classes() {
$this->menus['manage'] = new Manage_Menu();
$this->menus['edit'] = new Edit_Menu();
$this->menus['import'] = new Import_Menu();
if ( is_network_admin() === Settings\are_settings_unified() ) {
$this->menus['settings'] = new Settings_Menu();
}
$this->menus['welcome'] = new Welcome_Menu( $this->welcome_api );
foreach ( $this->menus as $menu ) {
$menu->run();
}
}
/**
* Register action and filter hooks
*/
public function run() {
add_action( 'init', array( $this, 'load_classes' ), 11 );
add_filter( 'mu_menu_items', array( $this, 'mu_menu_items' ) );
add_filter( 'plugin_action_links_' . plugin_basename( PLUGIN_FILE ), array( $this, 'plugin_action_links' ), 10, 2 );
add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
add_filter( 'debug_information', array( $this, 'debug_information' ) );
add_action( 'code_snippets/admin/manage', array( $this, 'print_notices' ) );
}
/**
* Allow super admins to control site admin access to
* snippet admin menus
*
* Adds a checkbox to the *Settings > Network Settings*
* network admin menu
*
* @param array<string, string> $menu_items Current mu menu items.
*
* @return array<string, string> The modified mu menu items
*
* @since 1.7.1
*/
public function mu_menu_items( array $menu_items ): array {
$menu_items['snippets'] = __( 'Snippets', 'code-snippets' );
$menu_items['snippets_settings'] = __( 'Snippets » Settings', 'code-snippets' );
return $menu_items;
}
/**
* Modify the action links for this plugin.
*
* @param array<string> $actions Existing plugin action links.
* @param string $plugin_file The plugin the links are for.
*
* @return array<string> Modified plugin action links.
* @since 2.0.0
*/
public function plugin_action_links( array $actions, string $plugin_file ): array {
if ( plugin_basename( PLUGIN_FILE ) !== $plugin_file ) {
return $actions;
}
$format = '<a href="%1$s" title="%2$s">%3$s</a>';
$actions = array_merge(
[
sprintf(
$format,
esc_url( code_snippets()->get_menu_url( 'settings' ) ),
esc_html__( 'Change plugin settings', 'code-snippets' ),
esc_html__( 'Settings', 'code-snippets' )
),
sprintf(
$format,
esc_url( code_snippets()->get_menu_url() ),
esc_html__( 'Manage your existing snippets', 'code-snippets' ),
esc_html__( 'Snippets', 'code-snippets' )
),
],
$actions
);
if ( ! code_snippets()->licensing->is_licensed() ) {
$actions[] = sprintf(
'<a href="%1$s" title="%2$s" style="color: #d46f4d; font-weight: bold;" target="_blank">%3$s</a>',
'https://snipco.de/JE2i',
esc_attr__( 'Upgrade to Code Snippets Pro', 'code-snippets' ),
esc_html__( 'Go Pro', 'code-snippets' )
);
}
return $actions;
}
/**
* Adds extra links related to the plugin
*
* @param array<string> $plugin_meta Existing plugin info links.
* @param string $plugin_file The plugin the links are for.
*
* @return array<string> Modified plugin info links.
* @since 2.0.0
*/
public function plugin_row_meta( array $plugin_meta, string $plugin_file ): array {
if ( plugin_basename( PLUGIN_FILE ) !== $plugin_file ) {
return $plugin_meta;
}
$format = '<a href="%1$s" title="%2$s" target="_blank">%3$s</a>';
return array_merge(
$plugin_meta,
array(
sprintf(
$format,
'https://help.codesnippets.pro/',
esc_attr__( 'Find out how to get support with Code Snippets', 'code-snippets' ),
esc_html__( 'Docs and Support', 'code-snippets' )
),
sprintf(
$format,
'https://www.facebook.com/groups/codesnippetsplugin/',
esc_attr__( 'Join our community on Facebook', 'code-snippets' ),
esc_html__( 'Community', 'code-snippets' )
),
)
);
}
/**
* Add Code Snippets information to Site Health information.
*
* @param array<string, array<string, mixed>> $info Current Site Health information.
*
* @return array<string, array<string, mixed>> Updated Site Health information.
* @author sc0ttkclark
*/
public function debug_information( array $info ): array {
$fields = array();
// build the debug information from snippet data.
foreach ( get_snippets() as $snippet ) {
$values = [ $snippet->scope_name ];
$debug = [];
if ( ! $snippet->active ) {
continue;
}
if ( $snippet->name ) {
$debug[] = 'name: ' . $snippet->name;
}
$debug[] = 'scope: ' . $snippet->scope;
if ( $snippet->modified ) {
/* translators: %s: formatted last modified date */
$values[] = sprintf( __( 'Last modified %s', 'code-snippets' ), $snippet->format_modified( false ) );
$debug[] = 'modified: ' . $snippet->modified;
}
if ( $snippet->tags ) {
$values[] = $snippet->tags_list;
$debug[] = 'tags: [' . $snippet->tags_list . ']';
}
$fields[ 'snippet-' . $snippet->id ] = [
'label' => $snippet->display_name,
'value' => implode( "\n | ", $values ),
'debug' => implode( ', ', $debug ),
];
}
$snippets_info = array(
'label' => __( 'Active Snippets', 'code-snippets' ),
'show_count' => true,
'fields' => $fields,
);
// attempt to insert the new section right after the Inactive Plugins section.
$index = array_search( 'wp-plugins-inactive', array_keys( $info ), true );
if ( false === $index ) {
$info['code-snippets'] = $snippets_info;
} else {
$info = array_merge(
array_slice( $info, 0, $index + 1 ),
[ 'code-snippets' => $snippets_info ],
array_slice( $info, $index + 1 )
);
}
return $info;
}
/**
* Print any admin notices that have not been dismissed.
*
* @return void
*/
public function print_notices() {
global $current_user;
if ( apply_filters( 'code_snippets/hide_welcome_banner', false ) ) {
return;
}
$meta_key = 'ignore_code_snippets_survey_message';
$dismissed = get_user_meta( $current_user->ID, $meta_key );
if ( isset( $_GET[ $meta_key ], $_REQUEST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), $meta_key ) ) {
add_user_meta( $current_user->ID, $meta_key, sanitize_key( wp_unslash( $_GET[ $meta_key ] ) ) );
return;
}
$welcome = $this->welcome_api->get_banner();
try {
$now = new DateTimeImmutable( 'now', new DateTimeZone( 'UTC' ) );
} catch ( Exception $e ) {
$now = $welcome['start_datetime'];
}
if ( isset( $welcome['key'] ) && ! in_array( $welcome['key'], $dismissed, true ) &&
( empty( $welcome['start_datetime'] ) || $now >= $welcome['start_datetime'] ) &&
( empty( $welcome['end_datetime'] ) || $now <= $welcome['end_datetime'] ) ) {
$notice = $welcome['key'];
$text = $welcome['text_free'];
$action_url = $welcome['action_url_free'];
$action_label = $welcome['action_label_free'];
} elseif ( ! in_array( 'survey', $dismissed, true ) && ! in_array( 'true', $dismissed, true ) ) {
$notice = 'survey';
$action_url = 'https://codesnippets.pro/survey/';
$action_label = __( 'Take the survey now', 'code-snippets' );
$text = __( "<strong>Have feedback on Code Snippets?</strong> Please take the time to answer a short survey on how you use this plugin and what you'd like to see changed or added in the future.", 'code-snippets' );
} else {
return;
}
printf(
'<div class="notice notice-info code-snippets-notice code-snippets-%s-notice is-dismissible"><p>',
esc_attr( sanitize_key( $notice ) )
);
echo wp_kses_post( $text );
printf(
'<a href="%s" class="button button-secondary" target="_blank" style="margin: auto .5em;">%s</a>',
esc_url( $action_url ),
esc_html( $action_label )
);
printf(
'<a href="%s" class="notice-dismiss"><span class="screen-reader-text">%s</span></a>',
esc_url( wp_nonce_url( add_query_arg( $meta_key, $notice ), $meta_key ) ),
esc_attr__( 'Dismiss', 'code-snippets' )
);
echo '</p></div>';
}
/**
* Render a nav tab for a snippet type.
*
* @param string $type_name Type identifier.
* @param string $label Type label.
* @param string $current_type Identifier of currently-selected type.
*
* @return void
*/
public static function render_snippet_type_tab( string $type_name, string $label, string $current_type = '' ) {
$cloud_tabs = [ 'cloud', 'cloud_search', 'bundles' ];
$nav_tab_inactive = false;
if ( $type_name === $current_type ) {
printf( '<a class="nav-tab nav-tab-active" data-snippet-type="%s">', esc_attr( $type_name ) );
} elseif ( ! code_snippets()->licensing->is_licensed() && Plugin::is_pro_type( $type_name ) ) {
printf(
'<a class="nav-tab nav-tab-inactive" data-snippet-type="%s" title="%s" href="https://codesnippets.pro/pricing/" target="_blank">',
esc_attr( $type_name ),
esc_attr__( 'Available in Code Snippets Pro (external link)', 'code-snippets' )
);
} else {
$current_url = remove_query_arg( [ 'cloud_select', 'cloud_search' ] );
if ( in_array( $type_name, $cloud_tabs, true ) && ! code_snippets()->cloud_api->is_cloud_key_verified() ) {
$nav_tab_inactive = true;
}
printf(
'<a class="nav-tab %s" href="%s" data-snippet-type="%s">',
$nav_tab_inactive ? 'nav-tab-inactive' : '',
esc_url( add_query_arg( 'type', $type_name, $current_url ) ),
esc_attr( $type_name )
);
}
if ( 'all' === $type_name ) {
$label_class = 'all-snippets-label';
} else {
$label_class = 'snippet-label';
}
echo '<span class="' . $label_class . '">', esc_html( $label ), '</span>';
switch ( $type_name ) {
case 'all':
break;
case 'cloud':
echo '<span class="cloud-badge dashicons dashicons-cloud cloud-icon cloud-synced"></span>';
break;
case 'cloud_search':
echo '<span class="cloud-badge dashicons dashicons-search cloud-icon cloud-downloaded"></span>';
break;
case 'bundles':
echo '<span class="cloud-badge dashicons dashicons-screenoptions cloud-icon cloud-bundle"></span>';
break;
case 'ai':
echo '<span class="cloud-badge ai-icon">', esc_html__( 'AI', 'code-snippets' ), '</span>';
break;
default:
echo '<span class="badge">' . esc_html( $type_name ) . '</span>';
break;
}
echo '</a>';
}
}
php/class-contextual-help.php 0000644 00000014364 15153464550 0012303 0 ustar 00 <?php
namespace Code_Snippets;
use WP_Screen;
/**
* This file holds all the content for the contextual help screens.
*
* @package Code_Snippets
*/
class Contextual_Help {
/**
* Current screen object
*
* @see get_current_screen()
*
* @var WP_Screen
*/
public WP_Screen $screen;
/**
* Name of current screen
*
* @see get_current_screen()
*
* @var string
*/
public string $screen_name;
/**
* Class constructor
*
* @param string $screen_name Name of current screen.
*/
public function __construct( string $screen_name ) {
$this->screen_name = $screen_name;
}
/**
* Load the contextual help
*/
public function load() {
$this->screen = get_current_screen();
switch ( $this->screen_name ) {
case 'manage':
$this->load_manage_help();
break;
case 'edit':
$this->load_edit_help();
break;
case 'import':
$this->load_import_help();
break;
}
$this->load_help_sidebar();
}
/**
* Load the help sidebar
*/
private function load_help_sidebar() {
$sidebar_links = [
'https://wordpress.org/plugins/code-snippets' => __( 'About Plugin', 'code-snippets' ),
'https://help.codesnippets.pro/collection/3-faq' => __( 'FAQ', 'code-snippets' ),
'https://wordpress.org/support/plugin/code-snippets' => __( 'Support Forum', 'code-snippets' ),
'https://codesnippets.pro' => __( 'Plugin Website', 'code-snippets' ),
];
$contents = '<p><strong>' . __( 'For more information:', 'code-snippets' ) . "</strong></p>\n";
foreach ( $sidebar_links as $url => $label ) {
$contents .= "\n" . sprintf( '<p><a href="%s">%s</a></p>', esc_url( $url ), esc_html( $label ) );
}
$this->screen->set_help_sidebar( wp_kses_post( $contents ) );
}
/**
* Add a help tab to the current screen.
*
* @param string $id Screen ID.
* @param string $title Screen title.
* @param string|array<string> $paragraphs List of paragraphs to display as content.
*
* @return void
*/
private function add_help_tab( string $id, string $title, $paragraphs ) {
$this->screen->add_help_tab(
array(
'title' => $title,
'id' => $id,
'content' => wp_kses_post(
implode(
"\n",
array_map(
function ( $content ) {
return '<p>' . $content . '</p>';
},
is_array( $paragraphs ) ? $paragraphs : [ $paragraphs ]
)
)
),
)
);
}
/**
* Reusable introduction text
*
* @return string
*/
private function get_intro_text(): string {
return __( 'Snippets are similar to plugins - they both extend and expand the functionality of WordPress. Snippets are more light-weight, just a few lines of code, and do not put as much load on your server. ', 'code-snippets' );
}
/**
* Register and handle the help tabs for the manage snippets admin page
*/
private function load_manage_help() {
$this->add_help_tab(
'overview',
__( 'Overview', 'code-snippets' ),
$this->get_intro_text() .
__( 'Here you can manage your existing snippets and perform tasks on them such as activating, deactivating, deleting and exporting.', 'code-snippets' )
);
$this->add_help_tab(
'safe-mode',
__( 'Safe Mode', 'code-snippets' ),
[
__( 'Be sure to check your snippets for errors before you activate them, as a faulty snippet could bring your whole blog down. If your site starts doing strange things, deactivate all your snippets and activate them one at a time.', 'code-snippets' ),
__( "If something goes wrong with a snippet, and you can't use WordPress, you can cause all snippets to stop executing by turning on <strong>safe mode</strong>.", 'code-snippets' ),
__( 'You can find out how to enable safe mode in the <a href="https://help.codesnippets.pro/article/12-safe-mode">Code Snippets Pro Docs</a>.', 'code-snippets' ),
]
);
}
/**
* Register and handle the help tabs for the single snippet admin page
*/
private function load_edit_help() {
$this->add_help_tab(
'overview',
__( 'Overview', 'code-snippets' ),
[
$this->get_intro_text() .
__( 'Here you can add a new snippet, or edit an existing one.', 'code-snippets' ),
__( "If you're not sure about the types of snippets you can add, take a look at the <a href=\"https://help.codesnippets.pro/collection/2-adding-snippets\">Code Snippets Pro Docs</a> for inspiration.", 'code-snippets' ),
]
);
$this->add_help_tab(
'adding',
__( 'Adding Snippets', 'code-snippets' ),
[
__( 'You need to fill out the name and code fields for your snippet to be added. While the description field will add more information about how your snippet works, what is does and where you found it, it is completely optional.', 'code-snippets' ),
__( 'Please be sure to check that your snippet is valid PHP code and will not produce errors before adding it through this page. While doing so will not become active straight away, it will help to minimise the chance of a faulty snippet becoming active on your site.', 'code-snippets' ),
]
);
}
/**
* Register and handle the help tabs for the import snippets admin page
*/
private function load_import_help() {
$manage_url = code_snippets()->get_menu_url( 'manage' );
$this->add_help_tab(
'overview',
__( 'Overview', 'code-snippets' ),
$this->get_intro_text() .
__( 'Here you can load snippets from a code snippets export file into the database alongside existing snippets.', 'code-snippets' )
);
$this->add_help_tab(
'import',
__( 'Importing', 'code-snippets' ),
__( 'You can load your snippets from a code snippets export file using this page.', 'code-snippets' ) .
/* translators: %s: URL to Snippets admin menu */
sprintf( __( 'Imported snippets will be added to the database along with your existing snippets. Regardless of whether the snippets were active on the previous site, imported snippets are always inactive until activated using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $manage_url )
);
$this->add_help_tab(
'export',
__( 'Exporting', 'code-snippets' ),
/* translators: %s: URL to Manage Snippets admin menu */
sprintf( __( 'You can save your snippets to a code snippets export file using the <a href="%s">Manage Snippets</a> page.', 'code-snippets' ), $manage_url )
);
}
}
php/class-data-item.php 0000644 00000014353 15153464550 0011032 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Base class for representing an item of data without needing to use direct access or individual getter and setter functions.
*
* @package Code_Snippets
*
* @since 3.4.0
*/
abstract class Data_Item {
/**
* List of data fields keyed to their current values. Will be initialised with default values.
*
* @var array<string, mixed>
*/
protected array $fields;
/**
* List of default values provided for fields.
*
* @var array<string, mixed>
*/
protected array $default_values;
/**
* Optional list of field name aliases to map when resolving a field name.
*
* @var array<string, string> Field alias names keyed to actual field names.
*/
protected array $field_aliases;
/**
* Class constructor.
*
* @param array<string, mixed> $default_values List of valid fields mapped to their default values.
* @param array<string, mixed>|Data_Item $initial_data Optional initial data to populate fields.
* @param array<string, string> $field_aliases Optional list of field name aliases to map when resolving a field name.
*/
public function __construct( array $default_values, $initial_data = null, array $field_aliases = [] ) {
$this->fields = $default_values;
$this->default_values = $default_values;
$this->field_aliases = $field_aliases;
// If we've accidentally passed an existing object, then fetch its fields before constructing the new object.
if ( is_object( $initial_data ) && method_exists( $initial_data, 'get_fields' ) ) {
$initial_data = $initial_data->get_fields();
}
$this->set_fields( $initial_data );
}
/**
* Set all data fields from an array or object. Invalid fields will be ignored.
*
* @param array<string, mixed>|mixed $data List of data.
*/
public function set_fields( $data ) {
// Only accept arrays or objects.
if ( ! $data || is_string( $data ) ) {
return;
}
// Convert objects into arrays.
if ( is_object( $data ) ) {
$data = get_object_vars( $data );
}
// Loop through the provided fields and set their values.
foreach ( $data as $field => $value ) {
$this->set_field( $field, $value );
}
}
/**
* Retrieve list of current data fields.
*
* @return array<string, mixed> Field names keyed to current values.
*/
public function get_fields(): array {
$fields = [];
foreach ( $this->get_allowed_fields() as $field_name ) {
$fields[ $field_name ] = $this->$field_name;
}
return $fields;
}
/**
* Retrieve a list of current data fields, excluding values that are unchanged from the default.
*
* @return array<string, mixed>
*/
public function get_modified_fields(): array {
return array_filter(
$this->get_fields(),
function ( $value, $field ) {
return $value && $value !== $this->default_values[ $field ];
},
ARRAY_FILTER_USE_BOTH
);
}
/**
* Internal function for resolving the actual name of a field.
*
* @param string $field A field name, potentially a field alias.
*
* @return string The resolved field name.
*/
protected function resolve_field_name( string $field ): string {
return $this->field_aliases[ $field ] ?? $field;
}
/**
* Check if a field is set.
*
* @param string $field The field name.
*
* @return bool Whether the field is set.
*/
public function __isset( string $field ) {
$field = $this->resolve_field_name( $field );
return isset( $this->fields[ $field ] ) || method_exists( $this, 'get_' . $field );
}
/**
* Retrieve a field's value.
*
* @param string $field The field name.
*
* @return mixed The field value
*/
public function __get( string $field ) {
$field = $this->resolve_field_name( $field );
if ( method_exists( $this, 'get_' . $field ) ) {
return call_user_func( array( $this, 'get_' . $field ) );
}
if ( ! $this->is_allowed_field( $field ) ) {
if ( WP_DEBUG ) {
$message = sprintf( 'Trying to access invalid property on "%s" class: %s', get_class( $this ), $field );
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error( esc_html( $message ), E_USER_WARNING );
}
return null;
}
return $this->fields[ $field ];
}
/**
* Set the value of a field.
*
* @param string $field The field name.
* @param mixed $value The field value.
*/
public function __set( string $field, $value ) {
$field = $this->resolve_field_name( $field );
if ( ! $this->is_allowed_field( $field ) ) {
if ( WP_DEBUG ) {
$message = sprintf( 'Trying to set invalid property on "%s" class: %s', get_class( $this ), $field );
// phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
trigger_error( esc_html( $message ), E_USER_ERROR );
}
return;
}
$value = method_exists( $this, 'prepare_' . $field ) ?
call_user_func( array( $this, 'prepare_' . $field ), $value ) :
$this->prepare_field( $value, $field );
$this->fields[ $field ] = $value;
}
/**
* Prepare a value before it is stored.
*
* @param mixed $value Value to prepare.
* @param string $field Field name.
*
* @return mixed Value in the correct format.
*/
abstract protected function prepare_field( $value, string $field );
/**
* Retrieve the list of fields that can be written to.
*
* @return array<string> List of field names.
*/
public function get_allowed_fields(): array {
return array_keys( $this->fields ) + array_keys( $this->field_aliases );
}
/**
* Determine whether a field is allowed to be written to
*
* @param string $field The field name.
*
* @return bool true if the is allowed, false if invalid.
*/
public function is_allowed_field( string $field ): bool {
return ( $this->fields && array_key_exists( $field, $this->fields ) ) ||
( $this->field_aliases && array_key_exists( $field, $this->field_aliases ) );
}
/**
* Safely set the value for a field.
* If the field name is invalid, false will be returned instead of an error thrown.
*
* @param string $field The field name.
* @param mixed $value The field value.
*
* @return bool true if the field was set successfully, false if the field name is invalid.
*/
public function set_field( string $field, $value ): bool {
if ( ! $this->is_allowed_field( $field ) ) {
return false;
}
$this->__set( $field, $value );
return true;
}
}
php/class-db.php 0000644 00000017276 15153464550 0007561 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Functions used to manage the database tables.
*
* @package Code_Snippets
*/
class DB {
/**
* Unprefixed site-wide table name.
*/
const TABLE_NAME = 'snippets';
/**
* Unprefixed network-wide table name.
*/
const MS_TABLE_NAME = 'ms_snippets';
/**
* Side-wide table name.
*
* @var string
*/
public string $table;
/**
* Network-wide table name.
*
* @var string
*/
public string $ms_table;
/**
* Class constructor.
*/
public function __construct() {
$this->set_table_vars();
}
/**
* Register the snippet table names with WordPress.
*
* @since 2.0
*/
public function set_table_vars() {
global $wpdb;
$this->table = $wpdb->prefix . self::TABLE_NAME;
$this->ms_table = $wpdb->base_prefix . self::MS_TABLE_NAME;
// Register the snippet table names with WordPress.
$wpdb->snippets = $this->table;
$wpdb->ms_snippets = $this->ms_table;
$wpdb->tables[] = self::TABLE_NAME;
$wpdb->ms_global_tables[] = self::MS_TABLE_NAME;
}
/**
* Validate a provided 'network' or 'multisite' param, converting it to a boolean.
*
* @param bool|null $network Network argument value.
*
* @return bool Sanitized value.
*/
public static function validate_network_param( ?bool $network = null ): bool {
// If multisite is not active, then assume the value is false.
if ( ! is_multisite() ) {
return false;
}
// If $multisite is null, try to base it on the current admin page.
if ( is_null( $network ) && function_exists( 'is_network_admin' ) ) {
return is_network_admin();
}
return (bool) $network;
}
/**
* Return the appropriate snippet table name
*
* @param bool|null $is_network Whether retrieve the multisite table name (true) or the site table name (false).
*
* @return string The snippet table name
* @since 2.0
*/
public function get_table_name( ?bool $is_network = null ): string {
$is_network = is_bool( $is_network ) ? $is_network : self::validate_network_param( $is_network );
return $is_network ? $this->ms_table : $this->table;
}
/**
* Determine whether a database table exists.
*
* @param string $table_name Name of database table to check.
* @param boolean $refresh Rerun the query, instead of using a cached value.
*
* @return bool Whether the database table exists.
*/
public static function table_exists( string $table_name, bool $refresh = false ): bool {
global $wpdb;
static $checked = array();
if ( $refresh || ! isset( $checked[ $table_name ] ) ) {
// phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching, caching is handled through $checked variable.
$result = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table_name ) ) );
$checked[ $table_name ] = $result === $table_name;
}
return $checked[ $table_name ];
}
/**
* Create the snippet tables if they do not already exist
*/
public function create_missing_tables() {
// Create the network snippets table if it doesn't exist.
if ( is_multisite() && ! self::table_exists( $this->ms_table ) ) {
$this->create_table( $this->ms_table );
}
// Create the table if it doesn't exist.
if ( ! self::table_exists( $this->table ) ) {
$this->create_table( $this->table );
}
}
/**
* Create the snippet tables, or upgrade them if they already exist
*/
public function create_or_upgrade_tables() {
if ( is_multisite() ) {
$this->create_table( $this->ms_table );
}
$this->create_table( $this->table );
}
/**
* Create a snippet table if it does not already exist
*
* @param string $table_name Name of database table.
*/
public static function create_missing_table( string $table_name ) {
if ( ! self::table_exists( $table_name ) ) {
self::create_table( $table_name );
}
}
/**
* Create a single snippet table.
*
* @param string $table_name The name of the table to create.
*
* @return bool Whether the table creation was successful.
* @since 1.6
* @uses dbDelta() to apply the SQL code
*/
public static function create_table( string $table_name ): bool {
global $wpdb;
$charset_collate = $wpdb->get_charset_collate();
/* Create the database table */
$sql = "CREATE TABLE $table_name (
id BIGINT(20) NOT NULL AUTO_INCREMENT,
name TINYTEXT NOT NULL,
description TEXT NOT NULL,
code LONGTEXT NOT NULL,
tags LONGTEXT NOT NULL,
scope VARCHAR(15) NOT NULL DEFAULT 'global',
priority SMALLINT NOT NULL DEFAULT 10,
active TINYINT(1) NOT NULL DEFAULT 0,
modified DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
revision BIGINT(20) NOT NULL DEFAULT 1,
cloud_id VARCHAR(255) NULL,
PRIMARY KEY (id),
KEY scope (scope),
KEY active (active)
) $charset_collate;";
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta( $sql );
$success = empty( $wpdb->last_error );
if ( $success ) {
do_action( 'code_snippets/create_table', $table_name );
}
return $success;
}
/**
* Fetch a list of active snippets from a database table.
*
* @param string $table_name Name of table to fetch snippets from.
* @param array<string> $scopes List of scopes to include in query.
* @param boolean $active_only Whether to only fetch active snippets from the table.
*
* @return array<string, array<string, mixed>>|false List of active snippets, if any could be retrieved.
*
* @phpcs:disable WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
*/
private static function fetch_snippets_from_table( string $table_name, array $scopes, bool $active_only = true ) {
global $wpdb;
$cache_key = sprintf( 'active_snippets_%s_%s', sanitize_key( join( '_', $scopes ) ), $table_name );
$cached_snippets = wp_cache_get( $cache_key, CACHE_GROUP );
if ( is_array( $cached_snippets ) ) {
return $cached_snippets;
}
if ( ! self::table_exists( $table_name ) ) {
return false;
}
$scopes_format = implode( ',', array_fill( 0, count( $scopes ), '%s' ) );
$extra_where = $active_only ? 'AND active=1' : '';
$snippets = $wpdb->get_results(
$wpdb->prepare(
"
SELECT id, code, scope, active
FROM $table_name
WHERE scope IN ($scopes_format) $extra_where
ORDER BY priority, id",
$scopes
),
'ARRAY_A'
);
// Cache the full list of snippets.
if ( is_array( $snippets ) ) {
wp_cache_set( $cache_key, $snippets, CACHE_GROUP );
return $snippets;
}
return false;
}
/**
* Generate the SQL for fetching active snippets from the database.
*
* @param array<string>|string $scopes List of scopes to retrieve in.
*
* @return array<string, array<string, mixed>> List of active snippets, indexed by table.
*/
public function fetch_active_snippets( $scopes ): array {
$active_snippets = array();
// Ensure that the list of scopes is an array.
if ( ! is_array( $scopes ) ) {
$scopes = array( $scopes );
}
// Fetch the active snippets for the current site, if there are any.
$snippets = $this->fetch_snippets_from_table( $this->table, $scopes );
if ( $snippets ) {
$active_snippets[ $this->table ] = $snippets;
}
// If multisite is enabled, fetch all snippets from the network table, and filter down to only active snippets.
if ( is_multisite() ) {
$active_shared_ids = (array) get_option( 'active_shared_network_snippets', array() );
$ms_snippets = $this->fetch_snippets_from_table( $this->ms_table, $scopes, false );
if ( $ms_snippets ) {
$active_snippets[ $this->ms_table ] = array_filter(
$ms_snippets,
function ( $snippet ) use ( $active_shared_ids ) {
return $snippet['active'] || in_array( intval( $snippet['id'] ), $active_shared_ids, true );
}
);
}
}
return $active_snippets;
}
}
php/class-licensing.php 0000644 00000000472 15153464550 0011135 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Empty class to better support interoperability between core and pro.
*
* @package Code_Snippets
*/
class Licensing {
/**
* Determine whether the current site has an active license.
*
* @return bool
*/
public function is_licensed(): bool {
return false;
}
}
php/class-list-table.php 0000644 00000113272 15153464550 0011225 0 ustar 00 <?php
/**
* Contains the class for handling the snippets table
*
* @package Code_Snippets
*
* phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
*/
namespace Code_Snippets;
use WP_List_Table;
use function Code_Snippets\Settings\get_setting;
// The WP_List_Table base class is not included by default, so we need to load it.
if ( ! class_exists( 'WP_List_Table' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
}
/**
* This class handles the table for the manage snippets menu
*
* @since 1.5
* @package Code_Snippets
*/
class List_Table extends WP_List_Table {
/**
* Whether the current screen is in the network admin
*
* @var bool
*/
public bool $is_network;
/**
* A list of statuses (views)
*
* @var array<string>
*/
public array $statuses = [ 'all', 'active', 'inactive', 'recently_activated' ];
/**
* Column name to use when ordering the snippets list.
*
* @var string
*/
protected string $order_by;
/**
* Direction to use when ordering the snippets list. Either 'asc' or 'desc'.
*
* @var string
*/
protected string $order_dir;
/**
* The constructor function for our class.
* Registers hooks, initializes variables, setups class.
*
* @phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited
*/
public function __construct() {
global $status, $page;
$this->is_network = is_network_admin();
// Determine the status.
$status = apply_filters( 'code_snippets/list_table/default_view', 'all' );
if ( isset( $_REQUEST['status'] ) && in_array( sanitize_key( $_REQUEST['status'] ), $this->statuses, true ) ) {
$status = sanitize_key( $_REQUEST['status'] );
}
// Add the search query to the URL.
if ( isset( $_REQUEST['s'] ) ) {
$_SERVER['REQUEST_URI'] = add_query_arg( 's', sanitize_text_field( wp_unslash( $_REQUEST['s'] ) ) );
}
// Add a snippets per page screen option.
$page = $this->get_pagenum();
add_screen_option(
'per_page',
array(
'label' => __( 'Snippets per page', 'code-snippets' ),
'default' => 999,
'option' => 'snippets_per_page',
)
);
add_filter( 'default_hidden_columns', array( $this, 'default_hidden_columns' ) );
// Strip the result query arg from the URL.
$_SERVER['REQUEST_URI'] = remove_query_arg( 'result' );
// Add filters to format the snippet description in the same way the post content is formatted.
$filters = [ 'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop', 'shortcode_unautop', 'capital_P_dangit', [ $this, 'wp_kses_desc' ] ];
foreach ( $filters as $filter ) {
add_filter( 'code_snippets/list_table/column_description', $filter );
}
// Set up the class.
parent::__construct(
array(
'ajax' => true,
'plural' => 'snippets',
'singular' => 'snippet',
)
);
}
/**
* Apply a more permissive version of wp_kses_post() to the snippet description.
*
* @param string $data Description content to filter.
*
* @return string Filtered description content with allowed HTML tags and attributes intact.
*/
public function wp_kses_desc( string $data ): string {
$safe_style_filter = function ( $styles ) {
$styles[] = 'display';
return $styles;
};
add_filter( 'safe_style_css', $safe_style_filter );
$data = wp_kses_post( $data );
remove_filter( 'safe_style_css', $safe_style_filter );
return $data;
}
/**
* Set the 'id' column as hidden by default.
*
* @param array<string> $hidden List of hidden columns.
*
* @return array<string> Modified list of hidden columns.
*/
public function default_hidden_columns( array $hidden ): array {
array_push( $hidden, 'id', 'code', 'cloud_id', 'revision' );
return $hidden;
}
/**
* Set the 'name' column as the primary column.
*
* @return string
*/
protected function get_default_primary_column_name(): string {
return 'name';
}
/**
* Define the output of all columns that have no callback function
*
* @param Snippet $item The snippet used for the current row.
* @param string $column_name The name of the column being printed.
*
* @return string The content of the column to output.
*/
protected function column_default( $item, $column_name ): string {
switch ( $column_name ) {
case 'id':
return $item->id;
case 'description':
return apply_filters( 'code_snippets/list_table/column_description', $item->desc );
case 'type':
$type = $item->type;
$url = add_query_arg( 'type', $type );
return sprintf(
'<a class="snippet-type-badge" href="%s" data-snippet-type="%s">%s</a>',
esc_url( $url ),
esc_attr( $type ),
esc_html( $type )
);
case 'date':
return $item->modified ? $item->format_modified() : '—';
default:
return apply_filters( "code_snippets/list_table/column_$column_name", '—', $item );
}
}
/**
* Retrieve a URL to perform an action on a snippet
*
* @param string $action Name of action to produce a link for.
* @param Snippet $snippet Snippet object to produce link for.
*
* @return string URL to perform action.
*/
public function get_action_link( string $action, Snippet $snippet ): string {
// Redirect actions to the network dashboard for shared network snippets.
$local_actions = array( 'activate', 'activate-shared', 'run-once', 'run-once-shared' );
$network_redirect = $snippet->shared_network && ! $this->is_network && ! in_array( $action, $local_actions, true );
// Edit links go to a different menu.
if ( 'edit' === $action ) {
return code_snippets()->get_snippet_edit_url( $snippet->id, $network_redirect ? 'network' : 'self' );
}
$query_args = array(
'action' => $action,
'id' => $snippet->id,
'scope' => $snippet->scope,
);
$url = $network_redirect ?
add_query_arg( $query_args, code_snippets()->get_menu_url( 'manage', 'network' ) ) :
add_query_arg( $query_args );
// Add a nonce to the URL for security purposes.
return wp_nonce_url( $url, 'code_snippets_manage_snippet_' . $snippet->id );
}
/**
* Build a list of action links for individual snippets
*
* @param Snippet $snippet The current snippet.
*
* @return array<string, string> The action links HTML.
*/
private function get_snippet_action_links( Snippet $snippet ): array {
$actions = array();
if ( ! $this->is_network && $snippet->network && ! $snippet->shared_network ) {
// Display special links if on a subsite and dealing with a network-active snippet.
if ( $snippet->active ) {
$actions['network_active'] = esc_html__( 'Network Active', 'code-snippets' );
} else {
$actions['network_only'] = esc_html__( 'Network Only', 'code-snippets' );
}
} elseif ( ! $snippet->shared_network || current_user_can( code_snippets()->get_network_cap_name() ) ) {
// If the snippet is a shared network snippet, only display extra actions if the user has network permissions.
$simple_actions = array(
'edit' => esc_html__( 'Edit', 'code-snippets' ),
'clone' => esc_html__( 'Clone', 'code-snippets' ),
'export' => esc_html__( 'Export', 'code-snippets' ),
);
foreach ( $simple_actions as $action => $label ) {
$actions[ $action ] = sprintf( '<a href="%s">%s</a>', esc_url( $this->get_action_link( $action, $snippet ) ), $label );
}
$actions['delete'] = sprintf(
'<a href="%2$s" class="delete" onclick="%3$s">%1$s</a>',
esc_html__( 'Delete', 'code-snippets' ),
esc_url( $this->get_action_link( 'delete', $snippet ) ),
esc_js(
sprintf(
'return confirm("%s");',
esc_html__( 'You are about to permanently delete the selected item.', 'code-snippets' ) . "\n" .
esc_html__( "'Cancel' to stop, 'OK' to delete.", 'code-snippets' )
)
)
);
}
return apply_filters( 'code_snippets/list_table/row_actions', $actions, $snippet );
}
/**
* Retrieve the code for a snippet activation switch
*
* @param Snippet $snippet Snippet object.
*
* @return string Output for activation switch.
*/
protected function column_activate( Snippet $snippet ): string {
if ( $this->is_network && ( $snippet->shared_network || ( ! $this->is_network && $snippet->network && ! $snippet->shared_network ) ) ) {
return '';
}
if ( 'single-use' === $snippet->scope ) {
$class = 'snippet-execution-button';
$action = 'run-once';
$label = esc_html__( 'Run Once', 'code-snippets' );
} else {
$class = 'snippet-activation-switch';
$action = $snippet->active ? 'deactivate' : 'activate';
$label = $snippet->network && ! $snippet->shared_network ?
( $snippet->active ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Network Activate', 'code-snippets' ) ) :
( $snippet->active ? __( 'Deactivate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ) );
}
if ( $snippet->shared_network ) {
$action .= '-shared';
}
return sprintf(
'<a class="%s" href="%s" title="%s"> </a> ',
esc_attr( $class ),
esc_url( $this->get_action_link( $action, $snippet ) ),
esc_attr( $label )
);
}
/**
* Build the content of the snippet name column
*
* @param Snippet $snippet The snippet being used for the current row.
*
* @return string The content of the column to output.
*/
protected function column_name( Snippet $snippet ): string {
$row_actions = $this->row_actions(
$this->get_snippet_action_links( $snippet ),
apply_filters( 'code_snippets/list_table/row_actions_always_visible', true )
);
$out = esc_html( $snippet->display_name );
if ( 'global' !== $snippet->scope ) {
$out .= sprintf( ' <span class="dashicons dashicons-%s"></span>', $snippet->scope_icon );
}
// Add a link to the snippet if it isn't an unreadable network-only snippet.
if ( $this->is_network || ! $snippet->network || current_user_can( code_snippets()->get_network_cap_name() ) ) {
$out = sprintf(
'<a href="%s" class="snippet-name">%s</a>',
esc_attr( code_snippets()->get_snippet_edit_url( $snippet->id, $snippet->network ? 'network' : 'admin' ) ),
$out
);
}
if ( $snippet->shared_network ) {
$out .= ' <span class="badge">' . esc_html__( 'Shared on Network', 'code-snippets' ) . '</span>';
}
// Return the name contents.
$out = apply_filters( 'code_snippets/list_table/column_name', $out, $snippet );
return $out . $row_actions;
}
/**
* Handles the checkbox column output.
*
* @param Snippet $item The snippet being used for the current row.
*
* @return string The column content to be printed.
*/
protected function column_cb( $item ): string {
$out = sprintf(
'<input type="checkbox" name="%s[]" value="%s">',
$item->shared_network ? 'shared_ids' : 'ids',
$item->id
);
return apply_filters( 'code_snippets/list_table/column_cb', $out, $item );
}
/**
* Handles the tags column output.
*
* @param Snippet $snippet The snippet being used for the current row.
*
* @return string The column output.
*/
protected function column_tags( Snippet $snippet ): string {
// Return now if there are no tags.
if ( empty( $snippet->tags ) ) {
return '';
}
$out = array();
// Loop through the tags and create a link for each one.
foreach ( $snippet->tags as $tag ) {
$out[] = sprintf(
'<a href="%s">%s</a>',
esc_url( add_query_arg( 'tag', esc_attr( $tag ) ) ),
esc_html( $tag )
);
}
return join( ', ', $out );
}
/**
* Handles the priority column output.
*
* @param Snippet $snippet The snippet being used for the current row.
*
* @return string The column output.
*/
protected function column_priority( Snippet $snippet ): string {
return sprintf( '<input type="number" class="snippet-priority" value="%d" step="1" disabled>', $snippet->priority );
}
/**
* Define the column headers for the table
*
* @return array<string, string> The column headers, ID paired with label
*/
public function get_columns(): array {
$columns = array(
'cb' => '<input type="checkbox">',
'activate' => '',
'name' => __( 'Name', 'code-snippets' ),
'type' => __( 'Type', 'code-snippets' ),
'description' => __( 'Description', 'code-snippets' ),
'tags' => __( 'Tags', 'code-snippets' ),
'date' => __( 'Modified', 'code-snippets' ),
'priority' => __( 'Priority', 'code-snippets' ),
'id' => __( 'ID', 'code-snippets' ),
);
if ( isset( $_GET['type'] ) && 'all' !== $_GET['type'] ) {
unset( $columns['type'] );
}
if ( ! get_setting( 'general', 'enable_description' ) ) {
unset( $columns['description'] );
}
if ( ! get_setting( 'general', 'enable_tags' ) ) {
unset( $columns['tags'] );
}
return apply_filters( 'code_snippets/list_table/columns', $columns );
}
/**
* Define the columns that can be sorted. The format is:
* 'internal-name' => 'orderby'
* or
* 'internal-name' => array( 'orderby', true )
*
* The second format will make the initial sorting order be descending.
*
* @return array<string, string|array<string|bool>> The IDs of the columns that can be sorted
*/
public function get_sortable_columns(): array {
$sortable_columns = [
'id' => [ 'id', true ],
'name' => 'name',
'type' => [ 'type', true ],
'date' => [ 'modified', true ],
'priority' => [ 'priority', true ],
];
return apply_filters( 'code_snippets/list_table/sortable_columns', $sortable_columns );
}
/**
* Define the bulk actions to include in the drop-down menus
*
* @return array<string, string> An array of menu items with the ID paired to the label
*/
public function get_bulk_actions(): array {
$actions = [
'activate-selected' => $this->is_network ? __( 'Network Activate', 'code-snippets' ) : __( 'Activate', 'code-snippets' ),
'deactivate-selected' => $this->is_network ? __( 'Network Deactivate', 'code-snippets' ) : __( 'Deactivate', 'code-snippets' ),
'clone-selected' => __( 'Clone', 'code-snippets' ),
'download-selected' => __( 'Export Code', 'code-snippets' ),
'export-selected' => __( 'Export', 'code-snippets' ),
'delete-selected' => __( 'Delete', 'code-snippets' ),
];
return apply_filters( 'code_snippets/list_table/bulk_actions', $actions );
}
/**
* Retrieve the classes for the table
*
* We override this in order to add 'snippets' as a class for custom styling
*
* @return array<string> The classes to include on the table element
*/
public function get_table_classes(): array {
$classes = array( 'widefat', $this->_args['plural'] );
return apply_filters( 'code_snippets/list_table/table_classes', $classes );
}
/**
* Retrieve the 'views' of the table
*
* Example: active, inactive, recently active
*
* @return array<string, string> A list of the view labels linked to the view
*/
public function get_views(): array {
global $totals, $status;
$status_links = parent::get_views();
// Loop through the view counts.
foreach ( $totals as $type => $count ) {
$labels = [];
if ( ! $count ) {
continue;
}
// translators: %s: total number of snippets.
$labels['all'] = _n(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
$count,
'code-snippets'
);
// translators: %s: total number of active snippets.
$labels['active'] = _n(
'Active <span class="count">(%s)</span>',
'Active <span class="count">(%s)</span>',
$count,
'code-snippets'
);
// translators: %s: total number of inactive snippets.
$labels['inactive'] = _n(
'Inactive <span class="count">(%s)</span>',
'Inactive <span class="count">(%s)</span>',
$count,
'code-snippets'
);
// translators: %s: total number of recently activated snippets.
$labels['recently_activated'] = _n(
'Recently Active <span class="count">(%s)</span>',
'Recently Active <span class="count">(%s)</span>',
$count,
'code-snippets'
);
// The page URL with the status parameter.
$url = esc_url( add_query_arg( 'status', $type ) );
// Add a class if this view is currently being viewed.
$class = $type === $status ? ' class="current"' : '';
// Add the view count to the label.
$text = sprintf( $labels[ $type ], number_format_i18n( $count ) );
$status_links[ $type ] = sprintf( '<a href="%s"%s>%s</a>', $url, $class, $text );
}
return apply_filters( 'code_snippets/list_table/views', $status_links );
}
/**
* Gets the tags of the snippets currently being viewed in the table
*
* @since 2.0
*/
public function get_current_tags() {
global $snippets, $status;
// If we're not viewing a snippets table, get all used tags instead.
if ( ! isset( $snippets, $status ) ) {
$tags = get_all_snippet_tags();
} else {
$tags = array();
// Merge all tags into a single array.
foreach ( $snippets[ $status ] as $snippet ) {
$tags = array_merge( $snippet->tags, $tags );
}
// Remove duplicate tags.
$tags = array_unique( $tags );
}
sort( $tags );
return $tags;
}
/**
* Add filters and extra actions above and below the table
*
* @param string $which Whether the actions are displayed on the before (true) or after (false) the table.
*/
public function extra_tablenav( $which ) {
/**
* Status global.
*
* @var string $status
*/
global $status;
if ( 'top' === $which ) {
// Tags dropdown filter.
$tags = $this->get_current_tags();
if ( count( $tags ) ) {
$query = isset( $_GET['tag'] ) ? sanitize_text_field( wp_unslash( $_GET['tag'] ) ) : '';
echo '<div class="alignleft actions">';
echo '<select name="tag">';
printf(
"<option %s value=''>%s</option>\n",
selected( $query, '', false ),
esc_html__( 'Show all tags', 'code-snippets' )
);
foreach ( $tags as $tag ) {
printf(
"<option %s value='%s'>%s</option>\n",
selected( $query, $tag, false ),
esc_attr( $tag ),
esc_html( $tag )
);
}
echo '</select>';
submit_button( __( 'Filter', 'code-snippets' ), 'button', 'filter_action', false );
echo '</div>';
}
}
echo '<div class="alignleft actions">';
if ( 'recently_activated' === $status ) {
submit_button( __( 'Clear List', 'code-snippets' ), 'secondary', 'clear-recent-list', false );
}
do_action( 'code_snippets/list_table/actions', $which );
echo '</div>';
}
/**
* Output form fields needed to preserve important
* query vars over form submissions
*
* @param string $context The context in which the fields are being outputted.
*/
public static function required_form_fields( string $context = 'main' ) {
$vars = apply_filters(
'code_snippets/list_table/required_form_fields',
array( 'page', 's', 'status', 'paged', 'tag' ),
$context
);
if ( 'search_box' === $context ) {
// Remove the 's' var if we're doing this for the search box.
$vars = array_diff( $vars, array( 's' ) );
}
foreach ( $vars as $var ) {
if ( ! empty( $_REQUEST[ $var ] ) ) {
$value = sanitize_text_field( wp_unslash( $_REQUEST[ $var ] ) );
printf( '<input type="hidden" name="%s" value="%s" />', esc_attr( $var ), esc_attr( $value ) );
echo "\n";
}
}
do_action( 'code_snippets/list_table/print_required_form_fields', $context );
}
/**
* Perform an action on a single snippet.
*
* @param int $id Snippet ID.
* @param string $action Action to perform.
*
* @return bool|string Result of performing action
*/
private function perform_action( int $id, string $action ) {
switch ( $action ) {
case 'activate':
activate_snippet( $id, $this->is_network );
return 'activated';
case 'deactivate':
deactivate_snippet( $id, $this->is_network );
return 'deactivated';
case 'run-once':
$this->perform_action( $id, 'activate' );
return 'executed';
case 'run-once-shared':
$this->perform_action( $id, 'activate-shared' );
return 'executed';
case 'activate-shared':
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
if ( ! in_array( $id, $active_shared_snippets, true ) ) {
$active_shared_snippets[] = $id;
update_option( 'active_shared_network_snippets', $active_shared_snippets );
clean_active_snippets_cache( code_snippets()->db->ms_table );
}
return 'activated';
case 'deactivate-shared':
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
update_option( 'active_shared_network_snippets', array_diff( $active_shared_snippets, array( $id ) ) );
clean_active_snippets_cache( code_snippets()->db->ms_table );
return 'deactivated';
case 'clone':
$this->clone_snippets( [ $id ] );
return 'cloned';
case 'delete':
delete_snippet( $id, $this->is_network );
return 'deleted';
case 'export':
$export = new Export_Attachment( [ $id ], $this->is_network );
$export->download_snippets_json();
break;
case 'download':
$export = new Export_Attachment( [ $id ], $this->is_network );
$export->download_snippets_code();
break;
}
return false;
}
/**
* Processes actions requested by the user.
*
* @return void
*/
public function process_requested_actions() {
// Clear the recent snippets list if requested to do so.
if ( isset( $_POST['clear-recent-list'] ) ) {
check_admin_referer( 'bulk-' . $this->_args['plural'] );
if ( $this->is_network ) {
update_site_option( 'recently_activated_snippets', array() );
} else {
update_option( 'recently_activated_snippets', array() );
}
}
// Check if there are any single snippet actions to perform.
if ( isset( $_GET['action'], $_GET['id'] ) ) {
$id = absint( $_GET['id'] );
$scope = isset( $_GET['scope'] ) ? sanitize_key( wp_unslash( $_GET['scope'] ) ) : '';
// Verify they were sent from a trusted source.
$nonce_action = 'code_snippets_manage_snippet_' . $id;
if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), $nonce_action ) ) {
wp_nonce_ays( $nonce_action );
}
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'action', 'id', 'scope', '_wpnonce' ) );
// If so, then perform the requested action and inform the user of the result.
$result = $this->perform_action( $id, sanitize_key( $_GET['action'] ), $scope );
if ( $result ) {
wp_safe_redirect( esc_url_raw( add_query_arg( 'result', $result ) ) );
exit;
}
}
// Only continue from this point if there are bulk actions to process.
if ( ! isset( $_POST['ids'] ) && ! isset( $_POST['shared_ids'] ) ) {
return;
}
check_admin_referer( 'bulk-' . $this->_args['plural'] );
$ids = isset( $_POST['ids'] ) ? array_map( 'intval', $_POST['ids'] ) : array();
$_SERVER['REQUEST_URI'] = remove_query_arg( 'action' );
switch ( $this->current_action() ) {
case 'activate-selected':
activate_snippets( $ids );
// Process the shared network snippets.
if ( isset( $_POST['shared_ids'] ) && is_multisite() && ! $this->is_network ) {
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
foreach ( array_map( 'intval', $_POST['shared_ids'] ) as $id ) {
if ( ! in_array( $id, $active_shared_snippets, true ) ) {
$active_shared_snippets[] = $id;
}
}
update_option( 'active_shared_network_snippets', $active_shared_snippets );
clean_active_snippets_cache( code_snippets()->db->ms_table );
}
$result = 'activated-multi';
break;
case 'deactivate-selected':
foreach ( $ids as $id ) {
deactivate_snippet( $id, $this->is_network );
}
// Process the shared network snippets.
if ( isset( $_POST['shared_ids'] ) && is_multisite() && ! $this->is_network ) {
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
$active_shared_snippets = ( '' === $active_shared_snippets ) ? array() : $active_shared_snippets;
$active_shared_snippets = array_diff( $active_shared_snippets, array_map( 'intval', $_POST['shared_ids'] ) );
update_option( 'active_shared_network_snippets', $active_shared_snippets );
clean_active_snippets_cache( code_snippets()->db->ms_table );
}
$result = 'deactivated-multi';
break;
case 'export-selected':
$export = new Export_Attachment( $ids, $this->is_network );
$export->download_snippets_json();
break;
case 'download-selected':
$export = new Export_Attachment( $ids, $this->is_network );
$export->download_snippets_code();
break;
case 'clone-selected':
$this->clone_snippets( $ids );
$result = 'cloned-multi';
break;
case 'delete-selected':
foreach ( $ids as $id ) {
delete_snippet( $id, $this->is_network );
}
$result = 'deleted-multi';
break;
}
if ( isset( $result ) ) {
wp_safe_redirect( esc_url_raw( add_query_arg( 'result', $result ) ) );
exit;
}
}
/**
* Message to display if no snippets are found.
*
* @return void
*/
public function no_items() {
if ( ! empty( $GLOBALS['s'] ) || ! empty( $_GET['tag'] ) ) {
esc_html_e( 'No snippets were found matching the current search query. Please enter a new query or use the "Clear Filters" button above.', 'code-snippets' );
} else {
$add_url = code_snippets()->get_menu_url( 'add' );
if ( empty( $_GET['type'] ) ) {
esc_html_e( "It looks like you don't have any snippets.", 'code-snippets' );
} else {
esc_html_e( "It looks like you don't have any snippets of this type.", 'code-snippets' );
$add_url = add_query_arg( 'type', sanitize_key( wp_unslash( $_GET['type'] ) ), $add_url );
}
printf(
' <a href="%s">%s</a>',
esc_url( $add_url ),
esc_html__( 'Perhaps you would like to add a new one?', 'code-snippets' )
);
}
}
/**
* Fetch all shared network snippets for the current site.
*
* @return void
*/
private function fetch_shared_network_snippets() {
/**
* Table data.
*
* @var $snippets array<string, Snippet[]>
*/
global $snippets;
$ids = get_site_option( 'shared_network_snippets' );
if ( ! is_multisite() || ! $ids ) {
return;
}
if ( $this->is_network ) {
$limit = count( $snippets['all'] );
for ( $i = 0; $i < $limit; $i++ ) {
$snippet = &$snippets['all'][ $i ];
if ( in_array( $snippet->id, $ids, true ) ) {
$snippet->shared_network = true;
$snippet->tags = array_merge( $snippet->tags, array( 'shared on network' ) );
$snippet->active = false;
}
}
} else {
$active_shared_snippets = get_option( 'active_shared_network_snippets', array() );
$shared_snippets = get_snippets( $ids, true );
foreach ( $shared_snippets as $snippet ) {
$snippet->shared_network = true;
$snippet->tags = array_merge( $snippet->tags, array( 'shared on network' ) );
$snippet->active = in_array( $snippet->id, $active_shared_snippets, true );
}
$snippets['all'] = array_merge( $snippets['all'], $shared_snippets );
}
}
/**
* Prepares the items to later display in the table.
* Should run before any headers are sent.
*
* @phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
*
* @return void
*/
public function prepare_items() {
/**
* Global variables.
*
* @var string $status Current status view.
* @var array<string, Snippet[]> $snippets List of snippets for views.
* @var array<string, integer> $totals List of total items for views.
* @var string $s Current search term.
*/
global $status, $snippets, $totals, $s;
wp_reset_vars( array( 'orderby', 'order', 's' ) );
// Redirect tag filter from POST to GET.
if ( isset( $_POST['filter_action'] ) ) {
$location = empty( $_POST['tag'] ) ?
remove_query_arg( 'tag' ) :
add_query_arg( 'tag', sanitize_text_field( wp_unslash( $_POST['tag'] ) ) );
wp_safe_redirect( esc_url_raw( $location ) );
exit;
}
$this->process_requested_actions();
$snippets = array_fill_keys( $this->statuses, array() );
$snippets['all'] = apply_filters( 'code_snippets/list_table/get_snippets', get_snippets() );
$this->fetch_shared_network_snippets();
// Filter snippets by type.
$type = sanitize_key( wp_unslash( $_GET['type'] ?? '' ) );
if ( $type && 'all' !== $type ) {
$snippets['all'] = array_filter(
$snippets['all'],
function ( Snippet $snippet ) use ( $type ) {
return $type === $snippet->type;
}
);
}
// Add scope tags.
foreach ( $snippets['all'] as $snippet ) {
if ( 'global' !== $snippet->scope ) {
$snippet->add_tag( $snippet->scope );
}
}
// Filter snippets by tag.
if ( ! empty( $_GET['tag'] ) ) {
$snippets['all'] = array_filter( $snippets['all'], array( $this, 'tags_filter_callback' ) );
}
// Filter snippets based on search query.
if ( $s ) {
$snippets['all'] = array_filter( $snippets['all'], array( $this, 'search_by_line_callback' ) );
}
// Clear recently activated snippets older than a week.
$recently_activated = $this->is_network ?
get_site_option( 'recently_activated_snippets', array() ) :
get_option( 'recently_activated_snippets', array() );
foreach ( $recently_activated as $key => $time ) {
if ( $time + WEEK_IN_SECONDS < time() ) {
unset( $recently_activated[ $key ] );
}
}
$this->is_network ?
update_site_option( 'recently_activated_snippets', $recently_activated ) :
update_option( 'recently_activated_snippets', $recently_activated );
/**
* Filter snippets into individual sections
*
* @var Snippet $snippet
*/
foreach ( $snippets['all'] as $snippet ) {
if ( $snippet->active ) {
$snippets['active'][] = $snippet;
} else {
$snippets['inactive'][] = $snippet;
// Was the snippet recently deactivated?
if ( isset( $recently_activated[ $snippet->id ] ) ) {
$snippets['recently_activated'][] = $snippet;
}
}
}
// Count the totals for each section.
$totals = array_map(
function ( $section_snippets ) {
return count( $section_snippets );
},
$snippets
);
// If the current status is empty, default to all.
if ( empty( $snippets[ $status ] ) ) {
$status = 'all';
}
// Get the current data.
$data = $snippets[ $status ];
// Decide how many records per page to show by getting the user's setting in the Screen Options panel.
$sort_by = $this->screen->get_option( 'per_page', 'option' );
$per_page = get_user_meta( get_current_user_id(), $sort_by, true );
if ( empty( $per_page ) || $per_page < 1 ) {
$per_page = $this->screen->get_option( 'per_page', 'default' );
}
$per_page = (int) $per_page;
$this->set_order_vars();
usort( $data, array( $this, 'usort_reorder_callback' ) );
// Determine what page the user is currently looking at.
$current_page = $this->get_pagenum();
// Check how many items are in the data array.
$total_items = count( $data );
// The WP_List_Table class does not handle pagination for us, so we need to ensure that the data is trimmed to only the current page.
$data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
// Now we can add our *sorted* data to the 'items' property, where it can be used by the rest of the class.
$this->items = $data;
// We register our pagination options and calculations.
$this->set_pagination_args(
[
'total_items' => $total_items, // Calculate the total number of items.
'per_page' => $per_page, // Determine how many items to show on a page.
'total_pages' => ceil( $total_items / $per_page ), // Calculate the total number of pages.
]
);
}
/**
* Determine the sort ordering for two pieces of data.
*
* @param mixed $a_data First piece of data.
* @param mixed $b_data Second piece of data.
*
* @return int Returns -1 if $a_data is less than $b_data; 0 if they are equal; 1 otherwise
* @ignore
*/
private function get_sort_direction( $a_data, $b_data ) {
// If the data is numeric, then calculate the ordering directly.
if ( is_numeric( $a_data ) && is_numeric( $b_data ) ) {
return $a_data - $b_data;
}
// If only one of the data points is empty, then place it before the one which is not.
if ( empty( $a_data ) xor empty( $b_data ) ) {
return empty( $a_data ) ? 1 : -1;
}
// Sort using the default string sort order if possible.
if ( is_string( $a_data ) && is_string( $b_data ) ) {
return strcasecmp( $a_data, $b_data );
}
// Otherwise, use basic comparison operators.
return $a_data === $b_data ? 0 : ( $a_data < $b_data ? -1 : 1 );
}
/**
* Set the $order_by and $order_dir class variables.
*/
private function set_order_vars() {
$order = Settings\get_setting( 'general', 'list_order' );
// set the order by based on the query variable, if set.
if ( ! empty( $_REQUEST['orderby'] ) ) {
$this->order_by = sanitize_key( wp_unslash( $_REQUEST['orderby'] ) );
} else {
// otherwise, fetch the order from the setting, ensuring it is valid.
$valid_fields = [ 'id', 'name', 'type', 'modified', 'priority' ];
$order_parts = explode( '-', $order, 2 );
$this->order_by = in_array( $order_parts[0], $valid_fields, true ) ? $order_parts[0] :
apply_filters( 'code_snippets/list_table/default_orderby', 'priority' );
}
// set the order dir based on the query variable, if set.
if ( ! empty( $_REQUEST['order'] ) ) {
$this->order_dir = sanitize_key( wp_unslash( $_REQUEST['order'] ) );
} elseif ( '-desc' === substr( $order, -5 ) ) {
$this->order_dir = 'desc';
} elseif ( '-asc' === substr( $order, -4 ) ) {
$this->order_dir = 'asc';
} else {
$this->order_dir = apply_filters( 'code_snippets/list_table/default_order', 'asc' );
}
}
/**
* Callback for usort() used to sort snippets
*
* @param Snippet $a The first snippet to compare.
* @param Snippet $b The second snippet to compare.
*
* @return int The sort order.
* @ignore
*/
private function usort_reorder_callback( Snippet $a, Snippet $b ) {
$orderby = $this->order_by;
$result = $this->get_sort_direction( $a->$orderby, $b->$orderby );
if ( 0 === $result && 'id' !== $orderby ) {
$result = $this->get_sort_direction( $a->id, $b->id );
}
// Apply the sort direction to the calculated order.
return ( 'asc' === $this->order_dir ) ? $result : -$result;
}
/**
* Callback for search function
*
* @param Snippet $snippet The snippet being filtered.
*
* @return bool The result of the filter
* @ignore
*/
private function search_callback( Snippet $snippet ): bool {
global $s;
$fields = array( 'name', 'desc', 'code', 'tags_list' );
foreach ( $fields as $field ) {
if ( false !== stripos( $snippet->$field, $s ) ) {
return true;
}
}
return false;
}
/**
* Callback for search function
*
* @param Snippet $snippet The snippet being filtered.
*
* @return bool The result of the filter
* @ignore
*/
private function search_by_line_callback( Snippet $snippet ): bool {
global $s;
static $line_num;
if ( is_null( $line_num ) ) {
if ( preg_match( '/@line:(?P<line>\d+)/', $s, $matches ) ) {
$s = trim( str_replace( $matches[0], '', $s ) );
$line_num = (int) $matches['line'] - 1;
} else {
$line_num = -1;
}
}
if ( $line_num < 0 ) {
return $this->search_callback( $snippet );
}
$code_lines = explode( "\n", $snippet->code );
return isset( $code_lines[ $line_num ] ) && false !== stripos( $code_lines[ $line_num ], $s );
}
/**
* Callback for filtering snippets by tag.
*
* @param Snippet $snippet The snippet being filtered.
*
* @return bool The result of the filter.
* @ignore
*/
private function tags_filter_callback( Snippet $snippet ): bool {
$tags = isset( $_GET['tag'] ) ?
explode( ',', sanitize_text_field( wp_unslash( $_GET['tag'] ) ) ) :
array();
foreach ( $tags as $tag ) {
if ( in_array( $tag, $snippet->tags, true ) ) {
return true;
}
}
return false;
}
/**
* Display a notice showing the current search terms
*
* @since 1.7
*/
public function search_notice() {
if ( ! empty( $_REQUEST['s'] ) || ! empty( $_GET['tag'] ) ) {
echo '<span class="subtitle">' . esc_html__( 'Search results', 'code-snippets' );
if ( ! empty( $_REQUEST['s'] ) ) {
$s = sanitize_text_field( wp_unslash( $_REQUEST['s'] ) );
if ( preg_match( '/@line:(?P<line>\d+)/', $s, $matches ) ) {
// translators: 1: search query, 2: line number.
$text = __( ' for “%1$s” on line %2$d', 'code-snippets' );
printf(
esc_html( $text ),
esc_html( trim( str_replace( $matches[0], '', $s ) ) ),
intval( $matches['line'] )
);
} else {
// translators: %s: search query.
echo esc_html( sprintf( __( ' for “%s”', 'code-snippets' ), $s ) );
}
}
if ( ! empty( $_GET['tag'] ) ) {
$tag = sanitize_text_field( wp_unslash( $_GET['tag'] ) );
// translators: %s: tag name.
echo esc_html( sprintf( __( ' in tag “%s”', 'code-snippets' ), $tag ) );
}
echo '</span>';
// translators: 1: link URL, 2: link text.
printf(
' <a class="button clear-filters" href="%s">%s</a>',
esc_url( remove_query_arg( array( 's', 'tag', 'cloud_search' ) ) ),
esc_html__( 'Clear Filters', 'code-snippets' )
);
}
}
/**
* Outputs content for a single row of the table
*
* @param Snippet $item The snippet being used for the current row.
*/
public function single_row( $item ) {
$status = $item->active ? 'active' : 'inactive';
$row_class = "snippet $status-snippet $item->type-snippet $item->scope-scope";
if ( $item->shared_network ) {
$row_class .= ' shared-network-snippet';
}
printf( '<tr class="%s" data-snippet-scope="%s">', esc_attr( $row_class ), esc_attr( $item->scope ) );
$this->single_row_columns( $item );
echo '</tr>';
}
/**
* Clone a selection of snippets
*
* @param array<integer> $ids List of snippet IDs.
*/
private function clone_snippets( array $ids ) {
$snippets = get_snippets( $ids, $this->is_network );
foreach ( $snippets as $snippet ) {
$snippet->id = 0;
$snippet->active = false;
$snippet->cloud_id = '';
// translators: %s: snippet title.
$snippet->name = sprintf( __( '%s [CLONE]', 'code-snippets' ), $snippet->name );
$snippet = apply_filters( 'code_snippets/list_table/clone_snippet', $snippet );
save_snippet( $snippet );
}
}
}
php/class-plugin.php 0000644 00000023431 15153464550 0010460 0 ustar 00 <?php
namespace Code_Snippets;
use Code_Snippets\Cloud\Cloud_API;
use Code_Snippets\REST_API\Snippets_REST_Controller;
/**
* The main plugin class
*
* @package Code_Snippets
*/
class Plugin {
/**
* Current plugin version number
*
* @var string
*/
public string $version;
/**
* Filesystem path to the main plugin file
*
* @var string
*/
public string $file;
/**
* Database class
*
* @var DB
*/
public DB $db;
/**
* Administration area class
*
* @var Admin
*/
public Admin $admin;
/**
* Front-end functionality class
*
* @var Front_End
*/
public Front_End $front_end;
/**
* Class for managing cloud API actions.
*
* @var Cloud_API
*/
public Cloud_API $cloud_api;
/**
* Class for managing active snippets
*
* @var Active_Snippets
*/
public Active_Snippets $active_snippets;
/**
* Handles licensing and plugin updates.
*
* @var Licensing
*/
public Licensing $licensing;
/**
* Class constructor
*
* @param string $version Current plugin version.
* @param string $file Path to main plugin file.
*/
public function __construct( string $version, string $file ) {
$this->version = $version;
$this->file = $file;
wp_cache_add_global_groups( CACHE_GROUP );
add_filter( 'code_snippets/execute_snippets', array( $this, 'disable_snippet_execution' ), 5 );
if ( isset( $_REQUEST['snippets-safe-mode'] ) ) {
add_filter( 'home_url', array( $this, 'add_safe_mode_query_var' ) );
add_filter( 'admin_url', array( $this, 'add_safe_mode_query_var' ) );
}
add_action( 'rest_api_init', [ $this, 'init_rest_api' ] );
add_action( 'allowed_redirect_hosts', [ $this, 'allow_code_snippets_redirect' ] );
}
/**
* Initialise classes and include files
*/
public function load_plugin() {
$includes_path = __DIR__;
// Database operation functions.
$this->db = new DB();
// Snippet operation functions.
require_once $includes_path . '/snippet-ops.php';
// CodeMirror editor functions.
require_once $includes_path . '/editor.php';
// General Administration functions.
if ( is_admin() ) {
$this->admin = new Admin();
}
// Settings component.
require_once $includes_path . '/settings/settings-fields.php';
require_once $includes_path . '/settings/editor-preview.php';
require_once $includes_path . '/settings/settings.php';
// Cloud List Table shared functions.
require_once $includes_path . '/cloud/list-table-shared-ops.php';
$this->active_snippets = new Active_Snippets();
$this->front_end = new Front_End();
$this->cloud_api = new Cloud_API();
$upgrade = new Upgrade( $this->version, $this->db );
add_action( 'plugins_loaded', array( $upgrade, 'run' ), 0 );
$this->licensing = new Licensing();
}
/**
* Register custom REST API controllers.
*
* @return void
*/
public function init_rest_api() {
$snippets_controller = new Snippets_REST_Controller();
$snippets_controller->register_routes();
}
/**
* Disable snippet execution if the necessary query var is set.
*
* @param bool $execute_snippets Current filter value.
*
* @return bool New filter value.
*/
public function disable_snippet_execution( bool $execute_snippets ): bool {
return ! empty( $_REQUEST['snippets-safe-mode'] ) && $this->current_user_can() ? false : $execute_snippets;
}
/**
* Determine whether the menu is full or compact.
*
* @return bool
*/
public function is_compact_menu(): bool {
return ! is_network_admin() && apply_filters( 'code_snippets_compact_menu', false );
}
/**
* Fetch the admin menu slug for a menu.
*
* @param string $menu Name of menu to retrieve the slug for.
*
* @return string The menu's slug.
*/
public function get_menu_slug( string $menu = '' ): string {
$add = array( 'single', 'add', 'add-new', 'add-snippet', 'new-snippet', 'add-new-snippet' );
$edit = array( 'edit', 'edit-snippet' );
$import = array( 'import', 'import-snippets', 'import-code-snippets' );
$settings = array( 'settings', 'snippets-settings' );
$cloud = array( 'cloud', 'cloud-snippets' );
$welcome = array( 'welcome', 'getting-started', 'code-snippets' );
if ( in_array( $menu, $edit, true ) ) {
return 'edit-snippet';
} elseif ( in_array( $menu, $add, true ) ) {
return 'add-snippet';
} elseif ( in_array( $menu, $import, true ) ) {
return 'import-code-snippets';
} elseif ( in_array( $menu, $settings, true ) ) {
return 'snippets-settings';
} elseif ( in_array( $menu, $cloud, true ) ) {
return 'snippets&type=cloud';
} elseif ( in_array( $menu, $welcome, true ) ) {
return 'code-snippets-welcome';
} else {
return 'snippets';
}
}
/**
* Fetch the URL to a snippets admin menu.
*
* @param string $menu Name of menu to retrieve the URL to.
* @param string $context URL scheme to use.
*
* @return string The menu's URL.
*/
public function get_menu_url( string $menu = '', string $context = 'self' ): string {
$slug = $this->get_menu_slug( $menu );
if ( $this->is_compact_menu() && 'network' !== $context ) {
$base_slug = $this->get_menu_slug();
$url = 'tools.php?page=' . $base_slug;
if ( $slug !== $base_slug ) {
$url .= '&sub=' . $slug;
}
} else {
$url = 'admin.php?page=' . $slug;
}
if ( 'network' === $context || 'snippets-settings' === $slug ) {
return network_admin_url( $url );
} elseif ( 'admin' === $context ) {
return admin_url( $url );
} else {
return self_admin_url( $url );
}
}
/**
* Fetch the admin menu slug for a snippets admin menu.
*
* @param integer $snippet_id Snippet ID.
* @param string $context URL scheme to use.
*
* @return string The URL to the edit snippet page for that snippet.
*/
public function get_snippet_edit_url( int $snippet_id, string $context = 'self' ): string {
return add_query_arg(
'id',
absint( $snippet_id ),
$this->get_menu_url( 'edit', $context )
);
}
/**
* Allow redirecting to the Code Snippets site.
*
* @param array<string> $hosts Allowed hosts.
*
* @return array Modified allowed hosts.
*/
public function allow_code_snippets_redirect( array $hosts ): array {
$hosts[] = 'codesnippets.pro';
$hosts[] = 'snipco.de';
return $hosts;
}
/**
* Determine whether the current user can perform actions on snippets.
*
* @return boolean Whether the current user has the required capability.
*
* @since 2.8.6
*/
public function current_user_can(): bool {
return current_user_can( $this->get_cap() );
}
/**
* Retrieve the name of the capability required to manage sub-site snippets.
*
* @return string
*/
public function get_cap_name(): string {
return apply_filters( 'code_snippets_cap', 'manage_options' );
}
/**
* Retrieve the name of the capability required to manage network snippets.
*
* @return string
*/
public function get_network_cap_name(): string {
return apply_filters( 'code_snippets_network_cap', 'manage_network_options' );
}
/**
* Get the required capability to perform a certain action on snippets.
* Does not check if the user has this capability or not.
*
* If multisite, checks if *Enable Administration Menus: Snippets* is active
* under the *Settings > Network Settings* network admin menu
*
* @return string The capability required to manage snippets.
*
* @since 2.0
*/
public function get_cap(): string {
if ( is_multisite() ) {
$menu_perms = get_site_option( 'menu_items', array() );
// If multisite is enabled and the snippet menu is not activated, restrict snippet operations to super admins only.
if ( empty( $menu_perms['snippets'] ) ) {
return $this->get_network_cap_name();
}
}
return $this->get_cap_name();
}
/**
* Inject the safe mode query var into URLs
*
* @param string $url Original URL.
*
* @return string Modified URL.
*/
public function add_safe_mode_query_var( string $url ): string {
return isset( $_REQUEST['snippets-safe-mode'] ) ?
add_query_arg( 'snippets-safe-mode', (bool) $_REQUEST['snippets-safe-mode'], $url ) :
$url;
}
/**
* Retrieve a list of available snippet types and their labels.
*
* @return array<string, string> Snippet types.
*/
public static function get_types(): array {
return apply_filters(
'code_snippets_types',
array(
'php' => __( 'Functions', 'code-snippets' ),
'html' => __( 'Content', 'code-snippets' ),
'css' => __( 'Styles', 'code-snippets' ),
'js' => __( 'Scripts', 'code-snippets' ),
'cloud' => __( 'Codevault', 'code-snippets' ),
'cloud_search' => __( 'Cloud Search', 'code-snippets' ),
'bundles' => __( 'Bundles', 'code-snippets' ),
)
);
}
/**
* Determine whether a snippet type is Pro-only.
*
* @param string $type Snippet type name.
*
* @return bool
*/
public static function is_pro_type( string $type ): bool {
return 'css' === $type || 'js' === $type || 'cloud' === $type || 'bundles' === $type;
}
/**
* Localise a plugin script to provide the CODE_SNIPPETS object.
*
* @param string $handle Script handle.
*
* @return void
*/
public function localize_script( string $handle ) {
wp_localize_script(
$handle,
'CODE_SNIPPETS',
[
'isLicensed' => $this->licensing->is_licensed(),
'isCloudConnected' => Cloud_API::is_cloud_connection_available(),
'restAPI' => [
'base' => esc_url_raw( rest_url() ),
'snippets' => esc_url_raw( rest_url( Snippets_REST_Controller::get_base_route() ) ),
'nonce' => wp_create_nonce( 'wp_rest' ),
'localToken' => $this->cloud_api->get_local_token(),
],
'urls' => [
'plugin' => esc_url_raw( plugins_url( '', PLUGIN_FILE ) ),
'manage' => esc_url_raw( $this->get_menu_url() ),
'edit' => esc_url_raw( $this->get_menu_url( 'edit' ) ),
'addNew' => esc_url_raw( $this->get_menu_url( 'add' ) ),
],
]
);
}
}
php/class-snippet.php 0000644 00000032105 15153464550 0010642 0 ustar 00 <?php
namespace Code_Snippets;
use DateTime;
use DateTimeZone;
use Exception;
/**
* A snippet object.
*
* @since 2.4.0
* @package Code_Snippets
*
* @property int $id The database ID.
* @property string $name The snippet title.
* @property string $desc The formatted description.
* @property string $code The executable code.
* @property array<string> $tags An array of the tags.
* @property string $scope The scope name.
* @property int $priority Execution priority.
* @property bool $active The active status.
* @property bool $network true if is multisite-wide snippet, false if site-wide.
* @property bool $shared_network Whether the snippet is a shared network snippet.
* @property string $modified The date and time when the snippet data was most recently saved to the database.
* @property array{string,int}|null $code_error Code error encountered when last testing snippet code.
* @property object|null $conditions Snippet conditionals
* @property int $revision Revision or version number of snippet.
* @property string $cloud_id Cloud ID and ownership status of snippet.
*
* @property-read string $display_name The snippet name if it exists or a placeholder if it does not.
* @property-read string $tags_list The tags in string list format.
* @property-read string $scope_icon The dashicon used to represent the current scope.
* @property-read string $scope_name Human-readable description of the snippet type.
* @property-read string $type The type of snippet.
* @property-read string $lang The language that the snippet code is written in.
* @property-read int $modified_timestamp The last modification date in Unix timestamp format.
* @property-read DateTime $modified_local The last modification date in the local timezone.
* @property-read string $type_desc Human-readable description of the snippet type.
* @property-read boolean $is_pro Whether the snippet type is pro-only.
*/
class Snippet extends Data_Item {
/**
* MySQL datetime format (YYYY-MM-DD hh:mm:ss).
*/
const DATE_FORMAT = 'Y-m-d H:i:s';
/**
* Default value used for a datetime variable.
*/
const DEFAULT_DATE = '0000-00-00 00:00:00';
/**
* Constructor function.
*
* @param array<string, mixed>|object $initial_data Initial snippet data.
*/
public function __construct( $initial_data = null ) {
$default_values = array(
'id' => 0,
'name' => '',
'desc' => '',
'code' => '',
'tags' => array(),
'scope' => 'global',
'active' => false,
'priority' => 10,
'network' => null,
'shared_network' => null,
'modified' => null,
'code_error' => null,
'revision' => 1,
'cloud_id' => '',
);
$field_aliases = array(
'description' => 'desc',
'language' => 'lang',
);
parent::__construct( $default_values, $initial_data, $field_aliases );
}
/**
* Add a new tag
*
* @param string $tag Tag content to add to list.
*/
public function add_tag( string $tag ) {
$this->fields['tags'][] = $tag;
}
/**
* Prepare a value before it is stored.
*
* @param mixed $value Value to prepare.
* @param string $field Field name.
*
* @return mixed Value in the correct format.
*/
protected function prepare_field( $value, string $field ) {
switch ( $field ) {
case 'id':
case 'priority':
return absint( $value );
case 'tags':
return code_snippets_build_tags_array( $value );
case 'active':
return is_bool( $value ) ? $value : (bool) $value;
default:
return $value;
}
}
/**
* Prepare the scope by ensuring that it is a valid choice
*
* @param int|string $scope The field as provided.
*
* @return string The field in the correct format.
*/
protected function prepare_scope( $scope ) {
$scopes = self::get_all_scopes();
if ( in_array( $scope, $scopes, true ) ) {
return $scope;
}
if ( is_numeric( $scope ) && isset( $scopes[ $scope ] ) ) {
return $scopes[ $scope ];
}
return $this->fields['scope'];
}
/**
* If $network is anything other than true, set it to false
*
* @param bool $network The field as provided.
*
* @return bool The field in the correct format.
*/
protected function prepare_network( bool $network ): bool {
if ( null === $network && function_exists( 'is_network_admin' ) ) {
return is_network_admin();
}
return true === $network;
}
/**
* Determine the type of code this snippet is, based on its scope
*
* @return string The snippet type – will be a filename extension.
*/
protected function get_type(): string {
if ( '-css' === substr( $this->scope, -4 ) ) {
return 'css';
} elseif ( '-js' === substr( $this->scope, -3 ) ) {
return 'js';
} elseif ( 'content' === substr( $this->scope, -7 ) ) {
return 'html';
} else {
return 'php';
}
}
/**
* Retrieve a list of all valid types.
*
* @return string[]
*/
public static function get_types(): array {
return [ 'php', 'html', 'css', 'js' ];
}
/**
* Retrieve description of snippet type.
*
* @return string
*/
protected function get_type_desc(): string {
$labels = [
'php' => __( 'Functions', 'code-snippets' ),
'html' => __( 'Content', 'code-snippets' ),
'css' => __( 'Styles', 'code-snippets' ),
'js' => __( 'Scripts', 'code-snippets' ),
];
return isset( $labels[ $this->type ] ) ? $labels[ $this->type ] : strtoupper( $this->type );
}
/**
* Determine the language that the snippet code is written in, based on the scope
*
* @return string The name of a language filename extension.
*/
protected function get_lang(): string {
return $this->type;
}
/**
* Prepare the modification field by ensuring it is in the correct format.
*
* @param DateTime|string $modified Snippet modification date.
*
* @return string
*/
protected function prepare_modified( $modified ): ?string {
// If the supplied value is a DateTime object, convert it to string representation.
if ( $modified instanceof DateTime ) {
return $modified->format( self::DATE_FORMAT );
}
// If the supplied value is probably a timestamp, attempt to convert it to a string.
if ( is_numeric( $modified ) ) {
return gmdate( self::DATE_FORMAT, $modified );
}
// If the supplied value is a string, check it is not just the default value.
if ( is_string( $modified ) && self::DEFAULT_DATE !== $modified ) {
return $modified;
}
// Otherwise, discard the supplied value.
return null;
}
/**
* Update the last modification date to the current date and time.
*
* @return void
*/
public function update_modified() {
$this->modified = gmdate( self::DATE_FORMAT );
}
/**
* Retrieve the snippet title if set or a placeholder title if not.
*
* @return string
*/
protected function get_display_name(): string {
// translators: %d: snippet ID.
return empty( $this->name ) ? sprintf( esc_html__( 'Untitled #%d', 'code-snippets' ), $this->id ) : $this->name;
}
/**
* Retrieve the tags in list format
*
* @return string The tags separated by a comma and a space.
*/
protected function get_tags_list(): string {
return implode( ', ', $this->tags );
}
/**
* Retrieve a list of all available scopes
*
* @return array<string> List of scope names.
*
* @phpcs:disable WordPress.Arrays.ArrayDeclarationSpacing.ArrayItemNoNewLine
*/
public static function get_all_scopes(): array {
return array(
'global', 'admin', 'front-end', 'single-use',
'content', 'head-content', 'footer-content',
'admin-css', 'site-css',
'site-head-js', 'site-footer-js',
);
}
/**
* Retrieve a list of all scope icons
*
* @return array<string, string> Scope name keyed to the class name of a dashicon.
*/
public static function get_scope_icons(): array {
return array(
'global' => 'admin-site',
'admin' => 'admin-tools',
'front-end' => 'admin-appearance',
'single-use' => 'clock',
'content' => 'shortcode',
'head-content' => 'editor-code',
'footer-content' => 'editor-code',
'admin-css' => 'dashboard',
'site-css' => 'admin-customizer',
'site-head-js' => 'media-code',
'site-footer-js' => 'media-code',
);
}
/**
* Retrieve the string representation of the scope
*
* @return string The name of the scope.
*/
protected function get_scope_name(): string {
switch ( $this->scope ) {
case 'global':
return __( 'Global function', 'code-snippets' );
case 'admin':
return __( 'Admin function', 'code-snippets' );
case 'front-end':
return __( 'Front-end function', 'code-snippets' );
case 'single-use':
return __( 'Single-use function', 'code-snippets' );
case 'content':
return __( 'Content', 'code-snippets' );
case 'head-content':
return __( 'Head content', 'code-snippets' );
case 'footer-content':
return __( 'Footer content', 'code-snippets' );
case 'admin-css':
return __( 'Admin styles', 'code-snippets' );
case 'site-css':
return __( 'Front-end styles', 'code-snippets' );
case 'site-head-js':
return __( 'Head styles', 'code-snippets' );
case 'site-footer-js':
return __( 'Footer styles', 'code-snippets' );
}
return '';
}
/**
* Retrieve the icon used for the current scope
*
* @return string A dashicon name.
*/
protected function get_scope_icon(): string {
$icons = self::get_scope_icons();
return $icons[ $this->scope ];
}
/**
* Determine if the snippet is a shared network snippet
*
* @return bool Whether the snippet is a shared network snippet.
*/
protected function get_shared_network(): bool {
if ( isset( $this->fields['shared_network'] ) ) {
return $this->fields['shared_network'];
}
if ( ! is_multisite() || ! $this->fields['network'] ) {
$this->fields['shared_network'] = false;
} else {
$shared_network_snippets = get_site_option( 'shared_network_snippets', array() );
$this->fields['shared_network'] = in_array( $this->fields['id'], $shared_network_snippets, true );
}
return $this->fields['shared_network'];
}
/**
* Retrieve the snippet modification date as a timestamp.
*
* @return integer Timestamp value.
*/
protected function get_modified_timestamp(): int {
$datetime = DateTime::createFromFormat( self::DATE_FORMAT, $this->modified, new DateTimeZone( 'UTC' ) );
return $datetime ? $datetime->getTimestamp() : 0;
}
/**
* Retrieve the modification time in the local timezone.
*
* @return DateTime
*/
protected function get_modified_local(): DateTime {
$datetime = DateTime::createFromFormat( self::DATE_FORMAT, $this->modified, new DateTimeZone( 'UTC' ) );
if ( function_exists( 'wp_timezone' ) ) {
$timezone = wp_timezone();
} else {
$timezone = get_option( 'timezone_string' );
// Calculate the timezone manually if it is not available.
if ( ! $timezone ) {
$offset = (float) get_option( 'gmt_offset' );
$hours = (int) $offset;
$minutes = ( $offset - $hours ) * 60;
$sign = ( $offset < 0 ) ? '-' : '+';
$timezone = sprintf( '%s%02d:%02d', $sign, abs( $hours ), abs( $minutes ) );
}
try {
$timezone = new DateTimeZone( $timezone );
} catch ( Exception $exception ) {
return $datetime;
}
}
$datetime->setTimezone( $timezone );
return $datetime;
}
/**
* Retrieve the last modified time, nicely formatted for readability.
*
* @param boolean $include_html Whether to include HTML in the output.
*
* @return string
*/
public function format_modified( bool $include_html = true ): string {
if ( ! $this->modified ) {
return '';
}
$timestamp = $this->modified_timestamp;
$time_diff = time() - $timestamp;
$local_time = $this->modified_local;
if ( $time_diff >= 0 && $time_diff < YEAR_IN_SECONDS ) {
// translators: %s: Human-readable time difference.
$human_time = sprintf( __( '%s ago', 'code-snippets' ), human_time_diff( $timestamp ) );
} else {
$human_time = $local_time->format( __( 'Y/m/d', 'code-snippets' ) );
}
if ( ! $include_html ) {
return $human_time;
}
// translators: 1: date format, 2: time format.
$date_format = _x( '%1$s at %2$s', 'date and time format', 'code-snippets' );
$date_format = sprintf( $date_format, get_option( 'date_format' ), get_option( 'time_format' ) );
return sprintf( '<span title="%s">%s</span>', $local_time->format( $date_format ), $human_time );
}
/**
* Determine whether the current snippet type is pro-only.
*/
private function get_is_pro(): bool {
return 'css' === $this->type || 'js' === $this->type;
}
/**
* Increment the revision number by one.
*/
public function increment_revision() {
++$this->revision;
}
}
php/class-upgrade.php 0000644 00000015070 15153464550 0010611 0 ustar 00 <?php
namespace Code_Snippets;
use WP_User;
/**
* Manages upgrade tasks such as deleting and updating options
*/
class Upgrade {
/**
* Instance of database class
*
* @var DB
*/
private DB $db;
/**
* The current plugin version number
*
* @var string
*/
private string $current_version;
/**
* Class constructor
*
* @param string $version Current plugin version.
* @param DB $db Instance of database class.
*/
public function __construct( string $version, DB $db ) {
$this->db = $db;
$this->current_version = $version;
}
/**
* Run the upgrade functions
*/
public function run() {
// Always run multisite upgrades, even if not on the main site, as sub-sites depend on the network snippet table.
if ( is_multisite() ) {
$this->do_multisite_upgrades();
}
$this->do_site_upgrades();
}
/**
* Perform upgrades for the current site
*/
private function do_site_upgrades() {
$table_name = $this->db->table;
$prev_version = get_option( 'code_snippets_version' );
// Do nothing if the plugin has not just been updated or installed.
if ( ! version_compare( $prev_version, $this->current_version, '<' ) ) {
return;
}
// Update the plugin version stored in the database.
$updated = update_option( 'code_snippets_version', $this->current_version );
if ( ! $updated ) {
return; // Bail if the data was not successfully saved to prevent this process from repeating.
}
$this->db->create_table( $table_name );
// Remove outdated user meta.
if ( version_compare( $prev_version, '2.14.1', '<' ) ) {
global $wpdb;
$prefix = $wpdb->get_blog_prefix();
$menu_slug = code_snippets()->get_menu_slug();
$option_name = "{$prefix}managetoplevel_page_{$menu_slug}columnshidden";
// Loop through each user ID and remove all matching user meta.
foreach ( get_users( array( 'fields' => 'ID' ) ) as $user_id ) {
delete_metadata( 'user', $user_id, $option_name, '', true );
}
}
// Update the scope column of the database.
if ( version_compare( $prev_version, '2.10.0', '<' ) ) {
$this->migrate_scope_data( $table_name );
}
// Custom capabilities were removed after version 2.9.5.
if ( version_compare( $prev_version, '2.9.5', '<=' ) ) {
$role = get_role( apply_filters( 'code_snippets_role', 'administrator' ) );
$role->remove_cap( apply_filters( 'code_snippets_cap', 'manage_snippets' ) );
}
if ( false === $prev_version ) {
add_action( 'init', [ $this, 'create_sample_content' ] );
}
clean_snippets_cache( $table_name );
Welcome_API::clear_cache();
}
/**
* Create example snippets.
*
* As this uses translation functions, this should not be called earlier than 'init'.
*
* @return void
*/
public function create_sample_content() {
if ( apply_filters( 'code_snippets/create_sample_content', true ) ) {
$sample_snippets = $this->get_sample_content();
foreach ( $sample_snippets as $sample_snippet ) {
save_snippet( $sample_snippet );
}
}
}
/**
* Perform multisite-only upgrades
*/
private function do_multisite_upgrades() {
$table_name = $this->db->ms_table;
$prev_version = get_site_option( 'code_snippets_version' );
// Do nothing if the plugin has not been updated or installed.
if ( ! version_compare( $prev_version, $this->current_version, '<' ) ) {
return;
}
// Always attempt to create or upgrade the database tables.
$this->db->create_table( $table_name );
// Update the plugin version stored in the database.
update_site_option( 'code_snippets_version', $this->current_version );
// Update the scope column of the database.
if ( version_compare( $prev_version, '2.10.0', '<' ) ) {
$this->migrate_scope_data( $table_name );
}
// Custom capabilities were removed after version 2.9.5.
if ( version_compare( $prev_version, '2.9.5', '<=' ) ) {
$network_cap = apply_filters( 'code_snippets_network_cap', 'manage_network_snippets' );
foreach ( get_super_admins() as $admin ) {
$user = new WP_User( 0, $admin );
$user->remove_cap( $network_cap );
}
}
clean_snippets_cache( $table_name );
}
/**
* Migrate data from the old integer method of storing scopes to the new string method
*
* @param string $table_name Name of database table.
*/
private function migrate_scope_data( string $table_name ) {
global $wpdb;
$scopes = array(
0 => 'global',
1 => 'admin',
2 => 'front-end',
);
foreach ( $scopes as $scope_number => $scope_name ) {
// phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching, will flush at end of process.
$wpdb->query(
$wpdb->prepare(
"UPDATE $table_name SET scope = %s WHERE scope = %d",
$scope_name,
$scope_number
)
);
}
}
/**
* Build a collection of sample snippets for new users to try out.
*
* @return array<string, Snippet> List of Snippet objects.
*/
private function get_sample_content(): array {
$tag = "\n\n" . esc_html__( 'This is a sample snippet. Feel free to use it, edit it, or remove it.', 'code-snippets' );
$snippets_data = array(
array(
'name' => esc_html__( 'Make upload filenames lowercase', 'code-snippets' ),
'code' => "add_filter( 'sanitize_file_name', 'mb_strtolower' );",
'desc' => esc_html__( 'Makes sure that image and file uploads have lowercase filenames.', 'code-snippets' ) . $tag,
'tags' => array( 'sample', 'media' ),
),
array(
'name' => esc_html__( 'Disable admin bar', 'code-snippets' ),
'code' => "add_action( 'wp', function () {\n\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\tshow_admin_bar( false );\n\t}\n} );",
'desc' => esc_html__( 'Turns off the WordPress admin bar for everyone except administrators.', 'code-snippets' ) . $tag,
'tags' => array( 'sample', 'admin-bar' ),
'scope' => 'front-end',
),
array(
'name' => esc_html__( 'Allow smilies', 'code-snippets' ),
'code' => "add_filter( 'widget_text', 'convert_smilies' );\nadd_filter( 'the_title', 'convert_smilies' );\nadd_filter( 'wp_title', 'convert_smilies' );\nadd_filter( 'get_bloginfo', 'convert_smilies' );",
'desc' => esc_html__( 'Allows smiley conversion in obscure places.', 'code-snippets' ) . $tag,
'tags' => array( 'sample' ),
),
array(
'name' => esc_html__( 'Current year', 'code-snippets' ),
'code' => "<?php echo date( 'Y' ); ?>",
'desc' => esc_html__( 'Shortcode for inserting the current year into a post or page..', 'code-snippets' ) . $tag,
'tags' => array( 'sample', 'dates' ),
'scope' => 'content',
),
);
return array_map(
function ( $snippet_data ) {
return new Snippet( $snippet_data );
},
$snippets_data
);
}
}
php/class-validator.php 0000644 00000016024 15153464550 0011147 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Validates code prior to execution.
*
* @package Code_Snippets
*/
class Validator {
/**
* Code to validate.
*
* @var string
*/
private string $code;
/**
* List of tokens.
*
* @var array<string>
*/
private array $tokens;
/**
* The index of the token currently being examined.
*
* @var integer
*/
private int $current;
/**
* The total number of tokens.
*
* @var integer
*/
private int $length;
/**
* Array to keep track of the various function, class and interface identifiers which have been defined.
*
* @var array<string, string[]>
*/
private array $defined_identifiers = [];
/**
* Exclude certain tokens from being checked.
*
* @var array<string, string[]>
*/
private array $exceptions = [];
/**
* Class constructor.
*
* @param string $code Snippet code for parsing.
*/
public function __construct( string $code ) {
$this->code = $code;
$this->tokens = token_get_all( "<?php\n" . $this->code );
$this->length = count( $this->tokens );
$this->current = 0;
}
/**
* Determine whether the parser has reached the end of the list of tokens.
*
* @return bool
*/
private function end(): bool {
return $this->current === $this->length;
}
/**
* Retrieve the next token without moving the pointer
*
* @return string|array<string|int>|null The current token if the list has not been expended, null otherwise.
*/
private function peek() {
return $this->end() ? null : $this->tokens[ $this->current ];
}
/**
* Move the pointer to the next token, if there is one.
*
* If the first argument is provided, only move the pointer if the tokens match.
*/
private function next() {
if ( ! $this->end() ) {
++$this->current;
}
}
/**
* Check whether a particular identifier has been used previously.
*
* @param string $type Which type of identifier this is. Supports T_FUNCTION, T_CLASS and T_INTERFACE.
* @param string $identifier The name of the identifier itself.
*
* @return bool true if the identifier is not unique.
*/
private function check_duplicate_identifier( string $type, string $identifier ): bool {
if ( ! isset( $this->defined_identifiers[ $type ] ) ) {
switch ( $type ) {
case T_FUNCTION:
$defined_functions = get_defined_functions();
$this->defined_identifiers[ T_FUNCTION ] = array_merge( $defined_functions['internal'], $defined_functions['user'] );
break;
case T_CLASS:
$this->defined_identifiers[ T_CLASS ] = get_declared_classes();
break;
case T_INTERFACE:
$this->defined_identifiers[ T_INTERFACE ] = get_declared_interfaces();
break;
default:
return false;
}
}
$duplicate = in_array( $identifier, $this->defined_identifiers[ $type ], true );
array_unshift( $this->defined_identifiers[ $type ], $identifier );
return $duplicate && ! ( isset( $this->exceptions[ $type ] ) && in_array( $identifier, $this->exceptions[ $type ], true ) );
}
/**
* Validate the given PHP code and return the result.
*
* @return array<string, mixed>|false Array containing message if an error was encountered, false if validation was successful.
*/
public function validate() {
while ( ! $this->end() ) {
$token = $this->peek();
$this->next();
if ( ! is_array( $token ) ) {
continue;
}
// If this is a function or class exists check, then allow this function or class to be defined.
if ( T_STRING === $token[0] && ( 'function_exists' === $token[1] || 'class_exists' === $token[1] ) ) {
$type = 'function_exists' === $token[1] ? T_FUNCTION : T_CLASS;
// Eat tokens until we find the function or class name.
while ( ! $this->end() && T_CONSTANT_ENCAPSED_STRING !== $token[0] ) {
$token = $this->peek();
$this->next();
}
// Add the identifier to the list of exceptions.
$this->exceptions[ $type ] = $this->exceptions[ $type ] ?? [];
$this->exceptions[ $type ][] = trim( $token[1], '\'"' );
continue;
}
// If we have a double colon, followed by a class, then consume it before the next section.
if ( T_DOUBLE_COLON === $token[0] ) {
$token = $this->peek();
$this->next();
if ( T_CLASS === $token[0] ) {
$this->next();
$token = $this->peek();
}
}
// Only look for class and function declaration tokens.
if ( T_CLASS !== $token[0] && T_FUNCTION !== $token[0] ) {
continue;
}
/**
* Ensure the type of $token is inferred correctly.
*
* @var string|array<string|int> $token
*/
$structure_type = $token[0];
// Continue eating tokens until we find the name of the class or function.
while ( ! $this->end() && T_STRING !== $token[0] &&
( T_FUNCTION !== $structure_type || '(' !== $token ) && ( T_CLASS !== $structure_type || '{' !== $token ) ) {
$token = $this->peek();
$this->next();
}
// If we've eaten all the tokens without discovering a name, then there must be a syntax error, so return appropriately.
if ( $this->end() ) {
return array(
'message' => __( 'Parse error: syntax error, unexpected end of snippet.', 'code-snippets' ),
'line' => $token[2],
);
}
// If the function or class is anonymous, with no name, then no need to check.
if ( ! ( T_FUNCTION === $structure_type && '(' === $token ) && ! ( T_CLASS === $structure_type && '{' === $token ) ) {
// Check whether the name has already been defined.
if ( $this->check_duplicate_identifier( $structure_type, $token[1] ) ) {
switch ( $structure_type ) {
case T_FUNCTION:
/* translators: %s: PHP function name */
$message = __( 'Cannot redeclare function %s.', 'code-snippets' );
break;
case T_CLASS:
/* translators: %s: PHP class name */
$message = __( 'Cannot redeclare class %s.', 'code-snippets' );
break;
case T_INTERFACE:
/* translators: %s: PHP interface name */
$message = __( 'Cannot redeclare interface %s.', 'code-snippets' );
break;
default:
/* translators: %s: PHP identifier name*/
$message = __( 'Cannot redeclare %s.', 'code-snippets' );
}
return array(
'message' => sprintf( $message, $token[1] ),
'line' => $token[2],
);
}
}
// If we have entered into a class, eat tokens until we find the closing brace.
if ( T_CLASS !== $structure_type ) {
continue;
}
// Find the opening brace for the class.
while ( ! $this->end() && '{' !== $token ) {
$token = $this->peek();
$this->next();
}
// Continue traversing the class tokens until we have found the class closing brace.
$depth = 1;
while ( ! $this->end() && $depth > 0 ) {
$token = $this->peek();
if ( '{' === $token ) {
++$depth;
} elseif ( '}' === $token ) {
--$depth;
}
$this->next();
}
// If we did not make it out of the class, then there's a problem.
if ( $depth > 0 ) {
return array(
'message' => __( 'Parse error: syntax error, unexpected end of snippet', 'code-snippets' ),
'line' => $token[2],
);
}
}
return false;
}
}
php/class-welcome-api.php 0000644 00000023042 15153464550 0011362 0 ustar 00 <?php
namespace Code_Snippets;
use DateTimeImmutable;
use Exception;
use WP_Filesystem_Direct;
/**
* Class for loading data from the codesnippets.pro website.
*
* @package Code_Snippets
*/
class Welcome_API {
/**
* URL for the welcome page data.
*
* @var string
*/
protected const WELCOME_JSON_URL = 'https://codesnippets.pro/wp-content/uploads/cs_welcome/cs_welcome.json';
/**
* Limit of number of items to display when loading lists of items.
*
* @var int
*/
protected const ITEM_LIMIT = 4;
/**
* Limit of number of items of historic versions to display in the changelog.
*
* @var int
*/
protected const MAX_CHANGELOG_ENTRIES = 4;
/**
* Key used for caching welcome page data.
*
* @var string
*/
protected const CACHE_KEY = 'code_snippets_welcome_data';
/**
* Data fetched from the remote API.
*
* @var array{
* banner: ?array,
* hero-item: ?array,
* features: ?array,
* partners: ?array,
* changelog: ?array
* }
*/
private array $welcome_data;
/**
* Populate the $welcome_data variable when the class is loaded.
*
* @return void
*/
public function __construct() {
$stored_data = get_transient( self::CACHE_KEY );
if ( is_array( $stored_data ) ) {
$this->welcome_data = $stored_data;
} else {
$this->welcome_data = [];
$this->fetch_remote_welcome_data();
$this->build_changelog_data();
set_transient( self::CACHE_KEY, $this->welcome_data, DAY_IN_SECONDS * 2 );
}
}
/**
* Purge the welcome data cache.
*
* @return void
*/
public static function clear_cache() {
delete_transient( self::CACHE_KEY );
}
/**
* Safely retrieve an array from an object, ensuring it exists and is valid, returning a default value if not.
*
* @param array<string, mixed> $items Associative array containing array to extract.
* @param string $key Array key.
*
* @return array Extracted array, or empty array if array is missing.
*/
private static function safe_get_array( array $items, string $key ): array {
return isset( $items[ $key ] ) && is_array( $items[ $key ] ) ? $items[ $key ] : [];
}
/**
* Parse DateTime value from a string without triggering an error.
*
* @param string $datetime String representation of DateTime value.
*
* @return DateTimeImmutable|null
*/
private static function safe_parse_datetime( string $datetime ): ?DateTimeImmutable {
try {
return new DateTimeImmutable( $datetime );
} catch ( Exception $e ) {
return null;
}
}
/**
* Parse remote hero item data.
*
* @param array $remote Remote hero item data.
*
* @return array
*/
private function parse_hero_item( array $remote ): array {
return [
'name' => $remote[0]['name'] ?? '',
'follow_url' => $remote[0]['follow_url'] ?? '',
'image_url' => $remote[0]['image_url'] ?? '',
];
}
/**
* Parse remote banner data.
*
* @param array $remote Remote hero item data.
*
* @return array
*/
private function parse_banner( array $remote ): array {
return [
'key' => sanitize_key( $remote['key'] ) ?? '',
'start_datetime' => self::safe_parse_datetime( $remote['start_datetime'] ),
'end_datetime' => self::safe_parse_datetime( $remote['end_datetime'] ),
'text_free' => $remote['text_free'] ?? '',
'action_url_free' => $remote['action_url_free'] ?? '',
'action_label_free' => $remote['action_label_free'] ?? '',
'text_pro' => $remote['text_pro'] ?? '',
'action_url_pro' => $remote['action_url_pro'] ?? '',
'action_label_pro' => $remote['action_label_pro'] ?? '',
];
}
/**
* Parse a list of features from a remote dataset.
*
* @param array $remote Remote data.
*
* @return array[] Parsed feature data.
*/
private function parse_features( array $remote ): array {
$limit = max( self::ITEM_LIMIT, count( $remote ) );
$features = [];
for ( $i = 0; $i < $limit; $i++ ) {
$feature = $remote[ $i ];
$features[] = [
'title' => $feature['title'] ?? '',
'follow_url' => $feature['follow_url'] ?? '',
'image_url' => $feature['image_url'] ?? '',
'category' => $feature['category'] ?? '',
'description' => $feature['description'] ?? '',
];
}
return $features;
}
/**
* Parse a list of partners from a remote dataset.
*
* @param array $remote Remote data.
*
* @return array[] Parsed partner data.
*/
private function parse_partners( array $remote ): array {
$limit = max( self::ITEM_LIMIT, count( $remote ) );
$partners = [];
for ( $i = 0; $i < $limit; $i++ ) {
$partner = $remote[ $i ];
$partners[] = [
'title' => $partner['title'] ?? '',
'follow_url' => $partner['follow_url'] ?? '',
'image_url' => $partner['image_url'] ?? '',
];
}
return $partners;
}
/**
* Fetch remote welcome data from the remote server and add it to the stored data.
*
* @return void
*/
protected function fetch_remote_welcome_data() {
$remote_welcome_data = wp_remote_get( self::WELCOME_JSON_URL );
if ( is_wp_error( $remote_welcome_data ) ) {
return;
}
$remote_welcome_data = json_decode( wp_remote_retrieve_body( $remote_welcome_data ), true );
if ( ! is_array( $remote_welcome_data ) ) {
return;
}
$this->welcome_data['banner'] = $this->parse_banner( self::safe_get_array( $remote_welcome_data, 'banner' ) );
$this->welcome_data['hero-item'] = $this->parse_hero_item( self::safe_get_array( $remote_welcome_data, 'hero-item' ) );
$this->welcome_data['features'] = $this->parse_features( self::safe_get_array( $remote_welcome_data, 'features' ) );
$this->welcome_data['partners'] = $this->parse_partners( self::safe_get_array( $remote_welcome_data, 'partners' ) );
}
/**
* Build the full list of latest changes for caching.
*
* @return void
*/
protected function build_changelog_data() {
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';
require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';
$filesystem = new WP_Filesystem_Direct( null );
$changelog_filename = 'CHANGELOG.md';
$changelog = [];
$changelog_dir = plugin_dir_path( PLUGIN_FILE );
while ( plugin_dir_path( $changelog_dir ) !== $changelog_dir && ! $filesystem->exists( $changelog_dir . $changelog_filename ) ) {
$changelog_dir = plugin_dir_path( $changelog_dir );
}
if ( ! $filesystem->exists( $changelog_dir . $changelog_filename ) ) {
return;
}
$changelog_contents = $filesystem->get_contents( $changelog_dir . $changelog_filename );
$changelog_releases = explode( "\n## ", $changelog_contents );
foreach ( array_slice( $changelog_releases, 1, self::MAX_CHANGELOG_ENTRIES ) as $changelog_release ) {
$sections = explode( "\n### ", $changelog_release );
if ( count( $sections ) < 2 ) {
continue;
}
$header_parts = explode( '(', $sections[0], 2 );
$version = trim( trim( $header_parts[0] ), '[]' );
$changelog[ $version ] = [];
foreach ( array_slice( $sections, 1 ) as $section_contents ) {
$lines = array_filter( array_map( 'trim', explode( "\n", $section_contents ) ) );
$section_type = $lines[0];
foreach ( array_slice( $lines, 1 ) as $line ) {
$entry = trim( str_replace( '(PRO)', '', str_replace( '*', '', $line ) ) );
$core_or_pro = false === strpos( $line, '(PRO)' ) ? 'core' : 'pro';
if ( ! isset( $changelog[ $version ][ $section_type ] ) ) {
$changelog[ $version ][ $section_type ] = [
$core_or_pro => [ $entry ],
];
} elseif ( ! isset( $changelog[ $version ][ $section_type ][ $core_or_pro ] ) ) {
$changelog[ $version ][ $section_type ][ $core_or_pro ] = [ $entry ];
} else {
$changelog[ $version ][ $section_type ][ $core_or_pro ][] = $entry;
}
}
}
}
$this->welcome_data['changelog'] = $changelog;
}
/**
* Retrieve banner information.
*
* @return array{
* key: string,
* start_datetime: ?DateTimeImmutable,
* end_datetime: ?DateTimeImmutable,
* text_free: string,
* action_url_free: string,
* action_label_free: string,
* text_pro: string,
* action_url_pro: string,
* action_label_pro: string tet
* }
*/
public function get_banner(): array {
return $this->welcome_data['banner'] ?? [];
}
/**
* Retrieve hero information.
*
* @return array{
* name: string,
* follow_url: string,
* image_url: string
* }
*/
public function get_hero_item(): array {
return $this->welcome_data['hero-item'] ?? [];
}
/**
* Retrieve the list of features retrieved from the remote API.
*
* @return array{
* title: string,
* follow_url: string,
* image_url: string,
* category: string,
* description: string
* }[] Feature details.
*/
public function get_features(): array {
return $this->welcome_data['features'] ?? [];
}
/**
* Retrieve the list of partners retrieved from the remote API.
*
* @return array{
* title: string,
* follow_url: string,
* image_url: string
* }[] Partner details.
*/
public function get_partners(): array {
return $this->welcome_data['partners'] ?? [];
}
/**
* Retrieve a list of latest changes for display.
*
* @return array<string, array{
* 'Added': ?array<'core' | 'pro', string>,
* 'Fixed': ?array<'core' | 'pro', string>,
* 'Improved': ?array<'core' | 'pro', string>,
* 'Other': ?array<'core' | 'pro', string>
* }>
*/
public function get_changelog(): array {
return $this->welcome_data['changelog'] ?? [];
}
}
php/cloud/class-cloud-api.php 0000644 00000031716 15153464550 0012152 0 ustar 00 <?php
namespace Code_Snippets\Cloud;
use Code_Snippets\Snippet;
use WP_Error;
use function Code_Snippets\get_snippet_by_cloud_id;
use function Code_Snippets\get_snippets;
use function Code_Snippets\save_snippet;
use function Code_Snippets\update_snippet_fields;
/**
* Functions used to manage cloud synchronisation.
*
* @package Code_Snippets
*/
class Cloud_API {
/**
* Key used to access the local-to-cloud map transient data.
*/
private const CLOUD_MAP_TRANSIENT_KEY = 'cs_local_to_cloud_map';
/**
* Days to cache data retrieved from API.
*/
private const DAYS_TO_STORE_CS = 1;
/**
* Name of key used to cache cloud settings.
*
* @var string
*/
private const CLOUD_SETTINGS_CACHE_KEY = 'code_snippets_cloud_settings';
/**
* Token used for public API access.
*
* @var string
*/
private const CLOUD_SEARCH_API_TOKEN = 'csc-1a2b3c4d5e6f7g8h9i0j';
/**
* Cached list of cloud links.
*
* @var Cloud_Link[]|null
*/
private ?array $cached_cloud_links = null;
/**
* Retrieve the Cloud URL from wp-config or fallback to default.
*
* @return string
*/
public static function get_cloud_url(): string {
return defined( 'CS_CLOUD_URL' )
? CS_CLOUD_URL
: 'https://codesnippets.cloud/';
}
/**
* Retrieve the Cloud API URL from wp-config or fallback to default.
*
* @return string
*/
public static function get_cloud_api_url(): string {
return defined( 'CS_CLOUD_API_URL' )
? CS_CLOUD_API_URL
: self::get_cloud_url() . 'api/v1/';
}
/**
* Retrieve the cloud local token.
*
* @return string
*/
public static function get_local_token(): string {
return self::CLOUD_SEARCH_API_TOKEN;
}
/**
* Check that the cloud key is valid and verified.
*
* @return boolean
*/
public static function is_cloud_key_verified(): bool {
return false;
}
/**
* Check if the API key is set and verified.
*
* @return boolean
*/
public static function is_cloud_connection_available(): bool {
return false;
}
/**
* Create local-to-cloud map to keep track of local snippets that have been synced to the cloud.
*
* @return Cloud_Link[]
*/
private function get_cloud_links(): ?array {
// Return the cached data if available.
if ( is_array( $this->cached_cloud_links ) ) {
return $this->cached_cloud_links;
}
// Fetch data from the stored transient, if available.
$transient_data = get_transient( self::CLOUD_MAP_TRANSIENT_KEY );
if ( is_array( $transient_data ) ) {
$this->cached_cloud_links = $transient_data;
return $this->cached_cloud_links;
}
// Otherwise, regenerate the local-to-cloud-map.
$this->cached_cloud_links = [];
// Fetch and iterate through all local snippets to create the map.
foreach ( get_snippets() as $local_snippet ) {
// Skip snippets that are only stored locally.
if ( ! $local_snippet->cloud_id ) {
continue;
}
$link = new Cloud_Link();
$cloud_id_owner = $this->get_cloud_id_and_ownership( $local_snippet->cloud_id );
$cloud_id_int = intval( $cloud_id_owner['cloud_id'] );
$link->local_id = $local_snippet->id;
$link->cloud_id = $cloud_id_int;
$link->is_owner = $cloud_id_owner['is_owner'];
// Check if cloud id exists in cloud_id_rev array - this shows if the snippet is in the codevault.
$link->in_codevault = $cloud_id_rev[ $cloud_id_int ] ?? false;
// Get the cloud snippet revision if in codevault get from cloud_id_rev array otherwise get from cloud.
if ( $link->in_codevault ) {
$cloud_snippet_revision = $cloud_id_rev[ $cloud_id_int ] ?? $this->get_cloud_snippet_revision( $local_snippet->cloud_id );
$link->update_available = $local_snippet->revision < $cloud_snippet_revision;
}
$this->cached_cloud_links[] = $link;
}
set_transient(
self::CLOUD_MAP_TRANSIENT_KEY,
$this->cached_cloud_links,
DAY_IN_SECONDS * self::DAYS_TO_STORE_CS
);
return $this->cached_cloud_links;
}
/**
* Get ownership and Cloud ID of a snippet.
*
* @param string $cloud_id Cloud ID.
*
* @return array<string, mixed>
*/
public function get_cloud_id_and_ownership( string $cloud_id ): array {
$cloud_id_owner = explode( '_', $cloud_id );
return [
'cloud_id' => (int) $cloud_id_owner[0] ?? '',
'is_owner' => isset( $cloud_id_owner[1] ) && $cloud_id_owner[1],
'is_owner_string' => isset( $cloud_id_owner[1] ) && $cloud_id_owner[1] ? '1' : '0',
];
}
/**
* Unpack JSON data from a request response.
*
* @param array|WP_Error $response Response from wp_request_*.
*
* @return array<string, mixed>|null Associative array of JSON data on success, null on failure.
*/
private static function unpack_request_json( $response ): ?array {
$body = wp_remote_retrieve_body( $response );
return $body ? json_decode( $body, true ) : null;
}
/**
* Search Code Snippets Cloud -> Static Function
*
* @param string $search_method Search by name of codevault or keyword(s).
* @param string $search Search query.
* @param integer $page Search result page to retrieve. Defaults to '0'.
*
* @return Cloud_Snippets Result of search query.
*/
public static function fetch_search_results( string $search_method, string $search, int $page = 0 ): Cloud_Snippets {
$api_url = add_query_arg(
[
's_method' => $search_method,
's' => $search,
'page' => $page,
'site_token' => self::get_local_token(),
'site_host' => wp_parse_url( get_site_url(), PHP_URL_HOST ),
],
self::get_cloud_api_url() . 'public/search'
);
$results = self::unpack_request_json( wp_remote_get( $api_url ) );
$results = new Cloud_Snippets( $results );
$results->page = $page;
return $results;
}
/**
* Add a new link item to the local-to-cloud map.
*
* @param Cloud_Link $link Link to add.
*
* @return void
*/
public function add_cloud_link( Cloud_Link $link ) {
$local_to_cloud_map = get_transient( self::CLOUD_MAP_TRANSIENT_KEY );
$local_to_cloud_map[] = $link;
set_transient(
self::CLOUD_MAP_TRANSIENT_KEY,
$local_to_cloud_map,
DAY_IN_SECONDS * self::DAYS_TO_STORE_CS
);
}
/**
* Delete a snippet from local-to-cloud map.
*
* @param int $snippet_id Local snippet ID.
*
* @return void
*/
public function delete_snippet_from_transient_data( int $snippet_id ) {
if ( ! $this->cached_cloud_links ) {
$this->get_cloud_links();
}
foreach ( $this->cached_cloud_links as $link ) {
if ( $link->local_id === $snippet_id ) {
// Remove the link from the local_to_cloud_map.
$index = array_search( $link, $this->cached_cloud_links, true );
unset( $this->cached_cloud_links[ $index ] );
// Update the transient data.
set_transient(
self::CLOUD_MAP_TRANSIENT_KEY,
$this->cached_cloud_links,
DAY_IN_SECONDS * self::DAYS_TO_STORE_CS
);
}
}
}
/**
* Retrieve a single cloud snippet from the API.
*
* @param int $cloud_id Remote cloud snippet ID.
*
* @return Cloud_Snippet Retrieved snippet.
*/
public static function get_single_snippet_from_cloud( int $cloud_id ): Cloud_Snippet {
$url = self::get_cloud_api_url() . sprintf( 'public/getsnippet/%s', $cloud_id );
$response = wp_remote_get( $url );
$cloud_snippet = self::unpack_request_json( $response );
return new Cloud_Snippet( $cloud_snippet['snippet'] );
}
/**
* Get the current revision of a single cloud snippet.
*
* @param string $cloud_id Cloud snippet ID.
*
* @return string|null Revision number on success, null otherwise.
*/
public static function get_cloud_snippet_revision( string $cloud_id ): ?string {
$api_url = self::get_cloud_api_url() . sprintf( 'public/getsnippetrevision/%s', $cloud_id );
$body = wp_remote_retrieve_body( wp_remote_get( $api_url ) );
if ( ! $body ) {
return null;
}
$cloud_snippet_revision = json_decode( $body, true );
return $cloud_snippet_revision['snippet_revision'] ?? null;
}
/**
* Download a snippet from the cloud.
*
* @param int|string $cloud_id The cloud ID of the snippet as string from query args.
* @param string $source Unused in Core.
* @param string $action The action to be performed: 'download' or 'update'.
*
* @return array<string, string|bool> Result of operation: an array with `success` and `error_message` keys.
*
* @noinspection PhpUnusedParameterInspection
*/
public function download_or_update_snippet( int $cloud_id, string $source, string $action ): array {
$cloud_id = intval( $cloud_id );
$snippet_to_store = $this->get_single_snippet_from_cloud( $cloud_id );
switch ( $action ) {
case 'download':
return $this->download_snippet_from_cloud( $snippet_to_store );
case 'update':
return $this->update_snippet_from_cloud( $snippet_to_store );
default:
return [
'success' => false,
'error' => __( 'Invalid action.', 'code-snippets' ),
];
}
}
/**
* Download a snippet from the cloud.
*
* @param Cloud_Snippet $snippet_to_store The snippet to be downloaded.
*
* @return array The result of the download.
*/
public function download_snippet_from_cloud( Cloud_Snippet $snippet_to_store ): array {
$snippet = new Snippet( $snippet_to_store );
// Set the snippet id to 0 to ensure that the snippet is saved as a new snippet.
$ownership = $snippet_to_store->is_owner ? '1' : '0';
$snippet->id = 0;
$snippet->active = 0;
$snippet->cloud_id = $snippet_to_store->id . '_' . $ownership;
$snippet->desc = $snippet_to_store->description ? $snippet_to_store->description : '';
// Save the snippet to the database.
$new_snippet = save_snippet( $snippet );
$link = new Cloud_Link();
$link->local_id = $new_snippet->id;
$link->cloud_id = $snippet_to_store->id;
$link->is_owner = $snippet_to_store->is_owner;
$link->in_codevault = false;
$link->update_available = false;
$this->add_cloud_link( $link );
return [
'success' => true,
'action' => 'Single Downloaded',
'snippet_id' => $new_snippet->id,
'link_id' => $link->cloud_id,
];
}
/**
* Update a snippet from the cloud.
*
* @param Cloud_Snippet $snippet_to_store Snippet to be updated.
*
* @return array The result of the update.
*/
public function update_snippet_from_cloud( Cloud_Snippet $snippet_to_store ): array {
$cloud_id = $snippet_to_store->id . '_' . ( $snippet_to_store->is_owner ? '1' : '0' );
$local_snippet = get_snippet_by_cloud_id( sanitize_key( $cloud_id ) );
// Only update the code, active and revision fields.
$fields = [
'code' => $snippet_to_store->code,
'active' => false,
'revision' => $snippet_to_store->revision,
];
update_snippet_fields( $local_snippet->id, $fields );
$this->clear_caches();
return [
'success' => true,
'action' => __( 'Updated', 'code-snippets' ),
];
}
/**
* Find the cloud link for a given cloud snippet identifier.
*
* @param int $cloud_id Cloud ID.
*
* @return Cloud_Link|null
*/
public function get_link_for_cloud_id( int $cloud_id ): ?Cloud_Link {
$cloud_links = $this->get_cloud_links();
if ( $cloud_links ) {
foreach ( $cloud_links as $cloud_link ) {
if ( $cloud_link->cloud_id === $cloud_id ) {
return $cloud_link;
}
}
}
return null;
}
/**
* Find the cloud link for a given cloud snippet.
*
* @param Cloud_Snippet $cloud_snippet Cloud snippet.
*
* @return Cloud_Link|null
*/
public function get_link_for_cloud_snippet( Cloud_Snippet $cloud_snippet ): ?Cloud_Link {
return $this->get_link_for_cloud_id( $cloud_snippet->id );
}
/**
* Translate a snippet scope to a type.
*
* @param string $scope The scope of the snippet.
*
* @return string The type of the snippet.
*/
public static function get_type_from_scope( string $scope ): string {
switch ( $scope ) {
case 'global':
return 'php';
case 'site-css':
return 'css';
case 'site-footer-js':
return 'js';
case 'content':
return 'html';
default:
return '';
}
}
/**
* Translate a snippet status to a status-name.
*
* @param int $status The scope of the snippet.
*
* @return string The style to be used for the stats badge.
*/
public static function get_status_name_from_status( int $status ): string {
switch ( $status ) {
case 3:
return __( 'Private', 'code-snippets' );
case 4:
return __( 'Public', 'code-snippets' );
case 5:
return __( 'Unverified', 'code-snippets' );
case 6:
return __( 'AI Verified', 'code-snippets' );
case 8:
return __( 'Pro Verified', 'code-snippets' );
default:
return '';
}
}
/**
* Renders the html for the preview thickbox popup.
*
* @return void
*/
public static function render_cloud_snippet_thickbox() {
add_thickbox();
?>
<div id="show-code-preview" style="display: none;">
<h3 id="snippet-name-thickbox"></h3>
<h4><?php esc_html_e( 'Snippet Code:', 'code-snippets' ); ?></h4>
<pre class="thickbox-code-viewer">
<code id="snippet-code-thickbox"></code>
</pre>
</div>
<?php
}
/**
* Refresh the cached synced data.
*
* @return void
*/
public function clear_caches() {
$this->cached_cloud_links = null;
delete_transient( self::CLOUD_MAP_TRANSIENT_KEY );
}
}
php/cloud/class-cloud-link.php 0000644 00000003071 15153464550 0012327 0 ustar 00 <?php
namespace Code_Snippets\Cloud;
use Code_Snippets\Data_Item;
/**
* A connection between a local snippet and remote cloud snippet.
*
* @package Code_Snippets
*
* @property integer $local_id ID of local snippet as stored in WordPress database, if applicable.
* @property integer $cloud_id ID of remote snippet on cloud platform, if applicable.
* @property boolean $is_owner Ownership status of remote snippet on cloud platform.
* @property boolean $in_codevault Whether the remote snippet is stored in the users' codevault.
* @property boolean $update_available If synchronised, whether there is an update available on the cloud platform.
*/
class Cloud_Link extends Data_Item {
/**
* Constructor function
*
* @param array<string, mixed>|object $data Initial data fields.
*/
public function __construct( $data = null ) {
parent::__construct(
[
'local_id' => 0,
'cloud_id' => 0,
'is_owner' => false,
'in_codevault' => false,
'update_available' => false,
],
$data
);
}
/**
* Prepare a value before it is stored.
*
* @param mixed $value Value to prepare.
* @param string $field Field name.
*
* @return mixed Value in the correct format.
*/
protected function prepare_field( $value, string $field ) {
switch ( $field ) {
case 'local_id':
case 'remote_id':
return absint( $value );
case 'is_owner':
case 'in_codevault':
case 'update_available':
return is_bool( $value ) ? $value : (bool) $value;
default:
return $value;
}
}
}
php/cloud/class-cloud-search-list-table.php 0000644 00000030257 15153464550 0014703 0 ustar 00 <?php
/**
* Contains the class for handling the cloud search results table
*
* @package Code_Snippets
*/
namespace Code_Snippets\Cloud;
use WP_Plugin_Install_List_Table;
use function Code_Snippets\code_snippets;
if ( ! class_exists( 'WP_Plugin_Install_List_Table' ) ) {
require_once ABSPATH . 'wp-admin/includes/class-wp-plugin-install-list-table.php';
}
/**
* Class for handling the cloud search results table.
*
* @property string $_pagination Pagination HTML.
*
* @package Code_Snippets
*/
class Cloud_Search_List_Table extends WP_Plugin_Install_List_Table {
/**
* Instance of Cloud API class.
*
* @var Cloud_API
*/
protected Cloud_API $cloud_api;
/**
* Items for the cloud list table.
*
* @var Cloud_Snippets
*/
protected Cloud_Snippets $cloud_snippets;
/**
* Class constructor.
*/
public function __construct() {
/**
* Declare global variable due to undeclared warning.
*
* @noinspection PhpUnusedLocalVariableInspection
*/
global $tab;
parent::__construct(
[
'singular' => 'cloud-snippet',
'plural' => 'cloud-snippets',
'ajax' => false,
]
);
// Strip the result query arg from the URL.
$_SERVER['REQUEST_URI'] = remove_query_arg( [ 'result' ] );
$this->cloud_api = code_snippets()->cloud_api;
}
/**
* Prepare items for the table.
*
* @return void
*/
public function prepare_items() {
$this->cloud_snippets = $this->fetch_snippets();
$this->items = $this->cloud_snippets->snippets;
$this->process_actions();
$this->set_pagination_args(
[
'per_page' => count( $this->cloud_snippets->snippets ),
'total_items' => $this->cloud_snippets->total_snippets,
'total_pages' => $this->cloud_snippets->total_pages,
]
);
}
/**
* Process any actions that have been submitted, such as downloading cloud snippets to the local database.
*
* @return void
*/
public function process_actions() {
$_SERVER['REQUEST_URI'] = remove_query_arg(
[ 'action', 'snippet', '_wpnonce', 'source', 'cloud-bundle-run', 'cloud-bundle-show', 'bundle_share_name', 'cloud_bundles' ]
);
// Check request is coming form the cloud search page.
if ( isset( $_REQUEST['type'] ) && 'cloud_search' === $_REQUEST['type'] ) {
if ( isset( $_REQUEST['action'], $_REQUEST['snippet'], $_REQUEST['source'] ) ) {
cloud_lts_process_download_action(
sanitize_key( wp_unslash( $_REQUEST['action'] ) ),
sanitize_key( wp_unslash( $_REQUEST['source'] ) ),
sanitize_key( wp_unslash( $_REQUEST['snippet'] ) )
);
}
}
}
/**
* Output table rows.
*
* @return void
*/
public function display_rows() {
/**
* The current table item.
*
* @var $item Cloud_Snippet
*/
foreach ( $this->items as $item ) {
?>
<div class="plugin-card cloud-search-card plugin-card-<?php echo sanitize_html_class( $item->id ); ?>">
<?php
cloud_lts_display_column_hidden_input( 'code', $item );
cloud_lts_display_column_hidden_input( 'name', $item );
?>
<div class="plugin-card-top">
<div class="name column-name">
<h3>
<?php
$link = code_snippets()->cloud_api->get_link_for_cloud_snippet( $item );
if ( $link ) {
printf( '<a href="%s">', esc_url( code_snippets()->get_snippet_edit_url( $link->local_id ) ) );
} else {
printf(
'<a href="%s" title="%s" class="cloud-snippet-preview thickbox" data-snippet="%s" data-lang="%s">',
'#TB_inline?&width=700&height=500&inlineId=show-code-preview',
esc_attr__( 'Preview this snippet', 'code-snippets' ),
esc_attr( $item->id ),
esc_attr( Cloud_API::get_type_from_scope( $item->scope ) )
);
}
echo esc_html( $item->name );
// Grab first tag in array of tags.
$category = count( $item->tags ) > 0 ? strtolower( esc_attr( $item->tags[0] ) ) : '';
printf(
'<img src="%s" class="plugin-icon" alt="%s">',
esc_url( "https://codesnippets.cloud/images/plugin-icons/$category-logo.png" ),
esc_attr( $category )
);
echo '</a>';
?>
</h3>
</div>
<div class="action-links">
<?php echo wp_kses_post( cloud_lts_build_action_links( $item, 'search' ) ); ?>
</div>
<div class="desc column-description">
<p><?php echo wp_kses_post( $this->process_description( $item->description ) ); ?></p>
<p class="authors">
<cite>
<?php
esc_html_e( 'Codevault: ', 'code-snippets' );
printf(
'<a target="_blank" href="%s">%s</a>',
esc_url( sprintf( 'https://codesnippets.cloud/codevault/%s', $item->codevault ) ),
esc_html( $item->codevault )
);
?>
</cite>
</p>
</div>
</div>
<div class="plugin-card-bottom cloud-search-card-bottom">
<div class="vers column-rating voted-info">
<svg xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="thumbs-up">
<path stroke-linecap="round" stroke-linejoin="round"
d="M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z"></path>
</svg>
<span class="num-ratings" aria-hidden="true">
<?php
// translators: 1: number of votes.
$votes_text = _nx( '%d time', '%d times', $item->vote_count, 'vote count', 'code-snippets' );
$votes_text = sprintf( $votes_text, number_format_i18n( $item->vote_count ) );
// translators: 1: number of users.
$users_text = _n( '%d user', '%d users', $item->total_votes, 'code-snippets' );
$users_text = sprintf( $users_text, number_format_i18n( $item->total_votes ) );
// translators: 1: number of votes with label, 2: number of users with label.
echo esc_html( sprintf( _x( '%1$s by %2$s', 'votes', 'code-snippets' ), $votes_text, $users_text ) );
?>
</span>
</div>
<div class="column-updated">
<strong><?php esc_html_e( 'Last Updated:', 'code-snippets' ); ?></strong>
<?php
// translators: %s: Human-readable time difference.
echo esc_html( sprintf( __( '%s ago', 'code-snippets' ), human_time_diff( strtotime( $item->updated ) ) ) );
?>
</div>
<div class="column-downloaded">
<?php
$status_name = $this->cloud_api->get_status_name_from_status( $item->status );
printf(
'<a class="snippet-type-badge snippet-status" data-type="%s">%s</a>',
esc_attr( sanitize_title_with_dashes( strtolower( $status_name ) ) ),
esc_html( $status_name )
);
?>
<div class="tooltip-box">
<span class="dashicons dashicons-editor-help"></span>
<div class="tooltip-text">
<p class="tooltip-text-title">
<?php esc_html_e( 'Snippet Statuses', 'code-snippets' ); ?>
</p>
<p class="tooltip-text-item">
<a class="snippet-type-badge snippet-status" data-type="public">
<?php esc_html_e( 'Public', 'code-snippets' ); ?></a>
<?php esc_html_e( 'Snippet has passed basic review.', 'code-snippets' ); ?>
</p>
<p class="tooltip-text-item">
<a class="snippet-type-badge snippet-status" data-type="ai-verified">
<?php esc_html_e( 'AI Verified', 'code-snippets' ); ?></a>
<?php esc_html_e( ' Snippet has been tested by our AI bot.', 'code-snippets' ); ?>
</p>
<p class="tooltip-text-item">
<a class="snippet-type-badge snippet-status" data-type="unverified">
<?php esc_html_e( 'Unverified', 'code-snippets' ); ?></a>
<?php esc_html_e( ' Snippet has not undergone any review yet.', 'code-snippets' ); ?>
</p>
<p class="tooltip-text-link">
<a class="tooltip-text-link"
href="https://codesnippets.cloud/getstarted"
target="_blankx">
<?php esc_html_e( 'View the full list.', 'code-snippets' ); ?></a>
</p>
</div>
</div>
</div>
<div class="column-compatibility">
<strong><?php esc_html_e( 'WP Compatability:', 'code-snippets' ); ?></strong>
<?php
if ( empty( $wp_tested ) ) {
echo '<span class="compatibility-untested">', esc_html__( 'Not indicated by author', 'code-snippets' ), '</span>';
} else {
// translators: tested status.
$text = sprintf( __( 'Author states %s', 'code-snippets' ), $wp_tested );
echo '<span class="compatibility-compatible">', esc_html( $text ), '</span>';
}
?>
</div>
</div>
</div>
<?php
}
}
/**
* Process the description text - limit to 150 characters.
*
* @param string|null $description Description as provided by the API.
*
* @return string formatted description string max 150 chars.
*/
protected function process_description( ?string $description ): string {
$description = wp_strip_all_tags( $description );
return strlen( $description ) > 150 ? substr( $description, 0, 150 ) . '…' : $description;
}
/**
* Text displayed when no snippet data is available.
*
* @return void
*/
public function no_items() {
if ( ! empty( $_REQUEST['cloud_search'] ) && count( $this->cloud_snippets->snippets ) < 1 ) {
echo '<p class="no-results">',
esc_html__( 'No snippets or codevault could be found with that search term. Please try again.', 'code-snippets' ),
'</p>';
} else {
echo '<p>', esc_html__( 'Please enter a term to start searching code snippets in the cloud.', 'code-snippets' ), '</p>';
}
}
/**
* Fetch the snippets used to populate the table.
*
* @return Cloud_Snippets
*/
public function fetch_snippets(): Cloud_Snippets {
// Check if search term has been entered.
if ( isset( $_REQUEST['type'], $_REQUEST['cloud_search'], $_REQUEST['cloud_select'] ) &&
'cloud_search' === sanitize_key( wp_unslash( $_REQUEST['type'] ) )
) {
// If we have a search query, then send a search request to cloud server API search endpoint.
$search_query = sanitize_text_field( wp_unslash( $_REQUEST['cloud_search'] ) );
$search_by = sanitize_text_field( wp_unslash( $_REQUEST['cloud_select'] ) );
return Cloud_API::fetch_search_results( $search_by, $search_query, $this->get_pagenum() - 1 );
}
// If no search results, then return empty object.
return new Cloud_Snippets();
}
/**
* Gets the current search result page number.
*
* @return integer
*/
public function get_pagenum(): int {
$page = isset( $_REQUEST['search_page'] ) ? absint( $_REQUEST['search_page'] ) : 0;
if ( isset( $this->_pagination_args['total_pages'] ) && $page > $this->_pagination_args['total_pages'] ) {
$page = $this->_pagination_args['total_pages'];
}
return max( 1, $page );
}
/**
* Display the table.
*
* @return void
*/
public function display() {
Cloud_API::render_cloud_snippet_thickbox();
parent::display();
}
/**
* Displays the pagination.
*
* @param string $which Context where the pagination will be displayed.
*
* @return void
*/
protected function pagination( $which ) {
$total_items = $this->_pagination_args['total_items'];
$total_pages = $this->_pagination_args['total_pages'];
$pagenum = $this->get_pagenum();
if ( 'top' === $which && $total_pages > 1 ) {
$this->screen->render_screen_reader_content( 'heading_pagination' );
}
$paginate = cloud_lts_pagination( $which, 'search', $total_items, $total_pages, $pagenum );
$page_class = $paginate['page_class'];
$output = $paginate['output'];
$this->_pagination = "<div class='tablenav-pages$page_class'>$output</div>";
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->_pagination;
// echo wp_kses_post( $this->_pagination ); TODO: This removes the top input box for page number.
}
}
php/cloud/class-cloud-snippet.php 0000644 00000005146 15153464550 0013061 0 ustar 00 <?php
namespace Code_Snippets\Cloud;
use Code_Snippets\Data_Item;
use function Code_Snippets\code_snippets_build_tags_array;
/**
* A snippet object as retrieved from the cloud API.
*
* @since 3.4.0
* @package Code_Snippets
*
* @property int $id The remote ID.
* @property string $name The snippet title.
* @property string $description The formatted description.
* @property string $code The executable code.
* @property array<string> $tags An array of the tags.
* @property string $scope The scope name.
* @property string $codevault Name of user codevault.
* @property string $total_votes The total number of votes.
* @property string $vote_count The number of actual votes.
* @property string $wp_tested Tested with WP version.
* @property string $status Snippet Status ID.
* @property string $created The date and time when the snippet data was first created, in ISO format.
* @property string $updated When the snippet was last updated, in ISO format.
* @property integer $revision The update revision number.
* @property bool $is_owner If user is owner or author of snippet.
*/
class Cloud_Snippet extends Data_Item {
/**
* Constructor function.
*
* @param array<string, mixed>|null $initial_data Initial snippet data.
*/
public function __construct( ?array $initial_data = null ) {
parent::__construct(
[
'id' => '',
'cloud_id' => '',
'name' => '',
'description' => '',
'code' => '',
'tags' => [],
'scope' => '',
'status' => '',
'codevault' => '',
'total_votes' => '',
'vote_count' => '',
'wp_tested' => '',
'created' => '',
'updated' => '',
'revision' => 0,
'is_owner' => false,
'shared_network' => false,
],
$initial_data
);
}
/**
* Prepare a value before it is stored.
*
* @param mixed $value Value to prepare.
* @param string $field Field name.
*
* @return mixed Value in the correct format.
*/
protected function prepare_field( $value, string $field ) {
switch ( $field ) {
case 'id':
case 'revision':
return absint( $value );
case 'is_owner':
return (bool) $value;
case 'description':
return ( null === $value ) ? '' : $value;
case 'tags':
return code_snippets_build_tags_array( $value );
default:
return $value;
}
}
}
php/cloud/class-cloud-snippets.php 0000644 00000004227 15153464550 0013243 0 ustar 00 <?php
namespace Code_Snippets\Cloud;
use Code_Snippets\Data_Item;
/**
* A list of snippets as retrieved from the cloud API.
*
* @since 3.4.0
* @package Code_Snippets
*
* @property Cloud_Snippet[] $snippets List of snippet items for the current page.
* @property integer $page Page of data that this data belongs to.
* @property integer $total_pages Total number of available pages of items.
* @property integer $total_snippets Total number of available snippet items.
* @property array $cloud_id_rev An array of all cloud snippet IDs and their revision numbers.
* @property bool $success If the request has any results.
*/
class Cloud_Snippets extends Data_Item {
/**
* Class constructor.
*
* @param array<string, Cloud_Snippet[]|integer> $initial_data Initial data.
*/
public function __construct( $initial_data = null ) {
parent::__construct(
[
'snippets' => [],
'total_snippets' => 0,
'total_pages' => 0,
'page' => 0,
'cloud_id_rev' => [],
],
$initial_data,
[
'items' => 'snippets',
'total_items' => 'total_snippets',
'page' => 'page',
'cloud_id_rev' => 'cloud_id_rev',
]
);
}
/**
* Prepare a value before it is stored.
*
* @param mixed $value Value to prepare.
* @param string $field Field name.
*
* @return mixed Value in the correct format.
*/
protected function prepare_field( $value, string $field ) {
switch ( $field ) {
case 'page':
case 'total_pages':
case 'total_snippets':
return absint( $value );
default:
return $value;
}
}
/**
* Prepare the `snippets` field by ensuring it is a list of Cloud_Snippets objects.
*
* @param mixed $snippets The field as provided.
*
* @return Cloud_Snippets[] The field in the correct format.
*/
protected function prepare_snippets( $snippets ): array {
$result = [];
$snippets = is_array( $snippets ) ? $snippets : [ $snippets ];
foreach ( $snippets as $snippet ) {
$result[] = $snippet instanceof Cloud_Snippet ? $snippet : new Cloud_Snippet( $snippet );
}
return $result;
}
}
php/cloud/list-table-shared-ops.php 0000644 00000020561 15153464550 0013271 0 ustar 00 <?php
/**
* Functions to perform snippet operations
*
* @package Code_Snippets
*/
namespace Code_Snippets\Cloud;
use function Code_Snippets\code_snippets;
/**
* Display a hidden input field for a certain column and snippet value.
*
* @param string $column_name Column name.
* @param Cloud_Snippet $snippet Column item.
*
* @return void
*/
function cloud_lts_display_column_hidden_input( string $column_name, Cloud_Snippet $snippet ) {
printf(
'<input id="cloud-snippet-%s-%s" class="cloud-snippet-item" type="hidden" name="%s" value="%s" />',
esc_attr( $column_name ),
esc_attr( $snippet->id ),
esc_attr( $column_name ),
esc_attr( $snippet->$column_name )
);
}
/**
* Process the download snippet action
*
* @param string $action Action - 'download' or 'update'.
* @param string $source Source - 'search' or 'cloud'.
* @param string $snippet Snippet ID.
* @param int $codevault_page The current page of the codevault.
*
* @return void
*/
function cloud_lts_process_download_action( string $action, string $source, string $snippet, int $codevault_page = 0 ) {
if ( 'download' === $action || 'update' === $action ) {
$result = code_snippets()->cloud_api->download_or_update_snippet( $snippet, $source, $action, $codevault_page );
if ( $result['success'] ) {
$redirect_uri = $result['snippet_id'] ?
code_snippets()->get_snippet_edit_url( (int) $result['snippet_id'] ) :
add_query_arg( 'result', $result['action'] );
wp_safe_redirect( esc_url_raw( $redirect_uri ) );
exit;
}
}
}
/**
* Build action links for snippet.
*
* @param Cloud_Snippet $cloud_snippet Snippet/Column item.
* @param string $source Source - 'search' or 'codevault'.
*
* @return string
*/
function cloud_lts_build_action_links( Cloud_Snippet $cloud_snippet, string $source ): string {
$lang = Cloud_API::get_type_from_scope( $cloud_snippet->scope );
$link = code_snippets()->cloud_api->get_link_for_cloud_snippet( $cloud_snippet );
$additional_classes = 'search' === $source ? 'action-button-link' : '';
$is_licensed = code_snippets()->licensing->is_licensed();
$download = true;
$action_link = '';
if ( ! $is_licensed && in_array( $lang, [ 'css', 'js' ], true ) ) {
$download = false;
}
if ( $link ) {
if ( $is_licensed && $link->update_available ) {
$download = false;
$update_url = add_query_arg(
[
'action' => 'update',
'snippet' => $cloud_snippet->id,
'source' => $source,
]
);
$action_link = sprintf(
'<a class="cloud-snippet-update %s" href="%s">%s</a>',
$additional_classes,
esc_url( $update_url ),
esc_html__( 'Update Available', 'code-snippets' )
);
} else {
return sprintf(
'<a href="%s" class="cloud-snippet-downloaded %s">%s</a>',
esc_url( code_snippets()->get_snippet_edit_url( $link->local_id ) ),
$additional_classes,
esc_html__( 'View', 'code-snippets' )
);
}
}
if ( $download ) {
$download_url = add_query_arg(
[
'action' => 'download',
'snippet' => $cloud_snippet->id,
'source' => $source,
]
);
$action_link = $is_licensed ?
sprintf(
'<a class="cloud-snippet-download %s" href="%s">%s</a>',
$additional_classes,
esc_url( $download_url ),
esc_html__( 'Download', 'code-snippets' )
) :
sprintf(
'<a class="cloud-snippet-download %s" href="%s" target="_blank"><span class="go-pro-badge">%s</span>%s</a>',
$additional_classes,
'https://codesnippets.pro/pricing/',
esc_html_x( 'Pro', 'pro only', 'code-snippets' ),
esc_html_x( ' Only', 'pro only', 'code-snippets' )
);
}
$thickbox_url = '#TB_inline?&width=700&height=500&inlineId=show-code-preview';
$thickbox_link = sprintf(
'<a href="%s" title="%s" class="cloud-snippet-preview cloud-snippet-preview-style thickbox %s" data-snippet="%s" data-lang="%s">%s</a>',
esc_url( $thickbox_url ),
esc_attr( $cloud_snippet->name ),
$additional_classes,
esc_attr( $cloud_snippet->id ),
esc_attr( $lang ),
esc_html__( 'Preview', 'code-snippets' )
);
return $action_link . $thickbox_link;
}
/**
* Build the pagination functionality
*
* @param string $which Context where the pagination will be displayed.
* @param string $source Source - 'search' or 'cloud'.
* @param int $total_items Total number of items.
* @param int $total_pages Total number of pages.
* @param int $pagenum Current page number.
*
* @return array
*/
function cloud_lts_pagination( string $which, string $source, int $total_items, int $total_pages, int $pagenum ): array {
/* translators: %s: Number of items. */
$num = sprintf( _n( '%s item', '%s items', $total_items, 'code-snippets' ), number_format_i18n( $total_items ) );
$output = '<span class="displaying-num">' . $num . '</span>';
$current = isset( $_REQUEST['cloud_page'] ) ? (int) $_REQUEST['cloud_page'] : $pagenum;
$current_url = remove_query_arg( wp_removable_query_args() ) . '#' . $source;
$page_links = array();
$html_current_page = '';
$total_pages_before = '<span class="paging-input">';
$total_pages_after = '</span></span>';
$disable_first = false;
$disable_last = false;
$disable_prev = false;
$disable_next = false;
if ( 1 === $current ) {
$disable_first = true;
$disable_prev = true;
}
if ( $total_pages === $current ) {
$disable_last = true;
$disable_next = true;
}
if ( $disable_first ) {
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">«</span>';
} else {
$page_links[] = sprintf(
'<a class="first-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">‹</span></a>',
esc_url( remove_query_arg( $source . '_page', $current_url ) ),
esc_html__( 'First page', 'code-snippets' )
);
}
if ( $disable_prev ) {
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">‹</span>';
} else {
$page_links[] = sprintf(
'<a class="prev-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">«</span></a>',
esc_url( add_query_arg( $source . '_page', max( 1, $current - 1 ), $current_url ) ),
esc_html__( 'Previous page', 'code-snippets' )
);
}
if ( 'bottom' === $which ) {
$html_current_page = $current;
$total_pages_before = sprintf( '<span class="screen-reader-text">%s</span><span id="table-paging" class="paging-input"><span class="tablenav-paging-text">', __( 'Current page', 'code-snippets' ) );
}
if ( 'top' === $which ) {
$html_current_page = sprintf(
'<label for="current-page-selector" class="screen-reader-text">%s</label><input class="current-page-selector" id="current-page-selector" type="text" name="%s_page" value="%s" size="%d" aria-describedby="table-paging" /><span class="tablenav-paging-text">',
__( 'Current page', 'code-snippets' ),
$source,
$current,
strlen( $total_pages )
);
}
$html_total_pages = sprintf( '<span class="total-pages">%s</span>', number_format_i18n( $total_pages ) );
/* translators: 1: Current page, 2: Total pages. */
$current_html = _x( '%1$s of %2$s', 'paging', 'code-snippets' );
$page_links[] = $total_pages_before . sprintf( $current_html, $html_current_page, $html_total_pages ) . $total_pages_after;
if ( $disable_next ) {
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">›</span>';
} else {
$page_links[] = sprintf(
'<a class="next-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">%s</span></a>',
esc_url( add_query_arg( $source . '_page', min( $total_pages, $current + 1 ), $current_url ) ),
__( 'Next page' ),
'›'
);
}
if ( $disable_last ) {
$page_links[] = '<span class="tablenav-pages-navspan button disabled" aria-hidden="true">»</span>';
} else {
$page_links[] = sprintf(
'<a class="last-page button" href="%s"><span class="screen-reader-text">%s</span><span aria-hidden="true">%s</span></a>',
esc_url( add_query_arg( $source . '_page', $total_pages, $current_url ) ),
__( 'Last page', 'code-snippets' ),
'»'
);
}
$pagination_links_class = 'pagination-links';
if ( ! empty( $infinite_scroll ) ) {
$pagination_links_class .= ' hide-if-js';
}
$output .= "\n<span class='$pagination_links_class'>" . implode( "\n", $page_links ) . '</span>';
return [
'output' => $output,
'page_class' => $total_pages ? ( $total_pages < 2 ? ' one-page' : '' ) : ' no-pages',
];
}
php/deactivation-notice.php 0000644 00000003707 15153464550 0012014 0 ustar 00 <?php
/**
* File loaded when the plugin cannot be activated.
*
* All code in this file should be compatible with PHP 5.2 or later.
*
* @package Code_Snippets
*
* @noinspection PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection
*
* phpcs:disable Modernize.FunctionCalls.Dirname.FileConstant
*/
if ( ! defined( 'ABSPATH' ) || function_exists( 'code_snippets_deactivation_notice' ) ) {
return;
}
/**
* Deactivate the plugin and display a notice informing the user that this has happened.
*
* @return void
*
* @since 3.3.0
*/
function code_snippets_deactivation_notice() {
$plugins = array();
$required_php_version = '7.4';
if ( version_compare( phpversion(), $required_php_version, '<' ) ) {
echo '<div class="error fade"><p><strong>';
// translators: %s: required PHP version number.
echo esc_html( sprintf( __( 'Code Snippets requires PHP %s or later.', 'code-snippets' ), $required_php_version ) );
echo '</strong><br>';
$update_url = function_exists( 'wp_get_default_update_php_url' ) ?
wp_get_default_update_php_url() :
'https://wordpress.org/support/update-php/';
// translators: %s: Update PHP URL.
$text = __( 'Please <a href="%s">upgrade your server to the latest version of PHP</a> to continue using Code Snippets.', 'code-snippets' );
echo wp_kses( sprintf( $text, $update_url ), array( 'a' => array( 'href' => array() ) ) );
echo '</p></div>';
$plugins[] = plugin_basename( dirname( dirname( __FILE__ ) ) . '/code-snippets.php' );
}
if ( defined( 'CODE_SNIPPETS_FILE' ) ) {
echo '<div class="error fade"><p>';
esc_html_e( 'Another version of Code Snippets appears to be installed. Deactivating this version.', 'code-snippets' );
echo '</p></div>';
$plugins[] = 'code-snippets/code-snippets.php';
}
if ( $plugins ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
deactivate_plugins( array_unique( $plugins ) );
}
}
add_action( 'admin_notices', 'code_snippets_deactivation_notice' );
php/editor.php 0000644 00000006320 15153464550 0007343 0 ustar 00 <?php
/**
* Functions for using the built-in code editor library
*
* @package Code_Snippets
*/
namespace Code_Snippets;
use function Code_Snippets\Settings\get_setting;
/**
* Register and load the CodeMirror library.
*
* @param string $type Type of code editor – either 'php', 'css', 'js', or 'html'.
* @param array<string, mixed> $extra_atts Pass a list of attributes to override the saved ones.
*/
function enqueue_code_editor( string $type, array $extra_atts = [] ) {
$plugin = code_snippets();
$modes = [
'css' => 'text/css',
'php' => 'php-snippet',
'js' => 'javascript',
'html' => 'application/x-httpd-php',
];
if ( ! isset( $modes[ $type ] ) ) {
$type = 'php';
}
$default_atts = [
'mode' => $modes[ $type ],
'inputStyle' => 'textarea',
'matchBrackets' => true,
'extraKeys' => [
'Alt-F' => 'findPersistent',
'Ctrl-Space' => 'autocomplete',
'Ctrl-/' => 'toggleComment',
'Cmd-/' => 'toggleComment',
'Alt-Up' => 'swapLineUp',
'Alt-Down' => 'swapLineDown',
],
'gutters' => [ 'CodeMirror-lint-markers', 'CodeMirror-foldgutter' ],
'lint' => 'css' === $type || 'php' === $type,
'direction' => 'ltr',
'colorpicker' => [ 'mode' => 'edit' ],
'foldOptions' => [ 'widget' => '...' ],
];
// Add relevant saved setting values to the default attributes.
$plugin_settings = Settings\get_settings_values();
$setting_fields = Settings\get_settings_fields();
foreach ( $setting_fields['editor'] as $field_id => $field ) {
// The 'codemirror' setting field specifies the name of the attribute.
$default_atts[ $field['codemirror'] ] = $plugin_settings['editor'][ $field_id ];
}
// Merge the default attributes with the ones passed into the function.
$atts = wp_parse_args( $default_atts, $extra_atts );
$atts = apply_filters( 'code_snippets_codemirror_atts', $atts );
// Ensure number values are not formatted as strings.
foreach ( [ 'indentUnit', 'tabSize' ] as $number_att ) {
$atts[ $number_att ] = intval( $atts[ $number_att ] );
}
wp_enqueue_code_editor(
[
'type' => $modes[ $type ],
'codemirror' => $atts,
]
);
wp_enqueue_script( 'htmlhint' );
wp_enqueue_script( 'csslint' );
wp_enqueue_script( 'jshint' );
wp_enqueue_script(
'code-snippets-code-editor',
plugins_url( 'dist/editor.js', $plugin->file ),
[ 'code-editor' ],
$plugin->version,
true
);
// CodeMirror Theme.
$theme = get_setting( 'editor', 'theme' );
if ( 'default' !== $theme ) {
wp_enqueue_style(
'code-snippets-editor-theme-' . $theme,
plugins_url( "dist/editor-themes/$theme.css", $plugin->file ),
[ 'code-editor' ],
$plugin->version
);
}
}
/**
* Retrieve a list of the available CodeMirror themes.
*
* @return array<string> The available themes.
*/
function get_editor_themes(): array {
static $themes = null;
if ( ! is_null( $themes ) ) {
return $themes;
}
$themes = array();
$themes_dir = plugin_dir_path( PLUGIN_FILE ) . 'dist/editor-themes/';
$theme_files = glob( $themes_dir . '*.css' );
foreach ( $theme_files as $theme ) {
$theme = str_replace( $themes_dir, '', $theme );
$theme = str_replace( '.css', '', $theme );
$themes[] = $theme;
}
return $themes;
}
php/export/class-export-attachment.php 0000644 00000003246 15153464550 0014154 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Handles exporting snippets from the site to a downloadable file over HTTP.
*
* @package Code_Snippets
*/
class Export_Attachment extends Export {
/**
* Set up the current page to act like a downloadable file instead of being shown in the browser
*
* @param string $format File format. Used for file extension.
* @param string $mime_type File MIME type. Used for Content-Type header.
*/
private function do_headers( string $format, string $mime_type = 'text/plain' ) {
header( 'Content-Disposition: attachment; filename=' . sanitize_file_name( $this->build_filename( $format ) ) );
header( sprintf( 'Content-Type: %s; charset=%s', sanitize_mime_type( $mime_type ), get_bloginfo( 'charset' ) ) );
}
/**
* Export snippets in JSON format as a downloadable file.
*/
public function download_snippets_json() {
$this->do_headers( 'json', 'application/json' );
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo wp_json_encode(
$this->create_export_object(),
apply_filters( 'code_snippets/export/json_encode_options', 0 )
);
exit;
}
/**
* Export snippets in their code file format.
*/
public function download_snippets_code() {
$mime_types = [
'php' => 'text/php',
'css' => 'text/css',
'js' => 'text/javascript',
];
$type = isset( $mime_types[ $this->snippets_list[0]->type ] ) ? $this->snippets_list[0]->type : 'php';
$this->do_headers( $type, $mime_types[ $type ] );
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
echo ( 'php' === $type || 'html' === $type ) ?
$this->export_snippets_php() :
$this->export_snippets_code( $type );
exit;
}
}
php/export/class-export.php 0000644 00000010170 15153464550 0012020 0 ustar 00 <?php
namespace Code_Snippets;
/**
* Handles exporting snippets from the site in various downloadable formats
*
* @package Code_Snippets
* @since 3.0.0
*/
class Export {
/**
* Array of snippet data fetched from the database
*
* @var Snippet[]
*/
protected array $snippets_list;
/**
* Class constructor
*
* @param array<int> $ids List of snippet IDs to export.
* @param boolean|null $network Whether to fetch snippets from local or network table.
*/
public function __construct( array $ids, ?bool $network = null ) {
$this->snippets_list = get_snippets( $ids, $network );
}
/**
* Build the export filename.
*
* @param string $format File format. Used for file extension.
*
* @return string
*/
public function build_filename( string $format ): string {
if ( 1 === count( $this->snippets_list ) ) {
// If there is only snippet to export, use its name instead of the site name.
$title = strtolower( $this->snippets_list[0]->name );
} else {
// Otherwise, use the site name as set in Settings > General.
$title = strtolower( get_bloginfo( 'name' ) );
}
$filename = "$title.code-snippets.$format";
return apply_filters( 'code_snippets/export/filename', $filename, $title, $this->snippets_list );
}
/**
* Bundle snippets together into JSON format.
*
* @return array<string, string|Snippet[]> Snippets as JSON object.
*/
public function create_export_object(): array {
$snippets = array();
foreach ( $this->snippets_list as $snippet ) {
$snippets[] = array_map(
function ( $value ) {
return is_string( $value ) ?
str_replace( "\r\n", "\n", $value ) :
$value;
},
$snippet->get_modified_fields()
);
}
return array(
'generator' => 'Code Snippets v' . code_snippets()->version,
'date_created' => gmdate( 'Y-m-d H:i' ),
'snippets' => $snippets,
);
}
/**
* Bundle a snippets into a PHP file.
*/
public function export_snippets_php(): string {
$result = "<?php\n";
foreach ( $this->snippets_list as $snippet ) {
$code = trim( $snippet->code );
if ( ( 'php' !== $snippet->type && 'html' !== $snippet->type ) || ! $code ) {
continue;
}
$result .= "\n/**\n * $snippet->display_name\n";
if ( ! empty( $snippet->desc ) ) {
// Convert description to PhpDoc.
$desc = wp_strip_all_tags( str_replace( "\n", "\n * ", $snippet->desc ) );
$result .= " *\n * $desc\n";
}
$result .= " */\n";
if ( 'content' === $snippet->scope ) {
$shortcode_tag = apply_filters( 'code_snippets_export_shortcode_tag', "code_snippets_export_$snippet->id", $snippet );
$code = sprintf(
"add_shortcode( '%s', function () {\n\tob_start();\n\t?>\n\n\t%s\n\n\t<?php\n\treturn ob_get_clean();\n} );",
$shortcode_tag,
str_replace( "\n", "\n\t", $code )
);
}
$result .= "$code\n";
}
return $result;
}
/**
* Export snippets in a generic JSON format that is not intended for importing.
*
* @return string
*/
public function export_snippets_basic_json(): string {
$snippet_data = array();
foreach ( $this->snippets_list as $snippet ) {
$snippet_data[] = $snippet->get_modified_fields();
}
return wp_json_encode( 1 === count( $snippet_data ) ? $snippet_data[0] : $snippet_data );
}
/**
* Generate a downloadable CSS or JavaScript file from a list of snippets
*
* @phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
*
* @param string|null $type Snippet type. Supports 'css' or 'js'.
*/
public function export_snippets_code( ?string $type = null ): string {
$result = '';
if ( ! $type ) {
$type = $this->snippets_list[0]->type;
}
if ( 'php' === $type || 'html' === $type ) {
return $this->export_snippets_php();
}
foreach ( $this->snippets_list as $snippet ) {
$snippet = new Snippet( $snippet );
if ( $snippet->type !== $type ) {
continue;
}
$result .= "\n/*\n";
if ( $snippet->name ) {
$result .= wp_strip_all_tags( $snippet->name ) . "\n\n";
}
if ( ! empty( $snippet->desc ) ) {
$result .= wp_strip_all_tags( $snippet->desc ) . "\n";
}
$result .= "*/\n\n$snippet->code\n\n";
}
return $result;
}
}
php/export/class-import.php 0000644 00000012324 15153464550 0012014 0 ustar 00 <?php
namespace Code_Snippets;
use DOMDocument;
/**
* Handles importing snippets from export files into the site
*
* @package Code_Snippets
* @since 3.0.0
*
* phpcs:disable WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
* phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
*/
class Import {
/**
* Path to file to import.
*
* @var string
*/
private string $file;
/**
* Whether snippets should be imported into the network-wide or site-wide table.
*
* @var bool
*/
private bool $multisite;
/**
* Action to take if duplicate snippets are detected. Can be 'skip', 'ignore', or 'replace'.
*
* @var string
*/
private string $dup_action;
/**
* Class constructor.
*
* @param string $file The path to the file to import.
* @param bool|null $network Import into network-wide table (true) or site-wide table (false).
* @param string $dup_action Action to take if duplicate snippets are detected. Can be 'skip', 'ignore', or 'replace'.
*/
public function __construct( string $file, ?bool $network = null, string $dup_action = 'ignore' ) {
$this->file = $file;
$this->multisite = DB::validate_network_param( $network );
$this->dup_action = $dup_action;
}
/**
* Imports snippets from a JSON file.
*
* @return array<integer>|bool An array of imported snippet IDs on success, false on failure
*/
public function import_json() {
if ( ! file_exists( $this->file ) || ! is_file( $this->file ) ) {
return false;
}
$raw_data = file_get_contents( $this->file );
$data = json_decode( $raw_data, true );
$snippets = array();
// Reformat the data into snippet objects.
foreach ( $data['snippets'] as $snippet_data ) {
$snippet = new Snippet();
$snippet->network = $this->multisite;
$import_fields = [
'name',
'desc',
'description',
'code',
'tags',
'scope',
'priority',
'shared_network',
'modified',
'cloud_id',
];
foreach ( $import_fields as $field ) {
if ( isset( $snippet_data[ $field ] ) ) {
$snippet->set_field( $field, $snippet_data[ $field ] );
}
}
$snippets[] = $snippet;
}
$imported = $this->save_snippets( $snippets );
do_action( 'code_snippets/import/json', $this->file, $this->multisite );
return $imported;
}
/**
* Imports snippets from an XML file
*
* @return array<integer>|bool An array of imported snippet IDs on success, false on failure
*/
public function import_xml() {
if ( ! file_exists( $this->file ) || ! is_file( $this->file ) ) {
return false;
}
$dom = new DOMDocument( '1.0', get_bloginfo( 'charset' ) );
$dom->load( $this->file );
$snippets_xml = $dom->getElementsByTagName( 'snippet' );
$fields = array( 'name', 'description', 'desc', 'code', 'tags', 'scope' );
$snippets = array();
foreach ( $snippets_xml as $snippet_xml ) {
$snippet = new Snippet();
$snippet->network = $this->multisite;
// Build a snippet object by looping through the field names.
foreach ( $fields as $field_name ) {
// Fetch the field element from the document.
$field = $snippet_xml->getElementsByTagName( $field_name )->item( 0 );
// If the field element exists, add it to the snippet object.
if ( isset( $field->nodeValue ) ) {
$snippet->set_field( $field_name, $field->nodeValue );
}
}
// Get scope from attribute.
$scope = $snippet_xml->getAttribute( 'scope' );
if ( ! empty( $scope ) ) {
$snippet->scope = $scope;
}
$snippets[] = $snippet;
}
$imported = $this->save_snippets( $snippets );
do_action( 'code_snippets/import/xml', $this->file, $this->multisite );
return $imported;
}
/**
* Fetch a list of existing snippets for checking duplicates.
*
* @return array<string, integer>
*/
private function fetch_existing_snippets(): array {
$existing_snippets = array();
if ( 'replace' === $this->dup_action || 'skip' === $this->dup_action ) {
$all_snippets = get_snippets( array(), $this->multisite );
foreach ( $all_snippets as $snippet ) {
if ( $snippet->name ) {
$existing_snippets[ $snippet->name ] = $snippet->id;
}
}
}
return $existing_snippets;
}
/**
* Save imported snippets to the database
*
* @access private
*
* @param array<Snippet> $snippets List of snippets to save.
*
* @return array<integer> IDs of imported snippets.
*/
private function save_snippets( array $snippets ): array {
$existing_snippets = $this->fetch_existing_snippets();
$imported = array();
foreach ( $snippets as $snippet ) {
// Check if the snippet already exists.
if ( 'ignore' !== $this->dup_action && isset( $existing_snippets[ $snippet->name ] ) ) {
// If so, either overwrite the existing ID, or skip this import.
if ( 'replace' === $this->dup_action ) {
$snippet->id = $existing_snippets[ $snippet->name ];
} elseif ( 'skip' === $this->dup_action ) {
continue;
}
}
// Save the snippet and increase the counter if successful.
$saved_snippet = save_snippet( $snippet );
// Get ID of the saved snippet as save_snippet() returns complete snippet object.
$snippet_id = $saved_snippet->id;
if ( $snippet_id ) {
$imported[] = $snippet_id;
}
}
return $imported;
}
}
php/front-end/class-front-end.php 0000644 00000027176 15153464550 0012764 0 ustar 00 <?php
namespace Code_Snippets;
use WP_Post;
use WP_REST_Response;
use WP_REST_Server;
/**
* This class manages the shortcodes included with the plugin,
*
* @package Code_Snippets
*/
class Front_End {
/**
* Name of the shortcode tag for rendering the code source
*/
const SOURCE_SHORTCODE = 'code_snippet_source';
/**
* Name of the shortcode tag for rendering content snippets
*/
const CONTENT_SHORTCODE = 'code_snippet';
/**
* Handle to use for front-end scripts and styles.
*/
const PRISM_HANDLE = 'code-snippets-prism';
/**
* Maximum depth for shortcode recursion.
*/
const MAX_SHORTCODE_DEPTH = 5;
/**
* Class constructor
*/
public function __construct() {
add_action( 'the_posts', [ $this, 'enqueue_highlighting' ] );
add_action( 'init', [ $this, 'setup_mce_plugin' ] );
add_shortcode( self::CONTENT_SHORTCODE, [ $this, 'render_content_shortcode' ] );
add_shortcode( self::SOURCE_SHORTCODE, [ $this, 'render_source_shortcode' ] );
add_filter( 'code_snippets/render_content_shortcode', 'trim' );
}
/**
* Register REST API routes for use in front-end plugins.
*
* @return void
*/
public function register_rest_routes() {
register_rest_route(
'v1/snippets',
'/snippets-info',
array(
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'get_snippets_info' ],
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
},
)
);
}
/**
* Fetch snippets data in response to a request.
*
* @return WP_REST_Response
*/
public function get_snippets_info(): WP_REST_Response {
$snippets = get_snippets();
$data = [];
foreach ( $snippets as $snippet ) {
$data[] = [
'id' => $snippet->id,
'name' => $snippet->name,
'type' => $snippet->type,
'active' => $snippet->active,
];
}
return new WP_REST_Response( $data, 200 );
}
/**
* Perform the necessary actions to add a button to the TinyMCE editor
*/
public function setup_mce_plugin() {
if ( ! code_snippets()->current_user_can() ) {
return;
}
/* Register the TinyMCE plugin */
add_filter(
'mce_external_plugins',
function ( $plugins ) {
$plugins['code_snippets'] = plugins_url( 'dist/mce.js', PLUGIN_FILE );
return $plugins;
}
);
/* Add the button to the editor toolbar */
add_filter(
'mce_buttons',
function ( $buttons ) {
$buttons[] = 'code_snippets';
return $buttons;
}
);
/* Add the translation strings to the TinyMCE editor */
add_filter(
'mce_external_languages',
function ( $languages ) {
$languages['code_snippets'] = __DIR__ . '/mce-strings.php';
return $languages;
}
);
}
/**
* Enqueue the syntax highlighting assets if they are required for the current posts
*
* @param array<WP_Post|int>|null|false $posts List of currently visible posts.
*
* @return array<WP_Post|int>|null|false Unchanged list of posts.
*/
public function enqueue_highlighting( $posts ) {
// Exit early if there are no posts to check or if the highlighter has been disabled.
if ( empty( $posts ) || Settings\get_setting( 'general', 'disable_prism' ) ) {
return $posts;
}
// Loop through the posts, checking for an existing shortcode, short-circuiting if possible.
$found_shortcode_content = null;
foreach ( $posts as $post ) {
if ( false !== stripos( $post->post_content, '[' . self::SOURCE_SHORTCODE ) ||
false !== strpos( $post->post_content, '<!-- wp:code-snippets/source ' ) ) {
$found_shortcode_content = $post->post_content;
break;
}
}
// Load assets on the appropriate hook if a matching shortcode was found.
if ( null !== $found_shortcode_content ) {
$this->register_prism_assets();
add_action(
'wp_enqueue_scripts',
function () {
wp_enqueue_style( self::PRISM_HANDLE );
wp_enqueue_script( self::PRISM_HANDLE );
},
100
);
}
return $posts;
}
/**
* Enqueue the styles and scripts for the Prism syntax highlighter.
*
* @return void
*/
public static function register_prism_assets() {
$plugin = code_snippets();
wp_register_style(
self::PRISM_HANDLE,
plugins_url( 'dist/prism.css', $plugin->file ),
array(),
$plugin->version
);
wp_register_script(
self::PRISM_HANDLE,
plugins_url( 'dist/prism.js', $plugin->file ),
array(),
$plugin->version,
true
);
}
/**
* Enqueue all available Prism themes.
*
* @return void
*/
public static function enqueue_all_prism_themes() {
self::register_prism_assets();
wp_enqueue_style( self::PRISM_HANDLE );
wp_enqueue_script( self::PRISM_HANDLE );
}
/**
* Print a message to the user if the snippet ID attribute is invalid.
*
* @param integer $id Snippet ID.
*
* @return string Warning message.
*/
protected function invalid_id_warning( int $id ): string {
// translators: %d: snippet ID.
$text = esc_html__( 'Could not load snippet with an invalid ID: %d.', 'code-snippets' );
return current_user_can( 'edit_posts' ) ? sprintf( $text, $id ) : '';
}
/**
* Allow boolean attributes to be provided without a value, similar to how React works.
*
* @param array<string|number, mixed> $atts Unfiltered shortcode attributes.
* @param array<string> $boolean_flags List of attribute names with boolean values.
*
* @return array<string|number, mixed> Shortcode attributes with flags converted to attributes.
*/
protected function convert_boolean_attribute_flags( array $atts, array $boolean_flags ): array {
foreach ( $atts as $key => $value ) {
if ( in_array( $value, $boolean_flags, true ) && ! isset( $atts[ $value ] ) ) {
$atts[ $value ] = true;
unset( $atts[ $key ] );
}
}
return $atts;
}
/**
* Evaluate the code from a content shortcode.
*
* @param Snippet $snippet Snippet.
* @param array<string, mixed> $atts Shortcode attributes.
*
* @return string Evaluated shortcode content.
*/
protected function evaluate_shortcode_content( Snippet $snippet, array $atts ): string {
if ( empty( $atts['php'] ) ) {
return $snippet->code;
}
/**
* Avoiding extract is typically recommended, however in this situation we want to make it easy for snippet
* authors to use custom attributes.
*
* @phpcs:disable WordPress.PHP.DontExtract.extract_extract
*/
extract( $atts );
ob_start();
eval( "?>\n\n" . $snippet->code . "\n\n<?php" );
return ob_get_clean();
}
/**
* Render the value of a content shortcode
*
* @param array<string, mixed> $atts Shortcode attributes.
*
* @return string Shortcode content.
*/
public function render_content_shortcode( array $atts ): string {
$atts = $this->convert_boolean_attribute_flags( $atts, [ 'network', 'php', 'format', 'shortcodes', 'debug' ] );
$original_atts = $atts;
$atts = shortcode_atts(
[
'id' => 0,
'snippet_id' => 0,
'network' => false,
'php' => false,
'format' => false,
'shortcodes' => false,
'debug' => false,
],
$atts,
self::CONTENT_SHORTCODE
);
$id = 0 !== intval( $atts['snippet_id'] ) ? intval( $atts['snippet_id'] ) : intval( $atts['id'] );
if ( ! $id ) {
return $this->invalid_id_warning( $id );
}
$snippet = get_snippet( $id, (bool) $atts['network'] );
// Render the source code if this is not a shortcode snippet.
if ( 'content' !== $snippet->scope ) {
return $snippet->id ? $this->render_snippet_source( $snippet ) : $this->invalid_id_warning( $snippet->id );
}
// If the snippet is inactive, either display a message or render nothing.
if ( ! $snippet->active ) {
if ( ! $atts['debug'] ) {
return '';
}
/* translators: 1: snippet name, 2: snippet edit link */
$text = __( '<strong>%1$s</strong> is currently inactive. You can <a href="%2$s">edit this snippet</a> to activate it and make it visible. This message will not appear in the published post.', 'code-snippets' );
$edit_url = add_query_arg( 'id', $snippet->id, code_snippets()->get_menu_url( 'edit' ) );
return wp_kses(
sprintf( $text, $snippet->name, $edit_url ),
[
'strong' => [],
'a' => [
'href' => [],
],
]
);
}
$content = $this->evaluate_shortcode_content( $snippet, $original_atts );
if ( $atts['format'] ) {
$functions = [ 'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop', 'capital_P_dangit' ];
foreach ( $functions as $function ) {
$content = call_user_func( $function, $content );
}
}
if ( $atts['shortcodes'] ) {
// Temporarily remove this shortcode from the list to prevent recursion while executing do_shortcode.
remove_shortcode( self::CONTENT_SHORTCODE );
$content = do_shortcode( $atts['format'] ? shortcode_unautop( $content ) : $content );
add_shortcode( self::CONTENT_SHORTCODE, [ $this, 'render_content_shortcode' ] );
}
return apply_filters( 'code_snippets/content_shortcode', $content, $snippet, $atts, $original_atts );
}
/**
* Converts a value and key into an HTML attribute pair.
*
* @param string $value Attribute value.
* @param string $key Attribute name.
*
* @return void
*/
private static function create_attribute_pair( string &$value, string $key ) {
$value = sprintf( '%s="%s"', sanitize_key( $key ), esc_attr( $value ) );
}
/**
* Render the source code of a given snippet
*
* @param Snippet $snippet Snippet object.
* @param array<string, mixed> $atts Shortcode attributes.
*
* @return string Shortcode content.
*/
private function render_snippet_source( Snippet $snippet, array $atts = [] ): string {
$atts = array_merge(
array(
'line_numbers' => false,
'highlight_lines' => '',
),
$atts
);
$language = 'css' === $snippet->type ? 'css' : ( 'js' === $snippet->type ? 'js' : 'php' );
$pre_attributes = array(
'id' => "code-snippet-source-$snippet->id",
'class' => 'code-snippet-source',
);
$code_attributes = array(
'class' => "language-$language",
);
if ( $atts['line_numbers'] ) {
$code_attributes['class'] .= ' line-numbers';
$pre_attributes['class'] .= ' linkable-line-numbers';
}
if ( $atts['highlight_lines'] ) {
$pre_attributes['data-line'] = $atts['highlight_lines'];
}
$pre_attributes = apply_filters( 'code_snippets/prism_pre_attributes', $pre_attributes, $snippet, $atts );
$code_attributes = apply_filters( 'code_snippets/prism_code_attributes', $code_attributes, $snippet, $atts );
array_walk( $code_attributes, array( $this, 'create_attribute_pair' ) );
array_walk( $pre_attributes, array( $this, 'create_attribute_pair' ) );
$code = 'php' === $snippet->type ? "<?php\n\n$snippet->code" : $snippet->code;
$output = sprintf(
'<pre %s><code %s>%s</code></pre>',
implode( ' ', $pre_attributes ),
implode( ' ', $code_attributes ),
esc_html( $code )
);
return apply_filters( 'code_snippets/render_source_shortcode', $output, $snippet, $atts );
}
/**
* Render the value of a source shortcode
*
* @param array<string, mixed> $atts Shortcode attributes.
*
* @return string Shortcode content.
*/
public function render_source_shortcode( array $atts ): string {
$atts = $this->convert_boolean_attribute_flags( $atts, [ 'network', 'line_numbers' ] );
$atts = shortcode_atts(
array(
'id' => 0,
'snippet_id' => 0,
'network' => false,
'line_numbers' => false,
'highlight_lines' => '',
),
$atts,
self::SOURCE_SHORTCODE
);
$id = 0 !== intval( $atts['snippet_id'] ) ? intval( $atts['snippet_id'] ) : intval( $atts['id'] );
if ( ! $id ) {
return $this->invalid_id_warning( $id );
}
$snippet = get_snippet( $id, (bool) $atts['network'] );
return $this->render_snippet_source( $snippet, $atts );
}
}
php/front-end/mce-strings.php 0000644 00000003326 15153464550 0012207 0 ustar 00 <?php
/**
* For some reason, WordPress requires that TinyMCE translations be hosted in an external file. So that's what this is.
*
* @package Code_Snippets
*/
namespace Code_Snippets;
use _WP_Editors;
/**
* Variable types.
*
* @var array<string, string|array<string, Snippet[]>> $strings
*/
$strings = [
'insert_content_menu' => __( 'Content Snippet', 'code-snippets' ),
'insert_content_title' => __( 'Insert Content Snippet', 'code-snippets' ),
'snippet_label' => __( 'Snippet', 'code-snippets' ),
'php_att_label' => __( 'Run PHP code', 'code-snippets' ),
'format_att_label' => __( 'Apply formatting', 'code-snippets' ),
'shortcodes_att_label' => __( 'Enable shortcodes', 'code-snippets' ),
'insert_source_menu' => __( 'Snippet Source Code', 'code-snippets' ),
'insert_source_title' => __( 'Insert Snippet Source', 'code-snippets' ),
'show_line_numbers_label' => __( 'Show line numbers', 'code-snippets' ),
];
$strings = array_map( 'esc_js', $strings );
$snippets = get_snippets();
$strings['all_snippets'] = [];
$strings['content_snippets'] = [];
foreach ( $snippets as $snippet ) {
if ( 'content' === $snippet->scope ) {
$strings['content_snippets'][ $snippet->id ] = $snippet->display_name;
}
$strings['all_snippets'][ $snippet->id ] = sprintf(
'%s (%s)',
$snippet->display_name,
strtoupper( $snippet->type )
);
}
asort( $strings['all_snippets'], SORT_STRING | SORT_FLAG_CASE );
asort( $strings['content_snippets'], SORT_STRING | SORT_FLAG_CASE );
$strings = [ _WP_Editors::$mce_locale => [ 'code_snippets' => $strings ] ];
/** $strings is used by outer file. @noinspection PhpUnusedLocalVariableInspection */
$strings = 'tinyMCE.addI18n(' . wp_json_encode( $strings ) . ');';
php/load.php 0000644 00000002670 15153464550 0007000 0 ustar 00 <?php
/**
* Initialise and load the plugin under the proper namespace.
*
* @package Code_Snippets
*/
namespace Code_Snippets;
/**
* The version number for this release of the plugin.
* This will later be used for upgrades and enqueuing files.
*
* This should be set to the 'Plugin Version' value defined
* in the plugin header.
*
* @var string A PHP-standardized version number string.
*/
const PLUGIN_VERSION = CODE_SNIPPETS_VERSION;
/**
* The full path to the main file of this plugin.
*
* This can later be used with functions such as
* plugin_dir_path(), plugins_url() and plugin_basename()
* to retrieve information about plugin paths.
*
* @var string
*/
const PLUGIN_FILE = CODE_SNIPPETS_FILE;
/**
* Name of the group used for caching data.
*
* @var string
*/
const CACHE_GROUP = 'code_snippets';
/**
* Namespace used for REST API endpoints.
*
* @var string
*/
const REST_API_NAMESPACE = 'code-snippets/v';
// Load dependencies with Composer.
require_once dirname( __DIR__ ) . '/vendor/autoload.php';
/**
* Retrieve the instance of the main plugin class.
*
* @return Plugin
* @since 2.6.0
*/
function code_snippets(): Plugin {
static $plugin;
if ( is_null( $plugin ) ) {
$plugin = new Plugin( PLUGIN_VERSION, PLUGIN_FILE );
}
return $plugin;
}
code_snippets()->load_plugin();
// Execute the snippets once the plugins are loaded.
add_action( 'plugins_loaded', __NAMESPACE__ . '\execute_active_snippets', 1 );
php/rest-api/class-snippets-rest-controller.php 0000644 00000036051 15153464550 0015711 0 ustar 00 <?php
namespace Code_Snippets\REST_API;
use Code_Snippets\Export;
use Code_Snippets\Snippet;
use WP_Error;
use WP_REST_Controller;
use WP_REST_Request;
use WP_REST_Response;
use WP_REST_Server;
use function Code_Snippets\activate_snippet;
use function Code_Snippets\code_snippets;
use function Code_Snippets\deactivate_snippet;
use function Code_Snippets\delete_snippet;
use function Code_Snippets\get_snippet;
use function Code_Snippets\get_snippets;
use function Code_Snippets\save_snippet;
use const Code_Snippets\REST_API_NAMESPACE;
/**
* Allows fetching snippet data through the WordPress REST API.
*
* @since 3.4.0
* @package Code_Snippets
*/
final class Snippets_REST_Controller extends WP_REST_Controller {
/**
* Current API version.
*/
const VERSION = 1;
/**
* The base of this controller's route.
*/
const BASE_ROUTE = 'snippets';
/**
* The namespace of this controller's route.
*
* @var string
*/
protected $namespace = REST_API_NAMESPACE . self::VERSION;
/**
* The base of this controller's route.
*
* @var string
*/
protected $rest_base = self::BASE_ROUTE;
/**
* Retrieve this controller's REST API base path, including namespace.
*
* @return string
*/
public static function get_base_route(): string {
return REST_API_NAMESPACE . self::VERSION . '/' . self::BASE_ROUTE;
}
/**
* Retrieve the full base route including the REST API prefix.
*
* @return string
*/
public static function get_prefixed_base_route(): string {
return '/' . rtrim( rest_get_url_prefix(), '/\\' ) . '/' . self::get_base_route();
}
/**
* Register REST routes.
*/
public function register_routes() {
$route = '/' . $this->rest_base;
$id_route = $route . '/(?P<id>[\d]+)';
$network_args = array_intersect_key(
$this->get_endpoint_args_for_item_schema(),
[ 'network' ]
);
register_rest_route(
$this->namespace,
$route,
[
[
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'get_items' ],
'permission_callback' => [ $this, 'get_items_permissions_check' ],
'args' => $network_args,
],
[
'methods' => WP_REST_Server::CREATABLE,
'callback' => [ $this, 'create_item' ],
'permission_callback' => [ $this, 'create_item_permissions_check' ],
'args' => $this->get_endpoint_args_for_item_schema( true ),
],
'schema' => [ $this, 'get_item_schema' ],
]
);
register_rest_route(
$this->namespace,
$id_route,
[
[
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'get_item' ],
'permission_callback' => [ $this, 'get_item_permissions_check' ],
'args' => $network_args,
],
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'update_item' ],
'permission_callback' => [ $this, 'update_item_permissions_check' ],
'args' => $this->get_endpoint_args_for_item_schema( false ),
],
[
'methods' => WP_REST_Server::DELETABLE,
'callback' => [ $this, 'delete_item' ],
'permission_callback' => [ $this, 'delete_item_permissions_check' ],
'args' => $network_args,
],
'schema' => [ $this, 'get_item_schema' ],
]
);
register_rest_route(
$this->namespace,
$route . '/schema',
[
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'get_public_item_schema' ],
'permission_callback' => '__return_true',
]
);
register_rest_route(
$this->namespace,
$id_route . '/activate',
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'activate_item' ],
'permission_callback' => [ $this, 'update_item_permissions_check' ],
'schema' => [ $this, 'get_item_schema' ],
'args' => $network_args,
]
);
register_rest_route(
$this->namespace,
$id_route . '/deactivate',
[
'methods' => WP_REST_Server::EDITABLE,
'callback' => [ $this, 'deactivate_item' ],
'permission_callback' => [ $this, 'update_item_permissions_check' ],
'schema' => [ $this, 'get_item_schema' ],
'args' => $network_args,
]
);
register_rest_route(
$this->namespace,
$id_route . '/export',
[
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'export_item' ],
'permission_callback' => [ $this, 'get_item_permissions_check' ],
'schema' => [ $this, 'get_item_schema' ],
'args' => $network_args,
]
);
register_rest_route(
$this->namespace,
$id_route . '/export-code',
[
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'export_item_code' ],
'permission_callback' => [ $this, 'get_item_permissions_check' ],
'schema' => [ $this, 'get_item_schema' ],
'args' => $network_args,
]
);
}
/**
* Retrieves a collection of snippets.
*
* @param WP_REST_Request $request Full details about the request.
*
* @return WP_REST_Response Response object on success.
*/
public function get_items( $request ): WP_REST_Response {
$snippets = get_snippets();
$snippets_data = [];
foreach ( $snippets as $snippet ) {
$snippet_data = $this->prepare_item_for_response( $snippet, $request );
$snippets_data[] = $this->prepare_response_for_collection( $snippet_data );
}
return rest_ensure_response( $snippets_data );
}
/**
* Retrieves one item from the collection.
*
* @param WP_REST_Request $request Full details about the request.
*
* @return WP_REST_Response|WP_Error Response object on success.
*/
public function get_item( $request ) {
$snippet_id = $request->get_param( 'id' );
$item = get_snippet( $snippet_id, $request->get_param( 'network' ) );
if ( ! $item->id && 0 !== $snippet_id && '0' !== $snippet_id ) {
return new WP_Error(
'rest_cannot_get',
__( 'The snippet could not be found.', 'code-snippets' ),
[ 'status' => 500 ]
);
}
$data = $this->prepare_item_for_response( $item, $request );
return rest_ensure_response( $data );
}
/**
* Create one item from the collection
*
* @param WP_REST_Request|array $request Full data about the request.
*
* @return WP_REST_Response|WP_Error
*/
public function create_item( $request ) {
$snippet = $this->prepare_item_for_database( $request );
$result = $snippet ? save_snippet( $snippet ) : null;
return $result ?
$this->prepare_item_for_response( $result, $request ) :
new WP_Error(
'rest_cannot_create',
__( 'The snippet could not be created.', 'code-snippets' ),
[ 'status' => 500 ]
);
}
/**
* Update one item from the collection
*
* @param WP_REST_Request $request Full data about the request.
*
* @return WP_Error|WP_REST_Response
*/
public function update_item( $request ) {
$snippet_id = absint( $request->get_param( 'id' ) );
$snippet = $snippet_id ? get_snippet( $snippet_id, $request->get_param( 'network' ) ) : null;
if ( ! $snippet_id || ! $snippet || ! $snippet->id ) {
return new WP_Error(
'rest_cannot_update',
__( 'Cannot update a snippet without a valid ID.', 'code-snippets' ),
[ 'status' => 400 ]
);
}
$item = $this->prepare_item_for_database( $request, $snippet );
$result = save_snippet( $item );
if ( $result ) {
$request->set_param( 'id', $result->id );
return $this->get_item( $request );
}
return new WP_Error(
'rest_cannot_update',
__( 'The snippet could not be updated.', 'code-snippets' ),
[ 'status' => 500 ]
);
}
/**
* Delete one item from the collection
*
* @param WP_REST_Request $request Full data about the request.
*
* @return WP_Error|WP_REST_Response
*/
public function delete_item( $request ) {
$item = $this->prepare_item_for_database( $request );
$result = delete_snippet( $item->id, $item->network );
return $result ?
new WP_REST_Response( null, 204 ) :
new WP_Error(
'rest_cannot_delete',
__( 'The snippet could not be deleted.', 'code-snippets' ),
[ 'status' => 500 ]
);
}
/**
* Activate one item in the collection.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return WP_Error|WP_REST_Response
*/
public function activate_item( WP_REST_Request $request ) {
$item = $this->prepare_item_for_database( $request );
$result = activate_snippet( $item->id, $item->network );
return $result instanceof Snippet ?
rest_ensure_response( $result ) :
new WP_Error(
'rest_cannot_activate',
$result,
[ 'status' => 500 ]
);
}
/**
* Deactivate one item in the collection.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return WP_Error|WP_REST_Response
*/
public function deactivate_item( WP_REST_Request $request ) {
$item = $this->prepare_item_for_database( $request );
$result = deactivate_snippet( $item->id, $item->network );
return $result instanceof Snippet ?
rest_ensure_response( $result ) :
new WP_Error(
'rest_cannot_activate',
__( 'The snippet could not be deactivated.', 'code-snippets' ),
[ 'status' => 500 ]
);
}
/**
* Prepare an instance of the Export class from a request.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return Export
*/
protected function build_export( WP_REST_Request $request ): Export {
$item = $this->prepare_item_for_database( $request );
return new Export( [ $item->id ], $item->network );
}
/**
* Retrieve one item in the collection in JSON export format.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return WP_Error|WP_REST_Response
*/
public function export_item( WP_REST_Request $request ) {
$export = $this->build_export( $request );
$result = $export->create_export_object();
return rest_ensure_response( $result );
}
/**
* Retrieve one item in the collection in the code export format.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return WP_Error|WP_REST_Response
*/
public function export_item_code( WP_REST_Request $request ) {
$export = $this->build_export( $request );
$result = $export->export_snippets_code();
return rest_ensure_response( $result );
}
/**
* Prepares one item for create or update operation.
*
* @param WP_REST_Request $request Request object.
* @param Snippet|null $item Existing item to augment.
*
* @return Snippet The prepared item.
*/
protected function prepare_item_for_database( $request, ?Snippet $item = null ): ?Snippet {
if ( ! $item instanceof Snippet ) {
$item = new Snippet();
}
foreach ( $item->get_allowed_fields() as $field ) {
if ( isset( $request[ $field ] ) ) {
$item->set_field( $field, $request[ $field ] );
}
}
return $item;
}
/**
* Prepare the item for the REST response.
*
* @param Snippet $item Snippet object.
* @param WP_REST_Request $request Request object.
*
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function prepare_item_for_response( $item, $request ) {
$schema = $this->get_item_schema();
$response = [];
foreach ( array_keys( $schema['properties'] ) as $property ) {
$response[ $property ] = $item->$property;
}
return rest_ensure_response( $response );
}
/**
* Check if a given request has access to get items.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return boolean
*/
public function get_items_permissions_check( $request ): bool {
return code_snippets()->current_user_can();
}
/**
* Check if a given request has access to get a specific item.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return boolean
*/
public function get_item_permissions_check( $request ): bool {
return $this->get_items_permissions_check( $request );
}
/**
* Check if a given request has access to create items.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return boolean
*/
public function create_item_permissions_check( $request ): bool {
return code_snippets()->current_user_can();
}
/**
* Check if a given request has access to update a specific item.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return boolean
*/
public function update_item_permissions_check( $request ): bool {
return $this->create_item_permissions_check( $request );
}
/**
* Check if a given request has access to delete a specific item.
*
* @param WP_REST_Request $request Full data about the request.
*
* @return boolean
*/
public function delete_item_permissions_check( $request ): bool {
return $this->create_item_permissions_check( $request );
}
/**
* Get our sample schema for a post.
*
* @return array<string, mixed> The sample schema for a post
*/
public function get_item_schema(): array {
if ( $this->schema ) {
return $this->schema;
}
$this->schema = [
'$schema' => 'http://json-schema.org/draft-04/schema#',
'title' => 'snippet',
'type' => 'object',
'properties' => [
'id' => [
'description' => esc_html__( 'Unique identifier for the snippet.', 'code-snippets' ),
'type' => 'integer',
'readonly' => true,
],
'name' => [
'description' => esc_html__( 'Descriptive title for the snippet.', 'code-snippets' ),
'type' => 'string',
],
'desc' => [
'description' => esc_html__( 'Descriptive text associated with snippet.', 'code-snippets' ),
'type' => 'string',
],
'code' => [
'description' => esc_html__( 'Executable snippet code.', 'code-snippets' ),
'type' => 'string',
],
'tags' => [
'description' => esc_html__( 'List of tag categories the snippet belongs to.', 'code-snippets' ),
'type' => 'array',
],
'scope' => [
'description' => esc_html__( 'Context in which the snippet is executable.', 'code-snippets' ),
'type' => 'string',
],
'active' => [
'description' => esc_html__( 'Snippet activation status.', 'code-snippets' ),
'type' => 'boolean',
],
'priority' => [
'description' => esc_html__( 'Relative priority in which the snippet is executed.', 'code-snippets' ),
'type' => 'integer',
],
'network' => [
'description' => esc_html__( 'Whether the snippet is network-wide instead of site-wide.', 'code-snippets' ),
'type' => 'boolean',
'default' => null,
],
'shared_network' => [
'description' => esc_html__( 'If a network snippet, whether can be activated on discrete sites instead of network-wide.', 'code-snippets' ),
'type' => 'boolean',
],
'modified' => [
'description' => esc_html__( 'Date and time when the snippet was last modified, in ISO format.', 'code-snippets' ),
'type' => 'string',
],
],
];
return $this->schema;
}
}
php/settings/class-setting-field.php 0000644 00000014635 15153464550 0013566 0 ustar 00 <?php
/**
* This file handles rendering the settings fields
*
* @since 2.0.0
* @package Code_Snippets
* @subpackage Settings
*/
namespace Code_Snippets\Settings;
/**
* Represents a single setting field
*
* @property-read string $desc Field description.
* @property-read string $label Field label.
* @property-read string $type Field type.
* @property-read string $name Setting name.
*
* @property-read int $min Minimum value (for numerical inputs).
* @property-read int $max Maximum value(for numerical inputs).
* @property-read array<string, string> $options List of options for a select or checkboxes field.
* @property-read callable $render_callback Custom function to use when rendering a callback field.
* @property-read callable $sanitize_callback Custom function to use when sanitize the setting value.
* @property-read mixed $default Default setting value.
*
* @property-read string $input_name Value of `name` HTML attribute on an input element.
* @property-read string $element_id
*/
class Setting_Field {
/**
* Input field identifier.
*
* @var string
*/
private string $field_id;
/**
* Settings section identifier.
*
* @var string
*/
private string $section;
/**
* List of possible arguments.
*
* @var array<string, mixed>
*/
private array $args = array(
'desc' => '',
'label' => '',
'min' => null,
'max' => null,
'options' => [],
);
/**
* Class constructor.
*
* @param string $section_id Settings section identifier.
* @param string $field_id Setting field identifier.
* @param array<string, mixed> $args The setting field attributes.
*/
public function __construct( string $section_id, string $field_id, array $args ) {
$this->field_id = $field_id;
$this->section = $section_id;
$this->args = array_merge( $this->args, $args );
}
/**
* Retrieve a single setting attribute.
*
* @param string $argument Attribute name.
*
* @return mixed Attribute value.
*/
public function __get( string $argument ) {
if ( 'input_name' === $argument ) {
return sprintf( '%s[%s][%s]', OPTION_NAME, $this->section, $this->field_id );
}
return $this->args[ $argument ];
}
/**
* Retrieve the saved value for this setting.
*
* @return mixed
*/
private function get_saved_value() {
return get_setting( $this->section, $this->field_id );
}
/**
* Render the setting field
*/
public function render() {
$method_name = 'render_' . $this->type . '_field';
if ( method_exists( $this, $method_name ) ) {
call_user_func( array( $this, $method_name ) );
} else {
// Error message, not necessary to translate.
printf( 'Cannot render a %s field.', esc_html( $this->type ) );
return;
}
if ( $this->desc ) {
echo '<p class="description">', wp_kses_post( $this->desc ), '</p>';
}
}
/**
* Render a callback field.
*/
public function render_callback_field() {
call_user_func( $this->render_callback );
}
/**
* Render a single checkbox field.
*
* @param string $input_name Input name.
* @param string $label Input label.
* @param boolean $checked Whether the checkbox should be checked.
*/
private static function render_checkbox( string $input_name, string $label, bool $checked ) {
$checkbox = sprintf(
'<input type="checkbox" name="%s"%s>',
esc_attr( $input_name ),
checked( $checked, true, false )
);
$kses = [
'input' => [
'type' => [],
'name' => [],
'checked' => [],
],
];
if ( $label ) {
printf(
'<label>%s %s</label>',
wp_kses( $checkbox, $kses ),
wp_kses_post( $label )
);
} else {
echo wp_kses( $checkbox, $kses );
}
}
/**
* Render a checkbox field for a setting
*
* @return void
* @since 2.0.0
*/
public function render_checkbox_field() {
$this->render_checkbox( $this->input_name, $this->label, $this->get_saved_value() ?? false );
}
/**
* Render a checkbox field for a setting
*
* @return void
* @since 2.0.0
*/
public function render_checkboxes_field() {
$saved_value = $this->get_saved_value();
$saved_value = is_array( $saved_value ) ? $saved_value : [];
echo '<fieldset>';
printf( '<legend class="screen-reader-text"><span>%s</span></legend>', esc_html( $this->name ) );
foreach ( $this->options as $option => $label ) {
$this->render_checkbox( $this->input_name . "[$option]", $label, in_array( $option, $saved_value, true ) );
echo '<br>';
}
echo '</fieldset>';
}
/**
* Render a basic text field for an editor setting.
*
* @return void
*/
private function render_text_field() {
printf(
'<input id="%s" type="text" name="%s" value="%s" class="regular-text %s">',
esc_attr( $this->element_id ),
esc_attr( $this->input_name ),
esc_attr( $this->get_saved_value() ),
esc_attr( $this->element_id )
);
if ( $this->label ) {
echo ' ' . wp_kses_post( $this->label );
}
}
/**
* Render a number select field for an editor setting
*
* @since 2.0.0
*/
private function render_number_field() {
printf(
'<input type="number" name="%s" value="%s"',
esc_attr( $this->input_name ),
esc_attr( $this->get_saved_value() )
);
if ( is_numeric( $this->min ) ) {
printf( ' min="%d"', intval( $this->min ) );
}
if ( is_numeric( $this->max ) ) {
printf( ' max="%d"', intval( $this->max ) );
}
echo '>';
if ( $this->label ) {
echo ' ' . wp_kses_post( $this->label );
}
}
/**
* Render a number select field for an editor setting.
*
* @since 3.0.0
*/
private function render_select_field() {
$saved_value = $this->get_saved_value();
printf( '<select name="%s">', esc_attr( $this->input_name ) );
foreach ( $this->options as $option => $option_label ) {
printf(
'<option value="%s"%s>%s</option>',
esc_attr( $option ),
selected( $option, $saved_value, false ),
esc_html( $option_label )
);
}
echo '</select>';
}
/**
* Render a button link.
*
* @since 3.5.1
*/
private function render_action_field() {
printf(
'<button type="submit" name="%s" class="button">%s</button>',
esc_attr( $this->input_name ),
esc_html( $this->label ? $this->label : $this->name )
);
}
}
php/settings/editor-preview.php 0000644 00000005620 15153464550 0012664 0 ustar 00 <?php
/**
* This file handles the editor preview setting
*
* @since 2.0.0
* @package Code_Snippets
*/
namespace Code_Snippets\Settings;
use function Code_Snippets\code_snippets;
use function Code_Snippets\enqueue_code_editor;
use function Code_Snippets\get_editor_themes;
/**
* Load the CSS and JavaScript for the editor preview field
*/
function enqueue_editor_preview_assets() {
$plugin = code_snippets();
enqueue_code_editor( 'php' );
// Enqueue all editor themes.
$themes = get_editor_themes();
foreach ( $themes as $theme ) {
wp_enqueue_style(
'code-snippets-editor-theme-' . $theme,
plugins_url( "dist/editor-themes/$theme.css", $plugin->file ),
[ 'code-editor' ],
$plugin->version
);
}
// Enqueue the menu scripts.
wp_enqueue_script(
'code-snippets-settings-menu',
plugins_url( 'dist/settings.js', $plugin->file ),
[ 'code-snippets-code-editor' ],
$plugin->version,
true
);
wp_set_script_translations( 'code-snippets-settings-menu', 'code-snippets' );
// Extract the CodeMirror-specific editor settings.
$setting_fields = get_settings_fields();
$editor_fields = array();
foreach ( $setting_fields['editor'] as $name => $field ) {
if ( empty( $field['codemirror'] ) ) {
continue;
}
$editor_fields[] = array(
'name' => $name,
'type' => $field['type'],
'codemirror' => addslashes( $field['codemirror'] ),
);
}
// Pass the saved options to the external JavaScript file.
$inline_script = 'var code_snippets_editor_settings = ' . wp_json_encode( $editor_fields ) . ';';
wp_add_inline_script( 'code-snippets-settings-menu', $inline_script, 'before' );
}
/**
* Retrieve the list of code editor themes.
*
* @return array<string, string> List of editor themes.
*/
function get_editor_theme_list(): array {
$themes = [
'default' => __( 'Default', 'code-snippets' ),
];
foreach ( get_editor_themes() as $theme ) {
// Skip mobile themes.
if ( '-mobile' === substr( $theme, -7 ) ) {
continue;
}
$themes[ $theme ] = ucwords( str_replace( '-', ' ', $theme ) );
}
return $themes;
}
/**
* Render the editor preview setting
*/
function render_editor_preview() {
$settings = get_settings_values();
$settings = $settings['editor'];
$indent_unit = absint( $settings['indent_unit'] );
$tab_size = absint( $settings['tab_size'] );
$n_tabs = $settings['indent_with_tabs'] ? floor( $indent_unit / $tab_size ) : 0;
$n_spaces = $settings['indent_with_tabs'] ? $indent_unit % $tab_size : $indent_unit;
$indent = str_repeat( "\t", $n_tabs ) . str_repeat( ' ', $n_spaces );
$code = "add_filter( 'admin_footer_text', function ( \$text ) {\n\n" .
$indent . "\$site_name = get_bloginfo( 'name' );\n\n" .
$indent . '$text = "Thank you for visiting $site_name.";' . "\n" .
$indent . 'return $text;' . "\n" .
"} );\n";
echo '<textarea id="code_snippets_editor_preview">', esc_textarea( $code ), '</textarea>';
}
php/settings/settings-fields.php 0000644 00000017074 15153464550 0013031 0 ustar 00 <?php
/**
* Manages the settings field definitions.
*
* @package Code_Snippets
* @subpackage Settings
*/
namespace Code_Snippets\Settings;
use function Code_Snippets\code_snippets;
/**
* Retrieve the default setting values
*
* @return array<string, array<string, mixed>>
*/
function get_default_settings(): array {
static $defaults;
if ( isset( $defaults ) ) {
return $defaults;
}
$defaults = [
'general' => [
'activate_by_default' => true,
'enable_tags' => true,
'enable_description' => true,
'visual_editor_rows' => 5,
'list_order' => 'priority-asc',
'disable_prism' => false,
'hide_upgrade_menu' => false,
'complete_uninstall' => false,
],
'editor' => [
'indent_with_tabs' => true,
'tab_size' => 4,
'indent_unit' => 4,
'wrap_lines' => true,
'code_folding' => true,
'line_numbers' => true,
'auto_close_brackets' => true,
'highlight_selection_matches' => true,
'highlight_active_line' => true,
'keymap' => 'default',
'theme' => 'default',
],
];
$defaults = apply_filters( 'code_snippets_settings_defaults', $defaults );
return $defaults;
}
/**
* Retrieve the settings fields
*
* @return array<string, array<string, array>>
*/
function get_settings_fields(): array {
static $fields;
if ( isset( $fields ) ) {
return $fields;
}
$fields = [];
$fields['debug'] = [
'database_update' => [
'name' => __( 'Database Table Upgrade', 'code-snippets' ),
'type' => 'action',
'label' => __( 'Upgrade Database Table', 'code-snippets' ),
'desc' => __( 'Use this button to manually upgrade the Code Snippets database table. This action will only affect the snippets table and should be used only when necessary.', 'code-snippets' ),
],
'reset_caches' => [
'name' => __( 'Reset Caches', 'code-snippets' ),
'type' => 'action',
'desc' => __( 'Use this button to manually clear snippets caches.', 'code-snippets' ),
],
];
$fields['general'] = [
'activate_by_default' => [
'name' => __( 'Activate by Default', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( "Make the 'Save and Activate' button the default action when saving a snippet.", 'code-snippets' ),
],
'enable_tags' => [
'name' => __( 'Enable Snippet Tags', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Show snippet tags on admin pages.', 'code-snippets' ),
],
'enable_description' => [
'name' => __( 'Enable Snippet Descriptions', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Show snippet descriptions on admin pages.', 'code-snippets' ),
],
'visual_editor_rows' => [
'name' => __( 'Description Editor Height', 'code-snippets' ),
'type' => 'number',
'label' => _x( 'rows', 'unit', 'code-snippets' ),
'min' => 0,
],
'list_order' => [
'name' => __( 'Snippets List Order', 'code-snippets' ),
'type' => 'select',
'desc' => __( 'Default way to order snippets on the All Snippets admin menu.', 'code-snippets' ),
'options' => [
'priority-asc' => __( 'Priority', 'code-snippets' ),
'name-asc' => __( 'Name (A-Z)', 'code-snippets' ),
'name-desc' => __( 'Name (Z-A)', 'code-snippets' ),
'modified-desc' => __( 'Modified (latest first)', 'code-snippets' ),
'modified-asc' => __( 'Modified (oldest first)', 'code-snippets' ),
],
],
'disable_prism' => [
'name' => __( 'Disable Syntax Highlighter', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Disable syntax highlighting when displaying snippet code on the front-end.', 'code-snippets' ),
],
];
if ( ! code_snippets()->licensing->is_licensed() ) {
$fields['general']['hide_upgrade_menu'] = [
'name' => __( 'Hide Upgrade Menu', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Hide the Upgrade button from the admin menu.', 'code-snippets' ),
];
}
if ( ! is_multisite() || is_main_site() ) {
$fields['general']['complete_uninstall'] = [
'name' => __( 'Complete Uninstall', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'When the plugin is deleted from the Plugins menu, also delete all snippets and plugin settings.', 'code-snippets' ),
];
}
$fields['editor'] = [
'indent_with_tabs' => [
'name' => __( 'Indent With Tabs', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Use hard tabs instead of spaces for indentation.', 'code-snippets' ),
'codemirror' => 'indentWithTabs',
],
'tab_size' => [
'name' => __( 'Tab Size', 'code-snippets' ),
'type' => 'number',
'desc' => __( 'The width of a tab character.', 'code-snippets' ),
'label' => _x( 'spaces', 'unit', 'code-snippets' ),
'codemirror' => 'tabSize',
'min' => 0,
],
'indent_unit' => [
'name' => __( 'Indent Unit', 'code-snippets' ),
'type' => 'number',
'desc' => __( 'The number of spaces to indent a block.', 'code-snippets' ),
'label' => _x( 'spaces', 'unit', 'code-snippets' ),
'codemirror' => 'indentUnit',
'min' => 0,
],
'wrap_lines' => [
'name' => __( 'Wrap Lines', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Soft-wrap long lines of code instead of horizontally scrolling.', 'code-snippets' ),
'codemirror' => 'lineWrapping',
],
'code_folding' => [
'name' => __( 'Code Folding', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Allow folding functions or other blocks into a single line.', 'code-snippets' ),
'codemirror' => 'foldGutter',
],
'line_numbers' => [
'name' => __( 'Line Numbers', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Show line numbers to the left of the editor.', 'code-snippets' ),
'codemirror' => 'lineNumbers',
],
'auto_close_brackets' => [
'name' => __( 'Auto Close Brackets', 'code-snippets' ),
'type' => 'checkbox',
'label' => __( 'Auto-close brackets and quotes when typed.', 'code-snippets' ),
'codemirror' => 'autoCloseBrackets',
],
'highlight_selection_matches' => [
'name' => __( 'Highlight Selection Matches', 'code-snippets' ),
'label' => __( 'Highlight all instances of a currently selected word.', 'code-snippets' ),
'type' => 'checkbox',
'codemirror' => 'highlightSelectionMatches',
],
'highlight_active_line' => [
'name' => __( 'Highlight Active Line', 'code-snippets' ),
'label' => __( 'Highlight the line that is currently being edited.', 'code-snippets' ),
'type' => 'checkbox',
'codemirror' => 'styleActiveLine',
],
'keymap' => [
'name' => __( 'Keymap', 'code-snippets' ),
'type' => 'select',
'desc' => __( 'The set of keyboard shortcuts to use in the code editor.', 'code-snippets' ),
'options' => [
'default' => __( 'Default', 'code-snippets' ),
'vim' => __( 'Vim', 'code-snippets' ),
'emacs' => __( 'Emacs', 'code-snippets' ),
'sublime' => __( 'Sublime Text', 'code-snippets' ),
],
'codemirror' => 'keyMap',
],
'theme' => [
'name' => __( 'Theme', 'code-snippets' ),
'type' => 'select',
'options' => get_editor_theme_list(),
'codemirror' => 'theme',
],
];
$fields = apply_filters( 'code_snippets_settings_fields', $fields );
return $fields;
}
php/settings/settings.php 0000644 00000022633 15153464550 0011562 0 ustar 00 <?php
/**
* This file registers the settings
*
* @package Code_Snippets
* @subpackage Settings
*/
namespace Code_Snippets\Settings;
use Code_Snippets\Welcome_API;
use function Code_Snippets\clean_snippets_cache;
use function Code_Snippets\code_snippets;
const CACHE_KEY = 'code_snippets_settings';
const OPTION_GROUP = 'code-snippets';
const OPTION_NAME = 'code_snippets_settings';
/**
* Add a new option for either the current site or the current network
*
* @param bool $network Whether to add a network-wide option.
* @param string $option Name of option to add. Expected to not be SQL-escaped.
* @param mixed $value Option value, can be anything. Expected to not be SQL-escaped.
*
* @return bool False if the option was not added. True if the option was added.
*/
function add_self_option( bool $network, string $option, $value ): bool {
return $network ? add_site_option( $option, $value ) : add_option( $option, $value );
}
/**
* Retrieves an option value based on an option name from either the current site or the current network
*
* @param bool $network Whether to get a network-wide option.
* @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
* @param mixed $default_value Optional value to return if option doesn't exist. Default false.
*
* @return mixed Value set for the option.
*/
function get_self_option( bool $network, string $option, $default_value = false ) {
return $network ? get_site_option( $option, $default_value ) : get_option( $option, $default_value );
}
/**
* Update the value of an option that was already added on the current site or the current network
*
* @param bool $network Whether to update a network-wide option.
* @param string $option Name of option. Expected to not be SQL-escaped.
* @param mixed $value Option value. Expected to not be SQL-escaped.
*
* @return bool False if value was not updated. True if value was updated.
*/
function update_self_option( bool $network, string $option, $value ): bool {
return $network ? update_site_option( $option, $value ) : update_option( $option, $value );
}
/**
* Returns 'true' if plugin settings are unified on a multisite installation
* under the Network Admin settings menu
*
* This option is controlled by the "Enable administration menus" setting on the Network Settings menu
*
* @return bool
*/
function are_settings_unified(): bool {
if ( ! is_multisite() ) {
return false;
}
$menu_perms = get_site_option( 'menu_items', array() );
return empty( $menu_perms['snippets_settings'] );
}
/**
* Retrieve the setting values from the database.
* If a setting does not exist in the database, the default value will be returned.
*
* @return array<string, array<string, mixed>>
*/
function get_settings_values(): array {
$settings = wp_cache_get( CACHE_KEY );
if ( $settings ) {
return $settings;
}
$settings = get_default_settings();
$saved = get_self_option( are_settings_unified(), OPTION_NAME, array() );
foreach ( $settings as $section => $fields ) {
if ( isset( $saved[ $section ] ) ) {
$settings[ $section ] = array_replace( $fields, $saved[ $section ] );
}
}
wp_cache_set( CACHE_KEY, $settings );
return $settings;
}
/**
* Retrieve an individual setting field value
*
* @param string $section ID of the section the setting belongs to.
* @param string $field ID of the setting field.
*
* @return mixed
*/
function get_setting( string $section, string $field ) {
$settings = get_settings_values();
return $settings[ $section ][ $field ] ?? null;
}
/**
* Update a single setting to a new value.
*
* @param string $section ID of the section the setting belongs to.
* @param string $field ID of the setting field.
* @param mixed $new_value Setting value. Expected to not be SQL-escaped.
*
* @return bool False if value was not updated. True if value was updated.
*/
function update_setting( string $section, string $field, $new_value ): bool {
$settings = get_settings_values();
$settings[ $section ][ $field ] = $new_value;
wp_cache_set( CACHE_KEY, $settings );
return update_self_option( are_settings_unified(), OPTION_NAME, $settings );
}
/**
* Retrieve the settings sections
*
* @return array<string, string> Settings sections.
*/
function get_settings_sections(): array {
$sections = array(
'general' => __( 'General', 'code-snippets' ),
'editor' => __( 'Code Editor', 'code-snippets' ),
'debug' => __( 'Debug', 'code-snippets' ),
);
return apply_filters( 'code_snippets_settings_sections', $sections );
}
/**
* Register settings sections, fields, etc
*/
function register_plugin_settings() {
if ( are_settings_unified() ) {
if ( ! get_site_option( OPTION_NAME ) ) {
add_site_option( OPTION_NAME, get_default_settings() );
}
} elseif ( ! get_option( OPTION_NAME ) ) {
add_option( OPTION_NAME, get_default_settings() );
}
// Register the setting.
register_setting(
OPTION_GROUP,
OPTION_NAME,
[ 'sanitize_callback' => __NAMESPACE__ . '\\sanitize_settings' ]
);
// Register settings sections.
foreach ( get_settings_sections() as $section_id => $section_name ) {
add_settings_section( $section_id, $section_name, '__return_empty_string', 'code-snippets' );
}
// Register settings fields.
foreach ( get_settings_fields() as $section_id => $fields ) {
foreach ( $fields as $field_id => $field ) {
$field_object = new Setting_Field( $section_id, $field_id, $field );
add_settings_field( $field_id, $field['name'], [ $field_object, 'render' ], 'code-snippets', $section_id );
}
}
// Add editor preview as a field.
add_settings_field(
'editor_preview',
__( 'Editor Preview', 'code-snippets' ),
__NAMESPACE__ . '\\render_editor_preview',
'code-snippets',
'editor'
);
}
add_action( 'admin_init', __NAMESPACE__ . '\\register_plugin_settings' );
/**
* Sanitize a single setting value.
*
* @param array<string, mixed> $field Setting field information.
* @param mixed $input_value User input setting value, or null if missing.
*
* @return mixed Sanitized setting value, or null if unset.
*/
function sanitize_setting_value( array $field, $input_value ) {
switch ( $field['type'] ) {
case 'checkbox':
return 'on' === $input_value;
case 'number':
return intval( $input_value );
case 'select':
$select_options = array_map( 'strval', array_keys( $field['options'] ) );
return in_array( strval( $input_value ), $select_options, true ) ? $input_value : null;
case 'checkboxes':
$results = [];
if ( ! empty( $input_value ) ) {
foreach ( $field['options'] as $option_id => $option_label ) {
if ( isset( $input_value[ $option_id ] ) && 'on' === $input_value[ $option_id ] ) {
$results[] = $option_id;
}
}
}
return $results;
case 'text':
case 'hidden':
return trim( sanitize_text_field( $input_value ) );
case 'callback':
return isset( $field['sanitize_callback'] ) && is_callable( $field['sanitize_callback'] ) ?
call_user_func( $field['sanitize_callback'], $input_value ) :
null;
default:
return null;
}
}
/**
* Process settings actions.
*
* @param array $input Provided settings input.
*
* @return array|null New $input value to return, or null to continue with settings update process.
*/
function process_settings_actions( array $input ): ?array {
if ( isset( $input['reset_settings'] ) ) {
add_settings_error(
OPTION_NAME,
'settings_reset',
__( 'All settings have been reset to their defaults.', 'code-snippets' ),
'updated'
);
delete_option( 'code_snippets_cloud_settings' );
return [];
}
if ( isset( $input['debug']['database_update'] ) ) {
code_snippets()->db->create_or_upgrade_tables();
add_settings_error(
OPTION_NAME,
'database_update_done',
__( 'Successfully performed database table upgrade.', 'code-snippets' ),
'updated'
);
}
if ( isset( $input['debug']['reset_caches'] ) ) {
Welcome_API::clear_cache();
clean_snippets_cache( code_snippets()->db->get_table_name( false ) );
if ( is_multisite() ) {
clean_snippets_cache( code_snippets()->db->get_table_name( true ) );
}
add_settings_error(
OPTION_NAME,
'snippet_caches_reset',
__( 'Successfully reset snippets caches.', 'code-snippets' ),
'updated'
);
}
return null;
}
/**
* Validate the settings
*
* @param array<string, array<string, mixed>> $input The received settings.
*
* @return array<string, array<string, mixed>> The validated settings.
*/
function sanitize_settings( array $input ): array {
wp_cache_delete( CACHE_KEY );
$result = process_settings_actions( $input );
if ( ! is_null( $result ) ) {
return $result;
}
$settings = get_settings_values();
$updated = false;
// Don't directly loop through $input as it does not include as deselected checkboxes.
foreach ( get_settings_fields() as $section_id => $fields ) {
foreach ( $fields as $field_id => $field ) {
// Fetch the corresponding input value from the posted data.
$input_value = $input[ $section_id ][ $field_id ] ?? null;
// Attempt to sanitize the setting value.
$sanitized_value = sanitize_setting_value( $field, $input_value );
if ( ! is_null( $sanitized_value ) && $settings[ $section_id ][ $field_id ] !== $sanitized_value ) {
$settings[ $section_id ][ $field_id ] = $sanitized_value;
$updated = true;
}
}
}
// Add an updated message.
if ( $updated ) {
add_settings_error(
OPTION_NAME,
'settings-saved',
__( 'Settings saved.', 'code-snippets' ),
'updated'
);
}
return $settings;
}
php/snippet-ops.php 0000644 00000051750 15153464550 0010345 0 ustar 00 <?php
/**
* Functions to perform snippet operations
*
* @package Code_Snippets
*/
namespace Code_Snippets;
use Code_Snippets\REST_API\Snippets_REST_Controller;
use ParseError;
use function Code_Snippets\Settings\get_self_option;
use function Code_Snippets\Settings\update_self_option;
/**
* Clean the cache where active snippets are stored.
*
* @param string $table_name Snippets table name.
* @param array<string>|false $scopes List of scopes. Optional. If not provided, will flush the cache for all scopes.
*
* @return void
*/
function clean_active_snippets_cache( string $table_name, $scopes = false ) {
$scope_groups = $scopes ? [ $scopes ] : [
[ 'head-content', 'footer-content' ],
[ 'global', 'single-use', 'front-end' ],
[ 'global', 'single-use', 'admin' ],
];
foreach ( $scope_groups as $scopes ) {
wp_cache_delete( sprintf( 'active_snippets_%s_%s', sanitize_key( join( '_', $scopes ) ), $table_name ), CACHE_GROUP );
}
}
/**
* Flush all snippets caches for a given database table.
*
* @param string $table_name Snippets table name.
*
* @return void
*/
function clean_snippets_cache( string $table_name ) {
wp_cache_delete( "all_snippet_tags_$table_name", CACHE_GROUP );
wp_cache_delete( "all_snippets_$table_name", CACHE_GROUP );
clean_active_snippets_cache( $table_name );
}
/**
* Retrieve a list of snippets from the database.
* Read operation.
*
* @param array<string> $ids The IDs of the snippets to fetch.
* @param bool|null $network Retrieve multisite-wide snippets (true) or site-wide snippets (false).
*
* @return array<Snippet> List of Snippet objects.
*
* @since 2.0
*/
function get_snippets( array $ids = array(), ?bool $network = null ): array {
global $wpdb;
// If only one ID has been passed in, defer to the get_snippet() function.
$ids_count = count( $ids );
if ( 1 === $ids_count ) {
return array( get_snippet( $ids[0], $network ) );
}
$network = DB::validate_network_param( $network );
$table_name = code_snippets()->db->get_table_name( $network );
$snippets = wp_cache_get( "all_snippets_$table_name", CACHE_GROUP );
// Fetch all snippets from the database if none are cached.
if ( ! is_array( $snippets ) ) {
$results = $wpdb->get_results( "SELECT * FROM $table_name", ARRAY_A );
$snippets = $results ?
array_map(
function ( $snippet_data ) use ( $network ) {
$snippet_data['network'] = $network;
return new Snippet( $snippet_data );
},
$results
) :
array();
$snippets = apply_filters( 'code_snippets/get_snippets', $snippets, $network );
if ( 0 === $ids_count ) {
wp_cache_set( "all_snippets_$table_name", $snippets, CACHE_GROUP );
}
}
// If a list of IDs are provided, narrow down the snippets list.
if ( $ids_count > 0 ) {
$ids = array_map( 'intval', $ids );
return array_filter(
$snippets,
function ( Snippet $snippet ) use ( $ids ) {
return in_array( $snippet->id, $ids, true );
}
);
}
return $snippets;
}
/**
* Gets all used tags from the database.
* Read operation.
*
* @since 2.0
*/
function get_all_snippet_tags() {
global $wpdb;
$table_name = code_snippets()->db->get_table_name();
$cache_key = "all_snippet_tags_$table_name";
$tags = wp_cache_get( $cache_key, CACHE_GROUP );
if ( $tags ) {
return $tags;
}
// Grab all tags from the database.
$tags = array();
$all_tags = $wpdb->get_col( "SELECT tags FROM $table_name" );
// Merge all tags into a single array.
foreach ( $all_tags as $snippet_tags ) {
$snippet_tags = code_snippets_build_tags_array( $snippet_tags );
$tags = array_merge( $snippet_tags, $tags );
}
// Remove duplicate tags.
$tags = array_values( array_unique( $tags, SORT_REGULAR ) );
wp_cache_set( $cache_key, $tags, CACHE_GROUP );
return $tags;
}
/**
* Make sure that the tags are a valid array.
*
* @param array|string $tags The tags to convert into an array.
*
* @return array<string> The converted tags.
*
* @since 2.0.0
*/
function code_snippets_build_tags_array( $tags ): array {
/* If there are no tags set, return an empty array. */
if ( empty( $tags ) ) {
return array();
}
/* If the tags are set as a string, convert them into an array. */
if ( is_string( $tags ) ) {
$tags = wp_strip_all_tags( $tags );
$tags = str_replace( ', ', ',', $tags );
$tags = explode( ',', $tags );
}
/* If we still don't have an array, just convert whatever we do have into one. */
return (array) $tags;
}
/**
* Retrieve a single snippets from the database.
* Will return empty snippet object if no snippet ID is specified.
* Read operation.
*
* @param int $id The ID of the snippet to retrieve. 0 to build a new snippet.
* @param bool|null $network Retrieve a multisite-wide snippet (true) or site-wide snippet (false).
*
* @return Snippet A single snippet object.
*
* @since 2.0.0
*/
function get_snippet( int $id = 0, ?bool $network = null ): Snippet {
global $wpdb;
$id = absint( $id );
$network = DB::validate_network_param( $network );
$table_name = code_snippets()->db->get_table_name( $network );
if ( 0 === $id ) {
// If an invalid ID is provided, then return an empty snippet object.
$snippet = new Snippet();
} else {
$cached_snippets = wp_cache_get( "all_snippets_$table_name", CACHE_GROUP );
// Attempt to fetch snippet from the cached list, if it exists.
if ( is_array( $cached_snippets ) ) {
foreach ( $cached_snippets as $snippet ) {
if ( $snippet->id === $id ) {
return apply_filters( 'code_snippets/get_snippet', $snippet, $id, $network );
}
}
}
// Otherwise, retrieve the snippet from the database.
// phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
$snippet_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE id = %d", $id ) );
$snippet = new Snippet( $snippet_data );
}
$snippet->network = $network;
return apply_filters( 'code_snippets/get_snippet', $snippet, $id, $network );
}
/**
* Ensure the list of shared network snippets is correct if one has been recently activated or deactivated.
* Write operation.
*
* @access private
*
* @param Snippet[] $snippets Snippets that was recently updated.
*
* @return boolean Whether an update was performed.
*/
function update_shared_network_snippets( array $snippets ): bool {
$shared_ids = [];
$unshared_ids = [];
if ( ! is_multisite() ) {
return false;
}
foreach ( $snippets as $snippet ) {
if ( $snippet->network ) {
if ( $snippet->shared_network ) {
$shared_ids[] = $snippet->id;
} else {
$unshared_ids[] = $snippet->id;
}
}
}
if ( ! $shared_ids && ! $unshared_ids ) {
return false;
}
$existing_shared_ids = get_site_option( 'shared_network_snippets', [] );
$updated_shared_ids = array_values( array_diff( array_merge( $existing_shared_ids, $shared_ids ), $unshared_ids ) );
if ( $existing_shared_ids === $updated_shared_ids ) {
return false;
}
update_site_option( 'shared_network_snippets', $updated_shared_ids );
// Deactivate the snippet on all sites if necessary.
if ( $unshared_ids ) {
$sites = get_sites( [ 'fields' => 'ids' ] );
foreach ( $sites as $site ) {
switch_to_blog( $site );
$active_shared_ids = get_option( 'active_shared_network_snippets' );
if ( is_array( $active_shared_ids ) ) {
$active_shared_ids = array_diff( $active_shared_ids, $unshared_ids );
update_option( 'active_shared_network_snippets', $active_shared_ids );
}
clean_active_snippets_cache( code_snippets()->db->ms_table );
}
restore_current_blog();
}
return true;
}
/**
* Activates a snippet.
* Write operation.
*
* @param int $id ID of the snippet to activate.
* @param bool|null $network Whether the snippets are multisite-wide (true) or site-wide (false).
*
* @return Snippet|string Snippet object on success, error message on failure.
* @since 2.0.0
*/
function activate_snippet( int $id, ?bool $network = null ) {
global $wpdb;
$network = DB::validate_network_param( $network );
$table_name = code_snippets()->db->get_table_name( $network );
// Retrieve the snippet code from the database for validation before activating.
$snippet = get_snippet( $id, $network );
if ( 0 === $snippet->id ) {
// translators: %d: snippet identifier.
return sprintf( __( 'Could not locate snippet with ID %d.', 'code-snippets' ), $id );
}
$validator = new Validator( $snippet->code );
if ( $validator->validate() ) {
return __( 'Could not activate snippet: code did not pass validation.', 'code-snippets' );
}
$result = $wpdb->update(
$table_name,
array( 'active' => '1' ),
array( 'id' => $id ),
array( '%d' ),
array( '%d' )
);
if ( ! $result ) {
return __( 'Could not activate snippet.', 'code-snippets' );
}
update_shared_network_snippets( [ $snippet ] );
do_action( 'code_snippets/activate_snippet', $snippet );
clean_snippets_cache( $table_name );
return $snippet;
}
/**
* Activates multiple snippets.
* Write operation.
*
* @param array<integer> $ids The IDs of the snippets to activate.
* @param bool|null $network Whether the snippets are multisite-wide (true) or site-wide (false).
*
* @return Snippet[]|null Snippets which were successfully activated, or null on failure.
*
* @since 2.0.0
*/
function activate_snippets( array $ids, ?bool $network = null ): ?array {
global $wpdb;
$network = DB::validate_network_param( $network );
$table_name = code_snippets()->db->get_table_name( $network );
$snippets = get_snippets( $ids, $network );
if ( ! $snippets ) {
return null;
}
// Loop through each snippet code and validate individually.
$valid_ids = [];
$valid_snippets = [];
foreach ( $snippets as $snippet ) {
$validator = new Validator( $snippet->code );
$code_error = $validator->validate();
if ( ! $code_error ) {
$valid_ids[] = $snippet->id;
$valid_snippets[] = $snippet;
}
}
// If there are no valid snippets, then we're done.
if ( ! $valid_ids ) {
return null;
}
// Build a SQL query containing all IDs, as wpdb::update does not support OR conditionals.
$ids_format = implode( ',', array_fill( 0, count( $valid_ids ), '%d' ) );
// phpcs:disable WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare
$rows_updated = $wpdb->query( $wpdb->prepare( "UPDATE $table_name SET active = 1 WHERE id IN ($ids_format)", $valid_ids ) );
if ( ! $rows_updated ) {
return null;
}
update_shared_network_snippets( $valid_snippets );
do_action( 'code_snippets/activate_snippets', $valid_snippets, $table_name );
clean_snippets_cache( $table_name );
return $valid_ids;
}
/**
* Deactivate a snippet.
* Write operation.
*
* @param int $id ID of the snippet to deactivate.
* @param bool|null $network Whether the snippets are multisite-wide (true) or site-wide (false).
*
* @return Snippet|null Snippet that was deactivated on success, or null on failure.
*
* @since 2.0.0
*/
function deactivate_snippet( int $id, ?bool $network = null ): ?Snippet {
global $wpdb;
$network = DB::validate_network_param( $network );
$table = code_snippets()->db->get_table_name( $network );
// Set the snippet to active.
$result = $wpdb->update(
$table,
array( 'active' => '0' ),
array( 'id' => $id ),
array( '%d' ),
array( '%d' )
);
if ( ! $result ) {
return null;
}
// Update the recently active list.
$snippet = get_snippet( $id );
$recently_active = [ $id => time() ] + get_self_option( $network, 'recently_activated_snippets', [] );
update_self_option( $network, 'recently_activated_snippets', $recently_active );
update_shared_network_snippets( [ $snippet ] );
do_action( 'code_snippets/deactivate_snippet', $id, $network );
clean_snippets_cache( $table );
return $snippet;
}
/**
* Deletes a snippet from the database.
* Write operation.
*
* @param int $id ID of the snippet to delete.
* @param bool|null $network Delete from network-wide (true) or site-wide (false) table.
*
* @return bool Whether the snippet was deleted successfully.
*
* @since 2.0.0
*/
function delete_snippet( int $id, ?bool $network = null ): bool {
global $wpdb;
$network = DB::validate_network_param( $network );
$table = code_snippets()->db->get_table_name( $network );
$result = $wpdb->delete(
$table,
array( 'id' => $id ),
array( '%d' )
);
if ( $result ) {
do_action( 'code_snippets/delete_snippet', $id, $network );
clean_snippets_cache( $table );
code_snippets()->cloud_api->delete_snippet_from_transient_data( $id );
}
return (bool) $result;
}
/**
* Test snippet code for errors, augmenting the snippet object.
*
* @param Snippet $snippet Snippet object.
*/
function test_snippet_code( Snippet $snippet ) {
$snippet->code_error = null;
if ( 'php' !== $snippet->type ) {
return;
}
$validator = new Validator( $snippet->code );
$result = $validator->validate();
if ( $result ) {
$snippet->code_error = [ $result['message'], $result['line'] ];
}
if ( ! $snippet->code_error && 'single-use' !== $snippet->scope ) {
$result = execute_snippet( $snippet->code, $snippet->id, true );
if ( $result instanceof ParseError ) {
$snippet->code_error = [
ucfirst( rtrim( $result->getMessage(), '.' ) ) . '.',
$result->getLine(),
];
}
}
}
/**
* Saves a snippet to the database.
* Write operation.
*
* @param Snippet|array<string, mixed> $snippet The snippet to add/update to the database.
*
* @return Snippet|null Updated snippet.
*
* @since 2.0.0
*/
function save_snippet( $snippet ) {
global $wpdb;
$table = code_snippets()->db->get_table_name( $snippet->network );
if ( ! $snippet instanceof Snippet ) {
$snippet = new Snippet( $snippet );
}
// Update the last modification date if necessary.
$snippet->update_modified();
$snippet->increment_revision();
if ( 'php' === $snippet->type ) {
// Remove tags from beginning and end of snippet.
$snippet->code = preg_replace( '|^\s*<\?(php)?|', '', $snippet->code );
$snippet->code = preg_replace( '|\?>\s*$|', '', $snippet->code );
// Deactivate snippet if code contains errors.
if ( $snippet->active && 'single-use' !== $snippet->scope ) {
test_snippet_code( $snippet );
if ( $snippet->code_error ) {
$snippet->active = 0;
}
}
}
// Shared network snippets are always considered inactive.
$snippet->active = $snippet->active && ! $snippet->shared_network;
// Build the list of data to insert.
$data = [
'name' => $snippet->name,
'description' => $snippet->desc,
'code' => $snippet->code,
'tags' => $snippet->tags_list,
'scope' => $snippet->scope,
'priority' => $snippet->priority,
'active' => intval( $snippet->active ),
'modified' => $snippet->modified,
'revision' => $snippet->revision,
'cloud_id' => $snippet->cloud_id ? $snippet->cloud_id : null,
];
// Create a new snippet if the ID is not set.
if ( 0 === $snippet->id ) {
$result = $wpdb->insert( $table, $data, '%s' );
if ( false === $result ) {
return null;
}
$snippet->id = $wpdb->insert_id;
do_action( 'code_snippets/create_snippet', $snippet, $table );
} else {
// Otherwise, update the snippet data.
$result = $wpdb->update( $table, $data, [ 'id' => $snippet->id ], null, [ '%d' ] );
if ( false === $result ) {
return null;
}
do_action( 'code_snippets/update_snippet', $snippet, $table );
}
update_shared_network_snippets( [ $snippet ] );
clean_snippets_cache( $table );
return $snippet;
}
/**
* Execute a snippet.
* Execute operation.
*
* Code must NOT be escaped, as it will be executed directly.
*
* @param string $code Snippet code to execute.
* @param integer $id Snippet ID.
* @param boolean $force Force snippet execution, even if save mode is active.
*
* @return ParseError|mixed Code error if encountered during execution, or result of snippet execution otherwise.
*
* @since 2.0.0
*/
function execute_snippet( string $code, int $id = 0, bool $force = false ) {
if ( empty( $code ) || ( ! $force && defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) ) {
return false;
}
ob_start();
try {
$result = eval( $code );
} catch ( ParseError $parse_error ) {
$result = $parse_error;
}
ob_end_clean();
do_action( 'code_snippets/after_execute_snippet', $code, $id, $result );
return $result;
}
/**
* Run the active snippets.
* Read-write-execute operation.
*
* @return bool true on success, false on failure.
*
* @since 2.0.0
*/
function execute_active_snippets(): bool {
global $wpdb;
// Bail early if safe mode is active.
if ( ( defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) ||
! apply_filters( 'code_snippets/execute_snippets', true ) ) {
return false;
}
$db = code_snippets()->db;
$scopes = array( 'global', 'single-use', is_admin() ? 'admin' : 'front-end' );
$data = $db->fetch_active_snippets( $scopes );
// Detect if a snippet is currently being edited, and if so, spare it from execution.
$edit_id = 0;
$edit_table = $db->table;
if ( wp_is_json_request() && ! empty( $_SERVER['REQUEST_URI'] ) ) {
$url = wp_parse_url( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
if ( isset( $url['path'] ) && false !== strpos( $url['path'], Snippets_REST_Controller::get_prefixed_base_route() ) ) {
$path_parts = explode( '/', $url['path'] );
$edit_id = intval( end( $path_parts ) );
if ( ! empty( $url['query'] ) ) {
wp_parse_str( $url['query'], $path_params );
$edit_table = isset( $path_params['network'] ) && rest_sanitize_boolean( $path_params['network'] ) ?
$db->ms_table : $db->table;
}
}
}
foreach ( $data as $table_name => $active_snippets ) {
// Loop through the returned snippets and execute the PHP code.
foreach ( $active_snippets as $snippet ) {
$snippet_id = intval( $snippet['id'] );
$code = $snippet['code'];
// If the snippet is a single-use snippet, deactivate it before execution to ensure that the process always happens.
if ( 'single-use' === $snippet['scope'] ) {
$active_shared_ids = get_option( 'active_shared_network_snippets', array() );
if ( $table_name === $db->ms_table && is_array( $active_shared_ids ) && in_array( $snippet_id, $active_shared_ids, true ) ) {
unset( $active_shared_ids[ array_search( $snippet_id, $active_shared_ids, true ) ] );
$active_shared_ids = array_values( $active_shared_ids );
update_option( 'active_shared_network_snippets', $active_shared_ids );
clean_active_snippets_cache( $table_name );
} else {
$wpdb->update(
$table_name,
array( 'active' => '0' ),
array( 'id' => $snippet_id ),
array( '%d' ),
array( '%d' )
);
clean_snippets_cache( $table_name );
}
}
if ( apply_filters( 'code_snippets/allow_execute_snippet', true, $snippet_id, $table_name ) &&
! ( $edit_id === $snippet_id && $table_name === $edit_table ) ) {
execute_snippet( $code, $snippet_id );
}
}
}
return true;
}
/**
* Retrieve a single snippets from the database using its cloud ID.
*
* Read operation.
*
* @param string $cloud_id The Cloud ID of the snippet to retrieve.
* @param boolean|null $multisite Retrieve a multisite-wide snippet (true) or site-wide snippet (false).
*
* @return Snippet|null A single snippet object or null if no snippet was found.
*
* @since 3.5.0
*/
function get_snippet_by_cloud_id( string $cloud_id, ?bool $multisite = null ): ?Snippet {
global $wpdb;
$multisite = DB::validate_network_param( $multisite );
$table_name = code_snippets()->db->get_table_name( $multisite );
$cached_snippets = wp_cache_get( "all_snippets_$table_name", CACHE_GROUP );
// Attempt to fetch snippet from the cached list, if it exists.
if ( is_array( $cached_snippets ) ) {
foreach ( $cached_snippets as $snippet ) {
if ( $snippet->cloud_id === $cloud_id ) {
return apply_filters( 'code_snippets/get_snippet_by_cloud_id', $snippet, $cloud_id, $multisite );
}
}
}
// Otherwise, search for the snippet from the database.
$snippet_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE cloud_id = %s", $cloud_id ) ); // cache pass, db call ok.
$snippet = $snippet_data ? new Snippet( $snippet_data ) : null;
return apply_filters( 'code_snippets/get_snippet_by_cloud_id', $snippet, $cloud_id, $multisite );
}
/**
* Update a snippet entry given a list of fields.
* Write operation.
*
* @param int $snippet_id ID of the snippet to update.
* @param array<string, mixed> $fields An array of fields mapped to their values.
* @param bool|null $network Update in network-wide (true) or site-wide (false) table.
*/
function update_snippet_fields( int $snippet_id, array $fields, ?bool $network = null ) {
global $wpdb;
$table = code_snippets()->db->get_table_name( $network );
// Build a new snippet object for the validation.
$snippet = new Snippet();
$snippet->id = $snippet_id;
// Validate fields through the snippet class and copy them into a clean array.
$clean_fields = array();
foreach ( $fields as $field => $value ) {
if ( $snippet->set_field( $field, $value ) ) {
$clean_fields[ $field ] = $snippet->$field;
}
}
// Update the snippet in the database.
$wpdb->update( $table, $clean_fields, array( 'id' => $snippet->id ), null, array( '%d' ) );
do_action( 'code_snippets/update_snippet', $snippet->id, $table );
clean_snippets_cache( $table );
}
php/strings.php 0000644 00000003470 15153464550 0007551 0 ustar 00 <?php
/**
* Additional strings needed for translation, but not currently present within code.
*
* @package Code_Snippets
*/
__( 'You can now safely remove the free version of Code Snippets', 'code-snippets' );
__( 'Success', 'code-snippets' );
__( 'Notice', 'code-snippets' );
__( 'Thanks', 'code-snippets' );
__( 'Okay', 'code-snippets' );
// settings-fields.php.
__( 'Minify Snippet Output', 'code-snippets' );
__( 'Minify snippet output by removing whitespace and optimising code to reduce load times.', 'code-snippets' );
// edit.php.
__( 'View Full Stylesheet', 'code-snippets' );
__( 'View Full Script', 'code-snippets' );
array(
'site-css' => __( 'Site front-end stylesheet', 'code-snippets' ),
'admin-css' => __( 'Administration area stylesheet', 'code-snippets' ),
'site-head-js' => __( 'JavaScript loaded in the site &lt;head&gt; section', 'code-snippets' ),
'site-footer-js' => __( 'JavaScript loaded just before the closing &lt;/body&gt; tag', 'code-snippets' ),
);
// class-content-widget.php.
__( 'Processing Options', 'code-snippets' );
__( 'Alignment', 'code-snippets' );
__( 'Left', 'code-snippets' );
__( 'Center', 'code-snippets' );
__( 'Right', 'code-snippets' );
__( 'Justified', 'code-snippets' );
__( 'Text Color', 'code-snippets' );
__( 'Select a snippet to show', 'code-snippets' );
// class-source-widget.php.
__( 'Code Snippet Source', 'code-snippets' );
__( 'Functions (PHP)', 'code-snippets' );
__( 'Content (Mixed)', 'code-snippets' );
__( 'Styles (CSS)', 'code-snippets' );
__( 'Scripts (JS)', 'code-snippets' );
__( 'Highlight Lines', 'code-snippets' );
__( 'Word Wrap', 'code-snippets' );
__( 'On', 'code-snippets' );
__( 'Off', 'code-snippets' );
__( 'Height', 'code-snippets' );
__( 'Font Size', 'code-snippets' );
__( 'Select a snippet to display', 'code-snippets' );
php/uninstall.php 0000644 00000004121 15153464550 0010063 0 ustar 00 <?php
/**
* Functions for cleaning data when the plugin is uninstalled.
*
* @package Code_Snippets
*
* phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
*/
namespace Code_Snippets\Uninstall;
/**
* Determine whether the option for allowing a complete uninstallation is enabled.
*
* @return boolean
*/
function complete_uninstall_enabled(): bool {
$unified = false;
if ( is_multisite() ) {
$menu_perms = get_site_option( 'menu_items', array() );
$unified = empty( $menu_perms['snippets_settings'] );
}
$settings = $unified ? get_site_option( 'code_snippets_settings' ) : get_option( 'code_snippets_settings' );
return isset( $settings['general']['complete_uninstall'] ) && $settings['general']['complete_uninstall'];
}
/**
* Clean up data created by this plugin for a single site
*
* phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
*/
function uninstall_current_site() {
global $wpdb;
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}snippets" );
delete_option( 'code_snippets_version' );
delete_option( 'recently_activated_snippets' );
delete_option( 'code_snippets_settings' );
delete_option( 'code_snippets_cloud_settings' );
delete_transient( 'cs_codevault_snippets' );
delete_transient( 'cs_local_to_cloud_map' );
}
/**
* Clean up data created by this plugin on multisite.
*
* phpcs:disable WordPress.DB.DirectDatabaseQuery.SchemaChange
*/
function uninstall_multisite() {
global $wpdb;
// Loop through sites.
$blog_ids = get_sites( [ 'fields' => 'ids' ] );
foreach ( $blog_ids as $site_id ) {
switch_to_blog( $site_id );
uninstall_current_site();
}
restore_current_blog();
// Remove network snippets table.
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}ms_snippets" );
// Remove saved options.
delete_site_option( 'code_snippets_version' );
delete_site_option( 'recently_activated_snippets' );
}
/**
* Uninstall the Code Snippets plugin.
*
* @return void
*/
function uninstall_plugin() {
if ( complete_uninstall_enabled() ) {
if ( is_multisite() ) {
uninstall_multisite();
} else {
uninstall_current_site();
}
}
}
php/views/import.php 0000644 00000006764 15153464550 0010540 0 ustar 00 <?php
/**
* HTML for the Import Snippets page.
*
* @package Code_Snippets
* @subpackage Views
*/
namespace Code_Snippets;
/**
* Loaded from import menu.
*
* @var Import_Menu $this
*/
if ( ! defined( 'ABSPATH' ) ) {
return;
}
$max_size_bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
?>
<div class="wrap">
<h1>
<?php
esc_html_e( 'Import Snippets', 'code-snippets' );
if ( code_snippets()->is_compact_menu() ) {
$this->render_page_title_actions( [ 'manage', 'add', 'settings' ] );
}
?>
</h1>
<?php $this->print_messages(); ?>
<div class="narrow">
<p><?php esc_html_e( 'Upload one or more Code Snippets export files and the snippets will be imported.', 'code-snippets' ); ?></p>
<p>
<?php
/* translators: %s: link to snippets admin menu */
$text = __( 'Afterward, you will need to visit the <a href="%s" >All Snippets</a> page to activate the imported snippets.', 'code-snippets' );
$url = esc_url( code_snippets()->get_menu_url( 'manage' ) );
echo wp_kses(
sprintf( $text, $url ),
array(
'a' => array(
'href' => array(),
'target' => array(),
)
)
);
?>
</p>
<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form"
name="code_snippets_import">
<?php wp_nonce_field( 'import_code_snippets_file' ); ?>
<h2><?php esc_html_e( 'Duplicate Snippets', 'code-snippets' ); ?></h2>
<p class="description">
<?php esc_html_e( 'What should happen if an existing snippet is found with an identical name to an imported snippet?', 'code-snippets' ); ?>
</p>
<fieldset>
<p>
<label>
<input type="radio" name="duplicate_action" value="ignore" checked="checked">
<?php esc_html_e( 'Ignore any duplicate snippets: import all snippets from the file regardless and leave all existing snippets unchanged.', 'code-snippets' ); ?>
</label>
</p>
<p>
<label>
<input type="radio" name="duplicate_action" value="replace">
<?php esc_html_e( 'Replace any existing snippets with a newly imported snippet of the same name.', 'code-snippets' ); ?>
</label>
</p>
<p>
<label>
<input type="radio" name="duplicate_action" value="skip">
<?php esc_html_e( 'Do not import any duplicate snippets; leave all existing snippets unchanged.', 'code-snippets' ); ?>
</label>
</p>
</fieldset>
<h2><?php esc_html_e( 'Upload Files', 'code-snippets' ); ?></h2>
<p class="description">
<?php esc_html_e( 'Choose one or more Code Snippets (.xml or .json) files to upload, then click "Upload files and import".', 'code-snippets' ); ?>
</p>
<fieldset>
<p>
<label for="upload"><?php esc_html_e( 'Choose files from your computer:', 'code-snippets' ); ?></label>
<?php
/* translators: %s: size in bytes */
printf( esc_html__( '(Maximum size: %s)', 'code-snippets' ), esc_html( size_format( $max_size_bytes ) ) ); ?>
<input type="file" id="upload" name="code_snippets_import_files[]" size="25"
accept="application/json,.json,text/xml" multiple="multiple">
<input type="hidden" name="action" value="save">
<input type="hidden" name="max_file_size" value="<?php echo esc_attr( $max_size_bytes ); ?>">
</p>
</fieldset>
<?php
do_action( 'code_snippets/admin/import_form' );
submit_button( __( 'Upload files and import', 'code-snippets' ) );
?>
</form>
</div>
</div>
php/views/manage.php 0000644 00000007537 15153464550 0010455 0 ustar 00 <?php
/**
* HTML for the Manage Snippets page.
*
* @package Code_Snippets
* @subpackage Views
*/
namespace Code_Snippets;
/**
* Loaded from the manage menu class.
*
* @var Manage_Menu $this
*/
if ( ! defined( 'ABSPATH' ) ) {
return;
}
$types = array_merge( [ 'all' => __( 'All Snippets', 'code-snippets' ) ], Plugin::get_types() );
$current_type = $this->get_current_type();
if ( false !== strpos( code_snippets()->version, 'beta' ) ) {
echo '<div class="notice beta-test-notice"><p id="beta-testing">';
echo wp_kses(
__( 'Thank you for testing this <span class="highlight-yellow">beta version of Code Snippets</span>. We would love to hear your feedback.', 'code-snippets' ),
[ 'span' => [ 'class' => [ 'highlight-yellow' ] ] ]
);
$feedback_url = __( 'mailto:team@codesnippets.pro?subject=Code Snippet Beta Test Feedback', 'code-snippets' );
printf( ' <a href="%s">%s</a>', esc_url( $feedback_url ), esc_html__( 'Click here to submit your feedback', 'code-snippets' ) );
echo '</p></div>';
}
?>
<div class="wrap">
<h1>
<?php
esc_html_e( 'Snippets', 'code-snippets' );
$this->render_page_title_actions( code_snippets()->is_compact_menu() ? [ 'add', 'import', 'settings' ] : [ 'add', 'import' ] );
$this->list_table->search_notice();
?>
</h1>
<?php $this->print_messages(); ?>
<h2 class="nav-tab-wrapper" id="snippet-type-tabs">
<?php
foreach ( $types as $type_name => $label ) {
Admin::render_snippet_type_tab( $type_name, $label, $current_type );
}
?>
<a class="button button-large nav-tab-button nav-tab-inactive go-pro-button"
href="https://codesnippets.pro/pricing/" target="_blank"
title="<?php esc_html_e( 'Find more about Pro (opens in external tab)', 'code-snippets' ); ?>">
<?php echo wp_kses( __( 'Upgrade to <span class="badge">Pro</span>', 'code-snippets' ), [ 'span' => [ 'class' => 'badge' ] ] ); ?>
<span class="dashicons dashicons-external"></span>
</a>
</h2>
<?php
$type_info = [
'php' => [
__( 'Function snippets are run on your site as if there were in a plugin or theme functions.php file.', 'code-snippets' ),
__( 'Learn more about function snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-php/',
],
'html' => [
__( 'Content snippets are bits of reusable PHP and HTML content that can be inserted into posts and pages.', 'code-snippets' ),
__( 'Learn more about content snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-html/',
],
'css' => [
__( 'Style snippets are written in CSS and loaded in the admin area or on the site front-end, just like the theme style.css.', 'code-snippets' ),
esc_html__( 'Learn more about style snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-css/',
],
'js' => [
__( 'Script snippets are loaded on the site front-end in a JavaScript file, either in the head or body sections.', 'code-snippets' ),
__( 'Learn more about javascript snippets →', 'code-snippets' ),
'https://codesnippets.pro/learn-js/',
],
'cloud' => [
__( 'See all your public and private snippets that are stored in your Code Snippet Cloud codevault.', 'code-snippets' ),
__( 'Learn more about Code Snippets Cloud →', 'code-snippets' ),
'https://codesnippets.cloud/getstarted/',
],
];
if ( isset( $type_info[ $current_type ] ) ) {
$info = $type_info[ $current_type ];
printf(
'<p class="snippet-type-description">%s <a href="%s" target="_blank">%s</a></p>',
esc_html( $info[0] ),
esc_url( $info[2] ),
esc_html( $info[1] )
);
}
do_action( 'code_snippets/admin/manage/before_list_table' );
$this->list_table->views();
switch ( $current_type ) {
case 'cloud_search':
include_once 'partials/cloud-search.php';
break;
default:
include_once 'partials/list-table.php';
break;
}
do_action( 'code_snippets/admin/manage', $current_type );
?>
</div>
php/views/partials/cloud-search.php 0000644 00000005003 15153464550 0013377 0 ustar 00 <?php
/**
* HTML for the cloud search tab
*
* @package Code_Snippets
* @subpackage Views
*/
namespace Code_Snippets;
/**
* Loaded from manage menu.
*
* @var Manage_Menu $this
*/
$search_query = isset( $_REQUEST['cloud_search'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['cloud_search'] ) ) : '';
$cloud_select = sanitize_key( wp_unslash( $_REQUEST['cloud_select'] ?? '' ) );
?>
<p class="cloud-search-info">
<?php esc_html_e( 'Use the search bar below to search cloud snippets by entering either the name of a codevault or keywords.', 'code-snippets' ); ?>
<small>
<?php esc_html_e( '(Note: codevault name is case and spelling sensitive and only public snippets will be shown)', 'code-snippets' ); ?>
</small>
</p>
<form method="get" action="" id="cloud-search-form">
<?php List_Table::required_form_fields( 'search_box' ); ?>
<label class="screen-reader-text" for="cloud_search">
<?php esc_html_e( 'Search cloud snippets', 'code-snippets' ); ?>
</label>
<?php
if ( isset( $_REQUEST['type'] ) ) {
printf( '<input type="hidden" name="type" value="%s">', esc_attr( sanitize_text_field( wp_unslash( $_REQUEST['type'] ) ) ) );
}
?>
<div class="heading-box">
<p class="cloud-search-heading">
<label for="cloud-select-prepend"><?php esc_html_e( 'Search Cloud', 'code-snippets' ); ?></label>
</p>
</div>
<div class="input-group">
<select id="cloud-select-prepend" class="select-prepend" name="cloud_select">
<option value="term"<?php selected( $cloud_select, 'term' ); ?>>
<?php esc_html_e( 'Search by keyword(s)', 'code-snippets' ); ?>
</option>
<option value="codevault"<?php selected( $cloud_select, 'codevault' ); ?>>
<?php esc_html_e( 'Name of codevault', 'code-snippets' ); ?>
</option>
</select>
<input type="text" id="cloud_search" name="cloud_search" class="cloud_search"
value="<?php echo esc_html( $search_query ); ?>"
placeholder="<?php esc_html_e( 'e.g. Remove unused javascript…', 'code-snippets' ); ?>">
<button type="submit" id="cloud-search-submit" class="button">
<?php esc_html_e( 'Search Cloud', 'code-snippets' ); ?>
<span class="dashicons dashicons-search cloud-search"></span>
</button>
</div>
</form>
<form method="post" action="" id="cloud-search-results">
<input type="hidden"
id="code_snippets_ajax_nonce"
value="<?php echo esc_attr( wp_create_nonce( 'code_snippets_manage_ajax' ) ); ?>">
<?php
List_Table::required_form_fields();
if ( $search_query ) {
$this->cloud_search_list_table->display();
}
?>
</form>
php/views/partials/list-table-notices.php 0000644 00000004061 15153464550 0014533 0 ustar 00 <?php
/**
* HTML for displaying notices for the manage table.
*
* @package Code_Snippets
* @subpackage Views
*/
namespace Code_Snippets;
/**
* Loaded from the manage menu.
*
* @var Manage_Menu $this
*/
if ( defined( 'CODE_SNIPPETS_SAFE_MODE' ) && CODE_SNIPPETS_SAFE_MODE ) {
?>
<div id="message" class="notice notice-error fade is-dismissible">
<p>
<?php echo wp_kses_post( __( '<strong>Warning:</strong> Safe mode is active and snippets will not execute! Remove the <code>CODE_SNIPPETS_SAFE_MODE</code> constant from <code>wp-config.php</code> to turn off safe mode.', 'code-snippets' ) ); ?>
<a href="https://help.codesnippets.pro/article/12-safe-mode" target="_blank">
<?php esc_html_e( 'Help', 'code-snippets' ); ?>
</a>
</p>
</div>
<?php
}
if ( empty( $_REQUEST['result'] ) ) {
return;
}
$result = sanitize_key( $_REQUEST['result'] );
$result_messages = apply_filters(
'code_snippets/manage/result_messages',
[
'executed' => __( 'Snippet <strong>executed</strong>.', 'code-snippets' ),
'activated' => __( 'Snippet <strong>activated</strong>.', 'code-snippets' ),
'activated-multi' => __( 'Selected snippets <strong>activated</strong>.', 'code-snippets' ),
'deactivated' => __( 'Snippet <strong>deactivated</strong>.', 'code-snippets' ),
'deactivated-multi' => __( 'Selected snippets <strong>deactivated</strong>.', 'code-snippets' ),
'deleted' => __( 'Snippet <strong>deleted</strong>.', 'code-snippets' ),
'deleted-multi' => __( 'Selected snippets <strong>deleted</strong>.', 'code-snippets' ),
'cloned' => __( 'Snippet <strong>cloned</strong>.', 'code-snippets' ),
'cloned-multi' => __( 'Selected snippets <strong>cloned</strong>.', 'code-snippets' ),
'cloud-refreshed' => __( 'Synced cloud data has been <strong>successfully</strong> refreshed.', 'code-snippets' ),
]
);
if ( isset( $result_messages[ $result ] ) ) {
printf(
'<div id="message" class="notice notice-success fade is-dismissible"><p>%s</p></div>',
wp_kses_post( $result_messages[ $result ] )
);
}
php/views/partials/list-table.php 0000644 00000001241 15153464550 0013066 0 ustar 00 <?php
/**
* HTML for the all snippets and codevault list table
*
* @package Code_Snippets
* @subpackage Views
*/
namespace Code_Snippets;
/**
* Loaded from the manage menu.
*
* @var Manage_Menu $this
*/
?>
<form method="get" action="">
<?php
List_Table::required_form_fields( 'search_box' );
$this->list_table->search_box( __( 'Search Snippets', 'code-snippets' ), 'search_id' );
?>
</form>
<form method="post" action="">
<input type="hidden" id="code_snippets_ajax_nonce"
value="<?php echo esc_attr( wp_create_nonce( 'code_snippets_manage_ajax' ) ); ?>">
<?php
List_Table::required_form_fields();
$this->list_table->display();
?>
</form>
php/views/welcome.php 0000644 00000015547 15153464550 0010660 0 ustar 00 <?php
/**
* HTML for the welcome page.
*
* @package Code_Snippets
* @subpackage Views
*/
namespace Code_Snippets;
/**
* Loaded from the Welcome_Menu class.
*
* @var Welcome_Menu $this
*/
if ( ! defined( 'ABSPATH' ) ) {
return;
}
$hero = $this->api->get_hero_item();
$changelog_sections = [
'Added' => [
'title' => __( 'New features', 'code-snippets' ),
'icon' => 'lightbulb',
],
'Improved' => [
'title' => __( 'Improvements', 'code-snippets' ),
'icon' => 'chart-line',
],
'Fixed' => [
'title' => __( 'Bug fixes', 'code-snippets' ),
'icon' => 'buddicons-replies',
],
'Other' => [
'title' => __( 'Other', 'code-snippets' ),
'icon' => 'open-folder',
],
];
$plugin_types = [
'core' => _x( 'Core', 'badge label', 'code-snippets' ),
'pro' => _x( 'Pro', 'badge label', 'code-snippets' ),
];
?>
<div class="csp-welcome-wrap">
<div class="csp-welcome-header">
<header class="csp-welcome-logo">
<img width="50px"
src="<?php echo esc_url( plugins_url( 'assets/icon.svg', PLUGIN_FILE ) ); ?>"
alt="<?php esc_attr_e( 'Code Snippets Logo', 'code-snippets' ); ?>">
<h1>
<?php echo wp_kses( __( "Resources and <span>What's New</span>", 'code-snippets' ), [ 'span' => [] ] ); ?>
</h1>
</header>
<ul class="csp-welcome-nav">
<?php foreach ( $this->get_header_links() as $link_name => $link_info ) { ?>
<li>
<a href="<?php echo esc_url( $link_info['url'] ); ?>" target="_blank"
class="csp-link-<?php echo esc_attr( $link_name ); ?>">
<span><?php echo esc_html( $link_info['label'] ); ?></span>
<?php if ( 'discord' === $link_info['icon'] ) { ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 127.14 96.36">
<path d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z" />
</svg>
<?php } else { ?>
<span class="dashicons dashicons-<?php echo esc_attr( $link_info['icon'] ); ?>"></span>
<?php } ?>
</a>
</li>
<?php } ?>
</ul>
</div>
<section class="csp-section-changes">
<h1>📰 <?php esc_html_e( 'Latest news', 'code-snippets' ); ?></h1>
<div class="csp-cards">
<a class="csp-card" href="<?php echo esc_url( $hero['follow_url'] ); ?>" target="_blank"
title="<?php esc_html_e( 'Read more', 'code-snippets' ); ?>">
<header>
<span class="dashicons dashicons-external"></span>
<h2><?php echo esc_html( $hero['name'] ); ?></h2>
</header>
<figure>
<div id="csp-loading-spinner" class="csp-loading-spinner"></div>
<img id="csp-changes-img"
onload="hideLoadingAnimation()"
src="<?php echo esc_url( $hero['image_url'] ); ?>"
alt="<?php esc_attr_e( 'Latest news image', 'code-snippets' ); ?>);">
</figure>
</a>
<a class="csp-card" href="https://wordpress.org/plugins/code-snippets/changelog" target="_blank"
title="<?php esc_html_e( 'Read the full changelog', 'code-snippets' ); ?>">
<header>
<span class="dashicons dashicons-external"></span>
<h2><?php esc_html_e( 'Latest changes', 'code-snippets' ); ?></h2>
</header>
<div class="csp-section-changelog">
<?php foreach ( $this->api->get_changelog() as $version => $version_changes ) { ?>
<h3><?php echo esc_html( $version ); ?></h3>
<article>
<?php
foreach ( $changelog_sections as $section_key => $section ) {
if ( empty( $version_changes[ $section_key ] ) ) {
continue;
}
?>
<h4>
<span class="dashicons dashicons-<?php echo esc_attr( $section['icon'] ); ?>"></span>
<?php echo esc_html( $section['title'] ); ?>
</h4>
<ul>
<?php
foreach ( $plugin_types as $plugin_type => $type_label ) {
if ( empty( $version_changes[ $section_key ][ $plugin_type ] ) ) {
continue;
}
foreach ( $version_changes[ $section_key ][ $plugin_type ] as $change ) {
?>
<li>
<span class="badge <?php echo esc_attr( $plugin_type ); ?>-badge">
<?php echo esc_html( $type_label ); ?>
</span>
<span><?php echo esc_html( $change ); ?></span>
</li>
<?php
}
}
?>
</ul>
<?php } ?>
</article>
<?php } ?>
</div>
</a>
</div>
</section>
<section class="csp-section-articles csp-section-links">
<h1>🛟 <?php esc_html_e( 'Helpful articles', 'code-snippets' ); ?></h1>
<div class="csp-cards">
<?php foreach ( $this->api->get_features() as $feature ) { ?>
<a class="csp-card"
href="<?php echo esc_url( $feature['follow_url'] ); ?>" target="_blank"
title="<?php esc_html_e( 'Read more', 'code-snippets' ); ?>">
<figure>
<img src="<?php echo esc_url( $feature['image_url'] ); ?>"
alt="<?php esc_attr_e( 'Feature image', 'code-snippets' ); ?>">
</figure>
<header>
<h2><?php echo esc_html( $feature['title'] ); ?></h2>
<p class="csp-card-item-description"><?php echo esc_html( $feature['description'] ); ?></p>
</header>
<footer>
<p class="csp-card-item-category"><?php echo esc_html( $feature['category'] ); ?></p>
<span class="dashicons dashicons-external"></span>
</footer>
</a>
<?php } ?>
</div>
</section>
<section class="csp-section-links csp-section-partners">
<h1>🚀 <?php esc_html_e( 'Partners and apps', 'code-snippets' ); ?></h1>
<div class="csp-cards">
<?php foreach ( $this->api->get_partners() as $partner ) { ?>
<a class="csp-card"
href="<?php echo esc_url( $partner['follow_url'] ); ?>" target="_blank"
title="<?php esc_attr_e( 'Go to Partner', 'code-snippets' ); ?>">
<figure>
<img src="<?php echo esc_url( $partner['image_url'] ); ?>"
alt="<?php esc_attr_e( 'Partner image', 'code-snippets' ); ?>">
</figure>
<header>
<span class="dashicons dashicons-external"></span>
<h2><?php echo esc_html( $partner['title'] ); ?></h2>
</header>
</a>
<?php } ?>
</div>
</section>
</div>
<script type="text/javascript">
function hideLoadingAnimation() {
const spinner = document.getElementById<HTMLDivElement>('csp-loading-spinner')
const image = document.getElementById<HTMLDivElement>('csp-changes-img')
spinner.style.display = 'none'
image.style.display = 'block'
}
</script>
readme.txt 0000644 00000037452 15153464550 0006565 0 ustar 00 === Code Snippets ===
Contributors: bungeshea, ver3, nate33, lightbulbman, 0aksmith, johnpixle, codesnippetspro
Donate link: https://codesnippets.pro
Tags: code, snippets, multisite, php, css
License: GPL-2.0-or-later
License URI: license.txt
Stable tag: 3.6.8
Tested up to: 6.7.2
An easy, clean and simple way to enhance your site with code snippets.
== Description ==
**✂ Code Snippets** provides an effortless way to enhance your WordPress site.
**🚀 Upgrade to Code Snippets Pro** for complete CSS, JavaScript, Gutenberg, Elementor and cloud synchronisation integrations. **[Elevate your snippets experience now!](https://codesnippets.pro/pricing)**
Say goodbye to the hassle of tweaking your theme's `functions.php` file and downloading endless plugins – Code Snippets simplifies the process!
A snippet is like a mini-plugin for your WordPress site, providing added functionality without the clutter.
Unlike other solutions that involve dumping code into your `functions.php` file, Code Snippets offers an intuitive graphical interface for seamless integration and real-time execution. Managing snippets is as easy as activating and deactivating plugins, only without the bloat and overhead.
**🎥 Watch a quick overview by Imran Siddiq:**
https://youtu.be/uzND-wdSCMQ
☁️ Each copy of Code Snippets includes full integration with the community-powered [Code Snippets Cloud](https://codesnippets.cloud/) platform, providing easy access to hundreds of tweaks and enhancements ready to power-up any WordPress site.
**🌐 Connect with us:**
* [Support Forum](https://wordpress.org/support/plugin/code-snippets)
* [Facebook Community](https://facebook.com/groups/codesnippetsplugin)
* [GitHub Repository](https://github.com/codesnippetspro/code-snippets)
🌟 Like our plugin? Find it useful? Please consider sharing your experience by [leaving a review on WordPress.org](https://wordpress.org/support/view/plugin-reviews/code-snippets). Your feedback is instrumental to shaping our future growth!
🌍 We'd like to thank the wonderful people who have helped contribute translations to allow Code Snippets to be used in different languages. [You can find a full list here](https://github.com/codesnippetspro/code-snippets/blob/core/CREDITS.md#translators).
== Installation ==
= Automatic installation =
1. Log into your WordPress admin
2. Click __Plugins__
3. Click __Add New__
4. Search for __Code Snippets__
5. Click __Install Now__ under "Code Snippets"
6. Activate the plugin
= Manual installation =
1. Download the plugin
2. Extract the contents of the zip file
3. Upload the contents of the zip file to the `wp-content/plugins/` folder of your WordPress installation
4. Activate the Code Snippets plugin from 'Plugins' page.
Network Activating Code Snippets through the Network Dashboard will enable a special interface for running snippets across the entire network.
== Frequently Asked Questions ==
A full list of our Frequently Asked Questions can be found at [help.codesnippets.pro](https://help.codesnippets.pro/collection/3-faq).
= How can I recover my site if it is crashed by a buggy snippet? =
You can recover your site by enabling the Code Snippets safe mode feature. Instructions for how to turn it on are available here: <https://help.codesnippets.pro/article/12-safe-mode>.
= Will I lose my snippets if I change the theme or upgrade WordPress? =
No, the snippets are stored in the WordPress database, independent of the theme and unaffected by WordPress upgrades.
= Can the plugin be completely uninstalled? =
If you enable the 'Complete Uninstall' option on the plugin settings page, Code Snippets will clean up all of its data when deleted through the WordPress 'Plugins' menu. This includes all stored snippets. If you would like to preserve the snippets, ensure they are exported first.
= Can I copy snippets that I have created to another WordPress site? =
Yes! You can individually export a single snippet using the link below the snippet name on the 'Manage Snippets' page or bulk export multiple snippets using the 'Bulk Actions' feature. Snippets can later be imported using the 'Import Snippets' page by uploading the export file.
= Can I export my snippets to PHP for a site where I'm not using the Code Snippets plugin? =
Yes. Click the checkboxes next to the snippets you want to export, and then choose **Export to PHP** from the Bulk Actions menu and click Apply. The generated PHP file will contain the exported snippets' code, as well as their name and description in comments.
= Can I run network-wide snippets on a multisite installation? =
You can run snippets across an entire multisite network by **Network Activating** Code Snippets through the Network Dashboard. You can also activate Code Snippets just on the main site, and then individually on other sites of your choice.
= Where are the snippets stored in my WordPress database? =
Snippets are stored in the `wp_snippets` table in the WordPress database. The table name may differ depending on what your table prefix is set to.
= Where can I go for help or suggest new features? =
You can get help with Code Snippets, report bugs or errors, and suggest new features and improvements either on the [WordPress Support Forums](https://wordpress.org/support/plugin/code-snippets) or on [GitHub](https://github.com/codesnippetspro/code-snippets).
= How can I help contribute to the development of the Code Snippets plugin? =
The best way to do this is to fork the [repository on GitHub](https://github.com/codesnippetspro/code-snippets) and send a pull request.
= How can I report security bugs found in this plugin? =
You can report security bugs found in the source code of this plugin through the [Patchstack Vulnerability Disclosure Program](https://patchstack.com/database/vdp/code-snippets). The Patchstack team will assist with verification, triage, and notification of security vulnerabilities.
== Screenshots ==
1. Managing existing snippets
2. Adding a new snippet
3. Editing a snippet
4. Importing snippets from an export file
== Changelog ==
= 3.6.8 (2025-02-14) =
__Added__
* `code_snippets/hide_welcome_banner` filter hook for hiding welcome banner in dashboard.
__Changed__
* Updated Freemius SDK to the latest version. (PRO)
__Removed__
* Functionality allowing `[code_snippet]` shortcodes to be embedded recursively – it will be re-added in a future version.
__Fixed__
* Shortcodes embedded within `[code_snippet]` shortcodes not evaluating correctly.
* Translation functions being called too early in some instances when loading plugin settings.
* 'Generate' button not appearing on some sites. (PRO)
* Incorrect arrow entity used in cloud list table (props to [brandonjp]).
* Removed reference to missing plugins.css file in core plugin version.
= 3.6.7 (2025-01-24) =
__Added__
* Generated snippet shortcode tags will include the snippet name, for easier identification.
* Admin notices will dismiss automatically after five seconds. ([#208](https://github.com/codesnippetspro/code-snippets/issues/208))
__Changed__
* Updated CSS to use latest Sass features.
* Moved theme selector to just above editor preview on settings page (thanks to brandonjp). ([#206](https://github.com/codesnippetspro/code-snippets/issues/206))
* `[code_snippet]` shortcodes can now be nested within each other. ([#198](https://github.com/codesnippetspro/code-snippets/issues/198))
__Fixed__
* Save buttons above editor did not follow usual validation process in Pro. (PRO) ([#197](https://github.com/codesnippetspro/code-snippets/issues/197))
* Minor inconsistencies in consistent UI elements between Core and Pro.
* Tags input not allowing input. ([#211](https://github.com/codesnippetspro/code-snippets/issues/211))
* Issue with Elementor source code widget. (PRO) ([#205](https://github.com/codesnippetspro/code-snippets/issues/205))
* Snippet descriptions not visible when viewing cloud search results.
* Snippet import page not displaying number of successfully imported snippets.
* Use UTC time when deciding when to display campaign notices.
= 3.6.6.1 (2024-11-27) =
__Fixed__
* Redeployment of v3.6.6 to overcome issue with initial build.
* Type issue when caching cloud links. (PRO)
= 3.6.6 (2024-11-27) =
__Changed__
* Improved compatability with modern versions of PHP.
* Extended welcome API to include admin notices.
__Fixed__
* Memory issue from checking aggregate posts while loading front-end syntax highlighter.
* Translation functions being called too early on upgrade, resulting in localisation loading errors.
* Bug preventing the 'share on network' status of network snippets from correctly updating.
* Incorrect logic controlling when to display 'Save Changes' or 'Save Changes and Activate' buttons.
* Old notices persisting when switching between editing and creating snippets.
= 3.6.5.1 (2024-05-24) =
* Redeployment of v3.6.5 to overcome issue with initial build.
= 3.6.5 (2024-05-24) =
__Added__
* New admin menu providing useful resources and updates on the Code Snippets plugin and community.
= 3.6.4 (2024-03-15) =
__Added__
* AI generation for all snippet types: HTML, CSS, JS. (PRO)
* Button to create a cloud connection directly from the Snippets menu when disconnected. (PRO)
__Changed__
* Increment the revision number of CSS and JS snippet when using the 'Reset Caches' debug action. (PRO)
* UX in generate dialog, such as allowing 'Enter' to submit the form. (PRO)
__Fixed__
* Minor type compatability issue with newer versions of PHP.
* Undefined array key issue when initiating cloud sync. (PRO)
* Bug preventing downloading a single snippet from a bundle. (PRO)
* Translations not loading for strings in JavaScript files.
= 3.6.3 (2023-11-13) =
__Added__
* Added debug action for resetting snippets caches.
__Fixed__
* Import error when initialising cloud sync configuration. (PRO)
= 3.6.2 (2023-11-11) =
__Removed__
* Removed automatic encoding of code content.
__Fixed__
* Error when attempting to save shared network snippets marked as active.
* Type error when rendering checkbox fields without a stored or default value.
* Label for snippet sharing input incorrectly linked to input field.
* Error when attempting to download export files from Edit menu.
* Issue loading Freemius string overrides too early. (PRO)
* Fix redirect URL when connecting with OAuth on subdirectory or HTTPS sites. (PRO)
* Import error when attempting to completely uninstall the plugin.
= 3.6.1 (2023-11-07) =
__Fixed__
* Issue accessing fields on Snippets class.
= 3.6.0 (2023-11-07) =
__Added__
* Ability to authenticate with Code Snippets Cloud using OAuth. (PRO)
* Integration with GPT AI for generating snippets. (PRO)
* Ability to generate line-by-line descriptions of snippet code with GPT AI. (PRO)
* Ability to generate tags and description text from existing snippet code with GPT AI. (PRO)
* Added debug settings menu for manually performing problem-solving actions.
* Filter to disable scroll-into-view functionality for edit page notices.
__Changed__
* Updated minimum PHP requirement to 7.4.
* Ensure that the URL of the edit snippet page changes when adding a new snippet.
* Snippet tags will automatically be added when focus is lost on the tags field.
__Fixed__
* Moved active status border on edit name field to left-hand side.
* New notices will not scroll if already at top of page.
* Potential CSRF vulnerability allowing an authenticated user to reset settings.
= 3.5.1 (2023-09-15) =
__Fixed__
* Undefined array key error when accessing plugin settings page. (PRO)
* Issue registering API endpoints affecting edit post screen. (PRO)
* Snippet ID instead of snippet object being passed to `code_snippets/update_snippet` action hook.
= 3.5.0 (2023-09-13) =
__Added__
* Support for the Code Snippets Cloud API.
* Search and download public snippets.
* Codevault back-up and synchronisation. (PRO)
* Synchronised local snippets are automatically updated in Cloud. (PRO)
* Bulk actions - 'update' and 'download'.
* Download snippets from public and private codevaults. (PRO)
* Search and download any publicly viewable snippet in Code Snippet Cloud by keyword or name of codevault. (PRO)
* Deploy snippets to plugin from Code Snippets Cloud app. (PRO)
* Bundles of Joy! Search and download Snippet Bundles in one go direct from Code Snippets Cloud. (PRO)
__Changed__
* Redirect to snippets table when deleting snippet from the edit menu.
* Scroll new notices into view on edit menu.
__Fixed__
* Error when attempting to update network shared snippets after saving. [[#](https://wordpress.org/support/topic/activating-snippets-breaks-on-wordpress-6-3/)]
= 3.4.2 (2023-07-05) =
__Fixed__
* Issue causing export process to fail with fatal error. [[#](https://wordpress.org/support/topic/critical-error-on-exporting-snippets/)]
* Type issue on `the_posts` filter when no posts available. [[#](https://wordpress.org/support/topic/collision-with-plugin-xml-sitemap-google-news/)]
= 3.4.1 (2023-06-29) =
__Added__
* Added better debugging when calling REST API methods from the edit menu.
__Changed__
* Escape special characters when sending snippet code through AJAX to avoid false-positives from security modules. [[#](https://wordpress.org/support/topic/latest-3-4-0-ajax-bug-cannot-save-snippets-403-error/)]
* Only display the latest update or error notice on the edit page, instead of allowing them to stack.
__Fixed__
* Undefined array key error. [[#](https://wordpress.org/support/topic/after-updating-occasionally-getting-undefined-array-key-query/)]
* Potential type issue when loading Prism. [[#](https://wordpress.org/support/topic/code-snippets-fatal-error-breaking-xml-sitemaps/)]
* Potential type issue when sorting snippets. [[#](https://github.com/codesnippetspro/code-snippets/issues/166)]
* Issue preventing asset revision numbers from updating correctly. (PRO) [[#](https://github.com/codesnippetspro/code-snippets/issues/166)]
= 3.4.0 (2023-05-17) =
__Added__
* Proper WordPress REST API support for retrieving and modifying snippets.
* Added help links to content snippet options.
__Changed__
* Better compatibility with modern versions of PHP (7.0+).
* Converted Edit/Add New Snippet page to use React.
* Converted action buttons to asynchronously use REST API endpoints through AJAX.
* Load page components dynamically through React.
* Added action notice queue system.
* Replaced native alert dialog with proper React modal.
* Catch snippet execution errors to prevent site from crashing.
* Display recent snippet errors in admin dashboard instead.
* Updated editor block to use new REST API endpoints. (PRO)
* Change colour of upgrade notice in Pro plugin. (PRO)
* All available snippet data is included in export files.
* Only import specific fields from export file, even if additional fields specified.
* Pass additional attributes specified in `[code_snippet]` content shortcode to shortcode content.
* Make shortcode attributes available as individual variables.
* Allow boolean attributes to be passed to code snippets shortcodes without specifying a value.
* Replace external links to Pro pricing page with an upgrade modal.
__Fixed__
* Issue preventing editor colorpicker from loading correctly. (PRO)
* Issue preventing linting libraries from loading correctly in the code editor.
= 3.3.0 (2023-03-09) =
__Added__
* Added additional editor shortcuts to list in tooltip.
* Filter for changing Snippets admin menu position. [See this help article for more information.](https://help.codesnippets.pro/article/61-how-can-i-change-the-location-of-the-snippets-admin-menu)
* Ability to filter shortcode output. Thanks to contributions from [Jack Szwergold](https://github.com/JackSzwergold).
__Fixed__
* Do not enqueue CSS or JS snippet file if no snippets exist. (PRO)
* Bug causing all snippets to show in site health information instead of those active.
* Unnecessary sanitization of file upload data causing import process to fail on Windows systems.
**[The full changelog is available on GitHub](https://github.com/codesnippetspro/code-snippets/blob/core/CHANGELOG.md)**
uninstall.php 0000644 00000000565 15153464550 0007304 0 ustar 00 <?php
/**
* Cleans up data created by this plugin
*
* @package Code_Snippets
* @since 2.0.0
*/
namespace Code_Snippets\Uninstall;
// Ensure this plugin is actually being uninstalled.
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) || ( defined( 'CODE_SNIPPETS_PRO' ) && CODE_SNIPPETS_PRO ) ) {
return;
}
require_once __DIR__ . '/php/uninstall.php';
uninstall_plugin();
vendor/autoload.php 0000644 00000001403 15153464550 0010370 0 ustar 00 <?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit32c628976156f02e2f24b767297ff314::getLoader();
vendor/composer/ClassLoader.php 0000644 00000037772 15153464550 0012625 0 ustar 00 <?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}
vendor/composer/InstalledVersions.php 0000644 00000037417 15153464550 0014075 0 ustar 00 <?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed;
}
}
vendor/composer/LICENSE 0000644 00000002056 15153464550 0010710 0 ustar 00
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
vendor/composer/autoload_classmap.php 0000644 00000005135 15153464550 0014110 0 ustar 00 <?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Code_Snippets\\Active_Snippets' => $baseDir . '/php/class-active-snippets.php',
'Code_Snippets\\Admin' => $baseDir . '/php/class-admin.php',
'Code_Snippets\\Admin_Menu' => $baseDir . '/php/admin-menus/class-admin-menu.php',
'Code_Snippets\\Cloud\\Cloud_API' => $baseDir . '/php/cloud/class-cloud-api.php',
'Code_Snippets\\Cloud\\Cloud_Link' => $baseDir . '/php/cloud/class-cloud-link.php',
'Code_Snippets\\Cloud\\Cloud_Search_List_Table' => $baseDir . '/php/cloud/class-cloud-search-list-table.php',
'Code_Snippets\\Cloud\\Cloud_Snippet' => $baseDir . '/php/cloud/class-cloud-snippet.php',
'Code_Snippets\\Cloud\\Cloud_Snippets' => $baseDir . '/php/cloud/class-cloud-snippets.php',
'Code_Snippets\\Contextual_Help' => $baseDir . '/php/class-contextual-help.php',
'Code_Snippets\\DB' => $baseDir . '/php/class-db.php',
'Code_Snippets\\Data_Item' => $baseDir . '/php/class-data-item.php',
'Code_Snippets\\Edit_Menu' => $baseDir . '/php/admin-menus/class-edit-menu.php',
'Code_Snippets\\Export' => $baseDir . '/php/export/class-export.php',
'Code_Snippets\\Export_Attachment' => $baseDir . '/php/export/class-export-attachment.php',
'Code_Snippets\\Front_End' => $baseDir . '/php/front-end/class-front-end.php',
'Code_Snippets\\Import' => $baseDir . '/php/export/class-import.php',
'Code_Snippets\\Import_Menu' => $baseDir . '/php/admin-menus/class-import-menu.php',
'Code_Snippets\\Licensing' => $baseDir . '/php/class-licensing.php',
'Code_Snippets\\List_Table' => $baseDir . '/php/class-list-table.php',
'Code_Snippets\\Manage_Menu' => $baseDir . '/php/admin-menus/class-manage-menu.php',
'Code_Snippets\\Plugin' => $baseDir . '/php/class-plugin.php',
'Code_Snippets\\REST_API\\Snippets_REST_Controller' => $baseDir . '/php/rest-api/class-snippets-rest-controller.php',
'Code_Snippets\\Settings\\Setting_Field' => $baseDir . '/php/settings/class-setting-field.php',
'Code_Snippets\\Settings_Menu' => $baseDir . '/php/admin-menus/class-settings-menu.php',
'Code_Snippets\\Snippet' => $baseDir . '/php/class-snippet.php',
'Code_Snippets\\Upgrade' => $baseDir . '/php/class-upgrade.php',
'Code_Snippets\\Validator' => $baseDir . '/php/class-validator.php',
'Code_Snippets\\Welcome_API' => $baseDir . '/php/class-welcome-api.php',
'Code_Snippets\\Welcome_Menu' => $baseDir . '/php/admin-menus/class-welcome-menu.php',
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);
vendor/composer/autoload_namespaces.php 0000644 00000000213 15153464550 0014414 0 ustar 00 <?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);
vendor/composer/autoload_psr4.php 0000644 00000000351 15153464550 0013170 0 ustar 00 <?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
);
vendor/composer/autoload_real.php 0000644 00000002161 15153464550 0013224 0 ustar 00 <?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit32c628976156f02e2f24b767297ff314
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit32c628976156f02e2f24b767297ff314', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit32c628976156f02e2f24b767297ff314', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit32c628976156f02e2f24b767297ff314::getInitializer($loader));
$loader->register(true);
return $loader;
}
}
vendor/composer/autoload_static.php 0000644 00000007556 15153464550 0013605 0 ustar 00 <?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit32c628976156f02e2f24b767297ff314
{
public static $prefixLengthsPsr4 = array (
'C' =>
array (
'Composer\\Installers\\' => 20,
),
);
public static $prefixDirsPsr4 = array (
'Composer\\Installers\\' =>
array (
0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
),
);
public static $classMap = array (
'Code_Snippets\\Active_Snippets' => __DIR__ . '/../..' . '/php/class-active-snippets.php',
'Code_Snippets\\Admin' => __DIR__ . '/../..' . '/php/class-admin.php',
'Code_Snippets\\Admin_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-admin-menu.php',
'Code_Snippets\\Cloud\\Cloud_API' => __DIR__ . '/../..' . '/php/cloud/class-cloud-api.php',
'Code_Snippets\\Cloud\\Cloud_Link' => __DIR__ . '/../..' . '/php/cloud/class-cloud-link.php',
'Code_Snippets\\Cloud\\Cloud_Search_List_Table' => __DIR__ . '/../..' . '/php/cloud/class-cloud-search-list-table.php',
'Code_Snippets\\Cloud\\Cloud_Snippet' => __DIR__ . '/../..' . '/php/cloud/class-cloud-snippet.php',
'Code_Snippets\\Cloud\\Cloud_Snippets' => __DIR__ . '/../..' . '/php/cloud/class-cloud-snippets.php',
'Code_Snippets\\Contextual_Help' => __DIR__ . '/../..' . '/php/class-contextual-help.php',
'Code_Snippets\\DB' => __DIR__ . '/../..' . '/php/class-db.php',
'Code_Snippets\\Data_Item' => __DIR__ . '/../..' . '/php/class-data-item.php',
'Code_Snippets\\Edit_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-edit-menu.php',
'Code_Snippets\\Export' => __DIR__ . '/../..' . '/php/export/class-export.php',
'Code_Snippets\\Export_Attachment' => __DIR__ . '/../..' . '/php/export/class-export-attachment.php',
'Code_Snippets\\Front_End' => __DIR__ . '/../..' . '/php/front-end/class-front-end.php',
'Code_Snippets\\Import' => __DIR__ . '/../..' . '/php/export/class-import.php',
'Code_Snippets\\Import_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-import-menu.php',
'Code_Snippets\\Licensing' => __DIR__ . '/../..' . '/php/class-licensing.php',
'Code_Snippets\\List_Table' => __DIR__ . '/../..' . '/php/class-list-table.php',
'Code_Snippets\\Manage_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-manage-menu.php',
'Code_Snippets\\Plugin' => __DIR__ . '/../..' . '/php/class-plugin.php',
'Code_Snippets\\REST_API\\Snippets_REST_Controller' => __DIR__ . '/../..' . '/php/rest-api/class-snippets-rest-controller.php',
'Code_Snippets\\Settings\\Setting_Field' => __DIR__ . '/../..' . '/php/settings/class-setting-field.php',
'Code_Snippets\\Settings_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-settings-menu.php',
'Code_Snippets\\Snippet' => __DIR__ . '/../..' . '/php/class-snippet.php',
'Code_Snippets\\Upgrade' => __DIR__ . '/../..' . '/php/class-upgrade.php',
'Code_Snippets\\Validator' => __DIR__ . '/../..' . '/php/class-validator.php',
'Code_Snippets\\Welcome_API' => __DIR__ . '/../..' . '/php/class-welcome-api.php',
'Code_Snippets\\Welcome_Menu' => __DIR__ . '/../..' . '/php/admin-menus/class-welcome-menu.php',
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit32c628976156f02e2f24b767297ff314::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit32c628976156f02e2f24b767297ff314::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit32c628976156f02e2f24b767297ff314::$classMap;
}, null, ClassLoader::class);
}
}
vendor/composer/installed.json 0000644 00000011522 15153464550 0012553 0 ustar 00 {
"packages": [
{
"name": "composer/installers",
"version": "v2.3.0",
"version_normalized": "2.3.0.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
"reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/installers/zipball/12fb2dfe5e16183de69e784a7b84046c43d97e8e",
"reference": "12fb2dfe5e16183de69e784a7b84046c43d97e8e",
"shasum": ""
},
"require": {
"composer-plugin-api": "^1.0 || ^2.0",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"composer/composer": "^1.10.27 || ^2.7",
"composer/semver": "^1.7.2 || ^3.4.0",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-phpunit": "^1",
"symfony/phpunit-bridge": "^7.1.1",
"symfony/process": "^5 || ^6 || ^7"
},
"time": "2024-06-24T20:46:46+00:00",
"type": "composer-plugin",
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
"dev-main": "2.x-dev"
},
"plugin-modifies-install-path": true
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Composer\\Installers\\": "src/Composer/Installers"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kyle Robinson Young",
"email": "kyle@dontkry.com",
"homepage": "https://github.com/shama"
}
],
"description": "A multi-framework Composer library installer",
"homepage": "https://composer.github.io/installers/",
"keywords": [
"Dolibarr",
"Eliasis",
"Hurad",
"ImageCMS",
"Kanboard",
"Lan Management System",
"MODX Evo",
"MantisBT",
"Mautic",
"Maya",
"OXID",
"Plentymarkets",
"Porto",
"RadPHP",
"SMF",
"Starbug",
"Thelia",
"Whmcs",
"WolfCMS",
"agl",
"annotatecms",
"attogram",
"bitrix",
"cakephp",
"chef",
"cockpit",
"codeigniter",
"concrete5",
"concreteCMS",
"croogo",
"dokuwiki",
"drupal",
"eZ Platform",
"elgg",
"expressionengine",
"fuelphp",
"grav",
"installer",
"itop",
"known",
"kohana",
"laravel",
"lavalite",
"lithium",
"magento",
"majima",
"mako",
"matomo",
"mediawiki",
"miaoxing",
"modulework",
"modx",
"moodle",
"osclass",
"pantheon",
"phpbb",
"piwik",
"ppi",
"processwire",
"puppet",
"pxcms",
"reindex",
"roundcube",
"shopware",
"silverstripe",
"sydes",
"sylius",
"tastyigniter",
"wordpress",
"yawik",
"zend",
"zikula"
],
"support": {
"issues": "https://github.com/composer/installers/issues",
"source": "https://github.com/composer/installers/tree/v2.3.0"
},
"funding": [
{
"url": "https://packagist.com",
"type": "custom"
},
{
"url": "https://github.com/composer",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/composer/composer",
"type": "tidelift"
}
],
"install-path": "./installers"
}
],
"dev": false,
"dev-package-names": []
}
vendor/composer/installed.php 0000644 00000002225 15153464550 0012371 0 ustar 00 <?php return array(
'root' => array(
'name' => 'codesnippetspro/code-snippets',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'a8799f820421dd1ee5e63b332df58ef30f256050',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => false,
),
'versions' => array(
'codesnippetspro/code-snippets' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'a8799f820421dd1ee5e63b332df58ef30f256050',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'composer/installers' => array(
'pretty_version' => 'v2.3.0',
'version' => '2.3.0.0',
'reference' => '12fb2dfe5e16183de69e784a7b84046c43d97e8e',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/./installers',
'aliases' => array(),
'dev_requirement' => false,
),
),
);
vendor/composer/installers/LICENSE 0000644 00000002046 15153464550 0013067 0 ustar 00 Copyright (c) 2012 Kyle Robinson Young
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. vendor/composer/installers/composer.json 0000644 00000005235 15153464550 0014607 0 ustar 00 {
"name": "composer/installers",
"type": "composer-plugin",
"license": "MIT",
"description": "A multi-framework Composer library installer",
"keywords": [
"installer",
"AGL",
"AnnotateCms",
"Attogram",
"Bitrix",
"CakePHP",
"Chef",
"Cockpit",
"CodeIgniter",
"concrete5",
"ConcreteCMS",
"Croogo",
"DokuWiki",
"Dolibarr",
"Drupal",
"Elgg",
"Eliasis",
"ExpressionEngine",
"eZ Platform",
"FuelPHP",
"Grav",
"Hurad",
"ImageCMS",
"iTop",
"Kanboard",
"Known",
"Kohana",
"Lan Management System",
"Laravel",
"Lavalite",
"Lithium",
"Magento",
"majima",
"Mako",
"MantisBT",
"Matomo",
"Mautic",
"Maya",
"MODX",
"MODX Evo",
"MediaWiki",
"Miaoxing",
"OXID",
"osclass",
"MODULEWork",
"Moodle",
"Pantheon",
"Piwik",
"pxcms",
"phpBB",
"Plentymarkets",
"PPI",
"Puppet",
"Porto",
"ProcessWire",
"RadPHP",
"ReIndex",
"Roundcube",
"shopware",
"SilverStripe",
"SMF",
"Starbug",
"SyDES",
"Sylius",
"TastyIgniter",
"Thelia",
"WHMCS",
"WolfCMS",
"WordPress",
"YAWIK",
"Zend",
"Zikula"
],
"homepage": "https://composer.github.io/installers/",
"authors": [
{
"name": "Kyle Robinson Young",
"email": "kyle@dontkry.com",
"homepage": "https://github.com/shama"
}
],
"autoload": {
"psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
},
"autoload-dev": {
"psr-4": { "Composer\\Installers\\Test\\": "tests/Composer/Installers/Test" }
},
"extra": {
"class": "Composer\\Installers\\Plugin",
"branch-alias": {
"dev-main": "2.x-dev"
},
"plugin-modifies-install-path": true
},
"require": {
"php": "^7.2 || ^8.0",
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer": "^1.10.27 || ^2.7",
"composer/semver": "^1.7.2 || ^3.4.0",
"symfony/phpunit-bridge": "^7.1.1",
"phpstan/phpstan": "^1.11",
"symfony/process": "^5 || ^6 || ^7",
"phpstan/phpstan-phpunit": "^1"
},
"scripts": {
"test": "@php vendor/bin/simple-phpunit",
"phpstan": "@php vendor/bin/phpstan analyse"
}
}
vendor/composer/installers/src/Composer/Installers/AglInstaller.php 0000644 00000001242 15153464550 0021647 0 ustar 00 <?php
namespace Composer\Installers;
class AglInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'More/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$name = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
return strtoupper($matches[1]);
}, $vars['name']);
if (null === $name) {
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
}
$vars['name'] = $name;
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/AkauntingInstaller.php 0000644 00000001133 15153464550 0023064 0 ustar 00 <?php
namespace Composer\Installers;
class AkauntingInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php 0000644 00000000505 15153464550 0023361 0 ustar 00 <?php
namespace Composer\Installers;
class AnnotateCmsInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'addons/modules/{$name}/',
'component' => 'addons/components/{$name}/',
'service' => 'addons/services/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php 0000644 00000003077 15153464550 0022355 0 ustar 00 <?php
namespace Composer\Installers;
class AsgardInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'Modules/{$name}/',
'theme' => 'Themes/{$name}/'
);
/**
* Format package name.
*
* For package type asgard-module, cut off a trailing '-plugin' if present.
*
* For package type asgard-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'asgard-module') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'asgard-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php 0000644 00000000320 15153464550 0022716 0 ustar 00 <?php
namespace Composer\Installers;
class AttogramInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/BaseInstaller.php 0000644 00000010117 15153464550 0022017 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\IO\IOInterface;
use Composer\Composer;
use Composer\Package\PackageInterface;
abstract class BaseInstaller
{
/** @var array<string, string> */
protected $locations = array();
/** @var Composer */
protected $composer;
/** @var PackageInterface */
protected $package;
/** @var IOInterface */
protected $io;
/**
* Initializes base installer.
*/
public function __construct(PackageInterface $package, Composer $composer, IOInterface $io)
{
$this->composer = $composer;
$this->package = $package;
$this->io = $io;
}
/**
* Return the install path based on package type.
*/
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
{
$type = $this->package->getType();
$prettyName = $this->package->getPrettyName();
if (strpos($prettyName, '/') !== false) {
list($vendor, $name) = explode('/', $prettyName);
} else {
$vendor = '';
$name = $prettyName;
}
$availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
$extra = $package->getExtra();
if (!empty($extra['installer-name'])) {
$availableVars['name'] = $extra['installer-name'];
}
$extra = $this->composer->getPackage()->getExtra();
if (!empty($extra['installer-paths'])) {
$customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
if ($customPath !== false) {
return $this->templatePath($customPath, $availableVars);
}
}
$packageType = substr($type, strlen($frameworkType) + 1);
$locations = $this->getLocations($frameworkType);
if (!isset($locations[$packageType])) {
throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
}
return $this->templatePath($locations[$packageType], $availableVars);
}
/**
* For an installer to override to modify the vars per installer.
*
* @param array<string, string> $vars This will normally receive array{name: string, vendor: string, type: string}
* @return array<string, string>
*/
public function inflectPackageVars(array $vars): array
{
return $vars;
}
/**
* Gets the installer's locations
*
* @return array<string, string> map of package types => install path
*/
public function getLocations(string $frameworkType)
{
return $this->locations;
}
/**
* Replace vars in a path
*
* @param array<string, string> $vars
*/
protected function templatePath(string $path, array $vars = array()): string
{
if (strpos($path, '{') !== false) {
extract($vars);
preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
if (!empty($matches[1])) {
foreach ($matches[1] as $var) {
$path = str_replace('{$' . $var . '}', $$var, $path);
}
}
}
return $path;
}
/**
* Search through a passed paths array for a custom install path.
*
* @param array<string, string[]|string> $paths
* @return string|false
*/
protected function mapCustomInstallPaths(array $paths, string $name, string $type, ?string $vendor = null)
{
foreach ($paths as $path => $names) {
$names = (array) $names;
if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
return $path;
}
}
return false;
}
protected function pregReplace(string $pattern, string $replacement, string $subject): string
{
$result = preg_replace($pattern, $replacement, $subject);
if (null === $result) {
throw new \RuntimeException('Failed to run preg_replace with '.$pattern.': '.preg_last_error());
}
return $result;
}
}
vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php 0000644 00000010344 15153464550 0022410 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Util\Filesystem;
/**
* Installer for Bitrix Framework. Supported types of extensions:
* - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
* - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
* - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
*
* You can set custom path to directory with Bitrix kernel in `composer.json`:
*
* ```json
* {
* "extra": {
* "bitrix-dir": "s1/bitrix"
* }
* }
* ```
*
* @author Nik Samokhvalov <nik@samokhvalov.info>
* @author Denis Kulichkin <onexhovia@gmail.com>
*/
class BitrixInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
);
/**
* @var string[] Storage for informations about duplicates at all the time of installation packages.
*/
private static $checkedDuplicates = array();
public function inflectPackageVars(array $vars): array
{
/** @phpstan-ignore-next-line */
if ($this->composer->getPackage()) {
$extra = $this->composer->getPackage()->getExtra();
if (isset($extra['bitrix-dir'])) {
$vars['bitrix_dir'] = $extra['bitrix-dir'];
}
}
if (!isset($vars['bitrix_dir'])) {
$vars['bitrix_dir'] = 'bitrix';
}
return parent::inflectPackageVars($vars);
}
/**
* {@inheritdoc}
*/
protected function templatePath(string $path, array $vars = array()): string
{
$templatePath = parent::templatePath($path, $vars);
$this->checkDuplicates($templatePath, $vars);
return $templatePath;
}
/**
* Duplicates search packages.
*
* @param array<string, string> $vars
*/
protected function checkDuplicates(string $path, array $vars = array()): void
{
$packageType = substr($vars['type'], strlen('bitrix') + 1);
$localDir = explode('/', $vars['bitrix_dir']);
array_pop($localDir);
$localDir[] = 'local';
$localDir = implode('/', $localDir);
$oldPath = str_replace(
array('{$bitrix_dir}', '{$name}'),
array($localDir, $vars['name']),
$this->locations[$packageType]
);
if (in_array($oldPath, static::$checkedDuplicates)) {
return;
}
if ($oldPath !== $path && file_exists($oldPath) && $this->io->isInteractive()) {
$this->io->writeError(' <error>Duplication of packages:</error>');
$this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
while (true) {
switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
case 'y':
$fs = new Filesystem();
$fs->removeDirectory($oldPath);
break 2;
case 'n':
break 2;
case '?':
default:
$this->io->writeError(array(
' y - delete package ' . $oldPath . ' and to continue with the installation',
' n - don\'t delete and to continue with the installation',
));
$this->io->writeError(' ? - print help');
break;
}
}
}
static::$checkedDuplicates[] = $oldPath;
}
}
vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php 0000644 00000000336 15153464550 0022704 0 ustar 00 <?php
namespace Composer\Installers;
class BonefishInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'package' => 'Packages/{$vendor}/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/BotbleInstaller.php 0000644 00000000417 15153464550 0022356 0 ustar 00 <?php
namespace Composer\Installers;
class BotbleInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'platform/plugins/{$name}/',
'theme' => 'platform/themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php 0000644 00000003641 15153464550 0022364 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\DependencyResolver\Pool;
use Composer\Semver\Constraint\Constraint;
class CakePHPInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'Plugin/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
if ($this->matchesCakeVersion('>=', '3.0.0')) {
return $vars;
}
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
/**
* Change the default plugin location when cakephp >= 3.0
*/
public function getLocations(string $frameworkType): array
{
if ($this->matchesCakeVersion('>=', '3.0.0')) {
$this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
}
return $this->locations;
}
/**
* Check if CakePHP version matches against a version
*
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $matcher
*/
protected function matchesCakeVersion(string $matcher, string $version): bool
{
$repositoryManager = $this->composer->getRepositoryManager();
/** @phpstan-ignore-next-line */
if (!$repositoryManager) {
return false;
}
$repos = $repositoryManager->getLocalRepository();
/** @phpstan-ignore-next-line */
if (!$repos) {
return false;
}
return $repos->findPackage('cakephp/cakephp', new Constraint($matcher, $version)) !== null;
}
}
vendor/composer/installers/src/Composer/Installers/ChefInstaller.php 0000644 00000000404 15153464550 0022010 0 ustar 00 <?php
namespace Composer\Installers;
class ChefInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'cookbook' => 'Chef/{$vendor}/{$name}/',
'role' => 'Chef/roles/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php 0000644 00000000312 15153464550 0022475 0 ustar 00 <?php
namespace Composer\Installers;
class CiviCrmInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'ext' => 'ext/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php 0000644 00000000420 15153464550 0024507 0 ustar 00 <?php
namespace Composer\Installers;
class ClanCatsFrameworkInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'ship' => 'CCF/orbit/{$name}/',
'theme' => 'CCF/app/themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php 0000644 00000001443 15153464550 0022543 0 ustar 00 <?php
namespace Composer\Installers;
class CockpitInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'cockpit/modules/addons/{$name}/',
);
/**
* Format module name.
*
* Strip `module-` prefix from package name.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] == 'cockpit-module') {
return $this->inflectModuleVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
public function inflectModuleVars(array $vars): array
{
$vars['name'] = ucfirst($this->pregReplace('/cockpit-/i', '', $vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php 0000644 00000000534 15153464550 0023343 0 ustar 00 <?php
namespace Composer\Installers;
class CodeIgniterInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'library' => 'application/libraries/{$name}/',
'third-party' => 'application/third_party/{$name}/',
'module' => 'application/modules/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php 0000644 00000000625 15153464550 0022777 0 ustar 00 <?php
namespace Composer\Installers;
class Concrete5Installer extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'core' => 'concrete/',
'block' => 'application/blocks/{$name}/',
'package' => 'packages/{$name}/',
'theme' => 'application/themes/{$name}/',
'update' => 'updates/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/ConcreteCMSInstaller.php 0000644 00000000627 15153464550 0023257 0 ustar 00 <?php
namespace Composer\Installers;
class ConcreteCMSInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'core' => 'concrete/',
'block' => 'application/blocks/{$name}/',
'package' => 'packages/{$name}/',
'theme' => 'application/themes/{$name}/',
'update' => 'updates/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php 0000644 00000001053 15153464550 0022374 0 ustar 00 <?php
namespace Composer\Installers;
class CroogoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'Plugin/{$name}/',
'theme' => 'View/Themed/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php 0000644 00000000341 15153464550 0022472 0 ustar 00 <?php
namespace Composer\Installers;
class DecibelInstaller extends BaseInstaller
{
/** @var array */
/** @var array<string, string> */
protected $locations = array(
'app' => 'app/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/DframeInstaller.php 0000644 00000000331 15153464550 0022340 0 ustar 00 <?php
namespace Composer\Installers;
class DframeInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$vendor}/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php 0000644 00000003005 15153464550 0022671 0 ustar 00 <?php
namespace Composer\Installers;
class DokuWikiInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'lib/plugins/{$name}/',
'template' => 'lib/tpl/{$name}/',
);
/**
* Format package name.
*
* For package type dokuwiki-plugin, cut off a trailing '-plugin',
* or leading dokuwiki_ if present.
*
* For package type dokuwiki-template, cut off a trailing '-template' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'dokuwiki-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'dokuwiki-template') {
return $this->inflectTemplateVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-plugin$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectTemplateVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-template$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php 0000644 00000000611 15153464550 0022701 0 ustar 00 <?php
namespace Composer\Installers;
/**
* Class DolibarrInstaller
*
* @package Composer\Installers
* @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
*/
class DolibarrInstaller extends BaseInstaller
{
//TODO: Add support for scripts and themes
/** @var array<string, string> */
protected $locations = array(
'module' => 'htdocs/custom/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php 0000644 00000001673 15153464550 0022403 0 ustar 00 <?php
namespace Composer\Installers;
class DrupalInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'core' => 'core/',
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
'library' => 'libraries/{$name}/',
'profile' => 'profiles/{$name}/',
'database-driver' => 'drivers/lib/Drupal/Driver/Database/{$name}/',
'drush' => 'drush/{$name}/',
'custom-theme' => 'themes/custom/{$name}/',
'custom-module' => 'modules/custom/{$name}/',
'custom-profile' => 'profiles/custom/{$name}/',
'drupal-multisite' => 'sites/{$name}/',
'console' => 'console/{$name}/',
'console-language' => 'console/language/{$name}/',
'config' => 'config/sync/',
'recipe' => 'recipes/{$name}',
);
}
vendor/composer/installers/src/Composer/Installers/ElggInstaller.php 0000644 00000000310 15153464550 0022015 0 ustar 00 <?php
namespace Composer\Installers;
class ElggInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'mod/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php 0000644 00000000530 15153464550 0022534 0 ustar 00 <?php
namespace Composer\Installers;
class EliasisInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'component' => 'components/{$name}/',
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$name}/',
'template' => 'templates/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php 0000644 00000001435 15153464550 0024435 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Package\PackageInterface;
class ExpressionEngineInstaller extends BaseInstaller
{
/** @var array<string, string> */
private $ee2Locations = array(
'addon' => 'system/expressionengine/third_party/{$name}/',
'theme' => 'themes/third_party/{$name}/',
);
/** @var array<string, string> */
private $ee3Locations = array(
'addon' => 'system/user/addons/{$name}/',
'theme' => 'themes/user/{$name}/',
);
public function getLocations(string $frameworkType): array
{
if ($frameworkType === 'ee2') {
$this->locations = $this->ee2Locations;
} else {
$this->locations = $this->ee3Locations;
}
return $this->locations;
}
}
vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php 0000644 00000000423 15153464550 0023227 0 ustar 00 <?php
namespace Composer\Installers;
class EzPlatformInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'meta-assets' => 'web/assets/ezplatform/',
'assets' => 'web/assets/ezplatform/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/ForkCMSInstaller.php 0000644 00000003460 15153464550 0022414 0 ustar 00 <?php
namespace Composer\Installers;
class ForkCMSInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = [
'module' => 'src/Modules/{$name}/',
'theme' => 'src/Themes/{$name}/'
];
/**
* Format package name.
*
* For package type fork-cms-module, cut off a trailing '-plugin' if present.
*
* For package type fork-cms-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'fork-cms-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'fork-cms-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^fork-cms-|-module|ForkCMS|ForkCms|Forkcms|forkcms|Module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); // replace hyphens with spaces
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); // make module name camelcased
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^fork-cms-|-theme|ForkCMS|ForkCms|Forkcms|forkcms|Theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']); // replace hyphens with spaces
$vars['name'] = str_replace(' ', '', ucwords($vars['name'])); // make theme name camelcased
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/FuelInstaller.php 0000644 00000000466 15153464550 0022046 0 ustar 00 <?php
namespace Composer\Installers;
class FuelInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'fuel/app/modules/{$name}/',
'package' => 'fuel/packages/{$name}/',
'theme' => 'fuel/app/themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php 0000644 00000000326 15153464550 0022551 0 ustar 00 <?php
namespace Composer\Installers;
class FuelphpInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'component' => 'components/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/GravInstaller.php 0000644 00000001306 15153464550 0022044 0 ustar 00 <?php
namespace Composer\Installers;
class GravInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'user/plugins/{$name}/',
'theme' => 'user/themes/{$name}/',
);
/**
* Format package name
*/
public function inflectPackageVars(array $vars): array
{
$restrictedWords = implode('|', array_keys($this->locations));
$vars['name'] = strtolower($vars['name']);
$vars['name'] = $this->pregReplace(
'/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
'$1',
$vars['name']
);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/HuradInstaller.php 0000644 00000001370 15153464550 0022211 0 ustar 00 <?php
namespace Composer\Installers;
class HuradInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'theme' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php 0000644 00000000513 15153464550 0022531 0 ustar 00 <?php
namespace Composer\Installers;
class ImageCMSInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'template' => 'templates/{$name}/',
'module' => 'application/modules/{$name}/',
'library' => 'application/libraries/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/Installer.php 0000644 00000024033 15153464550 0021226 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Composer;
use Composer\Installer\BinaryInstaller;
use Composer\Installer\LibraryInstaller;
use Composer\IO\IOInterface;
use Composer\Package\Package;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Util\Filesystem;
use React\Promise\PromiseInterface;
class Installer extends LibraryInstaller
{
/**
* Package types to installer class map
*
* @var array<string, string>
*/
private $supportedTypes = array(
'akaunting' => 'AkauntingInstaller',
'asgard' => 'AsgardInstaller',
'attogram' => 'AttogramInstaller',
'agl' => 'AglInstaller',
'annotatecms' => 'AnnotateCmsInstaller',
'bitrix' => 'BitrixInstaller',
'botble' => 'BotbleInstaller',
'bonefish' => 'BonefishInstaller',
'cakephp' => 'CakePHPInstaller',
'chef' => 'ChefInstaller',
'civicrm' => 'CiviCrmInstaller',
'ccframework' => 'ClanCatsFrameworkInstaller',
'cockpit' => 'CockpitInstaller',
'codeigniter' => 'CodeIgniterInstaller',
'concrete5' => 'Concrete5Installer',
'concretecms' => 'ConcreteCMSInstaller',
'croogo' => 'CroogoInstaller',
'dframe' => 'DframeInstaller',
'dokuwiki' => 'DokuWikiInstaller',
'dolibarr' => 'DolibarrInstaller',
'decibel' => 'DecibelInstaller',
'drupal' => 'DrupalInstaller',
'elgg' => 'ElggInstaller',
'eliasis' => 'EliasisInstaller',
'ee3' => 'ExpressionEngineInstaller',
'ee2' => 'ExpressionEngineInstaller',
'ezplatform' => 'EzPlatformInstaller',
'fork' => 'ForkCMSInstaller',
'fuel' => 'FuelInstaller',
'fuelphp' => 'FuelphpInstaller',
'grav' => 'GravInstaller',
'hurad' => 'HuradInstaller',
'tastyigniter' => 'TastyIgniterInstaller',
'imagecms' => 'ImageCMSInstaller',
'itop' => 'ItopInstaller',
'kanboard' => 'KanboardInstaller',
'known' => 'KnownInstaller',
'kodicms' => 'KodiCMSInstaller',
'kohana' => 'KohanaInstaller',
'lms' => 'LanManagementSystemInstaller',
'laravel' => 'LaravelInstaller',
'lavalite' => 'LavaLiteInstaller',
'lithium' => 'LithiumInstaller',
'magento' => 'MagentoInstaller',
'majima' => 'MajimaInstaller',
'mantisbt' => 'MantisBTInstaller',
'mako' => 'MakoInstaller',
'matomo' => 'MatomoInstaller',
'maya' => 'MayaInstaller',
'mautic' => 'MauticInstaller',
'mediawiki' => 'MediaWikiInstaller',
'miaoxing' => 'MiaoxingInstaller',
'microweber' => 'MicroweberInstaller',
'modulework' => 'MODULEWorkInstaller',
'modx' => 'ModxInstaller',
'modxevo' => 'MODXEvoInstaller',
'moodle' => 'MoodleInstaller',
'october' => 'OctoberInstaller',
'ontowiki' => 'OntoWikiInstaller',
'oxid' => 'OxidInstaller',
'osclass' => 'OsclassInstaller',
'pxcms' => 'PxcmsInstaller',
'phpbb' => 'PhpBBInstaller',
'piwik' => 'PiwikInstaller',
'plentymarkets'=> 'PlentymarketsInstaller',
'ppi' => 'PPIInstaller',
'puppet' => 'PuppetInstaller',
'radphp' => 'RadPHPInstaller',
'phifty' => 'PhiftyInstaller',
'porto' => 'PortoInstaller',
'processwire' => 'ProcessWireInstaller',
'quicksilver' => 'PantheonInstaller',
'redaxo' => 'RedaxoInstaller',
'redaxo5' => 'Redaxo5Installer',
'reindex' => 'ReIndexInstaller',
'roundcube' => 'RoundcubeInstaller',
'shopware' => 'ShopwareInstaller',
'sitedirect' => 'SiteDirectInstaller',
'silverstripe' => 'SilverStripeInstaller',
'smf' => 'SMFInstaller',
'starbug' => 'StarbugInstaller',
'sydes' => 'SyDESInstaller',
'sylius' => 'SyliusInstaller',
'tao' => 'TaoInstaller',
'thelia' => 'TheliaInstaller',
'tusk' => 'TuskInstaller',
'userfrosting' => 'UserFrostingInstaller',
'vanilla' => 'VanillaInstaller',
'whmcs' => 'WHMCSInstaller',
'winter' => 'WinterInstaller',
'wolfcms' => 'WolfCMSInstaller',
'wordpress' => 'WordPressInstaller',
'yawik' => 'YawikInstaller',
'zend' => 'ZendInstaller',
'zikula' => 'ZikulaInstaller',
'prestashop' => 'PrestashopInstaller'
);
/**
* Disables installers specified in main composer extra installer-disable
* list
*/
public function __construct(
IOInterface $io,
Composer $composer,
string $type = 'library',
?Filesystem $filesystem = null,
?BinaryInstaller $binaryInstaller = null
) {
parent::__construct($io, $composer, $type, $filesystem, $binaryInstaller);
$this->removeDisabledInstallers();
}
/**
* {@inheritDoc}
*/
public function getInstallPath(PackageInterface $package)
{
$type = $package->getType();
$frameworkType = $this->findFrameworkType($type);
if ($frameworkType === false) {
throw new \InvalidArgumentException(
'Sorry the package type of this package is not yet supported.'
);
}
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
/**
* @var BaseInstaller
*/
$installer = new $class($package, $this->composer, $this->getIO());
$path = $installer->getInstallPath($package, $frameworkType);
if (!$this->filesystem->isAbsolutePath($path)) {
$path = getcwd() . '/' . $path;
}
return $path;
}
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
{
$installPath = $this->getPackageBasePath($package);
$io = $this->io;
$outputStatus = function () use ($io, $installPath) {
$io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
};
$promise = parent::uninstall($repo, $package);
// Composer v2 might return a promise here
if ($promise instanceof PromiseInterface) {
return $promise->then($outputStatus);
}
// If not, execute the code right away as parent::uninstall executed synchronously (composer v1, or v2 without async)
$outputStatus();
return null;
}
/**
* {@inheritDoc}
*
* @param string $packageType
*/
public function supports($packageType)
{
$frameworkType = $this->findFrameworkType($packageType);
if ($frameworkType === false) {
return false;
}
$locationPattern = $this->getLocationPattern($frameworkType);
return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
}
/**
* Finds a supported framework type if it exists and returns it
*
* @return string|false
*/
protected function findFrameworkType(string $type)
{
krsort($this->supportedTypes);
foreach ($this->supportedTypes as $key => $val) {
if ($key === substr($type, 0, strlen($key))) {
return substr($type, 0, strlen($key));
}
}
return false;
}
/**
* Get the second part of the regular expression to check for support of a
* package type
*/
protected function getLocationPattern(string $frameworkType): string
{
$pattern = null;
if (!empty($this->supportedTypes[$frameworkType])) {
$frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
/** @var BaseInstaller $framework */
$framework = new $frameworkClass(new Package('dummy/pkg', '1.0.0.0', '1.0.0'), $this->composer, $this->getIO());
$locations = array_keys($framework->getLocations($frameworkType));
if ($locations) {
$pattern = '(' . implode('|', $locations) . ')';
}
}
return $pattern ?: '(\w+)';
}
private function getIO(): IOInterface
{
return $this->io;
}
/**
* Look for installers set to be disabled in composer's extra config and
* remove them from the list of supported installers.
*
* Globals:
* - true, "all", and "*" - disable all installers.
* - false - enable all installers (useful with
* wikimedia/composer-merge-plugin or similar)
*/
protected function removeDisabledInstallers(): void
{
$extra = $this->composer->getPackage()->getExtra();
if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
// No installers are disabled
return;
}
// Get installers to disable
$disable = $extra['installer-disable'];
// Ensure $disabled is an array
if (!is_array($disable)) {
$disable = array($disable);
}
// Check which installers should be disabled
$all = array(true, "all", "*");
$intersect = array_intersect($all, $disable);
if (!empty($intersect)) {
// Disable all installers
$this->supportedTypes = array();
return;
}
// Disable specified installers
foreach ($disable as $key => $installer) {
if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
unset($this->supportedTypes[$installer]);
}
}
}
}
vendor/composer/installers/src/Composer/Installers/ItopInstaller.php 0000644 00000000325 15153464550 0022060 0 ustar 00 <?php
namespace Composer\Installers;
class ItopInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'extension' => 'extensions/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php 0000644 00000000517 15153464550 0022671 0 ustar 00 <?php
namespace Composer\Installers;
/**
*
* Installer for kanboard plugins
*
* kanboard.net
*
* Class KanboardInstaller
* @package Composer\Installers
*/
class KanboardInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/KnownInstaller.php 0000644 00000000460 15153464550 0022241 0 ustar 00 <?php
namespace Composer\Installers;
class KnownInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'IdnoPlugins/{$name}/',
'theme' => 'Themes/{$name}/',
'console' => 'ConsolePlugins/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php 0000644 00000000403 15153464550 0022373 0 ustar 00 <?php
namespace Composer\Installers;
class KodiCMSInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'cms/plugins/{$name}/',
'media' => 'cms/media/vendor/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php 0000644 00000000316 15153464550 0022346 0 ustar 00 <?php
namespace Composer\Installers;
class KohanaInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php 0000644 00000001416 15153464550 0025063 0 ustar 00 <?php
namespace Composer\Installers;
class LanManagementSystemInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'template' => 'templates/{$name}/',
'document-template' => 'documents/templates/{$name}/',
'userpanel-module' => 'userpanel/modules/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php 0000644 00000000322 15153464550 0022530 0 ustar 00 <?php
namespace Composer\Installers;
class LaravelInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'library' => 'libraries/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php 0000644 00000000413 15153464550 0022644 0 ustar 00 <?php
namespace Composer\Installers;
class LavaLiteInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'package' => 'packages/{$vendor}/{$name}/',
'theme' => 'public/themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php 0000644 00000000405 15153464550 0022557 0 ustar 00 <?php
namespace Composer\Installers;
class LithiumInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'library' => 'libraries/{$name}/',
'source' => 'libraries/_source/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php 0000644 00000000325 15153464550 0022775 0 ustar 00 <?php
namespace Composer\Installers;
class MODULEWorkInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php 0000644 00000001010 15153464550 0022356 0 ustar 00 <?php
namespace Composer\Installers;
/**
* An installer to handle MODX Evolution specifics when installing packages.
*/
class MODXEvoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'snippet' => 'assets/snippets/{$name}/',
'plugin' => 'assets/plugins/{$name}/',
'module' => 'assets/modules/{$name}/',
'template' => 'assets/templates/{$name}/',
'lib' => 'assets/lib/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php 0000644 00000000470 15153464550 0022540 0 ustar 00 <?php
namespace Composer\Installers;
class MagentoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'theme' => 'app/design/frontend/{$name}/',
'skin' => 'skin/frontend/default/{$name}/',
'library' => 'lib/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php 0000644 00000002147 15153464550 0022347 0 ustar 00 <?php
namespace Composer\Installers;
/**
* Plugin/theme installer for majima
* @author David Neustadt
*/
class MajimaInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Transforms the names
*
* @param array<string, string> $vars
* @return array<string, string>
*/
public function inflectPackageVars(array $vars): array
{
return $this->correctPluginName($vars);
}
/**
* Change hyphenated names to camelcase
*
* @param array<string, string> $vars
* @return array<string, string>
*/
private function correctPluginName(array $vars): array
{
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
if (null === $camelCasedName) {
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
}
$vars['name'] = ucfirst($camelCasedName);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/MakoInstaller.php 0000644 00000000322 15153464550 0022031 0 ustar 00 <?php
namespace Composer\Installers;
class MakoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'package' => 'app/packages/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/MantisBTInstaller.php 0000644 00000001202 15153464550 0022621 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\DependencyResolver\Pool;
class MantisBTInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/MatomoInstaller.php 0000644 00000001235 15153464550 0022402 0 ustar 00 <?php
namespace Composer\Installers;
/**
* Class MatomoInstaller
*
* @package Composer\Installers
*/
class MatomoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/MauticInstaller.php 0000644 00000002217 15153464550 0022371 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Package\PackageInterface;
class MauticInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'theme' => 'themes/{$name}/',
'core' => 'app/',
);
private function getDirectoryName(): string
{
$extra = $this->package->getExtra();
if (!empty($extra['install-directory-name'])) {
return $extra['install-directory-name'];
}
return $this->toCamelCase($this->package->getPrettyName());
}
private function toCamelCase(string $packageName): string
{
return str_replace(' ', '', ucwords(str_replace('-', ' ', basename($packageName))));
}
/**
* Format package name of mautic-plugins to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] == 'mautic-plugin' || $vars['type'] == 'mautic-theme') {
$directoryName = $this->getDirectoryName();
$vars['name'] = $directoryName;
}
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/MayaInstaller.php 0000644 00000001666 15153464550 0022045 0 ustar 00 <?php
namespace Composer\Installers;
class MayaInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
);
/**
* Format package name.
*
* For package type maya-module, cut off a trailing '-module' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'maya-module') {
return $this->inflectModuleVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php 0000644 00000003041 15153464550 0023006 0 ustar 00 <?php
namespace Composer\Installers;
class MediaWikiInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'core' => 'core/',
'extension' => 'extensions/{$name}/',
'skin' => 'skins/{$name}/',
);
/**
* Format package name.
*
* For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
* to CamelCase keeping existing uppercase chars.
*
* For package type mediawiki-skin, cut off a trailing '-skin' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'mediawiki-extension') {
return $this->inflectExtensionVars($vars);
}
if ($vars['type'] === 'mediawiki-skin') {
return $this->inflectSkinVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectExtensionVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-extension$/', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectSkinVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-skin$/', '', $vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php 0000644 00000000320 15153464550 0022713 0 ustar 00 <?php
namespace Composer\Installers;
class MiaoxingInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php 0000644 00000012226 15153464550 0023246 0 ustar 00 <?php
namespace Composer\Installers;
class MicroweberInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'userfiles/modules/{$install_item_dir}/',
'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
'template' => 'userfiles/templates/{$install_item_dir}/',
'element' => 'userfiles/elements/{$install_item_dir}/',
'vendor' => 'vendor/{$install_item_dir}/',
'components' => 'components/{$install_item_dir}/'
);
/**
* Format package name.
*
* For package type microweber-module, cut off a trailing '-module' if present
*
* For package type microweber-template, cut off a trailing '-template' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($this->package->getTargetDir() !== null && $this->package->getTargetDir() !== '') {
$vars['install_item_dir'] = $this->package->getTargetDir();
} else {
$vars['install_item_dir'] = $vars['name'];
if ($vars['type'] === 'microweber-template') {
return $this->inflectTemplateVars($vars);
}
if ($vars['type'] === 'microweber-templates') {
return $this->inflectTemplatesVars($vars);
}
if ($vars['type'] === 'microweber-core') {
return $this->inflectCoreVars($vars);
}
if ($vars['type'] === 'microweber-adapter') {
return $this->inflectCoreVars($vars);
}
if ($vars['type'] === 'microweber-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'microweber-modules') {
return $this->inflectModulesVars($vars);
}
if ($vars['type'] === 'microweber-skin') {
return $this->inflectSkinVars($vars);
}
if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
return $this->inflectElementVars($vars);
}
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectTemplateVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-template$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/template-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectTemplatesVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-templates$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/templates-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectCoreVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-providers$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/-provider$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/-adapter$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModuleVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-module$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/module-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModulesVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-modules$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/modules-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectSkinVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-skin$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/skin-$/', '', $vars['install_item_dir']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectElementVars(array $vars): array
{
$vars['install_item_dir'] = $this->pregReplace('/-elements$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/elements-$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/-element$/', '', $vars['install_item_dir']);
$vars['install_item_dir'] = $this->pregReplace('/element-$/', '', $vars['install_item_dir']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/ModxInstaller.php 0000644 00000000433 15153464550 0022054 0 ustar 00 <?php
namespace Composer\Installers;
/**
* An installer to handle MODX specifics when installing packages.
*/
class ModxInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'extra' => 'core/packages/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php 0000644 00000007452 15153464550 0022374 0 ustar 00 <?php
namespace Composer\Installers;
class MoodleInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'mod' => 'mod/{$name}/',
'admin_report' => 'admin/report/{$name}/',
'atto' => 'lib/editor/atto/plugins/{$name}/',
'tool' => 'admin/tool/{$name}/',
'assignment' => 'mod/assignment/type/{$name}/',
'assignsubmission' => 'mod/assign/submission/{$name}/',
'assignfeedback' => 'mod/assign/feedback/{$name}/',
'antivirus' => 'lib/antivirus/{$name}/',
'auth' => 'auth/{$name}/',
'availability' => 'availability/condition/{$name}/',
'block' => 'blocks/{$name}/',
'booktool' => 'mod/book/tool/{$name}/',
'cachestore' => 'cache/stores/{$name}/',
'cachelock' => 'cache/locks/{$name}/',
'calendartype' => 'calendar/type/{$name}/',
'communication' => 'communication/provider/{$name}/',
'customfield' => 'customfield/field/{$name}/',
'fileconverter' => 'files/converter/{$name}/',
'format' => 'course/format/{$name}/',
'coursereport' => 'course/report/{$name}/',
'contenttype' => 'contentbank/contenttype/{$name}/',
'customcertelement' => 'mod/customcert/element/{$name}/',
'datafield' => 'mod/data/field/{$name}/',
'dataformat' => 'dataformat/{$name}/',
'datapreset' => 'mod/data/preset/{$name}/',
'editor' => 'lib/editor/{$name}/',
'enrol' => 'enrol/{$name}/',
'filter' => 'filter/{$name}/',
'forumreport' => 'mod/forum/report/{$name}/',
'gradeexport' => 'grade/export/{$name}/',
'gradeimport' => 'grade/import/{$name}/',
'gradereport' => 'grade/report/{$name}/',
'gradingform' => 'grade/grading/form/{$name}/',
'h5plib' => 'h5p/h5plib/{$name}/',
'local' => 'local/{$name}/',
'logstore' => 'admin/tool/log/store/{$name}/',
'ltisource' => 'mod/lti/source/{$name}/',
'ltiservice' => 'mod/lti/service/{$name}/',
'media' => 'media/player/{$name}/',
'message' => 'message/output/{$name}/',
'mlbackend' => 'lib/mlbackend/{$name}/',
'mnetservice' => 'mnet/service/{$name}/',
'paygw' => 'payment/gateway/{$name}/',
'plagiarism' => 'plagiarism/{$name}/',
'portfolio' => 'portfolio/{$name}/',
'qbank' => 'question/bank/{$name}/',
'qbehaviour' => 'question/behaviour/{$name}/',
'qformat' => 'question/format/{$name}/',
'qtype' => 'question/type/{$name}/',
'quizaccess' => 'mod/quiz/accessrule/{$name}/',
'quiz' => 'mod/quiz/report/{$name}/',
'report' => 'report/{$name}/',
'repository' => 'repository/{$name}/',
'scormreport' => 'mod/scorm/report/{$name}/',
'search' => 'search/engine/{$name}/',
'theme' => 'theme/{$name}/',
'tiny' => 'lib/editor/tiny/plugins/{$name}/',
'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
'profilefield' => 'user/profile/field/{$name}/',
'webservice' => 'webservice/{$name}/',
'workshopallocation' => 'mod/workshop/allocation/{$name}/',
'workshopeval' => 'mod/workshop/eval/{$name}/',
'workshopform' => 'mod/workshop/form/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php 0000644 00000003034 15153464550 0022542 0 ustar 00 <?php
namespace Composer\Installers;
class OctoberInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/',
'theme' => 'themes/{$vendor}-{$name}/'
);
/**
* Format package name.
*
* For package type october-plugin, cut off a trailing '-plugin' if present.
*
* For package type october-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'october-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'october-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^oc-|-plugin$/', '', $vars['name']);
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^oc-|-theme$/', '', $vars['name']);
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php 0000644 00000001432 15153464550 0022710 0 ustar 00 <?php
namespace Composer\Installers;
class OntoWikiInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'extension' => 'extensions/{$name}/',
'theme' => 'extensions/themes/{$name}/',
'translation' => 'extensions/translations/{$name}/',
);
/**
* Format package name to lower case and remove ".ontowiki" suffix
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($vars['name']);
$vars['name'] = $this->pregReplace('/.ontowiki$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
$vars['name'] = $this->pregReplace('/-translation$/', '', $vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php 0000644 00000000507 15153464550 0022556 0 ustar 00 <?php
namespace Composer\Installers;
class OsclassInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'oc-content/plugins/{$name}/',
'theme' => 'oc-content/themes/{$name}/',
'language' => 'oc-content/languages/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/OxidInstaller.php 0000644 00000002666 15153464550 0022062 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Package\PackageInterface;
class OxidInstaller extends BaseInstaller
{
const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'application/views/{$name}/',
'out' => 'out/{$name}/',
);
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
{
$installPath = parent::getInstallPath($package, $frameworkType);
$type = $this->package->getType();
if ($type === 'oxid-module') {
$this->prepareVendorDirectory($installPath);
}
return $installPath;
}
/**
* Makes sure there is a vendormetadata.php file inside
* the vendor folder if there is a vendor folder.
*/
protected function prepareVendorDirectory(string $installPath): void
{
$matches = '';
$hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
if (!$hasVendorDirectory) {
return;
}
$vendorDirectory = $matches['vendor'];
$vendorPath = getcwd() . '/modules/' . $vendorDirectory;
if (!file_exists($vendorPath)) {
mkdir($vendorPath, 0755, true);
}
$vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
touch($vendorMetaDataPath);
}
}
vendor/composer/installers/src/Composer/Installers/PPIInstaller.php 0000644 00000000313 15153464550 0021572 0 ustar 00 <?php
namespace Composer\Installers;
class PPIInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php 0000644 00000000446 15153464550 0022725 0 ustar 00 <?php
namespace Composer\Installers;
class PantheonInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'script' => 'web/private/scripts/quicksilver/{$name}',
'module' => 'web/private/scripts/quicksilver/{$name}',
);
}
vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php 0000644 00000000447 15153464550 0022415 0 ustar 00 <?php
namespace Composer\Installers;
class PhiftyInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'bundle' => 'bundles/{$name}/',
'library' => 'libraries/{$name}/',
'framework' => 'frameworks/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php 0000644 00000000454 15153464550 0022103 0 ustar 00 <?php
namespace Composer\Installers;
class PhpBBInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'extension' => 'ext/{$vendor}/{$name}/',
'language' => 'language/{$name}/',
'style' => 'styles/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php 0000644 00000001233 15153464550 0022227 0 ustar 00 <?php
namespace Composer\Installers;
/**
* Class PiwikInstaller
*
* @package Composer\Installers
*/
class PiwikInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php 0000644 00000001246 15153464550 0024012 0 ustar 00 <?php
namespace Composer\Installers;
class PlentymarketsInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => '{$name}/'
);
/**
* Remove hyphen, "plugin" and format to camelcase
*/
public function inflectPackageVars(array $vars): array
{
$nameBits = explode("-", $vars['name']);
foreach ($nameBits as $key => $name) {
$nameBits[$key] = ucfirst($name);
if (strcasecmp($name, "Plugin") == 0) {
unset($nameBits[$key]);
}
}
$vars['name'] = implode('', $nameBits);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/Plugin.php 0000644 00000001270 15153464550 0020525 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
class Plugin implements PluginInterface
{
/** @var Installer */
private $installer;
public function activate(Composer $composer, IOInterface $io): void
{
$this->installer = new Installer($io, $composer);
$composer->getInstallationManager()->addInstaller($this->installer);
}
public function deactivate(Composer $composer, IOInterface $io): void
{
$composer->getInstallationManager()->removeInstaller($this->installer);
}
public function uninstall(Composer $composer, IOInterface $io): void
{
}
}
vendor/composer/installers/src/Composer/Installers/PortoInstaller.php 0000644 00000000327 15153464550 0022252 0 ustar 00 <?php
namespace Composer\Installers;
class PortoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'container' => 'app/Containers/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php 0000644 00000000371 15153464550 0023276 0 ustar 00 <?php
namespace Composer\Installers;
class PrestashopInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php 0000644 00000001144 15153464550 0023412 0 ustar 00 <?php
namespace Composer\Installers;
class ProcessWireInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'site/modules/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php 0000644 00000000317 15153464550 0022423 0 ustar 00 <?php
namespace Composer\Installers;
class PuppetInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php 0000644 00000004154 15153464550 0022243 0 ustar 00 <?php
namespace Composer\Installers;
class PxcmsInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'app/Modules/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format package name.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'pxcms-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'pxcms-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* For package type pxcms-module, cut off a trailing '-plugin' if present.
*
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
$vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
$vars['name'] = $this->pregReplace('/-module$/', '', $vars['name']); // strip out -module
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
$vars['name'] = ucwords($vars['name']); // make module name camelcased
return $vars;
}
/**
* For package type pxcms-module, cut off a trailing '-plugin' if present.
*
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
$vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']); // strip out -theme
$vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
$vars['name'] = ucwords($vars['name']); // make module name camelcased
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php 0000644 00000001315 15153464550 0022223 0 ustar 00 <?php
namespace Composer\Installers;
class RadPHPInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'bundle' => 'src/{$name}/'
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$nameParts = explode('/', $vars['name']);
foreach ($nameParts as &$value) {
$value = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $value));
$value = str_replace(array('-', '_'), ' ', $value);
$value = str_replace(' ', '', ucwords($value));
}
$vars['name'] = implode('/', $nameParts);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php 0000644 00000000373 15153464550 0022506 0 ustar 00 <?php
namespace Composer\Installers;
class ReIndexInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'theme' => 'themes/{$name}/',
'plugin' => 'plugins/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php 0000644 00000000453 15153464550 0022456 0 ustar 00 <?php
namespace Composer\Installers;
class Redaxo5Installer extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'addon' => 'redaxo/src/addons/{$name}/',
'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php 0000644 00000000462 15153464550 0022371 0 ustar 00 <?php
namespace Composer\Installers;
class RedaxoInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'addon' => 'redaxo/include/addons/{$name}/',
'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php 0000644 00000000706 15153464550 0023076 0 ustar 00 <?php
namespace Composer\Installers;
class RoundcubeInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
);
/**
* Lowercase name and changes the name to a underscores
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/SMFInstaller.php 0000644 00000000361 15153464550 0021572 0 ustar 00 <?php
namespace Composer\Installers;
class SMFInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'Sources/{$name}/',
'theme' => 'Themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php 0000644 00000003547 15153464550 0022746 0 ustar 00 <?php
namespace Composer\Installers;
/**
* Plugin/theme installer for shopware
* @author Benjamin Boit
*/
class ShopwareInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
'theme' => 'templates/{$name}/',
'plugin' => 'custom/plugins/{$name}/',
'frontend-theme' => 'themes/Frontend/{$name}/',
);
/**
* Transforms the names
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'shopware-theme') {
return $this->correctThemeName($vars);
}
return $this->correctPluginName($vars);
}
/**
* Changes the name to a camelcased combination of vendor and name
*
* @param array<string, string> $vars
* @return array<string, string>
*/
private function correctPluginName(array $vars): array
{
$camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
return strtoupper($matches[0][1]);
}, $vars['name']);
if (null === $camelCasedName) {
throw new \RuntimeException('Failed to run preg_replace_callback: '.preg_last_error());
}
$vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
return $vars;
}
/**
* Changes the name to a underscore separated name
*
* @param array<string, string> $vars
* @return array<string, string>
*/
private function correctThemeName(array $vars): array
{
$vars['name'] = str_replace('-', '_', $vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php 0000644 00000002030 15153464550 0023573 0 ustar 00 <?php
namespace Composer\Installers;
use Composer\Package\PackageInterface;
class SilverStripeInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => '{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Return the install path based on package type.
*
* Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
* must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
*/
public function getInstallPath(PackageInterface $package, string $frameworkType = ''): string
{
if (
$package->getName() == 'silverstripe/framework'
&& preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
&& version_compare($package->getVersion(), '2.999.999') < 0
) {
return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
}
return parent::getInstallPath($package, $frameworkType);
}
}
vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php 0000644 00000001614 15153464550 0023206 0 ustar 00 <?php
namespace Composer\Installers;
class SiteDirectInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$vendor}/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/'
);
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
public function inflectPackageVars(array $vars): array
{
return $this->parseVars($vars);
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function parseVars(array $vars): array
{
$vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/StarbugInstaller.php 0000644 00000000530 15153464550 0022552 0 ustar 00 <?php
namespace Composer\Installers;
class StarbugInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
'theme' => 'themes/{$name}/',
'custom-module' => 'app/modules/{$name}/',
'custom-theme' => 'app/themes/{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php 0000644 00000002660 15153464550 0022100 0 ustar 00 <?php
namespace Composer\Installers;
class SyDESInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'app/modules/{$name}/',
'theme' => 'themes/{$name}/',
);
/**
* Format module name.
*
* Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] == 'sydes-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'sydes-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
public function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/(^sydes-|-module$)/i', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/(^sydes-|-theme$)/', '', $vars['name']);
$vars['name'] = strtolower($vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/SyliusInstaller.php 0000644 00000000314 15153464550 0022433 0 ustar 00 <?php
namespace Composer\Installers;
class SyliusInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'theme' => 'themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/TaoInstaller.php 0000644 00000001507 15153464550 0021673 0 ustar 00 <?php
namespace Composer\Installers;
/**
* An installer to handle TAO extensions.
*/
class TaoInstaller extends BaseInstaller
{
const EXTRA_TAO_EXTENSION_NAME = 'tao-extension-name';
/** @var array<string, string> */
protected $locations = array(
'extension' => '{$name}'
);
public function inflectPackageVars(array $vars): array
{
$extra = $this->package->getExtra();
if (array_key_exists(self::EXTRA_TAO_EXTENSION_NAME, $extra)) {
$vars['name'] = $extra[self::EXTRA_TAO_EXTENSION_NAME];
return $vars;
}
$vars['name'] = str_replace('extension-', '', $vars['name']);
$vars['name'] = str_replace('-', ' ', $vars['name']);
$vars['name'] = lcfirst(str_replace(' ', '', ucwords($vars['name'])));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php 0000644 00000004555 15153464550 0023604 0 ustar 00 <?php
namespace Composer\Installers;
class TastyIgniterInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = [
'module' => 'app/{$name}/',
'extension' => 'extensions/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/',
];
/**
* Format package name.
*
* Cut off leading 'ti-ext-' or 'ti-theme-' if present.
* Strip vendor name of characters that is not alphanumeric or an underscore
*
*/
public function inflectPackageVars(array $vars): array
{
$extra = $this->package->getExtra();
if ($vars['type'] === 'tastyigniter-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'tastyigniter-extension') {
return $this->inflectExtensionVars($vars, $extra);
}
if ($vars['type'] === 'tastyigniter-theme') {
return $this->inflectThemeVars($vars, $extra);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^ti-module-/', '', $vars['name']);
return $vars;
}
/**
* @param array<string, string> $vars
* @param array<string, mixed> $extra
* @return array<string, string>
*/
protected function inflectExtensionVars(array $vars, array $extra): array
{
if (!empty($extra['tastyigniter-extension']['code'])) {
$parts = explode('.', $extra['tastyigniter-extension']['code']);
$vars['vendor'] = (string)$parts[0];
$vars['name'] = (string)($parts[1] ?? '');
}
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
$vars['name'] = $this->pregReplace('/^ti-ext-/', '', $vars['name']);
return $vars;
}
/**
* @param array<string, string> $vars
* @param array<string, mixed> $extra
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars, array $extra): array
{
if (!empty($extra['tastyigniter-theme']['code'])) {
$vars['name'] = $extra['tastyigniter-theme']['code'];
}
$vars['name'] = $this->pregReplace('/^ti-theme-/', '', $vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php 0000644 00000000653 15153464550 0022357 0 ustar 00 <?php
namespace Composer\Installers;
class TheliaInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'local/modules/{$name}/',
'frontoffice-template' => 'templates/frontOffice/{$name}/',
'backoffice-template' => 'templates/backOffice/{$name}/',
'email-template' => 'templates/email/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/TuskInstaller.php 0000644 00000000624 15153464550 0022075 0 ustar 00 <?php
namespace Composer\Installers;
/**
* Composer installer for 3rd party Tusk utilities
* @author Drew Ewing <drew@phenocode.com>
*/
class TuskInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'task' => '.tusk/tasks/{$name}/',
'command' => '.tusk/commands/{$name}/',
'asset' => 'assets/tusk/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php 0000644 00000000334 15153464550 0023577 0 ustar 00 <?php
namespace Composer\Installers;
class UserFrostingInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'sprinkle' => 'app/sprinkles/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php 0000644 00000000374 15153464550 0022537 0 ustar 00 <?php
namespace Composer\Installers;
class VanillaInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'plugins/{$name}/',
'theme' => 'themes/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php 0000644 00000003107 15153464550 0022222 0 ustar 00 <?php
namespace Composer\Installers;
class VgmcpInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'bundle' => 'src/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
);
/**
* Format package name.
*
* For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
*
* For package type vgmcp-theme, cut off a trailing '-theme' if present.
*
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'vgmcp-bundle') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'vgmcp-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-bundle$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/-theme$/', '', $vars['name']);
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php 0000644 00000001554 15153464550 0022033 0 ustar 00 <?php
namespace Composer\Installers;
class WHMCSInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'addons' => 'modules/addons/{$vendor}_{$name}/',
'fraud' => 'modules/fraud/{$vendor}_{$name}/',
'gateways' => 'modules/gateways/{$vendor}_{$name}/',
'notifications' => 'modules/notifications/{$vendor}_{$name}/',
'registrars' => 'modules/registrars/{$vendor}_{$name}/',
'reports' => 'modules/reports/{$vendor}_{$name}/',
'security' => 'modules/security/{$vendor}_{$name}/',
'servers' => 'modules/servers/{$vendor}_{$name}/',
'social' => 'modules/social/{$vendor}_{$name}/',
'support' => 'modules/support/{$vendor}_{$name}/',
'templates' => 'templates/{$vendor}_{$name}/',
'includes' => 'includes/{$vendor}_{$name}/'
);
}
vendor/composer/installers/src/Composer/Installers/WinterInstaller.php 0000644 00000003507 15153464550 0022422 0 ustar 00 <?php
namespace Composer\Installers;
class WinterInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$name}/',
'plugin' => 'plugins/{$vendor}/{$name}/',
'theme' => 'themes/{$name}/'
);
/**
* Format package name.
*
* For package type winter-plugin, cut off a trailing '-plugin' if present.
*
* For package type winter-theme, cut off a trailing '-theme' if present.
*/
public function inflectPackageVars(array $vars): array
{
if ($vars['type'] === 'winter-module') {
return $this->inflectModuleVars($vars);
}
if ($vars['type'] === 'winter-plugin') {
return $this->inflectPluginVars($vars);
}
if ($vars['type'] === 'winter-theme') {
return $this->inflectThemeVars($vars);
}
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectModuleVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^wn-|-module$/', '', $vars['name']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectPluginVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^wn-|-plugin$/', '', $vars['name']);
$vars['vendor'] = $this->pregReplace('/[^a-z0-9_]/i', '', $vars['vendor']);
return $vars;
}
/**
* @param array<string, string> $vars
* @return array<string, string>
*/
protected function inflectThemeVars(array $vars): array
{
$vars['name'] = $this->pregReplace('/^wn-|-theme$/', '', $vars['name']);
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php 0000644 00000000324 15153464550 0022416 0 ustar 00 <?php
namespace Composer\Installers;
class WolfCMSInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'wolf/plugins/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php 0000644 00000000573 15153464550 0023102 0 ustar 00 <?php
namespace Composer\Installers;
class WordPressInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'plugin' => 'wp-content/plugins/{$name}/',
'theme' => 'wp-content/themes/{$name}/',
'muplugin' => 'wp-content/mu-plugins/{$name}/',
'dropin' => 'wp-content/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/YawikInstaller.php 0000644 00000001130 15153464550 0022224 0 ustar 00 <?php
namespace Composer\Installers;
class YawikInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'module/{$name}/',
);
/**
* Format package name to CamelCase
*/
public function inflectPackageVars(array $vars): array
{
$vars['name'] = strtolower($this->pregReplace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
$vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
$vars['name'] = str_replace(' ', '', ucwords($vars['name']));
return $vars;
}
}
vendor/composer/installers/src/Composer/Installers/ZendInstaller.php 0000644 00000000445 15153464550 0022050 0 ustar 00 <?php
namespace Composer\Installers;
class ZendInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'library' => 'library/{$name}/',
'extra' => 'extras/library/{$name}/',
'module' => 'module/{$name}/',
);
}
vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php 0000644 00000000410 15153464551 0022400 0 ustar 00 <?php
namespace Composer\Installers;
class ZikulaInstaller extends BaseInstaller
{
/** @var array<string, string> */
protected $locations = array(
'module' => 'modules/{$vendor}-{$name}/',
'theme' => 'themes/{$vendor}-{$name}/'
);
}
vendor/composer/installers/src/bootstrap.php 0000644 00000001040 15153464551 0015371 0 ustar 00 <?php
use Composer\Autoload\ClassLoader;
function includeIfExists(string $file): ?ClassLoader
{
if (file_exists($file)) {
return include $file;
}
return null;
}
if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
'php composer.phar install'.PHP_EOL);
}
return $loader;
vendor/composer/platform_check.php 0000644 00000001635 15153464551 0013400 0 ustar 00 <?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70400)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}