composer.lock000064400000056346147177211530007273 0ustar00{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "943677dd40de26b4cb25b4422817645b", "packages": [], "packages-dev": [ { "name": "composer/installers", "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35", "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": "^7.2 || ^8.0" }, "require-dev": { "composer/composer": "1.6.* || ^2.0", "composer/semver": "^1 || ^3", "phpstan/phpstan": "^0.12.55", "phpstan/phpstan-phpunit": "^0.12.16", "symfony/phpunit-bridge": "^5.3", "symfony/process": "^5" }, "type": "composer-plugin", "extra": { "class": "Composer\\Installers\\Plugin", "branch-alias": { "dev-main": "2.x-dev" }, "plugin-modifies-install-path": true }, "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", "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.2.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" } ], "time": "2022-08-20T06:45:11+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", "reference": "4be43904336affa5c2f70744a348312336afd0da" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", "reference": "4be43904336affa5c2f70744a348312336afd0da", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", "ext-json": "*", "ext-zip": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.0", "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", "extra": { "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Franck Nijhof", "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" }, { "name": "Contributors", "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", "code quality", "codesniffer", "composer", "installer", "phpcbf", "phpcs", "plugin", "qa", "quality", "standard", "standards", "style guide", "stylecheck", "tests" ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", "source": "https://github.com/PHPCSStandards/composer-installer" }, "time": "2023-01-05T11:28:13+00:00" }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { "php": ">=5.3", "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, "conflict": { "squizlabs/php_codesniffer": "2.6.2" }, "require-dev": { "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "homepage": "https://github.com/wimg", "role": "lead" }, { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "lead" }, { "name": "Contributors", "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ "compatibility", "phpcs", "standards" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, "time": "2019-12-27T09:44:58+00:00" }, { "name": "phpcompatibility/phpcompatibility-paragonie", "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "role": "lead" }, { "name": "Juliette Reinders Folmer", "role": "lead" } ], "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", "homepage": "http://phpcompatibility.com/", "keywords": [ "compatibility", "paragonie", "phpcs", "polyfill", "standards", "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, "time": "2022-10-25T01:46:02+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0", "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "role": "lead" }, { "name": "Juliette Reinders Folmer", "role": "lead" } ], "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", "homepage": "http://phpcompatibility.com/", "keywords": [ "compatibility", "phpcs", "standards", "static analysis", "wordpress" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, "time": "2022-10-24T09:00:36+00:00" }, { "name": "squizlabs/php_codesniffer", "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ "bin/phpcs", "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { "dev-master": "3.x-dev" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Greg Sherwood", "role": "lead" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, "time": "2023-02-22T23:07:41+00:00" }, { "name": "wp-coding-standards/wpcs", "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", "reference": "7da1894633f168fe244afc6de00d141f27517b62" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", "reference": "7da1894633f168fe244afc6de00d141f27517b62", "shasum": "" }, "require": { "php": ">=5.4", "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Contributors", "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", "keywords": [ "phpcs", "standards", "wordpress" ], "support": { "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, "time": "2020-05-13T23:57:56+00:00" }, { "name": "wptrt/wpthemereview", "version": "dev-develop", "source": { "type": "git", "url": "https://github.com/WPTT/WPThemeReview.git", "reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/WPTT/WPThemeReview/zipball/15684d0852fe90d807c2ae7746dea1302b74b4bd", "reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd", "shasum": "" }, "require": { "php": ">=5.4", "phpcompatibility/phpcompatibility-wp": "^2.0", "squizlabs/php_codesniffer": "^3.3.1", "wp-coding-standards/wpcs": "^2.2.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "php-parallel-lint/php-console-highlighter": "^0.5", "php-parallel-lint/php-parallel-lint": "^1.0", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0", "roave/security-advisories": "dev-master" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Theme Review Team", "homepage": "https://make.wordpress.org/themes/handbook/", "role": "Strategy and rule setting" }, { "name": "Ulrich Pogson", "homepage": "https://github.com/grappler", "role": "Lead developer" }, { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "Lead developer" }, { "name": "Denis Žoljom", "homepage": "https://github.com/dingo-d", "role": "Plugin integration lead" }, { "name": "Contributors", "homepage": "https://github.com/WPTRT/WPThemeReview/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org", "homepage": "https://make.wordpress.org/themes/handbook/review/", "keywords": [ "phpcs", "standards", "themes", "wordpress" ], "support": { "issues": "https://github.com/WPTRT/WPThemeReview/issues", "source": "https://github.com/WPTRT/WPThemeReview" }, "time": "2021-06-22T06:10:49+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { "wptrt/wpthemereview": 20 }, "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.3.0" } LICENSE000064400000002062147177211530005561 0ustar00The MIT License (MIT) Copyright (c) 2023 Themeum 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. upgrade-notifications.php000064400000002713147177211530011566 0ustar00upgrade_notice ) && strlen( trim( $response->upgrade_notice ) ) > 0 ) : ?>
upgrade_notice ); ?>
modules = new Modules(); // Instantiate classes. new Kirki(); new L10n( 'kirki', __DIR__ . '/languages' ); new \Kirki\Settings\SetupSettings(); // ? Bagus: Do we really need to-reinclude this file? It was included above. // Include the ariColor library. require_once wp_normalize_path( dirname( __FILE__ ) . '/lib/class-aricolor.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude // Add an empty config for global fields. Kirki::add_config( '' ); // ? Bagus: what is this for? Adding empty config. // ? Bagus: Do we really need this line? custom-config.php here is supposed to inside this plugin. Or is this just in case we need it in the future? $custom_config_path = dirname( __FILE__ ) . '/custom-config.php'; $custom_config_path = wp_normalize_path( $custom_config_path ); if ( file_exists( $custom_config_path ) ) { require_once $custom_config_path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude } // Add upgrade notifications. require_once wp_normalize_path( dirname( __FILE__ ) . '/upgrade-notifications.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude /** * To enable tests, add this line to your wp-config.php file (or anywhere alse): * define( 'KIRKI_TEST', true ); * * Please note that the example.php file is not included in the wordpress.org distribution * and will only be included in dev versions of the plugin in the github repository. */ if ( defined( 'KIRKI_TEST' ) && true === KIRKI_TEST && file_exists( dirname( __FILE__ ) . '/example.php' ) ) { include_once dirname( __FILE__ ) . '/example.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude } require_once __DIR__ . '/pro-src/pro-index.php';kirki-composer/autoload.php000064400000001403147177211530012031 0ustar00> $GITHUB_ENV" - name: "Install latest dependencies" run: "composer update ${{ env.COMPOSER_FLAGS }}" - name: "Run tests" run: "vendor/bin/simple-phpunit --verbose" kirki-composer/composer/installers/.github/workflows/lint.yml000064400000001051147177211530020604 0ustar00name: "PHP Lint" on: - push - pull_request jobs: tests: name: "Lint" runs-on: ubuntu-latest strategy: matrix: php-version: - "7.2" - "latest" steps: - name: "Checkout" uses: "actions/checkout@v2" - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: coverage: "none" php-version: "${{ matrix.php-version }}" - name: "Lint PHP files" run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f" kirki-composer/composer/installers/phpstan.neon.dist000064400000000440147177211530017017 0ustar00parameters: level: 8 paths: - src - tests excludes_analyse: - tests/Composer/Installers/Test/PolyfillTestCase.php ignoreErrors: - '~Test::[a-zA-Z0-9]+Provider\(\) return type~' includes: - vendor/phpstan/phpstan-phpunit/extension.neon kirki-composer/composer/installers/LICENSE000064400000002046147177211530014530 0ustar00Copyright (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.kirki-composer/composer/installers/src/Composer/Installers/LavaLiteInstaller.php000064400000000413147177211530024305 0ustar00 */ protected $locations = array( 'package' => 'packages/{$vendor}/{$name}/', 'theme' => 'public/themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/WolfCMSInstaller.php000064400000000324147177211530024057 0ustar00 */ protected $locations = array( 'plugin' => 'wolf/plugins/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/TastyIgniterInstaller.php000064400000004555147177211530025245 0ustar00 */ 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 $vars * @return array */ protected function inflectModuleVars(array $vars): array { $vars['name'] = $this->pregReplace('/^ti-module-/', '', $vars['name']); return $vars; } /** * @param array $vars * @param array $extra * @return array */ 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 $vars * @param array $extra * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/WordPressInstaller.php000064400000000573147177211530024543 0ustar00 */ protected $locations = array( 'plugin' => 'wp-content/plugins/{$name}/', 'theme' => 'wp-content/themes/{$name}/', 'muplugin' => 'wp-content/mu-plugins/{$name}/', 'dropin' => 'wp-content/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/BitrixInstaller.php000064400000010344147177211530024051 0ustar00.`. * - `bitrix-d7-component` — copy the component to directory `bitrix/components//`. * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/_`. * * You can set custom path to directory with Bitrix kernel in `composer.json`: * * ```json * { * "extra": { * "bitrix-dir": "s1/bitrix" * } * } * ``` * * @author Nik Samokhvalov * @author Denis Kulichkin */ class BitrixInstaller extends BaseInstaller { /** @var array */ 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 $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(' Duplication of packages:'); $this->io->writeError(' Package ' . $oldPath . ' will be called instead package ' . $path . ''); while (true) { switch ($this->io->ask(' Delete ' . $oldPath . ' [y,n,?]? ', '?')) { 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; } } kirki-composer/composer/installers/src/Composer/Installers/ItopInstaller.php000064400000000325147177211530023521 0ustar00 */ protected $locations = array( 'extension' => 'extensions/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/TaoInstaller.php000064400000001507147177211530023334 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/DframeInstaller.php000064400000000331147177211530024001 0ustar00 */ protected $locations = array( 'module' => 'modules/{$vendor}/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/ZikulaInstaller.php000064400000000410147177211530024040 0ustar00 */ protected $locations = array( 'module' => 'modules/{$vendor}-{$name}/', 'theme' => 'themes/{$vendor}-{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/MediaWikiInstaller.php000064400000003041147177211530024447 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ protected function inflectSkinVars(array $vars): array { $vars['name'] = $this->pregReplace('/-skin$/', '', $vars['name']); return $vars; } } kirki-composer/composer/installers/src/Composer/Installers/FuelphpInstaller.php000064400000000326147177211530024212 0ustar00 */ protected $locations = array( 'component' => 'components/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/ChefInstaller.php000064400000000404147177211530023451 0ustar00 */ protected $locations = array( 'cookbook' => 'Chef/{$vendor}/{$name}/', 'role' => 'Chef/roles/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/RoundcubeInstaller.php000064400000000706147177211530024537 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/VanillaInstaller.php000064400000000374147177211530024200 0ustar00 */ protected $locations = array( 'plugin' => 'plugins/{$name}/', 'theme' => 'themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/OctoberInstaller.php000064400000003034147177211530024203 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/LaravelInstaller.php000064400000000322147177211530024171 0ustar00 */ protected $locations = array( 'library' => 'libraries/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/ProcessWireInstaller.php000064400000001144147177211530025053 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/OntoWikiInstaller.php000064400000001432147177211530024351 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/PhpBBInstaller.php000064400000000454147177211530023544 0ustar00 */ protected $locations = array( 'extension' => 'ext/{$vendor}/{$name}/', 'language' => 'language/{$name}/', 'style' => 'styles/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/OsclassInstaller.php000064400000000507147177211530024217 0ustar00 */ protected $locations = array( 'plugin' => 'oc-content/plugins/{$name}/', 'theme' => 'oc-content/themes/{$name}/', 'language' => 'oc-content/languages/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/CroogoInstaller.php000064400000001053147177211530024035 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/HuradInstaller.php000064400000001370147177211530023652 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/SilverStripeInstaller.php000064400000002030147177211530025234 0ustar00 */ 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); } } kirki-composer/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php000064400000000534147177211530025004 0ustar00 */ protected $locations = array( 'library' => 'application/libraries/{$name}/', 'third-party' => 'application/third_party/{$name}/', 'module' => 'application/modules/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/EliasisInstaller.php000064400000000530147177211530024175 0ustar00 */ protected $locations = array( 'component' => 'components/{$name}/', 'module' => 'modules/{$name}/', 'plugin' => 'plugins/{$name}/', 'template' => 'templates/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MagentoInstaller.php000064400000000470147177211530024201 0ustar00 */ protected $locations = array( 'theme' => 'app/design/frontend/{$name}/', 'skin' => 'skin/frontend/default/{$name}/', 'library' => 'lib/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/CakePHPInstaller.php000064400000003621147177211530024023 0ustar00 */ 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 Constraint::STR_OP_* $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; } } kirki-composer/composer/installers/src/Composer/Installers/FuelInstaller.php000064400000000466147177211530023507 0ustar00 */ protected $locations = array( 'module' => 'fuel/app/modules/{$name}/', 'package' => 'fuel/packages/{$name}/', 'theme' => 'fuel/app/themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/SyDESInstaller.php000064400000002660147177211530023541 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ protected function inflectThemeVars(array $vars): array { $vars['name'] = $this->pregReplace('/(^sydes-|-theme$)/', '', $vars['name']); $vars['name'] = strtolower($vars['name']); return $vars; } } kirki-composer/composer/installers/src/Composer/Installers/WinterInstaller.php000064400000003507147177211530024063 0ustar00 */ 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 $vars * @return array */ protected function inflectModuleVars(array $vars): array { $vars['name'] = $this->pregReplace('/^wn-|-module$/', '', $vars['name']); return $vars; } /** * @param array $vars * @return array */ 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 $vars * @return array */ protected function inflectThemeVars(array $vars): array { $vars['name'] = $this->pregReplace('/^wn-|-theme$/', '', $vars['name']); return $vars; } } kirki-composer/composer/installers/src/Composer/Installers/UserFrostingInstaller.php000064400000000334147177211530025240 0ustar00 */ protected $locations = array( 'sprinkle' => 'app/sprinkles/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/YawikInstaller.php000064400000001130147177211530023665 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/Installer.php000064400000023457147177211530022700 0ustar00 */ private $supportedTypes = array( 'akaunting' => 'AkauntingInstaller', 'asgard' => 'AsgardInstaller', 'attogram' => 'AttogramInstaller', 'agl' => 'AglInstaller', 'annotatecms' => 'AnnotateCmsInstaller', 'bitrix' => 'BitrixInstaller', 'bonefish' => 'BonefishInstaller', 'cakephp' => 'CakePHPInstaller', 'chef' => 'ChefInstaller', 'civicrm' => 'CiviCrmInstaller', 'ccframework' => 'ClanCatsFrameworkInstaller', 'cockpit' => 'CockpitInstaller', 'codeigniter' => 'CodeIgniterInstaller', 'concrete5' => 'Concrete5Installer', 'croogo' => 'CroogoInstaller', 'dframe' => 'DframeInstaller', 'dokuwiki' => 'DokuWikiInstaller', 'dolibarr' => 'DolibarrInstaller', 'decibel' => 'DecibelInstaller', 'drupal' => 'DrupalInstaller', 'elgg' => 'ElggInstaller', 'eliasis' => 'EliasisInstaller', 'ee3' => 'ExpressionEngineInstaller', 'ee2' => 'ExpressionEngineInstaller', 'ezplatform' => 'EzPlatformInstaller', '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]; $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) ? 'deleted' : 'not deleted')); }; $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} */ 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]); } } } } kirki-composer/composer/installers/src/Composer/Installers/Plugin.php000064400000001270147177211530022166 0ustar00installer = 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 { } } kirki-composer/composer/installers/src/Composer/Installers/KanboardInstaller.php000064400000000517147177211530024332 0ustar00 */ protected $locations = array( 'plugin' => 'plugins/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MakoInstaller.php000064400000000322147177211530023472 0ustar00 */ protected $locations = array( 'package' => 'app/packages/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php000064400000000325147177211530024436 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/SyliusInstaller.php000064400000000314147177211530024074 0ustar00 */ protected $locations = array( 'theme' => 'themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MauticInstaller.php000064400000002217147177211530024032 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/AkauntingInstaller.php000064400000001133147177211530024525 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/PuppetInstaller.php000064400000000317147177211530024064 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/PantheonInstaller.php000064400000000446147177211530024366 0ustar00 */ protected $locations = array( 'script' => 'web/private/scripts/quicksilver/{$name}', 'module' => 'web/private/scripts/quicksilver/{$name}', ); } kirki-composer/composer/installers/src/Composer/Installers/MajimaInstaller.php000064400000002147147177211530024010 0ustar00 */ protected $locations = array( 'plugin' => 'plugins/{$name}/', ); /** * Transforms the names * * @param array $vars * @return array */ public function inflectPackageVars(array $vars): array { return $this->correctPluginName($vars); } /** * Change hyphenated names to camelcase * * @param array $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/PrestashopInstaller.php000064400000000371147177211530024737 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', 'theme' => 'themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/RadPHPInstaller.php000064400000001315147177211530023664 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/AglInstaller.php000064400000001242147177211530023310 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/LithiumInstaller.php000064400000000405147177211530024220 0ustar00 */ protected $locations = array( 'library' => 'libraries/{$name}/', 'source' => 'libraries/_source/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/ReIndexInstaller.php000064400000000373147177211530024147 0ustar00 */ protected $locations = array( 'theme' => 'themes/{$name}/', 'plugin' => 'plugins/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/Redaxo5Installer.php000064400000000453147177211530024117 0ustar00 */ protected $locations = array( 'addon' => 'redaxo/src/addons/{$name}/', 'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/EzPlatformInstaller.php000064400000000423147177211530024670 0ustar00 */ protected $locations = array( 'meta-assets' => 'web/assets/ezplatform/', 'assets' => 'web/assets/ezplatform/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MantisBTInstaller.php000064400000001202147177211530024262 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/TuskInstaller.php000064400000000624147177211530023536 0ustar00 */ class TuskInstaller extends BaseInstaller { /** @var array */ protected $locations = array( 'task' => '.tusk/tasks/{$name}/', 'command' => '.tusk/commands/{$name}/', 'asset' => 'assets/tusk/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php000064400000001416147177211530026524 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/MatomoInstaller.php000064400000001235147177211530024043 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/DrupalInstaller.php000064400000001612147177211530024035 0ustar00 */ 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/', ); } kirki-composer/composer/installers/src/Composer/Installers/BonefishInstaller.php000064400000000336147177211530024345 0ustar00 */ protected $locations = array( 'package' => 'Packages/{$vendor}/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/ModxInstaller.php000064400000000433147177211530023515 0ustar00 */ protected $locations = array( 'extra' => 'core/packages/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/TheliaInstaller.php000064400000000653147177211530024020 0ustar00 */ protected $locations = array( 'module' => 'local/modules/{$name}/', 'frontoffice-template' => 'templates/frontOffice/{$name}/', 'backoffice-template' => 'templates/backOffice/{$name}/', 'email-template' => 'templates/email/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/BaseInstaller.php000064400000010117147177211530023460 0ustar00 */ 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 $vars This will normally receive array{name: string, vendor: string, type: string} * @return array */ public function inflectPackageVars(array $vars): array { return $vars; } /** * Gets the installer's locations * * @return array map of package types => install path */ public function getLocations(string $frameworkType) { return $this->locations; } /** * Replace vars in a path * * @param array $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 $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; } } kirki-composer/composer/installers/src/Composer/Installers/StarbugInstaller.php000064400000000530147177211530024213 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', 'theme' => 'themes/{$name}/', 'custom-module' => 'app/modules/{$name}/', 'custom-theme' => 'app/themes/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/AsgardInstaller.php000064400000003077147177211530024016 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/CiviCrmInstaller.php000064400000000312147177211530024136 0ustar00 */ protected $locations = array( 'ext' => 'ext/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/ZendInstaller.php000064400000000445147177211530023511 0ustar00 */ protected $locations = array( 'library' => 'library/{$name}/', 'extra' => 'extras/library/{$name}/', 'module' => 'module/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/PhiftyInstaller.php000064400000000447147177211530024056 0ustar00 */ protected $locations = array( 'bundle' => 'bundles/{$name}/', 'library' => 'libraries/{$name}/', 'framework' => 'frameworks/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php000064400000001435147177211530026076 0ustar00 */ private $ee2Locations = array( 'addon' => 'system/expressionengine/third_party/{$name}/', 'theme' => 'themes/third_party/{$name}/', ); /** @var array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/ElggInstaller.php000064400000000310147177211530023456 0ustar00 */ protected $locations = array( 'plugin' => 'mod/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MODXEvoInstaller.php000064400000001010147177211530024017 0ustar00 */ protected $locations = array( 'snippet' => 'assets/snippets/{$name}/', 'plugin' => 'assets/plugins/{$name}/', 'module' => 'assets/modules/{$name}/', 'template' => 'assets/templates/{$name}/', 'lib' => 'assets/lib/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/MoodleInstaller.php000064400000006673147177211530024041 0ustar00 */ 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}/', '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}/', 'gradeexport' => 'grade/export/{$name}/', 'gradeimport' => 'grade/import/{$name}/', 'gradereport' => 'grade/report/{$name}/', 'gradingform' => 'grade/grading/form/{$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}/', 'mnetservice' => 'mnet/service/{$name}/', 'paygw' => 'payment/gateway/{$name}/', 'plagiarism' => 'plagiarism/{$name}/', 'portfolio' => 'portfolio/{$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}/', '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}/' ); } kirki-composer/composer/installers/src/Composer/Installers/Concrete5Installer.php000064400000000625147177211530024440 0ustar00 */ protected $locations = array( 'core' => 'concrete/', 'block' => 'application/blocks/{$name}/', 'package' => 'packages/{$name}/', 'theme' => 'application/themes/{$name}/', 'update' => 'updates/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/CockpitInstaller.php000064400000001443147177211530024204 0ustar00 */ 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 $vars * @return array */ public function inflectModuleVars(array $vars): array { $vars['name'] = ucfirst($this->pregReplace('/cockpit-/i', '', $vars['name'])); return $vars; } } kirki-composer/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php000064400000000420147177211530026150 0ustar00 */ protected $locations = array( 'ship' => 'CCF/orbit/{$name}/', 'theme' => 'CCF/app/themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/ImageCMSInstaller.php000064400000000513147177211530024172 0ustar00 */ protected $locations = array( 'template' => 'templates/{$name}/', 'module' => 'application/modules/{$name}/', 'library' => 'application/libraries/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/KodiCMSInstaller.php000064400000000403147177211530024034 0ustar00 */ protected $locations = array( 'plugin' => 'cms/plugins/{$name}/', 'media' => 'cms/media/vendor/{$name}/' ); } kirki-composer/composer/installers/src/Composer/Installers/PxcmsInstaller.php000064400000004154147177211530023704 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php000064400000001246147177211530025453 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/KohanaInstaller.php000064400000000316147177211530024007 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php000064400000000505147177211530025022 0ustar00 */ protected $locations = array( 'module' => 'addons/modules/{$name}/', 'component' => 'addons/components/{$name}/', 'service' => 'addons/services/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/DokuWikiInstaller.php000064400000003005147177211530024332 0ustar00 */ 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 $vars * @return array */ protected function inflectPluginVars(array $vars): array { $vars['name'] = $this->pregReplace('/-plugin$/', '', $vars['name']); $vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']); return $vars; } /** * @param array $vars * @return array */ protected function inflectTemplateVars(array $vars): array { $vars['name'] = $this->pregReplace('/-template$/', '', $vars['name']); $vars['name'] = $this->pregReplace('/^dokuwiki_?-?/', '', $vars['name']); return $vars; } } kirki-composer/composer/installers/src/Composer/Installers/DecibelInstaller.php000064400000000341147177211530024133 0ustar00 */ protected $locations = array( 'app' => 'app/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/VgmcpInstaller.php000064400000003107147177211530023663 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/ShopwareInstaller.php000064400000003547147177211530024407 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ private function correctThemeName(array $vars): array { $vars['name'] = str_replace('-', '_', $vars['name']); return $vars; } } kirki-composer/composer/installers/src/Composer/Installers/DolibarrInstaller.php000064400000000611147177211530024342 0ustar00 */ class DolibarrInstaller extends BaseInstaller { //TODO: Add support for scripts and themes /** @var array */ protected $locations = array( 'module' => 'htdocs/custom/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/KnownInstaller.php000064400000000460147177211530023702 0ustar00 */ protected $locations = array( 'plugin' => 'IdnoPlugins/{$name}/', 'theme' => 'Themes/{$name}/', 'console' => 'ConsolePlugins/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/SMFInstaller.php000064400000000361147177211530023233 0ustar00 */ protected $locations = array( 'module' => 'Sources/{$name}/', 'theme' => 'Themes/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/OxidInstaller.php000064400000002666147177211530023523 0ustar00.+)\/.+/'; /** @var array */ 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); } } kirki-composer/composer/installers/src/Composer/Installers/MiaoxingInstaller.php000064400000000320147177211530024354 0ustar00 */ protected $locations = array( 'plugin' => 'plugins/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/GravInstaller.php000064400000001306147177211530023505 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/SiteDirectInstaller.php000064400000001614147177211530024647 0ustar00 */ protected $locations = array( 'module' => 'modules/{$vendor}/{$name}/', 'plugin' => 'plugins/{$vendor}/{$name}/' ); /** * @param array $vars * @return array */ public function inflectPackageVars(array $vars): array { return $this->parseVars($vars); } /** * @param array $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/WHMCSInstaller.php000064400000001554147177211530023474 0ustar00 */ 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}/' ); } kirki-composer/composer/installers/src/Composer/Installers/MayaInstaller.php000064400000001666147177211530023506 0ustar00 */ 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 $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/PortoInstaller.php000064400000000327147177211530023713 0ustar00 */ protected $locations = array( 'container' => 'app/Containers/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/MicroweberInstaller.php000064400000012226147177211530024707 0ustar00 */ 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 $vars * @return array */ 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 $vars * @return array */ 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 $vars * @return array */ 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 $vars * @return array */ 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 $vars * @return array */ 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 $vars * @return array */ 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 $vars * @return array */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/AttogramInstaller.php000064400000000320147177211530024357 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/PiwikInstaller.php000064400000001233147177211530023670 0ustar00 */ 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; } } kirki-composer/composer/installers/src/Composer/Installers/PPIInstaller.php000064400000000313147177211530023233 0ustar00 */ protected $locations = array( 'module' => 'modules/{$name}/', ); } kirki-composer/composer/installers/src/Composer/Installers/RedaxoInstaller.php000064400000000462147177211530024032 0ustar00 */ protected $locations = array( 'addon' => 'redaxo/include/addons/{$name}/', 'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/' ); } kirki-composer/composer/installers/src/bootstrap.php000064400000001040147177211530017031 0ustar00 array($vendorDir . '/dealerdirect/phpcodesniffer-composer-installer/src'), 'Kirki\\Util\\' => array($baseDir . '/kirki-packages/util/src'), 'Kirki\\Settings\\' => array($baseDir . '/kirki-packages/settings/src'), 'Kirki\\Pro\\' => array($baseDir . '/pro-src'), 'Kirki\\Module\\' => array($baseDir . '/kirki-packages/module-css/src', $baseDir . '/kirki-packages/module-editor-styles/src', $baseDir . '/kirki-packages/module-field-dependencies/src', $baseDir . '/kirki-packages/module-postmessage/src', $baseDir . '/kirki-packages/module-preset/src', $baseDir . '/kirki-packages/module-section-icons/src', $baseDir . '/kirki-packages/module-selective-refresh/src', $baseDir . '/kirki-packages/module-tooltips/src', $baseDir . '/kirki-packages/module-webfonts/src'), 'Kirki\\Field\\' => array($baseDir . '/kirki-packages/field/src/Field', $baseDir . '/kirki-packages/field-background/src', $baseDir . '/kirki-packages/field-dimensions/src', $baseDir . '/kirki-packages/field-fontawesome/src', $baseDir . '/kirki-packages/field-multicolor/src/Field', $baseDir . '/kirki-packages/field-multicolor/src', $baseDir . '/kirki-packages/field-typography/src/Field', $baseDir . '/kirki-packages/field-typography/src'), 'Kirki\\Data\\' => array($baseDir . '/kirki-packages/data-option/src'), 'Kirki\\Compatibility\\' => array($baseDir . '/kirki-packages/compatibility/src'), 'Kirki\\' => array($baseDir . '/kirki-packages/control-base/src', $baseDir . '/kirki-packages/control-checkbox/src', $baseDir . '/kirki-packages/control-code/src', $baseDir . '/kirki-packages/control-color/src', $baseDir . '/kirki-packages/control-color-palette/src', $baseDir . '/kirki-packages/control-cropped-image/src', $baseDir . '/kirki-packages/control-custom/src', $baseDir . '/kirki-packages/control-dashicons/src', $baseDir . '/kirki-packages/control-date/src', $baseDir . '/kirki-packages/control-dimension/src', $baseDir . '/kirki-packages/control-editor/src', $baseDir . '/kirki-packages/control-generic/src', $baseDir . '/kirki-packages/control-image/src', $baseDir . '/kirki-packages/control-multicheck/src', $baseDir . '/kirki-packages/control-palette/src', $baseDir . '/kirki-packages/control-radio/src', $baseDir . '/kirki-packages/control-react-colorful/src', $baseDir . '/kirki-packages/control-react-select/src', $baseDir . '/kirki-packages/control-repeater/src', $baseDir . '/kirki-packages/control-select/src', $baseDir . '/kirki-packages/control-slider/src', $baseDir . '/kirki-packages/control-sortable/src', $baseDir . '/kirki-packages/control-upload/src', $baseDir . '/kirki-packages/field/src', $baseDir . '/kirki-packages/googlefonts/src', $baseDir . '/kirki-packages/l10n/src', $baseDir . '/kirki-packages/module-panels/src', $baseDir . '/kirki-packages/module-sections/src', $baseDir . '/kirki-packages/url-getter/src'), 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), ); kirki-composer/composer/include_paths.php000064400000000261147177211530014673 0ustar00register(true); return $loader; } } kirki-composer/composer/platform_check.php000064400000001635147177211530015040 0ustar00= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.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 ); } kirki-composer/composer/ClassLoader.php000064400000040220147177211530014244 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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 */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $classMap * * @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 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) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $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 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) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $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] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $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 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 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 indexed by their corresponding vendor directories. * * @return 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); } } kirki-composer/composer/autoload_classmap.php000064400000000336147177211530015547 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); kirki-composer/composer/autoload_static.php000064400000013764147177211530015244 0ustar00 array ( 'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => 57, ), 'K' => array ( 'Kirki\\Util\\' => 11, 'Kirki\\Settings\\' => 15, 'Kirki\\Pro\\' => 10, 'Kirki\\Module\\' => 13, 'Kirki\\Field\\' => 12, 'Kirki\\Data\\' => 11, 'Kirki\\Compatibility\\' => 20, 'Kirki\\' => 6, ), 'C' => array ( 'Composer\\Installers\\' => 20, ), ); public static $prefixDirsPsr4 = array ( 'PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\' => array ( 0 => __DIR__ . '/..' . '/dealerdirect/phpcodesniffer-composer-installer/src', ), 'Kirki\\Util\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/util/src', ), 'Kirki\\Settings\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/settings/src', ), 'Kirki\\Pro\\' => array ( 0 => __DIR__ . '/../..' . '/pro-src', ), 'Kirki\\Module\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/module-css/src', 1 => __DIR__ . '/../..' . '/kirki-packages/module-editor-styles/src', 2 => __DIR__ . '/../..' . '/kirki-packages/module-field-dependencies/src', 3 => __DIR__ . '/../..' . '/kirki-packages/module-postmessage/src', 4 => __DIR__ . '/../..' . '/kirki-packages/module-preset/src', 5 => __DIR__ . '/../..' . '/kirki-packages/module-section-icons/src', 6 => __DIR__ . '/../..' . '/kirki-packages/module-selective-refresh/src', 7 => __DIR__ . '/../..' . '/kirki-packages/module-tooltips/src', 8 => __DIR__ . '/../..' . '/kirki-packages/module-webfonts/src', ), 'Kirki\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/field/src/Field', 1 => __DIR__ . '/../..' . '/kirki-packages/field-background/src', 2 => __DIR__ . '/../..' . '/kirki-packages/field-dimensions/src', 3 => __DIR__ . '/../..' . '/kirki-packages/field-fontawesome/src', 4 => __DIR__ . '/../..' . '/kirki-packages/field-multicolor/src/Field', 5 => __DIR__ . '/../..' . '/kirki-packages/field-multicolor/src', 6 => __DIR__ . '/../..' . '/kirki-packages/field-typography/src/Field', 7 => __DIR__ . '/../..' . '/kirki-packages/field-typography/src', ), 'Kirki\\Data\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/data-option/src', ), 'Kirki\\Compatibility\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/compatibility/src', ), 'Kirki\\' => array ( 0 => __DIR__ . '/../..' . '/kirki-packages/control-base/src', 1 => __DIR__ . '/../..' . '/kirki-packages/control-checkbox/src', 2 => __DIR__ . '/../..' . '/kirki-packages/control-code/src', 3 => __DIR__ . '/../..' . '/kirki-packages/control-color/src', 4 => __DIR__ . '/../..' . '/kirki-packages/control-color-palette/src', 5 => __DIR__ . '/../..' . '/kirki-packages/control-cropped-image/src', 6 => __DIR__ . '/../..' . '/kirki-packages/control-custom/src', 7 => __DIR__ . '/../..' . '/kirki-packages/control-dashicons/src', 8 => __DIR__ . '/../..' . '/kirki-packages/control-date/src', 9 => __DIR__ . '/../..' . '/kirki-packages/control-dimension/src', 10 => __DIR__ . '/../..' . '/kirki-packages/control-editor/src', 11 => __DIR__ . '/../..' . '/kirki-packages/control-generic/src', 12 => __DIR__ . '/../..' . '/kirki-packages/control-image/src', 13 => __DIR__ . '/../..' . '/kirki-packages/control-multicheck/src', 14 => __DIR__ . '/../..' . '/kirki-packages/control-palette/src', 15 => __DIR__ . '/../..' . '/kirki-packages/control-radio/src', 16 => __DIR__ . '/../..' . '/kirki-packages/control-react-colorful/src', 17 => __DIR__ . '/../..' . '/kirki-packages/control-react-select/src', 18 => __DIR__ . '/../..' . '/kirki-packages/control-repeater/src', 19 => __DIR__ . '/../..' . '/kirki-packages/control-select/src', 20 => __DIR__ . '/../..' . '/kirki-packages/control-slider/src', 21 => __DIR__ . '/../..' . '/kirki-packages/control-sortable/src', 22 => __DIR__ . '/../..' . '/kirki-packages/control-upload/src', 23 => __DIR__ . '/../..' . '/kirki-packages/field/src', 24 => __DIR__ . '/../..' . '/kirki-packages/googlefonts/src', 25 => __DIR__ . '/../..' . '/kirki-packages/l10n/src', 26 => __DIR__ . '/../..' . '/kirki-packages/module-panels/src', 27 => __DIR__ . '/../..' . '/kirki-packages/module-sections/src', 28 => __DIR__ . '/../..' . '/kirki-packages/url-getter/src', ), 'Composer\\Installers\\' => array ( 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit734b74506bf23405b8270b65bdba2dd6::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit734b74506bf23405b8270b65bdba2dd6::$prefixDirsPsr4; $loader->classMap = ComposerStaticInit734b74506bf23405b8270b65bdba2dd6::$classMap; }, null, ClassLoader::class); } } kirki-composer/composer/InstalledVersions.php000064400000037417147177211530015536 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } kirki-composer/composer/installed.json000064400000060317147177211530014222 0ustar00{ "packages": [ { "name": "composer/installers", "version": "v2.2.0", "version_normalized": "2.2.0.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/composer/installers/zipball/c29dc4b93137acb82734f672c37e029dfbd95b35", "reference": "c29dc4b93137acb82734f672c37e029dfbd95b35", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": "^7.2 || ^8.0" }, "require-dev": { "composer/composer": "1.6.* || ^2.0", "composer/semver": "^1 || ^3", "phpstan/phpstan": "^0.12.55", "phpstan/phpstan-phpunit": "^0.12.16", "symfony/phpunit-bridge": "^5.3", "symfony/process": "^5" }, "time": "2022-08-20T06:45:11+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", "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.2.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" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v1.0.0", "version_normalized": "1.0.0.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/composer-installer.git", "reference": "4be43904336affa5c2f70744a348312336afd0da" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", "reference": "4be43904336affa5c2f70744a348312336afd0da", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", "ext-json": "*", "ext-zip": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.0", "yoast/phpunit-polyfills": "^1.0" }, "time": "2023-01-05T11:28:13+00:00", "type": "composer-plugin", "extra": { "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "installation-source": "dist", "autoload": { "psr-4": { "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Franck Nijhof", "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" }, { "name": "Contributors", "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", "code quality", "codesniffer", "composer", "installer", "phpcbf", "phpcs", "plugin", "qa", "quality", "standard", "standards", "style guide", "stylecheck", "tests" ], "support": { "issues": "https://github.com/PHPCSStandards/composer-installer/issues", "source": "https://github.com/PHPCSStandards/composer-installer" }, "install-path": "../dealerdirect/phpcodesniffer-composer-installer" }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", "version_normalized": "9.3.5.0", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { "php": ">=5.3", "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" }, "conflict": { "squizlabs/php_codesniffer": "2.6.2" }, "require-dev": { "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "time": "2019-12-27T09:44:58+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "homepage": "https://github.com/wimg", "role": "lead" }, { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "lead" }, { "name": "Contributors", "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", "keywords": [ "compatibility", "phpcs", "standards" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibility" }, "install-path": "../phpcompatibility/php-compatibility" }, { "name": "phpcompatibility/phpcompatibility-paragonie", "version": "1.3.2", "version_normalized": "1.3.2.0", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "time": "2022-10-25T01:46:02+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "role": "lead" }, { "name": "Juliette Reinders Folmer", "role": "lead" } ], "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", "homepage": "http://phpcompatibility.com/", "keywords": [ "compatibility", "paragonie", "phpcs", "polyfill", "standards", "static analysis" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, "install-path": "../phpcompatibility/phpcompatibility-paragonie" }, { "name": "phpcompatibility/phpcompatibility-wp", "version": "2.1.4", "version_normalized": "2.1.4.0", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0", "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "time": "2022-10-24T09:00:36+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", "license": [ "LGPL-3.0-or-later" ], "authors": [ { "name": "Wim Godden", "role": "lead" }, { "name": "Juliette Reinders Folmer", "role": "lead" } ], "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", "homepage": "http://phpcompatibility.com/", "keywords": [ "compatibility", "phpcs", "standards", "static analysis", "wordpress" ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, "install-path": "../phpcompatibility/phpcompatibility-wp" }, { "name": "squizlabs/php_codesniffer", "version": "3.7.2", "version_normalized": "3.7.2.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "time": "2023-02-22T23:07:41+00:00", "bin": [ "bin/phpcs", "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { "dev-master": "3.x-dev" } }, "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Greg Sherwood", "role": "lead" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, "install-path": "../squizlabs/php_codesniffer" }, { "name": "wp-coding-standards/wpcs", "version": "2.3.0", "version_normalized": "2.3.0.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", "reference": "7da1894633f168fe244afc6de00d141f27517b62" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", "reference": "7da1894633f168fe244afc6de00d141f27517b62", "shasum": "" }, "require": { "php": ">=5.4", "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "time": "2020-05-13T23:57:56+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Contributors", "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", "keywords": [ "phpcs", "standards", "wordpress" ], "support": { "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", "source": "https://github.com/WordPress/WordPress-Coding-Standards", "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" }, "install-path": "../wp-coding-standards/wpcs" }, { "name": "wptrt/wpthemereview", "version": "dev-develop", "version_normalized": "dev-develop", "source": { "type": "git", "url": "https://github.com/WPTT/WPThemeReview.git", "reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/WPTT/WPThemeReview/zipball/15684d0852fe90d807c2ae7746dea1302b74b4bd", "reference": "15684d0852fe90d807c2ae7746dea1302b74b4bd", "shasum": "" }, "require": { "php": ">=5.4", "phpcompatibility/phpcompatibility-wp": "^2.0", "squizlabs/php_codesniffer": "^3.3.1", "wp-coding-standards/wpcs": "^2.2.0" }, "require-dev": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "php-parallel-lint/php-console-highlighter": "^0.5", "php-parallel-lint/php-parallel-lint": "^1.0", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0", "roave/security-advisories": "dev-master" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "time": "2021-06-22T06:10:49+00:00", "default-branch": true, "type": "phpcodesniffer-standard", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Theme Review Team", "homepage": "https://make.wordpress.org/themes/handbook/", "role": "Strategy and rule setting" }, { "name": "Ulrich Pogson", "homepage": "https://github.com/grappler", "role": "Lead developer" }, { "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "Lead developer" }, { "name": "Denis Žoljom", "homepage": "https://github.com/dingo-d", "role": "Plugin integration lead" }, { "name": "Contributors", "homepage": "https://github.com/WPTRT/WPThemeReview/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to verify theme compliance with the rules for theme hosting on wordpress.org", "homepage": "https://make.wordpress.org/themes/handbook/review/", "keywords": [ "phpcs", "standards", "themes", "wordpress" ], "support": { "issues": "https://github.com/WPTRT/WPThemeReview/issues", "source": "https://github.com/WPTRT/WPThemeReview" }, "install-path": "../wptrt/wpthemereview" } ], "dev": true, "dev-package-names": [ "composer/installers", "dealerdirect/phpcodesniffer-composer-installer", "phpcompatibility/php-compatibility", "phpcompatibility/phpcompatibility-paragonie", "phpcompatibility/phpcompatibility-wp", "squizlabs/php_codesniffer", "wp-coding-standards/wpcs", "wptrt/wpthemereview" ] } kirki-composer/composer/installed.php000064400000007621147177211530014037 0ustar00 array( 'name' => 'kirki-framework/kirki', 'pretty_version' => '5.0.0', 'version' => '5.0.0.0', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( 'composer/installers' => array( 'pretty_version' => 'v2.2.0', 'version' => '2.2.0.0', 'reference' => 'c29dc4b93137acb82734f672c37e029dfbd95b35', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/./installers', 'aliases' => array(), 'dev_requirement' => true, ), 'dealerdirect/phpcodesniffer-composer-installer' => array( 'pretty_version' => 'v1.0.0', 'version' => '1.0.0.0', 'reference' => '4be43904336affa5c2f70744a348312336afd0da', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../dealerdirect/phpcodesniffer-composer-installer', 'aliases' => array(), 'dev_requirement' => true, ), 'kirki-framework/kirki' => array( 'pretty_version' => '5.0.0', 'version' => '5.0.0.0', 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'phpcompatibility/php-compatibility' => array( 'pretty_version' => '9.3.5', 'version' => '9.3.5.0', 'reference' => '9fb324479acf6f39452e0655d2429cc0d3914243', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcompatibility/php-compatibility', 'aliases' => array(), 'dev_requirement' => true, ), 'phpcompatibility/phpcompatibility-paragonie' => array( 'pretty_version' => '1.3.2', 'version' => '1.3.2.0', 'reference' => 'bba5a9dfec7fcfbd679cfaf611d86b4d3759da26', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-paragonie', 'aliases' => array(), 'dev_requirement' => true, ), 'phpcompatibility/phpcompatibility-wp' => array( 'pretty_version' => '2.1.4', 'version' => '2.1.4.0', 'reference' => 'b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp', 'aliases' => array(), 'dev_requirement' => true, ), 'squizlabs/php_codesniffer' => array( 'pretty_version' => '3.7.2', 'version' => '3.7.2.0', 'reference' => 'ed8e00df0a83aa96acf703f8c2979ff33341f879', 'type' => 'library', 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', 'aliases' => array(), 'dev_requirement' => true, ), 'wp-coding-standards/wpcs' => array( 'pretty_version' => '2.3.0', 'version' => '2.3.0.0', 'reference' => '7da1894633f168fe244afc6de00d141f27517b62', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../wp-coding-standards/wpcs', 'aliases' => array(), 'dev_requirement' => true, ), 'wptrt/wpthemereview' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', 'reference' => '15684d0852fe90d807c2ae7746dea1302b74b4bd', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../wptrt/wpthemereview', 'aliases' => array( 0 => '9999999-dev', ), 'dev_requirement' => true, ), ), ); lib/class-aricolor.php000064400000070056147177211530010760 0ustar00color = $color; if ( is_array( $color ) && isset( $color['fallback'] ) ) { $this->fallback = $color['fallback']; $this->fallback_obj = self::newColor( $this->fallback ); } if ( ! method_exists( $this, 'from_' . $mode ) ) { $mode = $this->get_mode( $color ); } $this->mode = $mode; if ( ! $mode ) { return; } $this->mode = $mode; $method = 'from_' . $mode; // Call the from_{$color_mode} method. $this->$method(); } /** * Gets an instance for this color. * We use a separate instance per color * because there's no need to create a completely new instance each time we call this class. * Instead using instances helps us improve performance & footprint. * * @static * @access public * @since 1.0.0 * @param string|array $color The color. * @param string $mode Mode to be used. * @return ariColor (object) */ public static function newColor( $color, $mode = 'auto' ) { // Get an md5 for this color. $color_md5 = ( is_array( $color ) ) ? md5( wp_json_encode( $color ) . $mode ) : md5( $color . $mode ); // Set the instance if it does not already exist. if ( ! isset( self::$instances[ $color_md5 ] ) ) { self::$instances[ $color_md5 ] = new self( $color, $mode ); } return self::$instances[ $color_md5 ]; } /** * Alias of the newColor method. * * @static * @access public * @since 1.1 * @param string|array $color The color. * @param string $mode Mode to be used. * @return ariColor (object) */ public static function new_color( $color, $mode = 'auto' ) { return self::newColor( $color, $mode ); } /** * Allows us to get a new instance by modifying a property of the existing one. * * @access public * @since 1.0.0 * @param string $property Can be one of the following: * red, * green, * blue, * alpha, * hue, * saturation, * lightness, * brightness. * @param int|float|string $value The new value. * @return ariColor|null */ public function getNew( $property = '', $value = '' ) { if ( in_array( $property, array( 'red', 'green', 'blue', 'alpha' ), true ) ) { // Check if we're changing any of the rgba values. $value = max( 0, min( 255, $value ) ); if ( 'red' === $property ) { return self::new_color( 'rgba(' . $value . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' ); } elseif ( 'green' === $property ) { return self::new_color( 'rgba(' . $this->red . ',' . $value . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' ); } elseif ( 'blue' === $property ) { return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $value . ',' . $this->alpha . ')', 'rgba' ); } elseif ( 'alpha' === $property ) { return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $value . ')', 'rgba' ); } } elseif ( in_array( $property, array( 'hue', 'saturation', 'lightness' ), true ) ) { // Check if we're changing any of the hsl values. $value = ( 'hue' === $property ) ? max( 0, min( 360, $value ) ) : max( 0, min( 100, $value ) ); if ( 'hue' === $property ) { return self::new_color( 'hsla(' . $value . ',' . $this->saturation . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' ); } elseif ( 'saturation' === $property ) { return self::new_color( 'hsla(' . $this->hue . ',' . $value . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' ); } elseif ( 'lightness' === $property ) { return self::new_color( 'hsla(' . $this->hue . ',' . $this->saturation . '%,' . $value . '%,' . $this->alpha . ')', 'hsla' ); } } elseif ( 'brightness' === $property ) { // Check if we're changing the brightness. if ( $value < $this->brightness['total'] ) { $red = max( 0, min( 255, $this->red - ( $this->brightness['total'] - $value ) ) ); $green = max( 0, min( 255, $this->green - ( $this->brightness['total'] - $value ) ) ); $blue = max( 0, min( 255, $this->blue - ( $this->brightness['total'] - $value ) ) ); } elseif ( $value > $this->brightness['total'] ) { $red = max( 0, min( 255, $this->red + ( $value - $this->brightness['total'] ) ) ); $green = max( 0, min( 255, $this->green + ( $value - $this->brightness['total'] ) ) ); $blue = max( 0, min( 255, $this->blue + ( $value - $this->brightness['total'] ) ) ); } else { // If it's not smaller and it's not greater, then it's equal. return $this; } return self::new_color( 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $this->alpha . ')', 'rgba' ); } return null; } /** * Allias for the getNew method. * * @access public * @since 1.1.0 * @param string $property Can be one of the following: * red, * green, * blue, * alpha, * hue, * saturation, * lightness, * brightness. * @param int|float|string $value The new value. * @return ariColor|null */ public function get_new( $property = '', $value = '' ) { return $this->getNew( $property, $value ); } /** * Figure out what mode we're using. * * @access public * @since 1.0.0 * @param string|array $color The color we're querying. * @return string */ public function get_mode( $color ) { // Check if value is an array. if ( is_array( $color ) ) { // Does the array have an 'rgba' key? if ( isset( $color['rgba'] ) ) { $this->color = $color['rgba']; return 'rgba'; } elseif ( isset( $color['color'] ) ) { // Does the array have a 'color' key? $this->color = $color['color']; if ( is_string( $color['color'] ) && false !== strpos( $color['color'], 'rgba' ) ) { return 'rgba'; } return 'hex'; } // Is this a simple array with 4 items? if ( 4 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) && isset( $color[3] ) ) { $this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',' . intval( $color[3] ) . ')'; return 'rgba'; } elseif ( 3 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) ) { // Is this a simple array with 3 items? $this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',1)'; return 'rgba'; } // Check for other keys in the array and get values from there. $finders_keepers = array( 'r' => 'red', 'g' => 'green', 'b' => 'blue', 'a' => 'alpha', 'red' => 'red', 'green' => 'green', 'blue' => 'blue', 'alpha' => 'alpha', 'opacity' => 'alpha', ); $found = false; foreach ( $finders_keepers as $finder => $keeper ) { if ( isset( $color[ $finder ] ) ) { $found = true; $this->$keeper = $color[ $finder ]; } } // We failed, use fallback. if ( ! $found ) { $this->from_fallback(); return $this->mode; } // We did not fail, so use rgba values recovered above. $this->color = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')'; return 'rgba'; } // If a string and 3 or 6 characters long, add # since it's a hex. if ( 3 === strlen( $this->color ) || 6 === strlen( $this->color ) && false === strpos( $this->color, '#' ) ) { $this->color = '#' . $this->color; $color = $this->color; } // If we got this far, it's not an array. // Check for key identifiers in the value. $finders_keepers = array( '#' => 'hex', 'rgba' => 'rgba', 'rgb' => 'rgb', 'hsla' => 'hsla', 'hsl' => 'hsl', ); foreach ( $finders_keepers as $finder => $keeper ) { if ( false !== strrpos( $color, $finder ) ) { // Make sure hex colors have 6 digits and not more. if ( '#' === $finder && 7 < strlen( $color ) ) { $this->color = substr( $color, 0, 7 ); } return $keeper; } } // Perhaps we're using a word like "orange"? $wordcolors = $this->get_word_colors(); if ( is_string( $color ) && array_key_exists( $color, $wordcolors ) ) { $this->color = '#' . $wordcolors[ $color ]; return 'hex'; } // Fallback to hex. $this->color = $this->fallback; return 'hex'; } /** * Starts with a HEX color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_hex() { if ( ! function_exists( 'sanitize_hex_color' ) ) { require_once wp_normalize_path( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); } // Is this perhaps a word-color? $word_colors = $this->get_word_colors(); if ( array_key_exists( $this->color, $word_colors ) ) { $this->color = '#' . $word_colors[ $this->color ]; } // Sanitize color. $this->hex = sanitize_hex_color( maybe_hash_hex_color( $this->color ) ); $hex = ltrim( $this->hex, '#' ); // Fallback if needed. if ( ! $hex || 3 > strlen( $hex ) ) { $this->from_fallback(); return; } // Make sure we have 6 digits for the below calculations. if ( 3 === strlen( $hex ) ) { $hex = ltrim( $this->hex, '#' ); $hex = substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 2, 1 ) . substr( $hex, 2, 1 ); } // Set red, green, blue. $this->red = hexdec( substr( $hex, 0, 2 ) ); $this->green = hexdec( substr( $hex, 2, 2 ) ); $this->blue = hexdec( substr( $hex, 4, 2 ) ); $this->alpha = 1; // Set other color properties. $this->set_brightness(); $this->set_hsl(); $this->set_luminance(); } /** * Starts with an RGB color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_rgb() { $value = explode( ',', str_replace( array( ' ', 'rgb', '(', ')' ), '', $this->color ) ); // Set red, green, blue. $this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255; $this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255; $this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255; $this->alpha = 1; // Set the hex. $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue ); // Set other color properties. $this->set_brightness(); $this->set_hsl(); $this->set_luminance(); } /** * Starts with an RGBA color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_rgba() { // Set r, g, b, a properties. $value = explode( ',', str_replace( array( ' ', 'rgba', '(', ')' ), '', $this->color ) ); $this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255; $this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255; $this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255; $this->alpha = ( isset( $value[3] ) ) ? filter_var( $value[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : 1; // Limit values in the range of 0 - 255. $this->red = max( 0, min( 255, $this->red ) ); $this->green = max( 0, min( 255, $this->green ) ); $this->blue = max( 0, min( 255, $this->blue ) ); // Limit values 0 - 1. $this->alpha = max( 0, min( 1, $this->alpha ) ); // Set hex. $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue ); // Set other color properties. $this->set_brightness(); $this->set_hsl(); $this->set_luminance(); } /** * Starts with an HSL color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_hsl() { $value = explode( ',', str_replace( array( ' ', 'hsl', '(', ')', '%' ), '', $this->color ) ); $this->hue = $value[0]; $this->saturation = $value[1]; $this->lightness = $value[2]; $this->from_hsl_array(); } /** * Starts with an HSLA color and calculates all other properties. * * @access protected * @since 1.0.0 * @return null */ protected function from_hsla() { $value = explode( ',', str_replace( array( ' ', 'hsla', '(', ')', '%' ), '', $this->color ) ); $this->hue = $value[0]; $this->saturation = $value[1]; $this->lightness = $value[2]; $this->alpha = $value[3]; $this->from_hsl_array(); } /** * Generates the HEX value of a color given values for $red, $green, $blue. * * @access protected * @since 1.0.0 * @param int|string $red The red value of this color. * @param int|string $green The green value of this color. * @param int|string $blue The blue value of this color. * @return string */ protected function rgb_to_hex( $red, $green, $blue ) { // Get hex values properly formatted. $hex_red = $this->dexhex_double_digit( $red ); $hex_green = $this->dexhex_double_digit( $green ); $hex_blue = $this->dexhex_double_digit( $blue ); return '#' . $hex_red . $hex_green . $hex_blue; } /** * Convert a decimal value to hex and make sure it's 2 characters. * * @access protected * @since 1.0.0 * @param int|string $value The value to convert. * @return string */ protected function dexhex_double_digit( $value ) { $value = dechex( $value ); if ( 1 === strlen( $value ) ) { $value = '0' . $value; } return $value; } /** * Calculates the red, green, blue values of an HSL color. * * @access protected * @since 1.0.0 * @see https://gist.github.com/brandonheyer/5254516 */ protected function from_hsl_array() { $h = $this->hue / 360; $s = $this->saturation / 100; $l = $this->lightness / 100; $r = $l; $g = $l; $b = $l; $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s ); if ( $v > 0 ) { $m = $l + $l - $v; $sv = ( $v - $m ) / $v; $h *= 6.0; $sextant = floor( $h ); $fract = $h - $sextant; $vsf = $v * $sv * $fract; $mid1 = $m + $vsf; $mid2 = $v - $vsf; switch ( $sextant ) { case 0: $r = $v; $g = $mid1; $b = $m; break; case 1: $r = $mid2; $g = $v; $b = $m; break; case 2: $r = $m; $g = $v; $b = $mid1; break; case 3: $r = $m; $g = $mid2; $b = $v; break; case 4: $r = $mid1; $g = $m; $b = $v; break; case 5: $r = $v; $g = $m; $b = $mid2; break; } } $this->red = round( $r * 255, 0 ); $this->green = round( $g * 255, 0 ); $this->blue = round( $b * 255, 0 ); $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue ); $this->set_luminance(); } /** * Returns a CSS-formatted value for colors. * * @access public * @since 1.0.0 * @param string $mode The mode we're using. * @return string */ public function toCSS( $mode = 'hex' ) { $value = ''; switch ( $mode ) { case 'hex': $value = strtolower( $this->hex ); break; case 'rgba': $value = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')'; break; case 'rgb': $value = 'rgb(' . $this->red . ',' . $this->green . ',' . $this->blue . ')'; break; case 'hsl': $value = 'hsl(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%)'; break; case 'hsla': $value = 'hsla(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%,' . $this->alpha . ')'; break; } return $value; } /** * Alias for the toCSS method. * * @access public * @since 1.1 * @param string $mode The mode we're using. * @return string */ public function to_css( $mode = 'hex' ) { return $this->toCSS( $mode ); } /** * Sets the HSL values of a color based on the values of red, green, blue. * * @access public * @since 1.0.0 */ protected function set_hsl() { $red = $this->red / 255; $green = $this->green / 255; $blue = $this->blue / 255; $max = max( $red, $green, $blue ); $min = min( $red, $green, $blue ); $lightness = ( $max + $min ) / 2; $difference = $max - $min; if ( ! $difference ) { $hue = $saturation = 0; // Achromatic. } else { $saturation = $difference / ( 1 - abs( 2 * $lightness - 1 ) ); switch ( $max ) { case $red: $hue = 60 * fmod( ( ( $green - $blue ) / $difference ), 6 ); if ( $blue > $green ) { $hue += 360; } break; case $green: $hue = 60 * ( ( $blue - $red ) / $difference + 2 ); break; case $blue: $hue = 60 * ( ( $red - $green ) / $difference + 4 ); break; } } $this->hue = round( $hue ); $this->saturation = round( $saturation * 100 ); $this->lightness = round( $lightness * 100 ); } /** * Sets the brightness of a color based on the values of red, green, blue. * * @access protected * @since 1.0.0 */ protected function set_brightness() { $this->brightness = array( 'red' => round( $this->red * .299 ), 'green' => round( $this->green * .587 ), 'blue' => round( $this->blue * .114 ), 'total' => intval( ( $this->red * .299 ) + ( $this->green * .587 ) + ( $this->blue * .114 ) ), ); } /** * Sets the luminance of a color (range:0-255) based on the values of red, green, blue. * * @access protected * @since 1.0.0 */ protected function set_luminance() { $lum = ( 0.2126 * $this->red ) + ( 0.7152 * $this->green ) + ( 0.0722 * $this->blue ); $this->luminance = round( $lum ); } /** * Gets an array of all the wordcolors. * * @access protected * @since 1.0.0 * @return array */ protected function get_word_colors() { return array( 'aliceblue' => 'F0F8FF', 'antiquewhite' => 'FAEBD7', 'aqua' => '00FFFF', 'aquamarine' => '7FFFD4', 'azure' => 'F0FFFF', 'beige' => 'F5F5DC', 'bisque' => 'FFE4C4', 'black' => '000000', 'blanchedalmond' => 'FFEBCD', 'blue' => '0000FF', 'blueviolet' => '8A2BE2', 'brown' => 'A52A2A', 'burlywood' => 'DEB887', 'cadetblue' => '5F9EA0', 'chartreuse' => '7FFF00', 'chocolate' => 'D2691E', 'coral' => 'FF7F50', 'cornflowerblue' => '6495ED', 'cornsilk' => 'FFF8DC', 'crimson' => 'DC143C', 'cyan' => '00FFFF', 'darkblue' => '00008B', 'darkcyan' => '008B8B', 'darkgoldenrod' => 'B8860B', 'darkgray' => 'A9A9A9', 'darkgreen' => '006400', 'darkgrey' => 'A9A9A9', 'darkkhaki' => 'BDB76B', 'darkmagenta' => '8B008B', 'darkolivegreen' => '556B2F', 'darkorange' => 'FF8C00', 'darkorchid' => '9932CC', 'darkred' => '8B0000', 'darksalmon' => 'E9967A', 'darkseagreen' => '8FBC8F', 'darkslateblue' => '483D8B', 'darkslategray' => '2F4F4F', 'darkslategrey' => '2F4F4F', 'darkturquoise' => '00CED1', 'darkviolet' => '9400D3', 'deeppink' => 'FF1493', 'deepskyblue' => '00BFFF', 'dimgray' => '696969', 'dimgrey' => '696969', 'dodgerblue' => '1E90FF', 'firebrick' => 'B22222', 'floralwhite' => 'FFFAF0', 'forestgreen' => '228B22', 'fuchsia' => 'FF00FF', 'gainsboro' => 'DCDCDC', 'ghostwhite' => 'F8F8FF', 'gold' => 'FFD700', 'goldenrod' => 'DAA520', 'gray' => '808080', 'green' => '008000', 'greenyellow' => 'ADFF2F', 'grey' => '808080', 'honeydew' => 'F0FFF0', 'hotpink' => 'FF69B4', 'indianred' => 'CD5C5C', 'indigo' => '4B0082', 'ivory' => 'FFFFF0', 'khaki' => 'F0E68C', 'lavender' => 'E6E6FA', 'lavenderblush' => 'FFF0F5', 'lawngreen' => '7CFC00', 'lemonchiffon' => 'FFFACD', 'lightblue' => 'ADD8E6', 'lightcoral' => 'F08080', 'lightcyan' => 'E0FFFF', 'lightgoldenrodyellow' => 'FAFAD2', 'lightgray' => 'D3D3D3', 'lightgreen' => '90EE90', 'lightgrey' => 'D3D3D3', 'lightpink' => 'FFB6C1', 'lightsalmon' => 'FFA07A', 'lightseagreen' => '20B2AA', 'lightskyblue' => '87CEFA', 'lightslategray' => '778899', 'lightslategrey' => '778899', 'lightsteelblue' => 'B0C4DE', 'lightyellow' => 'FFFFE0', 'lime' => '00FF00', 'limegreen' => '32CD32', 'linen' => 'FAF0E6', 'magenta' => 'FF00FF', 'maroon' => '800000', 'mediumaquamarine' => '66CDAA', 'mediumblue' => '0000CD', 'mediumorchid' => 'BA55D3', 'mediumpurple' => '9370D0', 'mediumseagreen' => '3CB371', 'mediumslateblue' => '7B68EE', 'mediumspringgreen' => '00FA9A', 'mediumturquoise' => '48D1CC', 'mediumvioletred' => 'C71585', 'midnightblue' => '191970', 'mintcream' => 'F5FFFA', 'mistyrose' => 'FFE4E1', 'moccasin' => 'FFE4B5', 'navajowhite' => 'FFDEAD', 'navy' => '000080', 'oldlace' => 'FDF5E6', 'olive' => '808000', 'olivedrab' => '6B8E23', 'orange' => 'FFA500', 'orangered' => 'FF4500', 'orchid' => 'DA70D6', 'palegoldenrod' => 'EEE8AA', 'palegreen' => '98FB98', 'paleturquoise' => 'AFEEEE', 'palevioletred' => 'DB7093', 'papayawhip' => 'FFEFD5', 'peachpuff' => 'FFDAB9', 'peru' => 'CD853F', 'pink' => 'FFC0CB', 'plum' => 'DDA0DD', 'powderblue' => 'B0E0E6', 'purple' => '800080', 'red' => 'FF0000', 'rosybrown' => 'BC8F8F', 'royalblue' => '4169E1', 'saddlebrown' => '8B4513', 'salmon' => 'FA8072', 'sandybrown' => 'F4A460', 'seagreen' => '2E8B57', 'seashell' => 'FFF5EE', 'sienna' => 'A0522D', 'silver' => 'C0C0C0', 'skyblue' => '87CEEB', 'slateblue' => '6A5ACD', 'slategray' => '708090', 'slategrey' => '708090', 'snow' => 'FFFAFA', 'springgreen' => '00FF7F', 'steelblue' => '4682B4', 'tan' => 'D2B48C', 'teal' => '008080', 'thistle' => 'D8BFD8', 'tomato' => 'FF6347', 'turquoise' => '40E0D0', 'violet' => 'EE82EE', 'wheat' => 'F5DEB3', 'white' => 'FFFFFF', 'whitesmoke' => 'F5F5F5', 'yellow' => 'FFFF00', 'yellowgreen' => '9ACD32', ); } /** * Use fallback object. * * @access protected * @since 1.2.0 */ protected function from_fallback() { $this->color = $this->fallback; if ( ! $this->fallback_obj ) { $this->fallback_obj = self::newColor( $this->fallback ); } $this->color = $this->fallback_obj->color; $this->mode = $this->fallback_obj->mode; $this->red = $this->fallback_obj->red; $this->green = $this->fallback_obj->green; $this->blue = $this->fallback_obj->blue; $this->alpha = $this->fallback_obj->alpha; $this->hue = $this->fallback_obj->hue; $this->saturation = $this->fallback_obj->saturation; $this->lightness = $this->fallback_obj->lightness; $this->luminance = $this->fallback_obj->luminance; $this->hex = $this->fallback_obj->hex; } /** * Handle non-existing public methods. * * @access public * @since 1.1.0 * @param string $name The method name. * @param mixed $arguments The method arguments. * @return mixed */ public function __call( $name, $arguments ) { if ( method_exists( $this, $name ) ) { call_user_func( array( $this, $name ), $arguments ); } else { return $arguments; } } /** * Handle non-existing public static methods. * * @static * @access public * @since 1.1.0 * @param string $name The method name. * @param mixed $arguments The method arguments. * @return mixed */ public static function __callStatic( $name, $arguments ) { if ( method_exists( __CLASS__, $name ) ) { call_user_func( array( __CLASS__, $name ), $arguments ); } else { return $arguments; } } } } lib/class-kirki-color.php000064400000025212147177211530011365 0ustar00mode; } return $obj->toCSS( $mode ); } /** * Gets the rgb value of a color. * * @static * @access public * @param string $color The color. * @param boolean $implode Whether we want to implode the values or not. * @return array|string */ public static function get_rgb( $color, $implode = false ) { $obj = ariColor::newColor( $color ); if ( $implode ) { return $obj->toCSS( 'rgb' ); } return array( $obj->red, $obj->green, $obj->blue ); } /** * A proxy for the sanitize_color method. * * @static * @access public * @param string|array $color The color to convert. * @return string The hex value of the color. */ public static function rgba2hex( $color ) { return self::sanitize_color( $color, 'hex' ); } /** * Get the alpha channel from an rgba color. * * @static * @access public * @param string $color The rgba color formatted like rgba(r,g,b,a). * @return int|float The alpha value of the color. */ public static function get_alpha_from_rgba( $color ) { $obj = ariColor::newColor( $color ); return $obj->alpha; } /** * Gets the rgba value of the $color. * * @static * @access public * @param string $color The hex value of a color. * @param int|float $alpha Opacity level (0-1). * @return string */ public static function get_rgba( $color = '#fff', $alpha = 1 ) { $obj = ariColor::newColor( $color ); if ( 1 == $alpha ) { return $obj->toCSS( 'rgba' ); } // Make sure that opacity is properly formatted. // Converts 1-100 values to 0-1. if ( $alpha > 1 || $alpha < -1 ) { // Divide by 100. $alpha /= 100; } // Get absolute value. $alpha = abs( $alpha ); // Max 1. if ( 1 < $alpha ) { $alpha = 1; } $new_obj = $obj->getNew( 'alpha', $alpha ); return $new_obj->toCSS( 'rgba' ); } /** * Strips the alpha value from an RGBA color string. * * @static * @access public * @param string $color The RGBA color string. * @return string The corresponding RGB string. */ public static function rgba_to_rgb( $color ) { $obj = ariColor::newColor( $color ); return $obj->toCSS( 'rgb' ); } /** * Gets the brightness of the $hex color. * * @static * @access public * @param string $hex The hex value of a color. * @return int Value between 0 and 255. */ public static function get_brightness( $hex ) { $hex = self::sanitize_hex( $hex, false ); // Returns brightness value from 0 to 255. return intval( ( ( hexdec( substr( $hex, 0, 2 ) ) * 299 ) + ( hexdec( substr( $hex, 2, 2 ) ) * 587 ) + ( hexdec( substr( $hex, 4, 2 ) ) * 114 ) ) / 1000 ); } /** * Adjusts brightness of the $hex color. * * @static * @access public * @param string $hex The hex value of a color. * @param integer $steps Should be between -255 and 255. Negative = darker, positive = lighter. * @return string Returns hex color. */ public static function adjust_brightness( $hex, $steps ) { $hex = self::sanitize_hex( $hex, false ); $steps = max( -255, min( 255, $steps ) ); // Adjust number of steps and keep it inside 0 to 255. $red = max( 0, min( 255, hexdec( substr( $hex, 0, 2 ) ) + $steps ) ); $green = max( 0, min( 255, hexdec( substr( $hex, 2, 2 ) ) + $steps ) ); $blue = max( 0, min( 255, hexdec( substr( $hex, 4, 2 ) ) + $steps ) ); $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT ); $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT ); $blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT ); return self::sanitize_hex( $red_hex . $green_hex . $blue_hex ); } /** * Mixes 2 hex colors. * The "percentage" variable is the percent of the first color. * to be used it the mix. default is 50 (equal mix). * * @static * @access public * @param string|false $hex1 Color. * @param string|false $hex2 Color. * @param int $percentage A value between 0 and 100. * @return string Returns hex color. */ public static function mix_colors( $hex1, $hex2, $percentage ) { $hex1 = self::sanitize_hex( $hex1, false ); $hex2 = self::sanitize_hex( $hex2, false ); $red = ( $percentage * hexdec( substr( $hex1, 0, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 0, 2 ) ) ) / 100; $green = ( $percentage * hexdec( substr( $hex1, 2, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 2, 2 ) ) ) / 100; $blue = ( $percentage * hexdec( substr( $hex1, 4, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 4, 2 ) ) ) / 100; $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT ); $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT ); $blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT ); return self::sanitize_hex( $red_hex . $green_hex . $blue_hex ); } /** * Convert hex color to hsv. * * @static * @access public * @param string $hex The hex value of color 1. * @return array Returns array( 'h', 's', 'v' ). */ public static function hex_to_hsv( $hex ) { $rgb = (array) (array) self::get_rgb( self::sanitize_hex( $hex, false ) ); return self::rgb_to_hsv( $rgb ); } /** * Convert hex color to hsv. * * @static * @access public * @param string $color The rgb color to convert array( 'r', 'g', 'b' ). * @return array Returns array( 'h', 's', 'v' ). */ public static function rgb_to_hsv( $color = array() ) { $var_r = ( $color[0] / 255 ); $var_g = ( $color[1] / 255 ); $var_b = ( $color[2] / 255 ); $var_min = min( $var_r, $var_g, $var_b ); $var_max = max( $var_r, $var_g, $var_b ); $del_max = $var_max - $var_min; $h = 0; $s = 0; $v = $var_max; if ( 0 != $del_max ) { $s = $del_max / $var_max; $del_r = ( ( ( $var_max - $var_r ) / 6 ) + ( $del_max / 2 ) ) / $del_max; $del_g = ( ( ( $var_max - $var_g ) / 6 ) + ( $del_max / 2 ) ) / $del_max; $del_b = ( ( ( $var_max - $var_b ) / 6 ) + ( $del_max / 2 ) ) / $del_max; if ( $var_r == $var_max ) { $h = $del_b - $del_g; } elseif ( $var_g == $var_max ) { $h = ( 1 / 3 ) + $del_r - $del_b; } elseif ( $var_b == $var_max ) { $h = ( 2 / 3 ) + $del_g - $del_r; } if ( $h < 0 ) { $h++; } if ( $h > 1 ) { $h--; } } return array( 'h' => round( $h, 2 ), 's' => round( $s, 2 ), 'v' => round( $v, 2 ), ); } /** * This is a very simple algorithm that works by summing up the differences between the three color components red, green and blue. * A value higher than 500 is recommended for good readability. * * @static * @access public * @param string $color_1 The 1st color. * @param string $color_2 The 2nd color. * @return string */ public static function color_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) { $color_1 = self::sanitize_hex( $color_1, false ); $color_2 = self::sanitize_hex( $color_2, false ); $color_1_rgb = self::get_rgb( $color_1 ); $color_2_rgb = self::get_rgb( $color_2 ); $r_diff = max( $color_1_rgb[0], $color_2_rgb[0] ) - min( $color_1_rgb[0], $color_2_rgb[0] ); $g_diff = max( $color_1_rgb[1], $color_2_rgb[1] ) - min( $color_1_rgb[1], $color_2_rgb[1] ); $b_diff = max( $color_1_rgb[2], $color_2_rgb[2] ) - min( $color_1_rgb[2], $color_2_rgb[2] ); $color_diff = $r_diff + $g_diff + $b_diff; return $color_diff; } /** * This function tries to compare the brightness of the colors. * A return value of more than 125 is recommended. * Combining it with the color_difference function above might make sense. * * @static * @access public * @param string $color_1 The 1st color. * @param string $color_2 The 2nd color. * @return string */ public static function brightness_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) { $color_1 = self::sanitize_hex( $color_1, false ); $color_2 = self::sanitize_hex( $color_2, false ); $color_1_rgb = self::get_rgb( $color_1 ); $color_2_rgb = self::get_rgb( $color_2 ); $br_1 = ( 299 * $color_1_rgb[0] + 587 * $color_1_rgb[1] + 114 * $color_1_rgb[2] ) / 1000; $br_2 = ( 299 * $color_2_rgb[0] + 587 * $color_2_rgb[1] + 114 * $color_2_rgb[2] ) / 1000; return intval( abs( $br_1 - $br_2 ) ); } /** * Uses the luminosity to calculate the difference between the given colors. * The returned value should be bigger than 5 for best readability. * * @static * @access public * @param string $color_1 The 1st color. * @param string $color_2 The 2nd color. * @return string */ public static function lumosity_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) { $color_1 = self::sanitize_hex( $color_1, false ); $color_2 = self::sanitize_hex( $color_2, false ); $color_1_rgb = self::get_rgb( $color_1 ); $color_2_rgb = self::get_rgb( $color_2 ); $l1 = 0.2126 * pow( $color_1_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_1_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_1_rgb[2] / 255, 2.2 ); $l2 = 0.2126 * pow( $color_2_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_2_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_2_rgb[2] / 255, 2.2 ); $lum_diff = ( $l1 > $l2 ) ? ( $l1 + 0.05 ) / ( $l2 + 0.05 ) : ( $l2 + 0.05 ) / ( $l1 + 0.05 ); return round( $lum_diff, 2 ); } } inc/bootstrap.php000064400000000406147177211530010053 0ustar003+͝;.n0SMXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&ńbBXL a1!,&=owGyyP^;4n_W]n9_/a]?~gUrUczl̠>IENDB`assets/images/kirki-logo.jpg000064400000027454147177211530012110 0ustar00JFIFHHCC 1  !"1#9vA2:  > !"1A2Q# 7Rqr$5Bat%6b ?4i4ƚcM1Li4i4ƚcM1Li4i4ƚcM1Li4i4ƚcM1Li4i4ƚcM1"o2SvWy΋Nn#*gk7,5Wh.Lr4`U67?K\jJhv޲H3ۢIqmB]fM )RP-&E*-5*E-b3)"=Y##F߇>x9?5[*dujMKzDpW +5䙝A0.@p(CS;kbkާyyec1x͓y| ,!9Ǚ#Q!*~3M1%<׫ zFIKƁPԱ46cn"mUdq&V[ӨeHJ#x ]WJȖss"DjobN e7MTT1&P@sNՆcl}JlvBؕ -VA•uٯN_b Kڝ#vb~HHzfVlB텽tSG)ښ &\|_p,TRTp%ЏD iBYqy SN,FOVJd4oXdta~Ô^;Su)Yf^_|ܦyJ2p۳9'OQCO+vtiMv LݱU" (+wDw}1kV L5luܶΧ>֔ϒs8$RװQwγ K^0b S j{\4Yz/Z0#*_r:Mig;o4fJxY#ҝ[@u$%[BV z=[MG$StK&")9nH᳂(i\]&J#)ZJy ujۭ(ᢚ&*ʺ76IcfՏpn'sme058ۘUА@xBLSוRz$sG"/^ƚcM1Li4j~C@qlyJcȹёqX#RY' . {H \HnzK[M5̓L5zsl#FJ3DA7S#kOQwZͷ:Vrʘֹ mh̔4xZD1Nf'w}T54Z=YITs7D N&d r& IC/ tC:~c:GӼƴ05h֏|+3vx&jNP{D7Tr<4Hݱģ$#GjmRj:6EQ(0EC XG坦RJYI$.,RT&Hbݻt߹뛇qݒr;$eεiX9i&%Wm26de!GOq>Q$1bI陊Litt͜Q L SUP *E9LCSD39$HGXdHْHF FC#C+Akz+Rګjk٭b$E4*r4l̎IWYꍙ%z^_&MsaNsvRG.(+rE=oVۘc>ѩH/%ōEX[t:β1bCn|ٌrVNYcZ+ˋY $川Gi)V>I'*P,i$Т!LcbIRAhWU͑ʆ ;,x1yG!/}kPy-SkuOmMɫ}ÆH>j8" 2i/;jL1Li4i4ƚߚ[?,S7[kjB,RE\a/c%c09B;v OFj-Ӗ$/_ VpJц -G*gvt8;Bw7Nz!}GZɆ),,eg# kջ4!&%Ҥ5R%XO`ZNWA uEA?lXaE3 Xrncb]#0-:F$xZ%oF} mkHA 6v UWBC EHߠU0 1ö%"6[z9>&D LDurظfm5r<=Py?##֭pidPDC+۝1x"QgI5nPIEU߱2CY-$/,b: Jm!` JsѝBڠWU=D65}L{8֥1A7s=_ad{={3t!'eUfCJCfCI~xrSFScwTBB"+<,|>9r__ 1Li4i4ƚΗm*K֧; :Mz6zrD4{lnBIB3HUD_mje[5Ep1f:#JSASk9nFOQuUV[ ^;S4B@T >.;2*(Fh瓱Z_z>UgR9fe,Ϸ{U@ԝsy++@dbIa J{a?(¢n 7,I8JDA@]B$D" o0(`L~z,zE='^Ar 5}8WQ7dԐ JLx"$VS*\OL`upOS$S`ف(g65:]:\PTBUh쾅M9#i܇$-a~e~;D}dNcndmkH`8=,| c(VXZn볺cM1Li4i5#Q5̦N&fI.^L9#HEHxbt$dlߧ3-޸"ؖJ#JZdK7kYk'J:P6Pv% l6tjj)cH,ޓ34ꛖʕvOi"VP6S/wm"+)Ykʪ,и-VBXErb9hB+g4]ѴzӜvV^VE" z 72SRin Լ^\q[LDشэQVYg-S'ۅ-9Wr v=IXh' to!⢩a{mrRHf[jp+0[h.RWY݉J#K-p{a%b |tu$YV'R;m-k!kB JalgL3Kɐ<*$1h}{nfAdh/BWebbXFe>̑J4nC6rx{W+2W+]RA+*^Aв0GEA6h+Oy9j(bbͺ4`eY3'%Qi*63H PFVJ[${U[`G[i-Ĵ<§ԙĎ9_)KzlGQ#.X#*.hjݱeEOR|Jp0`8jVlGu+ۘJF%N_d2]ak+;W"KfÅD5^^Fv Hت~zm 'k phæ拫J+ׇz%gEU~]LݪɴOыĴX]U^tfu L=0H3 I"HM;I"Y-XN1Li4i4ƚcMETPr)(z&[*>#GnPX^(Ih;'ʀA){l޽|}U;hbO#[GRy}s=>Ok[[8&wld^w4E,m_!id땳Y'S;o䯌QqJE*s@EW'cxѯ&TE556wb+YvMU24I\WiNԫ^|}"[j +,4x̦fV#/zV햶Be c*!WTbjV-0x*tH(edI I*+_;PP3VL7(C' RU#dIOSp͜YkڅD UT2Ds"9WteeאAα0y([ {̵NISUzr(GY +(q{QS # ?Q2!cF T^8HNu mb+XUj |G;"_i#MYXtU4q\eO#搪<xES +pDžos?Ca5*Yj)@Tt^8/Κʁ͒@YP2MAy +1eɶvBO޸>G2cn`;f"#dNbN yKk]vMp[^>*Q8qN2=Õk ҄b$y_5R6Li4i4ƚcM1Li4>]U|T=}s\J ZuLF?]]2\>u==. 2y1Lbs<ҵϟ:d~77O&*9+#'ϒy|?(.>ZòV?)rִȗe:~+u?%7^~C=EBkew*k7Vv%[1Y$d7j xks5xqw/<`y4<κJ( adI$O$$I:4ƚcM1Li4i5X_|KfrN@l]ZElȻ =k&w*֪\ҫQ 4NLӧrmV7$y)<1 Z`@X(2VRIέ@=~\WÈ#ިZijvl<=W5Z%ռk"3#|EĦ sH':vݡٙxT׬Ac^5 ^kFZz}c*&~r\xޮL,UXnOs xS\9xGLi-=T04T.+յ˽$3)lq ꍐy<6^ESش0}URn ሏjՀӪGq; ̐c73?)k4`1#鴒\M~ (#CRj;i żxπ[{hV1Ҽ1mfMeVu~BWQBrYbSFNNu$G !aTpBd<ך:X$/a$֊K1`e ð^0񩅘,~kyO/#: zt/czŗ3}և64gj [k\b(kR+!$fױ:oC+Zr1ENzqeB5i&`f@P(P C)bkFH]\/#!ଊ>>~O'j!M__^L/Źm#=O2̳^Zi4U#ը'tLRW1/>'լHjF!ؐTYa^BiQv=n?}{^87?*h;Zr?B fjխ#)+8xkl]]uՖdfizX5y8grg-lTOxcX[s LLqh.Gu3U-΀,JT/ IRؚIj! Ŀrd`faʀ}<ju11Li4j_4OPO?+[)No7[4[ϏBZ%SpoKW؇!hTUQYR&eT{kc'\:`Ibadk7ݵw]PUAm޴D(X0 ]^A/K7Y%i$p}̬/9 [IplU ? ,%gLi *5/]ZaY ag(aG35Y=qw$c =,BۂFhD$v։4d~*nGIID"67wˑ!Vf}GR ږ⬵vW; Itj\zʗK c3JYzPߨ17'N 9*I•=ʮyO5zbHdh̋ܜsVBG~xwU˨[M3}^rZz͌E0H4SypXQ!1! ڤ^N9u-(ǕoFZ >uE%#3ه2#uW/ 寎v;DEW$jknR-6=}^lMjeM )!$IYe_J6bͬ dhaю5]9YZ{$앑DR3QA.c#%y.$p FU_XࣞedN'J>viI[%{pl$.S։5RQU~nPWB.+V qv Qp E9nSrT;ϸHı %:Xoh/1KԦrN-ءda"r3#$QѵS!#E64똴9^B#v[r}H#fxja0UR%t'ЩrM*VXڽijc)=8ļToW&uxk#yen[5t]v9-N첯 dMڸVV*I1Mpl=VNjC]Kxu|T<QhS f,$ai&b;ݏjGHҷ"%yb_2v\63?e[wdW~gpt$aͳ4AH <^? 28]HS {G^V4iiA$Iݙ~5Y$d|$`?嫖W=1Li4j_4OPO?+[)No7O#Swopڛ^~Nm"ʬU6mk<(F')^bbi9>U_z4j?jIk "VX2wE%*DͷR,Js]ACO6-im nK)EHKI|$[EO|[ J i#kWIq0Kr(MI_$#C~5$>7o7Y /_UOl?2,Li4i4ƚ|>q|ֶԬZs0D yf, N5!S]:&B /ht#iGb'Nc${|khL i <x/>xԖ-)Teѱ;\uMHAbhzDd&7+LUN[w_%xbu -JKr9GѯE`CŏqUS?AG朜K.)jFŕMA8bE~ #d~B=,k#ڝs=QՌX+bhrb;e@QX7 nk=t$Ok+`#OA<~y⮼'G ,>KpVIVFRe[V?\MKL$&99A윊KԍƛDcbJ'4Ex # N8YD|5CD))ߎI?$-Up׳q">5ZU!X!F {>-r' y).}5-.{}^J>m׊UxS*:Tld TFۘx֪Cr1ܡ ?*IQ;O }`[.3l)[@:#|OUVHVAb%:f׾Li4i4ƚcM1Li4i4ƚcM1Liassets/images/2cr.png000064400000001545147177211530010524 0ustar00PNG  IHDRj^QtiCCPHD 709-A(c``rI-fa``+) rwRR` ` \\À|/JyӦ|6rV%:wJjq2#R d[:E%@v [^RbOEW; ¾V d? / v:@rF"l&]9P|e   9%.#H]}j^h0LlKR+J@ *23J rRs JKRt=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } pro-src/packages/kirki-pro-responsive/readme.txt000064400000000540147177211530016016 0ustar00=== Kirki Responsive Control === Contributors: davidvongries Tags: kirki-responsive-control Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20responsive == Description == Responsive extension for Kirki Customizer Framework. pro-src/packages/kirki-pro-responsive/vendor/autoload.php000064400000001403147177211530017635 0ustar00 array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); pro-src/packages/kirki-pro-responsive/vendor/composer/autoload_real.php000064400000002161147177211530022471 0ustar00register(true); return $loader; } } pro-src/packages/kirki-pro-responsive/vendor/composer/platform_check.php000064400000001635147177211530022644 0ustar00= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.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 ); } pro-src/packages/kirki-pro-responsive/vendor/composer/ClassLoader.php000064400000040220147177211530022050 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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 */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $classMap * * @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 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) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $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 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) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $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] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $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 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 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 indexed by their corresponding vendor directories. * * @return 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); } } pro-src/packages/kirki-pro-responsive/vendor/composer/autoload_classmap.php000064400000000336147177211530023353 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); pro-src/packages/kirki-pro-responsive/vendor/composer/autoload_static.php000064400000002562147177211530023042 0ustar00 array ( 'Kirki\\Pro\\Responsive\\' => 21, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\Responsive\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitfce553b9a6fa4102465a84b7e770c06c::$classMap; }, null, ClassLoader::class); } } pro-src/packages/kirki-pro-responsive/vendor/composer/InstalledVersions.php000064400000037417147177211530023342 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } pro-src/packages/kirki-pro-responsive/vendor/composer/installed.json000064400000000105147177211530022013 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } pro-src/packages/kirki-pro-responsive/vendor/composer/installed.php000064400000001344147177211530021637 0ustar00 array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); pro-src/packages/kirki-pro-responsive/src/Init.php000064400000025620147177211530016231 0ustar00register_control_type( '\Kirki\Pro\Control\Responsive' ); } /** * The control type. * * @param array $control_types The existing control types. */ public function control_type( $control_types ) { $control_types['kirki-responsive'] = 'Kirki\Pro\Control\Responsive'; return $control_types; } /** * Parse the "default" argument. * This method will format the "default" argument to contains the devices that wraps the default value. * * @since 1.0.0 * * @param array $args The field arguments. * @return array $args The modifiled field arguments. */ public function parse_default_arg( $args ) { $has_responsive_default = true; if ( isset( $args['default'] ) ) { if ( is_array( $args['default'] ) ) { if ( ! isset( $args['default']['desktop'] ) && ! isset( $args['default']['tablet'] ) && ! isset( $args['default']['mobile'] ) ) { $has_responsive_default = false; } } else { $has_responsive_default = false; } } if ( ! $has_responsive_default ) { if ( isset( $args['default'] ) ) { $args['default'] = array( 'desktop' => $args['default'], ); } else { $args['default'] = array( 'desktop' => '', ); } } return $args; } /** * Parse the output argument. * This method will format the "output" argument to modify the "media_query" based on the targetted device. * This method will be called inside of "default" argument loop when the control is using responsive mode. * * @since 1.0.0 * * @param array $args The field arguments. * @param string $device The targetted device. * * @return array $args The modified field arguments. */ public function parse_output_arg( $args, $device ) { if ( isset( $args['output'] ) && ! empty( $args['output'] ) ) { foreach ( $args['output'] as $index => $output ) { if ( isset( $output['media_query'] ) ) { if ( isset( $output['media_query'][ $device ] ) ) { $args['output'][ $index ]['media_query'] = $output['media_query'][ $device ]; } else { // If current device is not set in the "media_query", then the output won't work. unset( $args['output'][ $index ] ); } } else { // If "media_query" is not provided in the "output" arg, then the output won't work. unset( $args['output'][ $index ] ); } } } return $args; } /** * Exclude responsive field (field here means group of controls) from default field's init call. * * @see wp-content/plugins/kirki-dev/packages/kirki-framework/field/src/Field.php * @since 1.0.0 * * @param bool $condition The existing condition. * @param Object $field The field object. * @param array $args The field args. * * @return bool */ public function exclude_init( $condition, $field, $args ) { if ( isset( $args['responsive'] ) && $args['responsive'] ) { return true; } return $condition; } /** * Replace the default field init with custom init. * * @see wp-content/plugins/kirki-dev/packages/kirki-framework/field/src/Field.php * @since 1.0.0 * * @param Object $field The field object. * @param array $args The Kirki field args. * @param string $control_class The control class name if it exists. */ public function field_init( $field, $args, $control_class ) { // Stop if this field doesn't have the "responsive" argument. if ( ! isset( $args['responsive'] ) || ! $args['responsive'] ) { return; } $this->register_real_controls( $field, $args, $control_class ); } /** * Register the real controls. * * @since 1.0.0 * * @param Object $field The field object. * @param array $args The Kirki field args. * @param string $control_class The control class name if it exists. */ public function register_real_controls( $field, $args, $control_class = '' ) { $defaults = $this->parse_default_arg( $args ); $defaults = $defaults['default']; $defaults = array_reverse( $defaults ); $devices = []; $inside_horizontal_layout = property_exists( $field, 'type' ) && in_array( $field->type, $this->horizontal_types, true ) ? true : false; foreach ( $defaults as $device => $value ) { array_push( $devices, $device ); } $devices = array_reverse( $devices ); $devices_control_id = 'kirki_responsive__' . $args['settings']; $loop_count = 0; foreach ( $defaults as $device => $value ) { $loop_count++; if ( ! $inside_horizontal_layout && 1 === $loop_count ) { $this->add_devices_control( $devices_control_id, $args, $devices, $inside_horizontal_layout ); } $new_control_args = $args; $new_control_args['default'] = $value; $new_control_args['settings'] = $args['settings'] . '[' . $device . ']'; $new_control_args['device'] = $device; if ( ! isset( $new_control_args['wrapper_attrs'] ) ) { $new_control_args['wrapper_attrs'] = []; } $new_control_args['wrapper_attrs']['data-kirki-parent-responsive-id'] = $devices_control_id; $new_control_args['wrapper_attrs']['data-kirki-device-preview'] = $device; if ( isset( $new_control_args['label'] ) ) { unset( $new_control_args['label'] ); } if ( isset( $new_control_args['description'] ) ) { unset( $new_control_args['description'] ); } if ( isset( $new_control_args['responsive'] ) ) { unset( $new_control_args['responsive'] ); } $wrapper_class = ''; /** * If `$control_class` is empty, then we assume this is a "parent field" and not the "real controls". * A "parent field" here means: a parent of group of controls such as field-dimensions, field-typography, etc. */ if ( ! $control_class ) { $wrapper_class .= ' customize-control-kirki-hidden-field'; } if ( $inside_horizontal_layout ) { $wrapper_class .= ' customize-control-kirki-responsive-horizontal'; } if ( ! empty( $wrapper_class ) ) { if ( isset( $new_control_args['wrapper_attrs']['class'] ) ) { $new_control_args['wrapper_attrs']['class'] .= $wrapper_class; } else { $new_control_args['wrapper_attrs']['class'] = '{default_class}' . $wrapper_class; } } $new_control_args = $this->parse_output_arg( $new_control_args, $device ); $field_classname = get_class( $field ); new $field_classname( $new_control_args ); if ( $inside_horizontal_layout && count( $devices ) === $loop_count ) { $this->add_devices_control( $devices_control_id, $args, $devices, $inside_horizontal_layout ); } } } /** * Add devices control via $wp_customize. * * @param string $id The control's ID. * @param array $args The control arguments. * @param array $devices The specified devices. * @param bool $inside_horizontal_layout Whether or not this control is inside a horizontal layout. */ public function add_devices_control( $id, $args, $devices, $inside_horizontal_layout = false ) { unset( $args['responsive'] ); if ( isset( $args['default'] ) ) { unset( $args['default'] ); } if ( isset( $args['transport'] ) ) { unset( $args['transport'] ); } if ( isset( $args['output'] ) ) { unset( $args['output'] ); } if ( isset( $args['wrapper_attrs'] ) ) { if ( isset( $args['wrapper_attrs']['data-kirki-parent-responsive-id'] ) ) { unset( $args['wrapper_attrs']['data-kirki-parent-responsive-id'] ); } if ( isset( $args['wrapper_attrs']['data-kirki-device-preview'] ) ) { unset( $args['wrapper_attrs']['data-kirki-device-preview'] ); } } $args['settings'] = $id; $args['type'] = 'kirki-responsive'; if ( ! $inside_horizontal_layout ) { if ( ! isset( $args['wrapper_opts'] ) ) { $args['wrapper_opts'] = []; } $args['wrapper_opts']['gap'] = 'small'; } $args['choices'] = [ 'devices' => $devices, ]; new Responsive( $args ); } /** * Filter the value for responsive fields. * * @see wp-content/plugins/kirki-dev/packages/kirki-framework/data-option/src/Option.php * * @param mixed $value The field value. * @param string $field_name The field name. * @param mixed $default The default value. * @param string $type The option type (theme_mod or option). * * @return mixed The filtered value. */ public function kirki_get_value( $value = '', $field_name = '', $default = '', $type = 'theme_mod' ) { /** * The "option" will be handled by "kirki_get_value" method in * wp-content/plugins/kirki-dev/packages/kirki-framework/data-option/src/Option.php file. */ if ( 'option' === $type ) { return $value; } // If the field name doesn't contain a '[', then it's not a sub-item of another field. if ( false === strpos( $field_name, '[' ) ) { return $value; } // If this is not part of a responsive field, then return the value. if ( ! in_array( $field_name, Responsive::$sub_field_names, true ) ) { return $value; } /** * If we got here then this is part of an option array. * We need to get the 1st level, and then find the item inside that array. */ $parts = \explode( '[', $field_name ); $value = get_theme_mod( $parts[0], [] ); foreach ( $parts as $key => $part ) { /** * Skip the 1st item, it's already been dealt with * when we got the value initially right before this loop. */ if ( 0 === $key ) { continue; } $part = str_replace( ']', '', $part ); /** * If the item exists in the value, then change $value to the item. * This runs recursively for all parts until we get to the end. */ if ( is_array( $value ) && isset( $value[ $part ] ) ) { $value = $value[ $part ]; continue; } /** * If we got here, the item was not found in the value. * We need to change the value accordingly depending on whether * this is the last item in the loop or not. */ $value = ( isset( $parts[ $key + 1 ] ) ) ? [] : ''; } $value = empty( $value ) ? $default : $value; return $value; } } pro-src/packages/kirki-pro-responsive/src/control.js000064400000007210147177211530016626 0ustar00import "./control.scss"; (function ($) { const api = wp.customize; const setupDevices = () => { // Get all controls which are responsive-able (not the device control it self). const childControls = document.querySelectorAll( "[data-kirki-parent-responsive-id]" ); if (!childControls.length) return; // Responsive ids are collection of the id of the responsive controls (the device controls). let responsiveIds = []; [].slice.call(childControls).forEach(function (childControl) { const parentResponsiveId = childControl.dataset.kirkiParentResponsiveId; const device = childControl.dataset.kirkiDevicePreview; const setting = childControl.dataset.kirkiSetting; if (!responsiveIds.includes(parentResponsiveId)) { responsiveIds.push(parentResponsiveId); } /** * Grouped controls are collection of control which contains some child-controls. * Example of grouped controls: field-dimensions, field-typography, field-multicolor. */ const groupedControls = document.querySelectorAll( '[data-kirki-parent-control-setting="' + setting + '"]' ); // Check if childControl is a field that groups other controls. if (groupedControls.length) { [].slice.call(groupedControls).forEach(function (groupedControl) { // Inherit the parentResponsiveId & device from the group's parent. groupedControl.dataset.kirkiParentResponsiveId = parentResponsiveId; groupedControl.dataset.kirkiDevicePreview = device; }); } }); // Move the device icons next to the control's title. responsiveIds.forEach(function (responsiveId) { const $deviceButtons = $( "#customize-control-" + responsiveId + " .kirki-device-buttons" ); $deviceButtons.attr("data-kirki-devices-for", responsiveId); $deviceButtons.appendTo( "#customize-control-" + responsiveId + " .customize-control-title" ); }); }; const setupPreview = () => { function init() { switchDevice("desktop"); // Initial state. setupDeviceClicks(); syncPreviewButtons(); } function setupDeviceClicks() { const deviceButtons = document.querySelectorAll(".kirki-device-button"); if (!deviceButtons.length) return; // Loop through Kirki device buttons and assign the click event. [].slice.call(deviceButtons).forEach(function (deviceButton) { deviceButton.addEventListener("click", function (e) { var device = this.getAttribute("data-kirki-device"); // Trigger WordPress device event. api.previewedDevice.set(device); }); }); } /** * Sync device preview button from WordPress to Kirki and vice versa. */ function syncPreviewButtons() { // Bind device changes from WordPress default. api.previewedDevice.bind(function (newDevice) { switchDevice(newDevice); }); } /** * Setup device preview. * * @param string device The device (mobile, tablet, or desktop). */ function switchDevice(device) { $(".kirki-device-button").removeClass("is-active"); $(".kirki-device-button-" + device).addClass("is-active"); $("[data-kirki-device-preview]").addClass("kirki-responsive-item-hidden"); $('[data-kirki-device-preview="' + device + '"]').removeClass( "kirki-responsive-item-hidden" ); } init(); }; // Run setupDevices & setupPreview after the customizer is ready. wp.customize.bind("ready", function () { setTimeout(function () { setupDevices(); setupPreview(); }, 250); }); })(jQuery); pro-src/packages/kirki-pro-responsive/src/control.scss000064400000004101147177211530017161 0ustar00.customize-control-kirki-responsive { position: relative; z-index: 1; // Make it above it's children control. .customize-control-title { display: flex; } } .kirki-responsive { .kirki-device-buttons, .kirki-device-button { list-style: none; margin: 0; padding: 0; } .kirki-device-buttons { display: flex; top: 3px; justify-content: flex-start; position: relative; margin-left: 12px; font-weight: 600; font-size: 14px; } .kirki-device-button { display: flex; align-items: center; justify-content: center; position: relative; margin-right: 3px; width: 22px; height: 22px; background-color: #eee; border-radius: 50%; cursor: pointer; transition: all 0.2s; i { width: 11px; height: 11px; font-size: 11px; } &.is-active, &:hover { background-color: #ddd; } } } [data-kirki-parent-responsive-id] { &.customize-control-kirki-switch { top: -5px; .kirki-switch { .kirki-toggle-switch-label { padding-top: 0; } .toggle-on, .toggle-off { bottom: -5px; } } } } .customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] { margin-bottom: -35px; &.customize-control-kirki-react-colorful { margin-bottom: -30px; .kirki-trigger-circle-wrapper { z-index: 2; // Make it above the responsive devices. } } &.customize-control-kirki-checkbox { display: flex; justify-content: flex-end; top: 9px; [data-customize-setting-link] { z-index: 2; } } &.customize-control-kirki-toggle { top: 14px; .kirki-toggle { display: flex; justify-content: flex-end; .kirki-control-form { display: inline-block; display: inline-flex; } } .kirki-control-form { z-index: 2; // Make it above the responsive devices. } } .customize-control-title, .customize-control-description { padding-right: 25px; } } .kirki-responsive-item-hidden { display: none !important; } pro-src/packages/kirki-pro-responsive/src/Field/Responsive.php000064400000005034147177211530020503 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @since 0.1 * * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-responsive'; } return $args; } } pro-src/packages/kirki-pro-responsive/src/Control/Responsive.php000064400000005451147177211530021103 0ustar00 'dashicons-desktop', 'tablet' => 'dashicons-tablet', 'mobile' => 'dashicons-smartphone', ]; $devices = isset( $this->choices['devices'] ) ? $this->choices['devices'] : []; $device_menu = ''; $loop_index = 0; foreach ( $devices as $device ) { $loop_index++; $device_menu .= '
  • '; } $this->json['deviceMenu'] = $device_menu; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * @since 1.0 */ protected function content_template() { ?>
    {{{ data.label }}}
    <# if (data.description) { #>
    {{{ data.description }}}
    <# } #>
      {{{ data.deviceMenu }}}
    0.5%, last 2 versions, not dead" } pro-src/packages/kirki-pro-responsive/dist/control.js000064400000002542147177211530017005 0ustar00!function(){var e,i,t;e=jQuery,i=wp.customize,t=function(){function t(i){e(".kirki-device-button").removeClass("is-active"),e(".kirki-device-button-"+i).addClass("is-active"),e("[data-kirki-device-preview]").addClass("kirki-responsive-item-hidden"),e('[data-kirki-device-preview="'+i+'"]').removeClass("kirki-responsive-item-hidden")}var r;t("desktop"),(r=document.querySelectorAll(".kirki-device-button")).length&&[].slice.call(r).forEach((function(e){e.addEventListener("click",(function(e){var t=this.getAttribute("data-kirki-device");i.previewedDevice.set(t)}))})),i.previewedDevice.bind((function(e){t(e)}))},wp.customize.bind("ready",(function(){setTimeout((function(){!function(){var i=document.querySelectorAll("[data-kirki-parent-responsive-id]");if(i.length){var t=[];[].slice.call(i).forEach((function(e){var i=e.dataset.kirkiParentResponsiveId,r=e.dataset.kirkiDevicePreview,n=e.dataset.kirkiSetting;t.includes(i)||t.push(i);var c=document.querySelectorAll('[data-kirki-parent-control-setting="'+n+'"]');c.length&&[].slice.call(c).forEach((function(e){e.dataset.kirkiParentResponsiveId=i,e.dataset.kirkiDevicePreview=r}))})),t.forEach((function(i){var t=e("#customize-control-"+i+" .kirki-device-buttons");t.attr("data-kirki-devices-for",i),t.appendTo("#customize-control-"+i+" .customize-control-title")}))}}(),t()}),250)}))}(); //# sourceMappingURL=control.js.map pro-src/packages/kirki-pro-responsive/dist/control.css.map000064400000014507147177211530017741 0ustar00{"mappings":"AAAA,oCACE,iBAAA,CACA,SCCF,CDCE,6DACE,YCCJ,CDIE,+EAEE,eAAA,CACA,QAAA,CACA,SCDJ,CDIE,wCACE,YAAA,CAMA,cAAA,CADA,eAAA,CAHA,0BAAA,CAEA,gBAAA,CADA,iBAAA,CAFA,OCGJ,CDKE,uCAEE,kBAAA,CAMA,qBAAA,CACA,iBAAA,CACA,cAAA,CATA,YAAA,CAMA,WAAA,CAJA,sBAAA,CAEA,gBAAA,CADA,iBAAA,CAOA,kBAAA,CALA,UCEJ,CDKI,yCAGE,cAAA,CADA,WAAA,CADA,UCDN,CDMI,8FAEE,qBCLN,CDWE,iEACE,QCRJ,CDWM,0GACE,aCTR,CDYM,qLAEE,WCVR,CDgBA,gFACE,mBCbF,CDeE,uHACE,mBCbJ,CDeI,qJACE,SCbN,CDiBE,iHACE,YAAA,CACA,wBAAA,CACA,OCfJ,CDiBI,+IACE,SCfN,CDmBE,+GACE,QCjBJ,CDmBI,6HACE,YAAA,CACA,wBCjBN,CDmBM,iJACE,oBAAA,CACA,mBCjBR,CDqBI,mIACE,SCnBN,CDuBE,wNAEE,kBCrBJ,CDyBA,8BACE,sBCtBF","sources":["src/control.scss","%3Cinput%20css%20xEGFL3%3E"],"sourcesContent":[".customize-control-kirki-responsive {\r\n position: relative;\r\n z-index: 1; // Make it above it's children control.\r\n\r\n .customize-control-title {\r\n display: flex;\r\n }\r\n}\r\n\r\n.kirki-responsive {\r\n .kirki-device-buttons,\r\n .kirki-device-button {\r\n list-style: none;\r\n margin: 0;\r\n padding: 0;\r\n }\r\n\r\n .kirki-device-buttons {\r\n display: flex;\r\n top: 3px;\r\n justify-content: flex-start;\r\n position: relative;\r\n margin-left: 12px;\r\n font-weight: 600;\r\n font-size: 14px;\r\n }\r\n\r\n .kirki-device-button {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: relative;\r\n margin-right: 3px;\r\n width: 22px;\r\n height: 22px;\r\n background-color: #eee;\r\n border-radius: 50%;\r\n cursor: pointer;\r\n transition: all 0.2s;\r\n\r\n i {\r\n width: 11px;\r\n height: 11px;\r\n font-size: 11px;\r\n }\r\n\r\n &.is-active,\r\n &:hover {\r\n background-color: #ddd;\r\n }\r\n }\r\n}\r\n\r\n[data-kirki-parent-responsive-id] {\r\n &.customize-control-kirki-switch {\r\n top: -5px;\r\n\r\n .kirki-switch {\r\n .kirki-toggle-switch-label {\r\n padding-top: 0;\r\n }\r\n\r\n .toggle-on,\r\n .toggle-off {\r\n bottom: -5px;\r\n }\r\n }\r\n }\r\n}\r\n\r\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] {\r\n margin-bottom: -35px;\r\n\r\n &.customize-control-kirki-react-colorful {\r\n margin-bottom: -30px;\r\n\r\n .kirki-trigger-circle-wrapper {\r\n z-index: 2; // Make it above the responsive devices.\r\n }\r\n }\r\n\r\n &.customize-control-kirki-checkbox {\r\n display: flex;\r\n justify-content: flex-end;\r\n top: 9px;\r\n\r\n [data-customize-setting-link] {\r\n z-index: 2;\r\n }\r\n }\r\n\r\n &.customize-control-kirki-toggle {\r\n top: 14px;\r\n\r\n .kirki-toggle {\r\n display: flex;\r\n justify-content: flex-end;\r\n\r\n .kirki-control-form {\r\n display: inline-block;\r\n display: inline-flex;\r\n }\r\n }\r\n\r\n .kirki-control-form {\r\n z-index: 2; // Make it above the responsive devices.\r\n }\r\n }\r\n\r\n .customize-control-title,\r\n .customize-control-description {\r\n padding-right: 25px;\r\n }\r\n}\r\n\r\n.kirki-responsive-item-hidden {\r\n display: none !important;\r\n}\r\n",".customize-control-kirki-responsive {\n position: relative;\n z-index: 1;\n}\n.customize-control-kirki-responsive .customize-control-title {\n display: flex;\n}\n\n.kirki-responsive .kirki-device-buttons,\n.kirki-responsive .kirki-device-button {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.kirki-responsive .kirki-device-buttons {\n display: flex;\n top: 3px;\n justify-content: flex-start;\n position: relative;\n margin-left: 12px;\n font-weight: 600;\n font-size: 14px;\n}\n.kirki-responsive .kirki-device-button {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n margin-right: 3px;\n width: 22px;\n height: 22px;\n background-color: #eee;\n border-radius: 50%;\n cursor: pointer;\n transition: all 0.2s;\n}\n.kirki-responsive .kirki-device-button i {\n width: 11px;\n height: 11px;\n font-size: 11px;\n}\n.kirki-responsive .kirki-device-button.is-active, .kirki-responsive .kirki-device-button:hover {\n background-color: #ddd;\n}\n\n[data-kirki-parent-responsive-id].customize-control-kirki-switch {\n top: -5px;\n}\n[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .kirki-toggle-switch-label {\n padding-top: 0;\n}\n[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-on,\n[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-off {\n bottom: -5px;\n}\n\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] {\n margin-bottom: -35px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful {\n margin-bottom: -30px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful .kirki-trigger-circle-wrapper {\n z-index: 2;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox {\n display: flex;\n justify-content: flex-end;\n top: 9px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox [data-customize-setting-link] {\n z-index: 2;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle {\n top: 14px;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle {\n display: flex;\n justify-content: flex-end;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle .kirki-control-form {\n display: inline-block;\n display: inline-flex;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-control-form {\n z-index: 2;\n}\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-title,\n.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-description {\n padding-right: 25px;\n}\n\n.kirki-responsive-item-hidden {\n display: none !important;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}pro-src/packages/kirki-pro-responsive/dist/control.js.map000064400000012753147177211530017566 0ustar00{"mappings":"gBAEWA,EACHC,IADGD,SACHC,EAAMC,GAAGC,YAwDX,WAgDD,SAAUC,EAAYC,GACvBL,EAAA,wBAAwBM,YAAA,aACtBN,EAAA,wBAAYK,GAAAE,SAAA,aACZP,EAAA,+BAAYO,SAAA,gCACXP,EAAG,+BAAAK,EAAA,MAAAC,YAAA,oCA3CDE,EAPJJ,EAAA,YAOII,EAAWC,SAAeC,iBAAkB,yBAChCC,iBAGXC,KAAkCJ,GAAAK,SAAA,SAAAC,KAC9BC,iBAAoB,SAAM,SAAAC,GAC/B,IAAAX,EAAAY,KAAAC,aAAA,qBAEJjB,EAAAkB,gBAAAC,IAAAf,SAkBCJ,EAAwBkB,gBAAAE,MAAA,SAAEC,GACDlB,EAAAkB,qEA1FR,WAEnB,IAAMC,EAAgBd,SAASC,iBAC7B,qCAEF,GAAKa,EAAcZ,OAAnB,CAGA,IAAIa,EAAgB,GAEpB,GAAGC,MAAMb,KAAKW,GAAeV,SAAQ,SAAUa,GAC7C,IAAMC,EAAqBD,EAAaE,QAAQC,wBAC1CxB,EAASqB,EAAaE,QAAQE,mBAC9BC,EAAUL,EAAaE,QAAQI,aAEhCR,EAAcS,SAASN,IAC1BH,EAAcU,KAAKP,SAckDlB,SAAAC,iBAAA,uCAAAqB,EAAA,MAEnEI,EAAexB,QAAQ,GAAAc,MAAAb,KAAAuB,GAA2BtB,SAAA,SAAAuB,GAGvDA,EAAAR,QAAAC,wBAAAF,EAEoDS,EAAAR,QAAAE,mBAAAzB,UAQnDQ,SAAe,SACQwB,GAExB,IAAAC,EAAAtC,EAAA,sBAAAqC,EAAA,0BACFC,EAAAC,KAAA,yBAAAF,GAEKC,EAAeE,SAAO,sBAAAH,EAAA","sources":["src/control.js"],"sourcesContent":["import \"./control.scss\";\r\n\r\n(function ($) {\r\n const api = wp.customize;\r\n\r\n const setupDevices = () => {\r\n // Get all controls which are responsive-able (not the device control it self).\r\n const childControls = document.querySelectorAll(\r\n \"[data-kirki-parent-responsive-id]\"\r\n );\r\n if (!childControls.length) return;\r\n\r\n // Responsive ids are collection of the id of the responsive controls (the device controls).\r\n let responsiveIds = [];\r\n\r\n [].slice.call(childControls).forEach(function (childControl) {\r\n const parentResponsiveId = childControl.dataset.kirkiParentResponsiveId;\r\n const device = childControl.dataset.kirkiDevicePreview;\r\n const setting = childControl.dataset.kirkiSetting;\r\n\r\n if (!responsiveIds.includes(parentResponsiveId)) {\r\n responsiveIds.push(parentResponsiveId);\r\n }\r\n\r\n /**\r\n * Grouped controls are collection of control which contains some child-controls.\r\n * Example of grouped controls: field-dimensions, field-typography, field-multicolor.\r\n */\r\n const groupedControls = document.querySelectorAll(\r\n '[data-kirki-parent-control-setting=\"' + setting + '\"]'\r\n );\r\n\r\n // Check if childControl is a field that groups other controls.\r\n if (groupedControls.length) {\r\n [].slice.call(groupedControls).forEach(function (groupedControl) {\r\n // Inherit the parentResponsiveId & device from the group's parent.\r\n groupedControl.dataset.kirkiParentResponsiveId = parentResponsiveId;\r\n groupedControl.dataset.kirkiDevicePreview = device;\r\n });\r\n }\r\n });\r\n\r\n // Move the device icons next to the control's title.\r\n responsiveIds.forEach(function (responsiveId) {\r\n const $deviceButtons = $(\r\n \"#customize-control-\" + responsiveId + \" .kirki-device-buttons\"\r\n );\r\n\r\n $deviceButtons.attr(\"data-kirki-devices-for\", responsiveId);\r\n\r\n $deviceButtons.appendTo(\r\n \"#customize-control-\" + responsiveId + \" .customize-control-title\"\r\n );\r\n });\r\n };\r\n\r\n const setupPreview = () => {\r\n function init() {\r\n switchDevice(\"desktop\"); // Initial state.\r\n setupDeviceClicks();\r\n syncPreviewButtons();\r\n }\r\n\r\n function setupDeviceClicks() {\r\n const deviceButtons = document.querySelectorAll(\".kirki-device-button\");\r\n if (!deviceButtons.length) return;\r\n\r\n // Loop through Kirki device buttons and assign the click event.\r\n [].slice.call(deviceButtons).forEach(function (deviceButton) {\r\n deviceButton.addEventListener(\"click\", function (e) {\r\n var device = this.getAttribute(\"data-kirki-device\");\r\n\r\n // Trigger WordPress device event.\r\n api.previewedDevice.set(device);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Sync device preview button from WordPress to Kirki and vice versa.\r\n */\r\n function syncPreviewButtons() {\r\n // Bind device changes from WordPress default.\r\n api.previewedDevice.bind(function (newDevice) {\r\n switchDevice(newDevice);\r\n });\r\n }\r\n\r\n /**\r\n * Setup device preview.\r\n *\r\n * @param string device The device (mobile, tablet, or desktop).\r\n */\r\n function switchDevice(device) {\r\n $(\".kirki-device-button\").removeClass(\"is-active\");\r\n $(\".kirki-device-button-\" + device).addClass(\"is-active\");\r\n\r\n $(\"[data-kirki-device-preview]\").addClass(\"kirki-responsive-item-hidden\");\r\n $('[data-kirki-device-preview=\"' + device + '\"]').removeClass(\r\n \"kirki-responsive-item-hidden\"\r\n );\r\n }\r\n\r\n init();\r\n };\r\n\r\n // Run setupDevices & setupPreview after the customizer is ready.\r\n wp.customize.bind(\"ready\", function () {\r\n setTimeout(function () {\r\n setupDevices();\r\n setupPreview();\r\n }, 250);\r\n });\r\n})(jQuery);\r\n"],"names":["$","api","wp","customize","switchDevice","device","removeClass","addClass","deviceButtons","document","querySelectorAll","length","call","forEach","deviceButton","addEventListener","e","this","getAttribute","previewedDevice","set","bind","newDevice","childControls","responsiveIds","slice","childControl","parentResponsiveId","dataset","kirkiParentResponsiveId","kirkiDevicePreview","setting","kirkiSetting","includes","push","groupedControls","groupedControl","responsiveId","$deviceButtons","attr","appendTo"],"version":3,"file":"control.js.map"}pro-src/packages/kirki-pro-responsive/dist/control.css000064400000005457147177211530017171 0ustar00.customize-control-kirki-responsive{position:relative;z-index:1}.customize-control-kirki-responsive .customize-control-title{display:flex}.kirki-responsive .kirki-device-button,.kirki-responsive .kirki-device-buttons{list-style:none;margin:0;padding:0}.kirki-responsive .kirki-device-buttons{display:flex;font-size:14px;font-weight:600;justify-content:flex-start;margin-left:12px;position:relative;top:3px}.kirki-responsive .kirki-device-button{align-items:center;background-color:#eee;border-radius:50%;cursor:pointer;display:flex;height:22px;justify-content:center;margin-right:3px;position:relative;transition:all .2s;width:22px}.kirki-responsive .kirki-device-button i{font-size:11px;height:11px;width:11px}.kirki-responsive .kirki-device-button.is-active,.kirki-responsive .kirki-device-button:hover{background-color:#ddd}[data-kirki-parent-responsive-id].customize-control-kirki-switch{top:-5px}[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .kirki-toggle-switch-label{padding-top:0}[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-off,[data-kirki-parent-responsive-id].customize-control-kirki-switch .kirki-switch .toggle-on{bottom:-5px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id]{margin-bottom:-35px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful{margin-bottom:-30px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-react-colorful .kirki-trigger-circle-wrapper{z-index:2}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox{display:flex;justify-content:flex-end;top:9px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-checkbox [data-customize-setting-link]{z-index:2}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle{top:14px}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle{display:flex;justify-content:flex-end}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-toggle .kirki-control-form{display:inline-block;display:inline-flex}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id].customize-control-kirki-toggle .kirki-control-form{z-index:2}.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-description,.customize-control-kirki-responsive-horizontal[data-kirki-parent-responsive-id] .customize-control-title{padding-right:25px}.kirki-responsive-item-hidden{display:none!important} /*# sourceMappingURL=control.css.map */ pro-src/packages/kirki-pro-responsive/composer.json000064400000000300147177211530016534 0ustar00{ "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\Responsive\\": "src" } } }pro-src/packages/kirki-pro-responsive/kirki-pro-responsive.php000064400000002644147177211530020642 0ustar00api_url = trailingslashit( $_api_url ); $this->api_data = $_api_data; $this->plugin_file = $_plugin_file; $this->name = plugin_basename( $_plugin_file ); $this->slug = basename( $_plugin_file, '.php' ); $this->version = $_api_data['version']; $this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false; $this->beta = ! empty( $this->api_data['beta'] ) ? true : false; $this->failed_request_cache_key = 'edd_sl_failed_http_' . md5( $this->api_url ); $edd_plugin_data[ $this->slug ] = $this->api_data; /** * Fires after the $edd_plugin_data is setup. * * @since x.x.x * * @param array $edd_plugin_data Array of EDD SL plugin data. */ do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data ); // Set up hooks. $this->init(); } /** * Set up WordPress filters to hook into WP's update process. * * @uses add_filter() * * @return void */ public function init() { add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) ); add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); add_action( 'after_plugin_row', array( $this, 'show_update_notification' ), 10, 2 ); add_action( 'admin_init', array( $this, 'show_changelog' ) ); } /** * Check for Updates at the defined API endpoint and modify the update array. * * This function dives into the update API just when WordPress creates its update array, * then adds a custom API call and injects the custom plugin data retrieved from the API. * It is reassembled from parts of the native WordPress plugin update code. * See wp-includes/update.php line 121 for the original wp_update_plugins() function. * * @uses api_request() * * @param array $_transient_data Update array build by WordPress. * @return array Modified update array with custom plugin data. */ public function check_update( $_transient_data ) { global $pagenow; if ( ! is_object( $_transient_data ) ) { $_transient_data = new stdClass(); } if ( ! empty( $_transient_data->response ) && ! empty( $_transient_data->response[ $this->name ] ) && false === $this->wp_override ) { return $_transient_data; } $current = $this->get_repo_api_data(); if ( false !== $current && is_object( $current ) && isset( $current->new_version ) ) { if ( version_compare( $this->version, $current->new_version, '<' ) ) { $_transient_data->response[ $this->name ] = $current; } else { // Populating the no_update information is required to support auto-updates in WordPress 5.5. $_transient_data->no_update[ $this->name ] = $current; } } $_transient_data->last_checked = time(); $_transient_data->checked[ $this->name ] = $this->version; return $_transient_data; } /** * Get repo API data from store. * Save to cache. * * @return \stdClass */ public function get_repo_api_data() { $version_info = $this->get_cached_version_info(); if ( false === $version_info ) { $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta, ) ); if ( ! $version_info ) { return false; } // This is required for your plugin to support auto-updates in WordPress 5.5. $version_info->plugin = $this->name; $version_info->id = $this->name; $this->set_version_info_cache( $version_info ); } return $version_info; } /** * Show the update notification on multisite subsites. * * @param string $file * @param array $plugin */ public function show_update_notification( $file, $plugin ) { // Return early if in the network admin, or if this is not a multisite install. if ( is_network_admin() || ! is_multisite() ) { return; } // Allow single site admins to see that an update is available. if ( ! current_user_can( 'activate_plugins' ) ) { return; } if ( $this->name !== $file ) { return; } // Do not print any message if update does not exist. $update_cache = get_site_transient( 'update_plugins' ); if ( ! isset( $update_cache->response[ $this->name ] ) ) { if ( ! is_object( $update_cache ) ) { $update_cache = new stdClass(); } $update_cache->response[ $this->name ] = $this->get_repo_api_data(); } // Return early if this plugin isn't in the transient->response or if the site is running the current or newer version of the plugin. if ( empty( $update_cache->response[ $this->name ] ) || version_compare( $this->version, $update_cache->response[ $this->name ]->new_version, '>=' ) ) { return; } printf( '', $this->slug, $file, in_array( $this->name, $this->get_active_plugins(), true ) ? 'active' : 'inactive' ); echo ''; echo '

    '; $changelog_link = ''; if ( ! empty( $update_cache->response[ $this->name ]->sections->changelog ) ) { $changelog_link = add_query_arg( array( 'edd_sl_action' => 'view_plugin_changelog', 'plugin' => urlencode( $this->name ), 'slug' => urlencode( $this->slug ), 'TB_iframe' => 'true', 'width' => 77, 'height' => 911, ), self_admin_url( 'index.php' ) ); } $update_link = add_query_arg( array( 'action' => 'upgrade-plugin', 'plugin' => urlencode( $this->name ), ), self_admin_url( 'update.php' ) ); printf( /* translators: the plugin name. */ esc_html__( 'There is a new version of %1$s available.', 'easy-digital-downloads' ), esc_html( $plugin['Name'] ) ); if ( ! current_user_can( 'update_plugins' ) ) { echo ' '; esc_html_e( 'Contact your network administrator to install the update.', 'easy-digital-downloads' ); } elseif ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) { echo ' '; printf( /* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate. */ __( '%1$sView version %2$s details%3$s.', 'easy-digital-downloads' ), '', esc_html( $update_cache->response[ $this->name ]->new_version ), '' ); } elseif ( ! empty( $changelog_link ) ) { echo ' '; printf( __( '%1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ), '', esc_html( $update_cache->response[ $this->name ]->new_version ), '', '', '' ); } else { printf( ' %1$s%2$s%3$s', '', esc_html__( 'Update now.', 'easy-digital-downloads' ), '' ); } do_action( "in_plugin_update_message-{$file}", $plugin, $plugin ); echo '

    '; } /** * Gets the plugins active in a multisite network. * * @return array */ private function get_active_plugins() { $active_plugins = (array) get_option( 'active_plugins' ); $active_network_plugins = (array) get_site_option( 'active_sitewide_plugins' ); return array_merge( $active_plugins, array_keys( $active_network_plugins ) ); } /** * Updates information on the "View version x.x details" page with custom data. * * @uses api_request() * * @param mixed $_data * @param string $_action * @param object $_args * @return object $_data */ public function plugins_api_filter( $_data, $_action = '', $_args = null ) { if ( 'plugin_information' !== $_action ) { return $_data; } if ( ! isset( $_args->slug ) || ( $_args->slug !== $this->slug ) ) { return $_data; } $to_send = array( 'slug' => $this->slug, 'is_ssl' => is_ssl(), 'fields' => array( 'banners' => array(), 'reviews' => false, 'icons' => array(), ), ); // Get the transient where we store the api request for this plugin for 24 hours $edd_api_request_transient = $this->get_cached_version_info(); // If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now. if ( empty( $edd_api_request_transient ) ) { $api_response = $this->api_request( 'plugin_information', $to_send ); // Expires in 3 hours $this->set_version_info_cache( $api_response ); if ( false !== $api_response ) { $_data = $api_response; } } else { $_data = $edd_api_request_transient; } // Convert sections into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->sections ) && ! is_array( $_data->sections ) ) { $_data->sections = $this->convert_object_to_array( $_data->sections ); } // Convert banners into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->banners ) && ! is_array( $_data->banners ) ) { $_data->banners = $this->convert_object_to_array( $_data->banners ); } // Convert icons into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->icons ) && ! is_array( $_data->icons ) ) { $_data->icons = $this->convert_object_to_array( $_data->icons ); } // Convert contributors into an associative array, since we're getting an object, but Core expects an array. if ( isset( $_data->contributors ) && ! is_array( $_data->contributors ) ) { $_data->contributors = $this->convert_object_to_array( $_data->contributors ); } if ( ! isset( $_data->plugin ) ) { $_data->plugin = $this->name; } return $_data; } /** * Convert some objects to arrays when injecting data into the update API * * Some data like sections, banners, and icons are expected to be an associative array, however due to the JSON * decoding, they are objects. This method allows us to pass in the object and return an associative array. * * @since 3.6.5 * * @param stdClass $data * * @return array */ private function convert_object_to_array( $data ) { if ( ! is_array( $data ) && ! is_object( $data ) ) { return array(); } $new_data = array(); foreach ( $data as $key => $value ) { $new_data[ $key ] = is_object( $value ) ? $this->convert_object_to_array( $value ) : $value; } return $new_data; } /** * Disable SSL verification in order to prevent download update failures * * @param array $args * @param string $url * @return object $array */ public function http_request_args( $args, $url ) { if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) { $args['sslverify'] = $this->verify_ssl(); } return $args; } /** * Calls the API and, if successfull, returns the object delivered by the API. * * @uses get_bloginfo() * @uses wp_remote_post() * @uses is_wp_error() * * @param string $_action The requested action. * @param array $_data Parameters for the API action. * @return false|object|void */ private function api_request( $_action, $_data ) { $data = array_merge( $this->api_data, $_data ); if ( $data['slug'] !== $this->slug ) { return; } // Don't allow a plugin to ping itself if ( trailingslashit( home_url() ) === $this->api_url ) { return false; } if ( $this->request_recently_failed() ) { return false; } return $this->get_version_from_remote(); } /** * Determines if a request has recently failed. * * @since 1.9.1 * * @return bool */ private function request_recently_failed() { $failed_request_details = get_option( $this->failed_request_cache_key ); // Request has never failed. if ( empty( $failed_request_details ) || ! is_numeric( $failed_request_details ) ) { return false; } /* * Request previously failed, but the timeout has expired. * This means we're allowed to try again. */ if ( time() > $failed_request_details ) { delete_option( $this->failed_request_cache_key ); return false; } return true; } /** * Logs a failed HTTP request for this API URL. * We set a timestamp for 1 hour from now. This prevents future API requests from being * made to this domain for 1 hour. Once the timestamp is in the past, API requests * will be allowed again. This way if the site is down for some reason we don't bombard * it with failed API requests. * * @see EDD_SL_Plugin_Updater::request_recently_failed * * @since 1.9.1 */ private function log_failed_request() { update_option( $this->failed_request_cache_key, strtotime( '+1 hour' ) ); } /** * If available, show the changelog for sites in a multisite install. */ public function show_changelog() { if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' !== $_REQUEST['edd_sl_action'] ) { return; } if ( empty( $_REQUEST['plugin'] ) ) { return; } if ( empty( $_REQUEST['slug'] ) || $this->slug !== $_REQUEST['slug'] ) { return; } if ( ! current_user_can( 'update_plugins' ) ) { wp_die( esc_html__( 'You do not have permission to install plugin updates', 'easy-digital-downloads' ), esc_html__( 'Error', 'easy-digital-downloads' ), array( 'response' => 403 ) ); } $version_info = $this->get_repo_api_data(); if ( isset( $version_info->sections ) ) { $sections = $this->convert_object_to_array( $version_info->sections ); if ( ! empty( $sections['changelog'] ) ) { echo '
    ' . wp_kses_post( $sections['changelog'] ) . '
    '; } } exit; } /** * Gets the current version information from the remote site. * * @return array|false */ private function get_version_from_remote() { $api_params = array( 'edd_action' => 'get_version', 'license' => ! empty( $this->api_data['license'] ) ? $this->api_data['license'] : '', 'item_name' => isset( $this->api_data['item_name'] ) ? $this->api_data['item_name'] : false, 'item_id' => isset( $this->api_data['item_id'] ) ? $this->api_data['item_id'] : false, 'version' => isset( $this->api_data['version'] ) ? $this->api_data['version'] : false, 'slug' => $this->slug, 'author' => $this->api_data['author'], 'url' => home_url(), 'beta' => $this->beta, 'php_version' => phpversion(), 'wp_version' => get_bloginfo( 'version' ), ); /** * Filters the parameters sent in the API request. * * @param array $api_params The array of data sent in the request. * @param array $this->api_data The array of data set up in the class constructor. * @param string $this->plugin_file The full path and filename of the file. */ $api_params = apply_filters( 'edd_sl_plugin_updater_api_params', $api_params, $this->api_data, $this->plugin_file ); $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $this->verify_ssl(), 'body' => $api_params, ) ); if ( is_wp_error( $request ) || ( 200 !== wp_remote_retrieve_response_code( $request ) ) ) { $this->log_failed_request(); return false; } $request = json_decode( wp_remote_retrieve_body( $request ) ); if ( $request && isset( $request->sections ) ) { $request->sections = maybe_unserialize( $request->sections ); } else { $request = false; } if ( $request && isset( $request->banners ) ) { $request->banners = maybe_unserialize( $request->banners ); } if ( $request && isset( $request->icons ) ) { $request->icons = maybe_unserialize( $request->icons ); } if ( ! empty( $request->sections ) ) { foreach ( $request->sections as $key => $section ) { $request->$key = (array) $section; } } return $request; } /** * Get the version info from the cache, if it exists. * * @param string $cache_key * @return object */ public function get_cached_version_info( $cache_key = '' ) { if ( empty( $cache_key ) ) { $cache_key = $this->get_cache_key(); } $cache = get_option( $cache_key ); // Cache is expired if ( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) { return false; } // We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point. $cache['value'] = json_decode( $cache['value'] ); if ( ! empty( $cache['value']->icons ) ) { $cache['value']->icons = (array) $cache['value']->icons; } return $cache['value']; } /** * Adds the plugin version information to the database. * * @param string $value * @param string $cache_key */ public function set_version_info_cache( $value = '', $cache_key = '' ) { if ( empty( $cache_key ) ) { $cache_key = $this->get_cache_key(); } $data = array( 'timeout' => strtotime( '+3 hours', time() ), 'value' => wp_json_encode( $value ), ); update_option( $cache_key, $data, 'no' ); // Delete the duplicate option delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) ); } /** * Returns if the SSL of the store should be verified. * * @since 1.6.13 * @return bool */ private function verify_ssl() { return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this ); } /** * Gets the unique key (option name) for a plugin. * * @since 1.9.0 * @return string */ private function get_cache_key() { $string = $this->slug . $this->api_data['license'] . $this->beta; return 'edd_sl_' . md5( serialize( $string ) ); } } pro-src/packages/kirki-pro-tabs/composer.lock000064400000001124147177211530015254 0ustar00{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "8181a175698d243d8d964c66dc8e9b4c", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } pro-src/packages/kirki-pro-tabs/kirki-pro-tabs.php000064400000002637147177211530016134 0ustar00 array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); pro-src/packages/kirki-pro-tabs/vendor/composer/autoload_real.php000064400000002161147177211530021225 0ustar00register(true); return $loader; } } pro-src/packages/kirki-pro-tabs/vendor/composer/platform_check.php000064400000001635147177211530021400 0ustar00= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.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 ); } pro-src/packages/kirki-pro-tabs/vendor/composer/ClassLoader.php000064400000040220147177211530020604 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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 */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $classMap * * @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 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) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $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 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) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $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] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $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 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 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 indexed by their corresponding vendor directories. * * @return 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); } } pro-src/packages/kirki-pro-tabs/vendor/composer/autoload_classmap.php000064400000000336147177211530022107 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); pro-src/packages/kirki-pro-tabs/vendor/composer/autoload_static.php000064400000002546147177211530021600 0ustar00 array ( 'Kirki\\Pro\\Tabs\\' => 15, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\Tabs\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::$prefixDirsPsr4; $loader->classMap = ComposerStaticInit56a8a99d8c63b9f1227717dc63c34409::$classMap; }, null, ClassLoader::class); } } pro-src/packages/kirki-pro-tabs/vendor/composer/InstalledVersions.php000064400000037417147177211530022076 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } pro-src/packages/kirki-pro-tabs/vendor/composer/installed.json000064400000000105147177211530020547 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } pro-src/packages/kirki-pro-tabs/vendor/composer/installed.php000064400000001344147177211530020373 0ustar00 array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); pro-src/packages/kirki-pro-tabs/src/Init.php000064400000004020147177211530014754 0ustar00 $section, 'data-kirki-parent-tab-item' => isset( $args['tab'] ) ? $args['tab'] : '', ); if ( isset( $args['wrapper_attrs'] ) ) { $args['wrapper_attrs'] = array_merge( $args['wrapper_attrs'], $tab_wrapper_attrs ); } else { $args['wrapper_attrs'] = $tab_wrapper_attrs; } } } return $args; } /** * Add the tab by creating custom control using Kirki API. * * @since 1.0.0 * * @param string $section_id The The section id. * @param array $args The section args. */ public function add_tab( $section_id, $args ) { if ( ! isset( $args['tabs'] ) ) { return; } new \Kirki\Pro\Field\Tabs( [ 'settings' => 'kirki_tabs_' . $section_id, 'section' => $section_id, 'priority' => 0, 'choices' => [ 'tabs' => $args['tabs'], ], ] ); } } pro-src/packages/kirki-pro-tabs/src/control.js000064400000004444147177211530015370 0ustar00import "./control.scss"; (function ($) { const setupTabs = () => { const childControls = document.querySelectorAll( "[data-kirki-parent-tab-id]" ); if (!childControls.length) return; let tabIds = []; [].slice.call(childControls).forEach(function (childControl) { const parentTabId = childControl.dataset.kirkiParentTabId; if (!tabIds.includes(parentTabId)) { tabIds.push(parentTabId); } }); const switchTabs = (tabId, tabItemName) => { $('[data-kirki-tab-id="' + tabId + '"] .kirki-tab-menu-item').removeClass( "is-active" ); const tabMenuItem = document.querySelector( '[data-kirki-tab-id="' + tabId + '"] [data-kirki-tab-menu-id="' + tabItemName + '"]' ); if (tabMenuItem) tabMenuItem.classList.add("is-active"); const tabItems = document.querySelectorAll( '[data-kirki-parent-tab-id="' + tabId + '"]' ); [].slice.call(tabItems).forEach(function (tabItem) { if (tabItem.dataset.kirkiParentTabItem === tabItemName) { tabItem.classList.remove("kirki-tab-item-hidden"); } else { tabItem.classList.add("kirki-tab-item-hidden"); } }); }; const setupTabClicks = () => { $(document).on("click", ".kirki-tab-menu-item a", function (e) { e.preventDefault(); const tabId = this.parentNode.parentNode.parentNode.dataset.kirkiTabId; const tabItemName = this.parentNode.dataset.kirkiTabMenuId; switchTabs(tabId, tabItemName); }); }; const setupBindings = () => { tabIds.forEach(function (tabId) { wp.customize.section(tabId, function (section) { section.expanded.bind(function (isExpanded) { if (isExpanded) { const activeTabMenu = document.querySelector( '[data-kirki-tab-id="' + tabId + '"] .kirki-tab-menu-item.is-active' ); if (activeTabMenu) { switchTabs(tabId, activeTabMenu.dataset.kirkiTabMenuId); } } }); }); }); }; setupTabClicks(); setupBindings(); }; wp.customize.bind("ready", function () { setupTabs(); }); })(jQuery); pro-src/packages/kirki-pro-tabs/src/control.scss000064400000002055147177211530015723 0ustar00.rtl { .customize-control-kirki-tab { left: 0; right: -24px; } } .customize-control-kirki-tab { position: relative; left: -24px; width: calc(100% + 48px); } .kirki-tab { .kirki-tab-menu, .kirki-tab-menu-item { list-style: none; margin: 0; padding: 0; } .kirki-tab-menu { display: flex; flex-wrap: wrap; position: relative; margin-bottom: 12px; font-weight: 600; font-size: 14px; border-bottom: 1px solid #ddd; } .kirki-tab-menu-item { position: relative; flex-grow: 1; a { display: flex; align-items: center; justify-content: center; padding-left: 15px; padding-right: 15px; height: 50px; position: relative; border-bottom: 2px solid transparent; text-decoration: none; &:focus { box-shadow: none; } &:active, &:focus { color: #2271b1; } } &.is-active { a { border-color: #2271b1; } } } } .kirki-tab-item-hidden { display: none !important; } pro-src/packages/kirki-pro-tabs/src/Field/Tabs.php000064400000004232147177211530015772 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @since 0.1 * * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-tab'; } return $args; } } pro-src/packages/kirki-pro-tabs/src/Control/Tabs.php000064400000004547147177211530016400 0ustar00choices['tabs'] ) ? $this->choices['tabs'] : []; $tab_menu = ''; $loop_index = 0; foreach ( $tabs as $tab_id => $tab_args ) { $loop_index++; $tab_menu .= '
  • ' . esc_html( $tab_args['label'] ) . '
  • '; } $this->json['choices']['section'] = $this->section; $this->json['tabMenu'] = $tab_menu; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * @since 1.0 */ protected function content_template() { ?>
      {{{ data.tabMenu }}}
    0.5%, last 2 versions, not dead" } pro-src/packages/kirki-pro-tabs/dist/control.js000064400000002237147177211530015542 0ustar00!function(){var i;i=jQuery,wp.customize.bind("ready",(function(){!function(){var t=document.querySelectorAll("[data-kirki-parent-tab-id]");if(t.length){var a=[];[].slice.call(t).forEach((function(i){var t=i.dataset.kirkiParentTabId;a.includes(t)||a.push(t)}));var e=function(t,a){i('[data-kirki-tab-id="'+t+'"] .kirki-tab-menu-item').removeClass("is-active");var e=document.querySelector('[data-kirki-tab-id="'+t+'"] [data-kirki-tab-menu-id="'+a+'"]');e&&e.classList.add("is-active");var n=document.querySelectorAll('[data-kirki-parent-tab-id="'+t+'"]');[].slice.call(n).forEach((function(i){i.dataset.kirkiParentTabItem===a?i.classList.remove("kirki-tab-item-hidden"):i.classList.add("kirki-tab-item-hidden")}))};i(document).on("click",".kirki-tab-menu-item a",(function(i){i.preventDefault();var t=this.parentNode.parentNode.parentNode.dataset.kirkiTabId,a=this.parentNode.dataset.kirkiTabMenuId;e(t,a)})),a.forEach((function(i){wp.customize.section(i,(function(t){t.expanded.bind((function(t){if(t){var a=document.querySelector('[data-kirki-tab-id="'+i+'"] .kirki-tab-menu-item.is-active');a&&e(i,a.dataset.kirkiTabMenuId)}}))}))}))}}()}))}(); //# sourceMappingURL=control.js.map pro-src/packages/kirki-pro-tabs/dist/control.css.map000064400000005633147177211530016475 0ustar00{"mappings":"AACE,kCACE,MAAA,CACA,WCAJ,CDIA,6BAEE,UAAA,CADA,iBAAA,CAEA,uBCDF,CDKE,2DAEE,eAAA,CACA,QAAA,CACA,SCFJ,CDKE,2BAOE,4BAAA,CANA,YAAA,CACA,cAAA,CAIA,cAAA,CADA,eAAA,CADA,kBAAA,CADA,iBCCJ,CDME,gCAEE,WAAA,CADA,iBCHJ,CDMI,kCAEE,kBAAA,CAMA,mCAAA,CAPA,YAAA,CAKA,WAAA,CAHA,sBAAA,CACA,iBAAA,CACA,kBAAA,CAEA,iBAAA,CAEA,oBCJN,CDMM,wCACE,eCJR,CDOM,iFAEE,aCNR,CDWM,4CACE,oBCTR,CDeA,uBACE,sBCZF","sources":["src/control.scss","%3Cinput%20css%201ae8rn%3E"],"sourcesContent":[".rtl {\r\n .customize-control-kirki-tab {\r\n left: 0;\r\n right: -24px;\r\n }\r\n}\r\n\r\n.customize-control-kirki-tab {\r\n position: relative;\r\n left: -24px;\r\n width: calc(100% + 48px);\r\n}\r\n\r\n.kirki-tab {\r\n .kirki-tab-menu,\r\n .kirki-tab-menu-item {\r\n list-style: none;\r\n margin: 0;\r\n padding: 0;\r\n }\r\n\r\n .kirki-tab-menu {\r\n display: flex;\r\n flex-wrap: wrap;\r\n position: relative;\r\n margin-bottom: 12px;\r\n font-weight: 600;\r\n font-size: 14px;\r\n border-bottom: 1px solid #ddd;\r\n }\r\n\r\n .kirki-tab-menu-item {\r\n position: relative;\r\n flex-grow: 1;\r\n\r\n a {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n padding-left: 15px;\r\n padding-right: 15px;\r\n height: 50px;\r\n position: relative;\r\n border-bottom: 2px solid transparent;\r\n text-decoration: none;\r\n\r\n &:focus {\r\n box-shadow: none;\r\n }\r\n\r\n &:active,\r\n &:focus {\r\n color: #2271b1;\r\n }\r\n }\r\n\r\n &.is-active {\r\n a {\r\n border-color: #2271b1;\r\n }\r\n }\r\n }\r\n}\r\n\r\n.kirki-tab-item-hidden {\r\n display: none !important;\r\n}\r\n",".rtl .customize-control-kirki-tab {\n left: 0;\n right: -24px;\n}\n\n.customize-control-kirki-tab {\n position: relative;\n left: -24px;\n width: calc(100% + 48px);\n}\n\n.kirki-tab .kirki-tab-menu,\n.kirki-tab .kirki-tab-menu-item {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n.kirki-tab .kirki-tab-menu {\n display: flex;\n flex-wrap: wrap;\n position: relative;\n margin-bottom: 12px;\n font-weight: 600;\n font-size: 14px;\n border-bottom: 1px solid #ddd;\n}\n.kirki-tab .kirki-tab-menu-item {\n position: relative;\n flex-grow: 1;\n}\n.kirki-tab .kirki-tab-menu-item a {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 15px;\n padding-right: 15px;\n height: 50px;\n position: relative;\n border-bottom: 2px solid transparent;\n text-decoration: none;\n}\n.kirki-tab .kirki-tab-menu-item a:focus {\n box-shadow: none;\n}\n.kirki-tab .kirki-tab-menu-item a:active, .kirki-tab .kirki-tab-menu-item a:focus {\n color: #2271b1;\n}\n.kirki-tab .kirki-tab-menu-item.is-active a {\n border-color: #2271b1;\n}\n\n.kirki-tab-item-hidden {\n display: none !important;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}pro-src/packages/kirki-pro-tabs/dist/control.js.map000064400000010062147177211530016311 0ustar00{"mappings":"gBAEWA,EAAAA,EAmFRC,OAHDC,GAAGC,UAAUC,KAAK,SAAS,YA/ET,WAChB,IAAMC,EAAgBC,SAASC,iBAC7B,8BAEF,GAAKF,EAAcG,OAAnB,CAEA,IAAIC,EAAS,GAEb,GAAGC,MAAMC,KAAKN,GAAeO,SAAQ,SAAUC,GAC7C,IAAMC,EAAcD,EAAaE,QAAQC,iBAEpCP,EAAOQ,SAASH,IACnBL,EAAOS,KAAKJ,MAIhB,IAAMK,EAAa,SAACC,EAAOC,GACzBrB,EAAE,uBAAyBoB,EAAQ,2BAA2BE,YAC5D,aAGF,IAAMC,EAAcjB,SAASkB,cAC3B,uBACEJ,EACA,+BACAC,EACA,MAGAE,GAAaA,EAAYE,UAAUC,IAAI,aAE3C,IAAMC,EAAWrB,SAASC,iBACxB,8BAAgCa,EAAQ,MAG1C,GAAGV,MAAMC,KAAKgB,GAAUf,SAAQ,SAAUgB,GACpCA,EAAQb,QAAQc,qBAAuBR,EACzCO,EAAQH,UAAUK,OAAO,yBAEzBF,EAAQH,UAAUC,IAAI,6BAM1B1B,EAAEM,UAAUyB,GAAG,QAAS,0BAA0B,SAAUC,GAC1DA,EAAEC,iBAEF,IAAMb,EAAQc,KAAKC,WAAWA,WAAWA,WAAWpB,QAAQqB,WACtDf,EAAca,KAAKC,WAAWpB,QAAQsB,eAE5ClB,EAAWC,EAAOC,MAKpBZ,EAAOG,SAAQ,SAAUQ,GACvBlB,GAAGC,UAAUmC,QAAQlB,GAAO,SAAUkB,GACpCA,EAAQC,SAASnC,MAAK,SAAUoC,GAC9B,GAAIA,EAAY,CACd,IAAMC,EAAgBnC,SAASkB,cAC7B,uBACEJ,EACA,qCAGAqB,GACFtB,EAAWC,EAAOqB,EAAc1B,QAAQsB,2BAapDK","sources":["src/control.js"],"sourcesContent":["import \"./control.scss\";\r\n\r\n(function ($) {\r\n const setupTabs = () => {\r\n const childControls = document.querySelectorAll(\r\n \"[data-kirki-parent-tab-id]\"\r\n );\r\n if (!childControls.length) return;\r\n\r\n let tabIds = [];\r\n\r\n [].slice.call(childControls).forEach(function (childControl) {\r\n const parentTabId = childControl.dataset.kirkiParentTabId;\r\n\r\n if (!tabIds.includes(parentTabId)) {\r\n tabIds.push(parentTabId);\r\n }\r\n });\r\n\r\n const switchTabs = (tabId, tabItemName) => {\r\n $('[data-kirki-tab-id=\"' + tabId + '\"] .kirki-tab-menu-item').removeClass(\r\n \"is-active\"\r\n );\r\n\r\n const tabMenuItem = document.querySelector(\r\n '[data-kirki-tab-id=\"' +\r\n tabId +\r\n '\"] [data-kirki-tab-menu-id=\"' +\r\n tabItemName +\r\n '\"]'\r\n );\r\n\r\n if (tabMenuItem) tabMenuItem.classList.add(\"is-active\");\r\n\r\n const tabItems = document.querySelectorAll(\r\n '[data-kirki-parent-tab-id=\"' + tabId + '\"]'\r\n );\r\n\r\n [].slice.call(tabItems).forEach(function (tabItem) {\r\n if (tabItem.dataset.kirkiParentTabItem === tabItemName) {\r\n tabItem.classList.remove(\"kirki-tab-item-hidden\");\r\n } else {\r\n tabItem.classList.add(\"kirki-tab-item-hidden\");\r\n }\r\n });\r\n };\r\n\r\n const setupTabClicks = () => {\r\n $(document).on(\"click\", \".kirki-tab-menu-item a\", function (e) {\r\n e.preventDefault();\r\n\r\n const tabId = this.parentNode.parentNode.parentNode.dataset.kirkiTabId;\r\n const tabItemName = this.parentNode.dataset.kirkiTabMenuId;\r\n\r\n switchTabs(tabId, tabItemName);\r\n });\r\n };\r\n\r\n const setupBindings = () => {\r\n tabIds.forEach(function (tabId) {\r\n wp.customize.section(tabId, function (section) {\r\n section.expanded.bind(function (isExpanded) {\r\n if (isExpanded) {\r\n const activeTabMenu = document.querySelector(\r\n '[data-kirki-tab-id=\"' +\r\n tabId +\r\n '\"] .kirki-tab-menu-item.is-active'\r\n );\r\n\r\n if (activeTabMenu) {\r\n switchTabs(tabId, activeTabMenu.dataset.kirkiTabMenuId);\r\n }\r\n }\r\n });\r\n });\r\n });\r\n };\r\n\r\n setupTabClicks();\r\n setupBindings();\r\n };\r\n\r\n wp.customize.bind(\"ready\", function () {\r\n setupTabs();\r\n });\r\n})(jQuery);\r\n"],"names":["$","jQuery","wp","customize","bind","childControls","document","querySelectorAll","length","tabIds","slice","call","forEach","childControl","parentTabId","dataset","kirkiParentTabId","includes","push","switchTabs","tabId","tabItemName","removeClass","tabMenuItem","querySelector","classList","add","tabItems","tabItem","kirkiParentTabItem","remove","on","e","preventDefault","this","parentNode","kirkiTabId","kirkiTabMenuId","section","expanded","isExpanded","activeTabMenu","setupTabs"],"version":3,"file":"control.js.map"}pro-src/packages/kirki-pro-tabs/dist/control.css000064400000001677147177211530015725 0ustar00.rtl .customize-control-kirki-tab{left:0;right:-24px}.customize-control-kirki-tab{left:-24px;position:relative;width:calc(100% + 48px)}.kirki-tab .kirki-tab-menu,.kirki-tab .kirki-tab-menu-item{list-style:none;margin:0;padding:0}.kirki-tab .kirki-tab-menu{border-bottom:1px solid #ddd;display:flex;flex-wrap:wrap;font-size:14px;font-weight:600;margin-bottom:12px;position:relative}.kirki-tab .kirki-tab-menu-item{flex-grow:1;position:relative}.kirki-tab .kirki-tab-menu-item a{align-items:center;border-bottom:2px solid transparent;display:flex;height:50px;justify-content:center;padding-left:15px;padding-right:15px;position:relative;text-decoration:none}.kirki-tab .kirki-tab-menu-item a:focus{box-shadow:none}.kirki-tab .kirki-tab-menu-item a:active,.kirki-tab .kirki-tab-menu-item a:focus{color:#2271b1}.kirki-tab .kirki-tab-menu-item.is-active a{border-color:#2271b1}.kirki-tab-item-hidden{display:none!important} /*# sourceMappingURL=control.css.map */ pro-src/packages/kirki-pro-tabs/composer.json000064400000000272147177211530015300 0ustar00{ "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\Tabs\\": "src" } } }pro-src/packages/kirki-pro-tabs/.gitignore000064400000000063147177211530014544 0ustar00node_modules package-lock.json .parcel-cache buildspro-src/packages/kirki-pro-input-slider/composer.lock000064400000001124147177211530016742 0ustar00{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "b7c0bf1ec14636d40821afb93874266e", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } pro-src/packages/kirki-pro-input-slider/readme.txt000064400000000552147177211530016243 0ustar00=== Kirki Input Slider Control === Contributors: davidvongries Tags: kirki-input-slider-control Requires at least: 5.2 Tested up to: 5.9 Requires PHP: 7.0 License: GPL-3.0 License License URI: https://oss.ninja/gpl-3.0?organization=Kirki%20Framework&project=kirki%20pro%20input%20slider == Description == Input slider extension for Kirki Customizer Framework. pro-src/packages/kirki-pro-input-slider/vendor/autoload.php000064400000001403147177211530020057 0ustar00 array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); pro-src/packages/kirki-pro-input-slider/vendor/composer/autoload_real.php000064400000002161147177211530022713 0ustar00register(true); return $loader; } } pro-src/packages/kirki-pro-input-slider/vendor/composer/platform_check.php000064400000001635147177211530023066 0ustar00= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.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 ); } pro-src/packages/kirki-pro-input-slider/vendor/composer/ClassLoader.php000064400000040220147177211530022272 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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 */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $classMap * * @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 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) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $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 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) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $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] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $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 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 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 indexed by their corresponding vendor directories. * * @return 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); } } pro-src/packages/kirki-pro-input-slider/vendor/composer/autoload_classmap.php000064400000000336147177211530023575 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); pro-src/packages/kirki-pro-input-slider/vendor/composer/autoload_static.php000064400000002564147177211530023266 0ustar00 array ( 'Kirki\\Pro\\InputSlider\\' => 22, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\InputSlider\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitaa7362cafc4023cfd44d39ecfc30cc1d::$classMap; }, null, ClassLoader::class); } } pro-src/packages/kirki-pro-input-slider/vendor/composer/InstalledVersions.php000064400000037417147177211530023564 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } pro-src/packages/kirki-pro-input-slider/vendor/composer/installed.json000064400000000105147177211530022235 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } pro-src/packages/kirki-pro-input-slider/vendor/composer/installed.php000064400000001344147177211530022061 0ustar00 array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); pro-src/packages/kirki-pro-input-slider/src/KirkiInputSliderControl.js000064400000006460147177211530022173 0ustar00import KirkiInputSliderForm from "./KirkiInputSliderForm"; /** * KirkiInputSliderControl. * * Global objects brought: * - wp * - jQuery * - React * - ReactDOM * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiInputSliderControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with . function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind("removed", onRemoved); } } wp.customize.control.bind("removed", onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; ReactDOM.render( , control.container[0] ); if (false !== control.params.choices.allowCollapse) { control.container.addClass("allowCollapse"); } }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component value's state when customizer setting's value is changed. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, /** * This method will be overriden by the rendered component. */ updateComponentState: (val) => {}, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } }, }); export default KirkiInputSliderControl; pro-src/packages/kirki-pro-input-slider/src/KirkiInputSliderForm.js000064400000007723147177211530021461 0ustar00import { useRef } from "react"; const KirkiInputSliderForm = (props) => { const { control, customizerSetting, choices } = props; let trigger = ""; const validateValue = (value) => { if (value < choices.min) value = choices.min; if (value > choices.max) value = choices.max; return value; }; const getValueObject = (value) => { value = "string" !== typeof value ? value.toString() : value; const valueUnit = value.replace(/\d+/g, ""); let valueNumber = value.replace(valueUnit, ""); valueNumber = parseFloat(valueNumber.trim()); valueNumber = validateValue(valueNumber); return { number: valueNumber, unit: valueUnit, }; }; const getValueForInput = (value) => { const valueObject = getValueObject(value); return valueObject.number + valueObject.unit; }; const getValueForSlider = (value) => { return getValueObject(value).number; }; control.updateComponentState = (val) => { if ("slider" === trigger) { valueRef.current.value = getValueForInput(val); } else if ("input" === trigger) { sliderRef.current.value = getValueForSlider(val); } else if ("reset" === trigger) { valueRef.current.value = val; sliderRef.current.value = val; } }; const handleInputChange = (e) => { trigger = "input"; customizerSetting.set(getValueForInput(e.target.value)); }; const handleSliderChange = (e) => { trigger = "slider"; let value = parseFloat(e.target.value); value = validateValue(value); const inputValueObj = getValueObject(valueRef.current.value); // We're going to use the unit. const valueForInput = value + inputValueObj.unit; customizerSetting.set(valueForInput); }; const handleReset = (e) => { if ("" !== props.default && "undefined" !== typeof props.default) { sliderRef.current.value = props.default; valueRef.current.value = props.default; } else { if ("" !== props.value) { sliderRef.current.value = props.value; valueRef.current.value = props.value; } else { sliderRef.current.value = choices.min; valueRef.current.value = ""; } } trigger = "reset"; customizerSetting.set(sliderRef.current.value); }; // Preparing for the template. const fieldId = `kirki-control-input-${customizerSetting.id}`; const sliderValue = getValueForSlider(props.value); const inputValue = getValueForInput(props.value); const sliderRef = useRef(null); const valueRef = useRef(null); return (
    ); }; export default KirkiInputSliderForm; pro-src/packages/kirki-pro-input-slider/src/Init.php000064400000001212147177211530016442 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize_callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = [ __CLASS__, 'sanitize' ]; } } return $args; } /** * Sanitize the value. * * @param mixed $value The value to sanitize. * @return mixed */ public static function sanitize( $value ) { if ( is_numeric( $value ) ) { return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } else { return sanitize_text_field( $value ); } } /** * Filter arguments before creating the control. * * @since 1.0.0 * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-input-slider'; } return $args; } } pro-src/packages/kirki-pro-input-slider/src/Control/InputSlider.php000064400000007415147177211530021434 0ustar00choices['unit'] ) ) { $this->value_unit = $this->choices['unit']; } // If the value includes the unit, then replace the `value_unit` (set from choice) with unit from value. if ( ! is_numeric( $this->value() ) ) { $this->value_unit = preg_replace( '/\d+/', '', $this->value() ); $this->value_number = str_ireplace( $this->value_unit, '', $this->value() ); $this->value_number = (float) $this->value_number; } else { $this->value_number = (float) $this->value(); } // Set default choices. $this->choices = wp_parse_args( $this->choices, [ 'min' => 0, 'max' => 100, 'step' => 1, ] ); $this->choices['min'] = (float) $this->choices['min']; $this->choices['max'] = (float) $this->choices['max']; $this->choices['step'] = (float) $this->choices['step']; // Value number must not be less than min and must not be greater than max. $this->value_number = $this->value_number < $this->choices['min'] ? $this->choices['min'] : $this->value_number; $this->value_number = $this->value_number > $this->choices['max'] ? $this->choices['max'] : $this->value_number; } /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-input-slider', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'kirki-control-input-slider', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-controls', 'customize-base', 'react-dom' ], self::$control_ver, false ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() * * @since 1.0 * @access public */ public function to_json() { parent::to_json(); if ( isset( $this->json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->json['value_number'] = $this->value_number; $this->json['value_unit'] = $this->value_unit; $this->json['value'] = $this->value_number . $this->value_unit; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} } pro-src/packages/kirki-pro-input-slider/kirki-pro-input-slider.php000064400000002674147177211530021311 0ustar00 0.5%, last 2 versions, not dead", "source": "src/control.js", "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" } } pro-src/packages/kirki-pro-input-slider/.babelrc000064400000000131147177211530015631 0ustar00{ "presets": [ [ "@babel/preset-react", { "runtime": "classic" } ] ] }pro-src/packages/kirki-pro-input-slider/dist/control.js000064400000006604147177211530017232 0ustar00!function(){var t={};t=React;var e=function(e){var n=e.control,r=e.customizerSetting,a=e.choices,i="",o=function(t){return ta.max&&(t=a.max),t},c=function(t){var e=(t="string"!=typeof t?t.toString():t).replace(/\d+/g,""),n=t.replace(e,"");return n=parseFloat(n.trim()),{number:n=o(n),unit:e}},l=function(t){var e=c(t);return e.number+e.unit},u=function(t){return c(t).number};n.updateComponentState=function(t){"slider"===i?f.current.value=l(t):"input"===i?d.current.value=u(t):"reset"===i&&(f.current.value=t,d.current.value=t)};var s="kirki-control-input-".concat(r.id),m=u(e.value),p=l(e.value),d=t.useRef(null),f=t.useRef(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},React.createElement("label",{className:"kirki-control-label",htmlFor:s},React.createElement("span",{className:"customize-control-title"},e.label),React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:e.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:function(t){""!==e.default&&void 0!==e.default?(d.current.value=e.default,f.current.value=e.default):""!==e.value?(d.current.value=e.value,f.current.value=e.value):(d.current.value=a.min,f.current.value=""),i="reset",r.set(d.current.value)}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("input",{ref:d,type:"range",id:s,defaultValue:m,min:a.min,max:a.max,step:a.step,className:"kirki-control-input-slider kirki-pro-control-input-slider",onChange:function(t){i="slider";var e=parseFloat(t.target.value),n=(e=o(e))+c(f.current.value).unit;r.set(n)}})),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("input",{ref:f,type:"text",defaultValue:p,className:"kirki-control-input",onChange:function(t){i="input",r.set(l(t.target.value))}}))))};function n(){return n=Object.assign||function(t){for(var e=1;e {\n const { control, customizerSetting, choices } = props;\n\n let trigger = \"\";\n\n const validateValue = (value) => {\n if (value < choices.min) value = choices.min;\n if (value > choices.max) value = choices.max;\n\n return value;\n };\n\n const getValueObject = (value) => {\n value = \"string\" !== typeof value ? value.toString() : value;\n\n const valueUnit = value.replace(/\\d+/g, \"\");\n let valueNumber = value.replace(valueUnit, \"\");\n\n valueNumber = parseFloat(valueNumber.trim());\n valueNumber = validateValue(valueNumber);\n\n return {\n number: valueNumber,\n unit: valueUnit,\n };\n };\n\n const getValueForInput = (value) => {\n const valueObject = getValueObject(value);\n return valueObject.number + valueObject.unit;\n };\n\n const getValueForSlider = (value) => {\n return getValueObject(value).number;\n };\n\n control.updateComponentState = (val) => {\n if (\"slider\" === trigger) {\n valueRef.current.value = getValueForInput(val);\n } else if (\"input\" === trigger) {\n sliderRef.current.value = getValueForSlider(val);\n } else if (\"reset\" === trigger) {\n valueRef.current.value = val;\n sliderRef.current.value = val;\n }\n };\n\n const handleInputChange = (e) => {\n trigger = \"input\";\n customizerSetting.set(getValueForInput(e.target.value));\n };\n\n const handleSliderChange = (e) => {\n trigger = \"slider\";\n\n let value = parseFloat(e.target.value);\n value = validateValue(value);\n\n const inputValueObj = getValueObject(valueRef.current.value); // We're going to use the unit.\n const valueForInput = value + inputValueObj.unit;\n\n customizerSetting.set(valueForInput);\n };\n\n const handleReset = (e) => {\n if (\"\" !== props.default && \"undefined\" !== typeof props.default) {\n sliderRef.current.value = props.default;\n valueRef.current.value = props.default;\n } else {\n if (\"\" !== props.value) {\n sliderRef.current.value = props.value;\n valueRef.current.value = props.value;\n } else {\n sliderRef.current.value = choices.min;\n valueRef.current.value = \"\";\n }\n }\n\n trigger = \"reset\";\n customizerSetting.set(sliderRef.current.value);\n };\n\n // Preparing for the template.\n const fieldId = `kirki-control-input-${customizerSetting.id}`;\n const sliderValue = getValueForSlider(props.value);\n const inputValue = getValueForInput(props.value);\n\n const sliderRef = useRef(null);\n const valueRef = useRef(null);\n\n return (\n
    \n \n\n
    \n\n \n \n \n\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n );\n};\n\nexport default KirkiInputSliderForm;\n","import KirkiInputSliderForm from \"./KirkiInputSliderForm\";\r\n\r\n/**\r\n * KirkiInputSliderControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiInputSliderControl = wp.customize.Control.extend({\r\n /**\r\n * Initialize.\r\n *\r\n * @param {string} id - Control ID.\r\n * @param {object} params - Control params.\r\n */\r\n initialize: function (id, params) {\r\n const control = this;\r\n\r\n // Bind functions to this control context for passing as React props.\r\n control.setNotificationContainer =\r\n control.setNotificationContainer.bind(control);\r\n\r\n wp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n // The following should be eliminated with .\r\n function onRemoved(removedControl) {\r\n if (control === removedControl) {\r\n control.destroy();\r\n control.container.remove();\r\n wp.customize.control.unbind(\"removed\", onRemoved);\r\n }\r\n }\r\n\r\n wp.customize.control.bind(\"removed\", onRemoved);\r\n },\r\n\r\n /**\r\n * Set notification container and render.\r\n *\r\n * This is called when the React component is mounted.\r\n *\r\n * @param {Element} element - Notification container.\r\n * @returns {void}\r\n */\r\n setNotificationContainer: function setNotificationContainer(element) {\r\n const control = this;\r\n\r\n control.notifications.container = jQuery(element);\r\n control.notifications.render();\r\n },\r\n\r\n /**\r\n * Render the control into the DOM.\r\n *\r\n * This is called from the Control#embed() method in the parent class.\r\n *\r\n * @returns {void}\r\n */\r\n renderContent: function renderContent() {\r\n const control = this;\r\n\r\n ReactDOM.render(\r\n ,\r\n control.container[0]\r\n );\r\n\r\n if (false !== control.params.choices.allowCollapse) {\r\n control.container.addClass(\"allowCollapse\");\r\n }\r\n },\r\n\r\n /**\r\n * After control has been first rendered, start re-rendering when setting changes.\r\n *\r\n * React is able to be used here instead of the wp.customize.Element abstraction.\r\n *\r\n * @returns {void}\r\n */\r\n ready: function ready() {\r\n const control = this;\r\n\r\n /**\r\n * Update component value's state when customizer setting's value is changed.\r\n */\r\n control.setting.bind((val) => {\r\n control.updateComponentState(val);\r\n });\r\n },\r\n\r\n /**\r\n * This method will be overriden by the rendered component.\r\n */\r\n updateComponentState: (val) => {},\r\n\r\n /**\r\n * Handle removal/de-registration of the control.\r\n *\r\n * This is essentially the inverse of the Control#embed() method.\r\n *\r\n * @link https://core.trac.wordpress.org/ticket/31334\r\n * @returns {void}\r\n */\r\n destroy: function destroy() {\r\n const control = this;\r\n\r\n // Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n ReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n // Call destroy method in parent if it exists (as of #31334).\r\n if (wp.customize.Control.prototype.destroy) {\r\n wp.customize.Control.prototype.destroy.call(control);\r\n }\r\n },\r\n});\r\n\r\nexport default KirkiInputSliderControl;\r\n","import \"./control.scss\";\r\nimport KirkiInputSliderControl from './KirkiInputSliderControl';\r\n\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor['kirki-input-slider'] = KirkiInputSliderControl;\r\n"],"names":["module","React","$5e62cac5aac90bdd$export$2e2bcd8739ae039","props","control","customizerSetting","choices","trigger","validateValue","value","min","max","getValueObject","valueUnit","toString","replace","valueNumber","parseFloat","trim","number","unit","getValueForInput","valueObject","getValueForSlider","updateComponentState","val","valueRef","current","sliderRef","fieldId","concat","id","sliderValue","inputValue","useRef","createElement","className","tabIndex","htmlFor","label","dangerouslySetInnerHTML","__html","description","ref","setNotificationContainer","type","onClick","e","default","set","defaultValue","step","onChange","target","valueForInput","wp","customize","Control","extend","initialize","params","this","bind","ReactDOM","render","prototype","call","removedControl","destroy","container","remove","onRemoved","element","notifications","unmountComponentAtNode","controlConstructor","KirkiInputSliderControl"],"version":3,"file":"control.js.map"}pro-src/packages/kirki-pro-input-slider/dist/control.css000064400000006541147177211530017406 0ustar00.customize-control-kirki-input-slider .kirki-control-label{display:block;position:relative}.customize-control-kirki-input-slider .customize-control-description{padding-right:30px}.customize-control-kirki-input-slider .kirki-control-form{margin-bottom:12px;position:relative}.customize-control-kirki-input-slider .kirki-control-form:hover .kirki-control-reset{opacity:1}.customize-control-kirki-input-slider .kirki-control-reset{align-items:center;background-color:transparent;border-radius:50%;border-width:0;bottom:36px;color:#50575e;cursor:pointer;display:flex;height:16px;justify-content:center;opacity:0;padding:0;position:absolute;right:0;transition:all .3s;width:16px;z-index:3}.customize-control-kirki-input-slider .kirki-control-reset:focus{opacity:1}.customize-control-kirki-input-slider .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-input-slider .kirki-control-reset i{font-size:12px;height:auto;transform:rotate(45deg);transition:transform .3s;width:auto}.customize-control-kirki-input-slider .kirki-control-cols{align-items:center;display:flex;justify-content:space-between}.customize-control-kirki-input-slider .kirki-control-left-col{padding-right:13px;width:75%}.customize-control-kirki-input-slider .kirki-control-right-col{text-align:right;width:25%}.customize-control-kirki-input-slider .kirki-control-input:focus{background-color:#fff}.customize-control-kirki-input-slider .kirki-control-input{background-color:#f7f7f7;border-color:#bbb;border-radius:4px;font-size:12px;text-align:center;transition:box-shadow .15s;z-index:2}.customize-control-kirki-input-slider .kirki-control-input-slider{-webkit-appearance:none;background-color:#bdc3c7;border-radius:2.5px;height:5px;margin:0;outline:none;padding:0;position:relative;top:-1px;width:100%}.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background-color:#f0f0f0;border:1px solid #999;border-radius:50%;box-shadow:none;cursor:pointer;height:16px;-webkit-transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;width:16px}.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb:focus,.customize-control-kirki-input-slider .kirki-control-input-slider::-webkit-slider-thumb:hover{background-color:#e7e7e7}.customize-control-kirki-input-slider .kirki-control-input-slider:active::-webkit-slider-thumb{background-color:#e7e7e7}.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb{background-color:#f0f0f0;border:1px solid #999;border-radius:50%;box-shadow:none;cursor:pointer;height:16px;-moz-transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;transition:background-color .15s ease-in-out,box-shadow .15s cubic-bezier(.4,0,.2,1) 0ms;width:16px}.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb:focus,.customize-control-kirki-input-slider .kirki-control-input-slider::-moz-range-thumb:hover{background-color:#e7e7e7}.customize-control-kirki-input-slider ::-moz-range-track{background-color:#bdc3c7;border:0}.customize-control-kirki-input-slider input::-moz-focus-inner,.customize-control-kirki-input-slider input::-moz-focus-outer{border:0} /*# sourceMappingURL=control.css.map */ pro-src/packages/kirki-pro-input-slider/composer.json000064400000000372147177211530016767 0ustar00{ "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\InputSlider\\": "src" } } }pro-src/packages/kirki-pro-input-slider/.gitignore000064400000000063147177211530016232 0ustar00node_modules package-lock.json .parcel-cache buildspro-src/packages/kirki-pro-headline-divider/composer.lock000064400000001124147177211530017520 0ustar00{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "7671334a59eed8eda46b8c2c75a5fecf", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } pro-src/packages/kirki-pro-headline-divider/kirki-pro-headline-divider.php000064400000002777147177211530022651 0ustar00 array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); pro-src/packages/kirki-pro-headline-divider/vendor/composer/autoload_real.php000064400000002161147177211530023471 0ustar00register(true); return $loader; } } pro-src/packages/kirki-pro-headline-divider/vendor/composer/platform_check.php000064400000001635147177211530023644 0ustar00= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.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 ); } pro-src/packages/kirki-pro-headline-divider/vendor/composer/ClassLoader.php000064400000040220147177211530023050 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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 */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $classMap * * @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 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) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $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 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) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $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] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $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 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 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 indexed by their corresponding vendor directories. * * @return 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); } } pro-src/packages/kirki-pro-headline-divider/vendor/composer/autoload_classmap.php000064400000000336147177211530024353 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); pro-src/packages/kirki-pro-headline-divider/vendor/composer/autoload_static.php000064400000002574147177211530024045 0ustar00 array ( 'Kirki\\Pro\\HeadlineDivider\\' => 26, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\HeadlineDivider\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::$prefixDirsPsr4; $loader->classMap = ComposerStaticInit09f4acd2a8ddcef84af2ce57f365286e::$classMap; }, null, ClassLoader::class); } } pro-src/packages/kirki-pro-headline-divider/vendor/composer/InstalledVersions.php000064400000037417147177211530024342 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } pro-src/packages/kirki-pro-headline-divider/vendor/composer/installed.json000064400000000105147177211530023013 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } pro-src/packages/kirki-pro-headline-divider/vendor/composer/installed.php000064400000001344147177211530022637 0ustar00 array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); pro-src/packages/kirki-pro-headline-divider/src/Init.php000064400000001373147177211530017230 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @since 0.1 * * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-divider'; } return $args; } } pro-src/packages/kirki-pro-headline-divider/src/Field/Headline.php000064400000003466147177211530021066 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = '__return_null'; } } return $args; } /** * Filter arguments before creating the control. * * @since 0.1 * * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-headline'; } return $args; } } pro-src/packages/kirki-pro-headline-divider/src/Field/HeadlineToggle.php000064400000000732147177211530022221 0ustar00choices ) && isset( $this->choices['color'] ) ? esc_attr( $this->choices['color'] ) : '#ccc'; $border_bottom_color = '#f8f8f8'; $this->json['choices']['borderTopColor'] = $border_top_color; $this->json['choices']['borderBottomColor'] = $border_bottom_color; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * @since 1.0 */ protected function content_template() { ?>
    <# if (data.label) { #>

    {{{ data.label }}}

    <# } #> <# if (data.description) { #>

    {{{ data.description }}}

    <# } #>
    wrapper_attrs['class'] = '{default_class} ' . $args['wrapper_attrs']['class'] . ' customize-control-kirki-headline-toggle'; } else { $this->wrapper_attrs['class'] = '{default_class} customize-control-kirki-headline-toggle'; } } } pro-src/packages/kirki-pro-headline-divider/package.json000064400000001433147177211530017310 0ustar00{ "name": "kirki-pro-headline-divider", "version": "1.1", "description": "Dev toolkit for Kirki kirki-pro-headline-divider", "keywords": [ "kirki-pro-headline-divider" ], "author": "Kirki", "license": "MIT", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "devDependencies": { "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "source": "src/control.js", "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" }, "alias": { "jquery": { "global": "jQuery" }, "wp": { "global": "wp" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead" } pro-src/packages/kirki-pro-headline-divider/dist/control.js000064400000000045147177211530020001 0ustar00 //# sourceMappingURL=control.js.map pro-src/packages/kirki-pro-headline-divider/dist/control.css.map000064400000005677147177211530020751 0ustar00{"mappings":"AAAA,kCAKE,qBAAA,CAHA,UAAA,CACA,iBAAA,CAFA,iBAAA,CAGA,uBCEF,CDCE,2DAIE,cAAA,CACA,eAAA,CAFA,eAAA,CADA,eAAA,CADA,YCKJ,CDEE,iEAGE,eAAA,CADA,eAAA,CADA,YCEJ,CDII,0EAEE,QAAA,CADA,QCDN,CDKQ,iGACE,WCHV,CDQI,0EACE,WCNN,CDWA,yCAKE,qBAAA,CADA,UAAA,CAFA,iBAAA,CADA,iBAAA,CAEA,uBCNF,CDWI,sFACE,kBCTN,CDaE,kEAEE,cAAA,CADA,eCVJ,CDeI,2EACE,OCbN","sources":["src/control.scss","%3Cinput%20css%20KSx3Ca%3E"],"sourcesContent":[".customize-control-kirki-headline {\r\n position: relative;\r\n left: -24px;\r\n padding: 10px 24px;\r\n width: calc(100% + 48px);\r\n background-color: #fff;\r\n\r\n .customize-control-title {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n line-height: 1.2;\r\n font-size: 14px;\r\n font-weight: 600;\r\n }\r\n\r\n .customize-control-description {\r\n margin-top: 0;\r\n margin-bottom: 0;\r\n line-height: 1.3;\r\n }\r\n\r\n .kirki-tooltip-wrapper {\r\n .tooltip-trigger {\r\n top: -4px;\r\n left: 2px;\r\n\r\n &:hover {\r\n + .tooltip-content {\r\n bottom: 29px;\r\n }\r\n }\r\n }\r\n\r\n .tooltip-content {\r\n bottom: 26px;\r\n }\r\n }\r\n}\r\n\r\n.customize-control-kirki-headline-toggle {\r\n position: relative;\r\n padding: 10px 24px;\r\n width: calc(100% + 48px);\r\n left: -24px;\r\n background-color: #fff;\r\n\r\n &.customize-control-kirki-switch {\r\n .kirki-toggle {\r\n align-items: center;\r\n }\r\n }\r\n\r\n .customize-control-title {\r\n margin-bottom: 0;\r\n font-size: 14px;\r\n }\r\n\r\n .kirki-toggle {\r\n .kirki-control-form {\r\n top: 2px;\r\n }\r\n }\r\n}\r\n",".customize-control-kirki-headline {\n position: relative;\n left: -24px;\n padding: 10px 24px;\n width: calc(100% + 48px);\n background-color: #fff;\n}\n.customize-control-kirki-headline .customize-control-title {\n margin-top: 0;\n margin-bottom: 0;\n line-height: 1.2;\n font-size: 14px;\n font-weight: 600;\n}\n.customize-control-kirki-headline .customize-control-description {\n margin-top: 0;\n margin-bottom: 0;\n line-height: 1.3;\n}\n.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger {\n top: -4px;\n left: 2px;\n}\n.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger:hover + .tooltip-content {\n bottom: 29px;\n}\n.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-content {\n bottom: 26px;\n}\n\n.customize-control-kirki-headline-toggle {\n position: relative;\n padding: 10px 24px;\n width: calc(100% + 48px);\n left: -24px;\n background-color: #fff;\n}\n.customize-control-kirki-headline-toggle.customize-control-kirki-switch .kirki-toggle {\n align-items: center;\n}\n.customize-control-kirki-headline-toggle .customize-control-title {\n margin-bottom: 0;\n font-size: 14px;\n}\n.customize-control-kirki-headline-toggle .kirki-toggle .kirki-control-form {\n top: 2px;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}pro-src/packages/kirki-pro-headline-divider/dist/control.js.map000064400000000137147177211530020557 0ustar00{"mappings":"","sources":[],"sourcesContent":[],"names":[],"version":3,"file":"control.js.map"}pro-src/packages/kirki-pro-headline-divider/dist/control.css000064400000002137147177211530020161 0ustar00.customize-control-kirki-headline{background-color:#fff;left:-24px;padding:10px 24px;position:relative;width:calc(100% + 48px)}.customize-control-kirki-headline .customize-control-title{font-size:14px;font-weight:600;line-height:1.2;margin-bottom:0;margin-top:0}.customize-control-kirki-headline .customize-control-description{line-height:1.3;margin-bottom:0;margin-top:0}.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger{left:2px;top:-4px}.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-trigger:hover+.tooltip-content{bottom:29px}.customize-control-kirki-headline .kirki-tooltip-wrapper .tooltip-content{bottom:26px}.customize-control-kirki-headline-toggle{background-color:#fff;left:-24px;padding:10px 24px;position:relative;width:calc(100% + 48px)}.customize-control-kirki-headline-toggle.customize-control-kirki-switch .kirki-toggle{align-items:center}.customize-control-kirki-headline-toggle .customize-control-title{font-size:14px;margin-bottom:0}.customize-control-kirki-headline-toggle .kirki-toggle .kirki-control-form{top:2px} /*# sourceMappingURL=control.css.map */ pro-src/packages/kirki-pro-headline-divider/composer.json000064400000000376147177211530017551 0ustar00{ "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\HeadlineDivider\\": "src" } } }pro-src/packages/kirki-pro-headline-divider/.gitignore000064400000000063147177211530017010 0ustar00node_modules package-lock.json .parcel-cache buildspro-src/packages/kirki-pro-margin-padding/composer.lock000064400000001124147177211530017204 0ustar00{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "6068bbfbc68ad05162ba739d0807ec89", "packages": [], "packages-dev": [], "aliases": [], "minimum-stability": "dev", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": ">=7.0" }, "platform-dev": [], "plugin-api-version": "2.2.0" } pro-src/packages/kirki-pro-margin-padding/kirki-pro-margin-padding.php000064400000002740147177211530022007 0ustar00 array($baseDir . '/src'), 'Kirki\\Pro\\Field\\' => array($baseDir . '/src/Field'), 'Kirki\\Pro\\Control\\' => array($baseDir . '/src/Control'), ); pro-src/packages/kirki-pro-margin-padding/vendor/composer/autoload_real.php000064400000002161147177211530023155 0ustar00register(true); return $loader; } } pro-src/packages/kirki-pro-margin-padding/vendor/composer/platform_check.php000064400000001635147177211530023330 0ustar00= 70000)) { $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.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 ); } pro-src/packages/kirki-pro-margin-padding/vendor/composer/ClassLoader.php000064400000040220147177211530022534 0ustar00 * Jordi Boggiano * * 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 * @author Jordi Boggiano * @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 */ private $vendorDir; // PSR-4 /** * @var array[] * @psalm-var array> */ private $prefixLengthsPsr4 = array(); /** * @var array[] * @psalm-var array> */ private $prefixDirsPsr4 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr4 = array(); // PSR-0 /** * @var array[] * @psalm-var array> */ private $prefixesPsr0 = array(); /** * @var array[] * @psalm-var array */ private $fallbackDirsPsr0 = array(); /** @var bool */ private $useIncludePath = false; /** * @var string[] * @psalm-var array */ private $classMap = array(); /** @var bool */ private $classMapAuthoritative = false; /** * @var bool[] * @psalm-var array */ private $missingClasses = array(); /** @var ?string */ private $apcuPrefix; /** * @var self[] */ private static $registeredLoaders = array(); /** * @param ?string $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; self::initializeIncludeClosure(); } /** * @return string[] */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); } return array(); } /** * @return array[] * @psalm-return array> */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } /** * @return array[] * @psalm-return array */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } /** * @return array[] * @psalm-return array */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } /** * @return string[] Array of classname => path * @psalm-return array */ public function getClassMap() { return $this->classMap; } /** * @param string[] $classMap Class to filename map * @psalm-param array $classMap * * @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 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) { if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( (array) $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, (array) $paths ); } return; } $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { $this->prefixesPsr0[$first][$prefix] = (array) $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( (array) $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], (array) $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 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) { if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( (array) $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, (array) $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] = (array) $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( (array) $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], (array) $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 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 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 indexed by their corresponding vendor directories. * * @return 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); } } pro-src/packages/kirki-pro-margin-padding/vendor/composer/autoload_classmap.php000064400000000336147177211530024037 0ustar00 $vendorDir . '/composer/InstalledVersions.php', ); pro-src/packages/kirki-pro-margin-padding/vendor/composer/autoload_static.php000064400000002570147177211530023525 0ustar00 array ( 'Kirki\\Pro\\MarginPadding\\' => 24, 'Kirki\\Pro\\Field\\' => 16, 'Kirki\\Pro\\Control\\' => 18, ), ); public static $prefixDirsPsr4 = array ( 'Kirki\\Pro\\MarginPadding\\' => array ( 0 => __DIR__ . '/../..' . '/src', ), 'Kirki\\Pro\\Field\\' => array ( 0 => __DIR__ . '/../..' . '/src/Field', ), 'Kirki\\Pro\\Control\\' => array ( 0 => __DIR__ . '/../..' . '/src/Control', ), ); public static $classMap = array ( 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::$prefixDirsPsr4; $loader->classMap = ComposerStaticInitdcc6b1a8cec7267c7e011f71f11c7c7e::$classMap; }, null, ClassLoader::class); } } pro-src/packages/kirki-pro-margin-padding/vendor/composer/InstalledVersions.php000064400000037417147177211530024026 0ustar00 * Jordi Boggiano * * 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}|array{}|null */ private static $installed; /** * @var bool|null */ private static $canGetVendors; /** * @var array[] * @psalm-var array}> */ 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 */ 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 */ 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} */ 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}> */ 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} $data */ public static function reload($data) { self::$installed = $data; self::$installedByVendor = array(); } /** * @return array[] * @psalm-return list}> */ 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} $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} $required */ $required = require __DIR__ . '/installed.php'; self::$installed = $required; } else { self::$installed = array(); } } if (self::$installed !== array()) { $installed[] = self::$installed; } return $installed; } } pro-src/packages/kirki-pro-margin-padding/vendor/composer/installed.json000064400000000105147177211530022477 0ustar00{ "packages": [], "dev": true, "dev-package-names": [] } pro-src/packages/kirki-pro-margin-padding/vendor/composer/installed.php000064400000001344147177211530022323 0ustar00 array( 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', 'reference' => 'd5286e9104c4b742888a94467b07540d1081f2aa', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), ), ); pro-src/packages/kirki-pro-margin-padding/src/Init.php000064400000001210147177211530016702 0ustar00 { const { control, customizerSetting, defaultArray, valueArray, valueUnit } = props; const [inputValues, setInputValues] = useState(() => { return valueArray; }); const getSingleValueAsObject = (value) => { let unit = ""; let number = ""; let negative = ""; if ("" !== value) { value = "string" !== typeof value ? value.toString() : value; value = value.trim(); negative = -1 < value.indexOf("-") ? "-" : ""; value = value.replace(negative, ""); if ("" !== value) { unit = value.replace(/\d+/g, ""); number = value.replace(unit, ""); number = negative + number.trim(); number = parseFloat(number); } else { number = negative; } } return { unit: unit, number: number, }; }; const getValuesForInput = (values) => { let singleValue; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { singleValue = getSingleValueAsObject(values[position]); values[position] = singleValue.number; } } return values; }; const getValuesForCustomizer = (values) => { let singleValue; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { singleValue = values[position]; if ("" !== singleValue) { singleValue = getSingleValueAsObject(singleValue); singleValue = singleValue.number + valueUnit; } values[position] = singleValue; } } return values; }; control.updateComponentState = (val) => { setInputValues(getValuesForInput(val)); }; const handleChange = (e, position) => { let values = { ...inputValues }; values[position] = e.target.value; customizerSetting.set(getValuesForCustomizer(values)); }; const handleReset = (e) => { const values = "" !== props.default && "undefined" !== typeof props.default ? defaultArray : valueArray; customizerSetting.set(getValuesForCustomizer(values)); }; // Preparing for the template. const fieldId = `kirki-control-input-${props.type}-top`; const unitRef = useRef(null); const makeMapable = () => { const items = []; for (const position in inputValues) { if (Object.hasOwnProperty.call(inputValues, position)) { items.push({ position: position, value: inputValues[position] }); } } return items; }; return (
    {(props.label || props.description) && ( <>
    )}
    {makeMapable(inputValues).map((item) => { const className = `kirki-control-input kirki-control-input-${item.position}`; const id = `kirki-control-input-${props.type}-${item.position}`; return (
    handleChange(e, item.position)} />
    ); })}
    {valueUnit}
    ); }; export default KirkiMarginPaddingForm; pro-src/packages/kirki-pro-margin-padding/src/KirkiMarginPaddingControl.js000064400000006474147177211530022704 0ustar00import KirkiMarginPaddingForm from "./KirkiMarginPaddingForm"; /** * KirkiMarginPaddingControl. * * Global objects brought: * - wp * - jQuery * - React * - ReactDOM * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiMarginPaddingControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with . function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind("removed", onRemoved); } } wp.customize.control.bind("removed", onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; ReactDOM.render( , control.container[0] ); if (false !== control.params.choices.allowCollapse) { control.container.addClass("allowCollapse"); } }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component value's state when customizer setting's value is changed. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, /** * This method will be overriden by the rendered component. */ updateComponentState: (val) => {}, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } }, }); export default KirkiMarginPaddingControl; pro-src/packages/kirki-pro-margin-padding/src/preview.js000064400000002242147177211530017313 0ustar00(() => { /** * Function to hook into `kirkiPostMessageStylesOutput` filter. * * @param {string} styles The styles to be filtered. * @param {string|Object|int} values The control's value. * @param {Object} output The control's output argument. * @param {string} controlType The control type. * * @return {string} The filtered styles. */ const stylesOutput = (styles, values, output, controlType) => { if ("kirki-margin" !== controlType && "kirki-padding" !== controlType) { return styles; } if (!values.top && !values.right && !values.bottom && !values.left) { return styles; } const property = controlType.replace("kirki-", ""); styles += output.element + "{"; for (const position in values) { if (Object.hasOwnProperty.call(values, position)) { const value = values[position]; if ("" !== value) { styles += property + "-" + position + ": " + value + ";"; } } } styles += "}"; return styles; }; // Hook the function to the `kirkiPostMessageStylesOutput` filter. wp.hooks.addFilter("kirkiPostMessageStylesOutput", "kirki", stylesOutput); })(); pro-src/packages/kirki-pro-margin-padding/src/Field/Padding.php000064400000001723147177211530020401 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-padding'; } return $args; } } pro-src/packages/kirki-pro-margin-padding/src/Field/Margin.php000064400000006575147177211530020262 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize_callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = [ __CLASS__, 'sanitize' ]; } } return $args; } /** * Sanitize the value. * * @param mixed $values The value to sanitize. * @return mixed */ public static function sanitize( $values ) { foreach ( $values as $position => $value ) { if ( '' !== $value ) { if ( is_numeric( $value ) ) { $value = $value . 'px'; } } $values[ $position ] = sanitize_text_field( $value ); } return $values; } /** * Filter arguments before creating the control. * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-margin'; } return $args; } /** * Enqueue styles & scripts on 'customize_preview_init' action. * * @since 4.0.0 * @access public */ public function enqueue_customize_preview_scripts() { wp_enqueue_script( 'kirki-preview-margin-padding', URL::get_from_path( dirname( dirname( __DIR__ ) ) ) . '/dist/preview.js', [ 'wp-hooks', 'customize-preview' ], $this->control_class::$control_ver, true ); } /** * Add output control class for margin/padding control. * * @since 1.0.0 * @access public * * @param array $control_classes The existing control classes. * @return array */ public function output_control_classnames( $control_classes ) { $class_name = str_ireplace( 'kirki-', '', $this->type ); $class_name = ucfirst( $class_name ); $control_classes[ $this->type ] = '\Kirki\Pro\Field\CSS\\' . $class_name; return $control_classes; } } pro-src/packages/kirki-pro-margin-padding/src/Field/CSS/Padding.php000064400000000517147177211530021031 0ustar00type ); $unit = isset( $this->field['choices'] ) && isset( $this->field['choices']['unit'] ) ? $this->field['choices']['unit'] : 'px'; $output = wp_parse_args( $output, array( 'media_query' => 'global', 'element' => '', ) ); // Stop if the value is not an array. if ( ! is_array( $value ) ) { return; } foreach ( $value as $position => $value ) { if ( '' !== $value ) { $value = is_numeric( $value ) ? $value . $unit : $value; $css_property = $property . '-' . $position; $this->styles[ $output['media_query'] ][ $output['element'] ][ $css_property ] = $value; } } if ( 'kirki_pro_demo_responsive_margin[desktop]' === $this->field['settings'] ) { // error_log( print_r( get_theme_mod( 'kirki_pro_demo_responsive_margin[desktop]' ), true ) ); // error_log( print_r( $this->styles, true ) ); // error_log( print_r( $value, true ) ); } } } pro-src/packages/kirki-pro-margin-padding/src/Control/Padding.php000064400000000535147177211530020776 0ustar00 '', 'right' => '', 'bottom' => '', 'left' => '', ]; /** * The default of control's value. * This will be parsed with $this->value() and without the unit. * * @var array */ public $value_array = [ 'top' => '', 'right' => '', 'bottom' => '', 'left' => '', ]; /** * Control's constructor. * * @since 1.0.0 * * @param WP_Customize_Manager $wp_customize WP_Customize_Manager instance. * @param string $id The control's ID. * @param array $args The control's arguments. */ public function __construct( $wp_customize, $id, $args = array() ) { parent::__construct( $wp_customize, $id, $args ); // If `unit` choice is defined. if ( ! empty( $this->choices['unit'] ) ) { $this->value_unit = $this->choices['unit']; } $this->value_unit = strtolower( $this->value_unit ); // Parse $args['default'] with $this->default_array. if ( ! empty( $args['default'] ) && is_array( $args['default'] ) ) { $this->default_array = wp_parse_args( $args['default'], $this->default_array ); } $this->default_array = $this->remove_unit( $this->default_array ); // Parse $this->value() with $this->value_array. if ( ! empty( $this->value() ) && is_array( $this->value() ) ) { $this->value_array = wp_parse_args( $this->value(), $this->value_array ); } $this->value_array = $this->remove_unit( $this->value_array ); } /** * Remove unit from values. * * @param array $values The provided values. * @return array */ public function remove_unit( $values ) { foreach ( $values as $position => $value ) { if ( '' !== $value ) { // Force $value to not using unit. if ( ! is_numeric( $value ) ) { $unit = preg_replace( '/\d+/', '', $value ); $value = str_ireplace( $unit, '', $value ); $value = (float) $value; } else { $value = (float) $value; } } $values[ $position ] = $value; } return $values; } /** * Enqueue control related styles/scripts. * * @since 1.0 * @access public */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'kirki-control-margin-padding', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'kirki-control-margin-padding', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'jquery', 'customize-controls', 'customize-base', 'react-dom' ], self::$control_ver, false ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() * * @since 1.0 * @access public */ public function to_json() { parent::to_json(); if ( isset( $this->json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->json['valueArray'] = $this->value_array; $this->json['defaultArray'] = $this->value_array; $this->json['valueUnit'] = $this->value_unit; $this->json['value'] = []; foreach ( $this->json['valueArray'] as $position => $value ) { $this->json['value'][ $position ] = $value . $this->value_unit; } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} } pro-src/packages/kirki-pro-margin-padding/package.json000064400000001570147177211530016776 0ustar00{ "name": "kirki-pro-margin-padding", "version": "1.1", "description": "Dev toolkit for kirki-pro-margin-padding", "keywords": [ "kirki-pro-margin-padding" ], "author": "Kirki", "license": "MIT", "bugs": { "url": "https://www.themeum.com/" }, "homepage": "https://www.themeum.com/", "dependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, "devDependencies": { "@babel/preset-react": "^7.16.7", "@parcel/transformer-sass": "^2.2.1", "parcel": "^2.2.1" }, "alias": { "jquery": { "global": "jQuery" }, "react": { "global": "React" }, "react-dom": { "global": "ReactDOM" } }, "browserslist": "> 0.5%, last 2 versions, not dead", "source": [ "src/control.js", "src/preview.js" ], "scripts": { "build": "parcel build", "dev": "parcel build --no-optimize" } }pro-src/packages/kirki-pro-margin-padding/.babelrc000064400000000131147177211530016073 0ustar00{ "presets": [ [ "@babel/preset-react", { "runtime": "classic" } ] ] }pro-src/packages/kirki-pro-margin-padding/dist/preview.js.map000064400000003331147177211530020243 0ustar00{"mappings":"2DAkCI,SAAAA,EAAAC,EAAAC,EAAAC,GAEA,GAAA,iBAAAA,GAAA,kBAAAA,EAAA,OAAAH,EAGF,KAAAC,EAAAG,KAAAH,EAAAI,OAAAJ,EAAAK,QAAAL,EAAAM,MAFC,OAAAP,EAGEQ,IAAHC,EAAmBN,EAAnBO,QAAA,SAAA,iBAxCFV,GAAAE,EAAAS,QAAA","sources":["src/preview.js"],"sourcesContent":["(() => {\r\n /**\r\n * Function to hook into `kirkiPostMessageStylesOutput` filter.\r\n *\r\n * @param {string} styles The styles to be filtered.\r\n * @param {string|Object|int} values The control's value.\r\n * @param {Object} output The control's output argument.\r\n * @param {string} controlType The control type.\r\n *\r\n * @return {string} The filtered styles.\r\n */\r\n const stylesOutput = (styles, values, output, controlType) => {\r\n if (\"kirki-margin\" !== controlType && \"kirki-padding\" !== controlType) {\r\n return styles;\r\n }\r\n\r\n if (!values.top && !values.right && !values.bottom && !values.left) {\r\n return styles;\r\n }\r\n\r\n const property = controlType.replace(\"kirki-\", \"\");\r\n\r\n styles += output.element + \"{\";\r\n\r\n for (const position in values) {\r\n if (Object.hasOwnProperty.call(values, position)) {\r\n const value = values[position];\r\n\r\n if (\"\" !== value) {\r\n styles += property + \"-\" + position + \": \" + value + \";\";\r\n }\r\n }\r\n }\r\n\r\n styles += \"}\";\r\n\r\n return styles;\r\n };\r\n\r\n // Hook the function to the `kirkiPostMessageStylesOutput` filter.\r\n wp.hooks.addFilter(\"kirkiPostMessageStylesOutput\", \"kirki\", stylesOutput);\r\n})();\r\n"],"names":["styles","values","output","controlType","top","right","bottom","left","hooks","property","replace","element"],"version":3,"file":"preview.js.map"}pro-src/packages/kirki-pro-margin-padding/dist/control.js000064400000010743147177211530017473 0ustar00!function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var n={};n=React;var r=function(r){var o=r.control,i=r.customizerSetting,a=r.defaultArray,c=r.valueArray,l=r.valueUnit,s=e(n.useState((function(){return c}))),u=s[0],m=s[1],p=function(t){var e="",n="",r="";return""!==t&&(r=-1<(t=(t="string"!=typeof t?t.toString():t).trim()).indexOf("-")?"-":"",""!==(t=t.replace(r,""))?(e=t.replace(/\d+/g,""),n=r+(n=t.replace(e,"")).trim(),n=parseFloat(n)):n=r),{unit:e,number:n}},f=function(t){var e;for(var n in t)Object.hasOwnProperty.call(t,n)&&(""!==(e=t[n])&&(e=(e=p(e)).number+l),t[n]=e);return t};o.updateComponentState=function(t){m(function(t){var e;for(var n in t)Object.hasOwnProperty.call(t,n)&&(e=p(t[n]),t[n]=e.number);return t}(t))};var d=function(e,n){var r=function(e){for(var n=1;n {\n const { control, customizerSetting, defaultArray, valueArray, valueUnit } =\n props;\n\n const [inputValues, setInputValues] = useState(() => {\n return valueArray;\n });\n\n const getSingleValueAsObject = (value) => {\n let unit = \"\";\n let number = \"\";\n let negative = \"\";\n\n if (\"\" !== value) {\n value = \"string\" !== typeof value ? value.toString() : value;\n value = value.trim();\n negative = -1 < value.indexOf(\"-\") ? \"-\" : \"\";\n value = value.replace(negative, \"\");\n\n if (\"\" !== value) {\n unit = value.replace(/\\d+/g, \"\");\n number = value.replace(unit, \"\");\n number = negative + number.trim();\n number = parseFloat(number);\n } else {\n number = negative;\n }\n }\n\n return {\n unit: unit,\n number: number,\n };\n };\n\n const getValuesForInput = (values) => {\n let singleValue;\n\n for (const position in values) {\n if (Object.hasOwnProperty.call(values, position)) {\n singleValue = getSingleValueAsObject(values[position]);\n values[position] = singleValue.number;\n }\n }\n\n return values;\n };\n\n const getValuesForCustomizer = (values) => {\n let singleValue;\n\n for (const position in values) {\n if (Object.hasOwnProperty.call(values, position)) {\n singleValue = values[position];\n\n if (\"\" !== singleValue) {\n singleValue = getSingleValueAsObject(singleValue);\n singleValue = singleValue.number + valueUnit;\n }\n\n values[position] = singleValue;\n }\n }\n\n return values;\n };\n\n control.updateComponentState = (val) => {\n setInputValues(getValuesForInput(val));\n };\n\n const handleChange = (e, position) => {\n let values = { ...inputValues };\n values[position] = e.target.value;\n\n customizerSetting.set(getValuesForCustomizer(values));\n };\n\n const handleReset = (e) => {\n const values =\n \"\" !== props.default && \"undefined\" !== typeof props.default\n ? defaultArray\n : valueArray;\n\n customizerSetting.set(getValuesForCustomizer(values));\n };\n\n // Preparing for the template.\n const fieldId = `kirki-control-input-${props.type}-top`;\n const unitRef = useRef(null);\n\n const makeMapable = () => {\n const items = [];\n\n for (const position in inputValues) {\n if (Object.hasOwnProperty.call(inputValues, position)) {\n items.push({ position: position, value: inputValues[position] });\n }\n }\n\n return items;\n };\n\n return (\n
    \n {(props.label || props.description) && (\n <>\n \n\n \n \n )}\n\n \n \n \n\n
    \n
    \n
    \n {makeMapable(inputValues).map((item) => {\n const className = `kirki-control-input kirki-control-input-${item.position}`;\n const id = `kirki-control-input-${props.type}-${item.position}`;\n\n return (\n
    \n handleChange(e, item.position)}\n />\n \n
    \n );\n })}\n
    \n
    \n
    \n \n {valueUnit}\n \n
    \n
    \n
    \n );\n};\n\nexport default KirkiMarginPaddingForm;\n","import defineProperty from './_define_property';\n\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","import KirkiMarginPaddingForm from \"./KirkiMarginPaddingForm\";\r\n\r\n/**\r\n * KirkiMarginPaddingControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiMarginPaddingControl = wp.customize.Control.extend({\r\n /**\r\n * Initialize.\r\n *\r\n * @param {string} id - Control ID.\r\n * @param {object} params - Control params.\r\n */\r\n initialize: function (id, params) {\r\n const control = this;\r\n\r\n // Bind functions to this control context for passing as React props.\r\n control.setNotificationContainer =\r\n control.setNotificationContainer.bind(control);\r\n\r\n wp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n // The following should be eliminated with .\r\n function onRemoved(removedControl) {\r\n if (control === removedControl) {\r\n control.destroy();\r\n control.container.remove();\r\n wp.customize.control.unbind(\"removed\", onRemoved);\r\n }\r\n }\r\n\r\n wp.customize.control.bind(\"removed\", onRemoved);\r\n },\r\n\r\n /**\r\n * Set notification container and render.\r\n *\r\n * This is called when the React component is mounted.\r\n *\r\n * @param {Element} element - Notification container.\r\n * @returns {void}\r\n */\r\n setNotificationContainer: function setNotificationContainer(element) {\r\n const control = this;\r\n\r\n control.notifications.container = jQuery(element);\r\n control.notifications.render();\r\n },\r\n\r\n /**\r\n * Render the control into the DOM.\r\n *\r\n * This is called from the Control#embed() method in the parent class.\r\n *\r\n * @returns {void}\r\n */\r\n renderContent: function renderContent() {\r\n const control = this;\r\n\r\n ReactDOM.render(\r\n ,\r\n control.container[0]\r\n );\r\n\r\n if (false !== control.params.choices.allowCollapse) {\r\n control.container.addClass(\"allowCollapse\");\r\n }\r\n },\r\n\r\n /**\r\n * After control has been first rendered, start re-rendering when setting changes.\r\n *\r\n * React is able to be used here instead of the wp.customize.Element abstraction.\r\n *\r\n * @returns {void}\r\n */\r\n ready: function ready() {\r\n const control = this;\r\n\r\n /**\r\n * Update component value's state when customizer setting's value is changed.\r\n */\r\n control.setting.bind((val) => {\r\n control.updateComponentState(val);\r\n });\r\n },\r\n\r\n /**\r\n * This method will be overriden by the rendered component.\r\n */\r\n updateComponentState: (val) => {},\r\n\r\n /**\r\n * Handle removal/de-registration of the control.\r\n *\r\n * This is essentially the inverse of the Control#embed() method.\r\n *\r\n * @link https://core.trac.wordpress.org/ticket/31334\r\n * @returns {void}\r\n */\r\n destroy: function destroy() {\r\n const control = this;\r\n\r\n // Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n ReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n // Call destroy method in parent if it exists (as of #31334).\r\n if (wp.customize.Control.prototype.destroy) {\r\n wp.customize.Control.prototype.destroy.call(control);\r\n }\r\n },\r\n});\r\n\r\nexport default KirkiMarginPaddingControl;\r\n","import \"./control.scss\";\r\nimport KirkiMarginPaddingControl from \"./KirkiMarginPaddingControl\";\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor[\"kirki-margin\"] = KirkiMarginPaddingControl;\r\nwp.customize.controlConstructor[\"kirki-padding\"] = KirkiMarginPaddingControl;\r\n"],"names":["obj","key","value","Object","defineProperty","enumerable","configurable","writable","arr","i","Array","isArray","$6e00726c30bb8aa8$export$2e2bcd8739ae039","iter","Symbol","iterator","prototype","toString","call","from","$8664303016091545$export$2e2bcd8739ae039","TypeError","$9e1e3aff84b72d71$export$2e2bcd8739ae039","module","React","$c53a0f08a36f035b$export$2e2bcd8739ae039","props","control","customizerSetting","defaultArray","valueArray","valueUnit","useState","$d8de0eb6e0dd5f0d$export$2e2bcd8739ae039","inputValues","setInputValues","getSingleValueAsObject","unit","number","negative","trim","indexOf","replace","parseFloat","getValuesForCustomizer","values","singleValue","position","hasOwnProperty","updateComponentState","val","getValuesForInput","handleChange","e","target","arguments","length","source","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","forEach","$7dbcf7086e8d10dc$export$2e2bcd8739ae039","$d48ddae4a704ec47$export$2e2bcd8739ae039","set","fieldId","type","unitRef","useRef","createElement","className","tabIndex","label","description","Fragment","htmlFor","dangerouslySetInnerHTML","__html","ref","setNotificationContainer","onClick","default","class","items","push","makeMapable","map","item","id","onChange","wp","customize","Control","extend","initialize","params","this","bind","ReactDOM","render","removedControl","destroy","container","remove","onRemoved","element","notifications","unmountComponentAtNode","controlConstructor","KirkiMarginPaddingControl"],"version":3,"file":"control.js.map"}pro-src/packages/kirki-pro-margin-padding/dist/control.css000064400000005571147177211530017652 0ustar00.customize-control-kirki-margin .kirki-control-label,.customize-control-kirki-padding .kirki-control-label{display:block;position:relative}.customize-control-kirki-margin .customize-control-description,.customize-control-kirki-padding .customize-control-description{padding-right:30px}.customize-control-kirki-margin .kirki-control-form,.customize-control-kirki-padding .kirki-control-form{margin-bottom:12px;position:relative}.customize-control-kirki-margin .kirki-control-form:hover .kirki-control-reset,.customize-control-kirki-padding .kirki-control-form:hover .kirki-control-reset{opacity:1}.customize-control-kirki-margin .kirki-control-reset,.customize-control-kirki-padding .kirki-control-reset{align-items:center;background-color:transparent;border-radius:50%;border-width:0;bottom:50px;color:#50575e;cursor:pointer;display:flex;height:16px;justify-content:center;opacity:0;padding:0;position:absolute;right:0;transition:all .3s;width:16px;z-index:3}.customize-control-kirki-margin .kirki-control-reset:focus,.customize-control-kirki-padding .kirki-control-reset:focus{opacity:1}.customize-control-kirki-margin .kirki-control-reset:hover i,.customize-control-kirki-padding .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-margin .kirki-control-reset i,.customize-control-kirki-padding .kirki-control-reset i{font-size:12px;height:auto;transform:rotate(45deg);transition:transform .3s;width:auto}.customize-control-kirki-margin .kirki-control-cols,.customize-control-kirki-padding .kirki-control-cols{align-items:center;display:flex;justify-content:space-between}.customize-control-kirki-margin .kirki-control-left-col,.customize-control-kirki-padding .kirki-control-left-col{width:91%}.customize-control-kirki-margin .kirki-control-right-col,.customize-control-kirki-padding .kirki-control-right-col{text-align:right;width:9%}.customize-control-kirki-margin .kirki-control-fields,.customize-control-kirki-padding .kirki-control-fields{display:flex}.customize-control-kirki-margin .kirki-control-field,.customize-control-kirki-padding .kirki-control-field{padding-right:5px;width:25%}.customize-control-kirki-margin .kirki-control-input,.customize-control-kirki-padding .kirki-control-input{background-color:#f7f7f7;border-color:#bbb;border-radius:4px;font-size:12px;padding-left:3px;padding-right:3px;text-align:center;transition:box-shadow .15s;z-index:2}.customize-control-kirki-margin .kirki-control-input:focus,.customize-control-kirki-padding .kirki-control-input:focus{background-color:#fff}.customize-control-kirki-margin .kirki-control-unit,.customize-control-kirki-padding .kirki-control-unit{font-size:12px;font-weight:600;position:relative;top:-10px}.customize-control-kirki-margin .kirki-control-sublabel,.customize-control-kirki-padding .kirki-control-sublabel{display:block;font-size:11px;text-align:center;text-transform:capitalize} /*# sourceMappingURL=control.css.map */ pro-src/packages/kirki-pro-margin-padding/composer.json000064400000000374147177211530017233 0ustar00{ "require": { "php": ">=7.0" }, "autoload": { "psr-4": { "Kirki\\Pro\\Control\\": "src/Control", "Kirki\\Pro\\Field\\": "src/Field", "Kirki\\Pro\\MarginPadding\\": "src" } } }pro-src/packages/kirki-pro-margin-padding/.gitignore000064400000000063147177211530016474 0ustar00node_modules package-lock.json .parcel-cache buildspro-src/Init.php000064400000001157147177211530007561 0ustar00 .image { display: flex; flex-wrap: wrap; } label { position: relative; display: inline-block; } label .image-label { display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.7); font-weight: 700; } label .image-label .inner { width: 100%; height: 100%; text-align: center; padding: 0.5em; vertical-align: middle; } label:hover .image-label { display: block; } input { display: none; } input img { border: 1px solid transparent; } input:checked + label img { -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); border: 1px solid #3498db; } input + label .image-clickable { position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 100%; height: 100%; } } kirki-packages/control-radio/src/scss/_radio-buttonset.scss000064400000001100147177211530020126 0ustar00.customize-control-kirki-radio-buttonset { .buttonset { display: flex; flex-wrap: wrap; .switch-label { background: rgba(0,0,0,.1); border: 1px rgba(0,0,0,.1); color: #555d66; margin: 0; text-align: center; padding: 0.5em 1em; flex-grow: 1; } .switch-input { &:checked { + .switch-label { background-color: #00a0d2; color: rgba(255, 255, 255, 0.8); } } } } .screen-reader-text:focus { clip-path: inset(50%); -webkit-clip-path: inset(50%); } } kirki-packages/control-radio/src/scss/_radio.scss000064400000000346147177211530016114 0ustar00.customize-control-kirki-radio { label { display: list-item; margin-bottom: 7px; } label .option-description { display: block; color: rgba(0, 0, 0, 0.35); font-size: 0.9em; padding-left: 25px; } } kirki-packages/control-radio/src/control.js000064400000000530147177211530015020 0ustar00import "./control.scss"; wp.customize.controlConstructor['kirki-radio'] = wp.customize.kirkiDynamicControl.extend( {} ); wp.customize.controlConstructor['kirki-radio-buttonset'] = wp.customize.kirkiDynamicControl.extend( {} ); wp.customize.controlConstructor['kirki-radio-image'] = wp.customize.kirkiDynamicControl.extend( {} ); kirki-packages/control-radio/src/control.scss000064400000000130147177211530015353 0ustar00@import "./scss/radio"; @import "./scss/radio-buttonset"; @import "./scss/radio-image"; kirki-packages/control-radio/src/Field/Radio_Image.php000064400000002101147177211530016672 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-radio-image'; } return $args; } } kirki-packages/control-radio/src/Field/Radio_Buttonset.php000064400000002121147177211530017641 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-radio-buttonset'; } return $args; } } kirki-packages/control-radio/src/Field/Radio.php000064400000004162147177211530015601 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = function( $value ) { if ( ! isset( $this->args['choices'][ $value ] ) ) { return ( isset( $this->args['default'] ) ) ? $this->args['default'] : ''; } return $value; }; } } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-radio'; } return $args; } } kirki-packages/control-radio/src/Control/Radio_Image.php000064400000006243147177211530017302 0ustar00input_attrs as $attr => $value ) { if ( 'style' !== $attr ) { $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" '; continue; } $this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" '; } } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected * @since 1.0 * @return void */ protected function content_template() { ?>
    <# for ( key in data.choices ) { #> <# dataAlt = ( _.isObject( data.choices[ key ] ) && ! _.isUndefined( data.choices[ key ].alt ) ) ? data.choices[ key ].alt : '' #> checked="checked"<# } #> data-alt="{{ dataAlt }}"> <# } #>
    <# if ( data.label ) { #>{{{ data.label }}}<# } #> <# if ( data.description ) { #>{{{ data.description }}}<# } #>
    <# for ( key in data.choices ) { #> checked="checked" <# } #>> <# } #>
    {{{ data.label }}} <# if ( data.description ) { #> {{{ data.description }}} <# } #> <# _.each( data.choices, function( val, key ) { #> <# } ); #> .image {\n display: flex;\n flex-wrap: wrap;\n}\n.customize-control-kirki-radio-image label {\n position: relative;\n display: inline-block;\n}\n.customize-control-kirki-radio-image label .image-label {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.7);\n font-weight: 700;\n}\n.customize-control-kirki-radio-image label .image-label .inner {\n width: 100%;\n height: 100%;\n text-align: center;\n padding: 0.5em;\n vertical-align: middle;\n}\n.customize-control-kirki-radio-image label:hover .image-label {\n display: block;\n}\n.customize-control-kirki-radio-image input {\n display: none;\n}\n.customize-control-kirki-radio-image input img {\n border: 1px solid transparent;\n}\n.customize-control-kirki-radio-image input:checked + label img {\n -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n border: 1px solid #3498db;\n}\n.customize-control-kirki-radio-image input + label .image-clickable {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}\n/*# sourceMappingURL=control.css.map */\n",".customize-control-kirki-radio-buttonset {\n .buttonset {\n display: flex;\n flex-wrap: wrap;\n\n .switch-label {\n background: rgba(0,0,0,.1);\n border: 1px rgba(0,0,0,.1);\n color: #555d66;\n margin: 0;\n text-align: center;\n padding: 0.5em 1em;\n flex-grow: 1;\n }\n\n .switch-input {\n &:checked {\n + .switch-label {\n background-color: #00a0d2;\n color: rgba(255, 255, 255, 0.8);\n }\n }\n }\n }\n\n .screen-reader-text:focus {\n clip-path: inset(50%);\n -webkit-clip-path: inset(50%);\n }\n}\n",".customize-control-kirki-radio-image {\n > .image {\n display: flex;\n flex-wrap: wrap;\n }\n\n label {\n position: relative;\n display: inline-block;\n }\n\n label .image-label {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(255, 255, 255, 0.7);\n font-weight: 700;\n }\n\n label .image-label .inner {\n width: 100%;\n height: 100%;\n text-align: center;\n padding: 0.5em;\n vertical-align: middle;\n }\n\n label:hover .image-label {\n display: block;\n }\n\n input {\n display: none;\n }\n\n input img {\n border: 1px solid transparent;\n }\n\n input:checked + label img {\n -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n border: 1px solid #3498db;\n }\n\n input + label .image-clickable {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n }\n}\n\n"],"names":[],"version":3,"file":"control.css.map"}kirki-packages/control-radio/dist/control.js.map000064400000001302147177211530015746 0ustar00{"mappings":"AAEAA,GAAGC,UAAUC,mBAAkB,eAA4BF,GAAGC,UAAUE,oBAAoBC,OAAM,IAClGJ,GAAGC,UAAUC,mBAAkB,yBAA4BF,GAAGC,UAAUE,oBAAoBC,OAAM,IAClGJ,GAAGC,UAAUC,mBAAkB,qBAA4BF,GAAGC,UAAUE,oBAAoBC,OAAM","sources":["src/control.js"],"sourcesContent":["import \"./control.scss\";\n\nwp.customize.controlConstructor['kirki-radio'] = wp.customize.kirkiDynamicControl.extend( {} );\nwp.customize.controlConstructor['kirki-radio-buttonset'] = wp.customize.kirkiDynamicControl.extend( {} );\nwp.customize.controlConstructor['kirki-radio-image'] = wp.customize.kirkiDynamicControl.extend( {} );\n"],"names":["wp","customize","controlConstructor","kirkiDynamicControl","extend"],"version":3,"file":"control.js.map"}kirki-packages/control-radio/dist/control.css000064400000003316147177211530015355 0ustar00.customize-control-kirki-radio label{display:list-item;margin-bottom:7px}.customize-control-kirki-radio label .option-description{color:rgba(0,0,0,.35);display:block;font-size:.9em;padding-left:25px}.customize-control-kirki-radio-buttonset .buttonset{display:flex;flex-wrap:wrap}.customize-control-kirki-radio-buttonset .buttonset .switch-label{background:rgba(0,0,0,.1);border:1px rgba(0,0,0,.1);color:#555d66;flex-grow:1;margin:0;padding:.5em 1em;text-align:center}.customize-control-kirki-radio-buttonset .buttonset .switch-input:checked+.switch-label{background-color:#00a0d2;color:hsla(0,0%,100%,.8)}.customize-control-kirki-radio-buttonset .screen-reader-text:focus{clip-path:inset(50%);-webkit-clip-path:inset(50%)}.customize-control-kirki-radio-image>.image{display:flex;flex-wrap:wrap}.customize-control-kirki-radio-image label{display:inline-block;position:relative}.customize-control-kirki-radio-image label .image-label{background:hsla(0,0%,100%,.7);display:none;font-weight:700;height:100%;left:0;position:absolute;top:0;width:100%}.customize-control-kirki-radio-image label .image-label .inner{height:100%;padding:.5em;text-align:center;vertical-align:middle;width:100%}.customize-control-kirki-radio-image label:hover .image-label{display:block}.customize-control-kirki-radio-image input{display:none}.customize-control-kirki-radio-image input img{border:1px solid transparent}.customize-control-kirki-radio-image input:checked+label img{border:1px solid #3498db;-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25)}.customize-control-kirki-radio-image input+label .image-clickable{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%} /*# sourceMappingURL=control.css.map */ kirki-packages/data-option/LICENSE000064400000002060147177211530012663 0ustar00MIT License Copyright (c) 2019 Kirki Framework 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. kirki-packages/data-option/src/Option.php000064400000011332147177211530014430 0ustar00 $part ) { /** * Skip the 1st item, it's already been dealt with * when we got the value initially right before this loop. */ if ( 0 === $key ) { continue; } $part = str_replace( ']', '', $part ); /** * If the item exists in the value, then change $value to the item. * This runs recursively for all parts until we get to the end. */ if ( is_array( $value ) && isset( $value[ $part ] ) ) { $value = $value[ $part ]; continue; } /** * If we got here, the item was not found in the value. * We need to change the value accordingly depending on whether * this is the last item in the loop or not. */ $value = ( isset( $parts[ $key + 1 ] ) ) ? [] : ''; } } return $value; } /** * Allow filtering the arguments. * * @since 0.1 * @param array $args The arguments. * @param WP_Customize_Manager $customizer The customizer instance. * @return array Return the arguments. */ public function add_setting_args( $args, $customizer ) { // If this is not an option, early exit. if ( ! isset( $args['option_type'] ) || 'option' !== $args['option_type'] ) { return $args; } // Set "type" argument to option. $args['type'] = 'option'; return $this->maybe_change_settings( $args ); } /** * Allow filtering the arguments. * * @since 0.1 * @param array $args The arguments. * @param WP_Customize_Manager $customizer The customizer instance. * @return array Return the arguments. */ public function add_control_args( $args, $customizer ) { // If this is not an option, early exit. if ( ! isset( $args['option_type'] ) || 'option' !== $args['option_type'] ) { return $args; } return $this->maybe_change_settings( $args ); } /** * Change the settings argument. * * @access private * @since 1.0 * @param array $args The arguments. * @return array Returns modified array with tweaks to the [settings] argument if needed. */ private function maybe_change_settings( $args ) { // Check if we have an option-name defined. if ( isset( $args['option_name'] ) ) { if ( empty( $args['option_name'] ) ) { return $args; } if ( isset( $args['settings'] ) && $args['settings'] && false !== strpos( $args['settings'], $args['option_name'] . '[' ) ) { return $args; } if ( false === strpos( $args['settings'], '[' ) ) { // ? Bagus: in line above, it's obvious that '[' is not found in $args['settings']. But why do we explode it using '[' here? $parts = explode( '[', $args['settings'] ); $final_parts = [ $args['option_name'] ]; foreach ( $parts as $part ) { $final_parts[] = $part; } $args['settings'] = \implode( '][', $final_parts ) . ']'; $args['settings'] = str_replace( $args['option_name'] . '][', $args['option_name'] . '[', $args['settings'] ); } } return $args; } } kirki-packages/module-sections/LICENSE000064400000002060147177211530013556 0ustar00MIT License Copyright (c) 2019 Kirki Framework 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. kirki-packages/module-sections/src/styles.css000064400000002104147177211530015374 0ustar00#customize-theme-controls .control-section-kirki-expanded .accordion-section-title { display: none; } #customize-theme-controls .control-section-kirki-expanded .customize-section-back { display: none; } #customize-theme-controls .customize-pane-child.control-section-kirki-expanded { position: relative; visibility: visible; height: auto; margin-left: -100%; } #customize-theme-controls .customize-pane-child.control-section-kirki-expanded h3 .customize-action { display: none; } #customize-theme-controls .control-section-kirki-link .accordion-section-title { padding-right: 10px !important } #customize-theme-controls .control-section-kirki-link .button { margin-top: -3px; } #customize-theme-controls .customize-pane-child.current-section-parent, .in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent { transform: translateX(-100%); } .control-section-kirki-nested { margin: 0 -12px; } .control-section-kirki-outer { display: list-item !important; } kirki-packages/module-sections/src/Section_Types/Nested.php000064400000002671147177211530020073 0ustar00title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; $array['customizeAction'] = esc_html__( 'Customizing', 'kirki' ); if ( $this->panel ) { /* translators: The title. */ $array['customizeAction'] = sprintf( esc_html__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) ); } return $array; } } kirki-packages/module-sections/src/Section_Types/Expanded.php000064400000000651147177211530020375 0ustar00button_text; $json['button_url'] = $this->button_url; return $json; } /** * Outputs the Underscore.js template. * * @access public * @since 1.0.0 * @return void */ protected function render_template() { ?>
  • {{ data.title }} {{ data.button_text }}

  • '\Kirki\Section_Types\Expanded', 'kirki-nested' => '\Kirki\Section_Types\Nested', 'kirki-link' => '\Kirki\Section_Types\Link', 'kirki-outer' => '\Kirki\Section_Types\Outer', ]; /** * Constructor. * * @access public * @since 1.0.0 * @param string $id The section ID. * @param array $args The section args. */ public function __construct( $id, $args = [] ) { $this->id = $id; $this->args = $args; $this->section_types = apply_filters( 'kirki_section_types', $this->section_types ); do_action( 'kirki_section_init', $id, $args ); add_action( 'customize_register', [ $this, 'register_section_types' ] ); if ( $this->args ) { add_action( 'customize_register', [ $this, 'add_section' ] ); } add_action( 'customize_controls_enqueue_scripts', [ $this, 'enqueue_scrips' ] ); add_action( 'customize_controls_print_footer_scripts', [ $this, 'outer_sections_css' ] ); } /** * Register section types. * * @access public * @since 1.0.0 * @param object $wp_customize The customizer object. * @return void */ public function register_section_types( $wp_customize ) { foreach ( $this->section_types as $section_type ) { $wp_customize->register_section_type( $section_type ); } } /** * Add the section using the Customizer API. * * @access public * @since 1.0.0 * @param object $wp_customize The customizer object. */ public function add_section( $wp_customize ) { // Figure out the type of this section. $this->args['type'] = isset( $this->args['type'] ) ? $this->args['type'] : 'default'; if ( isset( $this->args['section'] ) && ! empty( $this->args['section'] ) ) { $this->args['type'] = 'kirki-nested'; // We need to check if the parent section is nested inside a panel. $parent_section = $wp_customize->get_section( $this->args['section'] ); if ( $parent_section && isset( $parent_section->panel ) ) { $this->args['panel'] = $parent_section->panel; } } $this->args['type'] = false === strpos( $this->args['type'], 'kirki-' ) ? 'kirki-' . $this->args['type'] : $this->args['type']; // Get the class we'll be using to create this section. $section_classname = '\WP_Customize_Section'; if ( isset( $this->section_types[ $this->args['type'] ] ) ) { $section_classname = $this->section_types[ $this->args['type'] ]; } if ( isset( $this->args['type'] ) && 'kirki-outer' === $this->args['type'] ) { $this->args['type'] = 'outer'; $section_classname = 'WP_Customize_Section'; // ? Bagus: we should be using `\` (backslash) right? Lookk at above. } // Add the section. $wp_customize->add_section( new $section_classname( $wp_customize, $this->id, apply_filters( 'kirki_section_args', $this->args, $this->id ) ) ); // Run an action after the section has been added. do_action( 'kirki_section_added', $this->id, $this->args ); } /** * Removes the section. * * @access public * @since 1.0.0 * @return void */ public function remove() { add_action( 'customize_register', [ $this, 'remove_section' ], 9999 ); } /** * Add the section using the Customizer API. * * @access public * @since 1.0.0 * @param object $wp_customize The customizer object. */ public function remove_section( $wp_customize ) { $wp_customize->remove_section( $this->id ); } /** * Enqueues any necessary scripts and styles. * * @access public * @since 1.0.0 */ public function enqueue_scrips() { wp_enqueue_style( 'kirki-sections', URL::get_from_path( __DIR__ . '/styles.css' ), [], '1.0' ); wp_enqueue_script( 'kirki-sections', URL::get_from_path( __DIR__ . '/script.js' ), [ 'jquery', 'customize-base', 'customize-controls' ], '1.0', false ); } /** * Generate CSS for the outer sections. * These are by default hidden, we need to expose them. * * @access public * @since 1.0.0 * @return void */ public function outer_sections_css() { if ( isset( $this->args['type'] ) && ( 'outer' === $this->args['type'] || 'kirki-outer' === $this->args['type'] ) ) { echo ''; } } } kirki-packages/control-date/LICENSE000064400000002060147177211530013037 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/control-date/src/control.js000064400000002070147177211530014640 0ustar00import "./control.scss"; wp.customize.controlConstructor['kirki-date'] = wp.customize.kirkiDynamicControl.extend({ handleWidth: (input) => { var styleTag = document.querySelector('#kirki-style-datepicker'); styleTag.innerHTML = '.kirki-datepicker-popup {width: ' + input.clientWidth.toString() + 'px;}'; }, initKirkiControl: function (control) { var selector; control = control || this; selector = control.selector + ' input.datepicker'; var styleTag = document.querySelector('#kirki-style-datepicker'); if (!styleTag) { styleTag = document.createElement('style'); styleTag.id = 'kirki-style-datepicker'; document.head.appendChild(styleTag); } // Init the datepicker. jQuery(selector).datepicker({ dateFormat: 'yy-mm-dd', duration: 200, beforeShow: function (input, inst) { inst.dpDiv[0].classList.add('kirki-datepicker-popup'); control.handleWidth(input); } }); // Save the changes this.container.on('change keyup paste', 'input.datepicker', function () { control.setting.set(jQuery(this).val()); }); } }); kirki-packages/control-date/src/control.scss000064400000005416147177211530015206 0ustar00$date-hover-color: #eee; $date-active-color: #2271b1; .kirki-datepicker-popup { padding-bottom: 10px; background-color: #fff; border: 1px solid #ddd; box-shadow: rgba(0, 0, 0, 0.09) 0 12px 15px 0; border-radius: 6px; z-index: 500001 !important; margin-top: 15px; overflow: hidden; max-width: 275px; .ui-datepicker-header { padding: 10px; background-color: $date-hover-color; .ui-datepicker-next, .ui-datepicker-prev { display: flex; align-items: center; justify-content: center; position: absolute; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; overflow: hidden; transition: all .2s; &:hover, &:active, &:focus { color: #fff; background-color: $date-active-color; } &:after, &:before { font-family: dashicons; } .ui-icon { display: none; } } .ui-datepicker-prev { left: 10px; &:before { content: "\f341"; } } .ui-datepicker-next { right: 10px; &:after { content: "\f345"; } } .ui-datepicker-title { display: flex; width: 100%; align-items: center; justify-content: center; height: 30px; font-size: 16px; text-align: center; } } .ui-datepicker-calendar { border-collapse: collapse; padding-bottom: 20px; width: 100%; thead { background-color: #ddd; padding-left: 5px; padding-right: 5px; th { padding-top: 5px; padding-bottom: 5px; text-align: center; font-weight: 600; font-size: 13px; } } tbody { padding: 5px; td { padding: 2px; text-align: center; } a { text-decoration: none; color: #333; } .ui-datepicker-today { .ui-state-default { background-color: $date-hover-color; } .ui-state-active { background-color: $date-active-color; &:hover, &:active, &:focus { background-color: $date-active-color; } } } .ui-state-default { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; &:hover, &:active { background-color: $date-hover-color; } &:focus { color: #fff; background-color: $date-active-color; } } .ui-state-active { background-color: $date-active-color; color: #fff; &:hover, &:active, &:focus { background-color: $date-active-color; } } } } } kirki-packages/control-date/src/Field/Date.php000064400000003601147177211530015234 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = 'sanitize_text_field'; } } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-date'; } return $args; } } kirki-packages/control-date/src/Control/Date.php000064400000004076147177211530015640 0ustar00 {\n\t\tvar styleTag = document.querySelector('#kirki-style-datepicker');\n\t\tstyleTag.innerHTML = '.kirki-datepicker-popup {width: ' + input.clientWidth.toString() + 'px;}';\n\t},\n\n\tinitKirkiControl: function (control) {\n\t\tvar selector;\n\n\t\tcontrol = control || this;\n\t\tselector = control.selector + ' input.datepicker';\n\n\t\tvar styleTag = document.querySelector('#kirki-style-datepicker');\n\n\t\tif (!styleTag) {\n\t\t\tstyleTag = document.createElement('style');\n\t\t\tstyleTag.id = 'kirki-style-datepicker';\n\t\t\tdocument.head.appendChild(styleTag);\n\t\t}\n\n\t\t// Init the datepicker.\n\t\tjQuery(selector).datepicker({\n\t\t\tdateFormat: 'yy-mm-dd',\n\t\t\tduration: 200,\n\t\t\tbeforeShow: function (input, inst) {\n\t\t\t\tinst.dpDiv[0].classList.add('kirki-datepicker-popup');\n\t\t\t\tcontrol.handleWidth(input);\n\t\t\t}\n\t\t});\n\n\t\t// Save the changes\n\t\tthis.container.on('change keyup paste', 'input.datepicker', function () {\n\t\t\tcontrol.setting.set(jQuery(this).val());\n\t\t});\n\t}\n});\n"],"names":["wp","customize","controlConstructor","kirkiDynamicControl","extend","handleWidth","input","document","querySelector","innerHTML","clientWidth","toString","initKirkiControl","control","selector","this","styleTag","createElement","id","head","appendChild","jQuery","datepicker","dateFormat","duration","beforeShow","inst","dpDiv","classList","add","container","on","setting","set","val"],"version":3,"file":"control.js.map"}kirki-packages/control-date/dist/control.css000064400000007653147177211530015204 0ustar00.kirki-datepicker-popup{background-color:#fff;border:1px solid #ddd;border-radius:6px;box-shadow:0 12px 15px 0 rgba(0,0,0,.09);margin-top:15px;max-width:275px;overflow:hidden;padding-bottom:10px;z-index:500001!important}.kirki-datepicker-popup .ui-datepicker-header{background-color:#eee;padding:10px}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev{align-items:center;border-radius:50%;cursor:pointer;display:flex;height:30px;justify-content:center;overflow:hidden;position:absolute;transition:all .2s;width:30px}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next:active,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next:focus,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next:hover,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev:active,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev:focus,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev:hover{background-color:#2271b1;color:#fff}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next:after,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next:before,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev:after,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev:before{font-family:dashicons}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next .ui-icon,.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev .ui-icon{display:none}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev{left:10px}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-prev:before{content:"\f341"}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next{right:10px}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-next:after{content:"\f345"}.kirki-datepicker-popup .ui-datepicker-header .ui-datepicker-title{align-items:center;display:flex;font-size:16px;height:30px;justify-content:center;text-align:center;width:100%}.kirki-datepicker-popup .ui-datepicker-calendar{border-collapse:collapse;padding-bottom:20px;width:100%}.kirki-datepicker-popup .ui-datepicker-calendar thead{background-color:#ddd;padding-left:5px;padding-right:5px}.kirki-datepicker-popup .ui-datepicker-calendar thead th{font-size:13px;font-weight:600;padding-bottom:5px;padding-top:5px;text-align:center}.kirki-datepicker-popup .ui-datepicker-calendar tbody{padding:5px}.kirki-datepicker-popup .ui-datepicker-calendar tbody td{padding:2px;text-align:center}.kirki-datepicker-popup .ui-datepicker-calendar tbody a{color:#333;text-decoration:none}.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-datepicker-today .ui-state-default{background-color:#eee}.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-datepicker-today .ui-state-active,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-datepicker-today .ui-state-active:active,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-datepicker-today .ui-state-active:focus,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-datepicker-today .ui-state-active:hover{background-color:#2271b1}.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-default{align-items:center;border-radius:50%;display:inline-flex;height:30px;justify-content:center;width:30px}.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-default:active,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-default:hover{background-color:#eee}.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-active,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-default:focus{background-color:#2271b1;color:#fff}.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-active:active,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-active:focus,.kirki-datepicker-popup .ui-datepicker-calendar tbody .ui-state-active:hover{background-color:#2271b1} /*# sourceMappingURL=control.css.map */ kirki-packages/control-upload/LICENSE000064400000002060147177211530013406 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/control-upload/src/Field/Upload.php000064400000007511147177211530016156 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = function( $value ) { $save_as = isset( $this->args['choices']['save_as'] ) ? $this->args['choices']['save_as'] : 'url'; return self::sanitize( $value, $save_as ); }; } } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'upload'; } return $args; } /** * Sanitizes the field value. * * @since 1.0.2 * * @param mixed $value The field value. * @param string $save_as The expected saving format. * * @return mixed */ public static function sanitize( $value, $save_as = 'url' ) { if ( 'array' === $save_as ) { if ( is_array( $value ) ) { return [ 'id' => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '', 'url' => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '', 'filename' => ( isset( $value['filename'] ) && '' !== $value['filename'] ) ? sanitize_text_field( $value['filename'] ) : '', ]; } elseif ( is_string( $value ) && ! is_numeric( $value ) ) { // Here, we assume that the value is the URL. $attachment_id = attachment_url_to_postid( $value ); return [ 'id' => $attachment_id, 'url' => $value, 'filename' => basename( get_attached_file( $attachment_id ) ), ]; } else { // Here, we assume that the value is int or numeric (the attachment ID). $value = absint( $value ); return [ 'id' => $value, 'url' => wp_get_attachment_url( $value ), 'filename' => basename( get_attached_file( $value ) ), ]; } } elseif ( 'id' === $save_as ) { if ( is_string( $value ) && ! is_numeric( $value ) ) { // Here, we assume that the value is the URL. return attachment_url_to_postid( $value ); } elseif ( is_array( $value ) && isset( $value['id'] ) ) { return absint( $value['id'] ); } // Here, we assume that the value is int or numeric (the attachment ID). return absint( $value ); } // If we're reaching this point, then we're saving the URL. if ( is_array( $value ) && isset( $value['url'] ) ) { $value = $value['url']; } elseif ( is_numeric( $value ) ) { $value = absint( $value ); $value = wp_get_attachment_url( $value ); } else { $value = esc_url_raw( $value ); } return $value; } } kirki-packages/control-upload/src/Control/Upload.php000064400000002350147177211530016547 0ustar00value(); if ( ! empty( $value ) ) { if ( is_array( $value ) && isset( $value['id'] ) ) { $attachment_id = $value['id']; } elseif ( is_numeric( $value ) ) { $attachment_id = absint( $value ); } elseif ( is_string( $value ) && ! is_numeric( $value ) ) { $attachment_id = attachment_url_to_postid( $value ); } if ( ! empty( $attachment_id ) ) { $this->json['attachment'] = wp_prepare_attachment_for_js( $attachment_id ); } } } } kirki-packages/util/LICENSE000064400000002060147177211530011421 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/util/src/MaterialColors.php000064400000012457147177211530014647 0ustar00 [ '#ffffff', '#000000', '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4', '#00bcd4', '#009688', '#4caf50', '#8bc34a', '#cddc39', '#ffeb3b', '#ffc107', '#ff9800', '#ff5722', '#795548', '#9e9e9e', '#607d8b' ], 'red' => [ '#ffebee', '#ffcdd2', '#ef9a9a', '#e57373', '#ef5350', '#f44336', '#e53935', '#d32f2f', '#c62828', '#b71c1c', '#ff8a80', '#ff5252', '#ff1744', '#d50000' ], 'pink' => [ '#fce4ec', '#f8bbd0', '#f48fb1', '#f06292', '#ec407a', '#e91e63', '#d81b60', '#c2185b', '#ad1457', '#880e4f', '#ff80ab', '#ff4081', '#f50057', '#c51162' ], 'purple' => [ '#f3e5f5', '#e1bee7', '#ce93d8', '#ba68c8', '#ab47bc', '#9c27b0', '#8e24aa', '#7b1fa2', '#6a1b9a', '#4a148c', '#ea80fc', '#e040fb', '#d500f9', '#aa00ff' ], 'deep-purple' => [ '#ede7f6', '#d1c4e9', '#b39ddb', '#9575cd', '#7e57c2', '#673ab7', '#5e35b1', '#512da8', '#4527a0', '#311b92', '#b388ff', '#7c4dff', '#651fff', '#6200ea' ], 'indigo' => [ '#e8eaf6', '#c5cae9', '#9fa8da', '#7986cb', '#5c6bc0', '#3f51b5', '#3949ab', '#303f9f', '#283593', '#1a237e', '#8c9eff', '#536dfe', '#3d5afe', '#304ffe' ], 'blue' => [ '#e3f2fd', '#bbdefb', '#90caf9', '#64b5f6', '#42a5f5', '#2196f3', '#1e88e5', '#1976d2', '#1565c0', '#0d47a1', '#82b1ff', '#448aff', '#2979ff', '#2962ff' ], 'light-blue' => [ '#e1f5fe', '#b3e5fc', '#81d4fa', '#4fc3f7', '#29b6fc', '#03a9f4', '#039be5', '#0288d1', '#0277bd', '#01579b', '#80d8ff', '#40c4ff', '#00b0ff', '#0091ea' ], 'cyan' => [ '#e0f7fa', '#b2ebf2', '#80deea', '#4dd0e1', '#26c6da', '#00bcd4', '#00acc1', '#0097a7', '#00838f', '#006064', '#84ffff', '#18ffff', '#00e5ff', '#00b8d4' ], 'teal' => [ '#e0f2f1', '#b2dfdb', '#80cbc4', '#4db6ac', '#26a69a', '#009688', '#00897b', '#00796b', '#00695c', '#004d40', '#a7ffeb', '#64ffda', '#1de9b6', '#00bfa5' ], 'green' => [ '#e8f5e9', '#c8e6c9', '#a5d6a7', '#81c784', '#66bb6a', '#4caf50', '#43a047', '#388e3c', '#2e7d32', '#1b5e20', '#b9f6ca', '#69f0ae', '#00e676', '#00c853' ], 'light-green' => [ '#f1f8e9', '#dcedc8', '#c5e1a5', '#aed581', '#9ccc65', '#8bc34a', '#7cb342', '#689f38', '#558b2f', '#33691e', '#ccff90', '#b2ff59', '#76ff03', '#64dd17' ], 'lime' => [ '#f9fbe7', '#f0f4c3', '#e6ee9c', '#dce775', '#d4e157', '#cddc39', '#c0ca33', '#a4b42b', '#9e9d24', '#827717', '#f4ff81', '#eeff41', '#c6ff00', '#aeea00' ], 'yellow' => [ '#fffde7', '#fff9c4', '#fff590', '#fff176', '#ffee58', '#ffeb3b', '#fdd835', '#fbc02d', '#f9a825', '#f57f17', '#ffff82', '#ffff00', '#ffea00', '#ffd600' ], 'amber' => [ '#fff8e1', '#ffecb3', '#ffe082', '#ffd54f', '#ffca28', '#ffc107', '#ffb300', '#ffa000', '#ff8f00', '#ff6f00', '#ffe57f', '#ffd740', '#ffc400', '#ffab00' ], 'orange' => [ '#fff3e0', '#ffe0b2', '#ffcc80', '#ffb74d', '#ffa726', '#ff9800', '#fb8c00', '#f57c00', '#ef6c00', '#e65100', '#ffd180', '#ffab40', '#ff9100', '#ff6d00' ], 'deep-orange' => [ '#fbe9a7', '#ffccbc', '#ffab91', '#ff8a65', '#ff7043', '#ff5722', '#f4511e', '#e64a19', '#d84315', '#bf360c', '#ff9e80', '#ff6e40', '#ff3d00', '#dd2600' ], 'brown' => [ '#efebe9', '#d7ccc8', '#bcaaa4', '#a1887f', '#8d6e63', '#795548', '#6d4c41', '#5d4037', '#4e342e', '#3e2723' ], 'grey' => [ '#fafafa', '#f5f5f5', '#eeeeee', '#e0e0e0', '#bdbdbd', '#9e9e9e', '#757575', '#616161', '#424242', '#212121', '#000000', '#ffffff' ], 'blue-grey' => [ '#eceff1', '#cfd8dc', '#b0bbc5', '#90a4ae', '#78909c', '#607d8b', '#546e7a', '#455a64', '#37474f', '#263238' ], ]; switch ( $context ) { case '50': case '100': case '200': case '300': case '400': case '500': case '600': case '700': case '800': case '900': case 'A100': case 'A200': case 'A400': case 'A700': $key = absint( $context ) / 100; if ( 'A100' === $context ) { $key = 10; unset( $colors['grey'] ); } elseif ( 'A200' === $context ) { $key = 11; unset( $colors['grey'] ); } elseif ( 'A400' === $context ) { $key = 12; unset( $colors['grey'] ); } elseif ( 'A700' === $context ) { $key = 13; unset( $colors['grey'] ); } unset( $colors['primary'] ); $position_colors = []; foreach ( $colors as $color_family ) { if ( isset( $color_family[ $key ] ) ) { $position_colors[] = $color_family[ $key ]; } } return $position_colors; case 'all': unset( $colors['primary'] ); $all_colors = []; foreach ( $colors as $color_family ) { foreach ( $color_family as $color ) { $all_colors[] = $color; } } return $all_colors; case 'primary': return $colors['primary']; default: if ( isset( $colors[ $context ] ) ) { return $colors[ $context ]; } return $colors['primary']; } } } kirki-packages/util/src/Helper.php000064400000024771147177211530013150 0ustar00 $value ) { // Create new key in $array, if it is empty or not an array. if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) { $array[ $key ] = []; } // Overwrite the value in the base array. if ( is_array( $value ) ) { $value = self::recurse( $array[ $key ], $value ); } $array[ $key ] = $value; } return $array; } /** * Initialize the WP_Filesystem. * * @static * @access public * @return object WP_Filesystem */ public static function init_filesystem() { $credentials = []; if ( ! defined( 'FS_METHOD' ) ) { define( 'FS_METHOD', 'direct' ); } $method = defined( 'FS_METHOD' ) ? FS_METHOD : false; if ( 'ftpext' === $method ) { // If defined, set it to that, Else, set to NULL. $credentials['hostname'] = defined( 'FTP_HOST' ) ? preg_replace( '|\w+://|', '', FTP_HOST ) : null; $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : null; $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : null; // Set FTP port. if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) { list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 ); if ( ! is_numeric( $credentials['port'] ) ) { unset( $credentials['port'] ); } } else { unset( $credentials['port'] ); } // Set connection type. if ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $method ) { $credentials['connection_type'] = 'ftps'; } elseif ( ! array_filter( $credentials ) ) { $credentials['connection_type'] = null; } else { $credentials['connection_type'] = 'ftp'; } } // The WordPress filesystem. global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' ); // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude WP_Filesystem( $credentials ); } return $wp_filesystem; } /** * Returns the attachment object. * * @static * @access public * @see https://pippinsplugins.com/retrieve-attachment-id-from-image-url/ * @param string $url URL to the image. * @return int|string Numeric ID of the attachement. */ public static function get_image_id( $url ) { global $wpdb; if ( empty( $url ) ) { return 0; } $attachment = wp_cache_get( 'kirki_image_id_' . md5( $url ), null ); if ( false === $attachment ) { $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid = %s;", $url ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery wp_cache_add( 'kirki_image_id_' . md5( $url ), $attachment, null ); } if ( ! empty( $attachment ) ) { return $attachment[0]; } return 0; } /** * Returns an array of the attachment's properties. * * @param string $url URL to the image. * @return array */ public static function get_image_from_url( $url ) { $image_id = self::get_image_id( $url ); $image = wp_get_attachment_image_src( $image_id, 'full' ); return [ 'url' => $image[0], 'width' => $image[1], 'height' => $image[2], 'thumbnail' => $image[3], ]; } /** * Get an array of posts. * * @static * @access public * @param array $args Define arguments for the get_posts function. * @return array */ public static function get_posts( $args ) { if ( is_string( $args ) ) { $args = add_query_arg( [ 'suppress_filters' => false, ] ); } elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) { $args['suppress_filters'] = false; } // Get the posts. // TODO: WordPress.VIP.RestrictedFunctions.get_posts_get_posts. $posts = get_posts( $args ); // Properly format the array. $items = []; foreach ( $posts as $post ) { $items[ $post->ID ] = $post->post_title; } wp_reset_postdata(); return $items; } /** * Get an array of publicly-querable taxonomies. * * @static * @access public * @return array */ public static function get_taxonomies() { $items = []; // Get the taxonomies. $taxonomies = get_taxonomies( [ 'public' => true, ] ); // Build the array. foreach ( $taxonomies as $taxonomy ) { $id = $taxonomy; $taxonomy = get_taxonomy( $taxonomy ); $items[ $id ] = $taxonomy->labels->name; } return $items; } /** * Get an array of publicly-querable post-types. * * @static * @access public * @return array */ public static function get_post_types() { $items = []; // Get the post types. $post_types = get_post_types( [ 'public' => true, ], 'objects' ); // Build the array. foreach ( $post_types as $post_type ) { $items[ $post_type->name ] = $post_type->labels->name; } return $items; } /** * Get an array of terms from a taxonomy. * * @static * @access public * @param string|array $taxonomies See https://developer.wordpress.org/reference/functions/get_terms/ for details. * @return array */ public static function get_terms( $taxonomies ) { $items = []; // Get the post types. $terms = get_terms( $taxonomies ); // Build the array. foreach ( $terms as $term ) { $items[ $term->term_id ] = $term->name; } return $items; } /** * Returns an array of navigation menus. * * @access public * @param string $value_field The value to be stored in options. Accepted values: id|slug. * @return array */ public static function get_nav_menus( $value_field = 'id' ) { $choices = []; $nav_menus = wp_get_nav_menus(); foreach ( $nav_menus as $term ) { $choices[ 'slug' === $value_field ? $term->slug : $term->term_id ] = $term->name; } return $choices; } /** * Gets an array of material-design colors. * * @static * @access public * @param string $context Allows us to get subsets of the palette. * @return array */ public static function get_material_design_colors( $context = 'primary' ) { return \Kirki\Util\MaterialColors::get_colors( $context ); } /** * Get an array of all available dashicons. * * @static * @access public * @return array */ public static function get_dashicons() { if ( class_exists( '\Kirki\Util\Dashicons' ) ) { return \Kirki\Util\Dashicons::get_icons(); } return []; } /** * Compares the 2 values given the condition * * @param mixed $value1 The 1st value in the comparison. * @param mixed $value2 The 2nd value in the comparison. * @param string $operator The operator we'll use for the comparison. * @return boolean whether The comparison has succeded (true) or failed (false). */ public static function compare_values( $value1, $value2, $operator ) { if ( '===' === $operator ) { return $value1 === $value2; } if ( '!==' === $operator ) { return $value1 !== $value2; } if ( ( '!=' === $operator || 'not equal' === $operator ) ) { return $value1 != $value2; // phpcs:ignore WordPress.PHP.StrictComparisons } if ( ( '>=' === $operator || 'greater or equal' === $operator || 'equal or greater' === $operator ) ) { return $value2 >= $value1; } if ( ( '<=' === $operator || 'smaller or equal' === $operator || 'equal or smaller' === $operator ) ) { return $value2 <= $value1; } if ( ( '>' === $operator || 'greater' === $operator ) ) { return $value2 > $value1; } if ( ( '<' === $operator || 'smaller' === $operator ) ) { return $value2 < $value1; } if ( 'contains' === $operator || 'in' === $operator ) { if ( is_array( $value1 ) && is_array( $value2 ) ) { foreach ( $value2 as $val ) { if ( in_array( $val, $value1 ) ) { // phpcs:ignore WordPress.PHP.StrictInArray return true; } } return false; } if ( is_array( $value1 ) && ! is_array( $value2 ) ) { return in_array( $value2, $value1 ); // phpcs:ignore WordPress.PHP.StrictInArray } if ( is_array( $value2 ) && ! is_array( $value1 ) ) { return in_array( $value1, $value2 ); // phpcs:ignore WordPress.PHP.StrictInArray } return ( false !== strrpos( $value1, $value2 ) || false !== strpos( $value2, $value1 ) ); } if ( 'does not contain' === $operator || 'not in' === $operator ) { return ! self::compare_values( $value1, $value2, $operator ); } return $value1 == $value2; // phpcs:ignore WordPress.PHP.StrictComparisons } /** * Prepare PHP array to be used as JS object. * * @see See https://developer.wordpress.org/reference/classes/wp_scripts/localize/ * * @param array $values The data which can be either a single or multi-dimensional array. * @return array */ public static function prepare_php_array_for_js( $values ) { foreach ( $values as $key => $value ) { if ( ! is_scalar( $value ) ) { continue; } $values[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); } return $values; } } kirki-packages/util/src/Util.php000064400000013735147177211530012644 0ustar00 $args ) { if ( ! $is_plugin && isset( $args['Name'] ) && ( 'Kirki' === $args['Name'] || 'Kirki Toolkit' === $args['Name'] ) ) { $is_plugin = true; $_plugin = $plugin; } } // No need to proceed any further if Kirki wasn't found in the list of plugins. if ( ! $is_plugin ) { return false; } // Make sure the is_plugins_loaded function is loaded. include_once ABSPATH . 'wp-admin/includes/plugin.php'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude // Extra logic in case the plugin is installed but not activated. if ( $_plugin && is_plugin_inactive( $_plugin ) ) { return false; } return $is_plugin; } /** * Add fields with variables to self::$variables_fields. * * @access public * @since 4.0 * @param array $args The field args. * @param Object $object The field object. * @return void */ public function field_init_variables( $args, $object ) { if ( isset( $args['variables'] ) ) { self::$variables_fields[] = $args; } } /** * Build the variables. * * @static * @access public * @since 3.0.9 * @return array Formatted as array( 'variable-name' => value ). */ public static function get_variables() { $variables = []; $fields = self::$variables_fields; /** * Compatibility with Kirki v3.x API. * If the Kirki class exists, check for fields inside it * and add them to our fields array. */ if ( class_exists( '\Kirki\Compatibility\Kirki' ) ) { $fields = array_merge( \Kirki\Compatibility\Kirki::$fields, $fields ); } // Loop through all fields. foreach ( $fields as $field ) { // Skip if this field doesn't have variables. if ( ! isset( $field['variables'] ) || ! $field['variables'] || empty( $field['variables'] ) ) { continue; } $option_type = ( isset( $field['option_type'] ) ) ? $field['option_type'] : 'theme_mod'; $default = ( isset( $field['default'] ) ) ? $field['default'] : ''; $value = apply_filters( 'kirki_get_value', get_theme_mod( $field['settings'], $default ), $field['settings'], $default, $option_type ); // Loop through the array of variables. foreach ( $field['variables'] as $field_variable ) { // Is the variable ['name'] defined? If yes, then we can proceed. if ( isset( $field_variable['name'] ) ) { // Do we have a callback function defined? If not then set $variable_callback to false. $variable_callback = ( isset( $field_variable['callback'] ) && is_callable( $field_variable['callback'] ) ) ? $field_variable['callback'] : false; /** * If we have a variable_callback defined then get the value of the option * and run it through the callback function. * If no callback is defined (false) then just get the value. */ $variables[ $field_variable['name'] ] = $value; if ( $variable_callback ) { $variables[ $field_variable['name'] ] = call_user_func( $field_variable['callback'], $value ); } } } } // Pass the variables through a filter ('kirki_variable') and return the array of variables. return apply_filters( 'kirki_variable', $variables ); } /** * HTTP Request injection. * * @access public * @since 3.0.0 * @param array $request The request params. * @param string $url The request URL. * @return array */ public function http_request( $request = [], $url = '' ) { // Early exit if installed as a plugin or not a request to wordpress.org, // or finally if we don't have everything we need. if ( self::is_plugin() || false === strpos( $url, 'wordpress.org' ) || ( ! isset( $request['body'] ) || ! isset( $request['body']['plugins'] ) || ! isset( $request['body']['translations'] ) || ! isset( $request['body']['locale'] ) || ! isset( $request['body']['all'] ) ) ) { return $request; } $plugins = json_decode( $request['body']['plugins'], true ); if ( ! isset( $plugins['plugins'] ) ) { return $request; } $exists = false; foreach ( $plugins['plugins'] as $plugin ) { if ( isset( $plugin['Name'] ) && 'Kirki Toolkit' === $plugin['Name'] ) { $exists = true; } } // Inject data. if ( ! $exists && defined( 'KIRKI_PLUGIN_FILE' ) ) { $plugins['plugins']['kirki/kirki.php'] = get_plugin_data( KIRKI_PLUGIN_FILE ); } $request['body']['plugins'] = wp_json_encode( $plugins ); return $request; } /** * Returns the $wp_version. * * @static * @access public * @since 3.0.12 * @param string $context Use 'minor' or 'major'. * @return int|string Returns integer when getting the 'major' version. * Returns string when getting the 'minor' version. */ public static function get_wp_version( $context = 'minor' ) { global $wp_version; // We only need the major version. if ( 'major' === $context ) { $version_parts = explode( '.', $wp_version ); return $version_parts[0]; } return $wp_version; } } kirki-packages/util/src/Setting/User_Meta.php000064400000004272147177211530015224 0ustar00id_data['base']; // Get all user-meta. // We'll use this to check if the value is set or not, // in order to figure out if we need to return the default value. $user_meta = get_user_meta( get_current_user_id() ); // Get the single meta. $single_meta = get_user_meta( get_current_user_id(), $id_base, true ); if ( isset( $user_meta[ $id_base ] ) ) { return $single_meta; } return $default; } /** * Set the root value for a setting, especially for multidimensional ones. * * @access protected * @since 3.0.0 * @param mixed $value Value to set as root of multidimensional setting. * @return bool Whether the multidimensional root was updated successfully. */ protected function set_root_value( $value ) { $id_base = $this->id_data['base']; // First delete the current user-meta. // We're doing this to avoid duplicate entries. delete_user_meta( get_current_user_id(), $id_base ); // Update the user-meta. return update_user_meta( get_current_user_id(), $id_base, $value ); } /** * Save the value of the setting, using the related API. * * @access protected * @since 3.0.0 * @param mixed $value The value to update. * @return bool The result of saving the value. */ protected function update( $value ) { return $this->set_root_value( $value ); } /** * Fetch the value of the setting. * * @access protected * @since 3.0.0 * @return mixed The value. */ public function value() { return $this->get_root_value( $this->default ); } } kirki-packages/util/src/Setting/Site_Option.php000064400000003160147177211530015567 0ustar00id_data['base'], $default ); } /** * Set the root value for a setting, especially for multidimensional ones. * * @access protected * @since 3.0.0 * @param mixed $value Value to set as root of multidimensional setting. * @return bool Whether the multidimensional root was updated successfully. */ protected function set_root_value( $value ) { return update_site_option( $this->id_data['base'], $value ); } /** * Save the value of the setting, using the related API. * * @access protected * @since 3.0.0 * @param mixed $value The value to update. * @return bool The result of saving the value. */ protected function update( $value ) { return $this->set_root_value( $value ); } /** * Fetch the value of the setting. * * @access protected * @since 3.0.0 * @return mixed The value. */ public function value() { return $this->get_root_value( $this->default ); } } kirki-packages/l10n/LICENSE000064400000002060147177211530011216 0ustar00MIT License Copyright (c) 2019 Kirki Framework 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. kirki-packages/l10n/src/L10n.php000064400000007506147177211530012235 0ustar00textdomain = $textdomain; $this->languages_path = $languages_path; // This will only work if we're inside a plugin. add_action( 'plugins_loaded', [ $this, 'load_textdomain' ] ); // If we got this far, then Kirki is embedded in a plugin. // We want the theme's textdomain to handle translations. add_filter( 'override_load_textdomain', [ $this, 'override_load_textdomain' ], 5, 3 ); } /** * Load the plugin textdomain * * @access public * @since 1.0 */ public function load_textdomain() { if ( null !== $this->get_path() ) { load_textdomain( $this->textdomain, $this->get_path() ); } load_plugin_textdomain( $this->textdomain, false, $this->languages_path ); } /** * Gets the path to a translation file. * * @access protected * @since 1.0 * @return string Absolute path to the translation file. */ protected function get_path() { $path_found = false; $found_path = null; foreach ( $this->get_paths() as $path ) { if ( $path_found ) { continue; } $path = wp_normalize_path( $path ); if ( file_exists( $path ) ) { $path_found = true; $found_path = $path; } } return $found_path; } /** * Returns an array of paths where translation files may be located. * * @access protected * @since 1.0 * @return array */ protected function get_paths() { return [ WP_LANG_DIR . '/' . $this->textdomain . '-' . get_locale() . '.mo', trailingslashit( $this->languages_path ) . $this->textdomain . '-' . get_locale() . '.mo', ]; } /** * Allows overriding the textdomain from a theme. * * @access public * @since 1.0 * @param bool $override Whether to override the .mo file loading. Default false. * @param string $domain Text domain. Unique identifier for retrieving translated strings. * @param string $mofile Path to the MO file. * @return bool */ public function override_load_textdomain( $override, $domain, $mofile ) { global $l10n; if ( isset( $l10n[ $this->get_theme_textdomain() ] ) ) { $l10n[ $this->textdomain ] = $l10n[ $this->get_theme_textdomain() ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride } // Check if the domain is the one we have defined. if ( $this->textdomain === $domain ) { return true; } return $override; } /** * Get the theme's textdomain. * * @access private * @since 1.0 * @return string */ private function get_theme_textdomain() { if ( '' === $this->theme_textdomain ) { // Get the textdomain. $theme = wp_get_theme(); $this->theme_textdomain = $theme->get( 'TextDomain' ); // If no texdomain was found, use the template folder name. if ( ! $this->theme_textdomain ) { $this->theme_textdomain = get_template(); } } return $this->theme_textdomain; } } kirki-packages/control-slider/src/KirkiSliderControl.js000064400000006152147177211530017307 0ustar00import KirkiSliderForm from './KirkiSliderForm'; /** * KirkiSliderControl. * * Global objects brought: * - wp * - jQuery * - React * - ReactDOM * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiSliderControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with . function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind('removed', onRemoved); } } wp.customize.control.bind('removed', onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; ReactDOM.render( , control.container[0] ); if (false !== control.params.choices.allowCollapse) { control.container.addClass('allowCollapse'); } }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component value's state when customizer setting's value is changed. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, /** * This method will be overriden by the rendered component. */ updateComponentState: (val) => { }, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } } }); export default KirkiSliderControl; kirki-packages/control-slider/src/control.js000064400000000302147177211530015201 0ustar00import "./control.scss"; import KirkiSliderControl from './KirkiSliderControl'; // Register control type with Customizer. wp.customize.controlConstructor['kirki-slider'] = KirkiSliderControl; kirki-packages/control-slider/src/control.scss000064400000006150147177211530015547 0ustar00// Range slider control. .customize-control-kirki-slider { .kirki-control-label { position: relative; display: block; } .customize-control-description { padding-right: 30px; } .kirki-control-form { position: relative; margin-bottom: 12px; &:hover { .kirki-control-reset { opacity: 1; } } } .kirki-control-reset { display: flex; align-items: center; justify-content: center; right: 0; bottom: 22px; position: absolute; padding: 0; width: 16px; height: 16px; color: #50575e; background-color: transparent; border-radius: 50%; border-width: 0; opacity: 0; cursor: pointer; transition: all 0.3s; z-index: 3; // a11y: support tab focus. &:focus { opacity: 1; } } .kirki-control-reset:hover i { color: #f00; transform: rotate(-45deg); } .kirki-control-reset i { font-size: 12px; width: auto; height: auto; transform: rotate(45deg); transition: transform 0.3s; } .kirki-control-cols { display: flex; align-items: center; justify-content: space-between; } .kirki-control-left-col { width: 90%; padding-right: 13px; } .kirki-control-right-col { width: 10%; text-align: right; } .kirki-control-input { font-size: 12px; text-align: center; background-color: #f7f7f7; border-color: #bbb; border-radius: 4px; z-index: 2; } .kirki-control-slider { position: relative; top: -1px; padding: 0; margin: 0; width: 100%; height: 5px; border-radius: 2.5px; background-color: #bdc3c7; outline: none; -webkit-appearance: none; } .kirki-control-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background-color: #f0f0f0; cursor: pointer; border: 1px solid #999; box-shadow: none; -webkit-transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; } .kirki-control-slider::-webkit-slider-thumb:hover, .kirki-control-slider::-webkit-slider-thumb:focus { background-color: #e7e7e7; } .kirki-control-slider:active::-webkit-slider-thumb { background-color: #e7e7e7; } .kirki-control-slider::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background-color: #f0f0f0; cursor: pointer; border: 1px solid #999; box-shadow: none; -moz-transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; transition: background-color 0.15s ease-in-out, box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms; } .kirki-control-slider::-moz-range-thumb:hover, .kirki-control-slider::-moz-range-thumb:focus { background-color: #e7e7e7; } ::-moz-range-track { background-color: #bdc3c7; border: 0; } input::-moz-focus-inner, input::-moz-focus-outer { border: 0; } } kirki-packages/control-slider/src/Field/Slider.php000064400000003734147177211530016155 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize_callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = function ( $value ) { return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); }; } } return $args; } /** * Filter arguments before creating the control. * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-slider'; } return $args; } } kirki-packages/control-slider/src/Control/Slider.php000064400000005153147177211530016547 0ustar00json['choices'] = wp_parse_args( $this->json['choices'], [ 'min' => 0, 'max' => 100, 'step' => 1, ] ); if ( isset( $this->json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->json['choices']['min'] = (float) $this->json['choices']['min']; $this->json['choices']['max'] = (float) $this->json['choices']['max']; $this->json['choices']['step'] = (float) $this->json['choices']['step']; $this->json['value'] = $this->json['value'] < $this->json['choices']['min'] ? $this->json['choices']['min'] : $this->json['value']; $this->json['value'] = $this->json['value'] > $this->json['choices']['max'] ? $this->json['choices']['max'] : $this->json['value']; $this->json['value'] = (float) $this->json['value']; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} } kirki-packages/control-slider/src/KirkiSliderForm.js000064400000005535147177211530016576 0ustar00import { useRef } from "react"; const KirkiSliderForm = (props) => { const { control, customizerSetting, choices } = props; let trigger = ""; control.updateComponentState = (val) => { if ("slider" === trigger) { valueRef.current.textContent = val; } else if ("input" === trigger) { sliderRef.current.value = val; } else if ("reset" === trigger) { valueRef.current.textContent = val; sliderRef.current.value = val; } }; const handleChange = (e) => { trigger = "range" === e.target.type ? "slider" : "input"; let value = e.target.value; if (value < choices.min) value = choices.min; if (value > choices.max) value = choices.max; if ("input" === trigger) e.target.value = value; customizerSetting.set(value); }; const handleReset = (e) => { if ("" !== props.default && "undefined" !== typeof props.default) { sliderRef.current.value = props.default; valueRef.current.textContent = props.default; } else { if ("" !== props.value) { sliderRef.current.value = props.value; valueRef.current.textContent = props.value; } else { sliderRef.current.value = choices.min; valueRef.current.textContent = ""; } } trigger = "reset"; customizerSetting.set(sliderRef.current.value); }; // Preparing for the template. const fieldId = `kirki-control-input-${customizerSetting.id}`; const value = "" !== props.value ? props.value : 0; const sliderRef = useRef(null); const valueRef = useRef(null); return (
    {value}
    ); }; export default KirkiSliderForm; kirki-packages/control-slider/dist/control.js000064400000006067147177211530015373 0ustar00(()=>{"use strict";const t=React,e=function(e){var n=e.control,o=e.customizerSetting,a=e.choices,i="";n.updateComponentState=function(t){"slider"===i?s.current.textContent=t:"input"===i?l.current.value=t:"reset"===i&&(s.current.textContent=t,l.current.value=t)};var r="kirki-control-input-".concat(o.id),c=""!==e.value?e.value:0,l=(0,t.useRef)(null),s=(0,t.useRef)(null);return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},React.createElement("label",{className:"kirki-control-label",htmlFor:r},React.createElement("span",{className:"customize-control-title"},e.label),React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:e.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:function(t){""!==e.default&&void 0!==e.default?(l.current.value=e.default,s.current.textContent=e.default):""!==e.value?(l.current.value=e.value,s.current.textContent=e.value):(l.current.value=a.min,s.current.textContent=""),i="reset",o.set(l.current.value)}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},React.createElement("input",{ref:l,type:"range",id:r,defaultValue:c,min:a.min,max:a.max,step:a.step,className:"kirki-control-slider",onChange:function(t){i="range"===t.target.type?"slider":"input";var e=t.target.value;ea.max&&(e=a.max),"input"===i&&(t.target.value=e),o.set(e)}})),React.createElement("div",{className:"kirki-control-right-col"},React.createElement("div",{className:"kirki-control-value",ref:s},c))))};function n(){return n=Object.assign||function(t){for(var e=1;e {\n const { control, customizerSetting, choices } = props;\n\n let trigger = \"\";\n\n control.updateComponentState = (val) => {\n if (\"slider\" === trigger) {\n valueRef.current.textContent = val;\n } else if (\"input\" === trigger) {\n sliderRef.current.value = val;\n } else if (\"reset\" === trigger) {\n valueRef.current.textContent = val;\n sliderRef.current.value = val;\n }\n };\n\n const handleChange = (e) => {\n trigger = \"range\" === e.target.type ? \"slider\" : \"input\";\n\n let value = e.target.value;\n\n if (value < choices.min) value = choices.min;\n\n if (value > choices.max) value = choices.max;\n\n if (\"input\" === trigger) e.target.value = value;\n customizerSetting.set(value);\n };\n\n const handleReset = (e) => {\n if (\"\" !== props.default && \"undefined\" !== typeof props.default) {\n sliderRef.current.value = props.default;\n valueRef.current.textContent = props.default;\n } else {\n if (\"\" !== props.value) {\n sliderRef.current.value = props.value;\n valueRef.current.textContent = props.value;\n } else {\n sliderRef.current.value = choices.min;\n valueRef.current.textContent = \"\";\n }\n }\n\n trigger = \"reset\";\n customizerSetting.set(sliderRef.current.value);\n };\n\n // Preparing for the template.\n const fieldId = `kirki-control-input-${customizerSetting.id}`;\n const value = \"\" !== props.value ? props.value : 0;\n\n const sliderRef = useRef(null);\n const valueRef = useRef(null);\n\n return (\n
    \n \n\n
    \n\n \n \n \n\n
    \n
    \n \n
    \n
    \n
    \n {value}\n
    \n
    \n
    \n
    \n );\n};\n\nexport default KirkiSliderForm;\n","import KirkiSliderForm from './KirkiSliderForm';\r\n\r\n/**\r\n * KirkiSliderControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiSliderControl = wp.customize.Control.extend({\r\n\r\n\t/**\r\n\t * Initialize.\r\n\t *\r\n\t * @param {string} id - Control ID.\r\n\t * @param {object} params - Control params.\r\n\t */\r\n\tinitialize: function (id, params) {\r\n\t\tconst control = this;\r\n\r\n\t\t// Bind functions to this control context for passing as React props.\r\n\t\tcontrol.setNotificationContainer = control.setNotificationContainer.bind(control);\r\n\r\n\t\twp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n\t\t// The following should be eliminated with .\r\n\t\tfunction onRemoved(removedControl) {\r\n\t\t\tif (control === removedControl) {\r\n\t\t\t\tcontrol.destroy();\r\n\t\t\t\tcontrol.container.remove();\r\n\t\t\t\twp.customize.control.unbind('removed', onRemoved);\r\n\t\t\t}\r\n\t\t}\r\n\t\twp.customize.control.bind('removed', onRemoved);\r\n\t},\r\n\r\n\t/**\r\n\t * Set notification container and render.\r\n\t *\r\n\t * This is called when the React component is mounted.\r\n\t *\r\n\t * @param {Element} element - Notification container.\r\n\t * @returns {void}\r\n\t */\r\n\tsetNotificationContainer: function setNotificationContainer(element) {\r\n\t\tconst control = this;\r\n\r\n\t\tcontrol.notifications.container = jQuery(element);\r\n\t\tcontrol.notifications.render();\r\n\t},\r\n\r\n\t/**\r\n\t * Render the control into the DOM.\r\n\t *\r\n\t * This is called from the Control#embed() method in the parent class.\r\n\t *\r\n\t * @returns {void}\r\n\t */\r\n\trenderContent: function renderContent() {\r\n\t\tconst control = this;\r\n\r\n\t\tReactDOM.render(\r\n\t\t\t,\r\n\t\t\tcontrol.container[0]\r\n\t\t);\r\n\r\n\t\tif (false !== control.params.choices.allowCollapse) {\r\n\t\t\tcontrol.container.addClass('allowCollapse');\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * After control has been first rendered, start re-rendering when setting changes.\r\n\t *\r\n\t * React is able to be used here instead of the wp.customize.Element abstraction.\r\n\t *\r\n\t * @returns {void}\r\n\t */\r\n\tready: function ready() {\r\n\t\tconst control = this;\r\n\r\n\t\t/**\r\n\t\t * Update component value's state when customizer setting's value is changed.\r\n\t\t */\r\n\t\tcontrol.setting.bind((val) => {\r\n\t\t\tcontrol.updateComponentState(val);\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * This method will be overriden by the rendered component.\r\n\t */\r\n\tupdateComponentState: (val) => { },\r\n\r\n\t/**\r\n\t * Handle removal/de-registration of the control.\r\n\t *\r\n\t * This is essentially the inverse of the Control#embed() method.\r\n\t *\r\n\t * @link https://core.trac.wordpress.org/ticket/31334\r\n\t * @returns {void}\r\n\t */\r\n\tdestroy: function destroy() {\r\n\t\tconst control = this;\r\n\r\n\t\t// Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n\t\tReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n\t\t// Call destroy method in parent if it exists (as of #31334).\r\n\t\tif (wp.customize.Control.prototype.destroy) {\r\n\t\t\twp.customize.Control.prototype.destroy.call(control);\r\n\t\t}\r\n\t}\r\n});\r\n\r\nexport default KirkiSliderControl;\r\n","import \"./control.scss\";\r\nimport KirkiSliderControl from './KirkiSliderControl';\r\n\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor['kirki-slider'] = KirkiSliderControl;\r\n"],"names":["React","props","control","customizerSetting","choices","trigger","updateComponentState","val","valueRef","current","textContent","sliderRef","value","fieldId","id","useRef","className","tabIndex","htmlFor","label","dangerouslySetInnerHTML","__html","description","ref","setNotificationContainer","type","onClick","e","min","set","defaultValue","max","step","onChange","target","wp","customize","Control","extend","initialize","params","this","bind","prototype","call","onRemoved","removedControl","destroy","container","remove","unbind","element","notifications","jQuery","render","renderContent","ReactDOM","setting","setNotificationCotainer","allowCollapse","addClass","ready","unmountComponentAtNode","controlConstructor","KirkiSliderControl"],"sourceRoot":""}kirki-packages/control-slider/dist/control.css000064400000006125147177211530015542 0ustar00.customize-control-kirki-slider .kirki-control-label{position:relative;display:block}.customize-control-kirki-slider .customize-control-description{padding-right:30px}.customize-control-kirki-slider .kirki-control-form{position:relative;margin-bottom:12px}.customize-control-kirki-slider .kirki-control-form:hover .kirki-control-reset{opacity:1}.customize-control-kirki-slider .kirki-control-reset{display:flex;align-items:center;justify-content:center;right:0;bottom:22px;position:absolute;padding:0;width:16px;height:16px;color:#50575e;background-color:transparent;border-radius:50%;border-width:0;opacity:0;cursor:pointer;transition:all .3s;z-index:3}.customize-control-kirki-slider .kirki-control-reset:focus{opacity:1}.customize-control-kirki-slider .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-slider .kirki-control-reset i{font-size:12px;width:auto;height:auto;transform:rotate(45deg);transition:transform .3s}.customize-control-kirki-slider .kirki-control-cols{display:flex;align-items:center;justify-content:space-between}.customize-control-kirki-slider .kirki-control-left-col{width:90%;padding-right:13px}.customize-control-kirki-slider .kirki-control-right-col{width:10%;text-align:right}.customize-control-kirki-slider .kirki-control-input{font-size:12px;text-align:center;background-color:#f7f7f7;border-color:#bbb;border-radius:4px;z-index:2}.customize-control-kirki-slider .kirki-control-slider{position:relative;top:-1px;padding:0;margin:0;width:100%;height:5px;border-radius:2.5px;background-color:#bdc3c7;outline:none;-webkit-appearance:none}.customize-control-kirki-slider .kirki-control-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background-color:#f0f0f0;cursor:pointer;border:1px solid #999;box-shadow:none;-webkit-transition:background-color .15s ease-in-out,box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color .15s ease-in-out,box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.customize-control-kirki-slider .kirki-control-slider::-webkit-slider-thumb:hover,.customize-control-kirki-slider .kirki-control-slider::-webkit-slider-thumb:focus{background-color:#e7e7e7}.customize-control-kirki-slider .kirki-control-slider:active::-webkit-slider-thumb{background-color:#e7e7e7}.customize-control-kirki-slider .kirki-control-slider::-moz-range-thumb{width:16px;height:16px;border:0;border-radius:50%;background-color:#f0f0f0;cursor:pointer;border:1px solid #999;box-shadow:none;-moz-transition:background-color .15s ease-in-out,box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;transition:background-color .15s ease-in-out,box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.customize-control-kirki-slider .kirki-control-slider::-moz-range-thumb:hover,.customize-control-kirki-slider .kirki-control-slider::-moz-range-thumb:focus{background-color:#e7e7e7}.customize-control-kirki-slider ::-moz-range-track{background-color:#bdc3c7;border:0}.customize-control-kirki-slider input::-moz-focus-inner,.customize-control-kirki-slider input::-moz-focus-outer{border:0} /*# sourceMappingURL=control.css.map*/kirki-packages/module-field-dependencies/LICENSE000064400000002060147177211530015436 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/module-field-dependencies/src/Field_Dependencies.php000064400000005337147177211530021434 0ustar00 $val ) { if ( is_callable( $val ) ) { unset( $args['active_callback'][ $key ] ); } } if ( isset( $args['active_callback'][0] ) ) { $args['required'] = $args['active_callback']; } } } if ( ! empty( $args['required'] ) ) { $this->dependencies[ $args['settings'] ] = $args['required']; $args['active_callback'] = '__return_true'; return $args; } // No need to proceed any further if we're using the default value. if ( '__return_true' === $args['active_callback'] ) { return $args; } // Make sure the function is callable, otherwise fallback to __return_true. if ( ! is_callable( $args['active_callback'] ) ) { $args['active_callback'] = '__return_true'; } } else { // The ReactSelect field triggered from Background field doesn't have $args['active_callback'] argument. if ( ! empty( $args['required'] ) ) { $this->dependencies[ $args['settings'] ] = $args['required']; } } return $args; } /** * Enqueues the field-dependencies script * and adds variables to it using the wp_localize_script function. * The rest is handled via JS. * * @access public * @return void */ public function field_dependencies() { wp_enqueue_script( 'kirki_field_dependencies', URL::get_from_path( dirname( __DIR__ ) . '/dist/control.js' ), [ 'jquery', 'customize-base', 'customize-controls' ], '4.0', true ); wp_localize_script( 'kirki_field_dependencies', 'kirkiControlDependencies', $this->dependencies ); } } kirki-packages/module-field-dependencies/src/control.js000064400000020216147177211530017241 0ustar00var kirkiDependencies = { dependencyControls: {}, init: function () { var self = this; _.each( window.kirkiControlDependencies, function (requirements, dependantID) { var control = wp.customize.control(dependantID); if (control) { requirements = self.addSettingLink(requirements); wp.customize.control(dependantID).params.required = requirements; self.showKirkiControl(control); } } ); _.each(self.dependencyControls, function (dependency, dependencySetting) { _.each(dependency.childrens, function (childrenSetting) { wp.customize(dependency.settingLink, function (setting) { var setupControl = function (control) { var setActiveState; var isDisplayed; isDisplayed = function () { return self.showKirkiControl( wp.customize.control(childrenSetting) ); }; setActiveState = function () { control.active.set(isDisplayed()); }; setActiveState(); setting.bind(setActiveState); control.active.validate = isDisplayed; }; wp.customize.control(childrenSetting, setupControl); }); }); }); }, /** * Get the actual customize setting link of a control. * * @since 1.0.3 * @param {string} controlID The ID of the control. * @return {string} The setting link. */ getSettingLink: function (controlID) { var control = document.querySelector( '[data-kirki-setting="' + controlID + '"]' ); var setting = controlID; if (control) { if (controlID !== control.dataset.kirkiSettingLink) { setting = control.dataset.kirkiSettingLink; } } return setting; }, addSettingLink: function (requirements) { const self = this; requirements.forEach(function (requirement, requirementIndex) { if (requirement.setting) { requirements[requirementIndex].settingLink = self.getSettingLink( requirement.setting ); } else { // If `requirement` is an array, then it has nested dependencies, so let's loop it. if (requirement.length) { requirements[requirementIndex] = self.addSettingLink( requirements[requirementIndex] ); } } }); return requirements; }, /** * Should we show the control? * * @since 3.0.17 * @param {string|object} control - The control-id or the control object. * @returns {bool} - Whether the control should be shown or not. */ showKirkiControl: function (control) { const self = this; let show = true; let i; if (_.isString(control)) { control = wp.customize.control(control); } // Exit early if control not found or if "required" argument is not defined. if ( "undefined" === typeof control || (control.params && _.isEmpty(control.params.required)) ) { return true; } // Loop control requirements. for (i = 0; i < control.params.required.length; i++) { if (!self.checkCondition(control.params.required[i], control, "AND")) { show = false; } } return show; }, /** * Check a condition. * * @param {Object} dependency - The dependency, inherited from showKirkiControl. * @param {Object} dependantControl - The dependant control object. * @param {string} relation - Can be one of 'AND' or 'OR'. * @returns {bool} - Returns the results of the condition checks. */ checkCondition: function (dependency, dependantControl, relation) { let self = this; let childRelation = "AND" === relation ? "OR" : "AND"; let nestedItems; let value; let i; // If dependency has nested dependants, we need to process them separately. if ( "undefined" !== typeof dependency[0] && "undefined" === typeof dependency.setting ) { nestedItems = []; // Loop sub-dependencies. for (i = 0; i < dependency.length; i++) { nestedItems.push( self.checkCondition(dependency[i], dependantControl, childRelation) ); } // OR relation. Check that true is part of the array. if ("OR" === childRelation) { return -1 !== nestedItems.indexOf(true); } // AND relation. Check that false is not part of the array. return -1 === nestedItems.indexOf(false); } // End of nested dependants processing. if ("undefined" === typeof wp.customize.control(dependency.setting)) { // Early exit if setting is not defined. return true; } if (!self.dependencyControls[dependency.setting]) { self.dependencyControls[dependency.setting] = { settingLink: dependency.settingLink, childrens: [], }; } if ( !self.dependencyControls[dependency.setting].childrens.includes( dependantControl.id ) ) { self.dependencyControls[dependency.setting].childrens.push( dependantControl.id ); } if (!dependency.settingLink) { // console.log(dependency); // console.log(dependantControl); console.log(self.dependencyControls); console.log("--------"); } value = wp.customize(dependency.settingLink).get(); if (wp.customize.control(dependency.setting).setting) { value = wp.customize.control(dependency.setting).setting._value; } return self.evaluate( dependency.value, value, dependency.operator, dependency.choice ); }, /** * Figure out if the 2 values have the relation we want. * * @since 3.0.17 * @param {mixed} value1 - The 1st value. * @param {mixed} value2 - The 2nd value. * @param {string} operator - The comparison to use. * @param {string} choice - If we want to check an item in an object value. * @returns {bool} - Returns the evaluation result. */ evaluate: function (value1, value2, operator, choice) { var found = false; if (choice && "object" === typeof value2) { value2 = value2[choice]; } if ("===" === operator) { return value1 === value2; } if ( "==" === operator || "=" === operator || "equals" === operator || "equal" === operator ) { return value1 == value2; } if ("!==" === operator) { return value1 !== value2; } if ("!=" === operator || "not equal" === operator) { return value1 != value2; } if ( ">=" === operator || "greater or equal" === operator || "equal or greater" === operator ) { return value2 >= value1; } if ( "<=" === operator || "smaller or equal" === operator || "equal or smaller" === operator ) { return value2 <= value1; } if (">" === operator || "greater" === operator) { return value2 > value1; } if ("<" === operator || "smaller" === operator) { return value2 < value1; } if ("contains" === operator || "in" === operator) { if (_.isArray(value1) && _.isArray(value2)) { _.each(value2, function (value) { if (value1.includes(value)) { found = true; return false; } }); return found; } if (_.isArray(value2)) { _.each(value2, function (value) { if (value == value1) { // jshint ignore:line found = true; } }); return found; } if (_.isObject(value2)) { if (!_.isUndefined(value2[value1])) { found = true; } _.each(value2, function (subValue) { if (value1 === subValue) { found = true; } }); return found; } if (_.isString(value2)) { if (_.isString(value1)) { return -1 < value1.indexOf(value2) && -1 < value2.indexOf(value1); } return -1 < value1.indexOf(value2); } } if ("does not contain" === operator || "not in" === operator) { return !this.evaluate(value1, value2, "contains", choice); } return value1 == value2; }, }; jQuery(document).ready(function () { kirkiDependencies.init(); }); kirki-packages/module-field-dependencies/dist/control.js000064400000005453147177211530017423 0ustar00!function(){var n={dependencyControls:{},init:function(){var n=this;_.each(window.kirkiControlDependencies,(function(t,e){var i=wp.customize.control(e);i&&(t=n.addSettingLink(t),wp.customize.control(e).params.required=t,n.showKirkiControl(i))})),_.each(n.dependencyControls,(function(t,e){_.each(t.childrens,(function(e){wp.customize(t.settingLink,(function(t){wp.customize.control(e,(function(i){var r,o;o=function(){return n.showKirkiControl(wp.customize.control(e))},(r=function(){i.active.set(o())})(),t.bind(r),i.active.validate=o}))}))}))}))},getSettingLink:function(n){var t=document.querySelector('[data-kirki-setting="'+n+'"]'),e=n;return t&&n!==t.dataset.kirkiSettingLink&&(e=t.dataset.kirkiSettingLink),e},addSettingLink:function(n){var t=this;return n.forEach((function(e,i){e.setting?n[i].settingLink=t.getSettingLink(e.setting):e.length&&(n[i]=t.addSettingLink(n[i]))})),n},showKirkiControl:function(n){var t,e=!0;if(_.isString(n)&&(n=wp.customize.control(n)),void 0===n||n.params&&_.isEmpty(n.params.required))return!0;for(t=0;t="===e||"greater or equal"===e||"equal or greater"===e)return t>=n;if("<="===e||"smaller or equal"===e||"equal or smaller"===e)return t<=n;if(">"===e||"greater"===e)return t>n;if("<"===e||"smaller"===e)return t=\" === operator ||\n \"greater or equal\" === operator ||\n \"equal or greater\" === operator\n ) {\n return value2 >= value1;\n }\n\n if (\n \"<=\" === operator ||\n \"smaller or equal\" === operator ||\n \"equal or smaller\" === operator\n ) {\n return value2 <= value1;\n }\n\n if (\">\" === operator || \"greater\" === operator) {\n return value2 > value1;\n }\n\n if (\"<\" === operator || \"smaller\" === operator) {\n return value2 < value1;\n }\n\n if (\"contains\" === operator || \"in\" === operator) {\n if (_.isArray(value1) && _.isArray(value2)) {\n _.each(value2, function (value) {\n if (value1.includes(value)) {\n found = true;\n return false;\n }\n });\n\n return found;\n }\n\n if (_.isArray(value2)) {\n _.each(value2, function (value) {\n if (value == value1) {\n // jshint ignore:line\n found = true;\n }\n });\n return found;\n }\n\n if (_.isObject(value2)) {\n if (!_.isUndefined(value2[value1])) {\n found = true;\n }\n _.each(value2, function (subValue) {\n if (value1 === subValue) {\n found = true;\n }\n });\n return found;\n }\n\n if (_.isString(value2)) {\n if (_.isString(value1)) {\n return -1 < value1.indexOf(value2) && -1 < value2.indexOf(value1);\n }\n return -1 < value1.indexOf(value2);\n }\n }\n\n if (\"does not contain\" === operator || \"not in\" === operator) {\n return !this.evaluate(value1, value2, \"contains\", choice);\n }\n\n return value1 == value2;\n },\n};\n\njQuery(document).ready(function () {\n kirkiDependencies.init();\n});\n"],"names":["$1abc80d3e2df1201$var$kirkiDependencies","dependencyControls","init","self","this","_","each","window","kirkiControlDependencies","requirements","dependantID","control","wp","customize","addSettingLink","params","required","showKirkiControl","dependency","dependencySetting","childrens","childrenSetting","settingLink","setting","setActiveState","isDisplayed","active","set","bind","validate","getSettingLink","controlID","document","querySelector","dataset","kirkiSettingLink","forEach","requirement","requirementIndex","length","i","show","isString","isEmpty","checkCondition","dependantControl","relation","nestedItems","value","childRelation","push","indexOf","includes","id","console","log","get","_value","evaluate","operator","choice","value1","value2","found","isArray","isObject","isUndefined","subValue","jQuery","ready"],"version":3,"file":"control.js.map"}kirki-packages/control-react-colorful/LICENSE000064400000002060147177211530015043 0ustar00MIT License Copyright (c) 2019 Kirki Framework 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. kirki-packages/control-react-colorful/src/KirkiReactColorfulControl.js000064400000010565147177211530022273 0ustar00import ReactDOM from "react-dom"; import KirkiReactColorfulForm from "./KirkiReactColorfulForm"; /** * KirkiReactColorfulControl. * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiReactColorfulControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with . function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind("removed", onRemoved); } } wp.customize.control.bind("removed", onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; const useHueMode = "hue" === control.params.mode; const choices = control.params.choices; let pickerComponent; if (choices.formComponent) { pickerComponent = choices.formComponent; } else { pickerComponent = choices.alpha ? "RgbaStringColorPicker" : "HexColorPicker"; } pickerComponent = useHueMode ? "HueColorPicker" : pickerComponent; const form = ( ); ReactDOM.render(form, control.container[0]); }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component state when customizer setting changes. * * There was an issue (which was fixed): * * Let's say we have other color picker ("x" color picker) and this current color picker ("y" color picker). * Let's say there's a script that bind to that "x" color picker to make change to this "y" color picker. * * When "x" color picker is changed fast (by dragging the color, for example), * then the re-render of this "y" color picker will be messy. * There was something like "function-call race" between component re-render and function call inside the component. * * When that happens, the "x" color picker becomes unresponsive and un-usable. * * How we fixed that: * - Provide a updateComponentState property to this file. * - Inside the component, assign the updateComponentState with a function to update some states. * - Then inside the binding below, call updateComponentState instead of re-rendering the component. * * The result: Even though the "x" color picker becomes very slow, it's still usable and responsive enough. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, updateComponentState: () => {}, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } }, }); export default KirkiReactColorfulControl; kirki-packages/control-react-colorful/src/control.js000064400000000357147177211530016652 0ustar00/* global wp */ import "./control.scss"; import KirkiReactColorfulControl from './KirkiReactColorfulControl'; // Register control type with Customizer. wp.customize.controlConstructor['kirki-react-colorful'] = KirkiReactColorfulControl; kirki-packages/control-react-colorful/src/control.scss000064400000012604147177211530017207 0ustar00// React colorful control. .customize-control-kirki-react-colorful { .kirki-control-form { position: relative; box-sizing: border-box; } .kirki-control-form * { box-sizing: border-box; } .kirki-control-cols { display: flex; align-items: flex-start; } .kirki-control-left-col { padding-right: 30px; width: 90%; width: calc(100% - 35px); } .kirki-control-right-col { display: flex; justify-content: flex-end; width: 35px; } .use-hue-mode { .react-colorful { height: auto; } .react-colorful__saturation { display: none; } .react-colorful__last-control { border-radius: 4px; } input.kirki-color-input { padding-left: 8px; padding-left: 8px; } } .kirki-trigger-circle-wrapper { position: relative; top: -3px; display: flex; align-items: center; justify-content: center; padding: 3px; width: 33px; height: 33px; border-radius: 50%; border: 1px solid #ccc; } .kirki-trigger-circle { position: relative; padding: 0; display: block; width: 25px; height: 25px; background-size: 10px; border: none; border-radius: 50%; cursor: pointer; .kirki-color-preview { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } } .colorPickerContainer { position: absolute; top: 35px; right: 0; margin-top: 5px; width: 100%; padding: 15px; background-color: #fff; border-radius: 6px; box-shadow: rgba(0, 0, 0, 0.09) 0 12px 15px 0; z-index: 9999; opacity: 0; visibility: hidden; transition: all 0.2s; transition-property: opacity, visibility; // Yes, only opacity and visibility please. &.is-open { opacity: 1; visibility: visible; transition: all 0.2s ease 10ms; // When we open the picker popup, the top offset is changed, so we need to wait a bit. transition-property: opacity, visibility; // Yes, only opacity and visibility please. } } .react-colorful { width: 100%; border-radius: 4px; } .react-colorful__saturation { border-radius: 4px 4px 0 0; } .react-colorful__last-control { border-radius: 0 0 4px 4px; } .react-colorful__pointer { width: 20px; height: 20px; } .kirki-color-input-wrapper { margin-top: 15px; } .kirki-color-input-control { position: relative; display: flex; align-items: center; width: 100%; } input.kirki-color-input { display: block; position: relative; padding-left: 32px; padding-right: 8px; width: 100%; height: 30px; line-height: 30px; color: #333; border: 1px solid #ccc; border-radius: 4px; z-index: 1; } .kirki-color-input:focus, .kirki-color-input:active { box-shadow: 0 0 0 1px #2271b1; outline: none; border-color: #2271b1; } .kirki-color-preview-wrapper { position: absolute; left: 6px; width: 22px; height: 22px; background-repeat: repeat; background-size: 8px; border-radius: 50%; border: 1px solid #ddd; border: 2px solid #fff; -webkit-box-shadow: 0px 0px 0px 1px #ddd; box-shadow: 0px 0px 0px 1px #ddd; z-index: 2; } .kirki-color-preview, .kirki-control-reset { position: absolute; padding: 0; background-color: transparent; cursor: pointer; } .kirki-color-preview { display: block; width: 100%; height: 100%; border-radius: 50%; border-width: 0; } .kirki-control-reset { display: flex; align-items: center; justify-content: center; top: 4px; right: 35px; width: 17px; height: 17px; border-radius: 50%; border-width: 0; z-index: 3; } .kirki-control-reset:hover i { color: #f00; transform: rotate(-45deg); } .kirki-control-reset i { font-size: 12px; width: auto; height: auto; transform: rotate(45deg); transition: transform 0.2s; } .kirki-color-swatches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 12px; } .kirki-color-swatch { position: relative; display: block; padding: 0; width: 25px; height: 25px; border-radius: 50%; border: 2px solid #fff; cursor: pointer; transform: scale(1, 1); transition: transform 0.2s; -webkit-box-shadow: 0px 0px 0px 1px #ddd; box-shadow: 0px 0px 0px 1px #ddd; } .kirki-color-swatch:active, .kirki-color-swatch:focus { outline: none; } .kirki-color-swatch:hover, .kirki-color-swatch:focus { transform: scale(1.1, 1.1); } .kirki-label-tooltip { position: absolute; bottom: 45px; left: -8px; padding: 7px 10px 3px; // The 4px of bottom side is handled by label / description's margin-bottom. width: auto; // just for fallback for max-content. width: max-content; max-width: 100px; color: #fff; background-color: rgba(0, 0, 0, 0.7); border-radius: 4px; opacity: 0; visibility: hidden; transition: all 0.2s; &::before { content: ""; position: absolute; bottom: -8px; left: 19px; border-width: 8px 7px 0 7px; border-style: solid; border-color: rgba(0, 0, 0, 0.7) transparent transparent transparent; } .customize-control-title { line-height: 1.2; } } .kirki-trigger-circle-wrapper { &:hover ~ .kirki-label-tooltip { opacity: 1; visibility: visible; } } &[data-kirki-parent-control-type="kirki-multicolor"] { margin-right: 8px; margin-bottom: 20px; padding-right: 0; width: 35px; .kirki-control-reset { top: -19px; right: 8px; } } &[data-kirki-parent-control-type="kirki-typography"] { .colorPickerContainer { top: 55px; } .kirki-control-reset { top: 30px; right: auto; left: 35px; } } } kirki-packages/control-react-colorful/src/preview.js000064400000005556147177211530016661 0ustar00(() => { /** * Check if the provided value is a numeric. * * Thanks to Dan (https://stackoverflow.com/users/17121/dan) for his answer on StackOverflow: * @see https://stackoverflow.com/questions/175739/built-in-way-in-javascript-to-check-if-a-string-is-a-valid-number#answer-175787 * * @param {string|number} str The provided value. * @return bool */ const isNumeric = (str) => { // Number is a numeric. if ("number" === typeof str) return true; // We only process strings. if ("string" !== typeof str) return false; // Use type coercion to parse the entirety of the string (`parseFloat` alone does not do this) and ensure strings of whitespace fail. return !isNaN(str) && !isNaN(parseFloat(str)); }; /** * Generate value from color object. * * @param {Object} value The value. * @return string */ const generateStringValue = (value) => { alphaEnabled = false; if (value.r || value.g || value.b) { colorMode = "undefined" !== typeof value.a ? "rgba" : "rgb"; alphaEnabled = "rgba" === colorMode ? true : alphaEnabled; pos1 = value.r; pos2 = value.g; pos3 = value.b; pos4 = "rgba" === colorMode ? value.a : 1; } else if (value.h || value.s) { pos1 = value.h; if (value.l) { colorMode = "undefined" !== typeof value.a ? "hsla" : "hsl"; pos2 = isNumeric(value.l) ? value.l + "%" : value.l; } else if (value.v) { colorMode = "undefined" !== typeof value.a ? "hvla" : "hvl"; pos2 = isNumeric(value.v) ? value.v + "%" : value.v; } alphaEnabled = "hsla" === colorMode || "hsva" === colorMode ? true : alphaEnabled; pos3 = isNumeric(value) ? value.s + "%" : value.s; pos4 = alphaEnabled ? value.a : 1; } if (alphaEnabled) { formattedValue = colorMode + "(" + pos1 + ", " + pos2 + ", " + pos3 + ", " + pos4 + ")"; } else { formattedValue = colorMode + "(" + pos1 + ", " + pos2 + ", " + pos3 + ")"; } return formattedValue; }; /** * Function to hook into `kirkiPostMessageStylesOutput` filter. * * @param {string} styles The styles to be filtered. * @param {string|Object|int} value The control's value. * @param {Object} output The control's output argument. * @param {string} controlType The control type. * * @return {string} The filtered styles. */ const stylesOutput = (styles, value, output, controlType) => { if ("kirki-react-colorful" !== controlType) return styles; if ("string" === typeof value || "number" === typeof value) return styles; const prefix = output.prefix ? output.prefix : ""; const suffix = output.suffix ? output.suffix : ""; styles += output.element + "{" + output.property + ": " + prefix + generateStringValue(value) + suffix + ";\ }"; return styles; }; // Hook the function to the `kirkiPostMessageStylesOutput` filter. wp.hooks.addFilter("kirkiPostMessageStylesOutput", "kirki", stylesOutput); })(); kirki-packages/control-react-colorful/src/KirkiReactColorfulForm.js000064400000025764147177211530021565 0ustar00import { useState, useRef } from "react"; import { HexColorPicker, RgbColorPicker, RgbaColorPicker, RgbStringColorPicker, RgbaStringColorPicker, HslColorPicker, HslaColorPicker, HslStringColorPicker, HslaStringColorPicker, HsvColorPicker, HsvaColorPicker, HsvStringColorPicker, HsvaStringColorPicker, } from "react-colorful"; import KirkiReactColorfulInput from "./js/components/KirkiReactColorfulInput"; import KirkiReactColorfulSwatches from "./js/components/KirkiReactColorfulSwatches"; import convertColorForPicker from "./js/utils/convertColorForPicker"; import convertColorForCustomizer from "./js/utils/convertColorForCustomizer"; import convertColorForInput from "./js/utils/convertColorForInput"; import useClickOutside from "./js/hooks/useClickOutside"; import useFocusOutside from "./js/hooks/useFocusOutside"; import useWindowResize from "./js/hooks/useWindowResize"; import KirkiReactColorfulCircle from "./js/components/KirkiReactColorfulCircle"; import { colord } from "colord"; /** * The form component of Kirki React Colorful. * * Globals: * _, wp, React, ReactDOM * * @param {Object} props The props for the component. * @returns The component element. */ const KirkiReactColorfulForm = (props) => { const { control, customizerSetting, useHueMode, pickerComponent, choices } = props; const parseEmptyValue = () => (useHueMode ? 0 : "#000000"); const parseHueModeValue = (hueValue) => { hueValue = hueValue || parseEmptyValue(); hueValue = hueValue < 0 ? 0 : hueValue; return hueValue > 360 ? 360 : hueValue; }; const parseInputValue = (value) => { if ("" === value) return ""; return useHueMode ? parseHueModeValue(value) : convertColorForInput( value, pickerComponent, choices.formComponent ).replace(";", ""); }; const parseCustomizerValue = (value) => { if ("" === value) return ""; return convertColorForCustomizer( value, pickerComponent, choices.formComponent ); }; const parsePickerValue = (value) => { value = value || parseEmptyValue(); // Hard coded saturation and lightness when using hue mode. return useHueMode ? { h: value, s: 100, l: 50 } : convertColorForPicker(value, pickerComponent); }; const [inputValue, setInputValue] = useState(() => { return parseInputValue(props.value); }); const [pickerValue, setPickerValue] = useState(() => { return parsePickerValue(props.value); }); let currentInputValue = inputValue; let currentPickerValue = pickerValue; // This function will be called when this control's customizer value is changed. control.updateComponentState = (value) => { const valueForInput = parseInputValue(value); let changeInputValue = false; if (typeof valueForInput === "string" || useHueMode) { changeInputValue = valueForInput !== inputValue; } else { changeInputValue = JSON.stringify(valueForInput) !== JSON.stringify(currentInputValue); } if (changeInputValue) setInputValue(valueForInput); const valueForPicker = parsePickerValue(value); let changePickerValue = false; if (typeof valueForPicker === "string" || useHueMode) { changePickerValue = valueForPicker !== pickerValue; } else { changePickerValue = JSON.stringify(valueForPicker) !== JSON.stringify(currentPickerValue); } if (changePickerValue) setPickerValue(valueForPicker); }; const saveToCustomizer = (value) => { if (useHueMode) { /** * When using hue mode, the pickerComponent is HslColorPicker. * If there is value.h, then value is set from the picker. * Otherwise, value is set from the input or the customizer. */ value = value.h || 0 === value.h ? value.h : value; value = parseHueModeValue(value); } else { value = parseCustomizerValue(value); } customizerSetting.set(value); }; const initialColor = "" !== props.default && "undefined" !== typeof props.default ? props.default : props.value; /** * Function to run on picker change. * * @param {string|Object} color The value returned by the picker. It can be a string or a color object. */ const handlePickerChange = (color) => { if (props.onChange) props.onChange(color); currentPickerValue = color; saveToCustomizer(color); }; const handleInputChange = (value) => { currentInputValue = value; saveToCustomizer(value); }; const handleReset = () => { if (!initialColor) { currentInputValue = ""; currentPickerValue = ""; } saveToCustomizer(initialColor); }; const handleSwatchesClick = (swatchColor) => { saveToCustomizer(swatchColor); }; const handleWindowResize = () => { setPickerContainerStyle(getPickerContainerStyle()); }; let controlLabel = ( ); let controlDescription = ( ); controlLabel = ( ); controlLabel = props.label || props.description ? controlLabel : ""; const formRef = useRef(null); // Reference to the form div. const pickerRef = useRef(null); // Reference to the picker popup. const resetRef = useRef(null); // Reference to the picker popup. const [isPickerOpen, setIsPickerOpen] = useState(false); const usePositionFixed = "default" !== choices.labelStyle ? true : false; const [pickerContainerStyle, setPickerContainerStyle] = useState({}); const getPickerContainerStyle = () => { let pickerContainerStyle = {}; if (!usePositionFixed) return pickerContainerStyle; let padding = window.getComputedStyle( control.container[0].parentNode ).paddingLeft; padding = parseInt(padding, 10) * 2; pickerContainerStyle.width = control.container[0].parentNode.getBoundingClientRect().width - padding; const controlLeftOffset = (control.container[0].offsetLeft - 9) * -1; pickerContainerStyle.left = controlLeftOffset + "px"; return pickerContainerStyle; }; const convertInputValueTo6Digits = () => { if (4 === inputValue.length && inputValue.includes("#")) { setInputValue(colord(inputValue).toHex()); } }; const togglePicker = () => { if (isPickerOpen) { closePicker(); } else { openPicker(); } }; const openPicker = () => { if (isPickerOpen) return; setPickerContainerStyle(getPickerContainerStyle()); convertInputValueTo6Digits(); setIsPickerOpen(true); }; const closePicker = () => { if (!isPickerOpen) return; setIsPickerOpen(false); setTimeout(convertInputValueTo6Digits, 200); }; let KirkiPickerComponent; // We can't just render `pickerComponent` directly, we need these lines so that the compiler will import them. switch (pickerComponent) { case "HexColorPicker": KirkiPickerComponent = HexColorPicker; break; case "RgbColorPicker": KirkiPickerComponent = RgbColorPicker; break; case "RgbStringColorPicker": KirkiPickerComponent = RgbStringColorPicker; break; case "RgbaColorPicker": KirkiPickerComponent = RgbaColorPicker; break; case "RgbaStringColorPicker": KirkiPickerComponent = RgbaStringColorPicker; break; // We treat HueColorPicker (hue mode) as HslColorPicker. case "HueColorPicker": KirkiPickerComponent = HslColorPicker; break; case "HslColorPicker": KirkiPickerComponent = HslColorPicker; break; case "HslStringColorPicker": KirkiPickerComponent = HslStringColorPicker; break; case "HslaColorPicker": KirkiPickerComponent = HslaColorPicker; break; case "HslaStringColorPicker": KirkiPickerComponent = HslaStringColorPicker; break; case "HsvColorPicker": KirkiPickerComponent = HsvColorPicker; break; case "HsvStringColorPicker": KirkiPickerComponent = HsvStringColorPicker; break; case "HsvaColorPicker": KirkiPickerComponent = HsvaColorPicker; break; case "HsvaStringColorPicker": KirkiPickerComponent = HsvaStringColorPicker; break; default: KirkiPickerComponent = HexColorPicker; break; } useWindowResize(handleWindowResize); // Handle outside focus to close the picker popup. useFocusOutside(formRef, closePicker); // Handle outside click to close the picker popup. useClickOutside(pickerRef, resetRef, closePicker); if (jQuery.wp && jQuery.wp.wpColorPicker) { const wpColorPickerSwatches = jQuery.wp.wpColorPicker.prototype.options.palettes; // If 3rd parties applied custom colors to wpColorPicker swatches, let's use them. if (Array.isArray(wpColorPickerSwatches)) { if (wpColorPickerSwatches.length < 8) { for (let i = wpColorPickerSwatches.length; i <= 8; i++) { wpColorPickerSwatches.push(choices.swatches[i]); } } choices.swatches = wpColorPickerSwatches; } } const controlHeader = ( <> {controlLabel}
    ); let formClassName = useHueMode ? "kirki-control-form use-hue-mode" : "kirki-control-form"; formClassName += " has-" + choices.labelStyle + "-label-style"; let pickerContainerClassName = isPickerOpen ? pickerComponent + " colorPickerContainer is-open" : pickerComponent + " colorPickerContainer"; const pickerTrigger = ( <> ); let pickerHeader; switch (choices.labelStyle) { case "tooltip": pickerHeader = ( <> {pickerTrigger} {!isPickerOpen && (
    {controlHeader}
    )} ); break; case "top": pickerHeader = ( <> {controlHeader} {pickerTrigger} ); break; default: pickerHeader = ( <>
    {controlHeader}
    {pickerTrigger}
    ); break; } return ( <>
    {pickerHeader}
    {!useHueMode && ( )}
    ); }; export default KirkiReactColorfulForm; kirki-packages/control-react-colorful/src/Field/ReactColorful.php000064400000021024147177211530021126 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = [ __CLASS__, 'sanitize' ]; // If this is a hue control then its value should be an integer. if ( isset( $args['mode'] ) && 'hue' === $args['mode'] ) { $args['sanitize_callback'] = 'absint'; } } // For postMessage/preview purpose, if property is not set, then set it to 'color'. if ( isset( $args['output'] ) && ! empty( $args['output'] ) && is_array( $args['output'] ) && ! isset( $args['output']['element'] ) ) { foreach ( $args['output'] as $index => $output ) { if ( ! isset( $output['property'] ) ) { if ( empty( $args['output'][ $index ] ) ) { $args['output'][ $index ] = []; } $args['output'][ $index ]['property'] = 'color'; } } } } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-react-colorful'; } return $args; } /** * Sanitize colors. * * @static * @access public * @since 1.0 * * @param string|array $value The color. * @return string|array */ public static function sanitize( $value ) { $sanitized_value = ''; if ( is_string( $value ) ) { $sanitized_value = self::sanitize_color_string( $value ); } elseif ( is_array( $value ) ) { if ( isset( $value['r'] ) || isset( $value['g'] ) || isset( $value['b'] ) ) { $sanitized_value = self::sanitize_color_array( $value, 'rgb' ); } elseif ( isset( $value['h'] ) || isset( $value['s'] ) ) { if ( isset( $value['l'] ) ) { $sanitized_value = self::sanitize_color_array( $value, 'hsl' ); } elseif ( isset( $value['v'] ) ) { $sanitized_value = self::sanitize_color_array( $value, 'hsv' ); } } } return $sanitized_value; } /** * Sanitize single color array. * * @param array $color The provided color in array format. * @param string $color_type The color type. Accepts: rgb, hsl, and hsv. * * @return array The sanitized color. */ public static function sanitize_color_array( $color, $color_type = 'rgb' ) { $keys = [ 'r', 'g', 'b' ]; $mins = [ 0, 0, 0 ]; $maxs = [ 255, 255, 255 ]; if ( 'hsl' === $color_type || 'hsv' === $color_type ) { $keys = [ 'h', 's', '' ]; $keys[2] = isset( $color['v'] ) ? 'v' : 'l'; $mins = [ 0, 0, 0 ]; $maxs = [ 360, 100, 100 ]; } $sanitized_color = []; $sanitized_color = [ $keys[0] => isset( $color[ $keys[0] ] ) ? absint( $color[ $keys[0] ] ) : $mins[0], $keys[1] => isset( $color[ $keys[1] ] ) ? absint( $color[ $keys[1] ] ) : $mins[1], $keys[2] => isset( $color[ $keys[2] ] ) ? absint( $color[ $keys[2] ] ) : $mins[2], ]; $sanitized_color[ $keys[0] ] = $sanitized_color[ $keys[0] ] < $mins[0] ? $mins[0] : $sanitized_color[ $keys[0] ]; $sanitized_color[ $keys[0] ] = $sanitized_color[ $keys[0] ] > $maxs[0] ? $maxs[0] : $sanitized_color[ $keys[0] ]; $sanitized_color[ $keys[1] ] = $sanitized_color[ $keys[1] ] < $mins[1] ? $mins[1] : $sanitized_color[ $keys[1] ]; $sanitized_color[ $keys[1] ] = $sanitized_color[ $keys[1] ] > $maxs[1] ? $maxs[1] : $sanitized_color[ $keys[1] ]; $sanitized_color[ $keys[2] ] = $sanitized_color[ $keys[2] ] < $mins[2] ? $mins[2] : $sanitized_color[ $keys[2] ]; $sanitized_color[ $keys[2] ] = $sanitized_color[ $keys[2] ] > $maxs[2] ? $maxs[2] : $sanitized_color[ $keys[2] ]; if ( isset( $color['a'] ) ) { $sanitized_color['a'] = isset( $color['a'] ) ? filter_var( $color['a'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : 1; $sanitized_color['a'] = $sanitized_color['a'] < 0 ? 0 : $sanitized_color['a']; $sanitized_color['a'] = $sanitized_color['a'] > 1 ? 1 : $sanitized_color['a']; } return $sanitized_color; } /** * Sanitize color string. * * @static * @access public * @since 1.0 * * @param string $value The color. * @return string */ public static function sanitize_color_string( $value ) { $value = strtolower( $value ); /** * This pattern will check and match 3/6/8-character hex, rgb, rgba, hsl, hsla, hsv, and hsva colors. * * RGB regex: * * @link https://stackoverflow.com/questions/9585973/javascript-regular-expression-for-rgb-values#answer-9586045 * * For testing it, you can use these links: * * @link https://regex101.com/ * @link https://regexr.com/ * @link https://www.regextester.com/ * * How to test it? * * Paste the following code to the test field (of course without the asterisks and spaces in front of them): * rgba(255, 255, 0, 0.9) * rgb(255, 255, 0) * #ff0 * #ffff00 * hsl(150, 25%, 25%) * hsla(250, 25%, 25%, 0.7) * hsv(125, 15%, 30%) * hsva(125, 15%, 30%, 0.5) * * And then paste the regex `$pattern` below (without the single quote's start and end) to the regular expression box. * Set the flag to use "global" and "multiline". */ $pattern = '/^(\#[\da-f]{3}|\#[\da-f]{6}|\#[\da-f]{8}|rgba\(((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*,\s*){2}((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*)(,\s*(0\.\d+|1))\)|rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)|hsla\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)(,\s*(0\.\d+|1))\)|hsl\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)\)|hsva\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)(,\s*(0\.\d+|1))\)|hsv\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)\))$/'; preg_match( $pattern, $value, $matches ); // Return the 1st match found. if ( isset( $matches[0] ) ) { if ( is_string( $matches[0] ) ) { return $matches[0]; } if ( is_array( $matches[0] ) && isset( $matches[0][0] ) ) { return $matches[0][0]; } } // If no match was found, return an empty string. return ''; } /** * Enqueue styles & scripts on 'customize_preview_init' action. * * @since 4.0.0 * @access public */ public function enqueue_customize_preview_scripts() { wp_enqueue_script( 'kirki-react-colorful', URL::get_from_path( dirname( dirname( __DIR__ ) ) ) . '/dist/preview.js', [ 'wp-hooks', 'customize-preview' ], $this->control_class::$control_ver, true ); } /** * Add output control class for react colorful control. * * @since 4.0.0 * @access public * * @param array $control_classes The existing control classes. * @return array */ public function output_control_classnames( $control_classes ) { $control_classes['kirki-react-colorful'] = '\Kirki\Field\CSS\ReactColorful'; return $control_classes; } } kirki-packages/control-react-colorful/src/Field/CSS/ReactColorful.php000064400000004526147177211530021566 0ustar00 'global', 'element' => '', 'property' => 'color', 'prefix' => '', 'suffix' => '', ) ); // Only need to process further if the $value format is array. if ( ! is_array( $value ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $value . $output['suffix']; return; } $alpha_enabled = false; if ( isset( $value['r'] ) || isset( $value['g'] ) || isset( $value['b'] ) ) { $color_mode = isset( $value['a'] ) ? 'rgba' : 'rgb'; $alpha_enabled = 'rgba' === $color_mode ? true : $alpha_enabled; $pos_1 = $value['r']; $pos_2 = $value['g']; $pos_3 = $value['b']; $pos_4 = 'rgba' === $color_mode ? $value['a'] : 1; } elseif ( isset( $value['h'] ) || isset( $value['s'] ) ) { $pos_1 = $value['h']; if ( isset( $value['l'] ) ) { $color_mode = isset( $value['a'] ) ? 'hsla' : 'hsl'; $pos_2 = is_numeric( $value['l'] ) ? $value['l'] . '%' : $value['l']; } elseif ( isset( $value['v'] ) ) { $color_mode = isset( $value['a'] ) ? 'hvla' : 'hvl'; $pos_2 = is_numeric( $value['v'] ) ? $value['v'] . '%' : $value['v']; } $alpha_enabled = 'hsla' === $color_mode || 'hsva' === $color_mode ? true : $alpha_enabled; $pos_3 = is_numeric( $value ) ? $value['s'] . '%' : $value['s']; $pos_4 = $alpha_enabled ? $value['a'] : 1; } if ( $alpha_enabled ) { $formatted_value = $color_mode . '(' . $pos_1 . ', ' . $pos_2 . ', ' . $pos_3 . ', ' . $pos_4 . ')'; } else { $formatted_value = $color_mode . '(' . $pos_1 . ', ' . $pos_2 . ', ' . $pos_3 . ')'; } $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $formatted_value . $output['suffix']; } } kirki-packages/control-react-colorful/src/js/components/KirkiReactColorfulSwatches.js000064400000001000147177211530025215 0ustar00const KirkiReactColorfulSwatches = ({ colors, onClick }) => { return (
    {colors.map((clr, index) => { const color = clr && clr.color ? clr.color : clr; return ( ); })}
    ); }; export default KirkiReactColorfulSwatches; kirki-packages/control-react-colorful/src/js/components/KirkiReactColorfulInput.js000064400000004661147177211530024553 0ustar00import { useState, useEffect, useCallback } from "react"; import reactCSS from "reactcss"; const KirkiReactColorfulInput = (props) => { const { onChange, color = "" } = props; const [value, setValue] = useState(() => color); const handleChange = useCallback( (e) => { let val = e.target.value; if (2 === val.length) { if (!val.includes("#") && !val.includes("rg") && !val.includes("hs")) { val = "#" + val; } } else if (3 === val.length || 6 === val.length) { if (!val.includes("#") && !val.includes("rg") && !val.includes("hs")) { val = "#" + val; } } val = val.toLowerCase(); // Thank you: https://regexr.com/39cgj const pattern = new RegExp( /(?:#|0x)(?:[a-f0-9]{3}|[a-f0-9]{6}|[a-f0-9]{8})\b|(?:rgb|hsl)a?\([^\)]*\)/ ); if ("" === val || pattern.test(val)) { onChange(val); // Run onChange handler passed by `KirkiReactColorfulForm` component. } setValue(val); }, [onChange] ); // Update the local state when `color` property value is changed. useEffect(() => { // We don't need to convert the color since it's already handled in parent component. setValue(color); }, [color]); const pickersWithAlpha = [ "RgbaColorPicker", "RgbaStringColorPicker", "HslaColorPicker", "HslaStringColorPicker", "HsvaColorPicker", "HsvaStringColorPicker", ]; const styles = reactCSS({ default: { colorPreviewWrapper: { backgroundImage: pickersWithAlpha.includes(props.pickerComponent) ? 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==")' : "none", }, colorPreview: { backgroundColor: value, }, }, }); return (
    {!props.useHueMode && (
    )}
    ); }; export default KirkiReactColorfulInput; kirki-packages/control-react-colorful/src/js/components/KirkiReactColorfulCircle.js000064400000002622147177211530024650 0ustar00import { useState, useEffect } from "react"; import reactCSS from "reactcss"; const KirkiReactColorfulCircle = (props) => { const { color = "" } = props; const [value, setValue] = useState(() => color); // Update the local state when `color` property value is changed. useEffect(() => { // We don't need to convert the color since it's using the customizer value. setValue(color); }, [color]); const pickersWithAlpha = [ "RgbaColorPicker", "RgbaStringColorPicker", "HslaColorPicker", "HslaStringColorPicker", "HsvaColorPicker", "HsvaStringColorPicker", ]; const styles = reactCSS({ default: { triggerButton: { backgroundImage: 'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==")', }, colorPreview: { backgroundColor: value ? value : "transparent", }, }, }); return (
    ); }; export default KirkiReactColorfulCircle; kirki-packages/control-react-colorful/src/js/utils/convertColorForCustomizer.js000064400000007416147177211530024164 0ustar00import { colord } from "colord"; /** * Convert the value for the customizer. * * @param {string|Object} value The value to be converted. * @param {string} pickerComponent The picker component name. * * @returns {string} The converted value. */ const convertColorForCustomizer = (value, pickerComponent, formComponent) => { let rgba; let hsv; let hsva; let convertedValue; switch (pickerComponent) { /** * The HexColorPicker is used by these condition: * 1. When formComponent is defined with HexColorPicker as the value. * 2. When formComponent is not defined but the "alpha" choice is not set or set to false (the old way). */ case "HexColorPicker": convertedValue = "string" === typeof value && value.includes("#") ? value : colord(value).toHex(); break; case "RgbColorPicker": convertedValue = colord(value).toRgb(); delete convertedValue.a; break; case "RgbStringColorPicker": convertedValue = "string" === typeof value && value.includes("rgb(") ? value : colord(value).toRgbString(); break; case "RgbaColorPicker": rgba = colord(value).toRgb(); convertedValue = rgba; break; /** * The RgbaStringColorPicker is used by these condition: * 1. When formComponent is defined with RgbaColorPicker as the value. * 2. When formComponent is not defined but the "alpha" choice is set to true. */ case "RgbaStringColorPicker": rgba = colord(value).toRgb(); if (rgba.a < 1) { convertedValue = "string" === typeof value && value.includes("rgba") ? value : colord(value).toRgbString(); } else { // When it uses the 2nd condition above, then the expected value is "hex". if (!formComponent) { convertedValue = "string" === typeof value && value.includes("#") ? value : colord(value).toHex(); } else { convertedValue = colord(value).toRgbString(); // Force to set the alpha channel value. if ( convertedValue.includes("rgb") && !convertedValue.includes("rgba") ) { convertedValue = convertedValue.replace("rgb", "rgba"); convertedValue = convertedValue.replace(")", ", 1)"); } } } break; case "HslColorPicker": convertedValue = colord(value).toHsl(); delete convertedValue.a; break; case "HslStringColorPicker": convertedValue = "string" === typeof value && value.includes("hsl(") ? value : colord(value).toHslString(); break; case "HslaColorPicker": convertedValue = colord(value).toHsl(); break; case "HslaStringColorPicker": convertedValue = colord(value).toHslString(); // Force to set the alpha channel value. if (convertedValue.includes("hsl") && !convertedValue.includes("hsla")) { convertedValue = convertedValue.replace("hsl", "hsla"); convertedValue = convertedValue.replace(")", ", 1)"); } break; case "HsvColorPicker": convertedValue = colord(value).toHsv(); delete convertedValue.a; break; /** * The colord library doesn't provide .toHsvString() method yet. * This manual value-building will apply to "HsvStringColorPicker" and "HsvaStringColorPicker" stuff below. */ case "HsvStringColorPicker": hsv = colord(value).toHsv(); convertedValue = "hsv(" + hsv.h + ", " + hsv.s + "%, " + hsv.v + "%)"; break; case "HsvaColorPicker": convertedValue = colord(value).toHsv(); break; case "HsvaStringColorPicker": hsva = colord(value).toHsv(); convertedValue = "hsva(" + hsva.h + ", " + hsva.s + "%, " + hsva.v + "%, " + hsva.a + ")"; break; default: convertedValue = "string" === typeof value && value.includes("#") ? value : colord(value).toHex(); break; } return convertedValue; }; export default convertColorForCustomizer; kirki-packages/control-react-colorful/src/js/utils/convertColorForInput.js000064400000010637147177211530023116 0ustar00import { colord } from "colord"; /** * Convert the value for the color input. * * @param {string|Object} value The value to be converted. * @param {string} pickerComponent The picker component name. * * @returns {string} The converted value. */ const convertColorForInput = (value, pickerComponent, formComponent) => { let rgba; let hsv; let hsva; let convertedValue; switch (pickerComponent) { /** * The HexColorPicker is used by these condition: * 1. When formComponent is defined with HexColorPicker as the value. * 2. When formComponent is not defined but the "alpha" choice is not set or set to false (the old way). */ case "HexColorPicker": convertedValue = "string" === typeof value && value.includes("#") ? value : colord(value).toHex(); break; case "RgbColorPicker": convertedValue = "string" === typeof value && value.includes("rgb(") ? value : colord(value).toRgbString(); break; case "RgbStringColorPicker": convertedValue = "string" === typeof value && value.includes("rgba") ? value : colord(value).toRgbString(); break; case "RgbaColorPicker": rgba = colord(value).toRgb(); if (rgba.a < 1) { convertedValue = "string" === typeof value && value.includes("rgba") ? value : colord(value).toRgbString(); } else { convertedValue = colord(value).toRgbString(); // Force to set the alpha value. if ( convertedValue.includes("rgb") && !convertedValue.includes("rgba") ) { convertedValue = convertedValue.replace("rgb", "rgba"); convertedValue = convertedValue.replace(")", ", 1)"); } } break; /** * The RgbaStringColorPicker is used by these condition: * 1. When formComponent is defined with RgbaColorPicker as the value. * 2. When formComponent is not defined but the "alpha" choice is set to true. */ case "RgbaStringColorPicker": rgba = colord(value).toRgb(); // When it uses the 2nd condition above, then the expected value is "hex". if (rgba.a == 1 && !formComponent) { convertedValue = "string" === typeof value && value.includes("#") ? value : colord(value).toHex(); } else { convertedValue = colord(value).toRgbString(); // Force to set the alpha value. if ( convertedValue.includes("rgb") && !convertedValue.includes("rgba") ) { convertedValue = convertedValue.replace("rgb", "rgba"); convertedValue = convertedValue.replace(")", ", 1)"); } } break; case "HslColorPicker": convertedValue = "string" === typeof value && value.includes("hsl(") ? value : colord(value).toHslString(); break; case "HslStringColorPicker": convertedValue = "string" === typeof value && value.includes("hsl(") ? value : colord(value).toHslString(); break; case "HslaColorPicker": convertedValue = colord(value).toHslString(); // Force to set the alpha value. if (convertedValue.includes("hsl") && !convertedValue.includes("hsla")) { convertedValue = convertedValue.replace("hsl", "hsla"); convertedValue = convertedValue.replace(")", ", 1)"); } break; case "HslaStringColorPicker": convertedValue = colord(value).toHslString(); // Force to set the alpha value. if (convertedValue.includes("hsl") && !convertedValue.includes("hsla")) { convertedValue = convertedValue.replace("hsl", "hsla"); convertedValue = convertedValue.replace(")", ", 1)"); } break; /** * The colord library doesn't provide .toHsvString() method yet. * This manual value-building will apply to "hsv" and "hsva" stuff below. */ case "HsvColorPicker": hsv = colord(value).toHsv(); convertedValue = "hsv(" + hsv.h + ", " + hsv.s + "%, " + hsv.v + "%)"; break; case "HsvStringColorPicker": hsv = colord(value).toHsv(); convertedValue = "hsv(" + hsv.h + ", " + hsv.s + "%, " + hsv.v + "%)"; break; case "HsvaColorPicker": hsva = colord(value).toHsv(); convertedValue = "hsva(" + hsva.h + ", " + hsva.s + "%, " + hsva.v + "%, " + hsva.a + ")"; break; case "HsvaStringColorPicker": hsva = colord(value).toHsv(); convertedValue = "hsva(" + hsva.h + ", " + hsva.s + "%, " + hsva.v + "%, " + hsva.a + ")"; break; default: convertedValue = colord(value).toHex(); break; } return convertedValue; }; export default convertColorForInput; kirki-packages/control-react-colorful/src/js/utils/util.js000064400000000000147177211530017704 0ustar00kirki-packages/control-react-colorful/src/js/utils/convertColorForPicker.js000064400000004603147177211530023230 0ustar00import { colord } from "colord"; /** * Convert the value for the color picker. * * @param {string|Object} value The value to be converted. * @param {string} pickerComponent The picker component name. * * @returns {string|Object} The converted value. */ const convertColorForPicker = (value, pickerComponent) => { let convertedValue; switch (pickerComponent) { case "HexColorPicker": convertedValue = colord(value).toHex(); break; case "RgbColorPicker": convertedValue = colord(value).toRgb(); delete convertedValue.a; break; case "RgbStringColorPicker": convertedValue = colord(value).toRgbString(); break; case "RgbaColorPicker": convertedValue = colord(value).toRgb(); break; case "RgbaStringColorPicker": convertedValue = colord(value).toRgbString(); // Force to set the alpha channel value. if (convertedValue.includes("rgb") && !convertedValue.includes("rgba")) { convertedValue = convertedValue.replace("rgb", "rgba"); convertedValue = convertedValue.replace(")", ", 1)"); } break; case "HslColorPicker": convertedValue = colord(value).toHsl(); delete convertedValue.a; break; case "HslStringColorPicker": convertedValue = colord(value).toHslString(); break; case "HslaColorPicker": convertedValue = colord(value).toHsl(); break; case "HslaStringColorPicker": convertedValue = colord(value).toHslString(); // Force to set the alpha channel value. if (convertedValue.includes("hsl") && !convertedValue.includes("hsla")) { convertedValue = convertedValue.replace("hsl", "hsla"); convertedValue = convertedValue.replace(")", ", 1)"); } break; case "HsvColorPicker": convertedValue = colord(value).toHsv(); delete convertedValue.a; break; case "HsvStringColorPicker": const hsv = colord(value).toHsv(); convertedValue = "hsv(" + hsv.h + ", " + hsv.s + "%, " + hsv.v + "%)"; break; case "HsvaColorPicker": convertedValue = colord(value).toHsv(); break; case "HsvaStringColorPicker": // colord library doesn't provide .toHsvString() method yet. const hsva = colord(value).toHsv(); convertedValue = "hsva(" + hsva.h + ", " + hsva.s + "%, " + hsva.v + "%, " + hsva.a + ")"; break; default: convertedValue = colord(value).toHex(); break; } return convertedValue; }; export default convertColorForPicker; kirki-packages/control-react-colorful/src/js/hooks/useFocusOutside.js000064400000001046147177211530022056 0ustar00import { useEffect } from "react"; const useFocusOutside = (ref, handler) => { useEffect(() => { const listener = (e) => { // Do nothing if the component hasn't been mounted. if (!ref.current) return; // Do nothing if the focused element is inside the ref or the ref it self. if (ref.current.contains(e.target)) return; handler(); }; document.addEventListener("focus", listener, true); return () => { document.removeEventListener("focus", listener, true); }; }, [ref, handler]); }; export default useFocusOutside; kirki-packages/control-react-colorful/src/js/hooks/useWindowResize.js000064400000000507147177211530022074 0ustar00import { useEffect } from "react"; const useWindowResize = (handler) => { useEffect(() => { const listener = (e) => { handler(); }; window.addEventListener("resize", listener, true); return () => { window.removeEventListener("resize", listener, true); }; }, [handler]); }; export default useWindowResize; kirki-packages/control-react-colorful/src/js/hooks/useClickOutside.js000064400000003076147177211530022031 0ustar00import { useEffect } from "react"; /** * Code was taken and then modified from https://codesandbox.io/s/opmco?file=/src/useClickOutside.js:0-1192 * It was improved version of https://usehooks.com/useOnClickOutside/ */ const useClickOutside = (pickerRef, resetRef, handler) => { useEffect(() => { let startedWhenMounted = false; let startedInside = false; const listener = (event) => { // Do nothing if `mousedown` or `touchstart` started either inside resetRef or pickerRef element if (!startedWhenMounted || startedInside) return; // Do nothing if clicking resetRef's element or descendent elements if (!resetRef.current || resetRef.current.contains(event.target)) return; // Do nothing if clicking pickerRef's element or descendent elements if (!pickerRef.current || pickerRef.current.contains(event.target)) return; handler(); }; const validateEventStart = (event) => { startedWhenMounted = resetRef.current && pickerRef.current; startedInside = (resetRef.current && resetRef.current.contains(event.target)) || (pickerRef.current && pickerRef.current.contains(event.target)); }; document.addEventListener("mousedown", validateEventStart); document.addEventListener("touchstart", validateEventStart); document.addEventListener("click", listener); return () => { document.removeEventListener("mousedown", validateEventStart); document.removeEventListener("touchstart", validateEventStart); document.removeEventListener("click", listener); }; }, [resetRef, pickerRef, handler]); }; export default useClickOutside; kirki-packages/control-react-colorful/src/Control/ReactColorful.php000064400000011771147177211530021533 0ustar00 'alpha' argument. * * @access public * @var string */ public $mode = ''; /** * Enqueue control related scripts/styles. * * @access public * @since 1.0 * @return void */ public function enqueue() { parent::enqueue(); // Enqueue the script. wp_enqueue_script( 'kirki-control-react-colorful', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'customize-controls', 'wp-element', 'jquery', 'customize-base', 'kirki-control-base' ], self::$control_ver, false ); // Enqueue the style. wp_enqueue_style( 'kirki-control-react-colorful', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @access public * @since 1.0 * @see WP_Customize_Control::to_json() * @return void */ public function to_json() { // Get the basics from the parent class. parent::to_json(); if ( isset( $this->json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } // Value. $this->json['value'] = empty( $this->value() ) ? '' : ( 'hue' === $this->mode ? absint( $this->value() ) : $this->value() ); if ( is_string( $this->json['value'] ) ) { $this->json['value'] = strtolower( $this->json['value'] ); } // Mode. $this->json['mode'] = $this->mode; // The label_style. $this->json['choices']['labelStyle'] = isset( $this->choices['label_style'] ) ? $this->choices['label_style'] : 'default'; // Color swatches. $this->json['choices']['swatches'] = $this->color_swatches(); // Form component (the value is bsaed on react-colorful's components). if ( isset( $this->choices['form_component'] ) ) { $this->json['choices']['formComponent'] = $this->choices['form_component']; } $this->remove_unused_json_props(); } /** * Remove un-used json properties. * * For consistency in JS, we converted some choices to use camelCase. * To reduce the returned json size, we remove the original properties (which is using snake_case) from the JSON. * But we keep them to stay in the choices array, so that they're still accessible. * * @return void */ public function remove_unused_json_props() { if ( isset( $this->json['choices']['label_style'] ) ) { unset( $this->json['choices']['label_style'] ); } if ( isset( $this->choices['form_component'] ) ) { unset( $this->json['choices']['form_component'] ); } if ( isset( $this->json['choices']['trigger_style'] ) ) { unset( $this->json['choices']['trigger_style'] ); } if ( isset( $this->json['choices']['button_text'] ) ) { unset( $this->json['choices']['button_text'] ); } } /** * Get color swatches values. * * @return array The color swatches values. */ public function color_swatches() { $default_swatches = [ '#000000', '#ffffff', '#dd3333', '#dd9933', '#eeee22', '#81d742', '#1e73be', '#8224e3', ]; $default_swatches = apply_filters( 'kirki_default_color_swatches', $default_swatches ); $defined_swatches = isset( $this->choices['swatches'] ) && ! empty( $this->choices['swatches'] ) ? $this->choices['swatches'] : []; if ( empty( $defined_swatches ) ) { $defined_swatches = isset( $this->choices['palettes'] ) && ! empty( $this->choices['palettes'] ) ? $this->choices['palettes'] : []; } if ( ! empty( $defined_swatches ) ) { $swatches = $defined_swatches; $total_swatches = count( $swatches ); if ( $total_swatches < 8 ) { for ( $i = $total_swatches; $i <= 8; $i++ ) { $swatches[] = $total_swatches[ $i ]; } } } else { $swatches = $default_swatches; } $swatches = apply_filters( 'kirki_color_swatches', $swatches ); return $swatches; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected * @since 1.0 * @return void */ protected function content_template() {} } kirki-packages/control-react-colorful/dist/preview.js.map000064400000011053147177211530017576 0ustar00{"mappings":"YAAC,IAUMA,EAAAA,EAAaC,SAAAA,GAGlB,MAAI,iBAAoBA,GAGpB,iBAAoBA,IAGfC,MAAMD,KAASC,MAAMC,WAAWF,KA4E1CG,GAAGC,MAAMC,UAAU,+BAAgC,SAjB9B,SAACC,EAAQC,EAAOC,EAAQC,GAE5C,GAAI,yBAA2BA,EAAa,OAAOH,EACnD,GAAI,iBAAoBC,GAAS,iBAAoBA,EAAO,OAAOD,EAEnE,IAAMI,EAASF,EAAOE,OAASF,EAAOE,OAAS,GACzCC,EAASH,EAAOG,OAASH,EAAOG,OAAS,GAM/C,OAJAL,GAAUE,EAAOI,QAAU,IACxBJ,EAAOK,SAAW,KAAOH,EA1DAH,SAAAA,GAmC5B,OAjCAO,cAAe,EAEXP,EAAMQ,GAAKR,EAAMS,GAAKT,EAAMU,GAC/BC,eAAY,IAAuBX,EAAMY,EAAI,OAAS,MACtDL,aAAe,SAAWI,WAAmBJ,aAE7CM,KAAOb,EAAMQ,EACbM,KAAOd,EAAMS,EACbM,KAAOf,EAAMU,EACbM,KAAO,SAAWL,UAAYX,EAAMY,EAAI,IAC9BZ,EAAMiB,GAAKjB,EAAMkB,KAC3BL,KAAOb,EAAMiB,EAETjB,EAAMmB,GACTR,eAAY,IAAuBX,EAAMY,EAAI,OAAS,MACtDE,KAAOtB,EAAUQ,EAAMmB,GAAKnB,EAAMmB,EAAI,IAAMnB,EAAMmB,GACxCnB,EAAMoB,IAChBT,eAAY,IAAuBX,EAAMY,EAAI,OAAS,MACtDE,KAAOtB,EAAUQ,EAAMoB,GAAKpB,EAAMoB,EAAI,IAAMpB,EAAMoB,GAGnDb,aAAe,SAAWI,WAAa,SAAWA,WAAmBJ,aAErEQ,KAAOvB,EAAUQ,GAASA,EAAMkB,EAAI,IAAMlB,EAAMkB,EAChDF,KAAOT,aAAeP,EAAMY,EAAI,GAG7BL,aACHc,eAAiBV,UAAY,IAAME,KAAO,KAAOC,KAAO,KAAOC,KAAO,KAAOC,KAAO,IAEpFK,eAAiBV,UAAY,IAAME,KAAO,KAAOC,KAAO,KAAOC,KAAO,IAGhEM,eAuB8BC,CAAoBtB,GAASI,EAAS,SAGpEL","sources":["src/preview.js"],"sourcesContent":["(() => {\n\t/**\n\t * Check if the provided value is a numeric.\n\t *\n\t * Thanks to Dan (https://stackoverflow.com/users/17121/dan) for his answer on StackOverflow:\n\t * @see https://stackoverflow.com/questions/175739/built-in-way-in-javascript-to-check-if-a-string-is-a-valid-number#answer-175787\n\t *\n\t * @param {string|number} str The provided value.\n\t * @return bool\n\t */\n\tconst isNumeric = (str) => {\n\n\t\t// Number is a numeric.\n\t\tif ('number' === typeof str) return true;\n\n\t\t// We only process strings.\n\t\tif ('string' !== typeof str) return false;\n\n\t\t// Use type coercion to parse the entirety of the string (`parseFloat` alone does not do this) and ensure strings of whitespace fail.\n\t\treturn (!isNaN(str) && !isNaN(parseFloat(str)));\n\n\t};\n\n\t/**\n\t * Generate value from color object.\n\t *\n\t * @param {Object} value The value.\n\t * @return string\n\t */\n\tconst generateStringValue = (value) => {\n\n\t\talphaEnabled = false;\n\n\t\tif (value.r || value.g || value.b) {\n\t\t\tcolorMode = \"undefined\" !== typeof value.a ? 'rgba' : 'rgb';\n\t\t\talphaEnabled = 'rgba' === colorMode ? true : alphaEnabled;\n\n\t\t\tpos1 = value.r;\n\t\t\tpos2 = value.g;\n\t\t\tpos3 = value.b;\n\t\t\tpos4 = 'rgba' === colorMode ? value.a : 1;\n\t\t} else if (value.h || value.s) {\n\t\t\tpos1 = value.h;\n\n\t\t\tif (value.l) {\n\t\t\t\tcolorMode = \"undefined\" !== typeof value.a ? 'hsla' : 'hsl';\n\t\t\t\tpos2 = isNumeric(value.l) ? value.l + '%' : value.l;\n\t\t\t} else if (value.v) {\n\t\t\t\tcolorMode = \"undefined\" !== typeof value.a ? 'hvla' : 'hvl';\n\t\t\t\tpos2 = isNumeric(value.v) ? value.v + '%' : value.v;\n\t\t\t}\n\n\t\t\talphaEnabled = 'hsla' === colorMode || 'hsva' === colorMode ? true : alphaEnabled;\n\n\t\t\tpos3 = isNumeric(value) ? value.s + '%' : value.s;\n\t\t\tpos4 = alphaEnabled ? value.a : 1;\n\t\t}\n\n\t\tif (alphaEnabled) {\n\t\t\tformattedValue = colorMode + '(' + pos1 + ', ' + pos2 + ', ' + pos3 + ', ' + pos4 + ')';\n\t\t} else {\n\t\t\tformattedValue = colorMode + '(' + pos1 + ', ' + pos2 + ', ' + pos3 + ')';\n\t\t}\n\n\t\treturn formattedValue;\n\n\t};\n\n\t/**\n\t * Function to hook into `kirkiPostMessageStylesOutput` filter.\n\t *\n\t * @param {string} styles The styles to be filtered.\n\t * @param {string|Object|int} value The control's value.\n\t * @param {Object} output The control's output argument.\n\t * @param {string} controlType The control type.\n\t *\n\t * @return {string} The filtered styles.\n\t */\n\tconst stylesOutput = (styles, value, output, controlType) => {\n\n\t\tif ('kirki-react-colorful' !== controlType) return styles;\n\t\tif ('string' === typeof value || 'number' === typeof value) return styles;\n\n\t\tconst prefix = output.prefix ? output.prefix : '';\n\t\tconst suffix = output.suffix ? output.suffix : \"\";\n\n\t\tstyles += output.element + '{'\n\t\t\t+ output.property + ': ' + prefix + generateStringValue(value) + suffix + ';\\\n\t\t}';\n\n\t\treturn styles;\n\n\t};\n\n\t// Hook the function to the `kirkiPostMessageStylesOutput` filter.\n\twp.hooks.addFilter('kirkiPostMessageStylesOutput', 'kirki', stylesOutput);\n})();\n"],"names":["isNumeric","str","isNaN","parseFloat","wp","hooks","addFilter","styles","value","output","controlType","prefix","suffix","element","property","alphaEnabled","r","g","b","colorMode","a","pos1","pos2","pos3","pos4","h","s","l","v","formattedValue","generateStringValue"],"version":3,"file":"preview.js.map"}kirki-packages/control-react-colorful/dist/control.js000064400000165042147177211530017031 0ustar00!function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function t(e){return e&&e.__esModule?e.default:e}var r={},n={},o=e.parcelRequire4303;null==o&&((o=function(e){if(e in r)return r[e].exports;if(e in n){var t=n[e];delete n[e];var o={id:e,exports:{}};return r[e]=o,t.call(o.exports,o,o.exports),o.exports}var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){n[e]=t},e.parcelRequire4303=o),o.register("7HKs8",(function(e,t){var r=o("8ThvE"),n=o("jjS2x"),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,c=i&&i.exports===a?r.Buffer:void 0,u=(c?c.isBuffer:void 0)||n;e.exports=u})),o.register("8ThvE",(function(e,t){var r=o("lyxRX"),n="object"==typeof self&&self&&self.Object===Object&&self,a=r||n||Function("return this")();e.exports=a})),o.register("lyxRX",(function(t,r){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n})),o.register("jjS2x",(function(e,t){e.exports=function(){return!1}})),o.register("7vc1R",(function(e,t){var r=o("lyxRX"),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n&&r.process,c=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c})),o.register("4vs1M",(function(e,t){var r=o("8ThvE"),n=t&&!t.nodeType&&t,a=n&&e&&!e.nodeType&&e,i=a&&a.exports===n?r.Buffer:void 0,c=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=c?c(r):new e.constructor(r);return e.copy(n),n}}));var a;function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}function v(e){var t=l.useRef(e),r=l.useRef((function(e){t.current&&t.current(e)}));return t.current=e,r.current}l=React;var d=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&a.current?i(h(a.current,e,u.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=d.current,o=b(a.current),i=r?o.addEventListener:o.removeEventListener;i(n?"touchmove":"mousemove",e),i(n?"touchend":"mouseup",t)}return[function(e){var t,n=e.nativeEvent,o=a.current;if(o&&(g(n),t=n,(!d.current||p(t))&&o)){if(p(n)){d.current=!0;var c=n.changedTouches||[];c.length&&(u.current=c[0].identifier)}o.focus(),i(h(o,n,u.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),c({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]}),[c,i]),m=y[0],_=y[1],k=y[2];return l.useEffect((function(){return k}),[k]),t(l).createElement("div",s({},o,{onTouchStart:m,onMouseDown:m,className:"react-colorful__interactive",ref:a,onKeyDown:_,tabIndex:0,role:"slider"}))})),m=function(e){return e.filter(Boolean).join(" ")},_=function(e){var r=e.color,n=e.left,o=e.top,a=void 0===o?.5:o,i=m(["react-colorful__pointer",e.className]);return t(l).createElement("div",{className:i,style:{top:100*a+"%",left:100*n+"%"}},t(l).createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:r}}))},k=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},j={grad:.9,turn:360,rad:360/(2*Math.PI)},C=function(e){return"#"===e[0]&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}},w=function(e,t){return void 0===t&&(t="deg"),Number(e)*(j[t]||1)},A=function(e){var t=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?O({h:w(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},E=A,O=function(e){var t=e.s,r=e.l;return{h:e.h,s:(t*=(r<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}},S=function(e){var t=e.s,r=e.v,n=e.a,o=(200-t)*r/100;return{h:k(e.h),s:k(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:k(o/2),a:k(n,2)}},H=function(e){var t=S(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},R=function(e){var t=S(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},x=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),i=n*(1-r),c=n*(1-(t-a)*r),u=n*(1-(1-t+a)*r),l=a%6;return{r:k(255*[n,c,i,i,u,n][l]),g:k(255*[u,n,n,c,i,i][l]),b:k(255*[i,i,u,n,n,c][l]),a:k(o,2)}},P=function(e){var t=/hsva?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?T({h:w(t[1],t[2]),s:Number(t[3]),v:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}},M=P,N=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?I({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},B=N,z=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},I=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),c=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:k(60*(c<0?c+6:c)),s:k(a?i/a*100:0),v:k(a/255*100),a:o}},T=function(e){return{h:k(e.h),s:k(e.s),v:k(e.v),a:k(e.a,2)}},F=t(l).memo((function(e){var r=e.hue,n=e.onChange,o=m(["react-colorful__hue",e.className]);return t(l).createElement("div",{className:o},t(l).createElement(y,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:d(r+360*e.left,0,360)})},"aria-label":"Hue","aria-valuetext":k(r)},t(l).createElement(_,{className:"react-colorful__hue-pointer",left:r/360,color:H({h:r,s:100,v:100,a:1})})))})),U=t(l).memo((function(e){var r=e.hsva,n=e.onChange,o={backgroundColor:H({h:r.h,s:100,v:100,a:1})};return t(l).createElement("div",{className:"react-colorful__saturation",style:o},t(l).createElement(y,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:d(r.s+100*e.left,0,100),v:d(r.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+k(r.s)+"%, Brightness "+k(r.v)+"%"},t(l).createElement(_,{className:"react-colorful__saturation-pointer",top:1-r.v/100,left:r.s/100,color:H(r)})))})),L=function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0},D=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function W(e,t,r){var n=v(r),o=l.useState((function(){return e.toHsva(t)})),a=o[0],i=o[1],c=l.useRef({color:t,hsva:a});l.useEffect((function(){if(!e.equal(t,c.current.color)){var r=e.toHsva(t);c.current={hsva:r,color:t},i(r)}}),[t,e]),l.useEffect((function(){var t;L(a,c.current.hsva)||e.equal(t=e.fromHsva(a),c.current.color)||(c.current={hsva:a,color:t},n(t))}),[a,e,n]);var u=l.useCallback((function(e){i((function(t){return Object.assign({},t,e)}))}),[]);return[a,u]}var J,q="undefined"!=typeof window?l.useLayoutEffect:l.useEffect,K=new Map,$=function(e){q((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!K.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',K.set(t,r);var n=J||("undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0);n&&r.setAttribute("nonce",n),t.head.appendChild(r)}}),[])},G=function(e){var r=e.className,n=e.colorModel,o=e.color,a=void 0===o?n.defaultColor:o,i=e.onChange,c=f(e,["className","colorModel","color","onChange"]),u=l.useRef(null);$(u);var v=W(n,a,i),d=v[0],p=v[1],b=m(["react-colorful",r]);return t(l).createElement("div",s({},c,{ref:u,className:b}),t(l).createElement(U,{hsva:d,onChange:p}),t(l).createElement(F,{hue:d.h,onChange:p,className:"react-colorful__last-control"}))},Z={defaultColor:"000",toHsva:function(e){return I(C(e))},fromHsva:function(e){var t,r,n;return r=(t=x(e)).g,n=t.b,"#"+z(t.r)+z(r)+z(n)},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||L(C(e),C(t))}},Q=function(e){return t(l).createElement(G,s({},e,{colorModel:Z}))},V=function(e){var r=e.className,n=e.hsva,o=e.onChange,a={backgroundImage:"linear-gradient(90deg, "+R(Object.assign({},n,{a:0}))+", "+R(Object.assign({},n,{a:1}))+")"},i=m(["react-colorful__alpha",r]);return t(l).createElement("div",{className:i},t(l).createElement("div",{className:"react-colorful__alpha-gradient",style:a}),t(l).createElement(y,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:d(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":k(100*n.a)+"%"},t(l).createElement(_,{className:"react-colorful__alpha-pointer",left:n.a,color:R(n)})))},Y=function(e){var r=e.className,n=e.colorModel,o=e.color,a=void 0===o?n.defaultColor:o,i=e.onChange,c=f(e,["className","colorModel","color","onChange"]),u=l.useRef(null);$(u);var v=W(n,a,i),d=v[0],p=v[1],b=m(["react-colorful",r]);return t(l).createElement("div",s({},c,{ref:u,className:b}),t(l).createElement(U,{hsva:d,onChange:p}),t(l).createElement(F,{hue:d.h,onChange:p}),t(l).createElement(V,{hsva:d,onChange:p,className:"react-colorful__last-control"}))},X={defaultColor:{h:0,s:0,l:0,a:1},toHsva:O,fromHsva:S,equal:L},ee=function(e){return t(l).createElement(Y,s({},e,{colorModel:X}))},te={defaultColor:"hsla(0, 0%, 0%, 1)",toHsva:A,fromHsva:R,equal:D},re=function(e){return t(l).createElement(Y,s({},e,{colorModel:te}))},ne={defaultColor:{h:0,s:0,l:0},toHsva:function(e){return O({h:e.h,s:e.s,l:e.l,a:1})},fromHsva:function(e){var t;return{h:(t=S(e)).h,s:t.s,l:t.l}},equal:L},oe=function(e){return t(l).createElement(G,s({},e,{colorModel:ne}))},ae={defaultColor:"hsl(0, 0%, 0%)",toHsva:E,fromHsva:H,equal:D},ie=function(e){return t(l).createElement(G,s({},e,{colorModel:ae}))},ce={defaultColor:{h:0,s:0,v:0,a:1},toHsva:function(e){return e},fromHsva:T,equal:L},ue=function(e){return t(l).createElement(Y,s({},e,{colorModel:ce}))},le={defaultColor:"hsva(0, 0%, 0%, 1)",toHsva:P,fromHsva:function(e){var t=T(e);return"hsva("+t.h+", "+t.s+"%, "+t.v+"%, "+t.a+")"},equal:D},se=function(e){return t(l).createElement(Y,s({},e,{colorModel:le}))},fe={defaultColor:{h:0,s:0,v:0},toHsva:function(e){return{h:e.h,s:e.s,v:e.v,a:1}},fromHsva:function(e){var t=T(e);return{h:t.h,s:t.s,v:t.v}},equal:L},ve=function(e){return t(l).createElement(G,s({},e,{colorModel:fe}))},de={defaultColor:"hsv(0, 0%, 0%)",toHsva:M,fromHsva:function(e){var t=T(e);return"hsv("+t.h+", "+t.s+"%, "+t.v+"%)"},equal:D},pe=function(e){return t(l).createElement(G,s({},e,{colorModel:de}))},be={defaultColor:{r:0,g:0,b:0,a:1},toHsva:I,fromHsva:x,equal:L},he=function(e){return t(l).createElement(Y,s({},e,{colorModel:be}))},ge={defaultColor:"rgba(0, 0, 0, 1)",toHsva:N,fromHsva:function(e){var t=x(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:D},ye=function(e){return t(l).createElement(Y,s({},e,{colorModel:ge}))},me={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return I({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){var t;return{r:(t=x(e)).r,g:t.g,b:t.b}},equal:L},_e=function(e){return t(l).createElement(G,s({},e,{colorModel:me}))},ke={defaultColor:"rgb(0, 0, 0)",toHsva:B,fromHsva:function(e){var t=x(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:D},je=function(e){return t(l).createElement(G,s({},e,{colorModel:ke}))},Ce={};Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.ReactCSS=Ce.loop=Ce.handleActive=Ce.handleHover=Ce.hover=void 0;var we={};Object.defineProperty(we,"__esModule",{value:!0}),we.flattenNames=void 0;var Ae,Ee={};Ae=(dr=o("8ThvE")).Symbol;var Oe={},Se=Object.prototype,He=Se.hasOwnProperty,Re=Se.toString,xe=Ae?Ae.toStringTag:void 0;Oe=function(e){var t=He.call(e,xe),r=e[xe];try{e[xe]=void 0;var n=!0}catch(e){}var o=Re.call(e);return n&&(t?e[xe]=r:delete e[xe]),o};var Pe={},Me=Object.prototype.toString;Pe=function(e){return Me.call(e)};var Ne=Ae?Ae.toStringTag:void 0;Ee=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ne&&Ne in Object(e)?Oe(e):Pe(e)};var Be={},ze=Array.isArray;Be=ze;var Ie={};Ie=function(e){return null!=e&&"object"==typeof e};var Te,Fe=co((function(e){return"string"==typeof e||!Be(e)&&Ie(e)&&"[object String]"==Ee(e)})),Ue={},Le={};var De=function(e){return function(t,r,n){for(var o=-1,a=Object(t),i=n(t),c=i.length;c--;){var u=i[e?c:++o];if(!1===r(a[u],u,a))break}return t}}();Le=De;var We={},Je={},qe={};qe=function(e,t){for(var r=-1,n=Array(e);++r-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};var ot={};ot["[object Float32Array]"]=ot["[object Float64Array]"]=ot["[object Int8Array]"]=ot["[object Int16Array]"]=ot["[object Int32Array]"]=ot["[object Uint8Array]"]=ot["[object Uint8ClampedArray]"]=ot["[object Uint16Array]"]=ot["[object Uint32Array]"]=!0,ot["[object Arguments]"]=ot["[object Array]"]=ot["[object ArrayBuffer]"]=ot["[object Boolean]"]=ot["[object DataView]"]=ot["[object Date]"]=ot["[object Error]"]=ot["[object Function]"]=ot["[object Map]"]=ot["[object Number]"]=ot["[object Object]"]=ot["[object RegExp]"]=ot["[object Set]"]=ot["[object String]"]=ot["[object WeakMap]"]=!1,tt=function(e){return Ie(e)&&nt(e.length)&&!!ot[Ee(e)]};var at={};at=function(e){return function(t){return e(t)}};var it=(ta=o("7vc1R"))&&ta.isTypedArray,ct=it?at(it):tt;rt=ct;var ut=Object.prototype.hasOwnProperty;Je=function(e,t){var r=Be(e),n=!r&&Ke(e),o=!r&&!n&&Ye(e),a=!r&&!n&&!o&&rt(e),i=r||n||o||a,c=i?qe(e.length,String):[],u=c.length;for(var l in e)!t&&!ut.call(e,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Xe(l,u))||c.push(l);return c};var lt={},st={},ft=Object.prototype;st=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ft)};var vt={},dt={};var pt=(dt=function(e,t){return function(r){return e(t(r))}})(Object.keys,Object);vt=pt;var bt=Object.prototype.hasOwnProperty;lt=function(e){if(!st(e))return vt(e);var t=[];for(var r in Object(e))bt.call(e,r)&&"constructor"!=r&&t.push(r);return t};var ht={},gt={},yt={};yt=function(e){var t=void 0===e?"undefined":u(e);return null!=e&&("object"==t||"function"==t)};gt=function(e){if(!yt(e))return!1;var t=Ee(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},ht=function(e){return null!=e&&nt(e.length)&&!gt(e)},We=function(e){return ht(e)?Je(e):lt(e)},Ue=function(e,t){return e&&Le(e,t,We)};var mt,_t={};mt=function(e){return e},_t=function(e){return"function"==typeof e?e:mt};var kt=co(Te=function(e,t){return e&&Ue(e,_t(t))}),jt={},Ct=dt(Object.getPrototypeOf,Object);jt=Ct;var wt=Function.prototype,At=Object.prototype,Et=wt.toString,Ot=At.hasOwnProperty,St=Et.call(Object);var Ht=co((function(e){if(!Ie(e)||"[object Object]"!=Ee(e))return!1;var t=jt(e);if(null===t)return!0;var r=Ot.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Et.call(r)==St})),Rt={};Rt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r-1};var Wt;function Jt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++tc))return!1;var l=a.get(e),s=a.get(t);if(l&&s)return l==t&&s==e;var f=-1,v=!0,d=2&r?new Ur:void 0;for(a.set(e,t),a.set(t,e);++f0&&void 0!==arguments[0]?arguments[0]:[],r=[];return(0,io.default)(t,(function(t){Array.isArray(t)?e(t).map((function(e){return r.push(e)})):(0,Ht.default)(t)?(0,kt.default)(t,(function(e,t){!0===e&&r.push(t),r.push(t+"-"+e)})):(0,Fe.default)(t)&&r.push(t)})),r};we.default=uo;var lo=Ta(we),so={};Object.defineProperty(so,"__esModule",{value:!0}),so.mergeClasses=void 0;var fo=sa(Te),vo={},po={};po=function(e,t){for(var r=-1,n=null==e?0:e.length;++r1&&void 0!==arguments[1]?arguments[1]:[],r=e.default&&(0,ua.default)(e.default)||{};return t.map((function(t){var n=e[t];return n&&(0,fo.default)(n,(function(e,t){r[t]||(r[t]={}),r[t]=la({},r[t],n[t])})),t})),r};so.default=fa;var va=Ta(so),da={};Object.defineProperty(da,"__esModule",{value:!0}),da.autoprefix=void 0;var pa,ba=(pa=Te)&&pa.__esModule?pa:{default:pa},ha=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var r,o,a;Ca(this,n);for(var i=arguments.length,c=Array(i),u=0;u1&&void 0!==arguments[1]?arguments[1]:"span";return function(r){function n(){var r,o,a;xa(this,n);for(var i=arguments.length,c=Array(i),u=0;u1&&void 0!==arguments[1])||arguments[1];r[e]=t};return 0===e&&n("first-child"),e===t-1&&n("last-child"),(0===e||e%2==0)&&n("even"),1===Math.abs(e%2)&&n("odd"),n("nth-child",e),r};var Ia=Ta(za);function Ta(e){return e&&e.__esModule?e:{default:e}}Ce.hover=Oa.default,Ce.handleHover=Oa.default,Ce.handleActive=Ba.default,Ce.loop=Ia.default;var Fa=Ce.ReactCSS=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0:"number"==typeof e},Ja=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},qa=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},Ka=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},$a=function(e){return{r:qa(e.r,0,255),g:qa(e.g,0,255),b:qa(e.b,0,255),a:qa(e.a)}},Ga=function(e){return{r:Ja(e.r),g:Ja(e.g),b:Ja(e.b),a:Ja(e.a,3)}},Za=/^#([0-9a-f]{3,8})$/i,Qa=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Va=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=Math.max(t,r,n),i=a-Math.min(t,r,n),c=i?a===t?(r-n)/i:a===r?2+(n-t)/i:4+(t-r)/i:0;return{h:60*(c<0?c+6:c),s:a?i/a*100:0,v:a/255*100,a:o}},Ya=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var a=Math.floor(t),i=n*(1-r),c=n*(1-(t-a)*r),u=n*(1-(1-t+a)*r),l=a%6;return{r:255*[n,c,i,i,u,n][l],g:255*[u,n,n,c,i,i][l],b:255*[i,i,u,n,n,c][l],a:o}},Xa=function(e){return{h:Ka(e.h),s:qa(e.s,0,100),l:qa(e.l,0,100),a:qa(e.a)}},ei=function(e){return{h:Ja(e.h),s:Ja(e.s),l:Ja(e.l),a:Ja(e.a,3)}},ti=function(e){var t,r,n;return Ya((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}))},ri=function(e){var t,r,n,o;return{h:(t=Va(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a}},ni=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oi=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ai=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ii=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ci={string:[[function(e){var t=Za.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Ja(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Ja(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=ai.exec(e)||ii.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:$a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=ni.exec(e)||oi.exec(e);if(!t)return null;var r,n,o=Xa({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(Da[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ti(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=void 0===o?1:o;return Wa(t)&&Wa(r)&&Wa(n)?$a({r:Number(t),g:Number(r),b:Number(n),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,a=void 0===o?1:o;if(!Wa(t)||!Wa(r)||!Wa(n))return null;var i=Xa({h:Number(t),s:Number(r),l:Number(n),a:Number(a)});return ti(i)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,a=void 0===o?1:o;if(!Wa(t)||!Wa(r)||!Wa(n))return null;var i,c=(i={h:Number(t),s:Number(r),v:Number(n),a:Number(a)},{h:Ka(i.h),s:qa(i.s,0,100),v:qa(i.v,0,100),a:qa(i.a)});return Ya(c)},"hsv"]]},ui=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){var e,t,r,n,o,a;return t=(e=Ga(this.rgba)).r,r=e.g,n=e.b,a=(o=e.a)<1?Qa(Ja(255*o)):"","#"+Qa(t)+Qa(r)+Qa(n)+a},e.prototype.toRgb=function(){return Ga(this.rgba)},e.prototype.toRgbString=function(){var e,t,r,n,o;return t=(e=Ga(this.rgba)).r,r=e.g,n=e.b,(o=e.a)<1?"rgba("+t+", "+r+", "+n+", "+o+")":"rgb("+t+", "+r+", "+n+")"},e.prototype.toHsl=function(){return ei(ri(this.rgba))},e.prototype.toHslString=function(){var e,t,r,n,o;return t=(e=ei(ri(this.rgba))).h,r=e.s,n=e.l,(o=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+o+")":"hsl("+t+", "+r+"%, "+n+"%)"},e.prototype.toHsv=function(){var e;return e=Va(this.rgba),{h:Ja(e.h),s:Ja(e.s),v:Ja(e.v),a:Ja(e.a,3)}},e.prototype.invert=function(){var e;return pi({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a})},e.prototype.saturate=function(e){return void 0===e&&(e=.1),pi(si(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),pi(si(this.rgba,-e))},e.prototype.grayscale=function(){return pi(si(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),pi(vi(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),pi(vi(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){var t;return"number"==typeof e?pi({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Ja(this.rgba.a,3)},e.prototype.hue=function(e){var t=ri(this.rgba);return"number"==typeof e?pi({h:e,s:t.s,l:t.l,a:t.a}):Ja(t.h)},e.prototype.isEqual=function(e){return this.toHex()===pi(e).toHex()},e}(),pi=function(e){return e instanceof di?e:new di(e)},bi=function(e,t){var r;switch(t){case"HexColorPicker":default:r=pi(e).toHex();break;case"RgbColorPicker":delete(r=pi(e).toRgb()).a;break;case"RgbStringColorPicker":r=pi(e).toRgbString();break;case"RgbaColorPicker":r=pi(e).toRgb();break;case"RgbaStringColorPicker":(r=pi(e).toRgbString()).includes("rgb")&&!r.includes("rgba")&&(r=(r=r.replace("rgb","rgba")).replace(")",", 1)"));break;case"HslColorPicker":delete(r=pi(e).toHsl()).a;break;case"HslStringColorPicker":r=pi(e).toHslString();break;case"HslaColorPicker":r=pi(e).toHsl();break;case"HslaStringColorPicker":(r=pi(e).toHslString()).includes("hsl")&&!r.includes("hsla")&&(r=(r=r.replace("hsl","hsla")).replace(")",", 1)"));break;case"HsvColorPicker":delete(r=pi(e).toHsv()).a;break;case"HsvStringColorPicker":var n=pi(e).toHsv();r="hsv("+n.h+", "+n.s+"%, "+n.v+"%)";break;case"HsvaColorPicker":r=pi(e).toHsv();break;case"HsvaStringColorPicker":var o=pi(e).toHsv();r="hsva("+o.h+", "+o.s+"%, "+o.v+"%, "+o.a+")"}return r},hi=function(e,t,r){var n,o,a;switch(t){case"HexColorPicker":default:a="string"==typeof e&&e.includes("#")?e:pi(e).toHex();break;case"RgbColorPicker":delete(a=pi(e).toRgb()).a;break;case"RgbStringColorPicker":a="string"==typeof e&&e.includes("rgb(")?e:pi(e).toRgbString();break;case"RgbaColorPicker":a=pi(e).toRgb();break;case"RgbaStringColorPicker":pi(e).toRgb().a<1?a="string"==typeof e&&e.includes("rgba")?e:pi(e).toRgbString():r?(a=pi(e).toRgbString()).includes("rgb")&&!a.includes("rgba")&&(a=(a=a.replace("rgb","rgba")).replace(")",", 1)")):a="string"==typeof e&&e.includes("#")?e:pi(e).toHex();break;case"HslColorPicker":delete(a=pi(e).toHsl()).a;break;case"HslStringColorPicker":a="string"==typeof e&&e.includes("hsl(")?e:pi(e).toHslString();break;case"HslaColorPicker":a=pi(e).toHsl();break;case"HslaStringColorPicker":(a=pi(e).toHslString()).includes("hsl")&&!a.includes("hsla")&&(a=(a=a.replace("hsl","hsla")).replace(")",", 1)"));break;case"HsvColorPicker":delete(a=pi(e).toHsv()).a;break;case"HsvStringColorPicker":a="hsv("+(n=pi(e).toHsv()).h+", "+n.s+"%, "+n.v+"%)";break;case"HsvaColorPicker":a=pi(e).toHsv();break;case"HsvaStringColorPicker":a="hsva("+(o=pi(e).toHsv()).h+", "+o.s+"%, "+o.v+"%, "+o.a+")"}return a},gi=function(e,t,r){var n,o,a;switch(t){case"HexColorPicker":a="string"==typeof e&&e.includes("#")?e:pi(e).toHex();break;case"RgbColorPicker":a="string"==typeof e&&e.includes("rgb(")?e:pi(e).toRgbString();break;case"RgbStringColorPicker":a="string"==typeof e&&e.includes("rgba")?e:pi(e).toRgbString();break;case"RgbaColorPicker":pi(e).toRgb().a<1?a="string"==typeof e&&e.includes("rgba")?e:pi(e).toRgbString():(a=pi(e).toRgbString()).includes("rgb")&&!a.includes("rgba")&&(a=(a=a.replace("rgb","rgba")).replace(")",", 1)"));break;case"RgbaStringColorPicker":1!=pi(e).toRgb().a||r?(a=pi(e).toRgbString()).includes("rgb")&&!a.includes("rgba")&&(a=(a=a.replace("rgb","rgba")).replace(")",", 1)")):a="string"==typeof e&&e.includes("#")?e:pi(e).toHex();break;case"HslColorPicker":case"HslStringColorPicker":a="string"==typeof e&&e.includes("hsl(")?e:pi(e).toHslString();break;case"HslaColorPicker":case"HslaStringColorPicker":(a=pi(e).toHslString()).includes("hsl")&&!a.includes("hsla")&&(a=(a=a.replace("hsl","hsla")).replace(")",", 1)"));break;case"HsvColorPicker":case"HsvStringColorPicker":a="hsv("+(n=pi(e).toHsv()).h+", "+n.s+"%, "+n.v+"%)";break;case"HsvaColorPicker":case"HsvaStringColorPicker":a="hsva("+(o=pi(e).toHsv()).h+", "+o.s+"%, "+o.v+"%, "+o.a+")";break;default:a=pi(e).toHex()}return a},yi=function(e,t,r){l.useEffect((function(){var n=!1,o=!1,a=function(a){n&&!o&&t.current&&!t.current.contains(a.target)&&e.current&&!e.current.contains(a.target)&&r()},i=function(r){n=t.current&&e.current,o=t.current&&t.current.contains(r.target)||e.current&&e.current.contains(r.target)};return document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),document.addEventListener("click",a),function(){document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i),document.removeEventListener("click",a)}}),[t,e,r])},mi=function(e,t){l.useEffect((function(){var r=function(r){e.current&&(e.current.contains(r.target)||t())};return document.addEventListener("focus",r,!0),function(){document.removeEventListener("focus",r,!0)}}),[e,t])},_i=function(e){l.useEffect((function(){var t=function(t){e()};return window.addEventListener("resize",t,!0),function(){window.removeEventListener("resize",t,!0)}}),[e])},ki=function(e){var r=e.color,n=void 0===r?"":r,o=c(l.useState((function(){return n})),2),a=o[0],i=o[1];l.useEffect((function(){i(n)}),[n]);var u=t(Ce)({default:{triggerButton:{backgroundImage:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==")'},colorPreview:{backgroundColor:a||"transparent"}}});return React.createElement("div",{className:"kirki-trigger-circle-wrapper"},React.createElement("button",{type:"button",className:"kirki-trigger-circle",onClick:e.togglePickerHandler,style:u.triggerButton},React.createElement("div",{className:"kirki-color-preview",style:u.colorPreview})))},ji=function(e){var t=e.control,r=e.customizerSetting,n=e.useHueMode,o=e.pickerComponent,a=e.choices,i=function(){return n?0:"#000000"},u=function(e){return(e=(e=e||i())<0?0:e)>360?360:e},s=function(e){return""===e?"":n?u(e):gi(e,o,a.formComponent).replace(";","")},f=function(e){return e=e||i(),n?{h:e,s:100,l:50}:bi(e,o)},v=c(l.useState((function(){return s(e.value)})),2),d=v[0],p=v[1],b=c(l.useState((function(){return f(e.value)})),2),h=b[0],g=b[1],y=d,m=h;t.updateComponentState=function(e){var t=s(e);("string"==typeof t||n?t!==d:JSON.stringify(t)!==JSON.stringify(y))&&p(t);var r=f(e);("string"==typeof r||n?r!==h:JSON.stringify(r)!==JSON.stringify(m))&&g(r)};var _=function(e){n?(e=e.h||0===e.h?e.h:e,e=u(e)):e=function(e){return""===e?"":hi(e,o,a.formComponent)}(e),r.set(e)},k=""!==e.default&&void 0!==e.default?e.default:e.value,j=React.createElement("span",{className:"customize-control-title",dangerouslySetInnerHTML:{__html:e.label}}),C=React.createElement("span",{className:"description customize-control-description",dangerouslySetInnerHTML:{__html:e.description}});j=React.createElement("label",{className:"kirki-control-label"},e.label?j:"",e.description?C:""),j=e.label||e.description?j:"";var w,A=l.useRef(null),E=l.useRef(null),O=l.useRef(null),S=c(l.useState(!1),2),H=S[0],R=S[1],x="default"!==a.labelStyle,P=c(l.useState({}),2),M=P[0],N=P[1],B=function(){var e={};if(!x)return e;var r=window.getComputedStyle(t.container[0].parentNode).paddingLeft;r=2*parseInt(r,10),e.width=t.container[0].parentNode.getBoundingClientRect().width-r;var n=-1*(t.container[0].offsetLeft-9);return e.left=n+"px",e},z=function(){4===d.length&&d.includes("#")&&p(pi(d).toHex())},I=function(){H||(N(B()),z(),R(!0))},T=function(){H&&(R(!1),setTimeout(z,200))};switch(o){case"HexColorPicker":default:w=Q;break;case"RgbColorPicker":w=_e;break;case"RgbStringColorPicker":w=je;break;case"RgbaColorPicker":w=he;break;case"RgbaStringColorPicker":w=ye;break;case"HueColorPicker":case"HslColorPicker":w=oe;break;case"HslStringColorPicker":w=ie;break;case"HslaColorPicker":w=ee;break;case"HslaStringColorPicker":w=re;break;case"HsvColorPicker":w=ve;break;case"HsvStringColorPicker":w=pe;break;case"HsvaColorPicker":w=ue;break;case"HsvaStringColorPicker":w=se}if(_i((function(){N(B())})),mi(A,T),yi(E,O,T),jQuery.wp&&jQuery.wp.wpColorPicker){var F=jQuery.wp.wpColorPicker.prototype.options.palettes;if(Array.isArray(F)){if(F.length<8)for(var U=F.length;U<=8;U++)F.push(a.swatches[U]);a.swatches=F}}var L=React.createElement(React.Fragment,null,j,React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer})),D=n?"kirki-control-form use-hue-mode":"kirki-control-form";D+=" has-"+a.labelStyle+"-label-style";var W,J=H?o+" colorPickerContainer is-open":o+" colorPickerContainer",q=React.createElement(React.Fragment,null,React.createElement("button",{type:"button",ref:O,className:"kirki-control-reset",onClick:function(){k||(y="",m=""),_(k)},style:{display:H?"flex":"none"}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement(ki,{pickerComponent:o,useHueMode:n,color:n?pi({h:d,s:100,l:50}).toHex():d,isPickerOpen:H,togglePickerHandler:function(){H?T():I()}}));switch(a.labelStyle){case"tooltip":W=React.createElement(React.Fragment,null,q,!H&&React.createElement("div",{className:"kirki-label-tooltip"},L));break;case"top":W=React.createElement(React.Fragment,null,L,q);break;default:W=React.createElement(React.Fragment,null,React.createElement("div",{className:"kirki-control-cols"},React.createElement("div",{className:"kirki-control-left-col"},L),React.createElement("div",{className:"kirki-control-right-col"},q)))}return React.createElement(React.Fragment,null,React.createElement("div",{className:D,ref:A,tabIndex:"1"},W,React.createElement("div",{ref:E,className:J,style:M},!n&&React.createElement(La,{colors:a.swatches,onClick:function(e){_(e)}}),React.createElement(w,{color:h,onChange:function(t){e.onChange&&e.onChange(t),m=t,_(t)}}),React.createElement(Ua,{pickerComponent:o,useHueMode:n,color:d,onChange:function(e){y=e,_(e)}}))))};function Ci(){return Ci=Object.assign||function(e){for(var t=1;t true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\n","import arrayWithHoles from './_array_with_holes';\nimport iterableToArrayLimit from './_iterable_to_array';\nimport nonIterableRest from './_non_iterable_rest';\nimport unsupportedIterableToArray from './_unsupported_iterable_to_array';\n\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n","import _arrayLikeToArray from './_array_like_to_array';\n\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(n);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))\n return _arrayLikeToArray(o, minLen);\n}\n","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n","export default function _typeof(obj) {\n \"@swc/helpers - typeof\";\n return obj && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n};\n","module.exports=ReactDOM;","import { useRef } from \"react\";\n\n// Saves incoming handler to the ref in order to avoid \"useCallback hell\"\nexport function useEventCallback(handler?: (value: T) => void): (value: T) => void {\n const callbackRef = useRef(handler);\n const fn = useRef((value: T) => {\n callbackRef.current && callbackRef.current(value);\n });\n callbackRef.current = handler;\n\n return fn.current;\n}\n","module.exports=React;","// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number: number, min = 0, max = 1): number => {\n return number > max ? max : number < min ? min : number;\n};\n","import React, { useRef, useMemo, useEffect } from \"react\";\n\nimport { useEventCallback } from \"../../hooks/useEventCallback\";\nimport { clamp } from \"../../utils/clamp\";\n\nexport interface Interaction {\n left: number;\n top: number;\n}\n\n// Check if an event was triggered by touch\nconst isTouch = (event: MouseEvent | TouchEvent): event is TouchEvent => \"touches\" in event;\n\n// Finds a proper touch point by its identifier\nconst getTouchPoint = (touches: TouchList, touchId: null | number): Touch => {\n for (let i = 0; i < touches.length; i++) {\n if (touches[i].identifier === touchId) return touches[i];\n }\n return touches[0];\n};\n\n// Finds the proper window object to fix iframe embedding issues\nconst getParentWindow = (node?: HTMLDivElement | null): Window => {\n return (node && node.ownerDocument.defaultView) || self;\n};\n\n// Returns a relative position of the pointer inside the node's bounding box\nconst getRelativePosition = (\n node: HTMLDivElement,\n event: MouseEvent | TouchEvent,\n touchId: null | number\n): Interaction => {\n const rect = node.getBoundingClientRect();\n\n // Get user's pointer position from `touches` array if it's a `TouchEvent`\n const pointer = isTouch(event) ? getTouchPoint(event.touches, touchId) : (event as MouseEvent);\n\n return {\n left: clamp((pointer.pageX - (rect.left + getParentWindow(node).pageXOffset)) / rect.width),\n top: clamp((pointer.pageY - (rect.top + getParentWindow(node).pageYOffset)) / rect.height),\n };\n};\n\n// Browsers introduced an intervention, making touch events passive by default.\n// This workaround removes `preventDefault` call from the touch handlers.\n// https://github.com/facebook/react/issues/19651\nconst preventDefaultMove = (event: MouseEvent | TouchEvent): void => {\n !isTouch(event) && event.preventDefault();\n};\n\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isInvalid = (event: MouseEvent | TouchEvent, hasTouch: boolean): boolean => {\n return hasTouch && !isTouch(event);\n};\n\ninterface Props {\n onMove: (interaction: Interaction) => void;\n onKey: (offset: Interaction) => void;\n children: React.ReactNode;\n}\n\nconst InteractiveBase = ({ onMove, onKey, ...rest }: Props) => {\n const container = useRef(null);\n const onMoveCallback = useEventCallback(onMove);\n const onKeyCallback = useEventCallback(onKey);\n const touchId = useRef(null);\n const hasTouch = useRef(false);\n\n const [handleMoveStart, handleKeyDown, toggleDocumentEvents] = useMemo(() => {\n const handleMoveStart = ({ nativeEvent }: React.MouseEvent | React.TouchEvent) => {\n const el = container.current;\n if (!el) return;\n\n // Prevent text selection\n preventDefaultMove(nativeEvent);\n\n if (isInvalid(nativeEvent, hasTouch.current) || !el) return;\n\n if (isTouch(nativeEvent)) {\n hasTouch.current = true;\n const changedTouches = nativeEvent.changedTouches || [];\n if (changedTouches.length) touchId.current = changedTouches[0].identifier;\n }\n\n el.focus();\n onMoveCallback(getRelativePosition(el, nativeEvent, touchId.current));\n toggleDocumentEvents(true);\n };\n\n const handleMove = (event: MouseEvent | TouchEvent) => {\n // Prevent text selection\n preventDefaultMove(event);\n\n // If user moves the pointer outside of the window or iframe bounds and release it there,\n // `mouseup`/`touchend` won't be fired. In order to stop the picker from following the cursor\n // after the user has moved the mouse/finger back to the document, we check `event.buttons`\n // and `event.touches`. It allows us to detect that the user is just moving his pointer\n // without pressing it down\n const isDown = isTouch(event) ? event.touches.length > 0 : event.buttons > 0;\n\n if (isDown && container.current) {\n onMoveCallback(getRelativePosition(container.current, event, touchId.current));\n } else {\n toggleDocumentEvents(false);\n }\n };\n\n const handleMoveEnd = () => toggleDocumentEvents(false);\n\n const handleKeyDown = (event: React.KeyboardEvent) => {\n const keyCode = event.which || event.keyCode;\n\n // Ignore all keys except arrow ones\n if (keyCode < 37 || keyCode > 40) return;\n // Do not scroll page by arrow keys when document is focused on the element\n event.preventDefault();\n // Send relative offset to the parent component.\n // We use codes (37←, 38↑, 39→, 40↓) instead of keys ('ArrowRight', 'ArrowDown', etc)\n // to reduce the size of the library\n onKeyCallback({\n left: keyCode === 39 ? 0.05 : keyCode === 37 ? -0.05 : 0,\n top: keyCode === 40 ? 0.05 : keyCode === 38 ? -0.05 : 0,\n });\n };\n\n function toggleDocumentEvents(state?: boolean) {\n const touch = hasTouch.current;\n const el = container.current;\n const parentWindow = getParentWindow(el);\n\n // Add or remove additional pointer event listeners\n const toggleEvent = state ? parentWindow.addEventListener : parentWindow.removeEventListener;\n toggleEvent(touch ? \"touchmove\" : \"mousemove\", handleMove);\n toggleEvent(touch ? \"touchend\" : \"mouseup\", handleMoveEnd);\n }\n\n return [handleMoveStart, handleKeyDown, toggleDocumentEvents];\n }, [onKeyCallback, onMoveCallback]);\n\n // Remove window event listeners before unmounting\n useEffect(() => toggleDocumentEvents, [toggleDocumentEvents]);\n\n return (\n \n );\n};\n\nexport const Interactive = React.memo(InteractiveBase);\n","export const formatClassName = (names: unknown[]): string => names.filter(Boolean).join(\" \");\n","import React from \"react\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props {\n className?: string;\n top?: number;\n left: number;\n color: string;\n}\n\nexport const Pointer = ({ className, color, left, top = 0.5 }: Props): JSX.Element => {\n const nodeClassName = formatClassName([\"react-colorful__pointer\", className]);\n\n const style = {\n top: `${top * 100}%`,\n left: `${left * 100}%`,\n };\n\n return (\n
    \n
    \n
    \n );\n};\n","export const round = (number: number, digits = 0, base = Math.pow(10, digits)): number => {\n return Math.round(base * number) / base;\n};\n","import { round } from \"./round\";\nimport { RgbaColor, RgbColor, HslaColor, HslColor, HsvaColor, HsvColor } from \"../types\";\n\n/**\n * Valid CSS units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits: Record = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2),\n};\n\nexport const hexToHsva = (hex: string): HsvaColor => rgbaToHsva(hexToRgba(hex));\n\nexport const hexToRgba = (hex: string): RgbaColor => {\n if (hex[0] === \"#\") hex = hex.substr(1);\n\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: 1,\n };\n }\n\n return {\n r: parseInt(hex.substr(0, 2), 16),\n g: parseInt(hex.substr(2, 2), 16),\n b: parseInt(hex.substr(4, 2), 16),\n a: 1,\n };\n};\n\nexport const parseHue = (value: string, unit = \"deg\"): number => {\n return Number(value) * (angleUnits[unit] || 1);\n};\n\nexport const hslaStringToHsva = (hslString: string): HsvaColor => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hslStringToHsva = hslaStringToHsva;\n\nexport const hslaToHsva = ({ h, s, l, a }: HslaColor): HsvaColor => {\n s *= (l < 50 ? l : 100 - l) / 100;\n\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a,\n };\n};\n\nexport const hsvaToHex = (hsva: HsvaColor): string => rgbaToHex(hsvaToRgba(hsva));\n\nexport const hsvaToHsla = ({ h, s, v, a }: HsvaColor): HslaColor => {\n const hh = ((200 - s) * v) / 100;\n\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToHslString = (hsva: HsvaColor): string => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\n\nexport const hsvaToHsvString = (hsva: HsvaColor): string => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\n\nexport const hsvaToHsvaString = (hsva: HsvaColor): string => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\n\nexport const hsvaToHslaString = (hsva: HsvaColor): string => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\n\nexport const hsvaToRgba = ({ h, s, v, a }: HsvaColor): RgbaColor => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n\n const hh = Math.floor(h),\n b = v * (1 - s),\n c = v * (1 - (h - hh) * s),\n d = v * (1 - (1 - h + hh) * s),\n module = hh % 6;\n\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2),\n };\n};\n\nexport const hsvaToRgbString = (hsva: HsvaColor): string => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\n\nexport const hsvaToRgbaString = (hsva: HsvaColor): string => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\n\nexport const hsvaStringToHsva = (hsvString: string): HsvaColor => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1),\n });\n};\n\nexport const hsvStringToHsva = hsvaStringToHsva;\n\nexport const rgbaStringToHsva = (rgbaString: string): HsvaColor => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n\n if (!match) return { h: 0, s: 0, v: 0, a: 1 };\n\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1),\n });\n};\n\nexport const rgbStringToHsva = rgbaStringToHsva;\n\nconst format = (number: number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? \"0\" + hex : hex;\n};\n\nexport const rgbaToHex = ({ r, g, b }: RgbaColor): string => {\n return \"#\" + format(r) + format(g) + format(b);\n};\n\nexport const rgbaToHsva = ({ r, g, b, a }: RgbaColor): HsvaColor => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a,\n };\n};\n\nexport const roundHsva = (hsva: HsvaColor): HsvaColor => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2),\n});\n\nexport const rgbaToRgb = ({ r, g, b }: RgbaColor): RgbColor => ({ r, g, b });\n\nexport const hslaToHsl = ({ h, s, l }: HslaColor): HslColor => ({ h, s, l });\n\nexport const hsvaToHsv = (hsva: HsvaColor): HsvColor => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n","import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n className?: string;\n hue: number;\n onChange: (newHue: { h: number }) => void;\n}\n\nconst HueBase = ({ className, hue, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({ h: 360 * interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n onChange({\n h: clamp(hue + offset.left * 360, 0, 360),\n });\n };\n\n const nodeClassName = formatClassName([\"react-colorful__hue\", className]);\n\n return (\n
    \n \n \n \n
    \n );\n};\n\nexport const Hue = React.memo(HueBase);\n","import React from \"react\";\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\nimport { HsvaColor } from \"../../types\";\nimport { hsvaToHslString } from \"../../utils/convert\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\n\ninterface Props {\n hsva: HsvaColor;\n onChange: (newColor: { s: number; v: number }) => void;\n}\n\nconst SaturationBase = ({ hsva, onChange }: Props) => {\n const handleMove = (interaction: Interaction) => {\n onChange({\n s: interaction.left * 100,\n v: 100 - interaction.top * 100,\n });\n };\n\n const handleKey = (offset: Interaction) => {\n // Saturation and brightness always fit into [0, 100] range\n onChange({\n s: clamp(hsva.s + offset.left * 100, 0, 100),\n v: clamp(hsva.v - offset.top * 100, 0, 100),\n });\n };\n\n const containerStyle = {\n backgroundColor: hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 }),\n };\n\n return (\n
    \n \n \n \n
    \n );\n};\n\nexport const Saturation = React.memo(SaturationBase);\n","import { hexToRgba } from \"./convert\";\nimport { ObjectColor } from \"../types\";\n\nexport const equalColorObjects = (first: ObjectColor, second: ObjectColor): boolean => {\n if (first === second) return true;\n\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (\n ((first as unknown) as Record)[prop] !==\n ((second as unknown) as Record)[prop]\n )\n return false;\n }\n\n return true;\n};\n\nexport const equalColorString = (first: string, second: string): boolean => {\n return first.replace(/\\s/g, \"\") === second.replace(/\\s/g, \"\");\n};\n\nexport const equalHex = (first: string, second: string): boolean => {\n if (first.toLowerCase() === second.toLowerCase()) return true;\n\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n","import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { ColorModel, AnyColor, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { useEventCallback } from \"./useEventCallback\";\n\nexport function useColorManipulation(\n colorModel: ColorModel,\n color: T,\n onChange?: (color: T) => void\n): [HsvaColor, (color: Partial) => void] {\n // Save onChange callback in the ref for avoiding \"useCallback hell\"\n const onChangeCallback = useEventCallback(onChange);\n\n // No matter which color model is used (HEX, RGB(A) or HSL(A)),\n // all internal calculations are based on HSVA model\n const [hsva, updateHsva] = useState(() => colorModel.toHsva(color));\n\n // By using this ref we're able to prevent extra updates\n // and the effects recursion during the color conversion\n const cache = useRef({ color, hsva });\n\n // Update local HSVA-value if `color` property value is changed,\n // but only if that's not the same color that we just sent to the parent\n useEffect(() => {\n if (!colorModel.equal(color, cache.current.color)) {\n const newHsva = colorModel.toHsva(color);\n cache.current = { hsva: newHsva, color };\n updateHsva(newHsva);\n }\n }, [color, colorModel]);\n\n // Trigger `onChange` callback only if an updated color is different from cached one;\n // save the new color to the ref to prevent unnecessary updates\n useEffect(() => {\n let newColor;\n if (\n !equalColorObjects(hsva, cache.current.hsva) &&\n !colorModel.equal((newColor = colorModel.fromHsva(hsva)), cache.current.color)\n ) {\n cache.current = { hsva, color: newColor };\n onChangeCallback(newColor);\n }\n }, [hsva, colorModel, onChangeCallback]);\n\n // Merge the current HSVA color object with updated params.\n // For example, when a child component sends `h` or `s` only\n const handleChange = useCallback((params: Partial) => {\n updateHsva((current) => Object.assign({}, current, params));\n }, []);\n\n return [hsva, handleChange];\n}\n","declare const __webpack_nonce__: string | undefined;\nlet nonce: string | undefined;\n\n/**\n * Returns a nonce hash included by Webpack or the one defined manually by developer.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce\n * https://webpack.js.org/guides/csp/\n */\nexport const getNonce = (): string | undefined => {\n if (nonce) return nonce;\n if (typeof __webpack_nonce__ !== \"undefined\") return __webpack_nonce__;\n return undefined;\n};\n\n/**\n * Signs the style tag with a base64-encoded string (nonce) to conforms to Content Security Policies.\n * This function has to be invoked before any picker is rendered if you aren't using Webpack for CSP.\n */\nexport const setNonce = (hash: string): void => {\n nonce = hash;\n};\n","import { useLayoutEffect, useEffect } from \"react\";\n\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n","import { RefObject } from \"react\";\n\nimport { useIsomorphicLayoutEffect } from \"./useIsomorphicLayoutEffect\";\nimport { getNonce } from \"../utils/nonce\";\n\n// Bundler is configured to load this as a processed minified CSS-string\nimport styles from \"../css/styles.css\";\n\nconst styleElementMap: Map = new Map();\n\n/**\n * Injects CSS code into the document's \n */\nexport const useStyleSheet = (nodeRef: RefObject): void => {\n useIsomorphicLayoutEffect(() => {\n const parentDocument = nodeRef.current ? nodeRef.current.ownerDocument : document;\n\n if (typeof parentDocument !== \"undefined\" && !styleElementMap.has(parentDocument)) {\n const styleElement = parentDocument.createElement(\"style\");\n styleElement.innerHTML = styles;\n styleElementMap.set(parentDocument, styleElement);\n\n // Conform to CSP rules by setting `nonce` attribute to the inline styles\n const nonce = getNonce();\n if (nonce) styleElement.setAttribute(\"nonce\", nonce);\n\n parentDocument.head.appendChild(styleElement);\n }\n }, []);\n};\n","import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props extends Partial> {\n colorModel: ColorModel;\n}\n\nexport const ColorPicker = ({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props): JSX.Element => {\n const nodeRef = useRef(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n
    \n \n \n
    \n );\n};\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalHex } from \"../utils/compare\";\nimport { hexToHsva, hsvaToHex } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"000\",\n toHsva: hexToHsva,\n fromHsva: hsvaToHex,\n equal: equalHex,\n};\n\nexport const HexColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { Interactive, Interaction } from \"./Interactive\";\nimport { Pointer } from \"./Pointer\";\n\nimport { hsvaToHslaString } from \"../../utils/convert\";\nimport { formatClassName } from \"../../utils/format\";\nimport { clamp } from \"../../utils/clamp\";\nimport { round } from \"../../utils/round\";\nimport { HsvaColor } from \"../../types\";\n\ninterface Props {\n className?: string;\n hsva: HsvaColor;\n onChange: (newAlpha: { a: number }) => void;\n}\n\nexport const Alpha = ({ className, hsva, onChange }: Props): JSX.Element => {\n const handleMove = (interaction: Interaction) => {\n onChange({ a: interaction.left });\n };\n\n const handleKey = (offset: Interaction) => {\n // Alpha always fit into [0, 1] range\n onChange({ a: clamp(hsva.a + offset.left) });\n };\n\n // We use `Object.assign` instead of the spread operator\n // to prevent adding the polyfill (about 150 bytes gzipped)\n const colorFrom = hsvaToHslaString(Object.assign({}, hsva, { a: 0 }));\n const colorTo = hsvaToHslaString(Object.assign({}, hsva, { a: 1 }));\n\n const gradientStyle = {\n backgroundImage: `linear-gradient(90deg, ${colorFrom}, ${colorTo})`,\n };\n\n const nodeClassName = formatClassName([\"react-colorful__alpha\", className]);\n\n return (\n
    \n
    \n \n \n \n
    \n );\n};\n","import React, { useRef } from \"react\";\n\nimport { Hue } from \"./Hue\";\nimport { Saturation } from \"./Saturation\";\nimport { Alpha } from \"./Alpha\";\n\nimport { ColorModel, ColorPickerBaseProps, AnyColor } from \"../../types\";\nimport { useColorManipulation } from \"../../hooks/useColorManipulation\";\nimport { useStyleSheet } from \"../../hooks/useStyleSheet\";\nimport { formatClassName } from \"../../utils/format\";\n\ninterface Props extends Partial> {\n colorModel: ColorModel;\n}\n\nexport const AlphaColorPicker = ({\n className,\n colorModel,\n color = colorModel.defaultColor,\n onChange,\n ...rest\n}: Props): JSX.Element => {\n const nodeRef = useRef(null);\n useStyleSheet(nodeRef);\n\n const [hsva, updateHsva] = useColorManipulation(colorModel, color, onChange);\n\n const nodeClassName = formatClassName([\"react-colorful\", className]);\n\n return (\n
    \n \n \n \n
    \n );\n};\n","import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HslaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hslaToHsva, hsvaToHsla } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, l: 0, a: 1 },\n toHsva: hslaToHsva,\n fromHsva: hsvaToHsla,\n equal: equalColorObjects,\n};\n\nexport const HslaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hslaStringToHsva, hsvaToHslaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsla(0, 0%, 0%, 1)\",\n toHsva: hslaStringToHsva,\n fromHsva: hsvaToHslaString,\n equal: equalColorString,\n};\n\nexport const HslaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HslColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hslaToHsva, hsvaToHsla, hslaToHsl } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, l: 0 },\n toHsva: ({ h, s, l }) => hslaToHsva({ h, s, l, a: 1 }),\n fromHsva: (hsva) => hslaToHsl(hsvaToHsla(hsva)),\n equal: equalColorObjects,\n};\n\nexport const HslColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hslStringToHsva, hsvaToHslString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsl(0, 0%, 0%)\",\n toHsva: hslStringToHsva,\n fromHsva: hsvaToHslString,\n equal: equalColorString,\n};\n\nexport const HslStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HsvaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { roundHsva } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, v: 0, a: 1 },\n toHsva: (hsva) => hsva,\n fromHsva: roundHsva,\n equal: equalColorObjects,\n};\n\nexport const HsvaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hsvaStringToHsva, hsvaToHsvaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsva(0, 0%, 0%, 1)\",\n toHsva: hsvaStringToHsva,\n fromHsva: hsvaToHsvaString,\n equal: equalColorString,\n};\n\nexport const HsvaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, HsvColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { hsvaToHsv } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { h: 0, s: 0, v: 0 },\n toHsva: ({ h, s, v }) => ({ h, s, v, a: 1 }),\n fromHsva: hsvaToHsv,\n equal: equalColorObjects,\n};\n\nexport const HsvColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { hsvStringToHsva, hsvaToHsvString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"hsv(0, 0%, 0%)\",\n toHsva: hsvStringToHsva,\n fromHsva: hsvaToHsvString,\n equal: equalColorString,\n};\n\nexport const HsvStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, RgbaColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { rgbaToHsva, hsvaToRgba } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { r: 0, g: 0, b: 0, a: 1 },\n toHsva: rgbaToHsva,\n fromHsva: hsvaToRgba,\n equal: equalColorObjects,\n};\n\nexport const RgbaColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { AlphaColorPicker } from \"./common/AlphaColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { rgbaStringToHsva, hsvaToRgbaString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"rgba(0, 0, 0, 1)\",\n toHsva: rgbaStringToHsva,\n fromHsva: hsvaToRgbaString,\n equal: equalColorString,\n};\n\nexport const RgbaStringColorPicker = (\n props: Partial>\n): JSX.Element => ;\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps, RgbColor } from \"../types\";\nimport { equalColorObjects } from \"../utils/compare\";\nimport { rgbaToHsva, hsvaToRgba, rgbaToRgb } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: { r: 0, g: 0, b: 0 },\n toHsva: ({ r, g, b }) => rgbaToHsva({ r, g, b, a: 1 }),\n fromHsva: (hsva) => rgbaToRgb(hsvaToRgba(hsva)),\n equal: equalColorObjects,\n};\n\nexport const RgbColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","import React from \"react\";\n\nimport { ColorPicker } from \"./common/ColorPicker\";\nimport { ColorModel, ColorPickerBaseProps } from \"../types\";\nimport { equalColorString } from \"../utils/compare\";\nimport { rgbStringToHsva, hsvaToRgbString } from \"../utils/convert\";\n\nconst colorModel: ColorModel = {\n defaultColor: \"rgb(0, 0, 0)\",\n toHsva: rgbStringToHsva,\n fromHsva: hsvaToRgbString,\n equal: equalColorString,\n};\n\nexport const RgbStringColorPicker = (props: Partial>): JSX.Element => (\n \n);\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ReactCSS = exports.loop = exports.handleActive = exports.handleHover = exports.hover = undefined;\n\nvar _flattenNames = require('./flattenNames');\n\nvar _flattenNames2 = _interopRequireDefault(_flattenNames);\n\nvar _mergeClasses = require('./mergeClasses');\n\nvar _mergeClasses2 = _interopRequireDefault(_mergeClasses);\n\nvar _autoprefix = require('./autoprefix');\n\nvar _autoprefix2 = _interopRequireDefault(_autoprefix);\n\nvar _hover2 = require('./components/hover');\n\nvar _hover3 = _interopRequireDefault(_hover2);\n\nvar _active = require('./components/active');\n\nvar _active2 = _interopRequireDefault(_active);\n\nvar _loop2 = require('./loop');\n\nvar _loop3 = _interopRequireDefault(_loop2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.hover = _hover3.default;\nexports.handleHover = _hover3.default;\nexports.handleActive = _active2.default;\nexports.loop = _loop3.default;\nvar ReactCSS = exports.ReactCSS = function ReactCSS(classes) {\n for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n activations[_key - 1] = arguments[_key];\n }\n\n var activeNames = (0, _flattenNames2.default)(activations);\n var merged = (0, _mergeClasses2.default)(classes, activeNames);\n return (0, _autoprefix2.default)(merged);\n};\n\nexports.default = ReactCSS;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.flattenNames = undefined;\n\nvar _isString2 = require('lodash/isString');\n\nvar _isString3 = _interopRequireDefault(_isString2);\n\nvar _forOwn2 = require('lodash/forOwn');\n\nvar _forOwn3 = _interopRequireDefault(_forOwn2);\n\nvar _isPlainObject2 = require('lodash/isPlainObject');\n\nvar _isPlainObject3 = _interopRequireDefault(_isPlainObject2);\n\nvar _map2 = require('lodash/map');\n\nvar _map3 = _interopRequireDefault(_map2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar flattenNames = exports.flattenNames = function flattenNames() {\n var things = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n var names = [];\n\n (0, _map3.default)(things, function (thing) {\n if (Array.isArray(thing)) {\n flattenNames(thing).map(function (name) {\n return names.push(name);\n });\n } else if ((0, _isPlainObject3.default)(thing)) {\n (0, _forOwn3.default)(thing, function (value, key) {\n value === true && names.push(key);\n names.push(key + '-' + value);\n });\n } else if ((0, _isString3.default)(thing)) {\n names.push(thing);\n }\n });\n\n return names;\n};\n\nexports.default = flattenNames;","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var identity = require('./identity');\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n","var baseForOwn = require('./_baseForOwn'),\n castFunction = require('./_castFunction');\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, castFunction(iteratee));\n}\n\nmodule.exports = forOwn;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n isArray = require('./isArray');\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, baseIteratee(iteratee, 3));\n}\n\nmodule.exports = map;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.mergeClasses = undefined;\n\nvar _forOwn2 = require('lodash/forOwn');\n\nvar _forOwn3 = _interopRequireDefault(_forOwn2);\n\nvar _cloneDeep2 = require('lodash/cloneDeep');\n\nvar _cloneDeep3 = _interopRequireDefault(_cloneDeep2);\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar mergeClasses = exports.mergeClasses = function mergeClasses(classes) {\n var activeNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n var styles = classes.default && (0, _cloneDeep3.default)(classes.default) || {};\n activeNames.map(function (name) {\n var toMerge = classes[name];\n if (toMerge) {\n (0, _forOwn3.default)(toMerge, function (value, key) {\n if (!styles[key]) {\n styles[key] = {};\n }\n\n styles[key] = _extends({}, styles[key], toMerge[key]);\n });\n }\n\n return name;\n });\n return styles;\n};\n\nexports.default = mergeClasses;","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.autoprefix = undefined;\n\nvar _forOwn2 = require('lodash/forOwn');\n\nvar _forOwn3 = _interopRequireDefault(_forOwn2);\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar transforms = {\n borderRadius: function borderRadius(value) {\n return {\n msBorderRadius: value,\n MozBorderRadius: value,\n OBorderRadius: value,\n WebkitBorderRadius: value,\n borderRadius: value\n };\n },\n boxShadow: function boxShadow(value) {\n return {\n msBoxShadow: value,\n MozBoxShadow: value,\n OBoxShadow: value,\n WebkitBoxShadow: value,\n boxShadow: value\n };\n },\n userSelect: function userSelect(value) {\n return {\n WebkitTouchCallout: value,\n KhtmlUserSelect: value,\n MozUserSelect: value,\n msUserSelect: value,\n WebkitUserSelect: value,\n userSelect: value\n };\n },\n\n flex: function flex(value) {\n return {\n WebkitBoxFlex: value,\n MozBoxFlex: value,\n WebkitFlex: value,\n msFlex: value,\n flex: value\n };\n },\n flexBasis: function flexBasis(value) {\n return {\n WebkitFlexBasis: value,\n flexBasis: value\n };\n },\n justifyContent: function justifyContent(value) {\n return {\n WebkitJustifyContent: value,\n justifyContent: value\n };\n },\n\n transition: function transition(value) {\n return {\n msTransition: value,\n MozTransition: value,\n OTransition: value,\n WebkitTransition: value,\n transition: value\n };\n },\n\n transform: function transform(value) {\n return {\n msTransform: value,\n MozTransform: value,\n OTransform: value,\n WebkitTransform: value,\n transform: value\n };\n },\n absolute: function absolute(value) {\n var direction = value && value.split(' ');\n return {\n position: 'absolute',\n top: direction && direction[0],\n right: direction && direction[1],\n bottom: direction && direction[2],\n left: direction && direction[3]\n };\n },\n extend: function extend(name, otherElementStyles) {\n var otherStyle = otherElementStyles[name];\n if (otherStyle) {\n return otherStyle;\n }\n return {\n 'extend': name\n };\n }\n};\n\nvar autoprefix = exports.autoprefix = function autoprefix(elements) {\n var prefixed = {};\n (0, _forOwn3.default)(elements, function (styles, element) {\n var expanded = {};\n (0, _forOwn3.default)(styles, function (value, key) {\n var transform = transforms[key];\n if (transform) {\n expanded = _extends({}, expanded, transform(value));\n } else {\n expanded[key] = value;\n }\n });\n prefixed[element] = expanded;\n });\n return prefixed;\n};\n\nexports.default = autoprefix;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hover = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar hover = exports.hover = function hover(Component) {\n var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span';\n\n return function (_React$Component) {\n _inherits(Hover, _React$Component);\n\n function Hover() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Hover);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Hover.__proto__ || Object.getPrototypeOf(Hover)).call.apply(_ref, [this].concat(args))), _this), _this.state = { hover: false }, _this.handleMouseOver = function () {\n return _this.setState({ hover: true });\n }, _this.handleMouseOut = function () {\n return _this.setState({ hover: false });\n }, _this.render = function () {\n return _react2.default.createElement(\n Span,\n { onMouseOver: _this.handleMouseOver, onMouseOut: _this.handleMouseOut },\n _react2.default.createElement(Component, _extends({}, _this.props, _this.state))\n );\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n return Hover;\n }(_react2.default.Component);\n};\n\nexports.default = hover;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.active = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar active = exports.active = function active(Component) {\n var Span = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'span';\n\n return function (_React$Component) {\n _inherits(Active, _React$Component);\n\n function Active() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Active);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Active.__proto__ || Object.getPrototypeOf(Active)).call.apply(_ref, [this].concat(args))), _this), _this.state = { active: false }, _this.handleMouseDown = function () {\n return _this.setState({ active: true });\n }, _this.handleMouseUp = function () {\n return _this.setState({ active: false });\n }, _this.render = function () {\n return _react2.default.createElement(\n Span,\n { onMouseDown: _this.handleMouseDown, onMouseUp: _this.handleMouseUp },\n _react2.default.createElement(Component, _extends({}, _this.props, _this.state))\n );\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n return Active;\n }(_react2.default.Component);\n};\n\nexports.default = active;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar loopable = function loopable(i, length) {\n var props = {};\n var setProp = function setProp(name) {\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n props[name] = value;\n };\n\n i === 0 && setProp('first-child');\n i === length - 1 && setProp('last-child');\n (i === 0 || i % 2 === 0) && setProp('even');\n Math.abs(i % 2) === 1 && setProp('odd');\n setProp('nth-child', i);\n\n return props;\n};\n\nexports.default = loopable;","import { useState, useEffect, useCallback } from \"react\";\nimport reactCSS from \"reactcss\";\n\nconst KirkiReactColorfulInput = (props) => {\n\tconst { onChange, color = \"\" } = props;\n\tconst [value, setValue] = useState(() => color);\n\n\tconst handleChange = useCallback(\n\t\t(e) => {\n\t\t\tlet val = e.target.value;\n\n\t\t\tif (2 === val.length) {\n\t\t\t\tif (!val.includes(\"#\") && !val.includes(\"rg\") && !val.includes(\"hs\")) {\n\t\t\t\t\tval = \"#\" + val;\n\t\t\t\t}\n\t\t\t} else if (3 === val.length || 6 === val.length) {\n\t\t\t\tif (!val.includes(\"#\") && !val.includes(\"rg\") && !val.includes(\"hs\")) {\n\t\t\t\t\tval = \"#\" + val;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tval = val.toLowerCase();\n\n\t\t\t// Thank you: https://regexr.com/39cgj\n\t\t\tconst pattern = new RegExp(\n\t\t\t\t/(?:#|0x)(?:[a-f0-9]{3}|[a-f0-9]{6}|[a-f0-9]{8})\\b|(?:rgb|hsl)a?\\([^\\)]*\\)/\n\t\t\t);\n\n\t\t\tif (\"\" === val || pattern.test(val)) {\n\t\t\t\tonChange(val); // Run onChange handler passed by `KirkiReactColorfulForm` component.\n\t\t\t}\n\n\t\t\tsetValue(val);\n\t\t},\n\t\t[onChange]\n\t);\n\n\t// Update the local state when `color` property value is changed.\n\tuseEffect(() => {\n\t\t// We don't need to convert the color since it's already handled in parent component.\n\t\tsetValue(color);\n\t}, [color]);\n\n\tconst pickersWithAlpha = [\n\t\t\"RgbaColorPicker\",\n\t\t\"RgbaStringColorPicker\",\n\t\t\"HslaColorPicker\",\n\t\t\"HslaStringColorPicker\",\n\t\t\"HsvaColorPicker\",\n\t\t\"HsvaStringColorPicker\",\n\t];\n\n\tconst styles = reactCSS({\n\t\tdefault: {\n\t\t\tcolorPreviewWrapper: {\n\t\t\t\tbackgroundImage: pickersWithAlpha.includes(props.pickerComponent)\n\t\t\t\t\t? 'url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==\")'\n\t\t\t\t\t: \"none\",\n\t\t\t},\n\t\t\tcolorPreview: {\n\t\t\t\tbackgroundColor: value,\n\t\t\t},\n\t\t},\n\t});\n\n\treturn (\n\t\t
    \n\t\t\t
    \n\t\t\t\t{!props.useHueMode && (\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t)}\n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t);\n};\n\nexport default KirkiReactColorfulInput;\n","const KirkiReactColorfulSwatches = ({ colors, onClick }) => {\n\treturn (\n\t\t
    \n\t\t\t{colors.map((clr, index) => {\n\t\t\t\tconst color = clr && clr.color ? clr.color : clr;\n\n\t\t\t\treturn (\n\t\t\t\t\t onClick(color)}\n\t\t\t\t\t>\n\t\t\t\t);\n\t\t\t})}\n\t\t
    \n\t);\n};\n\nexport default KirkiReactColorfulSwatches;\n","var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return\"string\"==typeof r?r.length>0:\"number\"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?\"0\"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,p=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,v=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,m=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},\"hex\"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},\"rgb\"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u=\"deg\"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},\"hsl\"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},\"rgb\"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},\"hsl\"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},\"hsv\"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):\"\",\"#\"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?\"rgba(\"+t+\", \"+n+\", \"+e+\", \"+u+\")\":\"rgb(\"+t+\", \"+n+\", \"+e+\")\";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?\"hsla(\"+t+\", \"+n+\"%, \"+e+\"%, \"+u+\")\":\"hsl(\"+t+\", \"+n+\"%, \"+e+\"%)\";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return\"number\"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return\"number\"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};export{j as Colord,w as colord,k as extend,I as getFormat,E as random};\n","import { colord } from \"colord\";\n\n/**\n * Convert the value for the color picker.\n *\n * @param {string|Object} value The value to be converted.\n * @param {string} pickerComponent The picker component name.\n *\n * @returns {string|Object} The converted value.\n */\nconst convertColorForPicker = (value, pickerComponent) => {\n\tlet convertedValue;\n\n\tswitch (pickerComponent) {\n\t\tcase \"HexColorPicker\":\n\t\t\tconvertedValue = colord(value).toHex();\n\t\t\tbreak;\n\n\t\tcase \"RgbColorPicker\":\n\t\t\tconvertedValue = colord(value).toRgb();\n\t\t\tdelete convertedValue.a;\n\t\t\tbreak;\n\n\t\tcase \"RgbStringColorPicker\":\n\t\t\tconvertedValue = colord(value).toRgbString();\n\t\t\tbreak;\n\n\t\tcase \"RgbaColorPicker\":\n\t\t\tconvertedValue = colord(value).toRgb();\n\t\t\tbreak;\n\n\t\tcase \"RgbaStringColorPicker\":\n\t\t\tconvertedValue = colord(value).toRgbString();\n\n\t\t\t// Force to set the alpha channel value.\n\t\t\tif (convertedValue.includes(\"rgb\") && !convertedValue.includes(\"rgba\")) {\n\t\t\t\tconvertedValue = convertedValue.replace(\"rgb\", \"rgba\");\n\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"HslColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsl();\n\t\t\tdelete convertedValue.a;\n\t\t\tbreak;\n\n\t\tcase \"HslStringColorPicker\":\n\t\t\tconvertedValue = colord(value).toHslString();\n\t\t\tbreak;\n\n\t\tcase \"HslaColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsl();\n\t\t\tbreak;\n\n\t\tcase \"HslaStringColorPicker\":\n\t\t\tconvertedValue = colord(value).toHslString();\n\n\t\t\t// Force to set the alpha channel value.\n\t\t\tif (convertedValue.includes(\"hsl\") && !convertedValue.includes(\"hsla\")) {\n\t\t\t\tconvertedValue = convertedValue.replace(\"hsl\", \"hsla\");\n\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"HsvColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsv();\n\t\t\tdelete convertedValue.a;\n\t\t\tbreak;\n\n\t\tcase \"HsvStringColorPicker\":\n\t\t\tconst hsv = colord(value).toHsv();\n\t\t\tconvertedValue = \"hsv(\" + hsv.h + \", \" + hsv.s + \"%, \" + hsv.v + \"%)\";\n\n\t\t\tbreak;\n\n\t\tcase \"HsvaColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsv();\n\t\t\tbreak;\n\n\t\tcase \"HsvaStringColorPicker\":\n\t\t\t// colord library doesn't provide .toHsvString() method yet.\n\t\t\tconst hsva = colord(value).toHsv();\n\t\t\tconvertedValue =\n\t\t\t\t\"hsva(\" +\n\t\t\t\thsva.h +\n\t\t\t\t\", \" +\n\t\t\t\thsva.s +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.v +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.a +\n\t\t\t\t\")\";\n\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconvertedValue = colord(value).toHex();\n\t\t\tbreak;\n\t}\n\n\treturn convertedValue;\n};\n\nexport default convertColorForPicker;\n","import { colord } from \"colord\";\n\n/**\n * Convert the value for the customizer.\n *\n * @param {string|Object} value The value to be converted.\n * @param {string} pickerComponent The picker component name.\n *\n * @returns {string} The converted value.\n */\nconst convertColorForCustomizer = (value, pickerComponent, formComponent) => {\n\tlet rgba;\n\tlet hsv;\n\tlet hsva;\n\tlet convertedValue;\n\n\tswitch (pickerComponent) {\n\t\t/**\n\t\t * The HexColorPicker is used by these condition:\n\t\t * 1. When formComponent is defined with HexColorPicker as the value.\n\t\t * 2. When formComponent is not defined but the \"alpha\" choice is not set or set to false (the old way).\n\t\t */\n\t\tcase \"HexColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"#\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toHex();\n\t\t\tbreak;\n\n\t\tcase \"RgbColorPicker\":\n\t\t\tconvertedValue = colord(value).toRgb();\n\t\t\tdelete convertedValue.a;\n\t\t\tbreak;\n\n\t\tcase \"RgbStringColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"rgb(\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toRgbString();\n\t\t\tbreak;\n\n\t\tcase \"RgbaColorPicker\":\n\t\t\trgba = colord(value).toRgb();\n\t\t\tconvertedValue = rgba;\n\t\t\tbreak;\n\n\t\t/**\n\t\t * The RgbaStringColorPicker is used by these condition:\n\t\t * 1. When formComponent is defined with RgbaColorPicker as the value.\n\t\t * 2. When formComponent is not defined but the \"alpha\" choice is set to true.\n\t\t */\n\t\tcase \"RgbaStringColorPicker\":\n\t\t\trgba = colord(value).toRgb();\n\n\t\t\tif (rgba.a < 1) {\n\t\t\t\tconvertedValue =\n\t\t\t\t\t\"string\" === typeof value && value.includes(\"rgba\")\n\t\t\t\t\t\t? value\n\t\t\t\t\t\t: colord(value).toRgbString();\n\t\t\t} else {\n\t\t\t\t// When it uses the 2nd condition above, then the expected value is \"hex\".\n\t\t\t\tif (!formComponent) {\n\t\t\t\t\tconvertedValue =\n\t\t\t\t\t\t\"string\" === typeof value && value.includes(\"#\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: colord(value).toHex();\n\t\t\t\t} else {\n\t\t\t\t\tconvertedValue = colord(value).toRgbString();\n\n\t\t\t\t\t// Force to set the alpha channel value.\n\t\t\t\t\tif (\n\t\t\t\t\t\tconvertedValue.includes(\"rgb\") &&\n\t\t\t\t\t\t!convertedValue.includes(\"rgba\")\n\t\t\t\t\t) {\n\t\t\t\t\t\tconvertedValue = convertedValue.replace(\"rgb\", \"rgba\");\n\t\t\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"HslColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsl();\n\t\t\tdelete convertedValue.a;\n\t\t\tbreak;\n\n\t\tcase \"HslStringColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"hsl(\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toHslString();\n\t\t\tbreak;\n\n\t\tcase \"HslaColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsl();\n\t\t\tbreak;\n\n\t\tcase \"HslaStringColorPicker\":\n\t\t\tconvertedValue = colord(value).toHslString();\n\n\t\t\t// Force to set the alpha channel value.\n\t\t\tif (convertedValue.includes(\"hsl\") && !convertedValue.includes(\"hsla\")) {\n\t\t\t\tconvertedValue = convertedValue.replace(\"hsl\", \"hsla\");\n\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"HsvColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsv();\n\t\t\tdelete convertedValue.a;\n\t\t\tbreak;\n\n\t\t/**\n\t\t * The colord library doesn't provide .toHsvString() method yet.\n\t\t * This manual value-building will apply to \"HsvStringColorPicker\" and \"HsvaStringColorPicker\" stuff below.\n\t\t */\n\t\tcase \"HsvStringColorPicker\":\n\t\t\thsv = colord(value).toHsv();\n\t\t\tconvertedValue = \"hsv(\" + hsv.h + \", \" + hsv.s + \"%, \" + hsv.v + \"%)\";\n\t\t\tbreak;\n\n\t\tcase \"HsvaColorPicker\":\n\t\t\tconvertedValue = colord(value).toHsv();\n\t\t\tbreak;\n\n\t\tcase \"HsvaStringColorPicker\":\n\t\t\thsva = colord(value).toHsv();\n\t\t\tconvertedValue =\n\t\t\t\t\"hsva(\" +\n\t\t\t\thsva.h +\n\t\t\t\t\", \" +\n\t\t\t\thsva.s +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.v +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.a +\n\t\t\t\t\")\";\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"#\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toHex();\n\t\t\tbreak;\n\t}\n\n\treturn convertedValue;\n};\n\nexport default convertColorForCustomizer;\n","import { colord } from \"colord\";\n\n/**\n * Convert the value for the color input.\n *\n * @param {string|Object} value The value to be converted.\n * @param {string} pickerComponent The picker component name.\n *\n * @returns {string} The converted value.\n */\nconst convertColorForInput = (value, pickerComponent, formComponent) => {\n\tlet rgba;\n\tlet hsv;\n\tlet hsva;\n\tlet convertedValue;\n\n\tswitch (pickerComponent) {\n\t\t/**\n\t\t * The HexColorPicker is used by these condition:\n\t\t * 1. When formComponent is defined with HexColorPicker as the value.\n\t\t * 2. When formComponent is not defined but the \"alpha\" choice is not set or set to false (the old way).\n\t\t */\n\t\tcase \"HexColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"#\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toHex();\n\t\t\tbreak;\n\n\t\tcase \"RgbColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"rgb(\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toRgbString();\n\t\t\tbreak;\n\n\t\tcase \"RgbStringColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"rgba\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toRgbString();\n\t\t\tbreak;\n\n\t\tcase \"RgbaColorPicker\":\n\t\t\trgba = colord(value).toRgb();\n\n\t\t\tif (rgba.a < 1) {\n\t\t\t\tconvertedValue =\n\t\t\t\t\t\"string\" === typeof value && value.includes(\"rgba\")\n\t\t\t\t\t\t? value\n\t\t\t\t\t\t: colord(value).toRgbString();\n\t\t\t} else {\n\t\t\t\tconvertedValue = colord(value).toRgbString();\n\n\t\t\t\t// Force to set the alpha value.\n\t\t\t\tif (\n\t\t\t\t\tconvertedValue.includes(\"rgb\") &&\n\t\t\t\t\t!convertedValue.includes(\"rgba\")\n\t\t\t\t) {\n\t\t\t\t\tconvertedValue = convertedValue.replace(\"rgb\", \"rgba\");\n\t\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\t/**\n\t\t * The RgbaStringColorPicker is used by these condition:\n\t\t * 1. When formComponent is defined with RgbaColorPicker as the value.\n\t\t * 2. When formComponent is not defined but the \"alpha\" choice is set to true.\n\t\t */\n\t\tcase \"RgbaStringColorPicker\":\n\t\t\trgba = colord(value).toRgb();\n\n\t\t\t// When it uses the 2nd condition above, then the expected value is \"hex\".\n\t\t\tif (rgba.a == 1 && !formComponent) {\n\t\t\t\tconvertedValue =\n\t\t\t\t\t\"string\" === typeof value && value.includes(\"#\")\n\t\t\t\t\t\t? value\n\t\t\t\t\t\t: colord(value).toHex();\n\t\t\t} else {\n\t\t\t\tconvertedValue = colord(value).toRgbString();\n\n\t\t\t\t// Force to set the alpha value.\n\t\t\t\tif (\n\t\t\t\t\tconvertedValue.includes(\"rgb\") &&\n\t\t\t\t\t!convertedValue.includes(\"rgba\")\n\t\t\t\t) {\n\t\t\t\t\tconvertedValue = convertedValue.replace(\"rgb\", \"rgba\");\n\t\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"HslColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"hsl(\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toHslString();\n\t\t\tbreak;\n\n\t\tcase \"HslStringColorPicker\":\n\t\t\tconvertedValue =\n\t\t\t\t\"string\" === typeof value && value.includes(\"hsl(\")\n\t\t\t\t\t? value\n\t\t\t\t\t: colord(value).toHslString();\n\t\t\tbreak;\n\n\t\tcase \"HslaColorPicker\":\n\t\t\tconvertedValue = colord(value).toHslString();\n\n\t\t\t// Force to set the alpha value.\n\t\t\tif (convertedValue.includes(\"hsl\") && !convertedValue.includes(\"hsla\")) {\n\t\t\t\tconvertedValue = convertedValue.replace(\"hsl\", \"hsla\");\n\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase \"HslaStringColorPicker\":\n\t\t\tconvertedValue = colord(value).toHslString();\n\n\t\t\t// Force to set the alpha value.\n\t\t\tif (convertedValue.includes(\"hsl\") && !convertedValue.includes(\"hsla\")) {\n\t\t\t\tconvertedValue = convertedValue.replace(\"hsl\", \"hsla\");\n\t\t\t\tconvertedValue = convertedValue.replace(\")\", \", 1)\");\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\t/**\n\t\t * The colord library doesn't provide .toHsvString() method yet.\n\t\t * This manual value-building will apply to \"hsv\" and \"hsva\" stuff below.\n\t\t */\n\t\tcase \"HsvColorPicker\":\n\t\t\thsv = colord(value).toHsv();\n\t\t\tconvertedValue = \"hsv(\" + hsv.h + \", \" + hsv.s + \"%, \" + hsv.v + \"%)\";\n\t\t\tbreak;\n\n\t\tcase \"HsvStringColorPicker\":\n\t\t\thsv = colord(value).toHsv();\n\t\t\tconvertedValue = \"hsv(\" + hsv.h + \", \" + hsv.s + \"%, \" + hsv.v + \"%)\";\n\t\t\tbreak;\n\n\t\tcase \"HsvaColorPicker\":\n\t\t\thsva = colord(value).toHsv();\n\t\t\tconvertedValue =\n\t\t\t\t\"hsva(\" +\n\t\t\t\thsva.h +\n\t\t\t\t\", \" +\n\t\t\t\thsva.s +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.v +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.a +\n\t\t\t\t\")\";\n\t\t\tbreak;\n\n\t\tcase \"HsvaStringColorPicker\":\n\t\t\thsva = colord(value).toHsv();\n\t\t\tconvertedValue =\n\t\t\t\t\"hsva(\" +\n\t\t\t\thsva.h +\n\t\t\t\t\", \" +\n\t\t\t\thsva.s +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.v +\n\t\t\t\t\"%, \" +\n\t\t\t\thsva.a +\n\t\t\t\t\")\";\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tconvertedValue = colord(value).toHex();\n\t\t\tbreak;\n\t}\n\n\treturn convertedValue;\n};\n\nexport default convertColorForInput;\n","import { useEffect } from \"react\";\n\n/**\n * Code was taken and then modified from https://codesandbox.io/s/opmco?file=/src/useClickOutside.js:0-1192\n * It was improved version of https://usehooks.com/useOnClickOutside/\n */\nconst useClickOutside = (pickerRef, resetRef, handler) => {\n\tuseEffect(() => {\n\t\tlet startedWhenMounted = false;\n\t\tlet startedInside = false;\n\n\t\tconst listener = (event) => {\n\t\t\t// Do nothing if `mousedown` or `touchstart` started either inside resetRef or pickerRef element\n\t\t\tif (!startedWhenMounted || startedInside) return;\n\n\t\t\t// Do nothing if clicking resetRef's element or descendent elements\n\t\t\tif (!resetRef.current || resetRef.current.contains(event.target)) return;\n\n\t\t\t// Do nothing if clicking pickerRef's element or descendent elements\n\t\t\tif (!pickerRef.current || pickerRef.current.contains(event.target))\n\t\t\t\treturn;\n\n\t\t\thandler();\n\t\t};\n\n\t\tconst validateEventStart = (event) => {\n\t\t\tstartedWhenMounted = resetRef.current && pickerRef.current;\n\t\t\tstartedInside =\n\t\t\t\t(resetRef.current && resetRef.current.contains(event.target)) ||\n\t\t\t\t(pickerRef.current && pickerRef.current.contains(event.target));\n\t\t};\n\n\t\tdocument.addEventListener(\"mousedown\", validateEventStart);\n\t\tdocument.addEventListener(\"touchstart\", validateEventStart);\n\t\tdocument.addEventListener(\"click\", listener);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousedown\", validateEventStart);\n\t\t\tdocument.removeEventListener(\"touchstart\", validateEventStart);\n\t\t\tdocument.removeEventListener(\"click\", listener);\n\t\t};\n\t}, [resetRef, pickerRef, handler]);\n};\n\nexport default useClickOutside;\n","import { useEffect } from \"react\";\n\nconst useFocusOutside = (ref, handler) => {\n\tuseEffect(() => {\n\t\tconst listener = (e) => {\n\t\t\t// Do nothing if the component hasn't been mounted.\n\t\t\tif (!ref.current) return;\n\n\t\t\t// Do nothing if the focused element is inside the ref or the ref it self.\n\t\t\tif (ref.current.contains(e.target)) return;\n\n\t\t\thandler();\n\t\t};\n\n\t\tdocument.addEventListener(\"focus\", listener, true);\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"focus\", listener, true);\n\t\t};\n\t}, [ref, handler]);\n};\n\nexport default useFocusOutside;\n","import { useEffect } from \"react\";\n\nconst useWindowResize = (handler) => {\n\tuseEffect(() => {\n\t\tconst listener = (e) => {\n\t\t\thandler();\n\t\t};\n\n\t\twindow.addEventListener(\"resize\", listener, true);\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener(\"resize\", listener, true);\n\t\t};\n\t}, [handler]);\n};\n\nexport default useWindowResize;\n","import { useState, useEffect } from \"react\";\nimport reactCSS from \"reactcss\";\n\nconst KirkiReactColorfulCircle = (props) => {\n\tconst { color = \"\" } = props;\n\tconst [value, setValue] = useState(() => color);\n\n\t// Update the local state when `color` property value is changed.\n\tuseEffect(() => {\n\t\t// We don't need to convert the color since it's using the customizer value.\n\t\tsetValue(color);\n\t}, [color]);\n\n\tconst pickersWithAlpha = [\n\t\t\"RgbaColorPicker\",\n\t\t\"RgbaStringColorPicker\",\n\t\t\"HslaColorPicker\",\n\t\t\"HslaStringColorPicker\",\n\t\t\"HsvaColorPicker\",\n\t\t\"HsvaStringColorPicker\",\n\t];\n\n\tconst styles = reactCSS({\n\t\tdefault: {\n\t\t\ttriggerButton: {\n\t\t\t\tbackgroundImage:\n\t\t\t\t\t'url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==\")',\n\t\t\t},\n\t\t\tcolorPreview: {\n\t\t\t\tbackgroundColor: value ? value : \"transparent\",\n\t\t\t},\n\t\t},\n\t});\n\n\treturn (\n\t\t
    \n\t\t\t\n\t\t\t\t
    \n\t\t\t\n\t\t
    \n\t);\n};\n\nexport default KirkiReactColorfulCircle;\n","import { useState, useRef } from \"react\";\nimport {\n\tHexColorPicker,\n\tRgbColorPicker,\n\tRgbaColorPicker,\n\tRgbStringColorPicker,\n\tRgbaStringColorPicker,\n\tHslColorPicker,\n\tHslaColorPicker,\n\tHslStringColorPicker,\n\tHslaStringColorPicker,\n\tHsvColorPicker,\n\tHsvaColorPicker,\n\tHsvStringColorPicker,\n\tHsvaStringColorPicker,\n} from \"react-colorful\";\nimport KirkiReactColorfulInput from \"./js/components/KirkiReactColorfulInput\";\nimport KirkiReactColorfulSwatches from \"./js/components/KirkiReactColorfulSwatches\";\nimport convertColorForPicker from \"./js/utils/convertColorForPicker\";\nimport convertColorForCustomizer from \"./js/utils/convertColorForCustomizer\";\nimport convertColorForInput from \"./js/utils/convertColorForInput\";\nimport useClickOutside from \"./js/hooks/useClickOutside\";\nimport useFocusOutside from \"./js/hooks/useFocusOutside\";\nimport useWindowResize from \"./js/hooks/useWindowResize\";\nimport KirkiReactColorfulCircle from \"./js/components/KirkiReactColorfulCircle\";\nimport { colord } from \"colord\";\n\n/**\n * The form component of Kirki React Colorful.\n *\n * Globals:\n * _, wp, React, ReactDOM\n *\n * @param {Object} props The props for the component.\n * @returns The component element.\n */\nconst KirkiReactColorfulForm = (props) => {\n\tconst { control, customizerSetting, useHueMode, pickerComponent, choices } =\n\t\tprops;\n\n\tconst parseEmptyValue = () => (useHueMode ? 0 : \"#000000\");\n\n\tconst parseHueModeValue = (hueValue) => {\n\t\thueValue = hueValue || parseEmptyValue();\n\t\thueValue = hueValue < 0 ? 0 : hueValue;\n\n\t\treturn hueValue > 360 ? 360 : hueValue;\n\t};\n\n\tconst parseInputValue = (value) => {\n\t\tif (\"\" === value) return \"\";\n\n\t\treturn useHueMode\n\t\t\t? parseHueModeValue(value)\n\t\t\t: convertColorForInput(\n\t\t\t\t\tvalue,\n\t\t\t\t\tpickerComponent,\n\t\t\t\t\tchoices.formComponent\n\t\t\t ).replace(\";\", \"\");\n\t};\n\n\tconst parseCustomizerValue = (value) => {\n\t\tif (\"\" === value) return \"\";\n\n\t\treturn convertColorForCustomizer(\n\t\t\tvalue,\n\t\t\tpickerComponent,\n\t\t\tchoices.formComponent\n\t\t);\n\t};\n\n\tconst parsePickerValue = (value) => {\n\t\tvalue = value || parseEmptyValue();\n\n\t\t// Hard coded saturation and lightness when using hue mode.\n\t\treturn useHueMode\n\t\t\t? { h: value, s: 100, l: 50 }\n\t\t\t: convertColorForPicker(value, pickerComponent);\n\t};\n\n\tconst [inputValue, setInputValue] = useState(() => {\n\t\treturn parseInputValue(props.value);\n\t});\n\n\tconst [pickerValue, setPickerValue] = useState(() => {\n\t\treturn parsePickerValue(props.value);\n\t});\n\n\tlet currentInputValue = inputValue;\n\tlet currentPickerValue = pickerValue;\n\n\t// This function will be called when this control's customizer value is changed.\n\tcontrol.updateComponentState = (value) => {\n\t\tconst valueForInput = parseInputValue(value);\n\t\tlet changeInputValue = false;\n\n\t\tif (typeof valueForInput === \"string\" || useHueMode) {\n\t\t\tchangeInputValue = valueForInput !== inputValue;\n\t\t} else {\n\t\t\tchangeInputValue =\n\t\t\t\tJSON.stringify(valueForInput) !== JSON.stringify(currentInputValue);\n\t\t}\n\n\t\tif (changeInputValue) setInputValue(valueForInput);\n\n\t\tconst valueForPicker = parsePickerValue(value);\n\t\tlet changePickerValue = false;\n\n\t\tif (typeof valueForPicker === \"string\" || useHueMode) {\n\t\t\tchangePickerValue = valueForPicker !== pickerValue;\n\t\t} else {\n\t\t\tchangePickerValue =\n\t\t\t\tJSON.stringify(valueForPicker) !== JSON.stringify(currentPickerValue);\n\t\t}\n\n\t\tif (changePickerValue) setPickerValue(valueForPicker);\n\t};\n\n\tconst saveToCustomizer = (value) => {\n\t\tif (useHueMode) {\n\t\t\t/**\n\t\t\t * When using hue mode, the pickerComponent is HslColorPicker.\n\t\t\t * If there is value.h, then value is set from the picker.\n\t\t\t * Otherwise, value is set from the input or the customizer.\n\t\t\t */\n\t\t\tvalue = value.h || 0 === value.h ? value.h : value;\n\t\t\tvalue = parseHueModeValue(value);\n\t\t} else {\n\t\t\tvalue = parseCustomizerValue(value);\n\t\t}\n\n\t\tcustomizerSetting.set(value);\n\t};\n\n\tconst initialColor =\n\t\t\"\" !== props.default && \"undefined\" !== typeof props.default\n\t\t\t? props.default\n\t\t\t: props.value;\n\n\t/**\n\t * Function to run on picker change.\n\t *\n\t * @param {string|Object} color The value returned by the picker. It can be a string or a color object.\n\t */\n\tconst handlePickerChange = (color) => {\n\t\tif (props.onChange) props.onChange(color);\n\t\tcurrentPickerValue = color;\n\t\tsaveToCustomizer(color);\n\t};\n\n\tconst handleInputChange = (value) => {\n\t\tcurrentInputValue = value;\n\t\tsaveToCustomizer(value);\n\t};\n\n\tconst handleReset = () => {\n\t\tif (!initialColor) {\n\t\t\tcurrentInputValue = \"\";\n\t\t\tcurrentPickerValue = \"\";\n\t\t}\n\n\t\tsaveToCustomizer(initialColor);\n\t};\n\n\tconst handleSwatchesClick = (swatchColor) => {\n\t\tsaveToCustomizer(swatchColor);\n\t};\n\n\tconst handleWindowResize = () => {\n\t\tsetPickerContainerStyle(getPickerContainerStyle());\n\t};\n\n\tlet controlLabel = (\n\t\t\n\t);\n\n\tlet controlDescription = (\n\t\t\n\t);\n\n\tcontrolLabel = (\n\t\t\n\t);\n\n\tcontrolLabel = props.label || props.description ? controlLabel : \"\";\n\n\tconst formRef = useRef(null); // Reference to the form div.\n\tconst pickerRef = useRef(null); // Reference to the picker popup.\n\tconst resetRef = useRef(null); // Reference to the picker popup.\n\n\tconst [isPickerOpen, setIsPickerOpen] = useState(false);\n\n\tconst usePositionFixed = \"default\" !== choices.labelStyle ? true : false;\n\n\tconst [pickerContainerStyle, setPickerContainerStyle] = useState({});\n\n\tconst getPickerContainerStyle = () => {\n\t\tlet pickerContainerStyle = {};\n\n\t\tif (!usePositionFixed) return pickerContainerStyle;\n\n\t\tlet padding = window.getComputedStyle(\n\t\t\tcontrol.container[0].parentNode\n\t\t).paddingLeft;\n\t\tpadding = parseInt(padding, 10) * 2;\n\n\t\tpickerContainerStyle.width =\n\t\t\tcontrol.container[0].parentNode.getBoundingClientRect().width - padding;\n\n\t\tconst controlLeftOffset = (control.container[0].offsetLeft - 9) * -1;\n\n\t\tpickerContainerStyle.left = controlLeftOffset + \"px\";\n\n\t\treturn pickerContainerStyle;\n\t};\n\n\tconst convertInputValueTo6Digits = () => {\n\t\tif (4 === inputValue.length && inputValue.includes(\"#\")) {\n\t\t\tsetInputValue(colord(inputValue).toHex());\n\t\t}\n\t};\n\n\tconst togglePicker = () => {\n\t\tif (isPickerOpen) {\n\t\t\tclosePicker();\n\t\t} else {\n\t\t\topenPicker();\n\t\t}\n\t};\n\n\tconst openPicker = () => {\n\t\tif (isPickerOpen) return;\n\n\t\tsetPickerContainerStyle(getPickerContainerStyle());\n\t\tconvertInputValueTo6Digits();\n\t\tsetIsPickerOpen(true);\n\t};\n\n\tconst closePicker = () => {\n\t\tif (!isPickerOpen) return;\n\n\t\tsetIsPickerOpen(false);\n\t\tsetTimeout(convertInputValueTo6Digits, 200);\n\t};\n\n\tlet KirkiPickerComponent;\n\n\t// We can't just render `pickerComponent` directly, we need these lines so that the compiler will import them.\n\tswitch (pickerComponent) {\n\t\tcase \"HexColorPicker\":\n\t\t\tKirkiPickerComponent = HexColorPicker;\n\t\t\tbreak;\n\t\tcase \"RgbColorPicker\":\n\t\t\tKirkiPickerComponent = RgbColorPicker;\n\t\t\tbreak;\n\t\tcase \"RgbStringColorPicker\":\n\t\t\tKirkiPickerComponent = RgbStringColorPicker;\n\t\t\tbreak;\n\t\tcase \"RgbaColorPicker\":\n\t\t\tKirkiPickerComponent = RgbaColorPicker;\n\t\t\tbreak;\n\t\tcase \"RgbaStringColorPicker\":\n\t\t\tKirkiPickerComponent = RgbaStringColorPicker;\n\t\t\tbreak;\n\t\t// We treat HueColorPicker (hue mode) as HslColorPicker.\n\t\tcase \"HueColorPicker\":\n\t\t\tKirkiPickerComponent = HslColorPicker;\n\t\t\tbreak;\n\t\tcase \"HslColorPicker\":\n\t\t\tKirkiPickerComponent = HslColorPicker;\n\t\t\tbreak;\n\t\tcase \"HslStringColorPicker\":\n\t\t\tKirkiPickerComponent = HslStringColorPicker;\n\t\t\tbreak;\n\t\tcase \"HslaColorPicker\":\n\t\t\tKirkiPickerComponent = HslaColorPicker;\n\t\t\tbreak;\n\t\tcase \"HslaStringColorPicker\":\n\t\t\tKirkiPickerComponent = HslaStringColorPicker;\n\t\t\tbreak;\n\t\tcase \"HsvColorPicker\":\n\t\t\tKirkiPickerComponent = HsvColorPicker;\n\t\t\tbreak;\n\t\tcase \"HsvStringColorPicker\":\n\t\t\tKirkiPickerComponent = HsvStringColorPicker;\n\t\t\tbreak;\n\t\tcase \"HsvaColorPicker\":\n\t\t\tKirkiPickerComponent = HsvaColorPicker;\n\t\t\tbreak;\n\t\tcase \"HsvaStringColorPicker\":\n\t\t\tKirkiPickerComponent = HsvaStringColorPicker;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tKirkiPickerComponent = HexColorPicker;\n\t\t\tbreak;\n\t}\n\n\tuseWindowResize(handleWindowResize);\n\n\t// Handle outside focus to close the picker popup.\n\tuseFocusOutside(formRef, closePicker);\n\n\t// Handle outside click to close the picker popup.\n\tuseClickOutside(pickerRef, resetRef, closePicker);\n\n\tif (jQuery.wp && jQuery.wp.wpColorPicker) {\n\t\tconst wpColorPickerSwatches =\n\t\t\tjQuery.wp.wpColorPicker.prototype.options.palettes;\n\n\t\t// If 3rd parties applied custom colors to wpColorPicker swatches, let's use them.\n\t\tif (Array.isArray(wpColorPickerSwatches)) {\n\t\t\tif (wpColorPickerSwatches.length < 8) {\n\t\t\t\tfor (let i = wpColorPickerSwatches.length; i <= 8; i++) {\n\t\t\t\t\twpColorPickerSwatches.push(choices.swatches[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchoices.swatches = wpColorPickerSwatches;\n\t\t}\n\t}\n\n\tconst controlHeader = (\n\t\t<>\n\t\t\t{controlLabel}\n\t\t\t\n\t\t\n\t);\n\n\tlet formClassName = useHueMode\n\t\t? \"kirki-control-form use-hue-mode\"\n\t\t: \"kirki-control-form\";\n\n\tformClassName += \" has-\" + choices.labelStyle + \"-label-style\";\n\n\tlet pickerContainerClassName = isPickerOpen\n\t\t? pickerComponent + \" colorPickerContainer is-open\"\n\t\t: pickerComponent + \" colorPickerContainer\";\n\n\tconst pickerTrigger = (\n\t\t<>\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\n\t);\n\n\tlet pickerHeader;\n\n\tswitch (choices.labelStyle) {\n\t\tcase \"tooltip\":\n\t\t\tpickerHeader = (\n\t\t\t\t<>\n\t\t\t\t\t{pickerTrigger}\n\t\t\t\t\t{!isPickerOpen && (\n\t\t\t\t\t\t
    {controlHeader}
    \n\t\t\t\t\t)}\n\t\t\t\t\n\t\t\t);\n\t\t\tbreak;\n\n\t\tcase \"top\":\n\t\t\tpickerHeader = (\n\t\t\t\t<>\n\t\t\t\t\t{controlHeader}\n\t\t\t\t\t{pickerTrigger}\n\t\t\t\t\n\t\t\t);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tpickerHeader = (\n\t\t\t\t<>\n\t\t\t\t\t
    \n\t\t\t\t\t\t
    {controlHeader}
    \n\t\t\t\t\t\t
    {pickerTrigger}
    \n\t\t\t\t\t
    \n\t\t\t\t\n\t\t\t);\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t
    \n\t\t\t\t{pickerHeader}\n\t\t\t\t\n\t\t\t\t\t{!useHueMode && (\n\t\t\t\t\t\t\n\t\t\t\t\t)}\n\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t\n\t);\n};\n\nexport default KirkiReactColorfulForm;\n","import ReactDOM from \"react-dom\";\nimport KirkiReactColorfulForm from \"./KirkiReactColorfulForm\";\n\n/**\n * KirkiReactColorfulControl.\n *\n * @class\n * @augments wp.customize.Control\n * @augments wp.customize.Class\n */\nconst KirkiReactColorfulControl = wp.customize.Control.extend({\n\t/**\n\t * Initialize.\n\t *\n\t * @param {string} id - Control ID.\n\t * @param {object} params - Control params.\n\t */\n\tinitialize: function (id, params) {\n\t\tconst control = this;\n\n\t\t// Bind functions to this control context for passing as React props.\n\t\tcontrol.setNotificationContainer =\n\t\t\tcontrol.setNotificationContainer.bind(control);\n\n\t\twp.customize.Control.prototype.initialize.call(control, id, params);\n\n\t\t// The following should be eliminated with .\n\t\tfunction onRemoved(removedControl) {\n\t\t\tif (control === removedControl) {\n\t\t\t\tcontrol.destroy();\n\t\t\t\tcontrol.container.remove();\n\t\t\t\twp.customize.control.unbind(\"removed\", onRemoved);\n\t\t\t}\n\t\t}\n\t\twp.customize.control.bind(\"removed\", onRemoved);\n\t},\n\n\t/**\n\t * Set notification container and render.\n\t *\n\t * This is called when the React component is mounted.\n\t *\n\t * @param {Element} element - Notification container.\n\t * @returns {void}\n\t */\n\tsetNotificationContainer: function setNotificationContainer(element) {\n\t\tconst control = this;\n\t\tcontrol.notifications.container = jQuery(element);\n\t\tcontrol.notifications.render();\n\t},\n\n\t/**\n\t * Render the control into the DOM.\n\t *\n\t * This is called from the Control#embed() method in the parent class.\n\t *\n\t * @returns {void}\n\t */\n\trenderContent: function renderContent() {\n\t\tconst control = this;\n\t\tconst useHueMode = \"hue\" === control.params.mode;\n\t\tconst choices = control.params.choices;\n\n\t\tlet pickerComponent;\n\n\t\tif (choices.formComponent) {\n\t\t\tpickerComponent = choices.formComponent;\n\t\t} else {\n\t\t\tpickerComponent = choices.alpha\n\t\t\t\t? \"RgbaStringColorPicker\"\n\t\t\t\t: \"HexColorPicker\";\n\t\t}\n\n\t\tpickerComponent = useHueMode ? \"HueColorPicker\" : pickerComponent;\n\n\t\tconst form = (\n\t\t\t\n\t\t);\n\n\t\tReactDOM.render(form, control.container[0]);\n\t},\n\n\t/**\n\t * After control has been first rendered, start re-rendering when setting changes.\n\t *\n\t * React is able to be used here instead of the wp.customize.Element abstraction.\n\t *\n\t * @returns {void}\n\t */\n\tready: function ready() {\n\t\tconst control = this;\n\n\t\t/**\n\t\t * Update component state when customizer setting changes.\n\t\t *\n\t\t * There was an issue (which was fixed):\n\t\t *\n\t\t * Let's say we have other color picker (\"x\" color picker) and this current color picker (\"y\" color picker).\n\t\t * Let's say there's a script that bind to that \"x\" color picker to make change to this \"y\" color picker.\n\t\t *\n\t\t * When \"x\" color picker is changed fast (by dragging the color, for example),\n\t\t * then the re-render of this \"y\" color picker will be messy.\n\t\t * There was something like \"function-call race\" between component re-render and function call inside the component.\n\t\t *\n\t\t * When that happens, the \"x\" color picker becomes unresponsive and un-usable.\n\t\t *\n\t\t * How we fixed that:\n\t\t * - Provide a updateComponentState property to this file.\n\t\t * - Inside the component, assign the updateComponentState with a function to update some states.\n\t\t * - Then inside the binding below, call updateComponentState instead of re-rendering the component.\n\t\t *\n\t\t * The result: Even though the \"x\" color picker becomes very slow, it's still usable and responsive enough.\n\t\t */\n\t\tcontrol.setting.bind((val) => {\n\t\t\tcontrol.updateComponentState(val);\n\t\t});\n\t},\n\n\tupdateComponentState: () => {},\n\n\t/**\n\t * Handle removal/de-registration of the control.\n\t *\n\t * This is essentially the inverse of the Control#embed() method.\n\t *\n\t * @link https://core.trac.wordpress.org/ticket/31334\n\t * @returns {void}\n\t */\n\tdestroy: function destroy() {\n\t\tconst control = this;\n\n\t\t// Garbage collection: undo mounting that was done in the embed/renderContent method.\n\t\tReactDOM.unmountComponentAtNode(control.container[0]);\n\n\t\t// Call destroy method in parent if it exists (as of #31334).\n\t\tif (wp.customize.Control.prototype.destroy) {\n\t\t\twp.customize.Control.prototype.destroy.call(control);\n\t\t}\n\t},\n});\n\nexport default KirkiReactColorfulControl;\n","/* global wp */\n\nimport \"./control.scss\";\nimport KirkiReactColorfulControl from './KirkiReactColorfulControl';\n\n// Register control type with Customizer.\nwp.customize.controlConstructor['kirki-react-colorful'] = KirkiReactColorfulControl;\n"],"names":["$8ThvE","parcelRequire","freeExports","exports","nodeType","freeModule","module","Buffer","undefined","isBuffer","$jjS2x","$lyxRX","$67910ad3df1b1086$var$freeSelf","self","Object","$67910ad3df1b1086$var$root","Function","$fb170ba8a9c2191f$var$freeGlobal","$parcel$global","freeProcess","process","nodeUtil","types","require","binding","e","allocUnsafe","buffer","isDeep","slice","length","result","constructor","copy","$a735c72dc00321c4$export$2e2bcd8739ae039","arr","len","i","arr2","Array","$d8de0eb6e0dd5f0d$export$2e2bcd8739ae039","isArray","$6e00726c30bb8aa8$export$2e2bcd8739ae039","iter","Symbol","iterator","from","$8664303016091545$export$2e2bcd8739ae039","o","minLen","n","prototype","toString","call","name","test","$09f7b49357d6407d$export$2e2bcd8739ae039","TypeError","$9e1e3aff84b72d71$export$2e2bcd8739ae039","$ee4fec65ef715af7$export$2e2bcd8739ae039","obj","ReactDOM","useEventCallback","handler","callbackRef","useRef","fn","value","current","React","clamp","number","min","max","isTouch","event","getParentWindow","node","ownerDocument","defaultView","getRelativePosition","touchId","rect","getBoundingClientRect","pointer","touches","identifier","left","pageX","pageXOffset","width","top","pageY","pageYOffset","height","preventDefaultMove","preventDefault","Interactive","memo","onMove","onKey","rest","container","onMoveCallback","onKeyCallback","hasTouch","x","useMemo","handleMove","buttons","toggleDocumentEvents","handleMoveEnd","state","touch","parentWindow","toggleEvent","addEventListener","removeEventListener","e3","nativeEvent","el","changedTouches","focus","keyCode","which","handleMoveStart","handleKeyDown","useEffect","onTouchStart","onMouseDown","className","ref","onKeyDown","tabIndex","role","formatClassName","names","filter","Boolean","join","Pointer","r","color","nodeClassName","style","backgroundColor","round","digits","base","Math","pow","angleUnits","grad","turn","rad","PI","hexToRgba","hex","substr","parseInt","g","b","a","parseHue","unit","Number","hslaStringToHsva","hslString","match","exec","hslaToHsva","h","s","l","v","hslStringToHsva","hsvaToHsla","hh","hsvaToHslString","hsva","hsvaToHslaString","hsvaToRgba","floor","c","d","hsvaStringToHsva","hsvString","roundHsva","hsvStringToHsva","rgbaStringToHsva","rgbaString","rgbaToHsva","rgbStringToHsva","format","delta","Hue","hue","onChange","interaction","offset","aria-label","aria-valuetext","Saturation","containerStyle","equalColorObjects","first","second","prop","equalColorString","replace","useColorManipulation","colorModel","onChangeCallback","useState","toHsva","updateHsva","cache","equal","newHsva","newColor","fromHsva","handleChange","useCallback","params","assign","nonce","useIsomorphicLayoutEffect","window","useLayoutEffect","styleElementMap","Map","useStyleSheet","nodeRef","parentDocument","document","has","styleElement","createElement","innerHTML","set","__webpack_nonce__","setAttribute","head","appendChild","ColorPicker","t","defaultColor","toLowerCase","HexColorPicker","props","Alpha","gradientStyle","backgroundImage","AlphaColorPicker","HslaColorPicker","HslaStringColorPicker","HslColorPicker","HslStringColorPicker","HsvaColorPicker","HsvaStringColorPicker","HsvColorPicker","HsvStringColorPicker","RgbaColorPicker","RgbaStringColorPicker","RgbColorPicker","RgbStringColorPicker","defineProperty","$e812653e67a6d710$exports","ReactCSS","loop","handleActive","handleHover","hover","$f318b0aeed5cca99$exports","flattenNames","$a090581360ce8173$exports","$f2cc4cee927d37c7$var$objectProto","$f2cc4cee927d37c7$var$hasOwnProperty","hasOwnProperty","$f2cc4cee927d37c7$var$nativeObjectToString","$f2cc4cee927d37c7$var$symToStringTag","toStringTag","$f2cc4cee927d37c7$exports","isOwn","tag","unmasked","$934b51efa189f09c$var$nativeObjectToString","$934b51efa189f09c$exports","$852d1f971b259156$var$symToStringTag","$852d1f971b259156$exports","$8cb3ae215df00a00$var$isArray","$8cb3ae215df00a00$exports","$5475ba594a8bdf91$exports","$f318b0aeed5cca99$var$_isString3","$f318b0aeed5cca99$var$_interopRequireDefault","$964779a63aa00972$var$baseFor","fromRight","object","iteratee","keysFunc","index","iterable","key","$5167005b932b675c$exports","$964779a63aa00972$exports","$29cd5707c05bf6b8$exports","$673e072344569ebe$exports","$c09020d853f4dd56$var$objectProto","$c09020d853f4dd56$var$hasOwnProperty","$c09020d853f4dd56$var$propertyIsEnumerable","propertyIsEnumerable","$c09020d853f4dd56$var$isArguments","arguments","$c09020d853f4dd56$exports","$1a5c8861aefb5e25$var$reIsUint","$1a5c8861aefb5e25$exports","type","$9ad3d04370aa37c9$exports","$404e7686b4834cf1$var$typedArrayTags","$404e7686b4834cf1$exports","$a37b20fb7156577b$exports","func","$32e7db2a0777bb6d$var$nodeIsTypedArray","$7vc1R","isTypedArray","$32e7db2a0777bb6d$var$isTypedArray","$32e7db2a0777bb6d$exports","$1a01a48c6e6e7ac2$var$hasOwnProperty","$1a01a48c6e6e7ac2$exports","inherited","isArr","isArg","isBuff","$7HKs8","isType","skipIndexes","String","push","$9fb63971f28e98ce$var$objectProto","$9fb63971f28e98ce$exports","Ctor","$d1eeca103b9aa761$var$nativeKeys","$10bd1c09b9f64069$exports","transform","arg","keys","$d1eeca103b9aa761$exports","$eb634362e8bab00b$var$hasOwnProperty","$eb634362e8bab00b$exports","$db5dfd0661742a1a$exports","$63bef038e059393f$exports","$887f7dd95a2dee62$exports","$b104760b34d6b7b1$exports","$c40d9c5aec6b4ec6$exports","$836ffceb73715ab3$exports","$a83757e5168931b6$exports","$f318b0aeed5cca99$var$_forOwn3","$29f32b5d9ce7155d$exports","$7a9433312306cf5b$var$getPrototype","getPrototypeOf","$7a9433312306cf5b$exports","$58f2645d8a82ddb4$var$funcProto","$58f2645d8a82ddb4$var$objectProto","$58f2645d8a82ddb4$var$funcToString","$58f2645d8a82ddb4$var$hasOwnProperty","$58f2645d8a82ddb4$var$objectCtorString","$f318b0aeed5cca99$var$_isPlainObject3","proto","$c0d7b47ee8b12bf1$exports","array","$ed640afc4605eeaf$exports","this","__data__","size","$6f80be9883321bbe$exports","other","$a5c18ae4f7c751db$exports","$8dacab0aad959c1a$var$splice","splice","$8dacab0aad959c1a$exports","data","pop","$822f7d857aa2dcb8$exports","$5edb34374c74a495$exports","$9655ef897f0bbdba$var$ListCache","entries","clear","entry","$315b693937a70245$exports","get","$9655ef897f0bbdba$exports","$f4765b9de3cd25a2$exports","$4e48da7de9bc0080$exports","$21c09588dffa6b32$exports","$2739006159eb7a0c$exports","uid","$69576d09d95c0935$var$coreJsData","$989d09d10c86a3af$var$maskSrcKey","$69576d09d95c0935$exports","IE_PROTO","$989d09d10c86a3af$exports","$3d1b4ae41857d3b0$var$funcToString","$3d1b4ae41857d3b0$exports","e1","$105e649bd3deec51$var$reIsHostCtor","$105e649bd3deec51$var$funcProto","$105e649bd3deec51$var$objectProto","$105e649bd3deec51$var$funcToString","$105e649bd3deec51$var$hasOwnProperty","$105e649bd3deec51$var$reIsNative","RegExp","$105e649bd3deec51$exports","$5c63d0177b86ffa5$exports","$97e6c72a80d118d2$exports","$1b8f1205e4056240$var$Map","$1b8f1205e4056240$exports","$1a89124de4ced368$var$nativeCreate","$1a89124de4ced368$exports","$8fe1870119bc2ce4$exports","$7b046508d0c4b2bb$exports","$570123ba6240e679$var$hasOwnProperty","$570123ba6240e679$exports","$75e6b0027cb55f48$var$hasOwnProperty","$75e6b0027cb55f48$exports","$1e733182a9700f13$var$Hash","$315cb19b5f7dc6c3$exports","$1e733182a9700f13$exports","$b06f33fda863a736$exports","hash","map","string","$3bd39081531a18a3$exports","$ee96f1b7eaa44ac5$exports","$5f4eea80c864f4a3$exports","$54d2d6191fb8ab24$exports","$e8338a2a89515313$exports","$f6389c21d76f2f82$var$MapCache","$26a7fc4b70d5469b$exports","$f6389c21d76f2f82$exports","$8bfbce7e35b86105$var$Stack","$0ab5431b23eb293c$exports","pairs","$0ab5431b23eb293c$var$LARGE_ARRAY_SIZE","$8bfbce7e35b86105$exports","$868090bb248ca2fc$exports","$32da07863e46acec$var$SetCache","values","add","$ba2e6a93841338dc$exports","$32da07863e46acec$exports","$71c492a50c15e5ea$exports","predicate","$c0081f1c22a5c7b6$exports","$d78075cec53d5845$exports","bitmask","customizer","equalFunc","stack","isPartial","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue1","compared","othValue","othIndex","$ddf8457b0c355418$var$Uint8Array","Uint8Array","$ddf8457b0c355418$exports","$65965bd4fe27ade2$exports","forEach","$eee7f5e5109334c4$exports","$a632bfd5cacb9484$var$symbolProto","$a632bfd5cacb9484$var$symbolValueOf","valueOf","$a632bfd5cacb9484$exports","byteLength","byteOffset","message","convert","stacked","$3fc9dba05ba16d53$exports","$9d3e3231281d182b$exports","symbolsFunc","$68bbccdd4a21a80e$exports","resIndex","$11b31dfc90d4eeeb$exports","$0eabf8f27c57cf11$var$propertyIsEnumerable","$0eabf8f27c57cf11$var$nativeGetSymbols","getOwnPropertySymbols","$0eabf8f27c57cf11$exports","symbol","$860bb4b6843d7563$exports","$b4663e3cbde1ff22$var$hasOwnProperty","$b4663e3cbde1ff22$exports","objProps","objLength","objStacked","skipCtor","objValue","objCtor","othCtor","$17dcac0166b81916$exports","$94f6808d7ce0e1fd$exports","$1a2f39184944fa46$exports","$7138f8441ce5e43e$exports","$e16b2168665de4fd$var$mapTag","$e16b2168665de4fd$var$promiseTag","$e16b2168665de4fd$var$setTag","$e16b2168665de4fd$var$weakMapTag","$e16b2168665de4fd$var$dataViewTag","$e16b2168665de4fd$var$dataViewCtorString","$e16b2168665de4fd$var$mapCtorString","$e16b2168665de4fd$var$promiseCtorString","$e16b2168665de4fd$var$setCtorString","$e16b2168665de4fd$var$weakMapCtorString","$e16b2168665de4fd$var$getTag","ArrayBuffer","resolve","ctorString","$e16b2168665de4fd$exports","$bfbd466526f8d698$var$argsTag","$bfbd466526f8d698$var$arrayTag","$bfbd466526f8d698$var$objectTag","$bfbd466526f8d698$var$hasOwnProperty","$bfbd466526f8d698$exports","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","$6219f680e6e19178$exports","$6219f680e6e19178$var$baseIsEqual","$85df9b6b26a2a3d6$exports","source","matchData","noCustomizer","srcValue","$85df9b6b26a2a3d6$var$COMPARE_PARTIAL_FLAG","$fdfd165136cf00fc$exports","$9d7de89299ad2e3c$exports","$84046984492b1213$exports","$1a6ab9420533a54c$exports","$b7350b23d035986b$exports","$ebf30b1c72800438$var$reIsDeepProp","$ebf30b1c72800438$var$reIsPlainProp","$ebf30b1c72800438$exports","$af3456543921feb4$var$memoize","resolver","memoized","args","apply","Cache","$af3456543921feb4$exports","$2171f479fe1b9e27$var$rePropName","$2171f479fe1b9e27$var$reEscapeChar","$2171f479fe1b9e27$var$stringToPath","$b8ba2ed78ec192fa$exports","charCodeAt","quote","subString","$2171f479fe1b9e27$exports","$c59f41c766f8804e$var$symbolProto","$c59f41c766f8804e$var$symbolToString","$c59f41c766f8804e$exports","$c59f41c766f8804e$var$baseToString","$22f1dff9b3c6ff0c$exports","$026916563a5fc8ad$exports","$e56d6cac75d4b6e0$exports","$01f8d472cea3b7ad$exports","path","$37f57525b6598a05$exports","defaultValue","$c33ef5d4bef3db8d$exports","$f29e6f17be0e64f1$exports","hasFunc","$ef091009ae184c05$exports","$f70cedfd69c2edab$exports","$f70cedfd69c2edab$var$COMPARE_PARTIAL_FLAG","$805c81fb4b9151f2$exports","$93a5b3a3d4a8ecc6$exports","$3931b06dee0ed94b$exports","$52849359d0c345c9$exports","$eb9d77a605684a7d$var$baseEach","eachFunc","collection","$c808fa36ed14e2e9$exports","$eb9d77a605684a7d$exports","$20f6957cb6a19f51$exports","collection1","$f318b0aeed5cca99$var$_map3","__esModule","default","$f318b0aeed5cca99$var$flattenNames","things","thing","$e812653e67a6d710$var$_flattenNames2","$e812653e67a6d710$var$_interopRequireDefault","$d39edcb6084a59a9$exports","mergeClasses","$d39edcb6084a59a9$var$_forOwn3","$d39edcb6084a59a9$var$_interopRequireDefault","$e883f280c82ab4ba$exports","$f6dfd7dc5e5ac807$var$defineProperty","$f6dfd7dc5e5ac807$exports","$48f1054f3ca5da26$exports","configurable","enumerable","writable","$6a410827939ce210$var$hasOwnProperty","$6a410827939ce210$exports","$31c6b882f05692c6$exports","isNew","newValue","$2ce1a18ea44c4deb$exports","$292ee6609f4e7a59$exports","$a4e56b5838b2897c$var$hasOwnProperty","$a4e56b5838b2897c$exports","isProto","$9db77247add89d2e$exports","$2f9edf92839feaff$exports","$cf08566b5f17aa4f$exports","$f8d658d15a2edcd4$exports","$d5293e6fa7b2b339$var$nativeGetSymbols","$d5293e6fa7b2b339$exports","$928edd92858e1662$exports","$ddc827b5ca2f5f3f$exports","$7d0a900e76da2d15$var$hasOwnProperty","$7d0a900e76da2d15$exports","input","$7ab071444f25f0fd$exports","arrayBuffer","$ae5e74912e4ee32e$exports","dataView","$bb1b70f977046c2d$var$reFlags","$bb1b70f977046c2d$exports","regexp","lastIndex","$2974eb792905b227$var$symbolProto","$2974eb792905b227$var$symbolValueOf","$2974eb792905b227$exports","$265d56dce3afa249$exports","typedArray","$b5e8347885b983a5$exports","$e9b96b6ee5614800$var$objectCreate","create","$e9b96b6ee5614800$var$baseCreate","$e9b96b6ee5614800$exports","$cdfd1eab1ed286bf$exports","$334fb66d416be2f0$exports","$eaa21bf4e287fd7f$var$nodeIsMap","isMap","$eaa21bf4e287fd7f$var$isMap","$eaa21bf4e287fd7f$exports","$01afc3bfd7071a26$exports","$10f055afd4d7cf22$var$nodeIsSet","isSet","$10f055afd4d7cf22$var$isSet","$10f055afd4d7cf22$exports","$8d55860d9ee8b98c$var$argsTag","$8d55860d9ee8b98c$var$funcTag","$8d55860d9ee8b98c$var$objectTag","$8d55860d9ee8b98c$var$cloneableTags","$8d55860d9ee8b98c$exports","$8d55860d9ee8b98c$var$baseClone","key1","isFlat","isFull","isFunc","$4vs1M","subValue","$d39edcb6084a59a9$var$_cloneDeep3","$bd24f08a3e765b6f$var$CLONE_DEEP_FLAG","$d39edcb6084a59a9$var$_extends","target","$d39edcb6084a59a9$var$mergeClasses","classes","activeNames","styles","toMerge","$e812653e67a6d710$var$_mergeClasses2","$bc1af4bbd8db85dd$exports","autoprefix","$bc1af4bbd8db85dd$var$_forOwn3","$bc1af4bbd8db85dd$var$_extends","$bc1af4bbd8db85dd$var$transforms","borderRadius","msBorderRadius","MozBorderRadius","OBorderRadius","WebkitBorderRadius","boxShadow","msBoxShadow","MozBoxShadow","OBoxShadow","WebkitBoxShadow","userSelect","WebkitTouchCallout","KhtmlUserSelect","MozUserSelect","msUserSelect","WebkitUserSelect","flex","WebkitBoxFlex","MozBoxFlex","WebkitFlex","msFlex","flexBasis","WebkitFlexBasis","justifyContent","WebkitJustifyContent","transition","msTransition","MozTransition","OTransition","WebkitTransition","msTransform","MozTransform","OTransform","WebkitTransform","absolute","direction","split","position","right","bottom","extend","otherElementStyles","otherStyle","$bc1af4bbd8db85dd$var$autoprefix","elements","prefixed","element","expanded","$e812653e67a6d710$var$_autoprefix2","$5b17b1ddd0131a26$exports","$5b17b1ddd0131a26$var$_extends","$5b17b1ddd0131a26$var$_react2","$5b17b1ddd0131a26$var$_interopRequireDefault","$5b55226219c5badd$exports","$5b17b1ddd0131a26$var$_classCallCheck","instance","Constructor","$5b17b1ddd0131a26$var$_possibleConstructorReturn","ReferenceError","$5b17b1ddd0131a26$var$_inherits","subClass","superClass","setPrototypeOf","__proto__","$5b17b1ddd0131a26$var$hover","Component","Span","_React$Component","Hover","_ref","_temp","_this","_len","_key","concat","handleMouseOver","setState","handleMouseOut","render","onMouseOver","onMouseOut","$e812653e67a6d710$var$_hover3","$57d875dd202e8322$exports","active","$57d875dd202e8322$var$_extends","$57d875dd202e8322$var$_react2","$57d875dd202e8322$var$_interopRequireDefault","$57d875dd202e8322$var$_classCallCheck","$57d875dd202e8322$var$_possibleConstructorReturn","$57d875dd202e8322$var$_inherits","$57d875dd202e8322$var$active","Active","handleMouseDown","handleMouseUp","onMouseUp","$e812653e67a6d710$var$_active2","$8f2c5b5ba3983d7d$exports","setProp","abs","$e812653e67a6d710$var$_loop3","$e812653e67a6d710$var$ReactCSS","activations","merged","$d52980caa599fe1f$export$2e2bcd8739ae039","_color","setValue","val","includes","pattern","reactCSS","colorPreviewWrapper","pickerComponent","colorPreview","useHueMode","spellCheck","$35ca578fd17d5d2a$export$2e2bcd8739ae039","param","colors","onClick","clr","$eb935346a8ccb34a$var$r","$eb935346a8ccb34a$var$t","$eb935346a8ccb34a$var$n","_n","$eb935346a8ccb34a$var$e","$eb935346a8ccb34a$var$u","isFinite","$eb935346a8ccb34a$var$a","$eb935346a8ccb34a$var$o","$eb935346a8ccb34a$var$i","$eb935346a8ccb34a$var$s","$eb935346a8ccb34a$var$h","u","$eb935346a8ccb34a$var$b","$eb935346a8ccb34a$var$g","$eb935346a8ccb34a$var$d","$eb935346a8ccb34a$var$f","$eb935346a8ccb34a$var$c","$eb935346a8ccb34a$var$l","$eb935346a8ccb34a$var$p","$eb935346a8ccb34a$var$v","$eb935346a8ccb34a$var$m","$eb935346a8ccb34a$var$y","r1","$eb935346a8ccb34a$var$N","$eb935346a8ccb34a$var$x","trim","$eb935346a8ccb34a$var$M","$eb935346a8ccb34a$var$H","$eb935346a8ccb34a$var$$","$eb935346a8ccb34a$export$4d30ed660ff08d0","r2","parsed","rgba","isValid","brightness","isDark","isLight","toHex","_$r","toRgb","toRgbString","toHsl","toHslString","toHsv","invert","$eb935346a8ccb34a$export$c8efe09109f9cb9e","saturate","desaturate","grayscale","lighten","darken","rotate","alpha","isEqual","$fdb67c921c041723$export$2e2bcd8739ae039","convertedValue","colord","hsv","$acc8e8e80a8c8e3d$export$2e2bcd8739ae039","formComponent","$8d8ec509b2dabd6c$export$2e2bcd8739ae039","$35e90aadd1ba6435$export$2e2bcd8739ae039","pickerRef","resetRef","startedWhenMounted","startedInside","listener","contains","validateEventStart","$11301fd5eebc4d6e$export$2e2bcd8739ae039","$4154559db83dad58$export$2e2bcd8739ae039","$9fb400e4497293f5$export$2e2bcd8739ae039","triggerButton","togglePickerHandler","$8f45dead40d2ca40$export$2e2bcd8739ae039","control","customizerSetting","choices","parseEmptyValue","parseHueModeValue","hueValue","parseInputValue","convertColorForInput","parsePickerValue","convertColorForPicker","inputValue","setInputValue","pickerValue","setPickerValue","currentInputValue","currentPickerValue","updateComponentState","valueForInput","JSON","stringify","valueForPicker","saveToCustomizer","convertColorForCustomizer","parseCustomizerValue","initialColor","controlLabel","dangerouslySetInnerHTML","__html","label","controlDescription","description","KirkiPickerComponent","formRef","isPickerOpen","setIsPickerOpen","usePositionFixed","labelStyle","pickerContainerStyle","setPickerContainerStyle","getPickerContainerStyle","padding","getComputedStyle","parentNode","paddingLeft","controlLeftOffset","offsetLeft","convertInputValueTo6Digits","openPicker","closePicker","setTimeout","useWindowResize","useFocusOutside","useClickOutside","jQuery","wp","wpColorPicker","wpColorPickerSwatches","options","palettes","swatches","controlHeader","Fragment","setNotificationContainer","formClassName","pickerHeader","pickerContainerClassName","pickerTrigger","display","swatchColor","$ffbc67b60e0ee796$export$2e2bcd8739ae039","customize","Control","initialize","id","bind","onRemoved","removedControl","destroy","remove","unbind","notifications","renderContent","mode","form","$ffbc67b60e0ee796$var$_extends","setting","ready","unmountComponentAtNode","controlConstructor","KirkiReactColorfulControl"],"version":3,"file":"control.js.map"}kirki-packages/control-react-colorful/dist/control.css000064400000013375147177211530017206 0ustar00.customize-control-kirki-react-colorful .kirki-control-form{box-sizing:border-box;position:relative}.customize-control-kirki-react-colorful .kirki-control-form *{box-sizing:border-box}.customize-control-kirki-react-colorful .kirki-control-cols{align-items:flex-start;display:flex}.customize-control-kirki-react-colorful .kirki-control-left-col{width:90%;width:calc(100% - 35px);padding-right:30px}.customize-control-kirki-react-colorful .kirki-control-right-col{width:35px;justify-content:flex-end;display:flex}.customize-control-kirki-react-colorful .use-hue-mode .react-colorful{height:auto}.customize-control-kirki-react-colorful .use-hue-mode .react-colorful__saturation{display:none}.customize-control-kirki-react-colorful .use-hue-mode .react-colorful__last-control{border-radius:4px}.customize-control-kirki-react-colorful .use-hue-mode input.kirki-color-input{padding-left:8px}.customize-control-kirki-react-colorful .kirki-trigger-circle-wrapper{width:33px;height:33px;border:1px solid #ccc;border-radius:50%;justify-content:center;align-items:center;padding:3px;display:flex;position:relative;top:-3px}.customize-control-kirki-react-colorful .kirki-trigger-circle{width:25px;height:25px;cursor:pointer;background-size:10px;border:none;border-radius:50%;padding:0;display:block;position:relative}.customize-control-kirki-react-colorful .kirki-trigger-circle .kirki-color-preview{width:100%;height:100%;position:absolute;top:0;left:0}.customize-control-kirki-react-colorful .colorPickerContainer{width:100%;z-index:9999;opacity:0;visibility:hidden;background-color:#fff;border-radius:6px;margin-top:5px;padding:15px;transition:opacity .2s,visibility .2s;position:absolute;top:35px;right:0;box-shadow:0 12px 15px rgba(0,0,0,.09)}.customize-control-kirki-react-colorful .colorPickerContainer.is-open{opacity:1;visibility:visible;transition:opacity .2s 10ms,visibility .2s 10ms}.customize-control-kirki-react-colorful .react-colorful{width:100%;border-radius:4px}.customize-control-kirki-react-colorful .react-colorful__saturation{border-radius:4px 4px 0 0}.customize-control-kirki-react-colorful .react-colorful__last-control{border-radius:0 0 4px 4px}.customize-control-kirki-react-colorful .react-colorful__pointer{width:20px;height:20px}.customize-control-kirki-react-colorful .kirki-color-input-wrapper{margin-top:15px}.customize-control-kirki-react-colorful .kirki-color-input-control{width:100%;align-items:center;display:flex;position:relative}.customize-control-kirki-react-colorful input.kirki-color-input{width:100%;height:30px;color:#333;z-index:1;border:1px solid #ccc;border-radius:4px;padding-left:32px;padding-right:8px;line-height:30px;display:block;position:relative}.customize-control-kirki-react-colorful .kirki-color-input:focus,.customize-control-kirki-react-colorful .kirki-color-input:active{border-color:#2271b1;outline:none;box-shadow:0 0 0 1px #2271b1}.customize-control-kirki-react-colorful .kirki-color-preview-wrapper{width:22px;height:22px;z-index:2;background-repeat:repeat;background-size:8px;border:2px solid #fff;border-radius:50%;position:absolute;left:6px;box-shadow:0 0 0 1px #ddd}.customize-control-kirki-react-colorful .kirki-color-preview,.customize-control-kirki-react-colorful .kirki-control-reset{cursor:pointer;background-color:rgba(0,0,0,0);padding:0;position:absolute}.customize-control-kirki-react-colorful .kirki-color-preview{width:100%;height:100%;border-width:0;border-radius:50%;display:block}.customize-control-kirki-react-colorful .kirki-control-reset{width:17px;height:17px;z-index:3;border-width:0;border-radius:50%;justify-content:center;align-items:center;display:flex;top:4px;right:35px}.customize-control-kirki-react-colorful .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-react-colorful .kirki-control-reset i{width:auto;height:auto;font-size:12px;transition:transform .2s;transform:rotate(45deg)}.customize-control-kirki-react-colorful .kirki-color-swatches{flex-wrap:wrap;align-items:center;gap:4px;margin-bottom:12px;display:flex}.customize-control-kirki-react-colorful .kirki-color-swatch{width:25px;height:25px;cursor:pointer;border:2px solid #fff;border-radius:50%;padding:0;transition:transform .2s;display:block;position:relative;transform:scale(1);box-shadow:0 0 0 1px #ddd}.customize-control-kirki-react-colorful .kirki-color-swatch:active,.customize-control-kirki-react-colorful .kirki-color-swatch:focus{outline:none}.customize-control-kirki-react-colorful .kirki-color-swatch:hover,.customize-control-kirki-react-colorful .kirki-color-swatch:focus{transform:scale(1.1)}.customize-control-kirki-react-colorful .kirki-label-tooltip{width:auto;width:max-content;max-width:100px;color:#fff;opacity:0;visibility:hidden;background-color:rgba(0,0,0,.7);border-radius:4px;padding:7px 10px 3px;transition:all .2s;position:absolute;bottom:45px;left:-8px}.customize-control-kirki-react-colorful .kirki-label-tooltip:before{content:"";border:7px solid rgba(0,0,0,0);border-top:8px solid rgba(0,0,0,.7);border-bottom-width:0;position:absolute;bottom:-8px;left:19px}.customize-control-kirki-react-colorful .kirki-label-tooltip .customize-control-title{line-height:1.2}.customize-control-kirki-react-colorful .kirki-trigger-circle-wrapper:hover~.kirki-label-tooltip{opacity:1;visibility:visible}.customize-control-kirki-react-colorful[data-kirki-parent-control-type=kirki-multicolor]{width:35px;margin-bottom:20px;margin-right:8px;padding-right:0}.customize-control-kirki-react-colorful[data-kirki-parent-control-type=kirki-multicolor] .kirki-control-reset{top:-19px;right:8px}.customize-control-kirki-react-colorful[data-kirki-parent-control-type=kirki-typography] .colorPickerContainer{top:55px}.customize-control-kirki-react-colorful[data-kirki-parent-control-type=kirki-typography] .kirki-control-reset{top:30px;left:35px;right:auto} /*# sourceMappingURL=control.css.map */ kirki-packages/control-dashicons/LICENSE000064400000002060147177211530014075 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/control-dashicons/src/Util/Dashicons.php000064400000010734147177211530017227 0ustar00 [ 'menu', 'menu-alt', 'menu-alt2', 'menu-alt3', 'admin-site', 'admin-site-alt', 'admin-site-alt2', 'admin-site-alt3', 'dashboard', 'admin-post', 'admin-media', 'admin-links', 'admin-page', 'admin-comments', 'admin-appearance', 'admin-plugins', 'plugins-checked', 'admin-users', 'admin-tools', 'admin-settings', 'admin-network', 'admin-home', 'admin-generic', 'admin-collapse', 'filter', 'admin-customizer', 'admin-multisite' ], 'welcome-screen' => [ 'welcome-write-blog', 'welcome-add-page', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-comments', 'welcome-learn-more' ], 'post-formats' => [ 'format-aside', 'format-image', 'format-gallery', 'format-video', 'format-status', 'format-quote', 'format-chat', 'format-audio', 'camera', 'camera-alt', 'images-alt', 'images-alt2', 'video-alt', 'video-alt2', 'video-alt3' ], 'media' => [ 'media-archive', 'media-audio', 'media-code', 'media-default', 'media-document', 'media-interactive', 'media-spreadsheet', 'media-text', 'media-video', 'playlist-audio', 'playlist-video', 'controls-play', 'controls-pause', 'controls-forward', 'controls-skipforward', 'controls-back', 'controls-skipback', 'controls-repeat', 'controls-volumeon', 'controls-volumeoff' ], 'image-editing' => [ 'image-crop', 'image-rotate', 'image-rotate-left', 'image-rotate-right', 'image-flip-vertical', 'image-flip-horizontal', 'image-filter', 'undo', 'redo' ], 'tinymce' => [ 'editor-bold', 'editor-italic', 'editor-ul', 'editor-ol', 'editor-ol-rtl', 'editor-quote', 'editor-alignleft', 'editor-aligncenter', 'editor-alignright', 'editor-insertmore', 'editor-spellcheck', 'editor-expand', 'editor-contract', 'editor-kitchensink', 'editor-underline', 'editor-justify', 'editor-textcolor', 'editor-paste-word', 'editor-paste-text', 'editor-removeformatting', 'editor-video', 'editor-customchar', 'editor-outdent', 'editor-indent', 'editor-help', 'editor-strikethrough', 'editor-unlink', 'editor-rtl', 'editor-ltr', 'editor-break', 'editor-code', 'editor-paragraph', 'editor-table' ], 'posts' => [ 'align-left', 'align-right', 'align-center', 'align-none', 'lock', 'unlock', 'calendar', 'calendar-alt', 'visibility', 'hidden', 'post-status', 'edit', 'trash', 'sticky' ], 'sorting' => [ 'external', 'arrow-up', 'arrow-down', 'arrow-right', 'arrow-left', 'arrow-up-alt', 'arrow-down-alt', 'arrow-right-alt', 'arrow-left-alt', 'arrow-up-alt2', 'arrow-down-alt2', 'arrow-right-alt2', 'arrow-left-alt2', 'sort', 'leftright', 'randomize', 'list-view', 'exerpt-view', 'grid-view', 'move' ], 'social' => [ 'share', 'share-alt', 'share-alt2', 'twitter', 'rss', 'email', 'email-alt', 'email-alt2', 'facebook', 'facebook-alt', 'googleplus', 'networking', 'instagram' ], 'wordpress_org' => [ 'hammer', 'art', 'migrate', 'performance', 'universal-access', 'universal-access-alt', 'tickets', 'nametag', 'clipboard', 'heart', 'megaphone', 'schedule', 'tide', 'rest-api', 'code-standards' ], 'products' => [ 'wordpress', 'wordpress-alt', 'pressthis', 'update', 'update-alt', 'screenoptions', 'info', 'cart', 'feedback', 'cloud', 'translation' ], 'taxonomies' => [ 'tag', 'category' ], 'widgets' => [ 'archive', 'tagcloud', 'text' ], 'notifications' => [ 'yes', 'yes-alt', 'no', 'no-alt', 'plus', 'plus-alt', 'minus', 'dismiss', 'marker', 'star-filled', 'star-half', 'star-empty', 'flag', 'warning' ], 'misc' => [ 'location', 'location-alt', 'vault', 'shield', 'shield-alt', 'sos', 'search', 'slides', 'text-page', 'analytics', 'chart-pie', 'chart-bar', 'chart-line', 'chart-area', 'groups', 'businessman', 'businesswoman', 'businessperson', 'id', 'id-alt', 'products', 'awards', 'forms', 'testimonial', 'portfolio', 'book', 'book-alt', 'download', 'upload', 'backup', 'clock', 'lightbulb', 'microphone', 'desktop', 'tablet', 'smartphone', 'phone', 'index-card', 'carrot', 'building', 'store', 'album', 'palmtree', 'tickets-alt', 'money', 'smiley', 'thumbs-up', 'thumbs-down', 'layout', 'paperclip' ], ]; } } kirki-packages/control-dashicons/src/control.js000064400000000176147177211530015703 0ustar00import "./control.scss"; wp.customize.controlConstructor['kirki-dashicons'] = wp.customize.kirkiDynamicControl.extend( {} ); kirki-packages/control-dashicons/src/control.scss000064400000001126147177211530016236 0ustar00.customize-control-kirki-dashicons { position: relative; label { position: relative; display: inline-block; } .icons-wrapper { max-height: 300px; overflow-y: scroll; h4 { font-weight: 300; margin: 0.7em 0; } .dashicons { padding: 3px; font-size: 25px; width: 25px; height: 25px; border: 1px solid transparent; } input { display: none; &:checked { + label { .dashicons { border: 1px solid #3498DB; color: #000; } } } } } } kirki-packages/control-dashicons/src/Field/Dashicons.php000064400000003611147177211530017331 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = 'sanitize_text_field'; } } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-dashicons'; } return $args; } } kirki-packages/control-dashicons/src/Control/Dashicons.php000064400000010663147177211530017733 0ustar00json['icons'] = \Kirki\Util\Dashicons::get_icons(); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected * @since 1.0 * @return void */ protected function content_template() { ?> <# if ( data.label ) { #>{{{ data.label }}}<# } #> <# if ( data.description ) { #>{{{ data.description }}}<# } #>
    <# if ( ! _.isUndefined( data.choices ) && 1 < _.size( data.choices ) ) { #> <# for ( key in data.choices ) { #> checked="checked"<# } #>> <# } #> <# } else { #> <# var dashiconSections = { 'admin-menu': '', 'welcome-screen': '', 'post-formats': '', 'media': '', 'image-editing': '', 'tinymce': 'TinyMCE', 'posts': '', 'sorting': '', 'social': '', 'wordpress_org': 'WordPress', 'products': '', 'taxonomies': '', 'widgets': '', 'notifications': '', 'misc': '' }; #> <# _.each( dashiconSections, function( sectionLabel, sectionKey ) { #>

    {{ sectionLabel }}

    <# for ( key in data.icons[ sectionKey ] ) { #> checked="checked"<# } #>> <# } #> <# }); #> <# } #>
    'WP_Customize_Panel', 'kirki-nested' => '\Kirki\Panel_Types\Nested', ]; /** * Constructor. * * @access public * @since 1.0 * @param string $id The panel ID. * @param array $args The panel args. */ public function __construct( $id, $args = [] ) { $this->id = $id; $this->args = $args; $this->panel_types = apply_filters( 'kirki_panel_types', $this->panel_types ); if ( $this->args ) { add_action( 'customize_register', [ $this, 'add_panel' ] ); } add_action( 'customize_controls_enqueue_scripts', [ $this, 'enqueue_scrips' ] ); } /** * Add the panel using the Customizer API. * * @access public * @since 1.0 * @param object $wp_customize The customizer object. */ public function add_panel( $wp_customize ) { // Figure out the type of this panel. $this->args['type'] = isset( $this->args['type'] ) ? $this->args['type'] : 'default'; if ( isset( $this->args['panel'] ) && ! empty( $this->args['panel'] ) ) { $this->args['type'] = 'kirki-nested'; } $this->args['type'] = false === strpos( $this->args['type'], 'kirki-' ) ? 'kirki-' . $this->args['type'] : $this->args['type']; $this->args['type'] = 'kirki-default' === $this->args['type'] ? 'default' : $this->args['type']; // Get the class we'll be using to create this panel. $panel_classname = $this->panel_types[ $this->args['type'] ]; // Fallback to the default panel type if the custom class doesn't exist. $panel_classname = class_exists( $panel_classname ) ? $panel_classname : 'WP_Customize_Panel'; // Add the panel. $wp_customize->add_panel( new $panel_classname( $wp_customize, $this->id, apply_filters( 'kirki_panel_args', $this->args, $this->id ) ) ); // Run an action after the panel has been added. do_action( 'kirki_panel_added', $this->id, $this->args ); } /** * Removes the panel. * * @access public * @since 1.0 * @return void */ public function remove() { add_action( 'customize_register', [ $this, 'remove_panel' ], 9999 ); } /** * Add the panel using the Customizer API. * * @access public * @since 1.0 * @param object $wp_customize The customizer object. */ public function remove_panel( $wp_customize ) { $wp_customize->remove_panel( $this->id ); } /** * Enqueues any necessary scripts and styles. * * @access public * @since 1.0 */ public function enqueue_scrips() { wp_enqueue_script( 'kirki-panels', URL::get_from_path( __DIR__ . '/script.js' ), [ 'jquery', 'customize-base', 'customize-controls' ], '1.0', false ); } } kirki-packages/module-panels/src/Panel_Types/Nested.php000064400000002212147177211530017150 0ustar00title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; return $array; } } kirki-packages/module-panels/src/script.js000064400000005612147177211530014643 0ustar00/** * @see https://wordpress.stackexchange.com/a/256103/17078 */ ( function() { var _panelEmbed, _panelIsContextuallyActive, _panelAttachEvents; wp.customize.bind( 'pane-contents-reflowed', function() { var panels = []; // Reflow Panels. wp.customize.panel.each( function( panel ) { if ( 'kirki-nested' !== panel.params.type || _.isUndefined( panel.params.panel ) ) { return; } panels.push( panel ); } ); panels.sort( wp.customize.utils.prioritySort ).reverse(); jQuery.each( panels, function( i, panel ) { var parentContainer = jQuery( '#sub-accordion-panel-' + panel.params.panel ); parentContainer.children( '.panel-meta' ).after( panel.headContainer ); } ); } ); // Extend Panel. _panelEmbed = wp.customize.Panel.prototype.embed; _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive; _panelAttachEvents = wp.customize.Panel.prototype.attachEvents; wp.customize.Panel = wp.customize.Panel.extend( { attachEvents: function() { var panel = this; if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.panel ) ) { _panelAttachEvents.call( this ); return; } _panelAttachEvents.call( this ); panel.expanded.bind( function( expanded ) { if ( expanded ) { wp.customize.panel( panel.params.panel ).contentContainer.addClass( 'current-panel-parent' ); } else { wp.customize.panel( panel.params.panel ).contentContainer.removeClass( 'current-panel-parent' ); } } ); panel.container.find( '.customize-panel-back' ).off( 'click keydown' ).on( 'click keydown', function( event ) { if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( panel.expanded() ) { wp.customize.panel( panel.params.panel ).expand(); } } ); }, embed: function() { var panel = this, parentContainer; if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.panel ) ) { _panelEmbed.call( this ); return; } _panelEmbed.call( this ); parentContainer = jQuery( '#sub-accordion-panel-' + this.params.panel ); parentContainer.append( panel.headContainer ); }, isContextuallyActive: function() { var panel = this, activeCount = 0, children; if ( 'kirki-nested' !== this.params.type ) { return _panelIsContextuallyActive.call( this ); } children = this._children( 'panel', 'section' ); wp.customize.panel.each( function( child ) { if ( ! child.params.panel || child.params.panel !== panel.id ) { return; } children.push( child ); } ); children.sort( wp.customize.utils.prioritySort ); _( children ).each( function( child ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } } ); return ( 0 !== activeCount ); } } ); }( jQuery ) ); kirki-packages/module-css/LICENSE000064400000002060147177211530012517 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/module-css/src/CSS/Property/Background_Image.php000064400000001705147177211530020454 0ustar00value ) && isset( $this->value['url'] ) ) { $this->value = $this->value['url']; } if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) { if ( empty( $this->value ) ) { return; } if ( preg_match( '/^\d+$/', $this->value ) ) { $this->value = 'url("' . set_url_scheme( wp_get_attachment_url( $this->value ) ) . '")'; } else { $this->value = 'url("' . set_url_scheme( $this->value ) . '")'; } } } } kirki-packages/module-css/src/CSS/Property/Background_Position.php000064400000003406147177211530021236 0ustar00value = trim( $this->value ); // If you use calc() there, I suppose you know what you're doing. // No need to process this any further, just exit. if ( false !== strpos( $this->value, 'calc' ) ) { return; } // If the value is initial or inherit, we don't need to do anything. // Just exit. if ( 'initial' === $this->value || 'inherit' === $this->value ) { return; } $x_dimensions = [ 'left', 'center', 'right' ]; $y_dimensions = [ 'top', 'center', 'bottom' ]; // If there's a space, we have an X and a Y value. if ( false !== strpos( $this->value, ' ' ) ) { $xy = explode( ' ', $this->value ); $x = trim( $xy[0] ); $y = trim( $xy[1] ); // If x is not left/center/right, we need to sanitize it. if ( ! in_array( $x, $x_dimensions, true ) ) { $x = sanitize_text_field( $x ); } if ( ! in_array( $y, $y_dimensions, true ) ) { $y = sanitize_text_field( $y ); } $this->value = $x . ' ' . $y; return; } $x = 'center'; foreach ( $x_dimensions as $x_dimension ) { if ( false !== strpos( $this->value, $x_dimension ) ) { $x = $x_dimension; } } $y = 'center'; foreach ( $y_dimensions as $y_dimension ) { if ( false !== strpos( $this->value, $y_dimension ) ) { $y = $y_dimension; } } $this->value = $x . ' ' . $y; } } kirki-packages/module-css/src/CSS/Property/Font_Family.php000064400000001736147177211530017506 0ustar00value; // Make sure the value is a string. // If not, then early exit. if ( ! is_string( $family ) ) { return; } // Hack for standard fonts. $family = str_replace( '"', '"', $family ); // Add double quotes if needed. if ( false !== strpos( $family, ' ' ) && false === strpos( $family, '"' ) ) { $this->value = '"' . $family . '"'; } $this->value = html_entity_decode( $family, ENT_QUOTES ); } } kirki-packages/module-css/src/CSS/Generator.php000064400000015261147177211530015377 0ustar00 self::$output, 'sanitize_callback' => null, ], ]; } // Get the value of this field. $option_type = ( isset( $field['option_type'] ) ) ? $field['option_type'] : 'theme_mod'; $default = ( isset( $field['default'] ) ) ? $field['default'] : ''; $setting_name = $field['settings']; if ( 'option' === $option_type ) { if ( ! empty( $field['option_name'] ) && 0 !== stripos( $setting_name, $field['option_name'] . '[' ) ) { $setting_name = $field['option_name'] . '[' . $field['settings'] . ']'; } } self::$value = apply_filters( 'kirki_get_value', get_theme_mod( $field['settings'], $default ), $setting_name, $default, $option_type ); // Find the class that will handle the outpout for this field. $classname = '\Kirki\Module\CSS\Output'; $field_output_classes = apply_filters( 'kirki_output_control_classnames', [] ); $field_output_classes = apply_filters( "kirki_{$field['kirki_config']}_output_control_classnames", $field_output_classes ); if ( array_key_exists( self::$field_type, $field_output_classes ) ) { $classname = $field_output_classes[ self::$field_type ]; } $obj = new $classname( $field['kirki_config'], self::$output, self::$value, $field ); return $obj->get_styles(); } /** * Gets the array of generated styles and creates the minimized, inline CSS. * * @static * @access public * @param array $css The CSS definitions array. * @return string The generated CSS. */ public static function styles_parse( $css = [] ) { // Pass our styles from the kirki_styles_array filter. $css = apply_filters( 'kirki_styles_array', $css ); // Process the array of CSS properties and produce the final CSS. $final_css = ''; if ( ! is_array( $css ) || empty( $css ) ) { return ''; } foreach ( $css as $media_query => $styles ) { $final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : ''; foreach ( $styles as $style => $style_array ) { $css_for_style = ''; foreach ( $style_array as $property => $value ) { if ( is_string( $value ) && '' !== $value ) { $css_for_style .= $property . ':' . $value . ';'; } elseif ( is_array( $value ) ) { foreach ( $value as $subvalue ) { if ( is_string( $subvalue ) && '' !== $subvalue ) { $css_for_style .= $property . ':' . $subvalue . ';'; } } } $value = ( is_string( $value ) ) ? $value : ''; } if ( '' !== $css_for_style ) { $final_css .= $style . '{' . $css_for_style . '}'; } } $final_css .= ( 'global' !== $media_query ) ? '}' : ''; } return $final_css; } /** * Add prefixes if necessary. * * @param array $css The CSS definitions array. * @return array */ public static function add_prefixes( $css ) { if ( is_array( $css ) ) { foreach ( $css as $media_query => $elements ) { foreach ( $elements as $element => $style_array ) { foreach ( $style_array as $property => $value ) { // Add -webkit-* and -moz-*. if ( is_string( $property ) && in_array( $property, [ 'border-radius', 'box-shadow', 'box-sizing', 'text-shadow', 'transform', 'background-size', 'transition', 'transition-property', ], true ) ) { unset( $css[ $media_query ][ $element ][ $property ] ); $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value; $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value; $css[ $media_query ][ $element ][ $property ] = $value; } // Add -ms-* and -o-*. if ( is_string( $property ) && in_array( $property, [ 'transform', 'background-size', 'transition', 'transition-property', ], true ) ) { unset( $css[ $media_query ][ $element ][ $property ] ); $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value; $css[ $media_query ][ $element ][ '-o-' . $property ] = $value; $css[ $media_query ][ $element ][ $property ] = $value; } } } } } return $css; } } kirki-packages/module-css/src/CSS/Output.php000064400000026713147177211530014755 0ustar00value = $value; $this->output = $output; $this->field = $field; $this->parse_output(); } /** * If we have a sanitize_callback defined, apply it to the value. * * @param array $output The output args. * @param string|array $value The value. * * @return string|array */ protected function apply_sanitize_callback( $output, $value ) { if ( isset( $output['sanitize_callback'] ) && null !== $output['sanitize_callback'] ) { // If the sanitize_callback is invalid, return the value. if ( ! is_callable( $output['sanitize_callback'] ) ) { return $value; } return call_user_func( $output['sanitize_callback'], $this->value ); } return $value; } /** * If we have a value_pattern defined, apply it to the value. * * @param array $output The output args. * @param string|array $value The value. * @return string|array */ protected function apply_value_pattern( $output, $value ) { if ( isset( $output['value_pattern'] ) && is_string( $output['value_pattern'] ) ) { if ( ! is_array( $value ) ) { $value = str_replace( '$', $value, $output['value_pattern'] ); } if ( is_array( $value ) ) { foreach ( array_keys( $value ) as $value_k ) { if ( is_array( $value[ $value_k ] ) ) { continue; } if ( isset( $output['choice'] ) ) { if ( $output['choice'] === $value_k ) { $value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] ); } continue; } $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] ); } } $value = $this->apply_pattern_replace( $output, $value ); } return $value; } /** * If we have a value_pattern defined, apply it to the value. * * @param array $output The output args. * @param string|array $value The value. * @return string|array */ protected function apply_pattern_replace( $output, $value ) { if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) { $option_type = ( isset( $this->field['option_type'] ) ) ? $this->field['option_type'] : 'theme_mod'; $option_name = ( isset( $this->field['option_name'] ) ) ? $this->field['option_name'] : ''; $options = []; if ( $option_name ) { $options = ( 'site_option' === $option_type ) ? get_site_option( $option_name ) : get_option( $option_name ); } foreach ( $output['pattern_replace'] as $search => $replace ) { $replacement = ''; switch ( $option_type ) { case 'option': if ( is_array( $options ) ) { if ( $option_name ) { $subkey = str_replace( [ $option_name, '[', ']' ], '', $replace ); $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : ''; break; } $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : ''; break; } $replacement = get_option( $replace ); break; case 'site_option': $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace ); break; case 'user_meta': $user_id = get_current_user_id(); if ( $user_id ) { $replacement = get_user_meta( $user_id, $replace, true ); } break; default: $replacement = get_theme_mod( $replace ); if ( ! $replacement ) { $replacement = Values::get_value( $this->field['kirki_config'], $replace ); } } $replacement = ( false === $replacement ) ? '' : $replacement; if ( is_array( $value ) ) { foreach ( $value as $k => $v ) { $_val = ( isset( $value[ $v ] ) ) ? $value[ $v ] : $v; $value[ $k ] = str_replace( $search, $replacement, $_val ); } return $value; } $value = str_replace( $search, $replacement, $value ); } } return $value; } /** * Parses the output arguments. * Calls the process_output method for each of them. * * @access protected */ protected function parse_output() { foreach ( $this->output as $output ) { $skip = false; // Apply any sanitization callbacks defined. $value = $this->apply_sanitize_callback( $output, $this->value ); // Skip if value is empty. if ( '' === $this->value ) { $skip = true; } // No need to proceed this if the current value is the same as in the "exclude" value. if ( isset( $output['exclude'] ) && is_array( $output['exclude'] ) ) { foreach ( $output['exclude'] as $exclude ) { if ( is_array( $value ) ) { if ( is_array( $exclude ) ) { $diff1 = array_diff( $value, $exclude ); $diff2 = array_diff( $exclude, $value ); if ( empty( $diff1 ) && empty( $diff2 ) ) { $skip = true; } } // If 'choice' is defined check for sub-values too. // Fixes https://github.com/aristath/kirki/issues/1416. if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison $skip = true; } } if ( $skip ) { continue; } // Skip if value is defined as excluded. if ( $exclude === $value || ( '' === $exclude && empty( $value ) ) ) { $skip = true; } } } if ( $skip ) { continue; } // Apply any value patterns defined. $value = $this->apply_value_pattern( $output, $value ); if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { $output['element'] = array_unique( $output['element'] ); sort( $output['element'] ); $output['element'] = implode( ',', $output['element'] ); } $value = $this->process_value( $value, $output ); if ( is_admin() ) { // In admin area, only output kirki-styles/kirki-inline-styles inside editing screen. if ( ! isset( $_GET['editor'] ) || 1 !== (int) $_GET['editor'] ) { // phpcs:ignore WordPress.Security.NonceVerification continue; } } else { // Check if this is a frontend style. if ( isset( $output['context'] ) && ! in_array( 'front', $output['context'], true ) ) { continue; } } /** * Inside gutenberg editing screen, prepend `.editor-styles-wrapper` to the element * so that it doesn't polute elements other than inside the editing content. */ if ( isset( $_GET['editor'] ) && 1 === (int) $_GET['editor'] ) { if ( isset( $output['element'] ) && ! empty( $output['element'] ) ) { if ( -1 < strpos( $output['element'], ',' ) ) { $elms = explode( ',', $output['element'] ); foreach ( $elms as $index => $elm ) { if ( ! empty( $elm ) ) { $elms[ $index ] = '.editor-styles-wrapper ' . $elm; $elms[ $index ] = str_ireplace( '.editor-styles-wrapper :root', '.editor-styles-wrapper', $elms[ $index ] ); } } $output['element'] = implode( ',', $elms ); } else { $output['element'] = '.editor-styles-wrapper ' . $output['element']; $output['element'] = str_ireplace( '.editor-styles-wrapper :root', '.editor-styles-wrapper', $output['element'] ); } } } $this->process_output( $output, $value ); } } /** * Parses an output and creates the styles array for it. * * @access protected * @param array $output The field output. * @param string|array $value The value. * * @return null */ protected function process_output( $output, $value ) { $output = apply_filters( 'kirki_output_item_args', $output, $value, $this->output, $this->field ); if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) { return; } $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global'; $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : ''; $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : ''; $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : ''; // Properties that can accept multiple values. // Useful for example for gradients where all browsers use the "background-image" property // and the browser prefixes go in the value_pattern arg. $accepts_multiple = [ 'background-image', 'background', ]; if ( in_array( $output['property'], $accepts_multiple, true ) ) { if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ]; } $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix']; return; } if ( is_string( $value ) || is_numeric( $value ) ) { $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix']; } } /** * Some CSS properties are unique. * We need to tweak the value to make everything works as expected. * * @access protected * @param string $property The CSS property. * @param string|array $value The value. * * @return array */ protected function process_property_value( $property, $value ) { $properties = apply_filters( 'kirki_output_property_classnames', [ 'font-family' => '\Kirki\Module\CSS\Property\Font_Family', 'background-image' => '\Kirki\Module\CSS\Property\Background_Image', 'background-position' => '\Kirki\Module\CSS\Property\Background_Position', ] ); if ( array_key_exists( $property, $properties ) ) { $classname = $properties[ $property ]; $obj = new $classname( $property, $value ); return $obj->get_value(); } return $value; } /** * Returns the value. * * @access protected * @param string|array $value The value. * @param array $output The field "output". * @return string|array */ protected function process_value( $value, $output ) { if ( isset( $output['property'] ) ) { return $this->process_property_value( $output['property'], $value ); } return $value; } /** * Exploses the private $styles property to the world * * @access protected * @return array */ public function get_styles() { return $this->styles; } } kirki-packages/module-css/src/CSS/Property.php000064400000002041147177211530015265 0ustar00property = $property; $this->value = $value; $this->process_value(); } /** * Modifies the value. * * @access protected */ protected function process_value() { } /** * Gets the value. * * @access protected */ public function get_value() { return $this->value; } } kirki-packages/module-css/src/CSS.php000064400000030625147177211530013452 0ustar00 $args['output'], ), ); } // Convert to array of arrays if needed. if ( isset( $args['output']['element'] ) ) { /* translators: The field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $args['settings'] ) ), '3.0.10' ); $args['output'] = array( $args['output'] ); } if ( empty( $args['output'] ) ) { return; } foreach ( $args['output'] as $key => $output ) { if ( empty( $output ) || ! isset( $output['element'] ) ) { unset( $args['output'][ $key ] ); continue; } if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) { $args['output'][ $key ]['sanitize_callback'] = $output['callback']; } // Convert element arrays to strings. if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { $args['output'][ $key ]['element'] = array_unique( $args['output'][ $key ]['element'] ); sort( $args['output'][ $key ]['element'] ); // Trim each element in the array. foreach ( $args['output'][ $key ]['element'] as $index => $element ) { $args['output'][ $key ]['element'][ $index ] = trim( $element ); } $args['output'][ $key ]['element'] = implode( ',', $args['output'][ $key ]['element'] ); } // Fix for https://github.com/aristath/kirki/issues/1659#issuecomment-346229751. $args['output'][ $key ]['element'] = str_replace( array( "\t", "\n", "\r", "\0", "\x0B" ), ' ', $args['output'][ $key ]['element'] ); $args['output'][ $key ]['element'] = trim( preg_replace( '/\s+/', ' ', $args['output'][ $key ]['element'] ) ); } if ( ! isset( $args['type'] ) && isset( $object->type ) ) { $args['type'] = $object->type; } self::$fields[] = $args; } /** * Print styles inline. * * @access public * @since 3.0.36 * @return void */ public function print_styles_inline() { $should_print = true; if ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) { $should_print = false; } ob_start(); $this->print_styles(); $inline_styles = ob_get_clean(); /** * If KIRKI_NO_OUTPUT constant is defined (and is true), but typography field is defined, then print it. * Otherwise, the typography field might be broken (missing font-family) if the font-face is not outputted. */ if ( ! $should_print && false !== stripos($inline_styles, '@font-face') ) { $should_print = true; } if ( ! $should_print ) { return; } $inline_styles_id = apply_filters( 'kirki_inline_styles_id', self::$inline_styles_id ); echo ''; } /** * Enqueue the styles. * * @access public * @since 3.0.36 * @return void */ public function enqueue_styles() { $args = array( 'action' => apply_filters( 'kirki_styles_action_handle', self::$css_handle ), ); if ( is_admin() ) { global $current_screen; /** * This `enqueue_styles` method is also hooked into `enqueue_block_editor_assets`. * It needs to be excluded from customize control page. * * Why not simply excluding all admin area except gutenberg editing interface? * Because it would be nice to let the possibility open * if a 3rd party plugin will output gutenberg syles somewhere in admin area. * * Example of possibility: * In the future, Ultimate Dashboard Pro's admin page feature might supports Gutenberg. */ if ( is_object( $current_screen ) && property_exists( $current_screen, 'id' ) && 'customize' === $current_screen->id ) { return; } if ( property_exists( $current_screen, 'is_block_editor' ) && 1 === (int) $current_screen->is_block_editor ) { $args['editor'] = '1'; } } // Enqueue the dynamic stylesheet. wp_enqueue_style( self::$css_handle, add_query_arg( $args, home_url() ), array(), '4.0' ); } /** * Prints the styles as an enqueued file. * * @access public * @since 3.0.36 * @return void */ public function print_styles_action() { /** * Note to code reviewers: * There is no need for a nonce check here, we're only checking if this is a valid request or not. */ // phpcs:ignore WordPress.Security.NonceVerification if ( empty( $_GET['action'] ) || apply_filters( 'kirki_styles_action_handle', self::$css_handle ) !== $_GET['action'] ) { return; } // This is a stylesheet. header( 'Content-type: text/css' ); $this->print_styles(); exit; } /** * Prints the styles. * * @access public */ public function print_styles() { // Go through all configs. $configs = Kirki::$config; foreach ( $configs as $config_id => $args ) { if ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) { continue; } if ( isset( $args['disable_output'] ) && true === $args['disable_output'] ) { continue; } $styles = self::loop_controls( $config_id ); $styles = apply_filters( "kirki_{$config_id}_dynamic_css", $styles ); if ( ! empty( $styles ) ) { /** * Note to code reviewers: * * Though all output should be run through an escaping function, this is pure CSS. * * When used in the print_styles_action() method the PHP header() call makes the browser interpret it as such. * No code, script or anything else can be executed from inside a stylesheet. * * When using in the print_styles_inline() method the wp_strip_all_tags call we use below * strips anything that has the possibility to be malicious, and since this is inslide a ' ); } }, /** * Add a ' ) ); const $tooltipStyleEl = jQuery( '.kirki-tooltip-inline-styles' ); const $sidebarOverlay = jQuery( '.wp-full-overlay-sidebar-content' ); sectionNames.forEach( function ( sectionName ) { wp.customize.section( sectionName, function ( section ) { section.expanded.bind( function ( expanded ) { if ( expanded ) { if ( section.contentContainer[0].scrollHeight > $sidebarOverlay.height() ) { $tooltipStyleEl.html( '.kirki-tooltip-wrapper span.tooltip-content {min-width: 258px;}' ); } else { $tooltipStyleEl.empty(); } } } ); } ); } ); } ); kirki-packages/module-tooltips/src/control.scss000064400000002125147177211530015745 0ustar00.kirki-tooltip-wrapper { position: relative; z-index: 5; // 2 is enough, but.. just to be safe. .tooltip-trigger { position: relative; top: 0; left: 3px; text-decoration: none; &:hover { + .tooltip-content { bottom: 32px; opacity: 1; visibility: visible; z-index: 99999; } } .dashicons { font-size: 18px; width: 18px; height: 18px; } } .tooltip-content { position: absolute; bottom: 29px; left: 0; padding: 7px; min-width: 275px; width: 100%; height: fit-content; font-size: 13px; color: #fff; line-height: 1.4em; background: #000; border-radius: 3px; opacity: 0; visibility: hidden; z-index: -1; transition: all 0.2s linear; /// We might want to bring it back in the future. // &::before { // content: ''; // position: absolute; // bottom: -6px; // display: block; // width: 0; // height: 0; // border-left: 10px solid transparent; // border-right: 10px solid transparent; // border-top: 10px solid #000; // } a { color: #00a0d2; } } } /*# sourceMappingURL=tooltip.css.map */ kirki-packages/module-tooltips/dist/control.js000064400000002261147177211530015563 0ustar00!function(){function t(t){_.each(kirkiTooltips,(function(n){if(n.id===t.id&&!t.container.find(".tooltip-content").length){var i=document.querySelector("#customize-control-"+n.id+" .customize-control-title");if(i){i.classList.add("kirki-tooltip-wrapper");var o=''+n.content+"",e=jQuery(i);jQuery('').appendTo(e),jQuery(o).appendTo(e)}}}))}jQuery(document).ready((function(){var n=[];wp.customize.control.each((function(i){n.includes(i.section())||n.push(i.section()),wp.customize.section(i.section(),(function(n){n.expanded()||wp.customize.settings.autofocus.control===i.id?t(i):n.expanded.bind((function(n){n&&t(i)}))}))})),jQuery("head").append(jQuery(''));var i=jQuery(".kirki-tooltip-inline-styles"),o=jQuery(".wp-full-overlay-sidebar-content");n.forEach((function(t){wp.customize.section(t,(function(t){t.expanded.bind((function(n){n&&(t.contentContainer[0].scrollHeight>o.height()?i.html(".kirki-tooltip-wrapper span.tooltip-content {min-width: 258px;}"):i.empty())}))}))}))}))}(); //# sourceMappingURL=control.js.map kirki-packages/module-tooltips/dist/control.css.map000064400000005351147177211530016516 0ustar00{"mappings":"AAAA,uBACC,iBAAA,CACA,SCCD,CDCC,wCAGC,QAAA,CAFA,iBAAA,CAGA,oBAAA,CAFA,KCGF,CDEG,+DACC,WAAA,CACA,SAAA,CACA,kBAAA,CACA,aCAJ,CDIE,mDACC,cAAA,CAEA,WAAA,CADA,UCDH,CDMC,wCAWC,eAAA,CACA,iBAAA,CAVA,WAAA,CAOA,UAAA,CADA,cAAA,CADA,kBAAA,CAJA,MAAA,CAOA,iBAAA,CALA,eAAA,CAQA,SAAA,CATA,WAAA,CAHA,iBAAA,CAeA,yBAAA,CAFA,iBAAA,CARA,UAAA,CASA,UCHF,CDmBE,0CACC,aCjBH","sources":["packages/kirki-framework/module-tooltips/src/control.scss","%3Cinput%20css%20gZwkcc%3E"],"sourcesContent":[".kirki-tooltip-wrapper {\n\tposition: relative;\n\tz-index: 5; // 2 is enough, but.. just to be safe.\n\n\t.tooltip-trigger {\n\t\tposition: relative;\n\t\ttop: 0;\n\t\tleft: 3px;\n\t\ttext-decoration: none;\n\n\t\t&:hover {\n\t\t\t+ .tooltip-content {\n\t\t\t\tbottom: 32px;\n\t\t\t\topacity: 1;\n\t\t\t\tvisibility: visible;\n\t\t\t\tz-index: 99999;\n\t\t\t}\n\t\t}\n\n\t\t.dashicons {\n\t\t\tfont-size: 18px;\n\t\t\twidth: 18px;\n\t\t\theight: 18px;\n\t\t}\n\t}\n\n\t.tooltip-content {\n\t\tposition: absolute;\n\t\tbottom: 29px;\n\t\tleft: 0;\n\t\tpadding: 7px;\n\t\tmin-width: 275px;\n\t\twidth: 100%;\n\t\theight: fit-content;\n\t\tfont-size: 13px;\n\t\tcolor: #fff;\n\t\tline-height: 1.4em;\n\t\tbackground: #000;\n\t\tborder-radius: 3px;\n\t\topacity: 0;\n\t\tvisibility: hidden;\n\t\tz-index: -1;\n\t\ttransition: all 0.2s linear;\n\n\t\t/// We might want to bring it back in the future.\n\t\t// &::before {\n\t\t// \tcontent: '';\n\t\t// \tposition: absolute;\n\t\t// \tbottom: -6px;\n\t\t// \tdisplay: block;\n\t\t// \twidth: 0;\n\t\t// \theight: 0;\n\t\t// \tborder-left: 10px solid transparent;\n\t\t// \tborder-right: 10px solid transparent;\n\t\t// \tborder-top: 10px solid #000;\n\t\t// }\n\n\t\ta {\n\t\t\tcolor: #00a0d2;\n\t\t}\n\t}\n}\n\n/*# sourceMappingURL=tooltip.css.map */\n",".kirki-tooltip-wrapper {\n position: relative;\n z-index: 5;\n}\n.kirki-tooltip-wrapper .tooltip-trigger {\n position: relative;\n top: 0;\n left: 3px;\n text-decoration: none;\n}\n.kirki-tooltip-wrapper .tooltip-trigger:hover + .tooltip-content {\n bottom: 32px;\n opacity: 1;\n visibility: visible;\n z-index: 99999;\n}\n.kirki-tooltip-wrapper .tooltip-trigger .dashicons {\n font-size: 18px;\n width: 18px;\n height: 18px;\n}\n.kirki-tooltip-wrapper .tooltip-content {\n position: absolute;\n bottom: 29px;\n left: 0;\n padding: 7px;\n min-width: 275px;\n width: 100%;\n height: fit-content;\n font-size: 13px;\n color: #fff;\n line-height: 1.4em;\n background: #000;\n border-radius: 3px;\n opacity: 0;\n visibility: hidden;\n z-index: -1;\n transition: all 0.2s linear;\n}\n.kirki-tooltip-wrapper .tooltip-content a {\n color: #00a0d2;\n}\n\n/*# sourceMappingURL=tooltip.css.map */\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}kirki-packages/module-tooltips/dist/control.js.map000064400000007540147177211530016344 0ustar00{"mappings":"YAE0B,SACjBA,EAAiBC,GACzBC,EAAEC,KAAMC,eAAe,SAAWC,GACjC,GAAKA,EAAQC,KAAOL,EAAQK,KAIvBL,EAAQM,UAAUC,KAAM,oBAAqBC,OAAlD,CAEA,IAAMC,EAASC,SAASC,cACvB,sBAAwBP,EAAQC,GAAK,6BAGtC,GAAOI,EAAP,CACAA,EAAOG,UAAUC,IAAK,yBAGtB,IAIMC,EACL,iCAAmCV,EAAQU,QAAU,UAEhDC,EAAUC,OAAQP,GAGxBO,OATC,8FASiBC,SAAUF,GAC5BC,OAAQF,GAAUG,SAAUF,QAI9BC,OAAQN,UAAWQ,OAAO,WACzB,IAAIC,EAAe,GAEnBC,GAAGC,UAAUrB,QAAQE,MAAM,SAAWF,GAC9BmB,EAAaG,SAAUtB,EAAQuB,YACrCJ,EAAaK,KAAMxB,EAAQuB,WAG5BH,GAAGC,UAAUE,QAASvB,EAAQuB,WAAW,SAAWA,GAElDA,EAAQE,YACRL,GAAGC,UAAUK,SAASC,UAAU3B,UAAYA,EAAQK,GAEpDN,EAAiBC,GAEjBuB,EAAQE,SAASG,MAAM,SAAWH,GAC5BA,GACJ1B,EAAiBC,YAOtBgB,OAAQ,QAASa,OAChBb,OAAQ,wDAGT,IAAMc,EAAkBd,OAAQ,gCAC1Be,EAAkBf,OAAQ,oCAEhCG,EAAaa,SAAS,SAAWC,GAChCb,GAAGC,UAAUE,QAASU,GAAa,SAAWV,GAC7CA,EAAQE,SAASG,MAAM,SAAWH,GAC5BA,IAEHF,EAAQW,iBAAiB,GAAGC,aAC5BJ,EAAgBK,SAEhBN,EAAgBO,KACf,mEAGDP,EAAgBQ","sources":["packages/kirki-framework/module-tooltips/src/control.js"],"sourcesContent":["import './control.scss';\n\n/* global kirkiTooltips */\nfunction kirkiTooltipAdd( control ) {\n\t_.each( kirkiTooltips, function ( tooltip ) {\n\t\tif ( tooltip.id !== control.id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( control.container.find( '.tooltip-content' ).length ) return;\n\n\t\tconst target = document.querySelector(\n\t\t\t'#customize-control-' + tooltip.id + ' .customize-control-title'\n\t\t);\n\n\t\tif ( ! target ) return;\n\t\ttarget.classList.add( 'kirki-tooltip-wrapper' );\n\n\t\t// Build the tooltip trigger.\n\t\tconst trigger =\n\t\t\t'';\n\n\t\t// Build the tooltip content.\n\t\tconst content =\n\t\t\t'' + tooltip.content + '';\n\n\t\tconst $target = jQuery( target );\n\n\t\t// Append the trigger & content next to the control's title.\n\t\tjQuery( trigger ).appendTo( $target );\n\t\tjQuery( content ).appendTo( $target );\n\t} );\n}\n\njQuery( document ).ready( function () {\n\tlet sectionNames = [];\n\n\twp.customize.control.each( function ( control ) {\n\t\tif ( ! sectionNames.includes( control.section() ) ) {\n\t\t\tsectionNames.push( control.section() );\n\t\t}\n\n\t\twp.customize.section( control.section(), function ( section ) {\n\t\t\tif (\n\t\t\t\tsection.expanded() ||\n\t\t\t\twp.customize.settings.autofocus.control === control.id\n\t\t\t) {\n\t\t\t\tkirkiTooltipAdd( control );\n\t\t\t} else {\n\t\t\t\tsection.expanded.bind( function ( expanded ) {\n\t\t\t\t\tif ( expanded ) {\n\t\t\t\t\t\tkirkiTooltipAdd( control );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t} );\n\n\tjQuery( 'head' ).append(\n\t\tjQuery( '' )\n\t);\n\n\tconst $tooltipStyleEl = jQuery( '.kirki-tooltip-inline-styles' );\n\tconst $sidebarOverlay = jQuery( '.wp-full-overlay-sidebar-content' );\n\n\tsectionNames.forEach( function ( sectionName ) {\n\t\twp.customize.section( sectionName, function ( section ) {\n\t\t\tsection.expanded.bind( function ( expanded ) {\n\t\t\t\tif ( expanded ) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tsection.contentContainer[0].scrollHeight >\n\t\t\t\t\t\t$sidebarOverlay.height()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$tooltipStyleEl.html(\n\t\t\t\t\t\t\t'.kirki-tooltip-wrapper span.tooltip-content {min-width: 258px;}'\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tooltipStyleEl.empty();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t} );\n} );\n"],"names":["$1a3e97217cc9f59a$var$kirkiTooltipAdd","control","_","each","kirkiTooltips","tooltip","id","container","find","length","target","document","querySelector","classList","add","content","$target","jQuery","appendTo","ready","sectionNames","wp","customize","includes","section","push","expanded","settings","autofocus","bind","append","$tooltipStyleEl","$sidebarOverlay","forEach","sectionName","contentContainer","scrollHeight","height","html","empty"],"version":3,"file":"control.js.map"}kirki-packages/module-tooltips/dist/control.css000064400000001327147177211530015741 0ustar00.kirki-tooltip-wrapper{position:relative;z-index:5}.kirki-tooltip-wrapper .tooltip-trigger{left:3px;position:relative;text-decoration:none;top:0}.kirki-tooltip-wrapper .tooltip-trigger:hover+.tooltip-content{bottom:32px;opacity:1;visibility:visible;z-index:99999}.kirki-tooltip-wrapper .tooltip-trigger .dashicons{font-size:18px;height:18px;width:18px}.kirki-tooltip-wrapper .tooltip-content{background:#000;border-radius:3px;bottom:29px;color:#fff;font-size:13px;height:fit-content;left:0;line-height:1.4em;min-width:275px;opacity:0;padding:7px;position:absolute;transition:all .2s linear;visibility:hidden;width:100%;z-index:-1}.kirki-tooltip-wrapper .tooltip-content a{color:#00a0d2} /*# sourceMappingURL=control.css.map */ kirki-packages/compatibility/LICENSE000064400000002060147177211530013315 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/compatibility/src/scripts/wp-polyfill.js000064400000702005147177211530017410 0ustar00(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 2 ? arguments[2] : undefined; var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); var inc = 1; if (from < to && to < from + count) { inc = -1; from += count - 1; to += count - 1; } while (count-- > 0) { if (from in O) O[to] = O[from]; else delete O[to]; to += inc; from += inc; } return O; }; },{"113":113,"117":117,"118":118}],18:[function(_dereq_,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 'use strict'; var toObject = _dereq_(118); var toAbsoluteIndex = _dereq_(113); var toLength = _dereq_(117); module.exports = function fill(value /* , start = 0, end = @length */) { var O = toObject(this); var length = toLength(O.length); var aLen = arguments.length; var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); var end = aLen > 2 ? arguments[2] : undefined; var endPos = end === undefined ? length : toAbsoluteIndex(end, length); while (endPos > index) O[index++] = value; return O; }; },{"113":113,"117":117,"118":118}],19:[function(_dereq_,module,exports){ // false -> Array#indexOf // true -> Array#includes var toIObject = _dereq_(116); var toLength = _dereq_(117); var toAbsoluteIndex = _dereq_(113); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) if (IS_INCLUDES || index in O) { if (O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; },{"113":113,"116":116,"117":117}],20:[function(_dereq_,module,exports){ // 0 -> Array#forEach // 1 -> Array#map // 2 -> Array#filter // 3 -> Array#some // 4 -> Array#every // 5 -> Array#find // 6 -> Array#findIndex var ctx = _dereq_(32); var IObject = _dereq_(53); var toObject = _dereq_(118); var toLength = _dereq_(117); var asc = _dereq_(23); module.exports = function (TYPE, $create) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; var create = $create || asc; return function ($this, callbackfn, that) { var O = toObject($this); var self = IObject(O); var f = ctx(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var val, res; for (;length > index; index++) if (NO_HOLES || index in self) { val = self[index]; res = f(val, index, O); if (TYPE) { if (IS_MAP) result[index] = res; // map else if (res) switch (TYPE) { case 3: return true; // some case 5: return val; // find case 6: return index; // findIndex case 2: result.push(val); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; }; }; },{"117":117,"118":118,"23":23,"32":32,"53":53}],21:[function(_dereq_,module,exports){ var aFunction = _dereq_(11); var toObject = _dereq_(118); var IObject = _dereq_(53); var toLength = _dereq_(117); module.exports = function (that, callbackfn, aLen, memo, isRight) { aFunction(callbackfn); var O = toObject(that); var self = IObject(O); var length = toLength(O.length); var index = isRight ? length - 1 : 0; var i = isRight ? -1 : 1; if (aLen < 2) for (;;) { if (index in self) { memo = self[index]; index += i; break; } index += i; if (isRight ? index < 0 : length <= index) { throw TypeError('Reduce of empty array with no initial value'); } } for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { memo = callbackfn(memo, self[index], index, O); } return memo; }; },{"11":11,"117":117,"118":118,"53":53}],22:[function(_dereq_,module,exports){ var isObject = _dereq_(57); var isArray = _dereq_(55); var SPECIES = _dereq_(128)('species'); module.exports = function (original) { var C; if (isArray(original)) { C = original.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return C === undefined ? Array : C; }; },{"128":128,"55":55,"57":57}],23:[function(_dereq_,module,exports){ // 9.4.2.3 ArraySpeciesCreate(originalArray, length) var speciesConstructor = _dereq_(22); module.exports = function (original, length) { return new (speciesConstructor(original))(length); }; },{"22":22}],24:[function(_dereq_,module,exports){ 'use strict'; var aFunction = _dereq_(11); var isObject = _dereq_(57); var invoke = _dereq_(52); var arraySlice = [].slice; var factories = {}; var construct = function (F, len, args) { if (!(len in factories)) { for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; // eslint-disable-next-line no-new-func factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); } return factories[len](F, args); }; module.exports = Function.bind || function bind(that /* , ...args */) { var fn = aFunction(this); var partArgs = arraySlice.call(arguments, 1); var bound = function (/* args... */) { var args = partArgs.concat(arraySlice.call(arguments)); return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); }; if (isObject(fn.prototype)) bound.prototype = fn.prototype; return bound; }; },{"11":11,"52":52,"57":57}],25:[function(_dereq_,module,exports){ // getting tag from 19.1.3.6 Object.prototype.toString() var cof = _dereq_(26); var TAG = _dereq_(128)('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (e) { /* empty */ } }; module.exports = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case : ARG ? cof(O) // ES3 arguments fallback : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; },{"128":128,"26":26}],26:[function(_dereq_,module,exports){ var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; },{}],27:[function(_dereq_,module,exports){ 'use strict'; var dP = _dereq_(75).f; var create = _dereq_(74); var redefineAll = _dereq_(93); var ctx = _dereq_(32); var anInstance = _dereq_(15); var forOf = _dereq_(45); var $iterDefine = _dereq_(61); var step = _dereq_(63); var setSpecies = _dereq_(99); var DESCRIPTORS = _dereq_(36); var fastKey = _dereq_(70).fastKey; var validate = _dereq_(125); var SIZE = DESCRIPTORS ? '_s' : 'size'; var getEntry = function (that, key) { // fast case var index = fastKey(key); var entry; if (index !== 'F') return that._i[index]; // frozen object case for (entry = that._f; entry; entry = entry.n) { if (entry.k == key) return entry; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._t = NAME; // collection type that._i = create(null); // index that._f = undefined; // first entry that._l = undefined; // last entry that[SIZE] = 0; // size if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.1.3.1 Map.prototype.clear() // 23.2.3.2 Set.prototype.clear() clear: function clear() { for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { entry.r = true; if (entry.p) entry.p = entry.p.n = undefined; delete data[entry.i]; } that._f = that._l = undefined; that[SIZE] = 0; }, // 23.1.3.3 Map.prototype.delete(key) // 23.2.3.4 Set.prototype.delete(value) 'delete': function (key) { var that = validate(this, NAME); var entry = getEntry(that, key); if (entry) { var next = entry.n; var prev = entry.p; delete that._i[entry.i]; entry.r = true; if (prev) prev.n = next; if (next) next.p = prev; if (that._f == entry) that._f = next; if (that._l == entry) that._l = prev; that[SIZE]--; } return !!entry; }, // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) forEach: function forEach(callbackfn /* , that = undefined */) { validate(this, NAME); var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); var entry; while (entry = entry ? entry.n : this._f) { f(entry.v, entry.k, this); // revert to the last existing entry while (entry && entry.r) entry = entry.p; } }, // 23.1.3.7 Map.prototype.has(key) // 23.2.3.7 Set.prototype.has(value) has: function has(key) { return !!getEntry(validate(this, NAME), key); } }); if (DESCRIPTORS) dP(C.prototype, 'size', { get: function () { return validate(this, NAME)[SIZE]; } }); return C; }, def: function (that, key, value) { var entry = getEntry(that, key); var prev, index; // change existing entry if (entry) { entry.v = value; // create new entry } else { that._l = entry = { i: index = fastKey(key, true), // <- index k: key, // <- key v: value, // <- value p: prev = that._l, // <- previous entry n: undefined, // <- next entry r: false // <- removed }; if (!that._f) that._f = entry; if (prev) prev.n = entry; that[SIZE]++; // add to index if (index !== 'F') that._i[index] = entry; } return that; }, getEntry: getEntry, setStrong: function (C, NAME, IS_MAP) { // add .keys, .values, .entries, [@@iterator] // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 $iterDefine(C, NAME, function (iterated, kind) { this._t = validate(iterated, NAME); // target this._k = kind; // kind this._l = undefined; // previous }, function () { var that = this; var kind = that._k; var entry = that._l; // revert to the last existing entry while (entry && entry.r) entry = entry.p; // get next entry if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { // or finish the iteration that._t = undefined; return step(1); } // return step by kind if (kind == 'keys') return step(0, entry.k); if (kind == 'values') return step(0, entry.v); return step(0, [entry.k, entry.v]); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // add [@@species], 23.1.2.2, 23.2.2.2 setSpecies(NAME); } }; },{"125":125,"15":15,"32":32,"36":36,"45":45,"61":61,"63":63,"70":70,"74":74,"75":75,"93":93,"99":99}],28:[function(_dereq_,module,exports){ 'use strict'; var redefineAll = _dereq_(93); var getWeak = _dereq_(70).getWeak; var anObject = _dereq_(16); var isObject = _dereq_(57); var anInstance = _dereq_(15); var forOf = _dereq_(45); var createArrayMethod = _dereq_(20); var $has = _dereq_(47); var validate = _dereq_(125); var arrayFind = createArrayMethod(5); var arrayFindIndex = createArrayMethod(6); var id = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (that) { return that._l || (that._l = new UncaughtFrozenStore()); }; var UncaughtFrozenStore = function () { this.a = []; }; var findUncaughtFrozen = function (store, key) { return arrayFind(store.a, function (it) { return it[0] === key; }); }; UncaughtFrozenStore.prototype = { get: function (key) { var entry = findUncaughtFrozen(this, key); if (entry) return entry[1]; }, has: function (key) { return !!findUncaughtFrozen(this, key); }, set: function (key, value) { var entry = findUncaughtFrozen(this, key); if (entry) entry[1] = value; else this.a.push([key, value]); }, 'delete': function (key) { var index = arrayFindIndex(this.a, function (it) { return it[0] === key; }); if (~index) this.a.splice(index, 1); return !!~index; } }; module.exports = { getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { var C = wrapper(function (that, iterable) { anInstance(that, C, NAME, '_i'); that._t = NAME; // collection type that._i = id++; // collection id that._l = undefined; // leak store for uncaught frozen objects if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); }); redefineAll(C.prototype, { // 23.3.3.2 WeakMap.prototype.delete(key) // 23.4.3.3 WeakSet.prototype.delete(value) 'delete': function (key) { if (!isObject(key)) return false; var data = getWeak(key); if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); return data && $has(data, this._i) && delete data[this._i]; }, // 23.3.3.4 WeakMap.prototype.has(key) // 23.4.3.4 WeakSet.prototype.has(value) has: function has(key) { if (!isObject(key)) return false; var data = getWeak(key); if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); return data && $has(data, this._i); } }); return C; }, def: function (that, key, value) { var data = getWeak(anObject(key), true); if (data === true) uncaughtFrozenStore(that).set(key, value); else data[that._i] = value; return that; }, ufstore: uncaughtFrozenStore }; },{"125":125,"15":15,"16":16,"20":20,"45":45,"47":47,"57":57,"70":70,"93":93}],29:[function(_dereq_,module,exports){ 'use strict'; var global = _dereq_(46); var $export = _dereq_(40); var redefine = _dereq_(94); var redefineAll = _dereq_(93); var meta = _dereq_(70); var forOf = _dereq_(45); var anInstance = _dereq_(15); var isObject = _dereq_(57); var fails = _dereq_(42); var $iterDetect = _dereq_(62); var setToStringTag = _dereq_(100); var inheritIfRequired = _dereq_(51); module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { var Base = global[NAME]; var C = Base; var ADDER = IS_MAP ? 'set' : 'add'; var proto = C && C.prototype; var O = {}; var fixMethod = function (KEY) { var fn = proto[KEY]; redefine(proto, KEY, KEY == 'delete' ? function (a) { return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); } : KEY == 'has' ? function has(a) { return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); } : KEY == 'get' ? function get(a) { return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } ); }; if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { new C().entries().next(); }))) { // create collection constructor C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); redefineAll(C.prototype, methods); meta.NEED = true; } else { var instance = new C(); // early implementations not supports chaining var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); // most early implementations doesn't supports iterables, most modern - not close it correctly var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new // for early implementations -0 and +0 not the same var BUGGY_ZERO = !IS_WEAK && fails(function () { // V8 ~ Chromium 42- fails only with 5+ elements var $instance = new C(); var index = 5; while (index--) $instance[ADDER](index, index); return !$instance.has(-0); }); if (!ACCEPT_ITERABLES) { C = wrapper(function (target, iterable) { anInstance(target, C, NAME); var that = inheritIfRequired(new Base(), target, C); if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); return that; }); C.prototype = proto; proto.constructor = C; } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); // weak collections should not contains .clear method if (IS_WEAK && proto.clear) delete proto.clear; } setToStringTag(C, NAME); O[NAME] = C; $export($export.G + $export.W + $export.F * (C != Base), O); if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); return C; }; },{"100":100,"15":15,"40":40,"42":42,"45":45,"46":46,"51":51,"57":57,"62":62,"70":70,"93":93,"94":94}],30:[function(_dereq_,module,exports){ var core = module.exports = { version: '2.6.1' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef },{}],31:[function(_dereq_,module,exports){ 'use strict'; var $defineProperty = _dereq_(75); var createDesc = _dereq_(92); module.exports = function (object, index, value) { if (index in object) $defineProperty.f(object, index, createDesc(0, value)); else object[index] = value; }; },{"75":75,"92":92}],32:[function(_dereq_,module,exports){ // optional / simple context binding var aFunction = _dereq_(11); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; },{"11":11}],33:[function(_dereq_,module,exports){ 'use strict'; // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var fails = _dereq_(42); var getTime = Date.prototype.getTime; var $toISOString = Date.prototype.toISOString; var lz = function (num) { return num > 9 ? num : '0' + num; }; // PhantomJS / old WebKit has a broken implementations module.exports = (fails(function () { return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; }) || !fails(function () { $toISOString.call(new Date(NaN)); })) ? function toISOString() { if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); var d = this; var y = d.getUTCFullYear(); var m = d.getUTCMilliseconds(); var s = y < 0 ? '-' : y > 9999 ? '+' : ''; return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; } : $toISOString; },{"42":42}],34:[function(_dereq_,module,exports){ 'use strict'; var anObject = _dereq_(16); var toPrimitive = _dereq_(119); var NUMBER = 'number'; module.exports = function (hint) { if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); return toPrimitive(anObject(this), hint != NUMBER); }; },{"119":119,"16":16}],35:[function(_dereq_,module,exports){ // 7.2.1 RequireObjectCoercible(argument) module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; },{}],36:[function(_dereq_,module,exports){ // Thank's IE8 for his funny defineProperty module.exports = !_dereq_(42)(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); },{"42":42}],37:[function(_dereq_,module,exports){ var isObject = _dereq_(57); var document = _dereq_(46).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); module.exports = function (it) { return is ? document.createElement(it) : {}; }; },{"46":46,"57":57}],38:[function(_dereq_,module,exports){ // IE 8- don't enum bug keys module.exports = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); },{}],39:[function(_dereq_,module,exports){ // all enumerable object keys, includes symbols var getKeys = _dereq_(83); var gOPS = _dereq_(80); var pIE = _dereq_(84); module.exports = function (it) { var result = getKeys(it); var getSymbols = gOPS.f; if (getSymbols) { var symbols = getSymbols(it); var isEnum = pIE.f; var i = 0; var key; while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); } return result; }; },{"80":80,"83":83,"84":84}],40:[function(_dereq_,module,exports){ var global = _dereq_(46); var core = _dereq_(30); var hide = _dereq_(48); var redefine = _dereq_(94); var ctx = _dereq_(32); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { var IS_FORCED = type & $export.F; var IS_GLOBAL = type & $export.G; var IS_STATIC = type & $export.S; var IS_PROTO = type & $export.P; var IS_BIND = type & $export.B; var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); var key, own, out, exp; if (IS_GLOBAL) source = name; for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // extend global if (target) redefine(target, key, out, type & $export.U); // export if (exports[key] != out) hide(exports, key, exp); if (IS_PROTO && expProto[key] != out) expProto[key] = out; } }; global.core = core; // type bitmap $export.F = 1; // forced $export.G = 2; // global $export.S = 4; // static $export.P = 8; // proto $export.B = 16; // bind $export.W = 32; // wrap $export.U = 64; // safe $export.R = 128; // real proto method for `library` module.exports = $export; },{"30":30,"32":32,"46":46,"48":48,"94":94}],41:[function(_dereq_,module,exports){ var MATCH = _dereq_(128)('match'); module.exports = function (KEY) { var re = /./; try { '/./'[KEY](re); } catch (e) { try { re[MATCH] = false; return !'/./'[KEY](re); } catch (f) { /* empty */ } } return true; }; },{"128":128}],42:[function(_dereq_,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (e) { return true; } }; },{}],43:[function(_dereq_,module,exports){ 'use strict'; _dereq_(224); var redefine = _dereq_(94); var hide = _dereq_(48); var fails = _dereq_(42); var defined = _dereq_(35); var wks = _dereq_(128); var regexpExec = _dereq_(96); var SPECIES = wks('species'); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { // #replace needs built-in support for named groups. // #match works fine because it just return the exec results, even if it has // a "grops" property. var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; return ''.replace(re, '$') !== '7'; }); var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec var re = /(?:)/; var originalExec = re.exec; re.exec = function () { return originalExec.apply(this, arguments); }; var result = 'ab'.split(re); return result.length === 2 && result[0] === 'a' && result[1] === 'b'; })(); module.exports = function (KEY, length, exec) { var SYMBOL = wks(KEY); var DELEGATES_TO_SYMBOL = !fails(function () { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) != 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; re.exec = function () { execCalled = true; return null; }; if (KEY === 'split') { // RegExp[@@split] doesn't call the regex's exec method, but first creates // a new one. We need to return the patched regex when creating the new one. re.constructor = {}; re.constructor[SPECIES] = function () { return re; }; } re[SYMBOL](''); return !execCalled; }) : undefined; if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) ) { var nativeRegExpMethod = /./[SYMBOL]; var fns = exec( defined, SYMBOL, ''[KEY], function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { if (regexp.exec === regexpExec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { // The native String method already delegates to @@method (this // polyfilled function), leasing to infinite recursion. // We avoid it by directly calling the native @@method method. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; } return { done: true, value: nativeMethod.call(str, regexp, arg2) }; } return { done: false }; } ); var strfn = fns[0]; var rxfn = fns[1]; redefine(String.prototype, KEY, strfn); hide(RegExp.prototype, SYMBOL, length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) // 21.2.5.11 RegExp.prototype[@@split](string, limit) ? function (string, arg) { return rxfn.call(string, this, arg); } // 21.2.5.6 RegExp.prototype[@@match](string) // 21.2.5.9 RegExp.prototype[@@search](string) : function (string) { return rxfn.call(string, this); } ); } }; },{"128":128,"224":224,"35":35,"42":42,"48":48,"94":94,"96":96}],44:[function(_dereq_,module,exports){ 'use strict'; // 21.2.5.3 get RegExp.prototype.flags var anObject = _dereq_(16); module.exports = function () { var that = anObject(this); var result = ''; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.unicode) result += 'u'; if (that.sticky) result += 'y'; return result; }; },{"16":16}],45:[function(_dereq_,module,exports){ var ctx = _dereq_(32); var call = _dereq_(59); var isArrayIter = _dereq_(54); var anObject = _dereq_(16); var toLength = _dereq_(117); var getIterFn = _dereq_(129); var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); var f = ctx(fn, that, entries ? 2 : 1); var index = 0; var length, step, iterator, result; if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); // fast case for arrays with default iterator if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); if (result === BREAK || result === RETURN) return result; } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { result = call(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) return result; } }; exports.BREAK = BREAK; exports.RETURN = RETURN; },{"117":117,"129":129,"16":16,"32":32,"54":54,"59":59}],46:[function(_dereq_,module,exports){ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef },{}],47:[function(_dereq_,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; },{}],48:[function(_dereq_,module,exports){ var dP = _dereq_(75); var createDesc = _dereq_(92); module.exports = _dereq_(36) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"36":36,"75":75,"92":92}],49:[function(_dereq_,module,exports){ var document = _dereq_(46).document; module.exports = document && document.documentElement; },{"46":46}],50:[function(_dereq_,module,exports){ module.exports = !_dereq_(36) && !_dereq_(42)(function () { return Object.defineProperty(_dereq_(37)('div'), 'a', { get: function () { return 7; } }).a != 7; }); },{"36":36,"37":37,"42":42}],51:[function(_dereq_,module,exports){ var isObject = _dereq_(57); var setPrototypeOf = _dereq_(98).set; module.exports = function (that, target, C) { var S = target.constructor; var P; if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { setPrototypeOf(that, P); } return that; }; },{"57":57,"98":98}],52:[function(_dereq_,module,exports){ // fast apply, http://jsperf.lnkit.com/fast-apply/5 module.exports = function (fn, args, that) { var un = that === undefined; switch (args.length) { case 0: return un ? fn() : fn.call(that); case 1: return un ? fn(args[0]) : fn.call(that, args[0]); case 2: return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); case 3: return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); case 4: return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); } return fn.apply(that, args); }; },{}],53:[function(_dereq_,module,exports){ // fallback for non-array-like ES3 and non-enumerable old V8 strings var cof = _dereq_(26); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); }; },{"26":26}],54:[function(_dereq_,module,exports){ // check on default Array iterator var Iterators = _dereq_(64); var ITERATOR = _dereq_(128)('iterator'); var ArrayProto = Array.prototype; module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); }; },{"128":128,"64":64}],55:[function(_dereq_,module,exports){ // 7.2.2 IsArray(argument) var cof = _dereq_(26); module.exports = Array.isArray || function isArray(arg) { return cof(arg) == 'Array'; }; },{"26":26}],56:[function(_dereq_,module,exports){ // 20.1.2.3 Number.isInteger(number) var isObject = _dereq_(57); var floor = Math.floor; module.exports = function isInteger(it) { return !isObject(it) && isFinite(it) && floor(it) === it; }; },{"57":57}],57:[function(_dereq_,module,exports){ module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],58:[function(_dereq_,module,exports){ // 7.2.8 IsRegExp(argument) var isObject = _dereq_(57); var cof = _dereq_(26); var MATCH = _dereq_(128)('match'); module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); }; },{"128":128,"26":26,"57":57}],59:[function(_dereq_,module,exports){ // call something on iterator step with safe closing on error var anObject = _dereq_(16); module.exports = function (iterator, fn, value, entries) { try { return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (e) { var ret = iterator['return']; if (ret !== undefined) anObject(ret.call(iterator)); throw e; } }; },{"16":16}],60:[function(_dereq_,module,exports){ 'use strict'; var create = _dereq_(74); var descriptor = _dereq_(92); var setToStringTag = _dereq_(100); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() _dereq_(48)(IteratorPrototype, _dereq_(128)('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); setToStringTag(Constructor, NAME + ' Iterator'); }; },{"100":100,"128":128,"48":48,"74":74,"92":92}],61:[function(_dereq_,module,exports){ 'use strict'; var LIBRARY = _dereq_(65); var $export = _dereq_(40); var redefine = _dereq_(94); var hide = _dereq_(48); var Iterators = _dereq_(64); var $iterCreate = _dereq_(60); var setToStringTag = _dereq_(100); var getPrototypeOf = _dereq_(81); var ITERATOR = _dereq_(128)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { $iterCreate(Constructor, NAME, next); var getMethod = function (kind) { if (!BUGGY && kind in proto) return proto[kind]; switch (kind) { case KEYS: return function keys() { return new Constructor(this, kind); }; case VALUES: return function values() { return new Constructor(this, kind); }; } return function entries() { return new Constructor(this, kind); }; }; var TAG = NAME + ' Iterator'; var DEF_VALUES = DEFAULT == VALUES; var VALUES_BUG = false; var proto = Base.prototype; var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; var $default = $native || getMethod(DEFAULT); var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; var methods, key, IteratorPrototype; // Fix native if ($anyNative) { IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { // Set @@toStringTag to native iterators setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEF_VALUES && $native && $native.name !== VALUES) { VALUES_BUG = true; $default = function values() { return $native.call(this); }; } // Define iterator if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { hide(proto, ITERATOR, $default); } // Plug for library Iterators[NAME] = $default; Iterators[TAG] = returnThis; if (DEFAULT) { methods = { values: DEF_VALUES ? $default : getMethod(VALUES), keys: IS_SET ? $default : getMethod(KEYS), entries: $entries }; if (FORCED) for (key in methods) { if (!(key in proto)) redefine(proto, key, methods[key]); } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); } return methods; }; },{"100":100,"128":128,"40":40,"48":48,"60":60,"64":64,"65":65,"81":81,"94":94}],62:[function(_dereq_,module,exports){ var ITERATOR = _dereq_(128)('iterator'); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR](); riter['return'] = function () { SAFE_CLOSING = true; }; // eslint-disable-next-line no-throw-literal Array.from(riter, function () { throw 2; }); } catch (e) { /* empty */ } module.exports = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING) return false; var safe = false; try { var arr = [7]; var iter = arr[ITERATOR](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; },{"128":128}],63:[function(_dereq_,module,exports){ module.exports = function (done, value) { return { value: value, done: !!done }; }; },{}],64:[function(_dereq_,module,exports){ module.exports = {}; },{}],65:[function(_dereq_,module,exports){ module.exports = false; },{}],66:[function(_dereq_,module,exports){ // 20.2.2.14 Math.expm1(x) var $expm1 = Math.expm1; module.exports = (!$expm1 // Old FF bug || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 // Tor Browser bug || $expm1(-2e-17) != -2e-17 ) ? function expm1(x) { return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; } : $expm1; },{}],67:[function(_dereq_,module,exports){ // 20.2.2.16 Math.fround(x) var sign = _dereq_(69); var pow = Math.pow; var EPSILON = pow(2, -52); var EPSILON32 = pow(2, -23); var MAX32 = pow(2, 127) * (2 - EPSILON32); var MIN32 = pow(2, -126); var roundTiesToEven = function (n) { return n + 1 / EPSILON - 1 / EPSILON; }; module.exports = Math.fround || function fround(x) { var $abs = Math.abs(x); var $sign = sign(x); var a, result; if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; a = (1 + EPSILON32 / EPSILON) * $abs; result = a - (a - $abs); // eslint-disable-next-line no-self-compare if (result > MAX32 || result != result) return $sign * Infinity; return $sign * result; }; },{"69":69}],68:[function(_dereq_,module,exports){ // 20.2.2.20 Math.log1p(x) module.exports = Math.log1p || function log1p(x) { return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); }; },{}],69:[function(_dereq_,module,exports){ // 20.2.2.28 Math.sign(x) module.exports = Math.sign || function sign(x) { // eslint-disable-next-line no-self-compare return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; }; },{}],70:[function(_dereq_,module,exports){ var META = _dereq_(123)('meta'); var isObject = _dereq_(57); var has = _dereq_(47); var setDesc = _dereq_(75).f; var id = 0; var isExtensible = Object.isExtensible || function () { return true; }; var FREEZE = !_dereq_(42)(function () { return isExtensible(Object.preventExtensions({})); }); var setMeta = function (it) { setDesc(it, META, { value: { i: 'O' + ++id, // object ID w: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMeta(it); // return object ID } return it[META].i; }; var getWeak = function (it, create) { if (!has(it, META)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMeta(it); // return hash weak collections IDs } return it[META].w; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); return it; }; var meta = module.exports = { KEY: META, NEED: false, fastKey: fastKey, getWeak: getWeak, onFreeze: onFreeze }; },{"123":123,"42":42,"47":47,"57":57,"75":75}],71:[function(_dereq_,module,exports){ var global = _dereq_(46); var macrotask = _dereq_(112).set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process = global.process; var Promise = global.Promise; var isNode = _dereq_(26)(process) == 'process'; module.exports = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode && (parent = process.domain)) parent.exit(); while (head) { fn = head.fn; head = head.next; try { fn(); } catch (e) { if (head) notify(); else last = undefined; throw e; } } last = undefined; if (parent) parent.enter(); }; // Node.js if (isNode) { notify = function () { process.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer && !(global.navigator && global.navigator.standalone)) { var toggle = true; var node = document.createTextNode(''); new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new notify = function () { node.data = toggle = !toggle; }; // environments with maybe non-completely correct, but existent Promise } else if (Promise && Promise.resolve) { // Promise.resolve without an argument throws an error in LG WebOS 2 var promise = Promise.resolve(undefined); notify = function () { promise.then(flush); }; // for other environments - macrotask based on: // - setImmediate // - MessageChannel // - window.postMessag // - onreadystatechange // - setTimeout } else { notify = function () { // strange IE + webpack dev server bug - use .call(global) macrotask.call(global, flush); }; } return function (fn) { var task = { fn: fn, next: undefined }; if (last) last.next = task; if (!head) { head = task; notify(); } last = task; }; }; },{"112":112,"26":26,"46":46}],72:[function(_dereq_,module,exports){ 'use strict'; // 25.4.1.5 NewPromiseCapability(C) var aFunction = _dereq_(11); function PromiseCapability(C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aFunction(resolve); this.reject = aFunction(reject); } module.exports.f = function (C) { return new PromiseCapability(C); }; },{"11":11}],73:[function(_dereq_,module,exports){ 'use strict'; // 19.1.2.1 Object.assign(target, source, ...) var getKeys = _dereq_(83); var gOPS = _dereq_(80); var pIE = _dereq_(84); var toObject = _dereq_(118); var IObject = _dereq_(53); var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) module.exports = !$assign || _dereq_(42)(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var S = Symbol(); var K = 'abcdefghijklmnopqrst'; A[S] = 7; K.split('').forEach(function (k) { B[k] = k; }); return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = gOPS.f; var isEnum = pIE.f; while (aLen > index) { var S = IObject(arguments[index++]); var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); var length = keys.length; var j = 0; var key; while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; } return T; } : $assign; },{"118":118,"42":42,"53":53,"80":80,"83":83,"84":84}],74:[function(_dereq_,module,exports){ // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = _dereq_(16); var dPs = _dereq_(76); var enumBugKeys = _dereq_(38); var IE_PROTO = _dereq_(101)('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = _dereq_(37)('iframe'); var i = enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; _dereq_(49).appendChild(iframe); iframe.src = 'javascript:'; // eslint-disable-line no-script-url // createDict = iframe.contentWindow.Object; // html.removeChild(iframe); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); iframeDocument.close(); createDict = iframeDocument.F; while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; return createDict(); }; module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : dPs(result, Properties); }; },{"101":101,"16":16,"37":37,"38":38,"49":49,"76":76}],75:[function(_dereq_,module,exports){ var anObject = _dereq_(16); var IE8_DOM_DEFINE = _dereq_(50); var toPrimitive = _dereq_(119); var dP = Object.defineProperty; exports.f = _dereq_(36) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return dP(O, P, Attributes); } catch (e) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"119":119,"16":16,"36":36,"50":50}],76:[function(_dereq_,module,exports){ var dP = _dereq_(75); var anObject = _dereq_(16); var getKeys = _dereq_(83); module.exports = _dereq_(36) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) dP.f(O, P = keys[i++], Properties[P]); return O; }; },{"16":16,"36":36,"75":75,"83":83}],77:[function(_dereq_,module,exports){ var pIE = _dereq_(84); var createDesc = _dereq_(92); var toIObject = _dereq_(116); var toPrimitive = _dereq_(119); var has = _dereq_(47); var IE8_DOM_DEFINE = _dereq_(50); var gOPD = Object.getOwnPropertyDescriptor; exports.f = _dereq_(36) ? gOPD : function getOwnPropertyDescriptor(O, P) { O = toIObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return gOPD(O, P); } catch (e) { /* empty */ } if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); }; },{"116":116,"119":119,"36":36,"47":47,"50":50,"84":84,"92":92}],78:[function(_dereq_,module,exports){ // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window var toIObject = _dereq_(116); var gOPN = _dereq_(79).f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return gOPN(it); } catch (e) { return windowNames.slice(); } }; module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); }; },{"116":116,"79":79}],79:[function(_dereq_,module,exports){ // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) var $keys = _dereq_(82); var hiddenKeys = _dereq_(38).concat('length', 'prototype'); exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return $keys(O, hiddenKeys); }; },{"38":38,"82":82}],80:[function(_dereq_,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],81:[function(_dereq_,module,exports){ // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var has = _dereq_(47); var toObject = _dereq_(118); var IE_PROTO = _dereq_(101)('IE_PROTO'); var ObjectProto = Object.prototype; module.exports = Object.getPrototypeOf || function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; },{"101":101,"118":118,"47":47}],82:[function(_dereq_,module,exports){ var has = _dereq_(47); var toIObject = _dereq_(116); var arrayIndexOf = _dereq_(19)(false); var IE_PROTO = _dereq_(101)('IE_PROTO'); module.exports = function (object, names) { var O = toIObject(object); var i = 0; var result = []; var key; for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~arrayIndexOf(result, key) || result.push(key); } return result; }; },{"101":101,"116":116,"19":19,"47":47}],83:[function(_dereq_,module,exports){ // 19.1.2.14 / 15.2.3.14 Object.keys(O) var $keys = _dereq_(82); var enumBugKeys = _dereq_(38); module.exports = Object.keys || function keys(O) { return $keys(O, enumBugKeys); }; },{"38":38,"82":82}],84:[function(_dereq_,module,exports){ exports.f = {}.propertyIsEnumerable; },{}],85:[function(_dereq_,module,exports){ // most Object methods by ES6 should accept primitives var $export = _dereq_(40); var core = _dereq_(30); var fails = _dereq_(42); module.exports = function (KEY, exec) { var fn = (core.Object || {})[KEY] || Object[KEY]; var exp = {}; exp[KEY] = exec(fn); $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); }; },{"30":30,"40":40,"42":42}],86:[function(_dereq_,module,exports){ var getKeys = _dereq_(83); var toIObject = _dereq_(116); var isEnum = _dereq_(84).f; module.exports = function (isEntries) { return function (it) { var O = toIObject(it); var keys = getKeys(O); var length = keys.length; var i = 0; var result = []; var key; while (length > i) if (isEnum.call(O, key = keys[i++])) { result.push(isEntries ? [key, O[key]] : O[key]); } return result; }; }; },{"116":116,"83":83,"84":84}],87:[function(_dereq_,module,exports){ // all object keys, includes non-enumerable and symbols var gOPN = _dereq_(79); var gOPS = _dereq_(80); var anObject = _dereq_(16); var Reflect = _dereq_(46).Reflect; module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { var keys = gOPN.f(anObject(it)); var getSymbols = gOPS.f; return getSymbols ? keys.concat(getSymbols(it)) : keys; }; },{"16":16,"46":46,"79":79,"80":80}],88:[function(_dereq_,module,exports){ var $parseFloat = _dereq_(46).parseFloat; var $trim = _dereq_(110).trim; module.exports = 1 / $parseFloat(_dereq_(111) + '-0') !== -Infinity ? function parseFloat(str) { var string = $trim(String(str), 3); var result = $parseFloat(string); return result === 0 && string.charAt(0) == '-' ? -0 : result; } : $parseFloat; },{"110":110,"111":111,"46":46}],89:[function(_dereq_,module,exports){ var $parseInt = _dereq_(46).parseInt; var $trim = _dereq_(110).trim; var ws = _dereq_(111); var hex = /^[-+]?0[xX]/; module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { var string = $trim(String(str), 3); return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); } : $parseInt; },{"110":110,"111":111,"46":46}],90:[function(_dereq_,module,exports){ module.exports = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; },{}],91:[function(_dereq_,module,exports){ var anObject = _dereq_(16); var isObject = _dereq_(57); var newPromiseCapability = _dereq_(72); module.exports = function (C, x) { anObject(C); if (isObject(x) && x.constructor === C) return x; var promiseCapability = newPromiseCapability.f(C); var resolve = promiseCapability.resolve; resolve(x); return promiseCapability.promise; }; },{"16":16,"57":57,"72":72}],92:[function(_dereq_,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],93:[function(_dereq_,module,exports){ var redefine = _dereq_(94); module.exports = function (target, src, safe) { for (var key in src) redefine(target, key, src[key], safe); return target; }; },{"94":94}],94:[function(_dereq_,module,exports){ var global = _dereq_(46); var hide = _dereq_(48); var has = _dereq_(47); var SRC = _dereq_(123)('src'); var TO_STRING = 'toString'; var $toString = Function[TO_STRING]; var TPL = ('' + $toString).split(TO_STRING); _dereq_(30).inspectSource = function (it) { return $toString.call(it); }; (module.exports = function (O, key, val, safe) { var isFunction = typeof val == 'function'; if (isFunction) has(val, 'name') || hide(val, 'name', key); if (O[key] === val) return; if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); if (O === global) { O[key] = val; } else if (!safe) { delete O[key]; hide(O, key, val); } else if (O[key]) { O[key] = val; } else { hide(O, key, val); } // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, TO_STRING, function toString() { return typeof this == 'function' && this[SRC] || $toString.call(this); }); },{"123":123,"30":30,"46":46,"47":47,"48":48}],95:[function(_dereq_,module,exports){ 'use strict'; var classof = _dereq_(25); var builtinExec = RegExp.prototype.exec; // `RegExpExec` abstract operation // https://tc39.github.io/ecma262/#sec-regexpexec module.exports = function (R, S) { var exec = R.exec; if (typeof exec === 'function') { var result = exec.call(R, S); if (typeof result !== 'object') { throw new TypeError('RegExp exec method returned something other than an Object or null'); } return result; } if (classof(R) !== 'RegExp') { throw new TypeError('RegExp#exec called on incompatible receiver'); } return builtinExec.call(R, S); }; },{"25":25}],96:[function(_dereq_,module,exports){ 'use strict'; var regexpFlags = _dereq_(44); var nativeExec = RegExp.prototype.exec; // This always refers to the native implementation, because the // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, // which loads this file before patching the method. var nativeReplace = String.prototype.replace; var patchedExec = nativeExec; var LAST_INDEX = 'lastIndex'; var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/, re2 = /b*/g; nativeExec.call(re1, 'a'); nativeExec.call(re2, 'a'); return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; })(); // nonparticipating capturing group, copied from es5-shim's String#split patch. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; if (PATCH) { patchedExec = function exec(str) { var re = this; var lastIndex, reCopy, match, i; if (NPCG_INCLUDED) { reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; match = nativeExec.call(re, str); if (UPDATES_LAST_INDEX_WRONG && match) { re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ // eslint-disable-next-line no-loop-func nativeReplace.call(match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } return match; }; } module.exports = patchedExec; },{"44":44}],97:[function(_dereq_,module,exports){ // 7.2.9 SameValue(x, y) module.exports = Object.is || function is(x, y) { // eslint-disable-next-line no-self-compare return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; }; },{}],98:[function(_dereq_,module,exports){ // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var isObject = _dereq_(57); var anObject = _dereq_(16); var check = function (O, proto) { anObject(O); if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); }; module.exports = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { set = _dereq_(32)(Function.call, _dereq_(77).f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) O.__proto__ = proto; else set(O, proto); return O; }; }({}, false) : undefined), check: check }; },{"16":16,"32":32,"57":57,"77":77}],99:[function(_dereq_,module,exports){ 'use strict'; var global = _dereq_(46); var dP = _dereq_(75); var DESCRIPTORS = _dereq_(36); var SPECIES = _dereq_(128)('species'); module.exports = function (KEY) { var C = global[KEY]; if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { configurable: true, get: function () { return this; } }); }; },{"128":128,"36":36,"46":46,"75":75}],100:[function(_dereq_,module,exports){ var def = _dereq_(75).f; var has = _dereq_(47); var TAG = _dereq_(128)('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); }; },{"128":128,"47":47,"75":75}],101:[function(_dereq_,module,exports){ var shared = _dereq_(102)('keys'); var uid = _dereq_(123); module.exports = function (key) { return shared[key] || (shared[key] = uid(key)); }; },{"102":102,"123":123}],102:[function(_dereq_,module,exports){ var core = _dereq_(30); var global = _dereq_(46); var SHARED = '__core-js_shared__'; var store = global[SHARED] || (global[SHARED] = {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: core.version, mode: _dereq_(65) ? 'pure' : 'global', copyright: '© 2018 Denis Pushkarev (zloirock.ru)' }); },{"30":30,"46":46,"65":65}],103:[function(_dereq_,module,exports){ // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = _dereq_(16); var aFunction = _dereq_(11); var SPECIES = _dereq_(128)('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); }; },{"11":11,"128":128,"16":16}],104:[function(_dereq_,module,exports){ 'use strict'; var fails = _dereq_(42); module.exports = function (method, arg) { return !!method && fails(function () { // eslint-disable-next-line no-useless-call arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); }); }; },{"42":42}],105:[function(_dereq_,module,exports){ var toInteger = _dereq_(115); var defined = _dereq_(35); // true -> String#at // false -> String#codePointAt module.exports = function (TO_STRING) { return function (that, pos) { var s = String(defined(that)); var i = toInteger(pos); var l = s.length; var a, b; if (i < 0 || i >= l) return TO_STRING ? '' : undefined; a = s.charCodeAt(i); return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; }; }; },{"115":115,"35":35}],106:[function(_dereq_,module,exports){ // helper for String#{startsWith, endsWith, includes} var isRegExp = _dereq_(58); var defined = _dereq_(35); module.exports = function (that, searchString, NAME) { if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); return String(defined(that)); }; },{"35":35,"58":58}],107:[function(_dereq_,module,exports){ var $export = _dereq_(40); var fails = _dereq_(42); var defined = _dereq_(35); var quot = /"/g; // B.2.3.2.1 CreateHTML(string, tag, attribute, value) var createHTML = function (string, tag, attribute, value) { var S = String(defined(string)); var p1 = '<' + tag; if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; return p1 + '>' + S + ''; }; module.exports = function (NAME, exec) { var O = {}; O[NAME] = exec(createHTML); $export($export.P + $export.F * fails(function () { var test = ''[NAME]('"'); return test !== test.toLowerCase() || test.split('"').length > 3; }), 'String', O); }; },{"35":35,"40":40,"42":42}],108:[function(_dereq_,module,exports){ // https://github.com/tc39/proposal-string-pad-start-end var toLength = _dereq_(117); var repeat = _dereq_(109); var defined = _dereq_(35); module.exports = function (that, maxLength, fillString, left) { var S = String(defined(that)); var stringLength = S.length; var fillStr = fillString === undefined ? ' ' : String(fillString); var intMaxLength = toLength(maxLength); if (intMaxLength <= stringLength || fillStr == '') return S; var fillLen = intMaxLength - stringLength; var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); return left ? stringFiller + S : S + stringFiller; }; },{"109":109,"117":117,"35":35}],109:[function(_dereq_,module,exports){ 'use strict'; var toInteger = _dereq_(115); var defined = _dereq_(35); module.exports = function repeat(count) { var str = String(defined(this)); var res = ''; var n = toInteger(count); if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; return res; }; },{"115":115,"35":35}],110:[function(_dereq_,module,exports){ var $export = _dereq_(40); var defined = _dereq_(35); var fails = _dereq_(42); var spaces = _dereq_(111); var space = '[' + spaces + ']'; var non = '\u200b\u0085'; var ltrim = RegExp('^' + space + space + '*'); var rtrim = RegExp(space + space + '*$'); var exporter = function (KEY, exec, ALIAS) { var exp = {}; var FORCE = fails(function () { return !!spaces[KEY]() || non[KEY]() != non; }); var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; if (ALIAS) exp[ALIAS] = fn; $export($export.P + $export.F * FORCE, 'String', exp); }; // 1 -> String#trimLeft // 2 -> String#trimRight // 3 -> String#trim var trim = exporter.trim = function (string, TYPE) { string = String(defined(string)); if (TYPE & 1) string = string.replace(ltrim, ''); if (TYPE & 2) string = string.replace(rtrim, ''); return string; }; module.exports = exporter; },{"111":111,"35":35,"40":40,"42":42}],111:[function(_dereq_,module,exports){ module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; },{}],112:[function(_dereq_,module,exports){ var ctx = _dereq_(32); var invoke = _dereq_(52); var html = _dereq_(49); var cel = _dereq_(37); var global = _dereq_(46); var process = global.process; var setTask = global.setImmediate; var clearTask = global.clearImmediate; var MessageChannel = global.MessageChannel; var Dispatch = global.Dispatch; var counter = 0; var queue = {}; var ONREADYSTATECHANGE = 'onreadystatechange'; var defer, channel, port; var run = function () { var id = +this; // eslint-disable-next-line no-prototype-builtins if (queue.hasOwnProperty(id)) { var fn = queue[id]; delete queue[id]; fn(); } }; var listener = function (event) { run.call(event.data); }; // Node.js 0.9+ & IE10+ has setImmediate, otherwise: if (!setTask || !clearTask) { setTask = function setImmediate(fn) { var args = []; var i = 1; while (arguments.length > i) args.push(arguments[i++]); queue[++counter] = function () { // eslint-disable-next-line no-new-func invoke(typeof fn == 'function' ? fn : Function(fn), args); }; defer(counter); return counter; }; clearTask = function clearImmediate(id) { delete queue[id]; }; // Node.js 0.8- if (_dereq_(26)(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; // Sphere (JS game engine) Dispatch API } else if (Dispatch && Dispatch.now) { defer = function (id) { Dispatch.now(ctx(run, id, 1)); }; // Browsers with MessageChannel, includes WebWorkers } else if (MessageChannel) { channel = new MessageChannel(); port = channel.port2; channel.port1.onmessage = listener; defer = ctx(port.postMessage, port, 1); // Browsers with postMessage, skip WebWorkers // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { defer = function (id) { global.postMessage(id + '', '*'); }; global.addEventListener('message', listener, false); // IE8- } else if (ONREADYSTATECHANGE in cel('script')) { defer = function (id) { html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(ctx(run, id, 1), 0); }; } } module.exports = { set: setTask, clear: clearTask }; },{"26":26,"32":32,"37":37,"46":46,"49":49,"52":52}],113:[function(_dereq_,module,exports){ var toInteger = _dereq_(115); var max = Math.max; var min = Math.min; module.exports = function (index, length) { index = toInteger(index); return index < 0 ? max(index + length, 0) : min(index, length); }; },{"115":115}],114:[function(_dereq_,module,exports){ // https://tc39.github.io/ecma262/#sec-toindex var toInteger = _dereq_(115); var toLength = _dereq_(117); module.exports = function (it) { if (it === undefined) return 0; var number = toInteger(it); var length = toLength(number); if (number !== length) throw RangeError('Wrong length!'); return length; }; },{"115":115,"117":117}],115:[function(_dereq_,module,exports){ // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; module.exports = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; },{}],116:[function(_dereq_,module,exports){ // to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = _dereq_(53); var defined = _dereq_(35); module.exports = function (it) { return IObject(defined(it)); }; },{"35":35,"53":53}],117:[function(_dereq_,module,exports){ // 7.1.15 ToLength var toInteger = _dereq_(115); var min = Math.min; module.exports = function (it) { return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; },{"115":115}],118:[function(_dereq_,module,exports){ // 7.1.13 ToObject(argument) var defined = _dereq_(35); module.exports = function (it) { return Object(defined(it)); }; },{"35":35}],119:[function(_dereq_,module,exports){ // 7.1.1 ToPrimitive(input [, PreferredType]) var isObject = _dereq_(57); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { if (!isObject(it)) return it; var fn, val; if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; throw TypeError("Can't convert object to primitive value"); }; },{"57":57}],120:[function(_dereq_,module,exports){ 'use strict'; if (_dereq_(36)) { var LIBRARY = _dereq_(65); var global = _dereq_(46); var fails = _dereq_(42); var $export = _dereq_(40); var $typed = _dereq_(122); var $buffer = _dereq_(121); var ctx = _dereq_(32); var anInstance = _dereq_(15); var propertyDesc = _dereq_(92); var hide = _dereq_(48); var redefineAll = _dereq_(93); var toInteger = _dereq_(115); var toLength = _dereq_(117); var toIndex = _dereq_(114); var toAbsoluteIndex = _dereq_(113); var toPrimitive = _dereq_(119); var has = _dereq_(47); var classof = _dereq_(25); var isObject = _dereq_(57); var toObject = _dereq_(118); var isArrayIter = _dereq_(54); var create = _dereq_(74); var getPrototypeOf = _dereq_(81); var gOPN = _dereq_(79).f; var getIterFn = _dereq_(129); var uid = _dereq_(123); var wks = _dereq_(128); var createArrayMethod = _dereq_(20); var createArrayIncludes = _dereq_(19); var speciesConstructor = _dereq_(103); var ArrayIterators = _dereq_(140); var Iterators = _dereq_(64); var $iterDetect = _dereq_(62); var setSpecies = _dereq_(99); var arrayFill = _dereq_(18); var arrayCopyWithin = _dereq_(17); var $DP = _dereq_(75); var $GOPD = _dereq_(77); var dP = $DP.f; var gOPD = $GOPD.f; var RangeError = global.RangeError; var TypeError = global.TypeError; var Uint8Array = global.Uint8Array; var ARRAY_BUFFER = 'ArrayBuffer'; var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; var PROTOTYPE = 'prototype'; var ArrayProto = Array[PROTOTYPE]; var $ArrayBuffer = $buffer.ArrayBuffer; var $DataView = $buffer.DataView; var arrayForEach = createArrayMethod(0); var arrayFilter = createArrayMethod(2); var arraySome = createArrayMethod(3); var arrayEvery = createArrayMethod(4); var arrayFind = createArrayMethod(5); var arrayFindIndex = createArrayMethod(6); var arrayIncludes = createArrayIncludes(true); var arrayIndexOf = createArrayIncludes(false); var arrayValues = ArrayIterators.values; var arrayKeys = ArrayIterators.keys; var arrayEntries = ArrayIterators.entries; var arrayLastIndexOf = ArrayProto.lastIndexOf; var arrayReduce = ArrayProto.reduce; var arrayReduceRight = ArrayProto.reduceRight; var arrayJoin = ArrayProto.join; var arraySort = ArrayProto.sort; var arraySlice = ArrayProto.slice; var arrayToString = ArrayProto.toString; var arrayToLocaleString = ArrayProto.toLocaleString; var ITERATOR = wks('iterator'); var TAG = wks('toStringTag'); var TYPED_CONSTRUCTOR = uid('typed_constructor'); var DEF_CONSTRUCTOR = uid('def_constructor'); var ALL_CONSTRUCTORS = $typed.CONSTR; var TYPED_ARRAY = $typed.TYPED; var VIEW = $typed.VIEW; var WRONG_LENGTH = 'Wrong length!'; var $map = createArrayMethod(1, function (O, length) { return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); }); var LITTLE_ENDIAN = fails(function () { // eslint-disable-next-line no-undef return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; }); var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { new Uint8Array(1).set({}); }); var toOffset = function (it, BYTES) { var offset = toInteger(it); if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); return offset; }; var validate = function (it) { if (isObject(it) && TYPED_ARRAY in it) return it; throw TypeError(it + ' is not a typed array!'); }; var allocate = function (C, length) { if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { throw TypeError('It is not a typed array constructor!'); } return new C(length); }; var speciesFromList = function (O, list) { return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); }; var fromList = function (C, list) { var index = 0; var length = list.length; var result = allocate(C, length); while (length > index) result[index] = list[index++]; return result; }; var addGetter = function (it, key, internal) { dP(it, key, { get: function () { return this._d[internal]; } }); }; var $from = function from(source /* , mapfn, thisArg */) { var O = toObject(source); var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iterFn = getIterFn(O); var i, length, values, result, step, iterator; if (iterFn != undefined && !isArrayIter(iterFn)) { for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { values.push(step.value); } O = values; } if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { result[i] = mapping ? mapfn(O[i], i) : O[i]; } return result; }; var $of = function of(/* ...items */) { var index = 0; var length = arguments.length; var result = allocate(this, length); while (length > index) result[index] = arguments[index++]; return result; }; // iOS Safari 6.x fails here var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); var $toLocaleString = function toLocaleString() { return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); }; var proto = { copyWithin: function copyWithin(target, start /* , end */) { return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); }, every: function every(callbackfn /* , thisArg */) { return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars return arrayFill.apply(validate(this), arguments); }, filter: function filter(callbackfn /* , thisArg */) { return speciesFromList(this, arrayFilter(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined)); }, find: function find(predicate /* , thisArg */) { return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }, findIndex: function findIndex(predicate /* , thisArg */) { return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); }, forEach: function forEach(callbackfn /* , thisArg */) { arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, indexOf: function indexOf(searchElement /* , fromIndex */) { return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }, includes: function includes(searchElement /* , fromIndex */) { return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); }, join: function join(separator) { // eslint-disable-line no-unused-vars return arrayJoin.apply(validate(this), arguments); }, lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars return arrayLastIndexOf.apply(validate(this), arguments); }, map: function map(mapfn /* , thisArg */) { return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); }, reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars return arrayReduce.apply(validate(this), arguments); }, reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars return arrayReduceRight.apply(validate(this), arguments); }, reverse: function reverse() { var that = this; var length = validate(that).length; var middle = Math.floor(length / 2); var index = 0; var value; while (index < middle) { value = that[index]; that[index++] = that[--length]; that[length] = value; } return that; }, some: function some(callbackfn /* , thisArg */) { return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); }, sort: function sort(comparefn) { return arraySort.call(validate(this), comparefn); }, subarray: function subarray(begin, end) { var O = validate(this); var length = O.length; var $begin = toAbsoluteIndex(begin, length); return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( O.buffer, O.byteOffset + $begin * O.BYTES_PER_ELEMENT, toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) ); } }; var $slice = function slice(start, end) { return speciesFromList(this, arraySlice.call(validate(this), start, end)); }; var $set = function set(arrayLike /* , offset */) { validate(this); var offset = toOffset(arguments[1], 1); var length = this.length; var src = toObject(arrayLike); var len = toLength(src.length); var index = 0; if (len + offset > length) throw RangeError(WRONG_LENGTH); while (index < len) this[offset + index] = src[index++]; }; var $iterators = { entries: function entries() { return arrayEntries.call(validate(this)); }, keys: function keys() { return arrayKeys.call(validate(this)); }, values: function values() { return arrayValues.call(validate(this)); } }; var isTAIndex = function (target, key) { return isObject(target) && target[TYPED_ARRAY] && typeof key != 'symbol' && key in target && String(+key) == String(key); }; var $getDesc = function getOwnPropertyDescriptor(target, key) { return isTAIndex(target, key = toPrimitive(key, true)) ? propertyDesc(2, target[key]) : gOPD(target, key); }; var $setDesc = function defineProperty(target, key, desc) { if (isTAIndex(target, key = toPrimitive(key, true)) && isObject(desc) && has(desc, 'value') && !has(desc, 'get') && !has(desc, 'set') // TODO: add validation descriptor w/o calling accessors && !desc.configurable && (!has(desc, 'writable') || desc.writable) && (!has(desc, 'enumerable') || desc.enumerable) ) { target[key] = desc.value; return target; } return dP(target, key, desc); }; if (!ALL_CONSTRUCTORS) { $GOPD.f = $getDesc; $DP.f = $setDesc; } $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { getOwnPropertyDescriptor: $getDesc, defineProperty: $setDesc }); if (fails(function () { arrayToString.call({}); })) { arrayToString = arrayToLocaleString = function toString() { return arrayJoin.call(this); }; } var $TypedArrayPrototype$ = redefineAll({}, proto); redefineAll($TypedArrayPrototype$, $iterators); hide($TypedArrayPrototype$, ITERATOR, $iterators.values); redefineAll($TypedArrayPrototype$, { slice: $slice, set: $set, constructor: function () { /* noop */ }, toString: arrayToString, toLocaleString: $toLocaleString }); addGetter($TypedArrayPrototype$, 'buffer', 'b'); addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); addGetter($TypedArrayPrototype$, 'byteLength', 'l'); addGetter($TypedArrayPrototype$, 'length', 'e'); dP($TypedArrayPrototype$, TAG, { get: function () { return this[TYPED_ARRAY]; } }); // eslint-disable-next-line max-statements module.exports = function (KEY, BYTES, wrapper, CLAMPED) { CLAMPED = !!CLAMPED; var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; var GETTER = 'get' + KEY; var SETTER = 'set' + KEY; var TypedArray = global[NAME]; var Base = TypedArray || {}; var TAC = TypedArray && getPrototypeOf(TypedArray); var FORCED = !TypedArray || !$typed.ABV; var O = {}; var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; var getter = function (that, index) { var data = that._d; return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); }; var setter = function (that, index, value) { var data = that._d; if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); }; var addElement = function (that, index) { dP(that, index, { get: function () { return getter(this, index); }, set: function (value) { return setter(this, index, value); }, enumerable: true }); }; if (FORCED) { TypedArray = wrapper(function (that, data, $offset, $length) { anInstance(that, TypedArray, NAME, '_d'); var index = 0; var offset = 0; var buffer, byteLength, length, klass; if (!isObject(data)) { length = toIndex(data); byteLength = length * BYTES; buffer = new $ArrayBuffer(byteLength); } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { buffer = data; offset = toOffset($offset, BYTES); var $len = data.byteLength; if ($length === undefined) { if ($len % BYTES) throw RangeError(WRONG_LENGTH); byteLength = $len - offset; if (byteLength < 0) throw RangeError(WRONG_LENGTH); } else { byteLength = toLength($length) * BYTES; if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); } length = byteLength / BYTES; } else if (TYPED_ARRAY in data) { return fromList(TypedArray, data); } else { return $from.call(TypedArray, data); } hide(that, '_d', { b: buffer, o: offset, l: byteLength, e: length, v: new $DataView(buffer) }); while (index < length) addElement(that, index++); }); TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); hide(TypedArrayPrototype, 'constructor', TypedArray); } else if (!fails(function () { TypedArray(1); }) || !fails(function () { new TypedArray(-1); // eslint-disable-line no-new }) || !$iterDetect(function (iter) { new TypedArray(); // eslint-disable-line no-new new TypedArray(null); // eslint-disable-line no-new new TypedArray(1.5); // eslint-disable-line no-new new TypedArray(iter); // eslint-disable-line no-new }, true)) { TypedArray = wrapper(function (that, data, $offset, $length) { anInstance(that, TypedArray, NAME); var klass; // `ws` module bug, temporarily remove validation length for Uint8Array // https://github.com/websockets/ws/pull/645 if (!isObject(data)) return new Base(toIndex(data)); if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { return $length !== undefined ? new Base(data, toOffset($offset, BYTES), $length) : $offset !== undefined ? new Base(data, toOffset($offset, BYTES)) : new Base(data); } if (TYPED_ARRAY in data) return fromList(TypedArray, data); return $from.call(TypedArray, data); }); arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); }); TypedArray[PROTOTYPE] = TypedArrayPrototype; if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; } var $nativeIterator = TypedArrayPrototype[ITERATOR]; var CORRECT_ITER_NAME = !!$nativeIterator && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); var $iterator = $iterators.values; hide(TypedArray, TYPED_CONSTRUCTOR, true); hide(TypedArrayPrototype, TYPED_ARRAY, NAME); hide(TypedArrayPrototype, VIEW, true); hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { dP(TypedArrayPrototype, TAG, { get: function () { return NAME; } }); } O[NAME] = TypedArray; $export($export.G + $export.W + $export.F * (TypedArray != Base), O); $export($export.S, NAME, { BYTES_PER_ELEMENT: BYTES }); $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { from: $from, of: $of }); if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); $export($export.P, NAME, proto); setSpecies(NAME); $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; $export($export.P + $export.F * fails(function () { new TypedArray(1).slice(); }), NAME, { slice: $slice }); $export($export.P + $export.F * (fails(function () { return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); }) || !fails(function () { TypedArrayPrototype.toLocaleString.call([1, 2]); })), NAME, { toLocaleString: $toLocaleString }); Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); }; } else module.exports = function () { /* empty */ }; },{"103":103,"113":113,"114":114,"115":115,"117":117,"118":118,"119":119,"121":121,"122":122,"123":123,"128":128,"129":129,"140":140,"15":15,"17":17,"18":18,"19":19,"20":20,"25":25,"32":32,"36":36,"40":40,"42":42,"46":46,"47":47,"48":48,"54":54,"57":57,"62":62,"64":64,"65":65,"74":74,"75":75,"77":77,"79":79,"81":81,"92":92,"93":93,"99":99}],121:[function(_dereq_,module,exports){ 'use strict'; var global = _dereq_(46); var DESCRIPTORS = _dereq_(36); var LIBRARY = _dereq_(65); var $typed = _dereq_(122); var hide = _dereq_(48); var redefineAll = _dereq_(93); var fails = _dereq_(42); var anInstance = _dereq_(15); var toInteger = _dereq_(115); var toLength = _dereq_(117); var toIndex = _dereq_(114); var gOPN = _dereq_(79).f; var dP = _dereq_(75).f; var arrayFill = _dereq_(18); var setToStringTag = _dereq_(100); var ARRAY_BUFFER = 'ArrayBuffer'; var DATA_VIEW = 'DataView'; var PROTOTYPE = 'prototype'; var WRONG_LENGTH = 'Wrong length!'; var WRONG_INDEX = 'Wrong index!'; var $ArrayBuffer = global[ARRAY_BUFFER]; var $DataView = global[DATA_VIEW]; var Math = global.Math; var RangeError = global.RangeError; // eslint-disable-next-line no-shadow-restricted-names var Infinity = global.Infinity; var BaseBuffer = $ArrayBuffer; var abs = Math.abs; var pow = Math.pow; var floor = Math.floor; var log = Math.log; var LN2 = Math.LN2; var BUFFER = 'buffer'; var BYTE_LENGTH = 'byteLength'; var BYTE_OFFSET = 'byteOffset'; var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; // IEEE754 conversions based on https://github.com/feross/ieee754 function packIEEE754(value, mLen, nBytes) { var buffer = new Array(nBytes); var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; var i = 0; var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; var e, m, c; value = abs(value); // eslint-disable-next-line no-self-compare if (value != value || value === Infinity) { // eslint-disable-next-line no-self-compare m = value != value ? 1 : 0; e = eMax; } else { e = floor(log(value) / LN2); if (value * (c = pow(2, -e)) < 1) { e--; c *= 2; } if (e + eBias >= 1) { value += rt / c; } else { value += rt * pow(2, 1 - eBias); } if (value * c >= 2) { e++; c /= 2; } if (e + eBias >= eMax) { m = 0; e = eMax; } else if (e + eBias >= 1) { m = (value * c - 1) * pow(2, mLen); e = e + eBias; } else { m = value * pow(2, eBias - 1) * pow(2, mLen); e = 0; } } for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); e = e << mLen | m; eLen += mLen; for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); buffer[--i] |= s * 128; return buffer; } function unpackIEEE754(buffer, mLen, nBytes) { var eLen = nBytes * 8 - mLen - 1; var eMax = (1 << eLen) - 1; var eBias = eMax >> 1; var nBits = eLen - 7; var i = nBytes - 1; var s = buffer[i--]; var e = s & 127; var m; s >>= 7; for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); m = e & (1 << -nBits) - 1; e >>= -nBits; nBits += mLen; for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); if (e === 0) { e = 1 - eBias; } else if (e === eMax) { return m ? NaN : s ? -Infinity : Infinity; } else { m = m + pow(2, mLen); e = e - eBias; } return (s ? -1 : 1) * m * pow(2, e - mLen); } function unpackI32(bytes) { return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; } function packI8(it) { return [it & 0xff]; } function packI16(it) { return [it & 0xff, it >> 8 & 0xff]; } function packI32(it) { return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; } function packF64(it) { return packIEEE754(it, 52, 8); } function packF32(it) { return packIEEE754(it, 23, 4); } function addGetter(C, key, internal) { dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); } function get(view, bytes, index, isLittleEndian) { var numIndex = +index; var intIndex = toIndex(numIndex); if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); var store = view[$BUFFER]._b; var start = intIndex + view[$OFFSET]; var pack = store.slice(start, start + bytes); return isLittleEndian ? pack : pack.reverse(); } function set(view, bytes, index, conversion, value, isLittleEndian) { var numIndex = +index; var intIndex = toIndex(numIndex); if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); var store = view[$BUFFER]._b; var start = intIndex + view[$OFFSET]; var pack = conversion(+value); for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; } if (!$typed.ABV) { $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, $ArrayBuffer, ARRAY_BUFFER); var byteLength = toIndex(length); this._b = arrayFill.call(new Array(byteLength), 0); this[$LENGTH] = byteLength; }; $DataView = function DataView(buffer, byteOffset, byteLength) { anInstance(this, $DataView, DATA_VIEW); anInstance(buffer, $ArrayBuffer, DATA_VIEW); var bufferLength = buffer[$LENGTH]; var offset = toInteger(byteOffset); if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); this[$BUFFER] = buffer; this[$OFFSET] = offset; this[$LENGTH] = byteLength; }; if (DESCRIPTORS) { addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); addGetter($DataView, BUFFER, '_b'); addGetter($DataView, BYTE_LENGTH, '_l'); addGetter($DataView, BYTE_OFFSET, '_o'); } redefineAll($DataView[PROTOTYPE], { getInt8: function getInt8(byteOffset) { return get(this, 1, byteOffset)[0] << 24 >> 24; }, getUint8: function getUint8(byteOffset) { return get(this, 1, byteOffset)[0]; }, getInt16: function getInt16(byteOffset /* , littleEndian */) { var bytes = get(this, 2, byteOffset, arguments[1]); return (bytes[1] << 8 | bytes[0]) << 16 >> 16; }, getUint16: function getUint16(byteOffset /* , littleEndian */) { var bytes = get(this, 2, byteOffset, arguments[1]); return bytes[1] << 8 | bytes[0]; }, getInt32: function getInt32(byteOffset /* , littleEndian */) { return unpackI32(get(this, 4, byteOffset, arguments[1])); }, getUint32: function getUint32(byteOffset /* , littleEndian */) { return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; }, getFloat32: function getFloat32(byteOffset /* , littleEndian */) { return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); }, getFloat64: function getFloat64(byteOffset /* , littleEndian */) { return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); }, setInt8: function setInt8(byteOffset, value) { set(this, 1, byteOffset, packI8, value); }, setUint8: function setUint8(byteOffset, value) { set(this, 1, byteOffset, packI8, value); }, setInt16: function setInt16(byteOffset, value /* , littleEndian */) { set(this, 2, byteOffset, packI16, value, arguments[2]); }, setUint16: function setUint16(byteOffset, value /* , littleEndian */) { set(this, 2, byteOffset, packI16, value, arguments[2]); }, setInt32: function setInt32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packI32, value, arguments[2]); }, setUint32: function setUint32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packI32, value, arguments[2]); }, setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { set(this, 4, byteOffset, packF32, value, arguments[2]); }, setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { set(this, 8, byteOffset, packF64, value, arguments[2]); } }); } else { if (!fails(function () { $ArrayBuffer(1); }) || !fails(function () { new $ArrayBuffer(-1); // eslint-disable-line no-new }) || fails(function () { new $ArrayBuffer(); // eslint-disable-line no-new new $ArrayBuffer(1.5); // eslint-disable-line no-new new $ArrayBuffer(NaN); // eslint-disable-line no-new return $ArrayBuffer.name != ARRAY_BUFFER; })) { $ArrayBuffer = function ArrayBuffer(length) { anInstance(this, $ArrayBuffer); return new BaseBuffer(toIndex(length)); }; var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); } if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; } // iOS Safari 7.x bug var view = new $DataView(new $ArrayBuffer(2)); var $setInt8 = $DataView[PROTOTYPE].setInt8; view.setInt8(0, 2147483648); view.setInt8(1, 2147483649); if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { setInt8: function setInt8(byteOffset, value) { $setInt8.call(this, byteOffset, value << 24 >> 24); }, setUint8: function setUint8(byteOffset, value) { $setInt8.call(this, byteOffset, value << 24 >> 24); } }, true); } setToStringTag($ArrayBuffer, ARRAY_BUFFER); setToStringTag($DataView, DATA_VIEW); hide($DataView[PROTOTYPE], $typed.VIEW, true); exports[ARRAY_BUFFER] = $ArrayBuffer; exports[DATA_VIEW] = $DataView; },{"100":100,"114":114,"115":115,"117":117,"122":122,"15":15,"18":18,"36":36,"42":42,"46":46,"48":48,"65":65,"75":75,"79":79,"93":93}],122:[function(_dereq_,module,exports){ var global = _dereq_(46); var hide = _dereq_(48); var uid = _dereq_(123); var TYPED = uid('typed_array'); var VIEW = uid('view'); var ABV = !!(global.ArrayBuffer && global.DataView); var CONSTR = ABV; var i = 0; var l = 9; var Typed; var TypedArrayConstructors = ( 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' ).split(','); while (i < l) { if (Typed = global[TypedArrayConstructors[i++]]) { hide(Typed.prototype, TYPED, true); hide(Typed.prototype, VIEW, true); } else CONSTR = false; } module.exports = { ABV: ABV, CONSTR: CONSTR, TYPED: TYPED, VIEW: VIEW }; },{"123":123,"46":46,"48":48}],123:[function(_dereq_,module,exports){ var id = 0; var px = Math.random(); module.exports = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; },{}],124:[function(_dereq_,module,exports){ var global = _dereq_(46); var navigator = global.navigator; module.exports = navigator && navigator.userAgent || ''; },{"46":46}],125:[function(_dereq_,module,exports){ var isObject = _dereq_(57); module.exports = function (it, TYPE) { if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); return it; }; },{"57":57}],126:[function(_dereq_,module,exports){ var global = _dereq_(46); var core = _dereq_(30); var LIBRARY = _dereq_(65); var wksExt = _dereq_(127); var defineProperty = _dereq_(75).f; module.exports = function (name) { var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); }; },{"127":127,"30":30,"46":46,"65":65,"75":75}],127:[function(_dereq_,module,exports){ exports.f = _dereq_(128); },{"128":128}],128:[function(_dereq_,module,exports){ var store = _dereq_(102)('wks'); var uid = _dereq_(123); var Symbol = _dereq_(46).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; },{"102":102,"123":123,"46":46}],129:[function(_dereq_,module,exports){ var classof = _dereq_(25); var ITERATOR = _dereq_(128)('iterator'); var Iterators = _dereq_(64); module.exports = _dereq_(30).getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; },{"128":128,"25":25,"30":30,"64":64}],130:[function(_dereq_,module,exports){ // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) var $export = _dereq_(40); $export($export.P, 'Array', { copyWithin: _dereq_(17) }); _dereq_(13)('copyWithin'); },{"13":13,"17":17,"40":40}],131:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $every = _dereq_(20)(4); $export($export.P + $export.F * !_dereq_(104)([].every, true), 'Array', { // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) every: function every(callbackfn /* , thisArg */) { return $every(this, callbackfn, arguments[1]); } }); },{"104":104,"20":20,"40":40}],132:[function(_dereq_,module,exports){ // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) var $export = _dereq_(40); $export($export.P, 'Array', { fill: _dereq_(18) }); _dereq_(13)('fill'); },{"13":13,"18":18,"40":40}],133:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $filter = _dereq_(20)(2); $export($export.P + $export.F * !_dereq_(104)([].filter, true), 'Array', { // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments[1]); } }); },{"104":104,"20":20,"40":40}],134:[function(_dereq_,module,exports){ 'use strict'; // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) var $export = _dereq_(40); var $find = _dereq_(20)(6); var KEY = 'findIndex'; var forced = true; // Shouldn't skip holes if (KEY in []) Array(1)[KEY](function () { forced = false; }); $export($export.P + $export.F * forced, 'Array', { findIndex: function findIndex(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); _dereq_(13)(KEY); },{"13":13,"20":20,"40":40}],135:[function(_dereq_,module,exports){ 'use strict'; // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) var $export = _dereq_(40); var $find = _dereq_(20)(5); var KEY = 'find'; var forced = true; // Shouldn't skip holes if (KEY in []) Array(1)[KEY](function () { forced = false; }); $export($export.P + $export.F * forced, 'Array', { find: function find(callbackfn /* , that = undefined */) { return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); _dereq_(13)(KEY); },{"13":13,"20":20,"40":40}],136:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $forEach = _dereq_(20)(0); var STRICT = _dereq_(104)([].forEach, true); $export($export.P + $export.F * !STRICT, 'Array', { // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) forEach: function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments[1]); } }); },{"104":104,"20":20,"40":40}],137:[function(_dereq_,module,exports){ 'use strict'; var ctx = _dereq_(32); var $export = _dereq_(40); var toObject = _dereq_(118); var call = _dereq_(59); var isArrayIter = _dereq_(54); var toLength = _dereq_(117); var createProperty = _dereq_(31); var getIterFn = _dereq_(129); $export($export.S + $export.F * !_dereq_(62)(function (iter) { Array.from(iter); }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iterFn = getIterFn(O); var length, result, step, iterator; if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = toLength(O.length); for (result = new C(length); length > index; index++) { createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); },{"117":117,"118":118,"129":129,"31":31,"32":32,"40":40,"54":54,"59":59,"62":62}],138:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $indexOf = _dereq_(19)(false); var $native = [].indexOf; var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; $export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(104)($native)), 'Array', { // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO // convert -0 to +0 ? $native.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments[1]); } }); },{"104":104,"19":19,"40":40}],139:[function(_dereq_,module,exports){ // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) var $export = _dereq_(40); $export($export.S, 'Array', { isArray: _dereq_(55) }); },{"40":40,"55":55}],140:[function(_dereq_,module,exports){ 'use strict'; var addToUnscopables = _dereq_(13); var step = _dereq_(63); var Iterators = _dereq_(64); var toIObject = _dereq_(116); // 22.1.3.4 Array.prototype.entries() // 22.1.3.13 Array.prototype.keys() // 22.1.3.29 Array.prototype.values() // 22.1.3.30 Array.prototype[@@iterator]() module.exports = _dereq_(61)(Array, 'Array', function (iterated, kind) { this._t = toIObject(iterated); // target this._i = 0; // next index this._k = kind; // kind // 22.1.5.2.1 %ArrayIteratorPrototype%.next() }, function () { var O = this._t; var kind = this._k; var index = this._i++; if (!O || index >= O.length) { this._t = undefined; return step(1); } if (kind == 'keys') return step(0, index); if (kind == 'values') return step(0, O[index]); return step(0, [index, O[index]]); }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) Iterators.Arguments = Iterators.Array; addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"116":116,"13":13,"61":61,"63":63,"64":64}],141:[function(_dereq_,module,exports){ 'use strict'; // 22.1.3.13 Array.prototype.join(separator) var $export = _dereq_(40); var toIObject = _dereq_(116); var arrayJoin = [].join; // fallback for not array-like strings $export($export.P + $export.F * (_dereq_(53) != Object || !_dereq_(104)(arrayJoin)), 'Array', { join: function join(separator) { return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); } }); },{"104":104,"116":116,"40":40,"53":53}],142:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var toIObject = _dereq_(116); var toInteger = _dereq_(115); var toLength = _dereq_(117); var $native = [].lastIndexOf; var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; $export($export.P + $export.F * (NEGATIVE_ZERO || !_dereq_(104)($native)), 'Array', { // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { // convert -0 to +0 if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; var O = toIObject(this); var length = toLength(O.length); var index = length - 1; if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); if (index < 0) index = length + index; for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; return -1; } }); },{"104":104,"115":115,"116":116,"117":117,"40":40}],143:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $map = _dereq_(20)(1); $export($export.P + $export.F * !_dereq_(104)([].map, true), 'Array', { // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments[1]); } }); },{"104":104,"20":20,"40":40}],144:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var createProperty = _dereq_(31); // WebKit Array.of isn't generic $export($export.S + $export.F * _dereq_(42)(function () { function F() { /* empty */ } return !(Array.of.call(F) instanceof F); }), 'Array', { // 22.1.2.3 Array.of( ...items) of: function of(/* ...args */) { var index = 0; var aLen = arguments.length; var result = new (typeof this == 'function' ? this : Array)(aLen); while (aLen > index) createProperty(result, index, arguments[index++]); result.length = aLen; return result; } }); },{"31":31,"40":40,"42":42}],145:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $reduce = _dereq_(21); $export($export.P + $export.F * !_dereq_(104)([].reduceRight, true), 'Array', { // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) reduceRight: function reduceRight(callbackfn /* , initialValue */) { return $reduce(this, callbackfn, arguments.length, arguments[1], true); } }); },{"104":104,"21":21,"40":40}],146:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $reduce = _dereq_(21); $export($export.P + $export.F * !_dereq_(104)([].reduce, true), 'Array', { // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) reduce: function reduce(callbackfn /* , initialValue */) { return $reduce(this, callbackfn, arguments.length, arguments[1], false); } }); },{"104":104,"21":21,"40":40}],147:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var html = _dereq_(49); var cof = _dereq_(26); var toAbsoluteIndex = _dereq_(113); var toLength = _dereq_(117); var arraySlice = [].slice; // fallback for not array-like ES3 strings and DOM objects $export($export.P + $export.F * _dereq_(42)(function () { if (html) arraySlice.call(html); }), 'Array', { slice: function slice(begin, end) { var len = toLength(this.length); var klass = cof(this); end = end === undefined ? len : end; if (klass == 'Array') return arraySlice.call(this, begin, end); var start = toAbsoluteIndex(begin, len); var upTo = toAbsoluteIndex(end, len); var size = toLength(upTo - start); var cloned = new Array(size); var i = 0; for (; i < size; i++) cloned[i] = klass == 'String' ? this.charAt(start + i) : this[start + i]; return cloned; } }); },{"113":113,"117":117,"26":26,"40":40,"42":42,"49":49}],148:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $some = _dereq_(20)(3); $export($export.P + $export.F * !_dereq_(104)([].some, true), 'Array', { // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) some: function some(callbackfn /* , thisArg */) { return $some(this, callbackfn, arguments[1]); } }); },{"104":104,"20":20,"40":40}],149:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var aFunction = _dereq_(11); var toObject = _dereq_(118); var fails = _dereq_(42); var $sort = [].sort; var test = [1, 2, 3]; $export($export.P + $export.F * (fails(function () { // IE8- test.sort(undefined); }) || !fails(function () { // V8 bug test.sort(null); // Old WebKit }) || !_dereq_(104)($sort)), 'Array', { // 22.1.3.25 Array.prototype.sort(comparefn) sort: function sort(comparefn) { return comparefn === undefined ? $sort.call(toObject(this)) : $sort.call(toObject(this), aFunction(comparefn)); } }); },{"104":104,"11":11,"118":118,"40":40,"42":42}],150:[function(_dereq_,module,exports){ _dereq_(99)('Array'); },{"99":99}],151:[function(_dereq_,module,exports){ // 20.3.3.1 / 15.9.4.4 Date.now() var $export = _dereq_(40); $export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); },{"40":40}],152:[function(_dereq_,module,exports){ // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() var $export = _dereq_(40); var toISOString = _dereq_(33); // PhantomJS / old WebKit has a broken implementations $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { toISOString: toISOString }); },{"33":33,"40":40}],153:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var toObject = _dereq_(118); var toPrimitive = _dereq_(119); $export($export.P + $export.F * _dereq_(42)(function () { return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; }), 'Date', { // eslint-disable-next-line no-unused-vars toJSON: function toJSON(key) { var O = toObject(this); var pv = toPrimitive(O); return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); } }); },{"118":118,"119":119,"40":40,"42":42}],154:[function(_dereq_,module,exports){ var TO_PRIMITIVE = _dereq_(128)('toPrimitive'); var proto = Date.prototype; if (!(TO_PRIMITIVE in proto)) _dereq_(48)(proto, TO_PRIMITIVE, _dereq_(34)); },{"128":128,"34":34,"48":48}],155:[function(_dereq_,module,exports){ var DateProto = Date.prototype; var INVALID_DATE = 'Invalid Date'; var TO_STRING = 'toString'; var $toString = DateProto[TO_STRING]; var getTime = DateProto.getTime; if (new Date(NaN) + '' != INVALID_DATE) { _dereq_(94)(DateProto, TO_STRING, function toString() { var value = getTime.call(this); // eslint-disable-next-line no-self-compare return value === value ? $toString.call(this) : INVALID_DATE; }); } },{"94":94}],156:[function(_dereq_,module,exports){ // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) var $export = _dereq_(40); $export($export.P, 'Function', { bind: _dereq_(24) }); },{"24":24,"40":40}],157:[function(_dereq_,module,exports){ 'use strict'; var isObject = _dereq_(57); var getPrototypeOf = _dereq_(81); var HAS_INSTANCE = _dereq_(128)('hasInstance'); var FunctionProto = Function.prototype; // 19.2.3.6 Function.prototype[@@hasInstance](V) if (!(HAS_INSTANCE in FunctionProto)) _dereq_(75).f(FunctionProto, HAS_INSTANCE, { value: function (O) { if (typeof this != 'function' || !isObject(O)) return false; if (!isObject(this.prototype)) return O instanceof this; // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: while (O = getPrototypeOf(O)) if (this.prototype === O) return true; return false; } }); },{"128":128,"57":57,"75":75,"81":81}],158:[function(_dereq_,module,exports){ var dP = _dereq_(75).f; var FProto = Function.prototype; var nameRE = /^\s*function ([^ (]*)/; var NAME = 'name'; // 19.2.4.2 name NAME in FProto || _dereq_(36) && dP(FProto, NAME, { configurable: true, get: function () { try { return ('' + this).match(nameRE)[1]; } catch (e) { return ''; } } }); },{"36":36,"75":75}],159:[function(_dereq_,module,exports){ 'use strict'; var strong = _dereq_(27); var validate = _dereq_(125); var MAP = 'Map'; // 23.1 Map Objects module.exports = _dereq_(29)(MAP, function (get) { return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.1.3.6 Map.prototype.get(key) get: function get(key) { var entry = strong.getEntry(validate(this, MAP), key); return entry && entry.v; }, // 23.1.3.9 Map.prototype.set(key, value) set: function set(key, value) { return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); } }, strong, true); },{"125":125,"27":27,"29":29}],160:[function(_dereq_,module,exports){ // 20.2.2.3 Math.acosh(x) var $export = _dereq_(40); var log1p = _dereq_(68); var sqrt = Math.sqrt; var $acosh = Math.acosh; $export($export.S + $export.F * !($acosh // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 && Math.floor($acosh(Number.MAX_VALUE)) == 710 // Tor Browser bug: Math.acosh(Infinity) -> NaN && $acosh(Infinity) == Infinity ), 'Math', { acosh: function acosh(x) { return (x = +x) < 1 ? NaN : x > 94906265.62425156 ? Math.log(x) + Math.LN2 : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); } }); },{"40":40,"68":68}],161:[function(_dereq_,module,exports){ // 20.2.2.5 Math.asinh(x) var $export = _dereq_(40); var $asinh = Math.asinh; function asinh(x) { return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); } // Tor Browser bug: Math.asinh(0) -> -0 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); },{"40":40}],162:[function(_dereq_,module,exports){ // 20.2.2.7 Math.atanh(x) var $export = _dereq_(40); var $atanh = Math.atanh; // Tor Browser bug: Math.atanh(-0) -> 0 $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { atanh: function atanh(x) { return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; } }); },{"40":40}],163:[function(_dereq_,module,exports){ // 20.2.2.9 Math.cbrt(x) var $export = _dereq_(40); var sign = _dereq_(69); $export($export.S, 'Math', { cbrt: function cbrt(x) { return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); } }); },{"40":40,"69":69}],164:[function(_dereq_,module,exports){ // 20.2.2.11 Math.clz32(x) var $export = _dereq_(40); $export($export.S, 'Math', { clz32: function clz32(x) { return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; } }); },{"40":40}],165:[function(_dereq_,module,exports){ // 20.2.2.12 Math.cosh(x) var $export = _dereq_(40); var exp = Math.exp; $export($export.S, 'Math', { cosh: function cosh(x) { return (exp(x = +x) + exp(-x)) / 2; } }); },{"40":40}],166:[function(_dereq_,module,exports){ // 20.2.2.14 Math.expm1(x) var $export = _dereq_(40); var $expm1 = _dereq_(66); $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); },{"40":40,"66":66}],167:[function(_dereq_,module,exports){ // 20.2.2.16 Math.fround(x) var $export = _dereq_(40); $export($export.S, 'Math', { fround: _dereq_(67) }); },{"40":40,"67":67}],168:[function(_dereq_,module,exports){ // 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) var $export = _dereq_(40); var abs = Math.abs; $export($export.S, 'Math', { hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars var sum = 0; var i = 0; var aLen = arguments.length; var larg = 0; var arg, div; while (i < aLen) { arg = abs(arguments[i++]); if (larg < arg) { div = larg / arg; sum = sum * div * div + 1; larg = arg; } else if (arg > 0) { div = arg / larg; sum += div * div; } else sum += arg; } return larg === Infinity ? Infinity : larg * Math.sqrt(sum); } }); },{"40":40}],169:[function(_dereq_,module,exports){ // 20.2.2.18 Math.imul(x, y) var $export = _dereq_(40); var $imul = Math.imul; // some WebKit versions fails with big numbers, some has wrong arity $export($export.S + $export.F * _dereq_(42)(function () { return $imul(0xffffffff, 5) != -5 || $imul.length != 2; }), 'Math', { imul: function imul(x, y) { var UINT16 = 0xffff; var xn = +x; var yn = +y; var xl = UINT16 & xn; var yl = UINT16 & yn; return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); } }); },{"40":40,"42":42}],170:[function(_dereq_,module,exports){ // 20.2.2.21 Math.log10(x) var $export = _dereq_(40); $export($export.S, 'Math', { log10: function log10(x) { return Math.log(x) * Math.LOG10E; } }); },{"40":40}],171:[function(_dereq_,module,exports){ // 20.2.2.20 Math.log1p(x) var $export = _dereq_(40); $export($export.S, 'Math', { log1p: _dereq_(68) }); },{"40":40,"68":68}],172:[function(_dereq_,module,exports){ // 20.2.2.22 Math.log2(x) var $export = _dereq_(40); $export($export.S, 'Math', { log2: function log2(x) { return Math.log(x) / Math.LN2; } }); },{"40":40}],173:[function(_dereq_,module,exports){ // 20.2.2.28 Math.sign(x) var $export = _dereq_(40); $export($export.S, 'Math', { sign: _dereq_(69) }); },{"40":40,"69":69}],174:[function(_dereq_,module,exports){ // 20.2.2.30 Math.sinh(x) var $export = _dereq_(40); var expm1 = _dereq_(66); var exp = Math.exp; // V8 near Chromium 38 has a problem with very small numbers $export($export.S + $export.F * _dereq_(42)(function () { return !Math.sinh(-2e-17) != -2e-17; }), 'Math', { sinh: function sinh(x) { return Math.abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); } }); },{"40":40,"42":42,"66":66}],175:[function(_dereq_,module,exports){ // 20.2.2.33 Math.tanh(x) var $export = _dereq_(40); var expm1 = _dereq_(66); var exp = Math.exp; $export($export.S, 'Math', { tanh: function tanh(x) { var a = expm1(x = +x); var b = expm1(-x); return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); } }); },{"40":40,"66":66}],176:[function(_dereq_,module,exports){ // 20.2.2.34 Math.trunc(x) var $export = _dereq_(40); $export($export.S, 'Math', { trunc: function trunc(it) { return (it > 0 ? Math.floor : Math.ceil)(it); } }); },{"40":40}],177:[function(_dereq_,module,exports){ 'use strict'; var global = _dereq_(46); var has = _dereq_(47); var cof = _dereq_(26); var inheritIfRequired = _dereq_(51); var toPrimitive = _dereq_(119); var fails = _dereq_(42); var gOPN = _dereq_(79).f; var gOPD = _dereq_(77).f; var dP = _dereq_(75).f; var $trim = _dereq_(110).trim; var NUMBER = 'Number'; var $Number = global[NUMBER]; var Base = $Number; var proto = $Number.prototype; // Opera ~12 has broken Object#toString var BROKEN_COF = cof(_dereq_(74)(proto)) == NUMBER; var TRIM = 'trim' in String.prototype; // 7.1.3 ToNumber(argument) var toNumber = function (argument) { var it = toPrimitive(argument, false); if (typeof it == 'string' && it.length > 2) { it = TRIM ? it.trim() : $trim(it, 3); var first = it.charCodeAt(0); var third, radix, maxCode; if (first === 43 || first === 45) { third = it.charCodeAt(2); if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix } else if (first === 48) { switch (it.charCodeAt(1)) { case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i default: return +it; } for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { code = digits.charCodeAt(i); // parseInt parses a string to a first unavailable symbol // but ToNumber should return NaN if a string contains unavailable symbols if (code < 48 || code > maxCode) return NaN; } return parseInt(digits, radix); } } return +it; }; if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { $Number = function Number(value) { var it = arguments.length < 1 ? 0 : value; var that = this; return that instanceof $Number // check on 1..constructor(foo) case && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); }; for (var keys = _dereq_(36) ? gOPN(Base) : ( // ES3: 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + // ES6 (in case, if modules with ES6 Number statics required before): 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' ).split(','), j = 0, key; keys.length > j; j++) { if (has(Base, key = keys[j]) && !has($Number, key)) { dP($Number, key, gOPD(Base, key)); } } $Number.prototype = proto; proto.constructor = $Number; _dereq_(94)(global, NUMBER, $Number); } },{"110":110,"119":119,"26":26,"36":36,"42":42,"46":46,"47":47,"51":51,"74":74,"75":75,"77":77,"79":79,"94":94}],178:[function(_dereq_,module,exports){ // 20.1.2.1 Number.EPSILON var $export = _dereq_(40); $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); },{"40":40}],179:[function(_dereq_,module,exports){ // 20.1.2.2 Number.isFinite(number) var $export = _dereq_(40); var _isFinite = _dereq_(46).isFinite; $export($export.S, 'Number', { isFinite: function isFinite(it) { return typeof it == 'number' && _isFinite(it); } }); },{"40":40,"46":46}],180:[function(_dereq_,module,exports){ // 20.1.2.3 Number.isInteger(number) var $export = _dereq_(40); $export($export.S, 'Number', { isInteger: _dereq_(56) }); },{"40":40,"56":56}],181:[function(_dereq_,module,exports){ // 20.1.2.4 Number.isNaN(number) var $export = _dereq_(40); $export($export.S, 'Number', { isNaN: function isNaN(number) { // eslint-disable-next-line no-self-compare return number != number; } }); },{"40":40}],182:[function(_dereq_,module,exports){ // 20.1.2.5 Number.isSafeInteger(number) var $export = _dereq_(40); var isInteger = _dereq_(56); var abs = Math.abs; $export($export.S, 'Number', { isSafeInteger: function isSafeInteger(number) { return isInteger(number) && abs(number) <= 0x1fffffffffffff; } }); },{"40":40,"56":56}],183:[function(_dereq_,module,exports){ // 20.1.2.6 Number.MAX_SAFE_INTEGER var $export = _dereq_(40); $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); },{"40":40}],184:[function(_dereq_,module,exports){ // 20.1.2.10 Number.MIN_SAFE_INTEGER var $export = _dereq_(40); $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); },{"40":40}],185:[function(_dereq_,module,exports){ var $export = _dereq_(40); var $parseFloat = _dereq_(88); // 20.1.2.12 Number.parseFloat(string) $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); },{"40":40,"88":88}],186:[function(_dereq_,module,exports){ var $export = _dereq_(40); var $parseInt = _dereq_(89); // 20.1.2.13 Number.parseInt(string, radix) $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); },{"40":40,"89":89}],187:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var toInteger = _dereq_(115); var aNumberValue = _dereq_(12); var repeat = _dereq_(109); var $toFixed = 1.0.toFixed; var floor = Math.floor; var data = [0, 0, 0, 0, 0, 0]; var ERROR = 'Number.toFixed: incorrect invocation!'; var ZERO = '0'; var multiply = function (n, c) { var i = -1; var c2 = c; while (++i < 6) { c2 += n * data[i]; data[i] = c2 % 1e7; c2 = floor(c2 / 1e7); } }; var divide = function (n) { var i = 6; var c = 0; while (--i >= 0) { c += data[i]; data[i] = floor(c / n); c = (c % n) * 1e7; } }; var numToString = function () { var i = 6; var s = ''; while (--i >= 0) { if (s !== '' || i === 0 || data[i] !== 0) { var t = String(data[i]); s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; } } return s; }; var pow = function (x, n, acc) { return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); }; var log = function (x) { var n = 0; var x2 = x; while (x2 >= 4096) { n += 12; x2 /= 4096; } while (x2 >= 2) { n += 1; x2 /= 2; } return n; }; $export($export.P + $export.F * (!!$toFixed && ( 0.00008.toFixed(3) !== '0.000' || 0.9.toFixed(0) !== '1' || 1.255.toFixed(2) !== '1.25' || 1000000000000000128.0.toFixed(0) !== '1000000000000000128' ) || !_dereq_(42)(function () { // V8 ~ Android 4.3- $toFixed.call({}); })), 'Number', { toFixed: function toFixed(fractionDigits) { var x = aNumberValue(this, ERROR); var f = toInteger(fractionDigits); var s = ''; var m = ZERO; var e, z, j, k; if (f < 0 || f > 20) throw RangeError(ERROR); // eslint-disable-next-line no-self-compare if (x != x) return 'NaN'; if (x <= -1e21 || x >= 1e21) return String(x); if (x < 0) { s = '-'; x = -x; } if (x > 1e-21) { e = log(x * pow(2, 69, 1)) - 69; z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); z *= 0x10000000000000; e = 52 - e; if (e > 0) { multiply(0, z); j = f; while (j >= 7) { multiply(1e7, 0); j -= 7; } multiply(pow(10, j, 1), 0); j = e - 1; while (j >= 23) { divide(1 << 23); j -= 23; } divide(1 << j); multiply(1, 1); divide(2); m = numToString(); } else { multiply(0, z); multiply(1 << -e, 0); m = numToString() + repeat.call(ZERO, f); } } if (f > 0) { k = m.length; m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); } else { m = s + m; } return m; } }); },{"109":109,"115":115,"12":12,"40":40,"42":42}],188:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $fails = _dereq_(42); var aNumberValue = _dereq_(12); var $toPrecision = 1.0.toPrecision; $export($export.P + $export.F * ($fails(function () { // IE7- return $toPrecision.call(1, undefined) !== '1'; }) || !$fails(function () { // V8 ~ Android 4.3- $toPrecision.call({}); })), 'Number', { toPrecision: function toPrecision(precision) { var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); } }); },{"12":12,"40":40,"42":42}],189:[function(_dereq_,module,exports){ // 19.1.3.1 Object.assign(target, source) var $export = _dereq_(40); $export($export.S + $export.F, 'Object', { assign: _dereq_(73) }); },{"40":40,"73":73}],190:[function(_dereq_,module,exports){ var $export = _dereq_(40); // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) $export($export.S, 'Object', { create: _dereq_(74) }); },{"40":40,"74":74}],191:[function(_dereq_,module,exports){ var $export = _dereq_(40); // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) $export($export.S + $export.F * !_dereq_(36), 'Object', { defineProperties: _dereq_(76) }); },{"36":36,"40":40,"76":76}],192:[function(_dereq_,module,exports){ var $export = _dereq_(40); // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) $export($export.S + $export.F * !_dereq_(36), 'Object', { defineProperty: _dereq_(75).f }); },{"36":36,"40":40,"75":75}],193:[function(_dereq_,module,exports){ // 19.1.2.5 Object.freeze(O) var isObject = _dereq_(57); var meta = _dereq_(70).onFreeze; _dereq_(85)('freeze', function ($freeze) { return function freeze(it) { return $freeze && isObject(it) ? $freeze(meta(it)) : it; }; }); },{"57":57,"70":70,"85":85}],194:[function(_dereq_,module,exports){ // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) var toIObject = _dereq_(116); var $getOwnPropertyDescriptor = _dereq_(77).f; _dereq_(85)('getOwnPropertyDescriptor', function () { return function getOwnPropertyDescriptor(it, key) { return $getOwnPropertyDescriptor(toIObject(it), key); }; }); },{"116":116,"77":77,"85":85}],195:[function(_dereq_,module,exports){ // 19.1.2.7 Object.getOwnPropertyNames(O) _dereq_(85)('getOwnPropertyNames', function () { return _dereq_(78).f; }); },{"78":78,"85":85}],196:[function(_dereq_,module,exports){ // 19.1.2.9 Object.getPrototypeOf(O) var toObject = _dereq_(118); var $getPrototypeOf = _dereq_(81); _dereq_(85)('getPrototypeOf', function () { return function getPrototypeOf(it) { return $getPrototypeOf(toObject(it)); }; }); },{"118":118,"81":81,"85":85}],197:[function(_dereq_,module,exports){ // 19.1.2.11 Object.isExtensible(O) var isObject = _dereq_(57); _dereq_(85)('isExtensible', function ($isExtensible) { return function isExtensible(it) { return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; }; }); },{"57":57,"85":85}],198:[function(_dereq_,module,exports){ // 19.1.2.12 Object.isFrozen(O) var isObject = _dereq_(57); _dereq_(85)('isFrozen', function ($isFrozen) { return function isFrozen(it) { return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; }; }); },{"57":57,"85":85}],199:[function(_dereq_,module,exports){ // 19.1.2.13 Object.isSealed(O) var isObject = _dereq_(57); _dereq_(85)('isSealed', function ($isSealed) { return function isSealed(it) { return isObject(it) ? $isSealed ? $isSealed(it) : false : true; }; }); },{"57":57,"85":85}],200:[function(_dereq_,module,exports){ // 19.1.3.10 Object.is(value1, value2) var $export = _dereq_(40); $export($export.S, 'Object', { is: _dereq_(97) }); },{"40":40,"97":97}],201:[function(_dereq_,module,exports){ // 19.1.2.14 Object.keys(O) var toObject = _dereq_(118); var $keys = _dereq_(83); _dereq_(85)('keys', function () { return function keys(it) { return $keys(toObject(it)); }; }); },{"118":118,"83":83,"85":85}],202:[function(_dereq_,module,exports){ // 19.1.2.15 Object.preventExtensions(O) var isObject = _dereq_(57); var meta = _dereq_(70).onFreeze; _dereq_(85)('preventExtensions', function ($preventExtensions) { return function preventExtensions(it) { return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; }; }); },{"57":57,"70":70,"85":85}],203:[function(_dereq_,module,exports){ // 19.1.2.17 Object.seal(O) var isObject = _dereq_(57); var meta = _dereq_(70).onFreeze; _dereq_(85)('seal', function ($seal) { return function seal(it) { return $seal && isObject(it) ? $seal(meta(it)) : it; }; }); },{"57":57,"70":70,"85":85}],204:[function(_dereq_,module,exports){ // 19.1.3.19 Object.setPrototypeOf(O, proto) var $export = _dereq_(40); $export($export.S, 'Object', { setPrototypeOf: _dereq_(98).set }); },{"40":40,"98":98}],205:[function(_dereq_,module,exports){ 'use strict'; // 19.1.3.6 Object.prototype.toString() var classof = _dereq_(25); var test = {}; test[_dereq_(128)('toStringTag')] = 'z'; if (test + '' != '[object z]') { _dereq_(94)(Object.prototype, 'toString', function toString() { return '[object ' + classof(this) + ']'; }, true); } },{"128":128,"25":25,"94":94}],206:[function(_dereq_,module,exports){ var $export = _dereq_(40); var $parseFloat = _dereq_(88); // 18.2.4 parseFloat(string) $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); },{"40":40,"88":88}],207:[function(_dereq_,module,exports){ var $export = _dereq_(40); var $parseInt = _dereq_(89); // 18.2.5 parseInt(string, radix) $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); },{"40":40,"89":89}],208:[function(_dereq_,module,exports){ 'use strict'; var LIBRARY = _dereq_(65); var global = _dereq_(46); var ctx = _dereq_(32); var classof = _dereq_(25); var $export = _dereq_(40); var isObject = _dereq_(57); var aFunction = _dereq_(11); var anInstance = _dereq_(15); var forOf = _dereq_(45); var speciesConstructor = _dereq_(103); var task = _dereq_(112).set; var microtask = _dereq_(71)(); var newPromiseCapabilityModule = _dereq_(72); var perform = _dereq_(90); var userAgent = _dereq_(124); var promiseResolve = _dereq_(91); var PROMISE = 'Promise'; var TypeError = global.TypeError; var process = global.process; var versions = process && process.versions; var v8 = versions && versions.v8 || ''; var $Promise = global[PROMISE]; var isNode = classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[_dereq_(128)('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 // we can't detect it synchronously, so just check versions && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1; } catch (e) { /* empty */ } }(); // helpers var isThenable = function (it) { var then; return isObject(it) && typeof (then = it.then) == 'function' ? then : false; }; var notify = function (promise, isReject) { if (promise._n) return; promise._n = true; var chain = promise._c; microtask(function () { var value = promise._v; var ok = promise._s == 1; var i = 0; var run = function (reaction) { var handler = ok ? reaction.ok : reaction.fail; var resolve = reaction.resolve; var reject = reaction.reject; var domain = reaction.domain; var result, then, exited; try { if (handler) { if (!ok) { if (promise._h == 2) onHandleUnhandled(promise); promise._h = 1; } if (handler === true) result = value; else { if (domain) domain.enter(); result = handler(value); // may throw if (domain) { domain.exit(); exited = true; } } if (result === reaction.promise) { reject(TypeError('Promise-chain cycle')); } else if (then = isThenable(result)) { then.call(result, resolve, reject); } else resolve(result); } else reject(value); } catch (e) { if (domain && !exited) domain.exit(); reject(e); } }; while (chain.length > i) run(chain[i++]); // variable length - can't use forEach promise._c = []; promise._n = false; if (isReject && !promise._h) onUnhandled(promise); }); }; var onUnhandled = function (promise) { task.call(global, function () { var value = promise._v; var unhandled = isUnhandled(promise); var result, handler, console; if (unhandled) { result = perform(function () { if (isNode) { process.emit('unhandledRejection', value, promise); } else if (handler = global.onunhandledrejection) { handler({ promise: promise, reason: value }); } else if ((console = global.console) && console.error) { console.error('Unhandled promise rejection', value); } }); // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should promise._h = isNode || isUnhandled(promise) ? 2 : 1; } promise._a = undefined; if (unhandled && result.e) throw result.v; }); }; var isUnhandled = function (promise) { return promise._h !== 1 && (promise._a || promise._c).length === 0; }; var onHandleUnhandled = function (promise) { task.call(global, function () { var handler; if (isNode) { process.emit('rejectionHandled', promise); } else if (handler = global.onrejectionhandled) { handler({ promise: promise, reason: promise._v }); } }); }; var $reject = function (value) { var promise = this; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap promise._v = value; promise._s = 2; if (!promise._a) promise._a = promise._c.slice(); notify(promise, true); }; var $resolve = function (value) { var promise = this; var then; if (promise._d) return; promise._d = true; promise = promise._w || promise; // unwrap try { if (promise === value) throw TypeError("Promise can't be resolved itself"); if (then = isThenable(value)) { microtask(function () { var wrapper = { _w: promise, _d: false }; // wrap try { then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); } catch (e) { $reject.call(wrapper, e); } }); } else { promise._v = value; promise._s = 1; notify(promise, false); } } catch (e) { $reject.call({ _w: promise, _d: false }, e); // wrap } }; // constructor polyfill if (!USE_NATIVE) { // 25.4.3.1 Promise(executor) $Promise = function Promise(executor) { anInstance(this, $Promise, PROMISE, '_h'); aFunction(executor); Internal.call(this); try { executor(ctx($resolve, this, 1), ctx($reject, this, 1)); } catch (err) { $reject.call(this, err); } }; // eslint-disable-next-line no-unused-vars Internal = function Promise(executor) { this._c = []; // <- awaiting reactions this._a = undefined; // <- checked in isUnhandled reactions this._s = 0; // <- state this._d = false; // <- done this._v = undefined; // <- value this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; Internal.prototype = _dereq_(93)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; reaction.fail = typeof onRejected == 'function' && onRejected; reaction.domain = isNode ? process.domain : undefined; this._c.push(reaction); if (this._a) this._a.push(reaction); if (this._s) notify(this, false); return reaction.promise; }, // 25.4.5.1 Promise.prototype.catch(onRejected) 'catch': function (onRejected) { return this.then(undefined, onRejected); } }); OwnPromiseCapability = function () { var promise = new Internal(); this.promise = promise; this.resolve = ctx($resolve, promise, 1); this.reject = ctx($reject, promise, 1); }; newPromiseCapabilityModule.f = newPromiseCapability = function (C) { return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); _dereq_(100)($Promise, PROMISE); _dereq_(99)(PROMISE); Wrapper = _dereq_(30)[PROMISE]; // statics $export($export.S + $export.F * !USE_NATIVE, PROMISE, { // 25.4.4.5 Promise.reject(r) reject: function reject(r) { var capability = newPromiseCapability(this); var $$reject = capability.reject; $$reject(r); return capability.promise; } }); $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { // 25.4.4.6 Promise.resolve(x) resolve: function resolve(x) { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); $export($export.S + $export.F * !(USE_NATIVE && _dereq_(62)(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) all: function all(iterable) { var C = this; var capability = newPromiseCapability(C); var resolve = capability.resolve; var reject = capability.reject; var result = perform(function () { var values = []; var index = 0; var remaining = 1; forOf(iterable, false, function (promise) { var $index = index++; var alreadyCalled = false; values.push(undefined); remaining++; C.resolve(promise).then(function (value) { if (alreadyCalled) return; alreadyCalled = true; values[$index] = value; --remaining || resolve(values); }, reject); }); --remaining || resolve(values); }); if (result.e) reject(result.v); return capability.promise; }, // 25.4.4.4 Promise.race(iterable) race: function race(iterable) { var C = this; var capability = newPromiseCapability(C); var reject = capability.reject; var result = perform(function () { forOf(iterable, false, function (promise) { C.resolve(promise).then(capability.resolve, reject); }); }); if (result.e) reject(result.v); return capability.promise; } }); },{"100":100,"103":103,"11":11,"112":112,"124":124,"128":128,"15":15,"25":25,"30":30,"32":32,"40":40,"45":45,"46":46,"57":57,"62":62,"65":65,"71":71,"72":72,"90":90,"91":91,"93":93,"99":99}],209:[function(_dereq_,module,exports){ // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) var $export = _dereq_(40); var aFunction = _dereq_(11); var anObject = _dereq_(16); var rApply = (_dereq_(46).Reflect || {}).apply; var fApply = Function.apply; // MS Edge argumentsList argument is optional $export($export.S + $export.F * !_dereq_(42)(function () { rApply(function () { /* empty */ }); }), 'Reflect', { apply: function apply(target, thisArgument, argumentsList) { var T = aFunction(target); var L = anObject(argumentsList); return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); } }); },{"11":11,"16":16,"40":40,"42":42,"46":46}],210:[function(_dereq_,module,exports){ // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) var $export = _dereq_(40); var create = _dereq_(74); var aFunction = _dereq_(11); var anObject = _dereq_(16); var isObject = _dereq_(57); var fails = _dereq_(42); var bind = _dereq_(24); var rConstruct = (_dereq_(46).Reflect || {}).construct; // MS Edge supports only 2 arguments and argumentsList argument is optional // FF Nightly sets third argument as `new.target`, but does not create `this` from it var NEW_TARGET_BUG = fails(function () { function F() { /* empty */ } return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); }); var ARGS_BUG = !fails(function () { rConstruct(function () { /* empty */ }); }); $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { construct: function construct(Target, args /* , newTarget */) { aFunction(Target); anObject(args); var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); if (Target == newTarget) { // w/o altered newTarget, optimization for 0-4 arguments switch (args.length) { case 0: return new Target(); case 1: return new Target(args[0]); case 2: return new Target(args[0], args[1]); case 3: return new Target(args[0], args[1], args[2]); case 4: return new Target(args[0], args[1], args[2], args[3]); } // w/o altered newTarget, lot of arguments case var $args = [null]; $args.push.apply($args, args); return new (bind.apply(Target, $args))(); } // with altered newTarget, not support built-in constructors var proto = newTarget.prototype; var instance = create(isObject(proto) ? proto : Object.prototype); var result = Function.apply.call(Target, instance, args); return isObject(result) ? result : instance; } }); },{"11":11,"16":16,"24":24,"40":40,"42":42,"46":46,"57":57,"74":74}],211:[function(_dereq_,module,exports){ // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = _dereq_(75); var $export = _dereq_(40); var anObject = _dereq_(16); var toPrimitive = _dereq_(119); // MS Edge has broken Reflect.defineProperty - throwing instead of returning false $export($export.S + $export.F * _dereq_(42)(function () { // eslint-disable-next-line no-undef Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); }), 'Reflect', { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject(target); propertyKey = toPrimitive(propertyKey, true); anObject(attributes); try { dP.f(target, propertyKey, attributes); return true; } catch (e) { return false; } } }); },{"119":119,"16":16,"40":40,"42":42,"75":75}],212:[function(_dereq_,module,exports){ // 26.1.4 Reflect.deleteProperty(target, propertyKey) var $export = _dereq_(40); var gOPD = _dereq_(77).f; var anObject = _dereq_(16); $export($export.S, 'Reflect', { deleteProperty: function deleteProperty(target, propertyKey) { var desc = gOPD(anObject(target), propertyKey); return desc && !desc.configurable ? false : delete target[propertyKey]; } }); },{"16":16,"40":40,"77":77}],213:[function(_dereq_,module,exports){ 'use strict'; // 26.1.5 Reflect.enumerate(target) var $export = _dereq_(40); var anObject = _dereq_(16); var Enumerate = function (iterated) { this._t = anObject(iterated); // target this._i = 0; // next index var keys = this._k = []; // keys var key; for (key in iterated) keys.push(key); }; _dereq_(60)(Enumerate, 'Object', function () { var that = this; var keys = that._k; var key; do { if (that._i >= keys.length) return { value: undefined, done: true }; } while (!((key = keys[that._i++]) in that._t)); return { value: key, done: false }; }); $export($export.S, 'Reflect', { enumerate: function enumerate(target) { return new Enumerate(target); } }); },{"16":16,"40":40,"60":60}],214:[function(_dereq_,module,exports){ // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) var gOPD = _dereq_(77); var $export = _dereq_(40); var anObject = _dereq_(16); $export($export.S, 'Reflect', { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { return gOPD.f(anObject(target), propertyKey); } }); },{"16":16,"40":40,"77":77}],215:[function(_dereq_,module,exports){ // 26.1.8 Reflect.getPrototypeOf(target) var $export = _dereq_(40); var getProto = _dereq_(81); var anObject = _dereq_(16); $export($export.S, 'Reflect', { getPrototypeOf: function getPrototypeOf(target) { return getProto(anObject(target)); } }); },{"16":16,"40":40,"81":81}],216:[function(_dereq_,module,exports){ // 26.1.6 Reflect.get(target, propertyKey [, receiver]) var gOPD = _dereq_(77); var getPrototypeOf = _dereq_(81); var has = _dereq_(47); var $export = _dereq_(40); var isObject = _dereq_(57); var anObject = _dereq_(16); function get(target, propertyKey /* , receiver */) { var receiver = arguments.length < 3 ? target : arguments[2]; var desc, proto; if (anObject(target) === receiver) return target[propertyKey]; if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') ? desc.value : desc.get !== undefined ? desc.get.call(receiver) : undefined; if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); } $export($export.S, 'Reflect', { get: get }); },{"16":16,"40":40,"47":47,"57":57,"77":77,"81":81}],217:[function(_dereq_,module,exports){ // 26.1.9 Reflect.has(target, propertyKey) var $export = _dereq_(40); $export($export.S, 'Reflect', { has: function has(target, propertyKey) { return propertyKey in target; } }); },{"40":40}],218:[function(_dereq_,module,exports){ // 26.1.10 Reflect.isExtensible(target) var $export = _dereq_(40); var anObject = _dereq_(16); var $isExtensible = Object.isExtensible; $export($export.S, 'Reflect', { isExtensible: function isExtensible(target) { anObject(target); return $isExtensible ? $isExtensible(target) : true; } }); },{"16":16,"40":40}],219:[function(_dereq_,module,exports){ // 26.1.11 Reflect.ownKeys(target) var $export = _dereq_(40); $export($export.S, 'Reflect', { ownKeys: _dereq_(87) }); },{"40":40,"87":87}],220:[function(_dereq_,module,exports){ // 26.1.12 Reflect.preventExtensions(target) var $export = _dereq_(40); var anObject = _dereq_(16); var $preventExtensions = Object.preventExtensions; $export($export.S, 'Reflect', { preventExtensions: function preventExtensions(target) { anObject(target); try { if ($preventExtensions) $preventExtensions(target); return true; } catch (e) { return false; } } }); },{"16":16,"40":40}],221:[function(_dereq_,module,exports){ // 26.1.14 Reflect.setPrototypeOf(target, proto) var $export = _dereq_(40); var setProto = _dereq_(98); if (setProto) $export($export.S, 'Reflect', { setPrototypeOf: function setPrototypeOf(target, proto) { setProto.check(target, proto); try { setProto.set(target, proto); return true; } catch (e) { return false; } } }); },{"40":40,"98":98}],222:[function(_dereq_,module,exports){ // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) var dP = _dereq_(75); var gOPD = _dereq_(77); var getPrototypeOf = _dereq_(81); var has = _dereq_(47); var $export = _dereq_(40); var createDesc = _dereq_(92); var anObject = _dereq_(16); var isObject = _dereq_(57); function set(target, propertyKey, V /* , receiver */) { var receiver = arguments.length < 4 ? target : arguments[3]; var ownDesc = gOPD.f(anObject(target), propertyKey); var existingDescriptor, proto; if (!ownDesc) { if (isObject(proto = getPrototypeOf(target))) { return set(proto, propertyKey, V, receiver); } ownDesc = createDesc(0); } if (has(ownDesc, 'value')) { if (ownDesc.writable === false || !isObject(receiver)) return false; if (existingDescriptor = gOPD.f(receiver, propertyKey)) { if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; existingDescriptor.value = V; dP.f(receiver, propertyKey, existingDescriptor); } else dP.f(receiver, propertyKey, createDesc(0, V)); return true; } return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); } $export($export.S, 'Reflect', { set: set }); },{"16":16,"40":40,"47":47,"57":57,"75":75,"77":77,"81":81,"92":92}],223:[function(_dereq_,module,exports){ var global = _dereq_(46); var inheritIfRequired = _dereq_(51); var dP = _dereq_(75).f; var gOPN = _dereq_(79).f; var isRegExp = _dereq_(58); var $flags = _dereq_(44); var $RegExp = global.RegExp; var Base = $RegExp; var proto = $RegExp.prototype; var re1 = /a/g; var re2 = /a/g; // "new" creates a new object, old webkit buggy here var CORRECT_NEW = new $RegExp(re1) !== re1; if (_dereq_(36) && (!CORRECT_NEW || _dereq_(42)(function () { re2[_dereq_(128)('match')] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; }))) { $RegExp = function RegExp(p, f) { var tiRE = this instanceof $RegExp; var piRE = isRegExp(p); var fiU = f === undefined; return !tiRE && piRE && p.constructor === $RegExp && fiU ? p : inheritIfRequired(CORRECT_NEW ? new Base(piRE && !fiU ? p.source : p, f) : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) , tiRE ? this : proto, $RegExp); }; var proxy = function (key) { key in $RegExp || dP($RegExp, key, { configurable: true, get: function () { return Base[key]; }, set: function (it) { Base[key] = it; } }); }; for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); proto.constructor = $RegExp; $RegExp.prototype = proto; _dereq_(94)(global, 'RegExp', $RegExp); } _dereq_(99)('RegExp'); },{"128":128,"36":36,"42":42,"44":44,"46":46,"51":51,"58":58,"75":75,"79":79,"94":94,"99":99}],224:[function(_dereq_,module,exports){ 'use strict'; var regexpExec = _dereq_(96); _dereq_(40)({ target: 'RegExp', proto: true, forced: regexpExec !== /./.exec }, { exec: regexpExec }); },{"40":40,"96":96}],225:[function(_dereq_,module,exports){ // 21.2.5.3 get RegExp.prototype.flags() if (_dereq_(36) && /./g.flags != 'g') _dereq_(75).f(RegExp.prototype, 'flags', { configurable: true, get: _dereq_(44) }); },{"36":36,"44":44,"75":75}],226:[function(_dereq_,module,exports){ 'use strict'; var anObject = _dereq_(16); var toLength = _dereq_(117); var advanceStringIndex = _dereq_(14); var regExpExec = _dereq_(95); // @@match logic _dereq_(43)('match', 1, function (defined, MATCH, $match, maybeCallNative) { return [ // `String.prototype.match` method // https://tc39.github.io/ecma262/#sec-string.prototype.match function match(regexp) { var O = defined(this); var fn = regexp == undefined ? undefined : regexp[MATCH]; return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); }, // `RegExp.prototype[@@match]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match function (regexp) { var res = maybeCallNative($match, regexp, this); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); if (!rx.global) return regExpExec(rx, S); var fullUnicode = rx.unicode; rx.lastIndex = 0; var A = []; var n = 0; var result; while ((result = regExpExec(rx, S)) !== null) { var matchStr = String(result[0]); A[n] = matchStr; if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); n++; } return n === 0 ? null : A; } ]; }); },{"117":117,"14":14,"16":16,"43":43,"95":95}],227:[function(_dereq_,module,exports){ 'use strict'; var anObject = _dereq_(16); var toObject = _dereq_(118); var toLength = _dereq_(117); var toInteger = _dereq_(115); var advanceStringIndex = _dereq_(14); var regExpExec = _dereq_(95); var max = Math.max; var min = Math.min; var floor = Math.floor; var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; var maybeToString = function (it) { return it === undefined ? it : String(it); }; // @@replace logic _dereq_(43)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { return [ // `String.prototype.replace` method // https://tc39.github.io/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = defined(this); var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; return fn !== undefined ? fn.call(searchValue, O, replaceValue) : $replace.call(String(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace function (regexp, replaceValue) { var res = maybeCallNative($replace, regexp, this, replaceValue); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var functionalReplace = typeof replaceValue === 'function'; if (!functionalReplace) replaceValue = String(replaceValue); var global = rx.global; if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; while (true) { var result = regExpExec(rx, S); if (result === null) break; results.push(result); if (!global) break; var matchStr = String(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = String(result[0]); var position = max(min(toInteger(result.index), S.length), 0); var captures = []; // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = [matched].concat(captures, position, S); if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); var replacement = String(replaceValue.apply(undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += S.slice(nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + S.slice(nextSourcePosition); } ]; // https://tc39.github.io/ecma262/#sec-getsubstitution function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return $replace.call(replacement, symbols, function (match, ch) { var capture; switch (ch.charAt(0)) { case '$': return '$'; case '&': return matched; case '`': return str.slice(0, position); case "'": return str.slice(tailPos); case '<': capture = namedCaptures[ch.slice(1, -1)]; break; default: // \d\d? var n = +ch; if (n === 0) return ch; if (n > m) { var f = floor(n / 10); if (f === 0) return ch; if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); return ch; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); } }); },{"115":115,"117":117,"118":118,"14":14,"16":16,"43":43,"95":95}],228:[function(_dereq_,module,exports){ 'use strict'; var anObject = _dereq_(16); var sameValue = _dereq_(97); var regExpExec = _dereq_(95); // @@search logic _dereq_(43)('search', 1, function (defined, SEARCH, $search, maybeCallNative) { return [ // `String.prototype.search` method // https://tc39.github.io/ecma262/#sec-string.prototype.search function search(regexp) { var O = defined(this); var fn = regexp == undefined ? undefined : regexp[SEARCH]; return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); }, // `RegExp.prototype[@@search]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search function (regexp) { var res = maybeCallNative($search, regexp, this); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var previousLastIndex = rx.lastIndex; if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; var result = regExpExec(rx, S); if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; return result === null ? -1 : result.index; } ]; }); },{"16":16,"43":43,"95":95,"97":97}],229:[function(_dereq_,module,exports){ 'use strict'; var isRegExp = _dereq_(58); var anObject = _dereq_(16); var speciesConstructor = _dereq_(103); var advanceStringIndex = _dereq_(14); var toLength = _dereq_(117); var callRegExpExec = _dereq_(95); var regexpExec = _dereq_(96); var $min = Math.min; var $push = [].push; var $SPLIT = 'split'; var LENGTH = 'length'; var LAST_INDEX = 'lastIndex'; // eslint-disable-next-line no-empty var SUPPORTS_Y = !!(function () { try { return new RegExp('x', 'y'); } catch (e) {} })(); // @@split logic _dereq_(43)('split', 2, function (defined, SPLIT, $split, maybeCallNative) { var internalSplit; if ( 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || '.'[$SPLIT](/()()/)[LENGTH] > 1 || ''[$SPLIT](/.?/)[LENGTH] ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { var string = String(this); if (separator === undefined && limit === 0) return []; // If `separator` is not a regex, use native split if (!isRegExp(separator)) return $split.call(string, separator, limit); var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); var lastLastIndex = 0; var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var match, lastIndex, lastLength; while (match = regexpExec.call(separatorCopy, string)) { lastIndex = separatorCopy[LAST_INDEX]; if (lastIndex > lastLastIndex) { output.push(string.slice(lastLastIndex, match.index)); if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); lastLength = match[0][LENGTH]; lastLastIndex = lastIndex; if (output[LENGTH] >= splitLimit) break; } if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop } if (lastLastIndex === string[LENGTH]) { if (lastLength || !separatorCopy.test('')) output.push(''); } else output.push(string.slice(lastLastIndex)); return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; }; // Chakra, V8 } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); }; } else { internalSplit = $split; } return [ // `String.prototype.split` method // https://tc39.github.io/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = defined(this); var splitter = separator == undefined ? undefined : separator[SPLIT]; return splitter !== undefined ? splitter.call(separator, O, limit) : internalSplit.call(String(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (regexp, limit) { var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var C = speciesConstructor(rx, RegExp); var unicodeMatching = rx.unicode; var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (SUPPORTS_Y ? 'y' : 'g'); // ^(? + rx + ) is needed, in combination with some S slicing, to // simulate the 'y' flag. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); var lim = limit === undefined ? 0xffffffff : limit >>> 0; if (lim === 0) return []; if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; var p = 0; var q = 0; var A = []; while (q < S.length) { splitter.lastIndex = SUPPORTS_Y ? q : 0; var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); var e; if ( z === null || (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching); } else { A.push(S.slice(p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { A.push(z[i]); if (A.length === lim) return A; } q = p = e; } } A.push(S.slice(p)); return A; } ]; }); },{"103":103,"117":117,"14":14,"16":16,"43":43,"58":58,"95":95,"96":96}],230:[function(_dereq_,module,exports){ 'use strict'; _dereq_(225); var anObject = _dereq_(16); var $flags = _dereq_(44); var DESCRIPTORS = _dereq_(36); var TO_STRING = 'toString'; var $toString = /./[TO_STRING]; var define = function (fn) { _dereq_(94)(RegExp.prototype, TO_STRING, fn, true); }; // 21.2.5.14 RegExp.prototype.toString() if (_dereq_(42)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { define(function toString() { var R = anObject(this); return '/'.concat(R.source, '/', 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); }); // FF44- RegExp#toString has a wrong name } else if ($toString.name != TO_STRING) { define(function toString() { return $toString.call(this); }); } },{"16":16,"225":225,"36":36,"42":42,"44":44,"94":94}],231:[function(_dereq_,module,exports){ 'use strict'; var strong = _dereq_(27); var validate = _dereq_(125); var SET = 'Set'; // 23.2 Set Objects module.exports = _dereq_(29)(SET, function (get) { return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.2.3.1 Set.prototype.add(value) add: function add(value) { return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); } }, strong); },{"125":125,"27":27,"29":29}],232:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.2 String.prototype.anchor(name) _dereq_(107)('anchor', function (createHTML) { return function anchor(name) { return createHTML(this, 'a', 'name', name); }; }); },{"107":107}],233:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.3 String.prototype.big() _dereq_(107)('big', function (createHTML) { return function big() { return createHTML(this, 'big', '', ''); }; }); },{"107":107}],234:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.4 String.prototype.blink() _dereq_(107)('blink', function (createHTML) { return function blink() { return createHTML(this, 'blink', '', ''); }; }); },{"107":107}],235:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.5 String.prototype.bold() _dereq_(107)('bold', function (createHTML) { return function bold() { return createHTML(this, 'b', '', ''); }; }); },{"107":107}],236:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $at = _dereq_(105)(false); $export($export.P, 'String', { // 21.1.3.3 String.prototype.codePointAt(pos) codePointAt: function codePointAt(pos) { return $at(this, pos); } }); },{"105":105,"40":40}],237:[function(_dereq_,module,exports){ // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 'use strict'; var $export = _dereq_(40); var toLength = _dereq_(117); var context = _dereq_(106); var ENDS_WITH = 'endsWith'; var $endsWith = ''[ENDS_WITH]; $export($export.P + $export.F * _dereq_(41)(ENDS_WITH), 'String', { endsWith: function endsWith(searchString /* , endPosition = @length */) { var that = context(this, searchString, ENDS_WITH); var endPosition = arguments.length > 1 ? arguments[1] : undefined; var len = toLength(that.length); var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); var search = String(searchString); return $endsWith ? $endsWith.call(that, search, end) : that.slice(end - search.length, end) === search; } }); },{"106":106,"117":117,"40":40,"41":41}],238:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.6 String.prototype.fixed() _dereq_(107)('fixed', function (createHTML) { return function fixed() { return createHTML(this, 'tt', '', ''); }; }); },{"107":107}],239:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.7 String.prototype.fontcolor(color) _dereq_(107)('fontcolor', function (createHTML) { return function fontcolor(color) { return createHTML(this, 'font', 'color', color); }; }); },{"107":107}],240:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.8 String.prototype.fontsize(size) _dereq_(107)('fontsize', function (createHTML) { return function fontsize(size) { return createHTML(this, 'font', 'size', size); }; }); },{"107":107}],241:[function(_dereq_,module,exports){ var $export = _dereq_(40); var toAbsoluteIndex = _dereq_(113); var fromCharCode = String.fromCharCode; var $fromCodePoint = String.fromCodePoint; // length should be 1, old FF problem $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { // 21.1.2.2 String.fromCodePoint(...codePoints) fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars var res = []; var aLen = arguments.length; var i = 0; var code; while (aLen > i) { code = +arguments[i++]; if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) ); } return res.join(''); } }); },{"113":113,"40":40}],242:[function(_dereq_,module,exports){ // 21.1.3.7 String.prototype.includes(searchString, position = 0) 'use strict'; var $export = _dereq_(40); var context = _dereq_(106); var INCLUDES = 'includes'; $export($export.P + $export.F * _dereq_(41)(INCLUDES), 'String', { includes: function includes(searchString /* , position = 0 */) { return !!~context(this, searchString, INCLUDES) .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); } }); },{"106":106,"40":40,"41":41}],243:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.9 String.prototype.italics() _dereq_(107)('italics', function (createHTML) { return function italics() { return createHTML(this, 'i', '', ''); }; }); },{"107":107}],244:[function(_dereq_,module,exports){ 'use strict'; var $at = _dereq_(105)(true); // 21.1.3.27 String.prototype[@@iterator]() _dereq_(61)(String, 'String', function (iterated) { this._t = String(iterated); // target this._i = 0; // next index // 21.1.5.2.1 %StringIteratorPrototype%.next() }, function () { var O = this._t; var index = this._i; var point; if (index >= O.length) return { value: undefined, done: true }; point = $at(O, index); this._i += point.length; return { value: point, done: false }; }); },{"105":105,"61":61}],245:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.10 String.prototype.link(url) _dereq_(107)('link', function (createHTML) { return function link(url) { return createHTML(this, 'a', 'href', url); }; }); },{"107":107}],246:[function(_dereq_,module,exports){ var $export = _dereq_(40); var toIObject = _dereq_(116); var toLength = _dereq_(117); $export($export.S, 'String', { // 21.1.2.4 String.raw(callSite, ...substitutions) raw: function raw(callSite) { var tpl = toIObject(callSite.raw); var len = toLength(tpl.length); var aLen = arguments.length; var res = []; var i = 0; while (len > i) { res.push(String(tpl[i++])); if (i < aLen) res.push(String(arguments[i])); } return res.join(''); } }); },{"116":116,"117":117,"40":40}],247:[function(_dereq_,module,exports){ var $export = _dereq_(40); $export($export.P, 'String', { // 21.1.3.13 String.prototype.repeat(count) repeat: _dereq_(109) }); },{"109":109,"40":40}],248:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.11 String.prototype.small() _dereq_(107)('small', function (createHTML) { return function small() { return createHTML(this, 'small', '', ''); }; }); },{"107":107}],249:[function(_dereq_,module,exports){ // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 'use strict'; var $export = _dereq_(40); var toLength = _dereq_(117); var context = _dereq_(106); var STARTS_WITH = 'startsWith'; var $startsWith = ''[STARTS_WITH]; $export($export.P + $export.F * _dereq_(41)(STARTS_WITH), 'String', { startsWith: function startsWith(searchString /* , position = 0 */) { var that = context(this, searchString, STARTS_WITH); var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); var search = String(searchString); return $startsWith ? $startsWith.call(that, search, index) : that.slice(index, index + search.length) === search; } }); },{"106":106,"117":117,"40":40,"41":41}],250:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.12 String.prototype.strike() _dereq_(107)('strike', function (createHTML) { return function strike() { return createHTML(this, 'strike', '', ''); }; }); },{"107":107}],251:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.13 String.prototype.sub() _dereq_(107)('sub', function (createHTML) { return function sub() { return createHTML(this, 'sub', '', ''); }; }); },{"107":107}],252:[function(_dereq_,module,exports){ 'use strict'; // B.2.3.14 String.prototype.sup() _dereq_(107)('sup', function (createHTML) { return function sup() { return createHTML(this, 'sup', '', ''); }; }); },{"107":107}],253:[function(_dereq_,module,exports){ 'use strict'; // 21.1.3.25 String.prototype.trim() _dereq_(110)('trim', function ($trim) { return function trim() { return $trim(this, 3); }; }); },{"110":110}],254:[function(_dereq_,module,exports){ 'use strict'; // ECMAScript 6 symbols shim var global = _dereq_(46); var has = _dereq_(47); var DESCRIPTORS = _dereq_(36); var $export = _dereq_(40); var redefine = _dereq_(94); var META = _dereq_(70).KEY; var $fails = _dereq_(42); var shared = _dereq_(102); var setToStringTag = _dereq_(100); var uid = _dereq_(123); var wks = _dereq_(128); var wksExt = _dereq_(127); var wksDefine = _dereq_(126); var enumKeys = _dereq_(39); var isArray = _dereq_(55); var anObject = _dereq_(16); var isObject = _dereq_(57); var toIObject = _dereq_(116); var toPrimitive = _dereq_(119); var createDesc = _dereq_(92); var _create = _dereq_(74); var gOPNExt = _dereq_(78); var $GOPD = _dereq_(77); var $DP = _dereq_(75); var $keys = _dereq_(83); var gOPD = $GOPD.f; var dP = $DP.f; var gOPN = gOPNExt.f; var $Symbol = global.Symbol; var $JSON = global.JSON; var _stringify = $JSON && $JSON.stringify; var PROTOTYPE = 'prototype'; var HIDDEN = wks('_hidden'); var TO_PRIMITIVE = wks('toPrimitive'); var isEnum = {}.propertyIsEnumerable; var SymbolRegistry = shared('symbol-registry'); var AllSymbols = shared('symbols'); var OPSymbols = shared('op-symbols'); var ObjectProto = Object[PROTOTYPE]; var USE_NATIVE = typeof $Symbol == 'function'; var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDesc = DESCRIPTORS && $fails(function () { return _create(dP({}, 'a', { get: function () { return dP(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (it, key, D) { var protoDesc = gOPD(ObjectProto, key); if (protoDesc) delete ObjectProto[key]; dP(it, key, D); if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); } : dP; var wrap = function (tag) { var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); sym._k = tag; return sym; }; var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return it instanceof $Symbol; }; var $defineProperty = function defineProperty(it, key, D) { if (it === ObjectProto) $defineProperty(OPSymbols, key, D); anObject(it); key = toPrimitive(key, true); anObject(D); if (has(AllSymbols, key)) { if (!D.enumerable) { if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); it[HIDDEN][key] = true; } else { if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; D = _create(D, { enumerable: createDesc(0, false) }); } return setSymbolDesc(it, key, D); } return dP(it, key, D); }; var $defineProperties = function defineProperties(it, P) { anObject(it); var keys = enumKeys(P = toIObject(P)); var i = 0; var l = keys.length; var key; while (l > i) $defineProperty(it, key = keys[i++], P[key]); return it; }; var $create = function create(it, P) { return P === undefined ? _create(it) : $defineProperties(_create(it), P); }; var $propertyIsEnumerable = function propertyIsEnumerable(key) { var E = isEnum.call(this, key = toPrimitive(key, true)); if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { it = toIObject(it); key = toPrimitive(key, true); if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; var D = gOPD(it, key); if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; return D; }; var $getOwnPropertyNames = function getOwnPropertyNames(it) { var names = gOPN(toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); } return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { var IS_OP = it === ObjectProto; var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); var result = []; var i = 0; var key; while (names.length > i) { if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); } return result; }; // 19.4.1.1 Symbol([description]) if (!USE_NATIVE) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); var tag = uid(arguments.length > 0 ? arguments[0] : undefined); var $set = function (value) { if (this === ObjectProto) $set.call(OPSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDesc(this, tag, createDesc(1, value)); }; if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); return wrap(tag); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return this._k; }); $GOPD.f = $getOwnPropertyDescriptor; $DP.f = $defineProperty; _dereq_(79).f = gOPNExt.f = $getOwnPropertyNames; _dereq_(84).f = $propertyIsEnumerable; _dereq_(80).f = $getOwnPropertySymbols; if (DESCRIPTORS && !_dereq_(65)) { redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); } wksExt.f = function (name) { return wrap(wks(name)); }; } $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); for (var es6Symbols = ( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { // 19.4.2.1 Symbol.for(key) 'for': function (key) { return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); }, // 19.4.2.5 Symbol.keyFor(sym) keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; }, useSetter: function () { setter = true; }, useSimple: function () { setter = false; } }); $export($export.S + $export.F * !USE_NATIVE, 'Object', { // 19.1.2.2 Object.create(O [, Properties]) create: $create, // 19.1.2.4 Object.defineProperty(O, P, Attributes) defineProperty: $defineProperty, // 19.1.2.3 Object.defineProperties(O, Properties) defineProperties: $defineProperties, // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) getOwnPropertyDescriptor: $getOwnPropertyDescriptor, // 19.1.2.7 Object.getOwnPropertyNames(O) getOwnPropertyNames: $getOwnPropertyNames, // 19.1.2.8 Object.getOwnPropertySymbols(O) getOwnPropertySymbols: $getOwnPropertySymbols }); // 24.3.2 JSON.stringify(value [, replacer [, space]]) $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { var S = $Symbol(); // MS Edge converts symbol values to JSON as {} // WebKit converts symbol values to JSON as null // V8 throws on boxed symbols return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; })), 'JSON', { stringify: function stringify(it) { var args = [it]; var i = 1; var replacer, $replacer; while (arguments.length > i) args.push(arguments[i++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return _stringify.apply($JSON, args); } }); // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) $Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(48)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // 19.4.3.5 Symbol.prototype[@@toStringTag] setToStringTag($Symbol, 'Symbol'); // 20.2.1.9 Math[@@toStringTag] setToStringTag(Math, 'Math', true); // 24.3.3 JSON[@@toStringTag] setToStringTag(global.JSON, 'JSON', true); },{"100":100,"102":102,"116":116,"119":119,"123":123,"126":126,"127":127,"128":128,"16":16,"36":36,"39":39,"40":40,"42":42,"46":46,"47":47,"48":48,"55":55,"57":57,"65":65,"70":70,"74":74,"75":75,"77":77,"78":78,"79":79,"80":80,"83":83,"84":84,"92":92,"94":94}],255:[function(_dereq_,module,exports){ 'use strict'; var $export = _dereq_(40); var $typed = _dereq_(122); var buffer = _dereq_(121); var anObject = _dereq_(16); var toAbsoluteIndex = _dereq_(113); var toLength = _dereq_(117); var isObject = _dereq_(57); var ArrayBuffer = _dereq_(46).ArrayBuffer; var speciesConstructor = _dereq_(103); var $ArrayBuffer = buffer.ArrayBuffer; var $DataView = buffer.DataView; var $isView = $typed.ABV && ArrayBuffer.isView; var $slice = $ArrayBuffer.prototype.slice; var VIEW = $typed.VIEW; var ARRAY_BUFFER = 'ArrayBuffer'; $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { // 24.1.3.1 ArrayBuffer.isView(arg) isView: function isView(it) { return $isView && $isView(it) || isObject(it) && VIEW in it; } }); $export($export.P + $export.U + $export.F * _dereq_(42)(function () { return !new $ArrayBuffer(2).slice(1, undefined).byteLength; }), ARRAY_BUFFER, { // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) slice: function slice(start, end) { if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix var len = anObject(this).byteLength; var first = toAbsoluteIndex(start, len); var fin = toAbsoluteIndex(end === undefined ? len : end, len); var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); var viewS = new $DataView(this); var viewT = new $DataView(result); var index = 0; while (first < fin) { viewT.setUint8(index++, viewS.getUint8(first++)); } return result; } }); _dereq_(99)(ARRAY_BUFFER); },{"103":103,"113":113,"117":117,"121":121,"122":122,"16":16,"40":40,"42":42,"46":46,"57":57,"99":99}],256:[function(_dereq_,module,exports){ var $export = _dereq_(40); $export($export.G + $export.W + $export.F * !_dereq_(122).ABV, { DataView: _dereq_(121).DataView }); },{"121":121,"122":122,"40":40}],257:[function(_dereq_,module,exports){ _dereq_(120)('Float32', 4, function (init) { return function Float32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],258:[function(_dereq_,module,exports){ _dereq_(120)('Float64', 8, function (init) { return function Float64Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],259:[function(_dereq_,module,exports){ _dereq_(120)('Int16', 2, function (init) { return function Int16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],260:[function(_dereq_,module,exports){ _dereq_(120)('Int32', 4, function (init) { return function Int32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],261:[function(_dereq_,module,exports){ _dereq_(120)('Int8', 1, function (init) { return function Int8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],262:[function(_dereq_,module,exports){ _dereq_(120)('Uint16', 2, function (init) { return function Uint16Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],263:[function(_dereq_,module,exports){ _dereq_(120)('Uint32', 4, function (init) { return function Uint32Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],264:[function(_dereq_,module,exports){ _dereq_(120)('Uint8', 1, function (init) { return function Uint8Array(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }); },{"120":120}],265:[function(_dereq_,module,exports){ _dereq_(120)('Uint8', 1, function (init) { return function Uint8ClampedArray(data, byteOffset, length) { return init(this, data, byteOffset, length); }; }, true); },{"120":120}],266:[function(_dereq_,module,exports){ 'use strict'; var each = _dereq_(20)(0); var redefine = _dereq_(94); var meta = _dereq_(70); var assign = _dereq_(73); var weak = _dereq_(28); var isObject = _dereq_(57); var fails = _dereq_(42); var validate = _dereq_(125); var WEAK_MAP = 'WeakMap'; var getWeak = meta.getWeak; var isExtensible = Object.isExtensible; var uncaughtFrozenStore = weak.ufstore; var tmp = {}; var InternalMap; var wrapper = function (get) { return function WeakMap() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }; var methods = { // 23.3.3.3 WeakMap.prototype.get(key) get: function get(key) { if (isObject(key)) { var data = getWeak(key); if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); return data ? data[this._i] : undefined; } }, // 23.3.3.5 WeakMap.prototype.set(key, value) set: function set(key, value) { return weak.def(validate(this, WEAK_MAP), key, value); } }; // 23.3 WeakMap Objects var $WeakMap = module.exports = _dereq_(29)(WEAK_MAP, wrapper, methods, weak, true, true); // IE11 WeakMap frozen keys fix if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { InternalMap = weak.getConstructor(wrapper, WEAK_MAP); assign(InternalMap.prototype, methods); meta.NEED = true; each(['delete', 'has', 'get', 'set'], function (key) { var proto = $WeakMap.prototype; var method = proto[key]; redefine(proto, key, function (a, b) { // store frozen objects on internal weakmap shim if (isObject(a) && !isExtensible(a)) { if (!this._f) this._f = new InternalMap(); var result = this._f[key](a, b); return key == 'set' ? this : result; // store all the rest on native weakmap } return method.call(this, a, b); }); }); } },{"125":125,"20":20,"28":28,"29":29,"42":42,"57":57,"70":70,"73":73,"94":94}],267:[function(_dereq_,module,exports){ 'use strict'; var weak = _dereq_(28); var validate = _dereq_(125); var WEAK_SET = 'WeakSet'; // 23.4 WeakSet Objects _dereq_(29)(WEAK_SET, function (get) { return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; }, { // 23.4.3.1 WeakSet.prototype.add(value) add: function add(value) { return weak.def(validate(this, WEAK_SET), value, true); } }, weak, false, true); },{"125":125,"28":28,"29":29}],268:[function(_dereq_,module,exports){ 'use strict'; // https://github.com/tc39/Array.prototype.includes var $export = _dereq_(40); var $includes = _dereq_(19)(true); $export($export.P, 'Array', { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } }); _dereq_(13)('includes'); },{"13":13,"19":19,"40":40}],269:[function(_dereq_,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = _dereq_(40); var $entries = _dereq_(86)(true); $export($export.S, 'Object', { entries: function entries(it) { return $entries(it); } }); },{"40":40,"86":86}],270:[function(_dereq_,module,exports){ // https://github.com/tc39/proposal-object-getownpropertydescriptors var $export = _dereq_(40); var ownKeys = _dereq_(87); var toIObject = _dereq_(116); var gOPD = _dereq_(77); var createProperty = _dereq_(31); $export($export.S, 'Object', { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIObject(object); var getDesc = gOPD.f; var keys = ownKeys(O); var result = {}; var i = 0; var key, desc; while (keys.length > i) { desc = getDesc(O, key = keys[i++]); if (desc !== undefined) createProperty(result, key, desc); } return result; } }); },{"116":116,"31":31,"40":40,"77":77,"87":87}],271:[function(_dereq_,module,exports){ // https://github.com/tc39/proposal-object-values-entries var $export = _dereq_(40); var $values = _dereq_(86)(false); $export($export.S, 'Object', { values: function values(it) { return $values(it); } }); },{"40":40,"86":86}],272:[function(_dereq_,module,exports){ // https://github.com/tc39/proposal-promise-finally 'use strict'; var $export = _dereq_(40); var core = _dereq_(30); var global = _dereq_(46); var speciesConstructor = _dereq_(103); var promiseResolve = _dereq_(91); $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { var C = speciesConstructor(this, core.Promise || global.Promise); var isFunction = typeof onFinally == 'function'; return this.then( isFunction ? function (x) { return promiseResolve(C, onFinally()).then(function () { return x; }); } : onFinally, isFunction ? function (e) { return promiseResolve(C, onFinally()).then(function () { throw e; }); } : onFinally ); } }); },{"103":103,"30":30,"40":40,"46":46,"91":91}],273:[function(_dereq_,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = _dereq_(40); var $pad = _dereq_(108); var userAgent = _dereq_(124); // https://github.com/zloirock/core-js/issues/280 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { padEnd: function padEnd(maxLength /* , fillString = ' ' */) { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); } }); },{"108":108,"124":124,"40":40}],274:[function(_dereq_,module,exports){ 'use strict'; // https://github.com/tc39/proposal-string-pad-start-end var $export = _dereq_(40); var $pad = _dereq_(108); var userAgent = _dereq_(124); // https://github.com/zloirock/core-js/issues/280 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { padStart: function padStart(maxLength /* , fillString = ' ' */) { return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); } }); },{"108":108,"124":124,"40":40}],275:[function(_dereq_,module,exports){ _dereq_(126)('asyncIterator'); },{"126":126}],276:[function(_dereq_,module,exports){ var $iterators = _dereq_(140); var getKeys = _dereq_(83); var redefine = _dereq_(94); var global = _dereq_(46); var hide = _dereq_(48); var Iterators = _dereq_(64); var wks = _dereq_(128); var ITERATOR = wks('iterator'); var TO_STRING_TAG = wks('toStringTag'); var ArrayValues = Iterators.Array; var DOMIterables = { CSSRuleList: true, // TODO: Not spec compliant, should be false. CSSStyleDeclaration: false, CSSValueList: false, ClientRectList: false, DOMRectList: false, DOMStringList: false, DOMTokenList: true, DataTransferItemList: false, FileList: false, HTMLAllCollection: false, HTMLCollection: false, HTMLFormElement: false, HTMLSelectElement: false, MediaList: true, // TODO: Not spec compliant, should be false. MimeTypeArray: false, NamedNodeMap: false, NodeList: true, PaintRequestList: false, Plugin: false, PluginArray: false, SVGLengthList: false, SVGNumberList: false, SVGPathSegList: false, SVGPointList: false, SVGStringList: false, SVGTransformList: false, SourceBufferList: false, StyleSheetList: true, // TODO: Not spec compliant, should be false. TextTrackCueList: false, TextTrackList: false, TouchList: false }; for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { var NAME = collections[i]; var explicit = DOMIterables[NAME]; var Collection = global[NAME]; var proto = Collection && Collection.prototype; var key; if (proto) { if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); Iterators[NAME] = ArrayValues; if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); } } },{"128":128,"140":140,"46":46,"48":48,"64":64,"83":83,"94":94}],277:[function(_dereq_,module,exports){ var $export = _dereq_(40); var $task = _dereq_(112); $export($export.G + $export.B, { setImmediate: $task.set, clearImmediate: $task.clear }); },{"112":112,"40":40}],278:[function(_dereq_,module,exports){ // ie9- setTimeout & setInterval additional parameters fix var global = _dereq_(46); var $export = _dereq_(40); var userAgent = _dereq_(124); var slice = [].slice; var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check var wrap = function (set) { return function (fn, time /* , ...args */) { var boundArgs = arguments.length > 2; var args = boundArgs ? slice.call(arguments, 2) : false; return set(boundArgs ? function () { // eslint-disable-next-line no-new-func (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); } : fn, time); }; }; $export($export.G + $export.B + $export.F * MSIE, { setTimeout: wrap(global.setTimeout), setInterval: wrap(global.setInterval) }); },{"124":124,"40":40,"46":46}],279:[function(_dereq_,module,exports){ _dereq_(278); _dereq_(277); _dereq_(276); module.exports = _dereq_(30); },{"276":276,"277":277,"278":278,"30":30}],280:[function(_dereq_,module,exports){ /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !(function(global) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; var inModule = typeof module === "object"; var runtime = global.regeneratorRuntime; if (runtime) { if (inModule) { // If regeneratorRuntime is defined globally and we're in a module, // make the exports object identical to regeneratorRuntime. module.exports = runtime; } // Don't bother evaluating the rest of this file if the runtime was // already defined globally. return; } // Define the runtime globally (as expected by generated code) as either // module.exports (if we're in a module) or a new, empty object. runtime = global.regeneratorRuntime = inModule ? module.exports : {}; function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } runtime.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { prototype[method] = function(arg) { return this._invoke(method, arg); }; }); } runtime.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; runtime.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; if (!(toStringTagSymbol in genFun)) { genFun[toStringTagSymbol] = "GeneratorFunction"; } } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. runtime.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return Promise.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return Promise.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new Promise(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; runtime.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. runtime.async = function(innerFn, outerFn, self, tryLocsList) { var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList) ); return runtime.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { if (delegate.iterator.return) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } runtime.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } runtime.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; })( // In sloppy mode, unbound `this` refers to the global object, fallback to // Function constructor if we're in global strict mode. That is sadly a form // of indirect eval which violates Content Security Policy. (function() { return this || (typeof self === "object" && self); })() || Function("return this")() ); },{}]},{},[1]); kirki-packages/compatibility/src/scripts/hooks.js000064400000052631147177211530016260 0ustar00this["wp"] = this["wp"] || {}; this["wp"]["hooks"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 366); /******/ }) /************************************************************************/ /******/ ({ /***/ 366: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateNamespace.js /** * Validate a namespace string. * * @param {string} namespace The namespace to validate - should take the form * `vendor/plugin/function`. * * @return {boolean} Whether the namespace is valid. */ function validateNamespace(namespace) { if ('string' !== typeof namespace || '' === namespace) { // eslint-disable-next-line no-console console.error('The namespace must be a non-empty string.'); return false; } if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) { // eslint-disable-next-line no-console console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.'); return false; } return true; } /* harmony default export */ var build_module_validateNamespace = (validateNamespace); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/validateHookName.js /** * Validate a hookName string. * * @param {string} hookName The hook name to validate. Should be a non empty string containing * only numbers, letters, dashes, periods and underscores. Also, * the hook name cannot begin with `__`. * * @return {boolean} Whether the hook name is valid. */ function validateHookName(hookName) { if ('string' !== typeof hookName || '' === hookName) { // eslint-disable-next-line no-console console.error('The hook name must be a non-empty string.'); return false; } if (/^__/.test(hookName)) { // eslint-disable-next-line no-console console.error('The hook name cannot begin with `__`.'); return false; } if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) { // eslint-disable-next-line no-console console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.'); return false; } return true; } /* harmony default export */ var build_module_validateHookName = (validateHookName); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createAddHook.js /** * Internal dependencies */ /** * Returns a function which, when invoked, will add a hook. * * @param {Object} hooks Stored hooks, keyed by hook name. * * @return {Function} Function that adds a new hook. */ function createAddHook(hooks) { /** * Adds the hook to the appropriate hooks container. * * @param {string} hookName Name of hook to add * @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`. * @param {Function} callback Function to call when the hook is run * @param {?number} priority Priority of this hook (default=10) */ return function addHook(hookName, namespace, callback) { var priority = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10; if (!build_module_validateHookName(hookName)) { return; } if (!build_module_validateNamespace(namespace)) { return; } if ('function' !== typeof callback) { // eslint-disable-next-line no-console console.error('The hook callback must be a function.'); return; } // Validate numeric priority if ('number' !== typeof priority) { // eslint-disable-next-line no-console console.error('If specified, the hook priority must be a number.'); return; } var handler = { callback: callback, priority: priority, namespace: namespace }; if (hooks[hookName]) { // Find the correct insert index of the new hook. var handlers = hooks[hookName].handlers; var i; for (i = handlers.length; i > 0; i--) { if (priority >= handlers[i - 1].priority) { break; } } if (i === handlers.length) { // If append, operate via direct assignment. handlers[i] = handler; } else { // Otherwise, insert before index via splice. handlers.splice(i, 0, handler); } // We may also be currently executing this hook. If the callback // we're adding would come after the current callback, there's no // problem; otherwise we need to increase the execution index of // any other runs by 1 to account for the added element. (hooks.__current || []).forEach(function (hookInfo) { if (hookInfo.name === hookName && hookInfo.currentIndex >= i) { hookInfo.currentIndex++; } }); } else { // This is the first hook of its type. hooks[hookName] = { handlers: [handler], runs: 0 }; } if (hookName !== 'hookAdded') { doAction('hookAdded', hookName, namespace, callback, priority); } }; } /* harmony default export */ var build_module_createAddHook = (createAddHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRemoveHook.js /** * Internal dependencies */ /** * Returns a function which, when invoked, will remove a specified hook or all * hooks by the given name. * * @param {Object} hooks Stored hooks, keyed by hook name. * @param {boolean} removeAll Whether to remove all callbacks for a hookName, without regard to namespace. Used to create `removeAll*` functions. * * @return {Function} Function that removes hooks. */ function createRemoveHook(hooks, removeAll) { /** * Removes the specified callback (or all callbacks) from the hook with a * given hookName and namespace. * * @param {string} hookName The name of the hook to modify. * @param {string} namespace The unique namespace identifying the callback in the form `vendor/plugin/function`. * * @return {number} The number of callbacks removed. */ return function removeHook(hookName, namespace) { if (!build_module_validateHookName(hookName)) { return; } if (!removeAll && !build_module_validateNamespace(namespace)) { return; } // Bail if no hooks exist by this name if (!hooks[hookName]) { return 0; } var handlersRemoved = 0; if (removeAll) { handlersRemoved = hooks[hookName].handlers.length; hooks[hookName] = { runs: hooks[hookName].runs, handlers: [] }; } else { // Try to find the specified callback to remove. var handlers = hooks[hookName].handlers; var _loop = function _loop(i) { if (handlers[i].namespace === namespace) { handlers.splice(i, 1); handlersRemoved++; // This callback may also be part of a hook that is // currently executing. If the callback we're removing // comes after the current callback, there's no problem; // otherwise we need to decrease the execution index of any // other runs by 1 to account for the removed element. (hooks.__current || []).forEach(function (hookInfo) { if (hookInfo.name === hookName && hookInfo.currentIndex >= i) { hookInfo.currentIndex--; } }); } }; for (var i = handlers.length - 1; i >= 0; i--) { _loop(i); } } if (hookName !== 'hookRemoved') { doAction('hookRemoved', hookName, namespace); } return handlersRemoved; }; } /* harmony default export */ var build_module_createRemoveHook = (createRemoveHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHasHook.js /** * Returns a function which, when invoked, will return whether any handlers are * attached to a particular hook. * * @param {Object} hooks Stored hooks, keyed by hook name. * * @return {Function} Function that returns whether any handlers are * attached to a particular hook. */ function createHasHook(hooks) { /** * Returns how many handlers are attached for the given hook. * * @param {string} hookName The name of the hook to check for. * * @return {boolean} Whether there are handlers that are attached to the given hook. */ return function hasHook(hookName) { return hookName in hooks; }; } /* harmony default export */ var build_module_createHasHook = (createHasHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createRunHook.js /** * Returns a function which, when invoked, will execute all callbacks * registered to a hook of the specified type, optionally returning the final * value of the call chain. * * @param {Object} hooks Stored hooks, keyed by hook name. * @param {?boolean} returnFirstArg Whether each hook callback is expected to * return its first argument. * * @return {Function} Function that runs hook callbacks. */ function createRunHook(hooks, returnFirstArg) { /** * Runs all callbacks for the specified hook. * * @param {string} hookName The name of the hook to run. * @param {...*} args Arguments to pass to the hook callbacks. * * @return {*} Return value of runner, if applicable. */ return function runHooks(hookName) { if (!hooks[hookName]) { hooks[hookName] = { handlers: [], runs: 0 }; } hooks[hookName].runs++; var handlers = hooks[hookName].handlers; for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } if (!handlers || !handlers.length) { return returnFirstArg ? args[0] : undefined; } var hookInfo = { name: hookName, currentIndex: 0 }; hooks.__current.push(hookInfo); while (hookInfo.currentIndex < handlers.length) { var handler = handlers[hookInfo.currentIndex]; var result = handler.callback.apply(null, args); if (returnFirstArg) { args[0] = result; } hookInfo.currentIndex++; } hooks.__current.pop(); if (returnFirstArg) { return args[0]; } }; } /* harmony default export */ var build_module_createRunHook = (createRunHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createCurrentHook.js /** * Returns a function which, when invoked, will return the name of the * currently running hook, or `null` if no hook of the given type is currently * running. * * @param {Object} hooks Stored hooks, keyed by hook name. * * @return {Function} Function that returns the current hook. */ function createCurrentHook(hooks) { /** * Returns the name of the currently running hook, or `null` if no hook of * the given type is currently running. * * @return {?string} The name of the currently running hook, or * `null` if no hook is currently running. */ return function currentHook() { if (!hooks.__current || !hooks.__current.length) { return null; } return hooks.__current[hooks.__current.length - 1].name; }; } /* harmony default export */ var build_module_createCurrentHook = (createCurrentHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDoingHook.js /** * Returns a function which, when invoked, will return whether a hook is * currently being executed. * * @param {Object} hooks Stored hooks, keyed by hook name. * * @return {Function} Function that returns whether a hook is currently * being executed. */ function createDoingHook(hooks) { /** * Returns whether a hook is currently being executed. * * @param {?string} hookName The name of the hook to check for. If * omitted, will check for any hook being executed. * * @return {boolean} Whether the hook is being executed. */ return function doingHook(hookName) { // If the hookName was not passed, check for any current hook. if ('undefined' === typeof hookName) { return 'undefined' !== typeof hooks.__current[0]; } // Return the __current hook. return hooks.__current[0] ? hookName === hooks.__current[0].name : false; }; } /* harmony default export */ var build_module_createDoingHook = (createDoingHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createDidHook.js /** * Internal dependencies */ /** * Returns a function which, when invoked, will return the number of times a * hook has been called. * * @param {Object} hooks Stored hooks, keyed by hook name. * * @return {Function} Function that returns a hook's call count. */ function createDidHook(hooks) { /** * Returns the number of times an action has been fired. * * @param {string} hookName The hook name to check. * * @return {number} The number of times the hook has run. */ return function didHook(hookName) { if (!build_module_validateHookName(hookName)) { return; } return hooks[hookName] && hooks[hookName].runs ? hooks[hookName].runs : 0; }; } /* harmony default export */ var build_module_createDidHook = (createDidHook); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/createHooks.js /** * Internal dependencies */ /** * Returns an instance of the hooks object. * * @return {Object} Object that contains all hooks. */ function createHooks() { var actions = Object.create(null); var filters = Object.create(null); actions.__current = []; filters.__current = []; return { addAction: build_module_createAddHook(actions), addFilter: build_module_createAddHook(filters), removeAction: build_module_createRemoveHook(actions), removeFilter: build_module_createRemoveHook(filters), hasAction: build_module_createHasHook(actions), hasFilter: build_module_createHasHook(filters), removeAllActions: build_module_createRemoveHook(actions, true), removeAllFilters: build_module_createRemoveHook(filters, true), doAction: build_module_createRunHook(actions), applyFilters: build_module_createRunHook(filters, true), currentAction: build_module_createCurrentHook(actions), currentFilter: build_module_createCurrentHook(filters), doingAction: build_module_createDoingHook(actions), doingFilter: build_module_createDoingHook(filters), didAction: build_module_createDidHook(actions), didFilter: build_module_createDidHook(filters), actions: actions, filters: filters }; } /* harmony default export */ var build_module_createHooks = (createHooks); // CONCATENATED MODULE: ./node_modules/@wordpress/hooks/build-module/index.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addAction", function() { return addAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addFilter", function() { return addFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAction", function() { return removeAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeFilter", function() { return removeFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasAction", function() { return hasAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasFilter", function() { return hasFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllActions", function() { return removeAllActions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeAllFilters", function() { return removeAllFilters; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doAction", function() { return doAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyFilters", function() { return applyFilters; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentAction", function() { return currentAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "currentFilter", function() { return currentFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doingAction", function() { return doingAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doingFilter", function() { return doingFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didAction", function() { return didAction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "didFilter", function() { return didFilter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "actions", function() { return build_module_actions; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "filters", function() { return build_module_filters; }); /* concated harmony reexport createHooks */__webpack_require__.d(__webpack_exports__, "createHooks", function() { return build_module_createHooks; }); /** * Internal dependencies */ var _createHooks = build_module_createHooks(), addAction = _createHooks.addAction, addFilter = _createHooks.addFilter, removeAction = _createHooks.removeAction, removeFilter = _createHooks.removeFilter, hasAction = _createHooks.hasAction, hasFilter = _createHooks.hasFilter, removeAllActions = _createHooks.removeAllActions, removeAllFilters = _createHooks.removeAllFilters, doAction = _createHooks.doAction, applyFilters = _createHooks.applyFilters, currentAction = _createHooks.currentAction, currentFilter = _createHooks.currentFilter, doingAction = _createHooks.doingAction, doingFilter = _createHooks.doingFilter, didAction = _createHooks.didAction, didFilter = _createHooks.didFilter, build_module_actions = _createHooks.actions, build_module_filters = _createHooks.filters; /***/ }) /******/ });kirki-packages/compatibility/src/scripts/i18n.js000064400000102205147177211530015705 0ustar00this["wp"] = this["wp"] || {}; this["wp"]["i18n"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 376); /******/ }) /************************************************************************/ /******/ ({ /***/ 137: /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */ !function() { 'use strict' var re = { not_string: /[^s]/, not_bool: /[^t]/, not_type: /[^T]/, not_primitive: /[^v]/, number: /[diefg]/, numeric_arg: /[bcdiefguxX]/, json: /[j]/, not_json: /[^j]/, text: /^[^\x25]+/, modulo: /^\x25{2}/, placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, key: /^([a-z_][a-z_\d]*)/i, key_access: /^\.([a-z_][a-z_\d]*)/i, index_access: /^\[(\d+)\]/, sign: /^[+-]/ } function sprintf(key) { // `arguments` is not an array, but should be fine for this call return sprintf_format(sprintf_parse(key), arguments) } function vsprintf(fmt, argv) { return sprintf.apply(null, [fmt].concat(argv || [])) } function sprintf_format(parse_tree, argv) { var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign for (i = 0; i < tree_length; i++) { if (typeof parse_tree[i] === 'string') { output += parse_tree[i] } else if (typeof parse_tree[i] === 'object') { ph = parse_tree[i] // convenience purposes only if (ph.keys) { // keyword argument arg = argv[cursor] for (k = 0; k < ph.keys.length; k++) { if (arg == undefined) { throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1])) } arg = arg[ph.keys[k]] } } else if (ph.param_no) { // positional argument (explicit) arg = argv[ph.param_no] } else { // positional argument (implicit) arg = argv[cursor++] } if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) { arg = arg() } if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) { throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg)) } if (re.number.test(ph.type)) { is_positive = arg >= 0 } switch (ph.type) { case 'b': arg = parseInt(arg, 10).toString(2) break case 'c': arg = String.fromCharCode(parseInt(arg, 10)) break case 'd': case 'i': arg = parseInt(arg, 10) break case 'j': arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0) break case 'e': arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential() break case 'f': arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg) break case 'g': arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg) break case 'o': arg = (parseInt(arg, 10) >>> 0).toString(8) break case 's': arg = String(arg) arg = (ph.precision ? arg.substring(0, ph.precision) : arg) break case 't': arg = String(!!arg) arg = (ph.precision ? arg.substring(0, ph.precision) : arg) break case 'T': arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase() arg = (ph.precision ? arg.substring(0, ph.precision) : arg) break case 'u': arg = parseInt(arg, 10) >>> 0 break case 'v': arg = arg.valueOf() arg = (ph.precision ? arg.substring(0, ph.precision) : arg) break case 'x': arg = (parseInt(arg, 10) >>> 0).toString(16) break case 'X': arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase() break } if (re.json.test(ph.type)) { output += arg } else { if (re.number.test(ph.type) && (!is_positive || ph.sign)) { sign = is_positive ? '+' : '-' arg = arg.toString().replace(re.sign, '') } else { sign = '' } pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' ' pad_length = ph.width - (sign + arg).length pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : '' output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg) } } } return output } var sprintf_cache = Object.create(null) function sprintf_parse(fmt) { if (sprintf_cache[fmt]) { return sprintf_cache[fmt] } var _fmt = fmt, match, parse_tree = [], arg_names = 0 while (_fmt) { if ((match = re.text.exec(_fmt)) !== null) { parse_tree.push(match[0]) } else if ((match = re.modulo.exec(_fmt)) !== null) { parse_tree.push('%') } else if ((match = re.placeholder.exec(_fmt)) !== null) { if (match[2]) { arg_names |= 1 var field_list = [], replacement_field = match[2], field_match = [] if ((field_match = re.key.exec(replacement_field)) !== null) { field_list.push(field_match[1]) while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { if ((field_match = re.key_access.exec(replacement_field)) !== null) { field_list.push(field_match[1]) } else if ((field_match = re.index_access.exec(replacement_field)) !== null) { field_list.push(field_match[1]) } else { throw new SyntaxError('[sprintf] failed to parse named argument key') } } } else { throw new SyntaxError('[sprintf] failed to parse named argument key') } match[2] = field_list } else { arg_names |= 2 } if (arg_names === 3) { throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported') } parse_tree.push( { placeholder: match[0], param_no: match[1], keys: match[2], sign: match[3], pad_char: match[4], align: match[5], width: match[6], precision: match[7], type: match[8] } ) } else { throw new SyntaxError('[sprintf] unexpected placeholder') } _fmt = _fmt.substring(match[0].length) } return sprintf_cache[fmt] = parse_tree } /** * export to either browser or node.js */ /* eslint-disable quote-props */ if (true) { exports['sprintf'] = sprintf exports['vsprintf'] = vsprintf } if (typeof window !== 'undefined') { window['sprintf'] = sprintf window['vsprintf'] = vsprintf if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return { 'sprintf': sprintf, 'vsprintf': vsprintf } }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) } } /* eslint-enable quote-props */ }(); // eslint-disable-line /***/ }), /***/ 15: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /***/ 376: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread.js var objectSpread = __webpack_require__(7); // CONCATENATED MODULE: ./node_modules/@tannin/postfix/index.js var PRECEDENCE, OPENERS, TERMINATORS, PATTERN; /** * Operator precedence mapping. * * @type {Object} */ PRECEDENCE = { '(': 9, '!': 8, '*': 7, '/': 7, '%': 7, '+': 6, '-': 6, '<': 5, '<=': 5, '>': 5, '>=': 5, '==': 4, '!=': 4, '&&': 3, '||': 2, '?': 1, '?:': 1, }; /** * Characters which signal pair opening, to be terminated by terminators. * * @type {string[]} */ OPENERS = [ '(', '?' ]; /** * Characters which signal pair termination, the value an array with the * opener as its first member. The second member is an optional operator * replacement to push to the stack. * * @type {string[]} */ TERMINATORS = { ')': [ '(' ], ':': [ '?', '?:' ], }; /** * Pattern matching operators and openers. * * @type {RegExp} */ PATTERN = /<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/; /** * Given a C expression, returns the equivalent postfix (Reverse Polish) * notation terms as an array. * * If a postfix string is desired, simply `.join( ' ' )` the result. * * @example * * ```js * import postfix from '@tannin/postfix'; * * postfix( 'n > 1' ); * // ⇒ [ 'n', '1', '>' ] * ``` * * @param {string} expression C expression. * * @return {string[]} Postfix terms. */ function postfix( expression ) { var terms = [], stack = [], match, operator, term, element; while ( ( match = expression.match( PATTERN ) ) ) { operator = match[ 0 ]; // Term is the string preceding the operator match. It may contain // whitespace, and may be empty (if operator is at beginning). term = expression.substr( 0, match.index ).trim(); if ( term ) { terms.push( term ); } while ( ( element = stack.pop() ) ) { if ( TERMINATORS[ operator ] ) { if ( TERMINATORS[ operator ][ 0 ] === element ) { // Substitution works here under assumption that because // the assigned operator will no longer be a terminator, it // will be pushed to the stack during the condition below. operator = TERMINATORS[ operator ][ 1 ] || operator; break; } } else if ( OPENERS.indexOf( element ) >= 0 || PRECEDENCE[ element ] < PRECEDENCE[ operator ] ) { // Push to stack if either an opener or when pop reveals an // element of lower precedence. stack.push( element ); break; } // For each popped from stack, push to terms. terms.push( element ); } if ( ! TERMINATORS[ operator ] ) { stack.push( operator ); } // Slice matched fragment from expression to continue match. expression = expression.substr( match.index + operator.length ); } // Push remainder of operand, if exists, to terms. expression = expression.trim(); if ( expression ) { terms.push( expression ); } // Pop remaining items from stack into terms. return terms.concat( stack.reverse() ); } // CONCATENATED MODULE: ./node_modules/@tannin/evaluate/index.js /** * Operator callback functions. * * @type {Object} */ var OPERATORS = { '!': function( a ) { return ! a; }, '*': function( a, b ) { return a * b; }, '/': function( a, b ) { return a / b; }, '%': function( a, b ) { return a % b; }, '+': function( a, b ) { return a + b; }, '-': function( a, b ) { return a - b; }, '<': function( a, b ) { return a < b; }, '<=': function( a, b ) { return a <= b; }, '>': function( a, b ) { return a > b; }, '>=': function( a, b ) { return a >= b; }, '==': function( a, b ) { return a === b; }, '!=': function( a, b ) { return a !== b; }, '&&': function( a, b ) { return a && b; }, '||': function( a, b ) { return a || b; }, '?:': function( a, b, c ) { if ( a ) { throw b; } return c; }, }; /** * Given an array of postfix terms and operand variables, returns the result of * the postfix evaluation. * * @example * * ```js * import evaluate from '@tannin/evaluate'; * * // 3 + 4 * 5 / 6 ⇒ '3 4 5 * 6 / +' * const terms = [ '3', '4', '5', '*', '6', '/', '+' ]; * * evaluate( terms, {} ); * // ⇒ 6.333333333333334 * ``` * * @param {string[]} postfix Postfix terms. * @param {Object} variables Operand variables. * * @return {*} Result of evaluation. */ function evaluate_evaluate( postfix, variables ) { var stack = [], i, j, args, getOperatorResult, term, value; for ( i = 0; i < postfix.length; i++ ) { term = postfix[ i ]; getOperatorResult = OPERATORS[ term ]; if ( getOperatorResult ) { // Pop from stack by number of function arguments. j = getOperatorResult.length; args = Array( j ); while ( j-- ) { args[ j ] = stack.pop(); } try { value = getOperatorResult.apply( null, args ); } catch ( earlyReturn ) { return earlyReturn; } } else if ( variables.hasOwnProperty( term ) ) { value = variables[ term ]; } else { value = +term; } stack.push( value ); } return stack[ 0 ]; } // CONCATENATED MODULE: ./node_modules/@tannin/compile/index.js /** * Given a C expression, returns a function which can be called to evaluate its * result. * * @example * * ```js * import compile from '@tannin/compile'; * * const evaluate = compile( 'n > 1' ); * * evaluate( { n: 2 } ); * // ⇒ true * ``` * * @param {string} expression C expression. * * @return {Function} Compiled evaluator. */ function compile( expression ) { var terms = postfix( expression ); return function( variables ) { return evaluate_evaluate( terms, variables ); }; } // CONCATENATED MODULE: ./node_modules/@tannin/plural-forms/index.js /** * Given a C expression, returns a function which, when called with a value, * evaluates the result with the value assumed to be the "n" variable of the * expression. The result will be coerced to its numeric equivalent. * * @param {string} expression C expression. * * @return {Function} Evaluator function. */ function pluralForms( expression ) { var evaluate = compile( expression ); return function( n ) { return +evaluate( { n: n } ); }; } // CONCATENATED MODULE: ./node_modules/tannin/index.js /** * Tannin constructor options. * * @property {?string} contextDelimiter Joiner in string lookup with context. * @property {?Function} onMissingKey Callback to invoke when key missing. * * @type {Object} * * @typedef {TanninOptions} */ /** * Default Tannin constructor options. * * @type {TanninOptions} */ var DEFAULT_OPTIONS = { contextDelimiter: '\u0004', onMissingKey: null, }; /** * Given a specific locale data's config `plural_forms` value, returns the * expression. * * @example * * ``` * getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)' * ``` * * @param {string} pf Locale data plural forms. * * @return {string} Plural forms expression. */ function getPluralExpression( pf ) { var parts, i, part; parts = pf.split( ';' ); for ( i = 0; i < parts.length; i++ ) { part = parts[ i ].trim(); if ( part.indexOf( 'plural=' ) === 0 ) { return part.substr( 7 ); } } } /** * Tannin constructor. * * @param {Object} data Jed-formatted locale data. * @param {TanninOptions} options Tannin options. */ function Tannin( data, options ) { var key; this.data = data; this.pluralForms = {}; options = options || {}; this.options = {}; for ( key in DEFAULT_OPTIONS ) { this.options[ key ] = options[ key ] || DEFAULT_OPTIONS[ key ]; } } /** * Returns the plural form index for the given domain and value. * * @param {string} domain Domain on which to calculate plural form. * @param {number} n Value for which plural form is to be calculated. * * @return {number} Plural form index. */ Tannin.prototype.getPluralForm = function( domain, n ) { var getPluralForm = this.pluralForms[ domain ], config, plural, pf; if ( ! getPluralForm ) { config = this.data[ domain ][ '' ]; pf = ( config[ 'Plural-Forms' ] || config[ 'plural-forms' ] || config.plural_forms ); if ( typeof pf !== 'function' ) { plural = getPluralExpression( config[ 'Plural-Forms' ] || config[ 'plural-forms' ] || config.plural_forms ); pf = pluralForms( plural ); } getPluralForm = this.pluralForms[ domain ] = pf; } return getPluralForm( n ); }; /** * Translate a string. * * @param {string} domain Translation domain. * @param {string} context Context distinguishing terms of the same name. * @param {string} singular Primary key for translation lookup. * @param {string} plural Fallback value used for non-zero plural form index. * @param {number} n Value to use in calculating plural form. * * @return {string} Translated string. */ Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) { var index, key, entry; if ( n === undefined ) { // Default to singular. index = 0; } else { // Find index by evaluating plural form for value. index = this.getPluralForm( domain, n ); } key = singular; // If provided, context is prepended to key with delimiter. if ( context ) { key = context + this.options.contextDelimiter + singular; } entry = this.data[ domain ][ key ]; // Verify not only that entry exists, but that the intended index is within // range and non-empty. if ( entry && entry[ index ] ) { return entry[ index ]; } if ( this.options.onMissingKey ) { this.options.onMissingKey( singular, domain ); } // If entry not found, fall back to singular vs. plural with zero index // representing the singular value. return index === 0 ? singular : plural; }; // EXTERNAL MODULE: ./node_modules/memize/index.js var memize = __webpack_require__(41); var memize_default = /*#__PURE__*/__webpack_require__.n(memize); // EXTERNAL MODULE: ./node_modules/@wordpress/i18n/node_modules/sprintf-js/src/sprintf.js var sprintf = __webpack_require__(137); var sprintf_default = /*#__PURE__*/__webpack_require__.n(sprintf); // CONCATENATED MODULE: ./node_modules/@wordpress/i18n/build-module/index.js /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLocaleData", function() { return setLocaleData; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__", function() { return __; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_x", function() { return _x; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_n", function() { return _n; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "_nx", function() { return _nx; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sprintf", function() { return build_module_sprintf; }); /** * External dependencies */ /** * Default locale data to use for Tannin domain when not otherwise provided. * Assumes an English plural forms expression. * * @type {Object} */ var DEFAULT_LOCALE_DATA = { '': { plural_forms: 'plural=(n!=1)' } }; /** * Log to console, once per message; or more precisely, per referentially equal * argument set. Because Jed throws errors, we log these to the console instead * to avoid crashing the application. * * @param {...*} args Arguments to pass to `console.error` */ var logErrorOnce = memize_default()(console.error); // eslint-disable-line no-console /** * The underlying instance of Tannin to which exported functions interface. * * @type {Tannin} */ var i18n = new Tannin({}); /** * Merges locale data into the Tannin instance by domain. Accepts data in a * Jed-formatted JSON object shape. * * @see http://messageformat.github.io/Jed/ * * @param {?Object} data Locale data configuration. * @param {?string} domain Domain for which configuration applies. */ function setLocaleData(data) { var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default'; i18n.data[domain] = Object(objectSpread["a" /* default */])({}, DEFAULT_LOCALE_DATA, i18n.data[domain], data); // Populate default domain configuration (supported locale date which omits // a plural forms expression). i18n.data[domain][''] = Object(objectSpread["a" /* default */])({}, DEFAULT_LOCALE_DATA[''], i18n.data[domain]['']); } /** * Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not * otherwise previously assigned. * * @param {?string} domain Domain to retrieve the translated text. * @param {?string} context Context information for the translators. * @param {string} single Text to translate if non-plural. Used as fallback * return value on a caught error. * @param {?string} plural The text to be used if the number is plural. * @param {?number} number The number to compare against to use either the * singular or plural form. * * @return {string} The translated string. */ function dcnpgettext() { var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default'; var context = arguments.length > 1 ? arguments[1] : undefined; var single = arguments.length > 2 ? arguments[2] : undefined; var plural = arguments.length > 3 ? arguments[3] : undefined; var number = arguments.length > 4 ? arguments[4] : undefined; if (!i18n.data[domain]) { setLocaleData(undefined, domain); } return i18n.dcnpgettext(domain, context, single, plural, number); } /** * Retrieve the translation of text. * * @see https://developer.wordpress.org/reference/functions/__/ * * @param {string} text Text to translate. * @param {?string} domain Domain to retrieve the translated text. * * @return {string} Translated text. */ function __(text, domain) { return dcnpgettext(domain, undefined, text); } /** * Retrieve translated string with gettext context. * * @see https://developer.wordpress.org/reference/functions/_x/ * * @param {string} text Text to translate. * @param {string} context Context information for the translators. * @param {?string} domain Domain to retrieve the translated text. * * @return {string} Translated context string without pipe. */ function _x(text, context, domain) { return dcnpgettext(domain, context, text); } /** * Translates and retrieves the singular or plural form based on the supplied * number. * * @see https://developer.wordpress.org/reference/functions/_n/ * * @param {string} single The text to be used if the number is singular. * @param {string} plural The text to be used if the number is plural. * @param {number} number The number to compare against to use either the * singular or plural form. * @param {?string} domain Domain to retrieve the translated text. * * @return {string} The translated singular or plural form. */ function _n(single, plural, number, domain) { return dcnpgettext(domain, undefined, single, plural, number); } /** * Translates and retrieves the singular or plural form based on the supplied * number, with gettext context. * * @see https://developer.wordpress.org/reference/functions/_nx/ * * @param {string} single The text to be used if the number is singular. * @param {string} plural The text to be used if the number is plural. * @param {number} number The number to compare against to use either the * singular or plural form. * @param {string} context Context information for the translators. * @param {?string} domain Domain to retrieve the translated text. * * @return {string} The translated singular or plural form. */ function _nx(single, plural, number, context, domain) { return dcnpgettext(domain, context, single, plural, number); } /** * Returns a formatted string. If an error occurs in applying the format, the * original format string is returned. * * @param {string} format The format of the string to generate. * @param {...string} args Arguments to apply to the format. * * @see http://www.diveintojavascript.com/projects/javascript-sprintf * * @return {string} The formatted string. */ function build_module_sprintf(format) { try { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return sprintf_default.a.sprintf.apply(sprintf_default.a, [format].concat(args)); } catch (error) { logErrorOnce('sprintf error: \n\n' + error.toString()); return format; } } /***/ }), /***/ 41: /***/ (function(module, exports, __webpack_require__) { module.exports = function memize( fn, options ) { var size = 0, maxSize, head, tail; if ( options && options.maxSize ) { maxSize = options.maxSize; } function memoized( /* ...args */ ) { var node = head, len = arguments.length, args, i; searchCache: while ( node ) { // Perform a shallow equality test to confirm that whether the node // under test is a candidate for the arguments passed. Two arrays // are shallowly equal if their length matches and each entry is // strictly equal between the two sets. Avoid abstracting to a // function which could incur an arguments leaking deoptimization. // Check whether node arguments match arguments length if ( node.args.length !== arguments.length ) { node = node.next; continue; } // Check whether node arguments match arguments values for ( i = 0; i < len; i++ ) { if ( node.args[ i ] !== arguments[ i ] ) { node = node.next; continue searchCache; } } // At this point we can assume we've found a match // Surface matched node to head if not already if ( node !== head ) { // As tail, shift to previous. Must only shift if not also // head, since if both head and tail, there is no previous. if ( node === tail ) { tail = node.prev; } // Adjust siblings to point to each other. If node was tail, // this also handles new tail's empty `next` assignment. node.prev.next = node.next; if ( node.next ) { node.next.prev = node.prev; } node.next = head; node.prev = null; head.prev = node; head = node; } // Return immediately return node.val; } // No cached value found. Continue to insertion phase: // Create a copy of arguments (avoid leaking deoptimization) args = new Array( len ); for ( i = 0; i < len; i++ ) { args[ i ] = arguments[ i ]; } node = { args: args, // Generate the result from original function val: fn.apply( null, args ) }; // Don't need to check whether node is already head, since it would // have been returned above already if it was // Shift existing head down list if ( head ) { head.prev = node; node.next = head; } else { // If no head, follows that there's no tail (at initial or reset) tail = node; } // Trim tail if we're reached max size and are pending cache insertion if ( size === maxSize ) { tail = tail.prev; tail.next = null; } else { size++; } head = node; return node.val; } memoized.clear = function() { head = null; tail = null; size = 0; }; if ( false ) {} return memoized; }; /***/ }), /***/ 7: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread; }); /* harmony import */ var _defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { Object(_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } return target; } /***/ }) /******/ });kirki-packages/compatibility/src/Field.php000064400000043457147177211530014652 0ustar00 'auto' * and have already set an array for the 'output' argument. * * @see https://docs.themeum.com/kirki/arguments/js_vars/ * @access protected * @var array */ protected $js_vars = array(); /** * If you want to use a CSS compiler, then use this to set the variable names. * * @see https://docs.themeum.com/kirki/arguments/output/ * @access protected * @var array */ protected $variables = array(); /** * Text that will be used in a tooltip to provide extra info for this field. * * @access protected * @var string */ protected $tooltip = ''; /** * A custom callback to determine if the field should be visible or not. * * @access protected * @var string|array */ protected $active_callback = '__return_true'; /** * A custom sanitize callback that will be used to properly save the values. * * @access protected * @var string|array */ protected $sanitize_callback = ''; /** * Use 'refresh', 'postMessage' or 'auto'. * 'auto' will automatically geberate any 'js_vars' from the 'output' argument. * * @access protected * @var string */ protected $transport = 'refresh'; /** * Define dependencies to show/hide this field based on the values of other fields. * * @access protected * @var array */ protected $required = array(); /** * Partial Refreshes array. * * @access protected * @var array */ protected $partial_refresh = array(); /** * The class constructor. * Parses and sanitizes all field arguments. * Then it adds the field to Kirki::$fields. * * @access public * @param string $config_id The ID of the config we want to use. * Defaults to "global". * Configs are handled by the Kirki\Compatibility\Config class. * @param array $args The arguments of the field. */ public function __construct( $config_id = 'global', $args = array() ) { /** * In case the user only provides 1 argument, * assume that the provided argument is $args and set $config_id = 'global'. */ if ( is_array( $config_id ) && empty( $args ) ) { $args = $config_id; $config_id = isset( $args['kirki_config'] ) ? $args['kirki_config'] : 'global'; } if ( isset( $args['setting'] ) && ! empty( $args['setting'] ) && ( ! isset( $args['settings'] ) || empty( $args['settings'] ) ) ) { /* translators: %s represents the field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Typo found in field %s - setting instead of settings.', 'kirki' ), esc_html( $args['settings'] ) ), '3.0.10' ); $args['settings'] = $args['setting']; unset( $args['setting'] ); } $args['kirki_config'] = $config_id; $this->kirki_config = $config_id; if ( '' === $config_id ) { /* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */ _doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_html( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' ); $this->kirki_config = 'global'; } // Get defaults from the class. $defaults = get_class_vars( __CLASS__ ); // Get the config arguments, and merge them with the defaults. $config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array(); if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) { $config_defaults = Kirki::$config[ $this->kirki_config ]; } $config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array(); foreach ( $config_defaults as $key => $value ) { if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value !== $defaults[ $key ] ) { $defaults[ $key ] = $value; } } // Merge our args with the defaults. $args = wp_parse_args( $args, $defaults ); // Set the class properties using the parsed args. foreach ( $args as $key => $value ) { $this->{$key} = $value; } $this->args = $args; $this->set_field(); // Instantiate the \Kirki\Field to apply hooks. new \Kirki\Field\None( $this->args ); } /** * Processes the field arguments * * @access protected */ protected function set_field() { $properties = get_class_vars( __CLASS__ ); // Some things must run before the others. $this->set_option_type(); $this->set_settings(); // Sanitize the properties, skipping the ones that have already run above. foreach ( array_keys( $properties ) as $property ) { if ( in_array( $property, array( 'option_name', 'option_type', 'settings' ), true ) ) { continue; } if ( method_exists( $this, 'set_' . $property ) ) { $method_name = 'set_' . $property; $this->$method_name(); } } // Get all arguments with their values. $args = get_object_vars( $this ); foreach ( array_keys( $args ) as $key ) { $args[ $key ] = $this->$key; } // Add the field to the static $fields variable properly indexed. Kirki::$fields[ $this->settings ] = $args; } /** * Escape the $section. * * @access protected */ protected function set_input_attrs() { $this->input_attrs = (array) $this->input_attrs; } /** * Make sure we're using the correct option_type * * @access protected */ protected function set_option_type() { // Take care of common typos. if ( 'options' === $this->option_type ) { $this->option_type = 'option'; } // Take care of common typos. if ( 'theme_mods' === $this->option_type ) { /* translators: %1$s represents the field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_html( 'Typo found in field %s - "theme_mods" vs "theme_mod"', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' ); $this->option_type = 'theme_mod'; } } /** * Modifications for partial refreshes. * * @access protected */ protected function set_partial_refresh() { if ( ! is_array( $this->partial_refresh ) ) { $this->partial_refresh = array(); } foreach ( $this->partial_refresh as $id => $args ) { if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) { /* translators: %1$s represents the field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' ); unset( $this->partial_refresh[ $id ] ); continue; } } if ( ! empty( $this->partial_refresh ) ) { $this->transport = 'postMessage'; } } /** * Sets the settings. * If we're using serialized options it makes sure that settings are properly formatted. * We'll also be escaping all setting names here for consistency. * * @access protected */ protected function set_settings() { // If settings is not an array, temporarily convert it to an array. // This is just to allow us to process everything the same way and avoid code duplication. // if settings is not an array then it will not be set as an array in the end. if ( ! is_array( $this->settings ) ) { $this->settings = array( 'kirki_placeholder_setting' => $this->settings, ); } $settings = array(); foreach ( $this->settings as $setting_key => $setting_value ) { $settings[ $setting_key ] = $setting_value; // If we're using serialized options then we need to spice this up. if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) { $settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]"; } } $this->settings = $settings; if ( isset( $this->settings['kirki_placeholder_setting'] ) ) { $this->settings = $this->settings['kirki_placeholder_setting']; } } /** * Sets the active_callback * If we're using the $required argument, * Then this is where the switch is made to our evaluation method. * * @access protected */ protected function set_active_callback() { if ( is_array( $this->active_callback ) ) { if ( ! is_callable( $this->active_callback ) ) { // Bugfix for https://github.com/aristath/kirki/issues/1961. foreach ( $this->active_callback as $key => $val ) { if ( is_callable( $val ) ) { unset( $this->active_callback[ $key ] ); } } if ( isset( $this->active_callback[0] ) ) { $this->required = $this->active_callback; } } } if ( ! empty( $this->required ) ) { $this->active_callback = '__return_true'; return; } // No need to proceed any further if we're using the default value. if ( '__return_true' === $this->active_callback ) { return; } // Make sure the function is callable, otherwise fallback to __return_true. if ( ! is_callable( $this->active_callback ) ) { $this->active_callback = '__return_true'; } } /** * Sets the $id. * Setting the ID should happen after the 'settings' sanitization. * This way we can also properly handle cases where the option_type is set to 'option' * and we're using an array instead of individual options. * * @access protected */ protected function set_id() { $this->id = sanitize_key( str_replace( '[', '-', str_replace( ']', '', $this->settings ) ) ); } /** * Sets the $choices. * * @access protected */ protected function set_choices() { if ( ! is_array( $this->choices ) ) { $this->choices = array(); } } /** * Escapes the $disable_output. * * @access protected */ protected function set_disable_output() { $this->disable_output = (bool) $this->disable_output; } /** * Sets the $sanitize_callback * * @access protected */ protected function set_output() { if ( empty( $this->output ) ) { return; } if ( ! is_array( $this->output ) ) { /* translators: The field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' ); $this->output = array( array( 'element' => $this->output, ), ); } // Convert to array of arrays if needed. if ( isset( $this->output['element'] ) ) { /* translators: The field ID where the error occurs. */ _doing_it_wrong( __METHOD__, sprintf( esc_html__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_html( $this->settings ) ), '3.0.10' ); $this->output = array( $this->output ); } foreach ( $this->output as $key => $output ) { if ( empty( $output ) || ! isset( $output['element'] ) ) { unset( $this->output[ $key ] ); continue; } if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) { $this->output[ $key ]['sanitize_callback'] = $output['callback']; } // Convert element arrays to strings. if ( isset( $output['element'] ) && is_array( $output['element'] ) ) { $this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] ); sort( $this->output[ $key ]['element'] ); // Trim each element in the array. foreach ( $this->output[ $key ]['element'] as $index => $element ) { $this->output[ $key ]['element'][ $index ] = trim( $element ); } $this->output[ $key ]['element'] = implode( ',', $this->output[ $key ]['element'] ); } // Fix for https://github.com/aristath/kirki/issues/1659#issuecomment-346229751. $this->output[ $key ]['element'] = str_replace( array( "\t", "\n", "\r", "\0", "\x0B" ), ' ', $this->output[ $key ]['element'] ); $this->output[ $key ]['element'] = trim( preg_replace( '/\s+/', ' ', $this->output[ $key ]['element'] ) ); } } /** * Sets the $js_vars * * @access protected */ protected function set_js_vars() { if ( ! is_array( $this->js_vars ) ) { $this->js_vars = array(); } // Check if transport is set to auto. // If not, then skip the auto-calculations and exit early. if ( 'auto' !== $this->transport ) { return; } // Set transport to refresh initially. // Serves as a fallback in case we failt to auto-calculate js_vars. $this->transport = 'refresh'; $js_vars = array(); // Try to auto-generate js_vars. // First we need to check if js_vars are empty, and that output is not empty. if ( empty( $this->js_vars ) && ! empty( $this->output ) ) { // Start going through each item in the $output array. foreach ( $this->output as $output ) { $output['function'] = ( isset( $output['function'] ) ) ? $output['function'] : 'style'; // If 'element' is not defined, skip this. if ( ! isset( $output['element'] ) ) { continue; } if ( is_array( $output['element'] ) ) { $output['element'] = implode( ',', $output['element'] ); } // If there's a sanitize_callback defined skip this, unless we also have a js_callback defined. if ( isset( $output['sanitize_callback'] ) && ! empty( $output['sanitize_callback'] ) && ! isset( $output['js_callback'] ) ) { continue; } // If we got this far, it's safe to add this. $js_vars[] = $output; } // Did we manage to get all the items from 'output'? // If not, then we're missing something so don't add this. if ( count( $js_vars ) !== count( $this->output ) ) { return; } $this->js_vars = $js_vars; $this->transport = 'postMessage'; } } /** * Sets the $variables * * @access protected */ protected function set_variables() { if ( ! is_array( $this->variables ) ) { $variable = ( is_string( $this->variables ) && ! empty( $this->variables ) ) ? $this->variables : false; $this->variables = array(); if ( $variable && empty( $this->variables ) ) { $this->variables[0]['name'] = $variable; } } } /** * Sets the $transport * * @access protected */ protected function set_transport() { if ( 'postmessage' === trim( strtolower( $this->transport ) ) ) { $this->transport = 'postMessage'; } } /** * Sets the $required * * @access protected */ protected function set_required() { if ( ! is_array( $this->required ) ) { $this->required = array(); } } /** * Sets the $priority * * @access protected */ protected function set_priority() { $this->priority = absint( $this->priority ); } /** * Sets the $css_vars * * @access protected */ protected function set_css_vars() { if ( is_string( $this->css_vars ) ) { $this->css_vars = array( $this->css_vars ); } if ( isset( $this->css_vars[0] ) && is_string( $this->css_vars[0] ) ) { $this->css_vars = array( $this->css_vars ); } foreach ( $this->css_vars as $key => $val ) { if ( ! isset( $val[1] ) ) { $this->css_vars[ $key ][1] = '$'; } } } } kirki-packages/compatibility/src/Kirki.php000064400000015016147177211530014666 0ustar00get_config(); self::$config[ $config_args['id'] ] = $config_args; } /** * Create a new panel. * * @static * @access public * @param string $id The ID for this panel. * @param array $args The panel arguments. */ public static function add_panel( $id = '', $args = [] ) { new \Kirki\Panel( $id, $args ); } /** * Remove a panel. * * @static * @access public * @since 3.0.17 * @param string $id The ID for this panel. */ public static function remove_panel( $id = '' ) { $panel = new \Kirki\Panel( $id ); $panel->remove(); } /** * Create a new section. * * @static * @access public * @param string $id The ID for this section. * @param array $args The section arguments. */ public static function add_section( $id, $args ) { new \Kirki\Section( $id, $args ); } /** * Remove a section. * * @static * @access public * @since 3.0.17 * @param string $id The ID for this section. */ public static function remove_section( $id = '' ) { $section = new \Kirki\Section( $id ); $section->remove(); } /** * Create a new field. * * @static * @access public * @param string $config_id The configuration ID for this field. * @param array $args The field arguments. */ public static function add_field( $config_id, $args = [] ) { if ( doing_action( 'customize_register' ) ) { _doing_it_wrong( __METHOD__, esc_html__( 'Kirki fields should not be added on customize_register. Please add them directly, or on init.', 'kirki' ), '3.0.10' ); } parent::maybe_show_fontawesome_nag( $args ); // Early exit if 'type' is not defined. if ( ! isset( $args['type'] ) ) { return; } $args = self::migrate_css_vars( $args ); $str = str_replace( [ '-', '_' ], ' ', $args['type'] ); $classname = '\Kirki\Field\\' . str_replace( ' ', '_', ucwords( $str ) ); $config = Config::get_instance( $config_id )->get_config(); $args['kirki_config'] = isset( $args['kirki_config'] ) ? $args['kirki_config'] : $config_id; unset( $config['id'] ); $args = wp_parse_args( $args, $config ); if ( class_exists( $classname ) ) { unset( $args['type'] ); new $classname( $args ); return; } new Field( $config_id, $args ); } /** * Remove a control. * * @static * @access public * @since 3.0.17 * @param string $id The field ID. */ public static function remove_control( $id ) { if ( ! in_array( $id, self::$controls_to_remove, true ) ) { self::$controls_to_remove[] = $id; } } /** * Gets a parameter for a config-id. * * @static * @access public * @since 3.0.10 * @param string $id The config-ID. * @param string $param The parameter we want. * @return string */ public static function get_config_param( $id, $param ) { if ( ! isset( self::$config[ $id ] ) || ! isset( self::$config[ $id ][ $param ] ) ) { return ''; } return self::$config[ $id ][ $param ]; } /** * Migrate css-variables to output argument. * * This only exists for backwards-compatibility with the deprecated css-vars argument. * * @static * @since 4.0 * @param array $args The field arguments. * @return array */ private static function migrate_css_vars( $args ) { // Convert css_vars to output args. if ( isset( $args['css_vars'] ) ) { if ( isset( $args['transport'] ) && 'postMessage' === $args['transport'] ) { $args['transport'] = 'auto'; } // Convert to properly-formatted arrays. $args['css_vars'] = (array) $args['css_vars']; if ( isset( $args['css_vars'][0] ) && is_string( $args['css_vars'][0] ) ) { $args['css_vars'] = [ $args['css_vars'] ]; } foreach ( $args['css_vars'] as $css_var ) { $output = [ 'element' => ':root', 'property' => $css_var[0], ]; if ( isset( $css_var[1] ) ) { $output['value_pattern'] = $css_var[1]; } if ( isset( $css_var[2] ) ) { $output['choice'] = $css_var[2]; } $args['output'][] = $output; } } return $args; } } kirki-packages/compatibility/src/Framework.php000064400000001472147177211530015553 0ustar00control_types = [ 'kirki-composite' => '\Kirki\Control\Composite', 'checkbox' => '\Kirki\Control\Checkbox', 'kirki-color' => '\Kirki\Control\ReactColorful', 'kirki-color-palette' => '\Kirki\Control\Color_Palette', 'kirki-custom' => '\Kirki\Control\Custom', 'kirki-date' => '\Kirki\Control\Date', 'kirki-dashicons' => '\Kirki\Control\Dashicons', 'kirki-dimension' => '\Kirki\Control\Dimension', 'kirki-dimensions' => '\Kirki\Control\Dimensions', 'kirki-editor' => '\Kirki\Control\Editor', 'kirki-image' => '\Kirki\Control\Image', 'kirki-multicolor' => '\Kirki\Control\Multicolor', 'kirki-multicheck' => '\Kirki\Control\Multicheck', 'kirki-number' => '\Kirki\Control\Number', 'kirki-radio' => '\Kirki\Control\Radio', 'kirki-radio-buttonset' => '\Kirki\Control\Radio_Buttonset', 'kirki-radio-image' => '\Kirki\Control\Radio_Image', 'repeater' => '\Kirki\Control\Repeater', 'kirki-select' => '\Kirki\Control\Select', 'kirki-slider' => '\Kirki\Control\Slider', 'kirki-sortable' => '\Kirki\Control\Sortable', 'kirki-spacing' => '\Kirki\Control\Dimensions', 'kirki-switch' => '\Kirki\Control\Checkbox_Switch', 'kirki-generic' => '\Kirki\Control\Generic', 'kirki-toggle' => '\Kirki\Control\Checkbox_Toggle', 'image' => '\Kirki\Control\Image', 'cropped_image' => '\Kirki\Control\Cropped_Image', 'upload' => '\Kirki\Control\Upload', ]; return array_merge( $this->control_types, $control_types ); } /** * Helper function that adds the fields to the customizer. */ public function add_to_customizer() { $this->fields_from_filters(); add_action( 'customize_register', [ $this, 'register_control_types' ] ); add_action( 'customize_register', [ $this, 'add_fields' ], 99 ); } /** * Register control types */ public function register_control_types() { global $wp_customize; $this->control_types = $this->default_control_types(); if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) { unset( $this->control_types['code_editor'] ); } foreach ( $this->control_types as $key => $classname ) { if ( ! class_exists( $classname ) ) { unset( $this->control_types[ $key ] ); } } $skip_control_types = apply_filters( 'kirki_control_types_exclude', [ '\Kirki\Control\Repeater', '\WP_Customize_Control', ] ); foreach ( $this->control_types as $control_type ) { if ( ! in_array( $control_type, $skip_control_types, true ) && class_exists( $control_type ) ) { $wp_customize->register_control_type( $control_type ); } } } /** * Create the settings and controls from the $fields array and register them. * * @var object The WordPress Customizer object. */ public function add_fields() { global $wp_customize; foreach ( Kirki::$fields as $args ) { // Create the settings. new \Kirki\Compatibility\Settings( $args ); // Check if we're on the customizer. // If we are, then we will create the controls, add the scripts needed for the customizer // and any other tweaks that this field may require. if ( $wp_customize ) { // Create the control. new Control( $args ); } } } /** * Process fields added using the 'kirki_fields' and 'kirki_controls' filter. * These filters are no longer used, this is simply for backwards-compatibility. * * @access private * @since 2.0.0 */ private function fields_from_filters() { $fields = apply_filters( 'kirki_controls', [] ); $fields = apply_filters( 'kirki_fields', $fields ); if ( ! empty( $fields ) ) { foreach ( $fields as $field ) { $field['kirki_config'] = 'global'; Kirki::add_field( 'global', $field ); } } } /** * Alias for the is_plugin static method in the Kirki\Util\Util class. * This is here for backwards-compatibility purposes. * * @static * @access public * @since 3.0.0 * @return bool */ public static function is_plugin() { return Util::is_plugin(); } /** * Alias for the get_variables static method in the Kirki\Util\Util class. * This is here for backwards-compatibility purposes. * * @static * @access public * @since 2.0.0 * @return array Formatted as array( 'variable-name' => value ). */ public static function get_variables() { // Log error for developers. _doing_it_wrong( __METHOD__, esc_html__( 'We detected you\'re using Kirki\Compatibility\Init::get_variables(). Please use \Kirki\Util\Util::get_variables() instead.', 'kirki' ), '3.0.10' ); // ! This will be failed, because Util class is under Kirki\Util namespace. return Util::get_variables(); } /** * Remove controls. * * @since 3.0.17 * @param object $wp_customize The customizer object. * @return void */ public function remove_controls( $wp_customize ) { foreach ( Kirki::$controls_to_remove as $control ) { $wp_customize->remove_control( $control ); } } /** * Shows an admin notice. * * @access public * @since 3.0.42 * @return void */ public function admin_notices() { // No need for a nag if we don't need to recommend installing the FA plugin. if ( ! self::$show_fa_nag ) { return; } // No need for a nag if FA plugin is already installed. if ( defined( 'FONTAWESOME_DIR_PATH' ) ) { return; } // No need for a nag if current user can't install plugins. if ( ! current_user_can( 'install_plugins' ) ) { return; } // No need for a nag if user has dismissed it. $dismissed = get_user_meta( get_current_user_id(), 'kirki_fa_nag_dismissed', true ); if ( true === $dismissed || 1 === $dismissed || '1' === $dismissed ) { return; } ?> $value ) { // Is this property whitelisted? if ( property_exists( $this, $key ) ) { $args[ $key ] = $value; } } $this->id = $config_id; $this->config_final = wp_parse_args( [ 'id' => $config_id, ], $args ); } /** * Use this method to get an instance of your config. * Each config has its own instance of this object. * * @static * @access public * @param string $id Config ID. * @param array $args { * Optional. Arguments to override config defaults. * * @type string $capability @see https://codex.wordpress.org/Roles_and_Capabilities * @type string $option_type theme_mod or option. * @type string $option_name If we want to used serialized options, * this is where we'll be adding the option name. * All fields using this config will be items in that array. * @type array $compiler Not yet fully implemented * @type bool $disable_output If set to true, no CSS will be generated * from fields using this configuration. * } * * @return Kirki\Compatibility\Config */ public static function get_instance( $id = 'global', $args = [] ) { if ( empty( $id ) ) { $id = 'global'; } $id_md5 = md5( $id ); if ( ! isset( self::$instances[ $id_md5 ] ) ) { self::$instances[ $id_md5 ] = new self( $id, $args ); } return self::$instances[ $id_md5 ]; } /** * Get the IDs of all current configs. * * @static * @access public * @since 3.0.22 * @return array */ public static function get_config_ids() { $configs = []; foreach ( self::$instances as $instance ) { $configs[] = $instance->id; } return array_unique( $configs ); } /** * Returns the $config_final property * * @access public * @return array */ public function get_config() { return $this->config_final; } } kirki-packages/compatibility/src/Scripts.php000064400000002673147177211530015251 0ustar00wp_customize = $wp_customize; // Set the setting_types. $this->set_setting_types(); // Add the settings. $this->add_settings( $args ); } /** * Adds the settings for this field. * If settings are defined as an array, then it goes through them * and calls the add_setting method. * If not an array, then it just calls add_setting * * @access private * @param array $args The field definition as sanitized in Kirki\Compatibility\Field. */ final function add_settings( $args = [] ) { // Get the classname we'll be using to create our setting(s). $classname = false; if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) { $classname = $this->setting_types[ $args['option_type'] ]; } if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) { $args['type'] = 'default'; } $classname = ! $classname ? $this->setting_types[ $args['type'] ] : $classname; // If settings are defined as an array, then we need to go through them // and call add_setting for each one of them separately. if ( isset( $args['settings'] ) && is_array( $args['settings'] ) ) { // Make sure defaults have been defined. if ( ! isset( $args['default'] ) || ! is_array( $args['default'] ) ) { $args['default'] = []; } foreach ( $args['settings'] as $key => $value ) { // ? Bagus: this $defaults var is not defined anywhere inside this function, so is this a mistake? $default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : ''; $this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); } } $this->add_setting( $classname, $args['settings'], $args['default'], $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] ); } /** * This is where we're finally adding the setting to the Customizer. * * @access private * @param string $classname The name of the class that will be used to create this setting. * We're getting this from $this->setting_types. * @param string $setting The setting-name. * If settings is an array, then this method is called per-setting. * @param string|array $default Default value for this setting. * @param string $type The data type we're using. Valid options: theme_mod|option. * @param string $capability @see https://codex.wordpress.org/Roles_and_Capabilities. * @param string $transport Use refresh|postMessage. * @param string|array $sanitize_callback A callable sanitization function or method. */ final function add_setting( $classname, $setting, $default, $type, $capability, $transport, $sanitize_callback ) { $this->wp_customize->add_setting( new $classname( $this->wp_customize, $setting, [ 'default' => $default, 'type' => $type, 'capability' => $capability, 'transport' => $transport, 'sanitize_callback' => $sanitize_callback, ] ) ); } /** * Sets the $this->setting_types property. * Makes sure the kirki_setting_types filter is applied * and that the defined classes actually exist. * If a defined class does not exist, it is removed. */ final function set_setting_types() { // Apply the kirki_setting_types filter. $this->setting_types = apply_filters( 'kirki_setting_types', [ 'default' => 'WP_Customize_Setting', 'repeater' => '\Kirki_Settings_Repeater_Setting', 'user_meta' => '\Kirki\Util\Setting\User_Meta', 'site_option' => '\Kirki\Util\Setting\Site_Option', ] ); // Make sure the defined classes actually exist. foreach ( $this->setting_types as $key => $classname ) { if ( ! class_exists( $classname ) ) { unset( $this->setting_types[ $key ] ); } } } } kirki-packages/compatibility/src/Modules.php000064400000006143147177211530015226 0ustar00 '\Kirki\Module\CSS', 'tooltips' => '\Kirki\Module\Tooltips', 'postMessage' => '\Kirki\Module\Postmessage', 'selective-refresh' => '\Kirki\Module\Selective_Refresh', 'field-dependencies' => '\Kirki\Module\Field_Dependencies', 'webfonts' => '\Kirki\Module\Webfonts', 'preset' => '\Kirki\Module\Preset', 'gutenberg' => '\Kirki\Module\Editor_Styles', 'section-icons' => '\Kirki\Module\Section_Icons', ] ); } /** * Instantiates the modules. * In v3.0.35 the visibility for this method was changed * from private to public to fix https://github.com/aristath/kirki/issues/2023 * * @access public * @since 3.0.0 */ public function init() { foreach ( self::$modules as $module_class ) { if ( class_exists( $module_class ) ) { new $module_class(); } } } /** * Add a module. * * @static * @access public * @param string $module The classname of the module to add. * @since 3.0.0 */ public static function add_module( $module ) { if ( ! in_array( $module, self::$modules, true ) ) { self::$modules[] = $module; } } /** * Remove a module. * * @static * @access public * @param string $module The classname of the module to add. * @since 3.0.0 */ public static function remove_module( $module ) { $key = array_search( $module, self::$modules, true ); if ( false !== $key ) { unset( self::$modules[ $key ] ); } } /** * Get the modules array. * * @static * @access public * @since 3.0.0 * @return array */ public static function get_modules() { return self::$modules; } /** * Get the array of active modules (objects). * * @static * @access public * @since 3.0.0 * @return array */ public static function get_active_modules() { return self::$active_modules; } } kirki-packages/compatibility/src/deprecated/filters.php000064400000007464147177211530017375 0ustar00toCSS( \'hex\' )' ); return Kirki_Color::sanitize_hex( $color ); } } if ( ! function_exists( 'kirki_get_rgb' ) ) { function kirki_get_rgb( $hex, $implode = false ) { _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgb\' )' ); return Kirki_Color::get_rgb( $hex, $implode ); } } if ( ! function_exists( 'kirki_get_rgba' ) ) { function kirki_get_rgba( $hex = '#fff', $opacity = 100 ) { _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgba\' )' ); return Kirki_Color::get_rgba( $hex, $opacity ); } } if ( ! function_exists( 'kirki_get_brightness' ) ) { function kirki_get_brightness( $hex ) { _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->lightness' ); return Kirki_Color::get_brightness( $hex ); } } if ( ! function_exists( 'Kirki' ) ) { function Kirki() { return \Kirki\Compatibility\Framework::get_instance(); } } kirki-packages/compatibility/src/Sanitize_Values.php000064400000012331147177211530016717 0ustar00sanitize( $value ); } /** * Sanitize number options. * * @static * @access public * @since 0.5 * @param int|float|double|string $value The value to be sanitized. * @return integer|double|string */ public static function number( $value ) { return ( is_numeric( $value ) ) ? $value : intval( $value ); } /** * Drop-down Pages sanitization callback. * * - Sanitization: dropdown-pages * - Control: dropdown-pages * * Sanitization callback for 'dropdown-pages' type controls. This callback sanitizes `$page_id` * as an absolute integer, and then validates that $input is the ID of a published page. * * @see absint() https://developer.wordpress.org/reference/functions/absint/ * @see get_post_status() https://developer.wordpress.org/reference/functions/get_post_status/ * * @param int $page_id Page ID. * @param WP_Customize_Setting $setting Setting instance. * @return int|string Page ID if the page is published; otherwise, the setting default. */ public static function dropdown_pages( $page_id, $setting ) { // Ensure $input is an absolute integer. $page_id = absint( $page_id ); // If $page_id is an ID of a published page, return it; otherwise, return the default. return ( 'publish' === get_post_status( $page_id ) ? $page_id : $setting->default ); } /** * Sanitizes css dimensions. * * @static * @access public * @since 2.2.0 * @param string $value The value to be sanitized. * @return string */ public static function css_dimension( $value ) { // Trim it. $value = trim( $value ); // If the value is round, then return 50%. if ( 'round' === $value ) { $value = '50%'; } // If the value is empty, return empty. if ( '' === $value ) { return ''; } // If auto, inherit or initial, return the value. if ( 'auto' === $value || 'initial' === $value || 'inherit' === $value || 'normal' === $value ) { return $value; } // Return empty if there are no numbers in the value. if ( ! preg_match( '#[0-9]#', $value ) ) { return ''; } // If we're using calc() then return the value. if ( false !== strpos( $value, 'calc(' ) ) { return $value; } // The raw value without the units. $raw_value = self::filter_number( $value ); $unit_used = ''; // An array of all valid CSS units. Their order was carefully chosen for this evaluation, don't mix it up!!! $units = [ 'fr', 'rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax' ]; foreach ( $units as $unit ) { if ( false !== strpos( $value, $unit ) ) { $unit_used = $unit; } } // Hack for rem values. if ( 'em' === $unit_used && false !== strpos( $value, 'rem' ) ) { $unit_used = 'rem'; } return $raw_value . $unit_used; } /** * Filters numeric values. * * @static * @access public * @param string $value The value to be sanitized. * @return int|float */ public static function filter_number( $value ) { return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } /** * Sanitize RGBA colors * * @static * @since 0.8.5 * @param string $value The value to be sanitized. * @return string */ public static function rgba( $value ) { $color = \ariColor::newColor( $value ); return $color->toCSS( 'rgba' ); } /** * Sanitize colors. * * @static * @since 0.8.5 * @param string $value The value to be sanitized. * @return string */ public static function color( $value ) { // If the value is empty, then return empty. if ( '' === $value ) { return ''; } // If transparent, then return 'transparent'. if ( is_string( $value ) && 'transparent' === trim( $value ) ) { return 'transparent'; } // Instantiate the object. $color = \ariColor::newColor( $value ); // Return a CSS value, using the auto-detected mode. return $color->toCSS( $color->mode ); } /** * DOES NOT SANITIZE ANYTHING. * * @static * @since 0.5 * @param int|string|array $value The value to be sanitized. * @return int|string|array */ public static function unfiltered( $value ) { return $value; } } kirki-packages/compatibility/src/Aliases.php000064400000016772147177211530015210 0ustar00 [ [ 'Kirki\Compatibility\Kirki', 'Kirki' ], [ 'Kirki\Compatibility\Config', 'Kirki_Config' ], [ 'Kirki\Compatibility\Control', 'Kirki_Control' ], [ 'Kirki\Compatibility\Field', 'Kirki_Field' ], [ 'Kirki\Util\Helper', 'Kirki_Helper' ], [ 'Kirki\Compatibility\Init', 'Kirki_Init' ], [ 'Kirki\L10n', 'Kirki_L10n' ], [ 'Kirki\Compatibility\Modules', 'Kirki_Modules' ], [ 'Kirki\Compatibility\Sanitize_Values', 'Kirki_Sanitize_Values' ], [ 'Kirki\Compatibility\Section', 'Kirki_Section' ], [ 'Kirki\Compatibility\Values', 'Kirki_Values' ], [ 'Kirki\Util\Util', 'Kirki_Util' ], [ 'Kirki\Compatibility\Framework', 'Kirki_Toolkit' ], [ 'Kirki\Module\CSS', 'Kirki_Modules_CSS' ], [ 'Kirki\Module\CSS\Output', 'Kirki_Output' ], [ 'Kirki\Module\CSS\Generator', 'Kirki_Modules_CSS_Generator' ], [ 'Kirki\Module\CSS\Property', 'Kirki_Output_Property' ], [ 'Kirki\Module\CSS\Property\Font_Family', 'Kirki_Output_Property_Font_Family' ], [ 'Kirki\Module\Preset', 'Kirki_Modules_Preset' ], [ 'Kirki\Module\Tooltips', 'Kirki_Modules_Tooltips' ], [ 'Kirki\Module\Webfonts', 'Kirki_Modules_Webfonts' ], [ 'Kirki\Module\Webfonts\Google', 'Kirki_Fonts_Google' ], [ 'Kirki\Module\Webfonts\Fonts', 'Kirki_Fonts' ], [ 'Kirki\Module\Webfonts\Embed', 'Kirki_Modules_Webfonts_Embed' ], [ 'Kirki\Module\Webfonts\Async', 'Kirki_Modules_Webfonts_Async' ], [ 'Kirki\Module\Field_Dependencies', 'Kirki_Modules_Field_Dependencies' ], [ 'Kirki\Module\Editor_Styles', 'Kirki_Modules_Gutenberg' ], [ 'Kirki\Module\Selective_Refresh', 'Kirki_Modules_Selective_Refresh' ], [ 'Kirki\Module\Postmessage', 'Kirki_Modules_Postmessage' ], [ 'Kirki\Field\Background', 'Kirki_Field_Background' ], [ 'Kirki\Field\CSS\Background', 'Kirki_Output_Field_Background' ], [ 'Kirki\Field\Checkbox', 'Kirki_Field_Checkbox' ], [ 'Kirki\Field\Checkbox_Switch', 'Kirki_Field_Switch' ], [ 'Kirki\Field\Checkbox_Switch', 'Kirki\Field\Switch' ], // Preventing typo. [ 'Kirki\Field\Checkbox_Toggle', 'Kirki_Field_Toggle' ], [ 'Kirki\Field\Checkbox_Toggle', 'Kirki\Field\Toggle' ], // Preventing typo. [ 'Kirki\Field\Code', 'Kirki_Field_Code' ], [ 'Kirki\Field\Color', 'Kirki_Field_Color' ], [ 'Kirki\Field\Color', 'Kirki_Field_Color_Alpha' ], [ 'Kirki\Field\Color_Palette', 'Kirki_Field_Color_Palette' ], [ 'Kirki\Field\Custom', 'Kirki_Field_Custom' ], [ 'Kirki\Field\Dashicons', 'Kirki_Field_Dashicons' ], [ 'Kirki\Field\Date', 'Kirki_Field_Date' ], [ 'Kirki\Field\Dimension', 'Kirki_Field_Dimension' ], [ 'Kirki\Field\Dimensions', 'Kirki_Field_Dimensions' ], [ 'Kirki\Field\CSS\Dimensions', 'Kirki_Output_Field_Dimensions' ], [ 'Kirki\Field\Dimensions', 'Kirki_Field_Spacing' ], [ 'Kirki\Field\Dimensions', 'Kirki\Field\Spacing' ], [ 'Kirki\Field\Editor', 'Kirki_Field_Editor' ], [ 'Kirki\Field\FontAwesome', 'Kirki_Field_FontAwesome' ], [ 'Kirki\Field\Generic', 'Kirki_Field_Kirki_Generic' ], [ 'Kirki\Field\Generic', 'Kirki_Field_Generic' ], [ 'Kirki\Field\Text', 'Kirki_Field_Text' ], [ 'Kirki\Field\Textarea', 'Kirki_Field_Textarea' ], [ 'Kirki\Field\URL', 'Kirki_Field_URL' ], [ 'Kirki\Field\URL', 'Kirki_Field_Link' ], [ 'Kirki\Field\URL', 'Kirki\Field\Link' ], [ 'Kirki\Field\Image', 'Kirki_Field_Image' ], [ 'Kirki\Field\CSS\Image', 'Kirki_Output_Field_Image' ], [ 'Kirki\Field\Multicheck', 'Kirki_Field_Multicheck' ], [ 'Kirki\Field\Multicolor', 'Kirki_Field_Multicolor' ], [ 'Kirki\Field\CSS\Multicolor', 'Kirki_Output_Field_Multicolor' ], [ 'Kirki\Field\Number', 'Kirki_Field_Number' ], [ 'Kirki\Field\Palette', 'Kirki_Field_Palette' ], [ 'Kirki\Field\Repeater', 'Kirki_Field_Repeater' ], [ 'Kirki\Field\Dropdown_Pages', 'Kirki_Field_Dropdown_Pages' ], [ 'Kirki\Field\Preset', 'Kirki_Field_Preset' ], [ 'Kirki\Field\Select', 'Kirki_Field_Select' ], [ 'Kirki\Field\Slider', 'Kirki_Field_Slider' ], [ 'Kirki\Field\Sortable', 'Kirki_Field_Sortable' ], [ 'Kirki\Field\Typography', 'Kirki_Field_Typography' ], [ 'Kirki\Field\CSS\Typography', 'Kirki_Output_Field_Typography' ], [ 'Kirki\Field\Upload', 'Kirki_Field_Upload' ], ], 'customizer' => [ [ 'Kirki\Control\Base', 'Kirki_Control_Base' ], [ 'Kirki\Control\Base', 'Kirki_Customize_Control' ], [ 'Kirki\Control\Checkbox', 'Kirki_Control_Checkbox' ], [ 'Kirki\Control\Checkbox_Switch', 'Kirki_Control_Switch' ], [ 'Kirki\Control\Checkbox_Toggle', 'Kirki_Control_Toggle' ], [ 'WP_Customize_Code_Editor_Control', 'Kirki_Control_Code' ], [ 'Kirki\Control\Color', 'Kirki_Control_Color' ], [ 'Kirki\Control\Color_Palette', 'Kirki_Control_Color_Palette' ], [ 'WP_Customize_Cropped_Image_Control', 'Kirki_Control_Cropped_Image' ], [ 'Kirki\Control\Custom', 'Kirki_Control_Custom' ], [ 'Kirki\Control\Dashicons', 'Kirki_Control_Dashicons' ], [ 'Kirki\Control\Date', 'Kirki_Control_Date' ], [ 'Kirki\Control\Dimension', 'Kirki_Control_Dimension' ], [ 'Kirki\Control\Editor', 'Kirki_Control_Editor' ], [ 'Kirki\Control\Generic', 'Kirki_Control_Generic' ], [ 'Kirki\Control\Image', 'Kirki_Control_Image' ], [ 'Kirki\Control\Multicheck', 'Kirki_Control_Multicheck' ], [ 'Kirki\Control\Generic', 'Kirki_Control_Number' ], [ 'Kirki\Control\Palette', 'Kirki_Control_Palette' ], [ 'Kirki\Control\Radio', 'Kirki_Control_Radio' ], [ 'Kirki\Control\Radio_Buttonset', 'Kirki_Control_Radio_Buttonset' ], [ 'Kirki\Control\Radio_Image', 'Kirki_Control_Radio_Image' ], [ 'Kirki\Control\Radio_Image', 'Kirki_Controls_Radio_Image_Control' ], [ 'Kirki\Control\Repeater', 'Kirki_Control_Repeater' ], [ 'Kirki\Control\Select', 'Kirki_Control_Select' ], [ 'Kirki\Control\Slider', 'Kirki_Control_Slider' ], [ 'Kirki\Control\Sortable', 'Kirki_Control_Sortable' ], [ 'Kirki\Control\Upload', 'Kirki_Control_Upload' ], [ 'Kirki\Settings\Repeater', 'Kirki\Settings\Repeater_Setting' ], [ 'Kirki\Settings\Repeater', 'Kirki_Settings_Repeater_Setting' ], [ 'WP_Customize_Section', 'Kirki_Sections_Default_Section' ], [ 'Kirki\Section_Types\Expanded', 'Kirki_Sections_Expanded_Section' ], [ 'Kirki\Section_Types\Nested', 'Kirki_Sections_Nested_Section' ], [ 'Kirki\Section_Types\Link', 'Kirki_Sections_Link_Section' ], [ 'Kirki\Panel_Types\Nested', 'Kirki_Panels_Nested_Panel' ], ], ]; /** * Constructor. * * @access public * @since 0.1 */ public function __construct() { $this->add_aliases(); add_action( 'customize_register', [ $this, 'add_customizer_aliases' ] ); } /** * Adds object aliases. * * @access public * @since 0.1 * @return void */ public function add_aliases() { foreach ( $this->aliases['generic'] as $item ) { if ( class_exists( $item[0] ) ) { class_alias( $item[0], $item[1] ); } } } /** * Adds object aliases for classes that get instantiated on customize_register. * * @access public * @since 0.1 * @return void */ public function add_customizer_aliases() { foreach ( $this->aliases['customizer'] as $item ) { if ( class_exists( $item[0] ) ) { class_alias( $item[0], $item[1] ); } } } } kirki-packages/compatibility/src/Control.php000064400000006002147177211530015230 0ustar00wp_customize = $wp_customize; // Set the control types. $this->set_control_types(); // Add the control. $this->add_control( $args ); } /** * Get the class name of the class needed to create tis control. * * @access private * @param array $args The field definition as sanitized in Kirki\Field. * * @return string the name of the class that will be used to create this control. */ final function get_control_class_name( $args ) { // Set a default class name. $class_name = 'WP_Customize_Control'; // Get the classname from the array of control classnames. if ( array_key_exists( $args['type'], self::$control_types ) ) { $class_name = self::$control_types[ $args['type'] ]; } return $class_name; } /** * Adds the control. * * @access protected * @param array $args The field definition as sanitized in Kirki\Field. */ final protected function add_control( $args ) { // Get the name of the class we're going to use. $class_name = $this->get_control_class_name( $args ); /** * Allow filtering the arguments. * * @since 0.1 * @param array $args The arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array Return the arguments. */ $args = apply_filters( 'kirki_field_add_control_args', $args, $this->wp_customize ); // Add the control. $this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) ); } /** * Sets the $control_types property. * Makes sure the kirki_control_types filter is applied * and that the defined classes actually exist. * If a defined class does not exist, it is removed. * * @access private */ final function set_control_types() { // Early exit if this has already run. if ( ! empty( self::$control_types ) ) { return; } self::$control_types = apply_filters( 'kirki_control_types', [] ); // Make sure the defined classes actually exist. foreach ( self::$control_types as $key => $classname ) { if ( ! class_exists( $classname ) ) { unset( self::$control_types[ $key ] ); } } } } kirki-packages/field-fontawesome/LICENSE000064400000002060147177211530014054 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/field-fontawesome/src/Field/fontawesome.json000064400000372350147177211530020117 0ustar00{ "icons": [ { "name": "Glass", "id": "glass", "unicode": "f000", "created": 1, "filter": [ "martini", "drink", "bar", "alcohol", "liquor" ], "categories": [ "Web Application Icons" ] }, { "name": "Music", "id": "music", "unicode": "f001", "created": 1, "filter": [ "note", "sound" ], "categories": [ "Web Application Icons" ] }, { "name": "Search", "id": "search", "unicode": "f002", "created": 1, "filter": [ "magnify", "zoom", "enlarge", "bigger" ], "categories": [ "Web Application Icons" ] }, { "name": "Envelope Outlined", "id": "envelope-o", "unicode": "f003", "created": 1, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Heart", "id": "heart", "unicode": "f004", "created": 1, "filter": [ "love", "like", "favorite" ], "categories": [ "Web Application Icons", "Medical Icons" ] }, { "name": "Star", "id": "star", "unicode": "f005", "created": 1, "filter": [ "award", "achievement", "night", "rating", "score", "favorite" ], "categories": [ "Web Application Icons" ] }, { "name": "Star Outlined", "id": "star-o", "unicode": "f006", "created": 1, "filter": [ "award", "achievement", "night", "rating", "score", "favorite" ], "categories": [ "Web Application Icons" ] }, { "name": "User", "id": "user", "unicode": "f007", "created": 1, "filter": [ "person", "man", "head", "profile" ], "categories": [ "Web Application Icons" ] }, { "name": "Film", "id": "film", "unicode": "f008", "created": 1, "filter": [ "movie" ], "categories": [ "Web Application Icons" ] }, { "name": "th-large", "id": "th-large", "unicode": "f009", "created": 1, "filter": [ "blocks", "squares", "boxes", "grid" ], "categories": [ "Text Editor Icons" ] }, { "name": "th", "id": "th", "unicode": "f00a", "created": 1, "filter": [ "blocks", "squares", "boxes", "grid" ], "categories": [ "Text Editor Icons" ] }, { "name": "th-list", "id": "th-list", "unicode": "f00b", "created": 1, "filter": [ "ul", "ol", "checklist", "finished", "completed", "done", "todo" ], "categories": [ "Text Editor Icons" ] }, { "name": "Check", "id": "check", "unicode": "f00c", "created": 1, "filter": [ "checkmark", "done", "todo", "agree", "accept", "confirm", "tick", "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "Times", "id": "times", "unicode": "f00d", "created": 1, "aliases": [ "remove", "close" ], "filter": [ "close", "exit", "x", "cross" ], "categories": [ "Web Application Icons" ] }, { "name": "Search Plus", "id": "search-plus", "unicode": "f00e", "created": 1, "filter": [ "magnify", "zoom", "enlarge", "bigger" ], "categories": [ "Web Application Icons" ] }, { "name": "Search Minus", "id": "search-minus", "unicode": "f010", "created": 1, "filter": [ "magnify", "minify", "zoom", "smaller" ], "categories": [ "Web Application Icons" ] }, { "name": "Power Off", "id": "power-off", "unicode": "f011", "created": 1, "filter": [ "on" ], "categories": [ "Web Application Icons" ] }, { "name": "signal", "id": "signal", "unicode": "f012", "created": 1, "filter": [ "graph", "bars" ], "categories": [ "Web Application Icons" ] }, { "name": "cog", "id": "cog", "unicode": "f013", "created": 1, "filter": [ "settings" ], "aliases": [ "gear" ], "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "Trash Outlined", "id": "trash-o", "unicode": "f014", "created": 1, "filter": [ "garbage", "delete", "remove", "trash", "hide" ], "categories": [ "Web Application Icons" ] }, { "name": "home", "id": "home", "unicode": "f015", "created": 1, "filter": [ "main", "house" ], "categories": [ "Web Application Icons" ] }, { "name": "File Outlined", "id": "file-o", "unicode": "f016", "created": 1, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "Clock Outlined", "id": "clock-o", "unicode": "f017", "created": 1, "filter": [ "watch", "timer", "late", "timestamp" ], "categories": [ "Web Application Icons" ] }, { "name": "road", "id": "road", "unicode": "f018", "created": 1, "filter": [ "street" ], "categories": [ "Web Application Icons" ] }, { "name": "Download", "id": "download", "unicode": "f019", "created": 1, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "Arrow Circle Outlined Down", "id": "arrow-circle-o-down", "unicode": "f01a", "created": 1, "filter": [ "download" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Outlined Up", "id": "arrow-circle-o-up", "unicode": "f01b", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "inbox", "id": "inbox", "unicode": "f01c", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Play Circle Outlined", "id": "play-circle-o", "unicode": "f01d", "created": 1, "categories": [ "Video Player Icons" ] }, { "name": "Repeat", "id": "repeat", "unicode": "f01e", "created": 1, "filter": [ "redo", "forward" ], "aliases": [ "rotate-right" ], "categories": [ "Text Editor Icons" ] }, { "name": "refresh", "id": "refresh", "unicode": "f021", "created": 1, "filter": [ "reload", "sync" ], "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "list-alt", "id": "list-alt", "unicode": "f022", "created": 1, "filter": [ "ul", "ol", "checklist", "finished", "completed", "done", "todo" ], "categories": [ "Text Editor Icons" ] }, { "name": "lock", "id": "lock", "unicode": "f023", "created": 1, "filter": [ "protect", "admin", "security" ], "categories": [ "Web Application Icons" ] }, { "name": "flag", "id": "flag", "unicode": "f024", "created": 1, "filter": [ "report", "notification", "notify" ], "categories": [ "Web Application Icons" ] }, { "name": "headphones", "id": "headphones", "unicode": "f025", "created": 1, "filter": [ "sound", "listen", "music", "audio" ], "categories": [ "Web Application Icons" ] }, { "name": "volume-off", "id": "volume-off", "unicode": "f026", "created": 1, "filter": [ "audio", "mute", "sound", "music" ], "categories": [ "Web Application Icons" ] }, { "name": "volume-down", "id": "volume-down", "unicode": "f027", "created": 1, "filter": [ "audio", "lower", "quieter", "sound", "music" ], "categories": [ "Web Application Icons" ] }, { "name": "volume-up", "id": "volume-up", "unicode": "f028", "created": 1, "filter": [ "audio", "higher", "louder", "sound", "music" ], "categories": [ "Web Application Icons" ] }, { "name": "qrcode", "id": "qrcode", "unicode": "f029", "created": 1, "filter": [ "scan" ], "categories": [ "Web Application Icons" ] }, { "name": "barcode", "id": "barcode", "unicode": "f02a", "created": 1, "filter": [ "scan" ], "categories": [ "Web Application Icons" ] }, { "name": "tag", "id": "tag", "unicode": "f02b", "created": 1, "filter": [ "label" ], "categories": [ "Web Application Icons" ] }, { "name": "tags", "id": "tags", "unicode": "f02c", "created": 1, "filter": [ "labels" ], "categories": [ "Web Application Icons" ] }, { "name": "book", "id": "book", "unicode": "f02d", "created": 1, "filter": [ "read", "documentation" ], "categories": [ "Web Application Icons" ] }, { "name": "bookmark", "id": "bookmark", "unicode": "f02e", "created": 1, "filter": [ "save" ], "categories": [ "Web Application Icons" ] }, { "name": "print", "id": "print", "unicode": "f02f", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "camera", "id": "camera", "unicode": "f030", "created": 1, "filter": [ "photo", "picture", "record" ], "categories": [ "Web Application Icons" ] }, { "name": "font", "id": "font", "unicode": "f031", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "bold", "id": "bold", "unicode": "f032", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "italic", "id": "italic", "unicode": "f033", "created": 1, "filter": [ "italics" ], "categories": [ "Text Editor Icons" ] }, { "name": "text-height", "id": "text-height", "unicode": "f034", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "text-width", "id": "text-width", "unicode": "f035", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "align-left", "id": "align-left", "unicode": "f036", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "align-center", "id": "align-center", "unicode": "f037", "created": 1, "filter": [ "middle", "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "align-right", "id": "align-right", "unicode": "f038", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "align-justify", "id": "align-justify", "unicode": "f039", "created": 1, "filter": [ "text" ], "categories": [ "Text Editor Icons" ] }, { "name": "list", "id": "list", "unicode": "f03a", "created": 1, "filter": [ "ul", "ol", "checklist", "finished", "completed", "done", "todo" ], "categories": [ "Text Editor Icons" ] }, { "name": "Outdent", "id": "outdent", "unicode": "f03b", "created": 1, "aliases": [ "dedent" ], "categories": [ "Text Editor Icons" ] }, { "name": "Indent", "id": "indent", "unicode": "f03c", "created": 1, "categories": [ "Text Editor Icons" ] }, { "name": "Video Camera", "id": "video-camera", "unicode": "f03d", "created": 1, "filter": [ "film", "movie", "record" ], "categories": [ "Web Application Icons" ] }, { "name": "Picture Outlined", "id": "picture-o", "unicode": "f03e", "created": 1, "aliases": [ "photo", "image" ], "categories": [ "Web Application Icons" ] }, { "name": "pencil", "id": "pencil", "unicode": "f040", "created": 1, "filter": [ "write", "edit", "update" ], "categories": [ "Web Application Icons" ] }, { "name": "map-marker", "id": "map-marker", "unicode": "f041", "created": 1, "filter": [ "map", "pin", "location", "coordinates", "localize", "address", "travel", "where", "place" ], "categories": [ "Web Application Icons" ] }, { "name": "adjust", "id": "adjust", "unicode": "f042", "created": 1, "filter": [ "contrast" ], "categories": [ "Web Application Icons" ] }, { "name": "tint", "id": "tint", "unicode": "f043", "created": 1, "filter": [ "raindrop", "waterdrop", "drop", "droplet" ], "categories": [ "Web Application Icons" ] }, { "name": "Pencil Square Outlined", "id": "pencil-square-o", "unicode": "f044", "created": 1, "filter": [ "write", "edit", "update" ], "aliases": [ "edit" ], "categories": [ "Web Application Icons" ] }, { "name": "Share Square Outlined", "id": "share-square-o", "unicode": "f045", "created": 1, "filter": [ "social", "send", "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Square Outlined", "id": "check-square-o", "unicode": "f046", "created": 1, "filter": [ "todo", "done", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Arrows", "id": "arrows", "unicode": "f047", "created": 1, "filter": [ "move", "reorder", "resize" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "step-backward", "id": "step-backward", "unicode": "f048", "created": 1, "filter": [ "rewind", "previous", "beginning", "start", "first" ], "categories": [ "Video Player Icons" ] }, { "name": "fast-backward", "id": "fast-backward", "unicode": "f049", "created": 1, "filter": [ "rewind", "previous", "beginning", "start", "first" ], "categories": [ "Video Player Icons" ] }, { "name": "backward", "id": "backward", "unicode": "f04a", "created": 1, "filter": [ "rewind", "previous" ], "categories": [ "Video Player Icons" ] }, { "name": "play", "id": "play", "unicode": "f04b", "created": 1, "filter": [ "start", "playing", "music", "sound" ], "categories": [ "Video Player Icons" ] }, { "name": "pause", "id": "pause", "unicode": "f04c", "created": 1, "filter": [ "wait" ], "categories": [ "Video Player Icons" ] }, { "name": "stop", "id": "stop", "unicode": "f04d", "created": 1, "filter": [ "block", "box", "square" ], "categories": [ "Video Player Icons" ] }, { "name": "forward", "id": "forward", "unicode": "f04e", "created": 1, "filter": [ "forward", "next" ], "categories": [ "Video Player Icons" ] }, { "name": "fast-forward", "id": "fast-forward", "unicode": "f050", "created": 1, "filter": [ "next", "end", "last" ], "categories": [ "Video Player Icons" ] }, { "name": "step-forward", "id": "step-forward", "unicode": "f051", "created": 1, "filter": [ "next", "end", "last" ], "categories": [ "Video Player Icons" ] }, { "name": "eject", "id": "eject", "unicode": "f052", "created": 1, "categories": [ "Video Player Icons" ] }, { "name": "chevron-left", "id": "chevron-left", "unicode": "f053", "created": 1, "filter": [ "bracket", "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "chevron-right", "id": "chevron-right", "unicode": "f054", "created": 1, "filter": [ "bracket", "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "Plus Circle", "id": "plus-circle", "unicode": "f055", "created": 1, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Web Application Icons" ] }, { "name": "Minus Circle", "id": "minus-circle", "unicode": "f056", "created": 1, "filter": [ "delete", "remove", "trash", "hide" ], "categories": [ "Web Application Icons" ] }, { "name": "Times Circle", "id": "times-circle", "unicode": "f057", "created": 1, "filter": [ "close", "exit", "x" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Circle", "id": "check-circle", "unicode": "f058", "created": 1, "filter": [ "todo", "done", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "Question Circle", "id": "question-circle", "unicode": "f059", "filter": [ "help", "information", "unknown", "support" ], "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Info Circle", "id": "info-circle", "unicode": "f05a", "created": 1, "filter": [ "help", "information", "more", "details" ], "categories": [ "Web Application Icons" ] }, { "name": "Crosshairs", "id": "crosshairs", "unicode": "f05b", "created": 1, "filter": [ "picker" ], "categories": [ "Web Application Icons" ] }, { "name": "Times Circle Outlined", "id": "times-circle-o", "unicode": "f05c", "created": 1, "filter": [ "close", "exit", "x" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Circle Outlined", "id": "check-circle-o", "unicode": "f05d", "created": 1, "filter": [ "todo", "done", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "ban", "id": "ban", "unicode": "f05e", "created": 1, "filter": [ "delete", "remove", "trash", "hide", "block", "stop", "abort", "cancel" ], "categories": [ "Web Application Icons" ] }, { "name": "arrow-left", "id": "arrow-left", "unicode": "f060", "created": 1, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "arrow-right", "id": "arrow-right", "unicode": "f061", "created": 1, "filter": [ "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "arrow-up", "id": "arrow-up", "unicode": "f062", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "arrow-down", "id": "arrow-down", "unicode": "f063", "created": 1, "filter": [ "download" ], "categories": [ "Directional Icons" ] }, { "name": "Share", "id": "share", "unicode": "f064", "created": 1, "aliases": [ "mail-forward" ], "categories": [ "Web Application Icons" ] }, { "name": "Expand", "id": "expand", "unicode": "f065", "created": 1, "filter": [ "enlarge", "bigger", "resize" ], "categories": [ "Video Player Icons" ] }, { "name": "Compress", "id": "compress", "unicode": "f066", "created": 1, "filter": [ "collapse", "combine", "contract", "merge", "smaller" ], "categories": [ "Video Player Icons" ] }, { "name": "plus", "id": "plus", "unicode": "f067", "created": 1, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Web Application Icons" ] }, { "name": "minus", "id": "minus", "unicode": "f068", "created": 1, "filter": [ "hide", "minify", "delete", "remove", "trash", "hide", "collapse" ], "categories": [ "Web Application Icons" ] }, { "name": "asterisk", "id": "asterisk", "unicode": "f069", "created": 1, "filter": [ "details" ], "categories": [ "Web Application Icons" ] }, { "name": "Exclamation Circle", "id": "exclamation-circle", "unicode": "f06a", "created": 1, "filter": [ "warning", "error", "problem", "notification", "alert" ], "categories": [ "Web Application Icons" ] }, { "name": "gift", "id": "gift", "unicode": "f06b", "created": 1, "filter": [ "present" ], "categories": [ "Web Application Icons" ] }, { "name": "leaf", "id": "leaf", "unicode": "f06c", "created": 1, "filter": [ "eco", "nature", "plant" ], "categories": [ "Web Application Icons" ] }, { "name": "fire", "id": "fire", "unicode": "f06d", "created": 1, "filter": [ "flame", "hot", "popular" ], "categories": [ "Web Application Icons" ] }, { "name": "Eye", "id": "eye", "unicode": "f06e", "created": 1, "filter": [ "show", "visible", "views" ], "categories": [ "Web Application Icons" ] }, { "name": "Eye Slash", "id": "eye-slash", "unicode": "f070", "created": 1, "filter": [ "toggle", "show", "hide", "visible", "visiblity", "views" ], "categories": [ "Web Application Icons" ] }, { "name": "Exclamation Triangle", "id": "exclamation-triangle", "unicode": "f071", "created": 1, "filter": [ "warning", "error", "problem", "notification", "alert" ], "aliases": [ "warning" ], "categories": [ "Web Application Icons" ] }, { "name": "plane", "id": "plane", "unicode": "f072", "created": 1, "filter": [ "travel", "trip", "location", "destination", "airplane", "fly", "mode" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "calendar", "id": "calendar", "unicode": "f073", "created": 1, "filter": [ "date", "time", "when", "event" ], "categories": [ "Web Application Icons" ] }, { "name": "random", "id": "random", "unicode": "f074", "created": 1, "filter": [ "sort", "shuffle" ], "categories": [ "Web Application Icons", "Video Player Icons" ] }, { "name": "comment", "id": "comment", "unicode": "f075", "created": 1, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "magnet", "id": "magnet", "unicode": "f076", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "chevron-up", "id": "chevron-up", "unicode": "f077", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "chevron-down", "id": "chevron-down", "unicode": "f078", "created": 1, "categories": [ "Directional Icons" ] }, { "name": "retweet", "id": "retweet", "unicode": "f079", "created": 1, "filter": [ "refresh", "reload", "share" ], "categories": [ "Web Application Icons" ] }, { "name": "shopping-cart", "id": "shopping-cart", "unicode": "f07a", "created": 1, "filter": [ "checkout", "buy", "purchase", "payment" ], "categories": [ "Web Application Icons" ] }, { "name": "Folder", "id": "folder", "unicode": "f07b", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Folder Open", "id": "folder-open", "unicode": "f07c", "created": 1, "categories": [ "Web Application Icons" ] }, { "name": "Arrows Vertical", "id": "arrows-v", "unicode": "f07d", "created": 1, "filter": [ "resize" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Arrows Horizontal", "id": "arrows-h", "unicode": "f07e", "created": 1, "filter": [ "resize" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Bar Chart", "id": "bar-chart", "unicode": "f080", "created": 1, "aliases": [ "bar-chart-o" ], "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "Twitter Square", "id": "twitter-square", "unicode": "f081", "created": 1, "filter": [ "tweet", "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Facebook Square", "id": "facebook-square", "unicode": "f082", "created": 1, "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "camera-retro", "id": "camera-retro", "unicode": "f083", "created": 1, "filter": [ "photo", "picture", "record" ], "categories": [ "Web Application Icons" ] }, { "name": "key", "id": "key", "unicode": "f084", "created": 1, "filter": [ "unlock", "password" ], "categories": [ "Web Application Icons" ] }, { "name": "cogs", "id": "cogs", "unicode": "f085", "created": 1, "aliases": [ "gears" ], "filter": [ "settings" ], "categories": [ "Web Application Icons" ] }, { "name": "comments", "id": "comments", "unicode": "f086", "created": 1, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Thumbs Up Outlined", "id": "thumbs-o-up", "unicode": "f087", "created": 1, "filter": [ "like", "approve", "favorite", "agree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Thumbs Down Outlined", "id": "thumbs-o-down", "unicode": "f088", "created": 1, "filter": [ "dislike", "disapprove", "disagree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "star-half", "id": "star-half", "unicode": "f089", "created": 1, "filter": [ "award", "achievement", "rating", "score" ], "categories": [ "Web Application Icons" ] }, { "name": "Heart Outlined", "id": "heart-o", "unicode": "f08a", "created": 1, "filter": [ "love", "like", "favorite" ], "categories": [ "Web Application Icons", "Medical Icons" ] }, { "name": "Sign Out", "id": "sign-out", "unicode": "f08b", "created": 1, "filter": [ "log out", "logout", "leave", "exit", "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "LinkedIn Square", "id": "linkedin-square", "unicode": "f08c", "created": 1, "categories": [ "Brand Icons" ] }, { "name": "Thumb Tack", "id": "thumb-tack", "unicode": "f08d", "created": 1, "filter": [ "marker", "pin", "location", "coordinates" ], "categories": [ "Web Application Icons" ] }, { "name": "External Link", "id": "external-link", "unicode": "f08e", "created": 1, "filter": [ "open", "new" ], "categories": [ "Web Application Icons" ] }, { "name": "Sign In", "id": "sign-in", "unicode": "f090", "created": 1, "filter": [ "enter", "join", "log in", "login", "sign up", "sign in", "signin", "signup", "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "trophy", "id": "trophy", "unicode": "f091", "created": 1, "filter": [ "award", "achievement", "cup", "winner", "game" ], "categories": [ "Web Application Icons" ] }, { "name": "GitHub Square", "id": "github-square", "unicode": "f092", "created": 1, "url": "github.com/logos", "filter": [ "octocat" ], "categories": [ "Brand Icons" ] }, { "name": "Upload", "id": "upload", "unicode": "f093", "created": 1, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "Lemon Outlined", "id": "lemon-o", "unicode": "f094", "created": 1, "filter": [ "food" ], "categories": [ "Web Application Icons" ] }, { "name": "Phone", "id": "phone", "unicode": "f095", "created": 2, "filter": [ "call", "voice", "number", "support", "earphone", "telephone" ], "categories": [ "Web Application Icons" ] }, { "name": "Square Outlined", "id": "square-o", "unicode": "f096", "created": 2, "filter": [ "block", "square", "box" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Bookmark Outlined", "id": "bookmark-o", "unicode": "f097", "created": 2, "filter": [ "save" ], "categories": [ "Web Application Icons" ] }, { "name": "Phone Square", "id": "phone-square", "unicode": "f098", "created": 2, "filter": [ "call", "voice", "number", "support", "telephone" ], "categories": [ "Web Application Icons" ] }, { "name": "Twitter", "id": "twitter", "unicode": "f099", "created": 2, "filter": [ "tweet", "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Facebook", "id": "facebook", "unicode": "f09a", "created": 2, "aliases": [ "facebook-f" ], "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "GitHub", "id": "github", "unicode": "f09b", "created": 2, "url": "github.com/logos", "filter": [ "octocat" ], "categories": [ "Brand Icons" ] }, { "name": "unlock", "id": "unlock", "unicode": "f09c", "created": 2, "filter": [ "protect", "admin", "password", "lock" ], "categories": [ "Web Application Icons" ] }, { "name": "credit-card", "id": "credit-card", "unicode": "f09d", "created": 2, "filter": [ "money", "buy", "debit", "checkout", "purchase", "payment" ], "categories": [ "Web Application Icons", "Payment Icons" ] }, { "name": "rss", "id": "rss", "unicode": "f09e", "created": 2, "filter": [ "blog" ], "aliases": [ "feed" ], "categories": [ "Web Application Icons" ] }, { "name": "HDD", "id": "hdd-o", "unicode": "f0a0", "created": 2, "filter": [ "harddrive", "hard drive", "storage", "save" ], "categories": [ "Web Application Icons" ] }, { "name": "bullhorn", "id": "bullhorn", "unicode": "f0a1", "created": 2, "filter": [ "announcement", "share", "broadcast", "louder", "megaphone" ], "categories": [ "Web Application Icons" ] }, { "name": "bell", "id": "bell", "unicode": "f0f3", "created": 2, "filter": [ "alert", "reminder", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "certificate", "id": "certificate", "unicode": "f0a3", "created": 2, "filter": [ "badge", "star" ], "categories": [ "Web Application Icons" ] }, { "name": "Hand Outlined Right", "id": "hand-o-right", "unicode": "f0a4", "created": 2, "filter": [ "point", "right", "next", "forward", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Hand Outlined Left", "id": "hand-o-left", "unicode": "f0a5", "created": 2, "filter": [ "point", "left", "previous", "back", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Hand Outlined Up", "id": "hand-o-up", "unicode": "f0a6", "created": 2, "filter": [ "point", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Hand Outlined Down", "id": "hand-o-down", "unicode": "f0a7", "created": 2, "filter": [ "point", "finger" ], "categories": [ "Directional Icons", "Hand Icons" ] }, { "name": "Arrow Circle Left", "id": "arrow-circle-left", "unicode": "f0a8", "created": 2, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Right", "id": "arrow-circle-right", "unicode": "f0a9", "created": 2, "filter": [ "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Up", "id": "arrow-circle-up", "unicode": "f0aa", "created": 2, "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Down", "id": "arrow-circle-down", "unicode": "f0ab", "created": 2, "filter": [ "download" ], "categories": [ "Directional Icons" ] }, { "name": "Globe", "id": "globe", "unicode": "f0ac", "created": 2, "filter": [ "world", "planet", "map", "place", "travel", "earth", "global", "translate", "all", "language", "localize", "location", "coordinates", "country" ], "categories": [ "Web Application Icons" ] }, { "name": "Wrench", "id": "wrench", "unicode": "f0ad", "created": 2, "filter": [ "settings", "fix", "update", "spanner" ], "categories": [ "Web Application Icons" ] }, { "name": "Tasks", "id": "tasks", "unicode": "f0ae", "created": 2, "filter": [ "progress", "loading", "downloading", "downloads", "settings" ], "categories": [ "Web Application Icons" ] }, { "name": "Filter", "id": "filter", "unicode": "f0b0", "created": 2, "filter": [ "funnel", "options" ], "categories": [ "Web Application Icons" ] }, { "name": "Briefcase", "id": "briefcase", "unicode": "f0b1", "created": 2, "filter": [ "work", "business", "office", "luggage", "bag" ], "categories": [ "Web Application Icons" ] }, { "name": "Arrows Alt", "id": "arrows-alt", "unicode": "f0b2", "created": 2, "filter": [ "expand", "enlarge", "fullscreen", "bigger", "move", "reorder", "resize", "arrow" ], "categories": [ "Video Player Icons", "Directional Icons" ] }, { "name": "Users", "id": "users", "unicode": "f0c0", "created": 2, "filter": [ "people", "profiles", "persons" ], "aliases": [ "group" ], "categories": [ "Web Application Icons" ] }, { "name": "Link", "id": "link", "unicode": "f0c1", "created": 2, "filter": [ "chain" ], "aliases": [ "chain" ], "categories": [ "Text Editor Icons" ] }, { "name": "Cloud", "id": "cloud", "filter": [ "save" ], "unicode": "f0c2", "created": 2, "categories": [ "Web Application Icons" ] }, { "name": "Flask", "id": "flask", "unicode": "f0c3", "created": 2, "filter": [ "science", "beaker", "experimental", "labs" ], "categories": [ "Web Application Icons" ] }, { "name": "Scissors", "id": "scissors", "unicode": "f0c4", "created": 2, "aliases": [ "cut" ], "categories": [ "Text Editor Icons" ] }, { "name": "Files Outlined", "id": "files-o", "unicode": "f0c5", "created": 2, "filter": [ "duplicate", "clone", "copy" ], "aliases": [ "copy" ], "categories": [ "Text Editor Icons" ] }, { "name": "Paperclip", "id": "paperclip", "unicode": "f0c6", "created": 2, "filter": [ "attachment" ], "categories": [ "Text Editor Icons" ] }, { "name": "Floppy Outlined", "id": "floppy-o", "unicode": "f0c7", "created": 2, "aliases": [ "save" ], "categories": [ "Text Editor Icons" ] }, { "name": "Square", "id": "square", "unicode": "f0c8", "created": 2, "filter": [ "block", "box" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Bars", "id": "bars", "unicode": "f0c9", "created": 2, "aliases": [ "navicon", "reorder" ], "filter": [ "menu", "drag", "reorder", "settings", "list", "ul", "ol", "checklist", "todo", "list", "hamburger" ], "categories": [ "Web Application Icons" ] }, { "name": "list-ul", "id": "list-ul", "unicode": "f0ca", "created": 2, "filter": [ "ul", "ol", "checklist", "todo", "list" ], "categories": [ "Text Editor Icons" ] }, { "name": "list-ol", "id": "list-ol", "unicode": "f0cb", "created": 2, "filter": [ "ul", "ol", "checklist", "list", "todo", "list", "numbers" ], "categories": [ "Text Editor Icons" ] }, { "name": "Strikethrough", "id": "strikethrough", "unicode": "f0cc", "created": 2, "categories": [ "Text Editor Icons" ] }, { "name": "Underline", "id": "underline", "unicode": "f0cd", "created": 2, "categories": [ "Text Editor Icons" ] }, { "name": "table", "id": "table", "unicode": "f0ce", "created": 2, "filter": [ "data", "excel", "spreadsheet" ], "categories": [ "Text Editor Icons" ] }, { "name": "magic", "id": "magic", "unicode": "f0d0", "created": 2, "filter": [ "wizard", "automatic", "autocomplete" ], "categories": [ "Web Application Icons" ] }, { "name": "truck", "id": "truck", "unicode": "f0d1", "created": 2, "filter": [ "shipping" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Pinterest", "id": "pinterest", "unicode": "f0d2", "created": 2, "categories": [ "Brand Icons" ] }, { "name": "Pinterest Square", "id": "pinterest-square", "unicode": "f0d3", "created": 2, "categories": [ "Brand Icons" ] }, { "name": "Google Plus Square", "id": "google-plus-square", "unicode": "f0d4", "created": 2, "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Google Plus", "id": "google-plus", "unicode": "f0d5", "created": 2, "filter": [ "social network" ], "categories": [ "Brand Icons" ] }, { "name": "Money", "id": "money", "unicode": "f0d6", "created": 2, "filter": [ "cash", "money", "buy", "checkout", "purchase", "payment" ], "categories": [ "Web Application Icons", "Currency Icons" ] }, { "name": "Caret Down", "id": "caret-down", "unicode": "f0d7", "created": 2, "filter": [ "more", "dropdown", "menu", "triangle down", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Up", "id": "caret-up", "unicode": "f0d8", "created": 2, "filter": [ "triangle up", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Left", "id": "caret-left", "unicode": "f0d9", "created": 2, "filter": [ "previous", "back", "triangle left", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Right", "id": "caret-right", "unicode": "f0da", "created": 2, "filter": [ "next", "forward", "triangle right", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Columns", "id": "columns", "unicode": "f0db", "created": 2, "filter": [ "split", "panes" ], "categories": [ "Text Editor Icons" ] }, { "name": "Sort", "id": "sort", "unicode": "f0dc", "created": 2, "filter": [ "order" ], "aliases": [ "unsorted" ], "categories": [ "Web Application Icons" ] }, { "name": "Sort Descending", "id": "sort-desc", "unicode": "f0dd", "created": 2, "filter": [ "dropdown", "more", "menu", "arrow" ], "aliases": [ "sort-down" ], "categories": [ "Web Application Icons" ] }, { "name": "Sort Ascending", "id": "sort-asc", "unicode": "f0de", "created": 2, "aliases": [ "sort-up" ], "filter": [ "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Envelope", "id": "envelope", "unicode": "f0e0", "created": 2, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "LinkedIn", "id": "linkedin", "unicode": "f0e1", "created": 2, "categories": [ "Brand Icons" ] }, { "name": "Undo", "id": "undo", "unicode": "f0e2", "created": 2, "filter": [ "back" ], "aliases": [ "rotate-left" ], "categories": [ "Text Editor Icons" ] }, { "name": "Gavel", "id": "gavel", "unicode": "f0e3", "created": 2, "filter": [ "judge", "lawyer", "opinion" ], "aliases": [ "legal" ], "categories": [ "Web Application Icons" ] }, { "name": "Tachometer", "id": "tachometer", "unicode": "f0e4", "created": 2, "filter": [ "speedometer", "fast" ], "aliases": [ "dashboard" ], "categories": [ "Web Application Icons" ] }, { "name": "comment-o", "id": "comment-o", "unicode": "f0e5", "created": 2, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "comments-o", "id": "comments-o", "unicode": "f0e6", "created": 2, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Lightning Bolt", "id": "bolt", "unicode": "f0e7", "created": 2, "filter": [ "lightning", "weather" ], "aliases": [ "flash" ], "categories": [ "Web Application Icons" ] }, { "name": "Sitemap", "id": "sitemap", "unicode": "f0e8", "created": 2, "filter": [ "directory", "hierarchy", "organization" ], "categories": [ "Web Application Icons" ] }, { "name": "Umbrella", "id": "umbrella", "unicode": "f0e9", "created": 2, "categories": [ "Web Application Icons" ] }, { "name": "Clipboard", "id": "clipboard", "unicode": "f0ea", "created": 2, "filter": [ "copy" ], "aliases": [ "paste" ], "categories": [ "Text Editor Icons" ] }, { "name": "Lightbulb Outlined", "id": "lightbulb-o", "unicode": "f0eb", "created": 3, "filter": [ "idea", "inspiration" ], "categories": [ "Web Application Icons" ] }, { "name": "Exchange", "id": "exchange", "unicode": "f0ec", "created": 3, "filter": [ "transfer", "arrows", "arrow" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Cloud Download", "id": "cloud-download", "unicode": "f0ed", "created": 3, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "Cloud Upload", "id": "cloud-upload", "unicode": "f0ee", "created": 3, "filter": [ "import" ], "categories": [ "Web Application Icons" ] }, { "name": "user-md", "id": "user-md", "unicode": "f0f0", "created": 2, "filter": [ "doctor", "profile", "medical", "nurse" ], "categories": [ "Medical Icons" ] }, { "name": "Stethoscope", "id": "stethoscope", "unicode": "f0f1", "created": 3, "categories": [ "Medical Icons" ] }, { "name": "Suitcase", "id": "suitcase", "unicode": "f0f2", "created": 3, "filter": [ "trip", "luggage", "travel", "move", "baggage" ], "categories": [ "Web Application Icons" ] }, { "name": "Bell Outlined", "id": "bell-o", "unicode": "f0a2", "created": 3, "filter": [ "alert", "reminder", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Coffee", "id": "coffee", "unicode": "f0f4", "created": 3, "filter": [ "morning", "mug", "breakfast", "tea", "drink", "cafe" ], "categories": [ "Web Application Icons" ] }, { "name": "Cutlery", "id": "cutlery", "unicode": "f0f5", "created": 3, "filter": [ "food", "restaurant", "spoon", "knife", "dinner", "eat" ], "categories": [ "Web Application Icons" ] }, { "name": "File Text Outlined", "id": "file-text-o", "unicode": "f0f6", "created": 3, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "Building Outlined", "id": "building-o", "unicode": "f0f7", "created": 3, "filter": [ "work", "business", "apartment", "office", "company" ], "categories": [ "Web Application Icons" ] }, { "name": "hospital Outlined", "id": "hospital-o", "unicode": "f0f8", "created": 3, "filter": [ "building" ], "categories": [ "Medical Icons" ] }, { "name": "ambulance", "id": "ambulance", "unicode": "f0f9", "created": 3, "filter": [ "vehicle", "support", "help" ], "categories": [ "Medical Icons", "Transportation Icons" ] }, { "name": "medkit", "id": "medkit", "unicode": "f0fa", "created": 3, "filter": [ "first aid", "firstaid", "help", "support", "health" ], "categories": [ "Medical Icons" ] }, { "name": "fighter-jet", "id": "fighter-jet", "unicode": "f0fb", "created": 3, "filter": [ "fly", "plane", "airplane", "quick", "fast", "travel" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "beer", "id": "beer", "unicode": "f0fc", "created": 3, "filter": [ "alcohol", "stein", "drink", "mug", "bar", "liquor" ], "categories": [ "Web Application Icons" ] }, { "name": "H Square", "id": "h-square", "unicode": "f0fd", "created": 3, "filter": [ "hospital", "hotel" ], "categories": [ "Medical Icons" ] }, { "name": "Plus Square", "id": "plus-square", "unicode": "f0fe", "created": 3, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Medical Icons", "Web Application Icons", "Form Control Icons" ] }, { "name": "Angle Double Left", "id": "angle-double-left", "unicode": "f100", "created": 3, "filter": [ "laquo", "quote", "previous", "back", "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "Angle Double Right", "id": "angle-double-right", "unicode": "f101", "created": 3, "filter": [ "raquo", "quote", "next", "forward", "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "Angle Double Up", "id": "angle-double-up", "unicode": "f102", "created": 3, "filter": [ "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "Angle Double Down", "id": "angle-double-down", "unicode": "f103", "created": 3, "filter": [ "arrows" ], "categories": [ "Directional Icons" ] }, { "name": "angle-left", "id": "angle-left", "unicode": "f104", "created": 3, "filter": [ "previous", "back", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "angle-right", "id": "angle-right", "unicode": "f105", "created": 3, "filter": [ "next", "forward", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "angle-up", "id": "angle-up", "unicode": "f106", "created": 3, "filter": [ "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "angle-down", "id": "angle-down", "unicode": "f107", "created": 3, "filter": [ "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Desktop", "id": "desktop", "unicode": "f108", "created": 3, "filter": [ "monitor", "screen", "desktop", "computer", "demo", "device" ], "categories": [ "Web Application Icons" ] }, { "name": "Laptop", "id": "laptop", "unicode": "f109", "created": 3, "filter": [ "demo", "computer", "device" ], "categories": [ "Web Application Icons" ] }, { "name": "tablet", "id": "tablet", "unicode": "f10a", "created": 3, "filter": [ "ipad", "device" ], "categories": [ "Web Application Icons" ] }, { "name": "Mobile Phone", "id": "mobile", "unicode": "f10b", "created": 3, "filter": [ "cell phone", "cellphone", "text", "call", "iphone", "number", "telephone" ], "aliases": [ "mobile-phone" ], "categories": [ "Web Application Icons" ] }, { "name": "Circle Outlined", "id": "circle-o", "unicode": "f10c", "created": 3, "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "quote-left", "id": "quote-left", "unicode": "f10d", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "quote-right", "id": "quote-right", "unicode": "f10e", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "Spinner", "id": "spinner", "unicode": "f110", "created": 3, "filter": [ "loading", "progress" ], "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "Circle", "id": "circle", "unicode": "f111", "created": 3, "filter": [ "dot", "notification" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Reply", "id": "reply", "unicode": "f112", "created": 3, "aliases": [ "mail-reply" ], "categories": [ "Web Application Icons" ] }, { "name": "GitHub Alt", "id": "github-alt", "unicode": "f113", "created": 3, "url": "github.com/logos", "filter": [ "octocat" ], "categories": [ "Brand Icons" ] }, { "name": "Folder Outlined", "id": "folder-o", "unicode": "f114", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "Folder Open Outlined", "id": "folder-open-o", "unicode": "f115", "created": 3, "categories": [ "Web Application Icons" ] }, { "name": "Smile Outlined", "id": "smile-o", "unicode": "f118", "created": 3.1, "filter": [ "face", "emoticon", "happy", "approve", "satisfied", "rating" ], "categories": [ "Web Application Icons" ] }, { "name": "Frown Outlined", "id": "frown-o", "unicode": "f119", "created": 3.1, "filter": [ "face", "emoticon", "sad", "disapprove", "rating" ], "categories": [ "Web Application Icons" ] }, { "name": "Meh Outlined", "id": "meh-o", "unicode": "f11a", "created": 3.1, "filter": [ "face", "emoticon", "rating", "neutral" ], "categories": [ "Web Application Icons" ] }, { "name": "Gamepad", "id": "gamepad", "unicode": "f11b", "created": 3.1, "filter": [ "controller" ], "categories": [ "Web Application Icons" ] }, { "name": "Keyboard Outlined", "id": "keyboard-o", "unicode": "f11c", "created": 3.1, "filter": [ "type", "input" ], "categories": [ "Web Application Icons" ] }, { "name": "Flag Outlined", "id": "flag-o", "unicode": "f11d", "created": 3.1, "filter": [ "report", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "flag-checkered", "id": "flag-checkered", "unicode": "f11e", "created": 3.1, "filter": [ "report", "notification", "notify" ], "categories": [ "Web Application Icons" ] }, { "name": "Terminal", "id": "terminal", "unicode": "f120", "created": 3.1, "filter": [ "command", "prompt", "code" ], "categories": [ "Web Application Icons" ] }, { "name": "Code", "id": "code", "unicode": "f121", "created": 3.1, "filter": [ "html", "brackets" ], "categories": [ "Web Application Icons" ] }, { "name": "reply-all", "id": "reply-all", "unicode": "f122", "created": 3.1, "aliases": [ "mail-reply-all" ], "categories": [ "Web Application Icons" ] }, { "name": "Star Half Outlined", "id": "star-half-o", "unicode": "f123", "created": 3.1, "filter": [ "award", "achievement", "rating", "score" ], "aliases": [ "star-half-empty", "star-half-full" ], "categories": [ "Web Application Icons" ] }, { "name": "location-arrow", "id": "location-arrow", "unicode": "f124", "created": 3.1, "filter": [ "map", "coordinates", "location", "address", "place", "where" ], "categories": [ "Web Application Icons" ] }, { "name": "crop", "id": "crop", "unicode": "f125", "created": 3.1, "categories": [ "Web Application Icons" ] }, { "name": "code-fork", "id": "code-fork", "unicode": "f126", "created": 3.1, "filter": [ "git", "fork", "vcs", "svn", "github", "rebase", "version", "merge" ], "categories": [ "Web Application Icons" ] }, { "name": "Chain Broken", "id": "chain-broken", "unicode": "f127", "created": 3.1, "filter": [ "remove" ], "aliases": [ "unlink" ], "categories": [ "Text Editor Icons" ] }, { "name": "Question", "id": "question", "unicode": "f128", "created": 3.1, "filter": [ "help", "information", "unknown", "support" ], "categories": [ "Web Application Icons" ] }, { "name": "Info", "id": "info", "unicode": "f129", "created": 3.1, "filter": [ "help", "information", "more", "details" ], "categories": [ "Web Application Icons" ] }, { "name": "exclamation", "id": "exclamation", "unicode": "f12a", "created": 3.1, "filter": [ "warning", "error", "problem", "notification", "notify", "alert" ], "categories": [ "Web Application Icons" ] }, { "name": "superscript", "id": "superscript", "unicode": "f12b", "created": 3.1, "filter": [ "exponential" ], "categories": [ "Text Editor Icons" ] }, { "name": "subscript", "id": "subscript", "unicode": "f12c", "created": 3.1, "categories": [ "Text Editor Icons" ] }, { "name": "eraser", "id": "eraser", "unicode": "f12d", "created": 3.1, "filter": [ "remove", "delete" ], "categories": [ "Text Editor Icons", "Web Application Icons" ] }, { "name": "Puzzle Piece", "id": "puzzle-piece", "unicode": "f12e", "created": 3.1, "filter": [ "addon", "add-on", "section" ], "categories": [ "Web Application Icons" ] }, { "name": "microphone", "id": "microphone", "unicode": "f130", "created": 3.1, "filter": [ "record", "voice", "sound" ], "categories": [ "Web Application Icons" ] }, { "name": "Microphone Slash", "id": "microphone-slash", "unicode": "f131", "created": 3.1, "filter": [ "record", "voice", "sound", "mute" ], "categories": [ "Web Application Icons" ] }, { "name": "shield", "id": "shield", "unicode": "f132", "created": 3.1, "filter": [ "award", "achievement", "security", "winner" ], "categories": [ "Web Application Icons" ] }, { "name": "calendar-o", "id": "calendar-o", "unicode": "f133", "created": 3.1, "filter": [ "date", "time", "when", "event" ], "categories": [ "Web Application Icons" ] }, { "name": "fire-extinguisher", "id": "fire-extinguisher", "unicode": "f134", "created": 3.1, "categories": [ "Web Application Icons" ] }, { "name": "rocket", "id": "rocket", "unicode": "f135", "created": 3.1, "filter": [ "app" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "MaxCDN", "id": "maxcdn", "unicode": "f136", "created": 3.1, "categories": [ "Brand Icons" ] }, { "name": "Chevron Circle Left", "id": "chevron-circle-left", "unicode": "f137", "created": 3.1, "filter": [ "previous", "back", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Chevron Circle Right", "id": "chevron-circle-right", "unicode": "f138", "created": 3.1, "filter": [ "next", "forward", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Chevron Circle Up", "id": "chevron-circle-up", "unicode": "f139", "created": 3.1, "filter": [ "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "Chevron Circle Down", "id": "chevron-circle-down", "unicode": "f13a", "created": 3.1, "filter": [ "more", "dropdown", "menu", "arrow" ], "categories": [ "Directional Icons" ] }, { "name": "HTML 5 Logo", "id": "html5", "unicode": "f13b", "created": 3.1, "code": [ "code", "html5" ], "categories": [ "Brand Icons" ] }, { "name": "CSS 3 Logo", "id": "css3", "unicode": "f13c", "created": 3.1, "filter": [ "code" ], "categories": [ "Brand Icons" ] }, { "name": "Anchor", "id": "anchor", "unicode": "f13d", "created": 3.1, "filter": [ "link" ], "categories": [ "Web Application Icons" ] }, { "name": "Unlock Alt", "id": "unlock-alt", "unicode": "f13e", "created": 3.1, "filter": [ "protect", "admin", "password", "lock" ], "categories": [ "Web Application Icons" ] }, { "name": "Bullseye", "id": "bullseye", "unicode": "f140", "created": 3.1, "filter": [ "target" ], "categories": [ "Web Application Icons" ] }, { "name": "Ellipsis Horizontal", "id": "ellipsis-h", "unicode": "f141", "created": 3.1, "filter": [ "dots" ], "categories": [ "Web Application Icons" ] }, { "name": "Ellipsis Vertical", "id": "ellipsis-v", "unicode": "f142", "created": 3.1, "filter": [ "dots" ], "categories": [ "Web Application Icons" ] }, { "name": "RSS Square", "id": "rss-square", "unicode": "f143", "created": 3.1, "filter": [ "feed", "blog" ], "categories": [ "Web Application Icons" ] }, { "name": "Play Circle", "id": "play-circle", "unicode": "f144", "created": 3.1, "filter": [ "start", "playing" ], "categories": [ "Video Player Icons" ] }, { "name": "Ticket", "id": "ticket", "unicode": "f145", "created": 3.1, "filter": [ "movie", "pass", "support" ], "categories": [ "Web Application Icons" ] }, { "name": "Minus Square", "id": "minus-square", "unicode": "f146", "created": 3.1, "filter": [ "hide", "minify", "delete", "remove", "trash", "hide", "collapse" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Minus Square Outlined", "id": "minus-square-o", "unicode": "f147", "created": 3.1, "filter": [ "hide", "minify", "delete", "remove", "trash", "hide", "collapse" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Level Up", "id": "level-up", "unicode": "f148", "created": 3.1, "filter": [ "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Level Down", "id": "level-down", "unicode": "f149", "created": 3.1, "filter": [ "arrow" ], "categories": [ "Web Application Icons" ] }, { "name": "Check Square", "id": "check-square", "unicode": "f14a", "created": 3.1, "filter": [ "checkmark", "done", "todo", "agree", "accept", "confirm", "ok" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Pencil Square", "id": "pencil-square", "unicode": "f14b", "created": 3.1, "filter": [ "write", "edit", "update" ], "categories": [ "Web Application Icons" ] }, { "name": "External Link Square", "id": "external-link-square", "unicode": "f14c", "created": 3.1, "filter": [ "open", "new" ], "categories": [ "Web Application Icons" ] }, { "name": "Share Square", "id": "share-square", "unicode": "f14d", "created": 3.1, "filter": [ "social", "send" ], "categories": [ "Web Application Icons" ] }, { "name": "Compass", "id": "compass", "unicode": "f14e", "created": 3.2, "filter": [ "safari", "directory", "menu", "location" ], "categories": [ "Web Application Icons" ] }, { "name": "Caret Square Outlined Down", "id": "caret-square-o-down", "unicode": "f150", "created": 3.2, "aliases": [ "toggle-down" ], "filter": [ "more", "dropdown", "menu" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Caret Square Outlined Up", "id": "caret-square-o-up", "unicode": "f151", "created": 3.2, "aliases": [ "toggle-up" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Caret Square Outlined Right", "id": "caret-square-o-right", "unicode": "f152", "created": 3.2, "filter": [ "next", "forward" ], "aliases": [ "toggle-right" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Euro (EUR)", "id": "eur", "unicode": "f153", "created": 3.2, "aliases": [ "euro" ], "categories": [ "Currency Icons" ] }, { "name": "GBP", "id": "gbp", "unicode": "f154", "created": 3.2, "categories": [ "Currency Icons" ] }, { "name": "US Dollar", "id": "usd", "unicode": "f155", "created": 3.2, "aliases": [ "dollar" ], "categories": [ "Currency Icons" ] }, { "name": "Indian Rupee (INR)", "id": "inr", "unicode": "f156", "created": 3.2, "aliases": [ "rupee" ], "categories": [ "Currency Icons" ] }, { "name": "Japanese Yen (JPY)", "id": "jpy", "unicode": "f157", "created": 3.2, "aliases": [ "cny", "rmb", "yen" ], "categories": [ "Currency Icons" ] }, { "name": "Russian Ruble (RUB)", "id": "rub", "unicode": "f158", "created": 4, "aliases": [ "ruble", "rouble" ], "categories": [ "Currency Icons" ] }, { "name": "Korean Won (KRW)", "id": "krw", "unicode": "f159", "created": 3.2, "aliases": [ "won" ], "categories": [ "Currency Icons" ] }, { "name": "Bitcoin (BTC)", "id": "btc", "unicode": "f15a", "created": 3.2, "aliases": [ "bitcoin" ], "categories": [ "Currency Icons", "Brand Icons" ] }, { "name": "File", "id": "file", "unicode": "f15b", "created": 3.2, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "File Text", "id": "file-text", "unicode": "f15c", "created": 3.2, "filter": [ "new", "page", "pdf", "document" ], "categories": [ "Text Editor Icons", "File Type Icons" ] }, { "name": "Sort Alpha Ascending", "id": "sort-alpha-asc", "unicode": "f15d", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Alpha Descending", "id": "sort-alpha-desc", "unicode": "f15e", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Amount Ascending", "id": "sort-amount-asc", "unicode": "f160", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Amount Descending", "id": "sort-amount-desc", "unicode": "f161", "created": 3.2, "categories": [ "Web Application Icons" ] }, { "name": "Sort Numeric Ascending", "id": "sort-numeric-asc", "unicode": "f162", "created": 3.2, "filter": [ "numbers" ], "categories": [ "Web Application Icons" ] }, { "name": "Sort Numeric Descending", "id": "sort-numeric-desc", "unicode": "f163", "created": 3.2, "filter": [ "numbers" ], "categories": [ "Web Application Icons" ] }, { "name": "thumbs-up", "id": "thumbs-up", "unicode": "f164", "created": 3.2, "filter": [ "like", "favorite", "approve", "agree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "thumbs-down", "id": "thumbs-down", "unicode": "f165", "created": 3.2, "filter": [ "dislike", "disapprove", "disagree", "hand" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "YouTube Square", "id": "youtube-square", "unicode": "f166", "created": 3.2, "filter": [ "video", "film" ], "categories": [ "Brand Icons" ] }, { "name": "YouTube", "id": "youtube", "unicode": "f167", "created": 3.2, "filter": [ "video", "film" ], "categories": [ "Brand Icons" ] }, { "name": "Xing", "id": "xing", "unicode": "f168", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Xing Square", "id": "xing-square", "unicode": "f169", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "YouTube Play", "id": "youtube-play", "unicode": "f16a", "created": 3.2, "filter": [ "start", "playing" ], "categories": [ "Brand Icons", "Video Player Icons" ] }, { "name": "Dropbox", "id": "dropbox", "unicode": "f16b", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Stack Overflow", "id": "stack-overflow", "unicode": "f16c", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Instagram", "id": "instagram", "unicode": "f16d", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Flickr", "id": "flickr", "unicode": "f16e", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "App.net", "id": "adn", "unicode": "f170", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Bitbucket", "id": "bitbucket", "unicode": "f171", "created": 3.2, "filter": [ "git" ], "categories": [ "Brand Icons" ] }, { "name": "Bitbucket Square", "id": "bitbucket-square", "unicode": "f172", "created": 3.2, "filter": [ "git" ], "categories": [ "Brand Icons" ] }, { "name": "Tumblr", "id": "tumblr", "unicode": "f173", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Tumblr Square", "id": "tumblr-square", "unicode": "f174", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Long Arrow Down", "id": "long-arrow-down", "unicode": "f175", "created": 3.2, "categories": [ "Directional Icons" ] }, { "name": "Long Arrow Up", "id": "long-arrow-up", "unicode": "f176", "created": 3.2, "categories": [ "Directional Icons" ] }, { "name": "Long Arrow Left", "id": "long-arrow-left", "unicode": "f177", "created": 3.2, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "Long Arrow Right", "id": "long-arrow-right", "unicode": "f178", "created": 3.2, "categories": [ "Directional Icons" ] }, { "name": "Apple", "id": "apple", "unicode": "f179", "created": 3.2, "filter": [ "osx", "food" ], "categories": [ "Brand Icons" ] }, { "name": "Windows", "id": "windows", "unicode": "f17a", "created": 3.2, "filter": [ "microsoft" ], "categories": [ "Brand Icons" ] }, { "name": "Android", "id": "android", "unicode": "f17b", "created": 3.2, "filter": [ "robot" ], "categories": [ "Brand Icons" ] }, { "name": "Linux", "id": "linux", "unicode": "f17c", "created": 3.2, "filter": [ "tux" ], "categories": [ "Brand Icons" ] }, { "name": "Dribbble", "id": "dribbble", "unicode": "f17d", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Skype", "id": "skype", "unicode": "f17e", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Foursquare", "id": "foursquare", "unicode": "f180", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Trello", "id": "trello", "unicode": "f181", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Female", "id": "female", "unicode": "f182", "created": 3.2, "filter": [ "woman", "user", "person", "profile" ], "categories": [ "Web Application Icons" ] }, { "name": "Male", "id": "male", "unicode": "f183", "created": 3.2, "filter": [ "man", "user", "person", "profile" ], "categories": [ "Web Application Icons" ] }, { "name": "Gratipay (Gittip)", "id": "gratipay", "unicode": "f184", "created": 3.2, "aliases": [ "gittip" ], "filter": [ "heart", "like", "favorite", "love" ], "categories": [ "Brand Icons" ] }, { "name": "Sun Outlined", "id": "sun-o", "unicode": "f185", "created": 3.2, "filter": [ "weather", "contrast", "lighter", "brighten", "day" ], "categories": [ "Web Application Icons" ] }, { "name": "Moon Outlined", "id": "moon-o", "unicode": "f186", "created": 3.2, "filter": [ "night", "darker", "contrast" ], "categories": [ "Web Application Icons" ] }, { "name": "Archive", "id": "archive", "unicode": "f187", "created": 3.2, "filter": [ "box", "storage" ], "categories": [ "Web Application Icons" ] }, { "name": "Bug", "id": "bug", "unicode": "f188", "created": 3.2, "filter": [ "report", "insect" ], "categories": [ "Web Application Icons" ] }, { "name": "VK", "id": "vk", "unicode": "f189", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Weibo", "id": "weibo", "unicode": "f18a", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Renren", "id": "renren", "unicode": "f18b", "created": 3.2, "categories": [ "Brand Icons" ] }, { "name": "Pagelines", "id": "pagelines", "unicode": "f18c", "created": 4, "filter": [ "leaf", "leaves", "tree", "plant", "eco", "nature" ], "categories": [ "Brand Icons" ] }, { "name": "Stack Exchange", "id": "stack-exchange", "unicode": "f18d", "created": 4, "categories": [ "Brand Icons" ] }, { "name": "Arrow Circle Outlined Right", "id": "arrow-circle-o-right", "unicode": "f18e", "created": 4, "filter": [ "next", "forward" ], "categories": [ "Directional Icons" ] }, { "name": "Arrow Circle Outlined Left", "id": "arrow-circle-o-left", "unicode": "f190", "created": 4, "filter": [ "previous", "back" ], "categories": [ "Directional Icons" ] }, { "name": "Caret Square Outlined Left", "id": "caret-square-o-left", "unicode": "f191", "created": 4, "filter": [ "previous", "back" ], "aliases": [ "toggle-left" ], "categories": [ "Web Application Icons", "Directional Icons" ] }, { "name": "Dot Circle Outlined", "id": "dot-circle-o", "unicode": "f192", "created": 4, "filter": [ "target", "bullseye", "notification" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Wheelchair", "id": "wheelchair", "unicode": "f193", "created": 4, "filter": [ "handicap", "person" ], "categories": [ "Web Application Icons", "Medical Icons", "Transportation Icons", "Accessibility Icons" ] }, { "name": "Vimeo Square", "id": "vimeo-square", "unicode": "f194", "created": 4, "categories": [ "Brand Icons" ] }, { "name": "Turkish Lira (TRY)", "id": "try", "unicode": "f195", "created": 4, "aliases": [ "turkish-lira" ], "categories": [ "Currency Icons" ] }, { "name": "Plus Square Outlined", "id": "plus-square-o", "unicode": "f196", "created": 4, "filter": [ "add", "new", "create", "expand" ], "categories": [ "Web Application Icons", "Form Control Icons" ] }, { "name": "Space Shuttle", "id": "space-shuttle", "unicode": "f197", "created": 4.1, "filter": null, "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Slack Logo", "id": "slack", "unicode": "f198", "created": 4.1, "filter": [ "hashtag", "anchor", "hash" ], "categories": [ "Brand Icons" ] }, { "name": "Envelope Square", "id": "envelope-square", "unicode": "f199", "created": 4.1, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "WordPress Logo", "id": "wordpress", "unicode": "f19a", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "OpenID", "id": "openid", "unicode": "f19b", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "University", "id": "university", "unicode": "f19c", "created": 4.1, "aliases": [ "institution", "bank" ], "categories": [ "Web Application Icons" ] }, { "name": "Graduation Cap", "id": "graduation-cap", "unicode": "f19d", "created": 4.1, "aliases": [ "mortar-board" ], "filter": [ "learning", "school", "student" ], "categories": [ "Web Application Icons" ] }, { "name": "Yahoo Logo", "id": "yahoo", "unicode": "f19e", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Google Logo", "id": "google", "unicode": "f1a0", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "reddit Logo", "id": "reddit", "unicode": "f1a1", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "reddit Square", "id": "reddit-square", "unicode": "f1a2", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "StumbleUpon Circle", "id": "stumbleupon-circle", "unicode": "f1a3", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "StumbleUpon Logo", "id": "stumbleupon", "unicode": "f1a4", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Delicious Logo", "id": "delicious", "unicode": "f1a5", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Digg Logo", "id": "digg", "unicode": "f1a6", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Pied Piper PP Logo (Old)", "id": "pied-piper-pp", "unicode": "f1a7", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Pied Piper Alternate Logo", "id": "pied-piper-alt", "unicode": "f1a8", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Drupal Logo", "id": "drupal", "unicode": "f1a9", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Joomla Logo", "id": "joomla", "unicode": "f1aa", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Language", "id": "language", "unicode": "f1ab", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Fax", "id": "fax", "unicode": "f1ac", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Building", "id": "building", "unicode": "f1ad", "created": 4.1, "filter": [ "work", "business", "apartment", "office", "company" ], "categories": [ "Web Application Icons" ] }, { "name": "Child", "id": "child", "unicode": "f1ae", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Paw", "id": "paw", "unicode": "f1b0", "created": 4.1, "filter": [ "pet" ], "categories": [ "Web Application Icons" ] }, { "name": "spoon", "id": "spoon", "unicode": "f1b1", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Cube", "id": "cube", "unicode": "f1b2", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Cubes", "id": "cubes", "unicode": "f1b3", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Behance", "id": "behance", "unicode": "f1b4", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Behance Square", "id": "behance-square", "unicode": "f1b5", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Steam", "id": "steam", "unicode": "f1b6", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Steam Square", "id": "steam-square", "unicode": "f1b7", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Recycle", "id": "recycle", "unicode": "f1b8", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Car", "id": "car", "unicode": "f1b9", "created": 4.1, "aliases": [ "automobile" ], "filter": [ "vehicle" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Taxi", "id": "taxi", "unicode": "f1ba", "created": 4.1, "aliases": [ "cab" ], "filter": [ "vehicle" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Tree", "id": "tree", "unicode": "f1bb", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Spotify", "id": "spotify", "unicode": "f1bc", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "deviantART", "id": "deviantart", "unicode": "f1bd", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "SoundCloud", "id": "soundcloud", "unicode": "f1be", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Database", "id": "database", "unicode": "f1c0", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "PDF File Outlined", "id": "file-pdf-o", "unicode": "f1c1", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Word File Outlined", "id": "file-word-o", "unicode": "f1c2", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Excel File Outlined", "id": "file-excel-o", "unicode": "f1c3", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Powerpoint File Outlined", "id": "file-powerpoint-o", "unicode": "f1c4", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Image File Outlined", "id": "file-image-o", "unicode": "f1c5", "created": 4.1, "aliases": [ "file-photo-o", "file-picture-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Archive File Outlined", "id": "file-archive-o", "unicode": "f1c6", "created": 4.1, "aliases": [ "file-zip-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Audio File Outlined", "id": "file-audio-o", "unicode": "f1c7", "created": 4.1, "aliases": [ "file-sound-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Video File Outlined", "id": "file-video-o", "unicode": "f1c8", "created": 4.1, "aliases": [ "file-movie-o" ], "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Code File Outlined", "id": "file-code-o", "unicode": "f1c9", "created": 4.1, "categories": [ "Web Application Icons", "File Type Icons" ] }, { "name": "Vine", "id": "vine", "unicode": "f1ca", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Codepen", "id": "codepen", "unicode": "f1cb", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "jsFiddle", "id": "jsfiddle", "unicode": "f1cc", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Life Ring", "id": "life-ring", "unicode": "f1cd", "created": 4.1, "aliases": [ { "life-bouy": "Deprecated - remove in 5.0.0" }, "life-buoy", "life-saver", "support" ], "categories": [ "Web Application Icons" ] }, { "name": "Circle Outlined Notched", "id": "circle-o-notch", "unicode": "f1ce", "created": 4.1, "categories": [ "Web Application Icons", "Spinner Icons" ] }, { "name": "Rebel Alliance", "id": "rebel", "unicode": "f1d0", "created": 4.1, "aliases": [ "ra", "resistance" ], "categories": [ "Brand Icons" ] }, { "name": "Galactic Empire", "id": "empire", "unicode": "f1d1", "created": 4.1, "aliases": [ "ge" ], "categories": [ "Brand Icons" ] }, { "name": "Git Square", "id": "git-square", "unicode": "f1d2", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Git", "id": "git", "unicode": "f1d3", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Hacker News", "id": "hacker-news", "unicode": "f1d4", "created": 4.1, "aliases": [ "y-combinator-square", "yc-square" ], "categories": [ "Brand Icons" ] }, { "name": "Tencent Weibo", "id": "tencent-weibo", "unicode": "f1d5", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "QQ", "id": "qq", "unicode": "f1d6", "created": 4.1, "categories": [ "Brand Icons" ] }, { "name": "Weixin (WeChat)", "id": "weixin", "unicode": "f1d7", "created": 4.1, "aliases": [ "wechat" ], "categories": [ "Brand Icons" ] }, { "name": "Paper Plane", "id": "paper-plane", "unicode": "f1d8", "created": 4.1, "aliases": [ "send" ], "categories": [ "Web Application Icons" ] }, { "name": "Paper Plane Outlined", "id": "paper-plane-o", "unicode": "f1d9", "created": 4.1, "aliases": [ "send-o" ], "categories": [ "Web Application Icons" ] }, { "name": "History", "id": "history", "unicode": "f1da", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Circle Outlined Thin", "id": "circle-thin", "unicode": "f1db", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "header", "id": "header", "unicode": "f1dc", "created": 4.1, "filter": [ "heading" ], "categories": [ "Text Editor Icons" ] }, { "name": "paragraph", "id": "paragraph", "unicode": "f1dd", "created": 4.1, "categories": [ "Text Editor Icons" ] }, { "name": "Sliders", "id": "sliders", "unicode": "f1de", "created": 4.1, "filter": [ "settings" ], "categories": [ "Web Application Icons" ] }, { "name": "Share Alt", "id": "share-alt", "unicode": "f1e0", "created": 4.1, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Share Alt Square", "id": "share-alt-square", "unicode": "f1e1", "created": 4.1, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Bomb", "id": "bomb", "unicode": "f1e2", "created": 4.1, "categories": [ "Web Application Icons" ] }, { "name": "Futbol Outlined", "id": "futbol-o", "unicode": "f1e3", "created": 4.2, "aliases": [ "soccer-ball-o" ], "categories": [ "Web Application Icons" ] }, { "name": "TTY", "id": "tty", "unicode": "f1e4", "created": 4.2, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Binoculars", "id": "binoculars", "unicode": "f1e5", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Plug", "id": "plug", "unicode": "f1e6", "created": 4.2, "filter": [ "power", "connect" ], "categories": [ "Web Application Icons" ] }, { "name": "Slideshare", "id": "slideshare", "unicode": "f1e7", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Twitch", "id": "twitch", "unicode": "f1e8", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Yelp", "id": "yelp", "unicode": "f1e9", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Newspaper Outlined", "id": "newspaper-o", "unicode": "f1ea", "created": 4.2, "filter": [ "press" ], "categories": [ "Web Application Icons" ] }, { "name": "WiFi", "id": "wifi", "unicode": "f1eb", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Calculator", "id": "calculator", "unicode": "f1ec", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Paypal", "id": "paypal", "unicode": "f1ed", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Google Wallet", "id": "google-wallet", "unicode": "f1ee", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Visa Credit Card", "id": "cc-visa", "unicode": "f1f0", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "MasterCard Credit Card", "id": "cc-mastercard", "unicode": "f1f1", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Discover Credit Card", "id": "cc-discover", "unicode": "f1f2", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "American Express Credit Card", "id": "cc-amex", "unicode": "f1f3", "created": 4.2, "filter": [ "amex" ], "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Paypal Credit Card", "id": "cc-paypal", "unicode": "f1f4", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Stripe Credit Card", "id": "cc-stripe", "unicode": "f1f5", "created": 4.2, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Bell Slash", "id": "bell-slash", "unicode": "f1f6", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Bell Slash Outlined", "id": "bell-slash-o", "unicode": "f1f7", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Trash", "id": "trash", "unicode": "f1f8", "created": 4.2, "filter": [ "garbage", "delete", "remove", "hide" ], "categories": [ "Web Application Icons" ] }, { "name": "Copyright", "id": "copyright", "unicode": "f1f9", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "At", "id": "at", "unicode": "f1fa", "created": 4.2, "filter": [ "email", "e-mail" ], "categories": [ "Web Application Icons" ] }, { "name": "Eyedropper", "id": "eyedropper", "unicode": "f1fb", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Paint Brush", "id": "paint-brush", "unicode": "f1fc", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Birthday Cake", "id": "birthday-cake", "unicode": "f1fd", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Area Chart", "id": "area-chart", "unicode": "f1fe", "created": 4.2, "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "Pie Chart", "id": "pie-chart", "unicode": "f200", "created": 4.2, "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "Line Chart", "id": "line-chart", "unicode": "f201", "created": 4.2, "filter": [ "graph", "analytics" ], "categories": [ "Web Application Icons", "Chart Icons" ] }, { "name": "last.fm", "id": "lastfm", "unicode": "f202", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "last.fm Square", "id": "lastfm-square", "unicode": "f203", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Toggle Off", "id": "toggle-off", "unicode": "f204", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Toggle On", "id": "toggle-on", "unicode": "f205", "created": 4.2, "categories": [ "Web Application Icons" ] }, { "name": "Bicycle", "id": "bicycle", "unicode": "f206", "created": 4.2, "filter": [ "vehicle", "bike" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Bus", "id": "bus", "unicode": "f207", "created": 4.2, "filter": [ "vehicle" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "ioxhost", "id": "ioxhost", "unicode": "f208", "created": 4.2, "url": "ioxhost.co.uk", "categories": [ "Brand Icons" ] }, { "name": "AngelList", "id": "angellist", "unicode": "f209", "created": 4.2, "categories": [ "Brand Icons" ] }, { "name": "Closed Captions", "id": "cc", "unicode": "f20a", "created": 4.2, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Shekel (ILS)", "id": "ils", "unicode": "f20b", "created": 4.2, "aliases": [ "shekel", "sheqel" ], "categories": [ "Currency Icons" ] }, { "name": "meanpath", "id": "meanpath", "unicode": "f20c", "created": 4.2, "url": "meanpath.com", "categories": [ "Brand Icons" ] }, { "name": "BuySellAds", "id": "buysellads", "unicode": "f20d", "created": 4.3, "url": "buysellads.com", "categories": [ "Brand Icons" ] }, { "name": "Connect Develop", "id": "connectdevelop", "unicode": "f20e", "created": 4.3, "url": "connectdevelop.com", "categories": [ "Brand Icons" ] }, { "name": "DashCube", "id": "dashcube", "unicode": "f210", "created": 4.3, "url": "dashcube.com", "categories": [ "Brand Icons" ] }, { "name": "Forumbee", "id": "forumbee", "unicode": "f211", "created": 4.3, "url": "forumbee.com", "categories": [ "Brand Icons" ] }, { "name": "Leanpub", "id": "leanpub", "unicode": "f212", "created": 4.3, "url": "leanpub.com", "categories": [ "Brand Icons" ] }, { "name": "Sellsy", "id": "sellsy", "unicode": "f213", "created": 4.3, "url": "sellsy.com", "categories": [ "Brand Icons" ] }, { "name": "Shirts in Bulk", "id": "shirtsinbulk", "unicode": "f214", "created": 4.3, "url": "shirtsinbulk.com", "categories": [ "Brand Icons" ] }, { "name": "SimplyBuilt", "id": "simplybuilt", "unicode": "f215", "created": 4.3, "url": "simplybuilt.com", "categories": [ "Brand Icons" ] }, { "name": "skyatlas", "id": "skyatlas", "unicode": "f216", "created": 4.3, "url": "skyatlas.com", "categories": [ "Brand Icons" ] }, { "name": "Add to Shopping Cart", "id": "cart-plus", "unicode": "f217", "created": 4.3, "filter": [ "add", "shopping" ], "categories": [ "Web Application Icons" ] }, { "name": "Shopping Cart Arrow Down", "id": "cart-arrow-down", "unicode": "f218", "created": 4.3, "filter": [ "shopping" ], "categories": [ "Web Application Icons" ] }, { "name": "Diamond", "id": "diamond", "unicode": "f219", "created": 4.3, "filter": [ "gem", "gemstone" ], "categories": [ "Web Application Icons" ] }, { "name": "Ship", "id": "ship", "unicode": "f21a", "created": 4.3, "filter": [ "boat", "sea" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "User Secret", "id": "user-secret", "unicode": "f21b", "created": 4.3, "filter": [ "whisper", "spy", "incognito", "privacy" ], "categories": [ "Web Application Icons" ] }, { "name": "Motorcycle", "id": "motorcycle", "unicode": "f21c", "created": 4.3, "filter": [ "vehicle", "bike" ], "categories": [ "Web Application Icons", "Transportation Icons" ] }, { "name": "Street View", "id": "street-view", "unicode": "f21d", "created": 4.3, "filter": [ "map" ], "categories": [ "Web Application Icons" ] }, { "name": "Heartbeat", "id": "heartbeat", "unicode": "f21e", "created": 4.3, "filter": [ "ekg" ], "categories": [ "Web Application Icons", "Medical Icons" ] }, { "name": "Venus", "id": "venus", "unicode": "f221", "created": 4.3, "filter": [ "female" ], "categories": [ "Gender Icons" ] }, { "name": "Mars", "id": "mars", "unicode": "f222", "created": 4.3, "filter": [ "male" ], "categories": [ "Gender Icons" ] }, { "name": "Mercury", "id": "mercury", "unicode": "f223", "created": 4.3, "filter": [ "transgender" ], "categories": [ "Gender Icons" ] }, { "name": "Transgender", "id": "transgender", "unicode": "f224", "created": 4.3, "aliases": [ "intersex" ], "categories": [ "Gender Icons" ] }, { "name": "Transgender Alt", "id": "transgender-alt", "unicode": "f225", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Venus Double", "id": "venus-double", "unicode": "f226", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Double", "id": "mars-double", "unicode": "f227", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Venus Mars", "id": "venus-mars", "unicode": "f228", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Stroke", "id": "mars-stroke", "unicode": "f229", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Stroke Vertical", "id": "mars-stroke-v", "unicode": "f22a", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Mars Stroke Horizontal", "id": "mars-stroke-h", "unicode": "f22b", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Neuter", "id": "neuter", "unicode": "f22c", "created": 4.3, "categories": [ "Gender Icons" ] }, { "name": "Genderless", "id": "genderless", "unicode": "f22d", "created": 4.4, "categories": [ "Gender Icons" ] }, { "name": "Facebook Official", "id": "facebook-official", "unicode": "f230", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "Pinterest P", "id": "pinterest-p", "unicode": "f231", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "What's App", "id": "whatsapp", "unicode": "f232", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "Server", "id": "server", "unicode": "f233", "created": 4.3, "categories": [ "Web Application Icons" ] }, { "name": "Add User", "id": "user-plus", "unicode": "f234", "created": 4.3, "filter": [ "sign up", "signup" ], "categories": [ "Web Application Icons" ] }, { "name": "Remove User", "id": "user-times", "unicode": "f235", "created": 4.3, "categories": [ "Web Application Icons" ] }, { "name": "Bed", "id": "bed", "unicode": "f236", "created": 4.3, "filter": [ "travel" ], "aliases": [ "hotel" ], "categories": [ "Web Application Icons" ] }, { "name": "Viacoin", "id": "viacoin", "unicode": "f237", "created": 4.3, "url": "viacoin.org", "categories": [ "Brand Icons" ] }, { "name": "Train", "id": "train", "unicode": "f238", "created": 4.3, "categories": [ "Transportation Icons" ] }, { "name": "Subway", "id": "subway", "unicode": "f239", "created": 4.3, "categories": [ "Transportation Icons" ] }, { "name": "Medium", "id": "medium", "unicode": "f23a", "created": 4.3, "categories": [ "Brand Icons" ] }, { "name": "Y Combinator", "id": "y-combinator", "unicode": "f23b", "created": 4.4, "aliases": [ "yc" ], "categories": [ "Brand Icons" ] }, { "name": "Optin Monster", "id": "optin-monster", "unicode": "f23c", "created": 4.4, "url": "optinmonster.com", "categories": [ "Brand Icons" ] }, { "name": "OpenCart", "id": "opencart", "unicode": "f23d", "created": 4.4, "url": "opencart.com", "categories": [ "Brand Icons" ] }, { "name": "ExpeditedSSL", "id": "expeditedssl", "unicode": "f23e", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Battery Full", "id": "battery-full", "unicode": "f240", "created": 4.4, "aliases": [ "battery-4", "battery" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery 3/4 Full", "id": "battery-three-quarters", "unicode": "f241", "created": 4.4, "aliases": [ "battery-3" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery 1/2 Full", "id": "battery-half", "unicode": "f242", "created": 4.4, "aliases": [ "battery-2" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery 1/4 Full", "id": "battery-quarter", "unicode": "f243", "created": 4.4, "aliases": [ "battery-1" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Battery Empty", "id": "battery-empty", "unicode": "f244", "created": 4.4, "aliases": [ "battery-0" ], "filter": [ "power" ], "categories": [ "Web Application Icons" ] }, { "name": "Mouse Pointer", "id": "mouse-pointer", "unicode": "f245", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "I Beam Cursor", "id": "i-cursor", "unicode": "f246", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Object Group", "id": "object-group", "unicode": "f247", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Object Ungroup", "id": "object-ungroup", "unicode": "f248", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Sticky Note", "id": "sticky-note", "unicode": "f249", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Sticky Note Outlined", "id": "sticky-note-o", "unicode": "f24a", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "JCB Credit Card", "id": "cc-jcb", "unicode": "f24b", "created": 4.4, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Diner's Club Credit Card", "id": "cc-diners-club", "unicode": "f24c", "created": 4.4, "categories": [ "Brand Icons", "Payment Icons" ] }, { "name": "Clone", "id": "clone", "unicode": "f24d", "created": 4.4, "filter": [ "copy" ], "categories": [ "Web Application Icons" ] }, { "name": "Balance Scale", "id": "balance-scale", "unicode": "f24e", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Hourglass Outlined", "id": "hourglass-o", "unicode": "f250", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Hourglass Start", "id": "hourglass-start", "unicode": "f251", "created": 4.4, "aliases": [ "hourglass-1" ], "categories": [ "Web Application Icons" ] }, { "name": "Hourglass Half", "id": "hourglass-half", "unicode": "f252", "created": 4.4, "aliases": [ "hourglass-2" ], "categories": [ "Web Application Icons" ] }, { "name": "Hourglass End", "id": "hourglass-end", "unicode": "f253", "created": 4.4, "aliases": [ "hourglass-3" ], "categories": [ "Web Application Icons" ] }, { "name": "Hourglass", "id": "hourglass", "unicode": "f254", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Rock (Hand)", "id": "hand-rock-o", "unicode": "f255", "created": 4.4, "aliases": [ "hand-grab-o" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Paper (Hand)", "id": "hand-paper-o", "unicode": "f256", "created": 4.4, "aliases": [ "hand-stop-o" ], "filter": [ "stop" ], "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Scissors (Hand)", "id": "hand-scissors-o", "unicode": "f257", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Lizard (Hand)", "id": "hand-lizard-o", "unicode": "f258", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Spock (Hand)", "id": "hand-spock-o", "unicode": "f259", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Hand Pointer", "id": "hand-pointer-o", "unicode": "f25a", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Hand Peace", "id": "hand-peace-o", "unicode": "f25b", "created": 4.4, "categories": [ "Web Application Icons", "Hand Icons" ] }, { "name": "Trademark", "id": "trademark", "unicode": "f25c", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Registered Trademark", "id": "registered", "unicode": "f25d", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Creative Commons", "id": "creative-commons", "unicode": "f25e", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "GG Currency", "id": "gg", "unicode": "f260", "created": 4.4, "categories": [ "Currency Icons", "Brand Icons" ] }, { "name": "GG Currency Circle", "id": "gg-circle", "unicode": "f261", "created": 4.4, "categories": [ "Currency Icons", "Brand Icons" ] }, { "name": "TripAdvisor", "id": "tripadvisor", "unicode": "f262", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Odnoklassniki", "id": "odnoklassniki", "unicode": "f263", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Odnoklassniki Square", "id": "odnoklassniki-square", "unicode": "f264", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Get Pocket", "id": "get-pocket", "unicode": "f265", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Wikipedia W", "id": "wikipedia-w", "unicode": "f266", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Safari", "id": "safari", "unicode": "f267", "created": 4.4, "filter": [ "browser" ], "categories": [ "Brand Icons" ] }, { "name": "Chrome", "id": "chrome", "unicode": "f268", "created": 4.4, "filter": [ "browser" ], "categories": [ "Brand Icons" ] }, { "name": "Firefox", "id": "firefox", "unicode": "f269", "created": 4.4, "filter": [ "browser" ], "categories": [ "Brand Icons" ] }, { "name": "Opera", "id": "opera", "unicode": "f26a", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Internet-explorer", "id": "internet-explorer", "unicode": "f26b", "created": 4.4, "filter": [ "browser", "ie" ], "categories": [ "Brand Icons" ] }, { "name": "Television", "id": "television", "unicode": "f26c", "created": 4.4, "aliases": [ "tv" ], "filter": [ "display", "computer", "monitor" ], "categories": [ "Web Application Icons" ] }, { "name": "Contao", "id": "contao", "unicode": "f26d", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "500px", "id": "500px", "unicode": "f26e", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Amazon", "id": "amazon", "unicode": "f270", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Calendar Plus Outlined", "id": "calendar-plus-o", "unicode": "f271", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Calendar Minus Outlined", "id": "calendar-minus-o", "unicode": "f272", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Calendar Times Outlined", "id": "calendar-times-o", "unicode": "f273", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Calendar Check Outlined", "id": "calendar-check-o", "unicode": "f274", "created": 4.4, "filter": [ "ok" ], "categories": [ "Web Application Icons" ] }, { "name": "Industry", "id": "industry", "unicode": "f275", "created": 4.4, "filter": [ "factory" ], "categories": [ "Web Application Icons" ] }, { "name": "Map Pin", "id": "map-pin", "unicode": "f276", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Map Signs", "id": "map-signs", "unicode": "f277", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Map Outlined", "id": "map-o", "unicode": "f278", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Map", "id": "map", "unicode": "f279", "created": 4.4, "categories": [ "Web Application Icons" ] }, { "name": "Commenting", "id": "commenting", "unicode": "f27a", "created": 4.4, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Commenting Outlined", "id": "commenting-o", "unicode": "f27b", "created": 4.4, "filter": [ "speech", "notification", "note", "chat", "bubble", "feedback", "message", "texting", "sms", "conversation" ], "categories": [ "Web Application Icons" ] }, { "name": "Houzz", "id": "houzz", "unicode": "f27c", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Vimeo", "id": "vimeo", "unicode": "f27d", "created": 4.4, "categories": [ "Brand Icons" ] }, { "name": "Font Awesome Black Tie", "id": "black-tie", "unicode": "f27e", "created": 4.4, "url": "blacktie.io", "categories": [ "Brand Icons" ] }, { "name": "Fonticons", "id": "fonticons", "unicode": "f280", "created": 4.4, "url": "fonticons.com", "categories": [ "Brand Icons" ] }, { "name": "reddit Alien", "id": "reddit-alien", "unicode": "f281", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Edge Browser", "id": "edge", "unicode": "f282", "created": 4.5, "filter": [ "browser", "ie" ], "categories": [ "Brand Icons" ] }, { "name": "Credit Card", "id": "credit-card-alt", "unicode": "f283", "created": 4.5, "filter": [ "money", "buy", "debit", "checkout", "purchase", "payment", "credit card" ], "categories": [ "Payment Icons", "Web Application Icons" ] }, { "name": "Codie Pie", "id": "codiepie", "unicode": "f284", "created": 4.5, "url": "codiepie.com", "categories": [ "Brand Icons" ] }, { "name": "MODX", "id": "modx", "unicode": "f285", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Fort Awesome", "id": "fort-awesome", "unicode": "f286", "created": 4.5, "url": "fortawesome.com", "categories": [ "Brand Icons" ] }, { "name": "USB", "id": "usb", "unicode": "f287", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Product Hunt", "id": "product-hunt", "unicode": "f288", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Mixcloud", "id": "mixcloud", "unicode": "f289", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Scribd", "id": "scribd", "unicode": "f28a", "created": 4.5, "categories": [ "Brand Icons" ] }, { "name": "Pause Circle", "id": "pause-circle", "unicode": "f28b", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Pause Circle Outlined", "id": "pause-circle-o", "unicode": "f28c", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Stop Circle", "id": "stop-circle", "unicode": "f28d", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Stop Circle Outlined", "id": "stop-circle-o", "unicode": "f28e", "created": 4.5, "categories": [ "Video Player Icons" ] }, { "name": "Shopping Bag", "id": "shopping-bag", "unicode": "f290", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "Shopping Basket", "id": "shopping-basket", "unicode": "f291", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "Hashtag", "id": "hashtag", "unicode": "f292", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "Bluetooth", "id": "bluetooth", "unicode": "f293", "created": 4.5, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Bluetooth", "id": "bluetooth-b", "unicode": "f294", "created": 4.5, "categories": [ "Web Application Icons", "Brand Icons" ] }, { "name": "Percent", "id": "percent", "unicode": "f295", "created": 4.5, "categories": [ "Web Application Icons" ] }, { "name": "GitLab", "id": "gitlab", "unicode": "f296", "created": 4.6, "url": "gitlab.com", "categories": [ "Brand Icons" ] }, { "name": "WPBeginner", "id": "wpbeginner", "unicode": "f297", "created": 4.6, "url": "wpbeginner.com", "categories": [ "Brand Icons" ] }, { "name": "WPForms", "id": "wpforms", "unicode": "f298", "created": 4.6, "url": "wpforms.com", "categories": [ "Brand Icons" ] }, { "name": "Envira Gallery", "id": "envira", "unicode": "f299", "created": 4.6, "url": "enviragallery.com", "filter": [ "leaf" ], "categories": [ "Brand Icons" ] }, { "name": "Universal Access", "id": "universal-access", "unicode": "f29a", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Wheelchair Alt", "id": "wheelchair-alt", "unicode": "f29b", "created": 4.6, "filter": [ "handicap", "person" ], "categories": [ "Web Application Icons", "Medical Icons", "Transportation Icons", "Accessibility Icons" ] }, { "name": "Question Circle Outlined", "id": "question-circle-o", "unicode": "f29c", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Blind", "id": "blind", "unicode": "f29d", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Audio Description", "id": "audio-description", "unicode": "f29e", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Volume Control Phone", "id": "volume-control-phone", "unicode": "f2a0", "created": 4.6, "filter": [ "telephone" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Braille", "id": "braille", "unicode": "f2a1", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Assistive Listening Systems", "id": "assistive-listening-systems", "unicode": "f2a2", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "American Sign Language Interpreting", "id": "american-sign-language-interpreting", "unicode": "f2a3", "created": 4.6, "aliases": [ "asl-interpreting" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Deaf", "id": "deaf", "unicode": "f2a4", "created": 4.6, "aliases": [ "deafness", "hard-of-hearing" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Glide", "id": "glide", "unicode": "f2a5", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Glide G", "id": "glide-g", "unicode": "f2a6", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Sign Language", "id": "sign-language", "unicode": "f2a7", "created": 4.6, "aliases": [ "signing" ], "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Low Vision", "id": "low-vision", "unicode": "f2a8", "created": 4.6, "categories": [ "Web Application Icons", "Accessibility Icons" ] }, { "name": "Viadeo", "id": "viadeo", "unicode": "f2a9", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Viadeo Square", "id": "viadeo-square", "unicode": "f2aa", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Snapchat", "id": "snapchat", "unicode": "f2ab", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Snapchat Ghost", "id": "snapchat-ghost", "unicode": "f2ac", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Snapchat Square", "id": "snapchat-square", "unicode": "f2ad", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Pied Piper Logo", "id": "pied-piper", "unicode": "f2ae", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "First Order", "id": "first-order", "unicode": "f2b0", "created": 4.6, "categories": [ "Brand Icons" ] }, { "name": "Yoast", "id": "yoast", "unicode": "f2b1", "created": 4.6, "url": "yoast.com", "categories": [ "Brand Icons" ] }, { "name": "ThemeIsle", "id": "themeisle", "unicode": "f2b2", "created": 4.6, "url": "themeisle.com", "categories": [ "Brand Icons" ] }, { "name": "Google Plus Official", "id": "google-plus-official", "unicode": "f2b3", "created": 4.6, "aliases": [ "google-plus-circle" ], "categories": [ "Brand Icons" ] }, { "name": "Font Awesome", "id": "font-awesome", "unicode": "f2b4", "created": 4.6, "aliases": [ "fa" ], "categories": [ "Brand Icons" ] }, { "name": "Handshake Outlined", "id": "handshake-o", "unicode": "f2b5", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Envelope Open", "id": "envelope-open", "unicode": "f2b6", "created": 4.7, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Envelope Open Outlined", "id": "envelope-open-o", "unicode": "f2b7", "created": 4.7, "filter": [ "email", "e-mail", "letter", "support", "mail", "message", "notification" ], "categories": [ "Web Application Icons" ] }, { "name": "Linode", "id": "linode", "unicode": "f2b8", "created": 4.7, "url": "linode.com", "categories": [ "Brand Icons" ] }, { "name": "Address Book", "id": "address-book", "unicode": "f2b9", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Address Book Outlined", "id": "address-book-o", "unicode": "f2ba", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Address Card", "id": "address-card", "unicode": "f2bb", "created": 4.7, "aliases": [ "vcard" ], "categories": [ "Web Application Icons" ] }, { "name": "Address Card Outlined", "id": "address-card-o", "unicode": "f2bc", "created": 4.7, "aliases": [ "vcard-o" ], "categories": [ "Web Application Icons" ] }, { "name": "User Circle", "id": "user-circle", "unicode": "f2bd", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "User Circle Outlined", "id": "user-circle-o", "unicode": "f2be", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "User Outlined", "id": "user-o", "unicode": "f2c0", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Identification Badge", "id": "id-badge", "unicode": "f2c1", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Identification Card", "id": "id-card", "unicode": "f2c2", "created": 4.7, "aliases": [ "drivers-license" ], "categories": [ "Web Application Icons" ] }, { "name": "Identification Card Outlined", "id": "id-card-o", "unicode": "f2c3", "created": 4.7, "aliases": [ "drivers-license-o" ], "categories": [ "Web Application Icons" ] }, { "name": "Quora", "id": "quora", "unicode": "f2c4", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Free Code Camp", "id": "free-code-camp", "unicode": "f2c5", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Telegram", "id": "telegram", "unicode": "f2c6", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Thermometer Full", "id": "thermometer-full", "unicode": "f2c7", "created": 4.7, "aliases": [ "thermometer-4", "thermometer" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer 3/4 Full", "id": "thermometer-three-quarters", "unicode": "f2c8", "created": 4.7, "aliases": [ "thermometer-3" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer 1/2 Full", "id": "thermometer-half", "unicode": "f2c9", "created": 4.7, "aliases": [ "thermometer-2" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer 1/4 Full", "id": "thermometer-quarter", "unicode": "f2ca", "created": 4.7, "aliases": [ "thermometer-1" ], "categories": [ "Web Application Icons" ] }, { "name": "Thermometer Empty", "id": "thermometer-empty", "unicode": "f2cb", "created": 4.7, "aliases": [ "thermometer-0" ], "categories": [ "Web Application Icons" ] }, { "name": "Shower", "id": "shower", "unicode": "f2cc", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Bath", "id": "bath", "unicode": "f2cd", "created": 4.7, "aliases": [ "bathtub", "s15" ], "categories": [ "Web Application Icons" ] }, { "name": "Podcast", "id": "podcast", "unicode": "f2ce", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Maximize", "id": "window-maximize", "unicode": "f2d0", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Minimize", "id": "window-minimize", "unicode": "f2d1", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Restore", "id": "window-restore", "unicode": "f2d2", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Window Close", "id": "window-close", "unicode": "f2d3", "created": 4.7, "aliases": [ "times-rectangle" ], "categories": [ "Web Application Icons" ] }, { "name": "Window Close Outline", "id": "window-close-o", "unicode": "f2d4", "created": 4.7, "aliases": [ "times-rectangle-o" ], "categories": [ "Web Application Icons" ] }, { "name": "Bandcamp", "id": "bandcamp", "unicode": "f2d5", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Grav", "id": "grav", "unicode": "f2d6", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Etsy", "id": "etsy", "unicode": "f2d7", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "IMDB", "id": "imdb", "unicode": "f2d8", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Ravelry", "id": "ravelry", "unicode": "f2d9", "created": 4.7, "categories": [ "Brand Icons" ] }, { "name": "Eercast", "id": "eercast", "unicode": "f2da", "created": 4.7, "url": "eercast.com", "categories": [ "Brand Icons" ] }, { "name": "Microchip", "id": "microchip", "unicode": "f2db", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Snowflake Outlined", "id": "snowflake-o", "unicode": "f2dc", "created": 4.7, "categories": [ "Web Application Icons" ] }, { "name": "Superpowers", "id": "superpowers", "unicode": "f2dd", "created": 4.7, "url": "superpowers.io", "categories": [ "Brand Icons" ] }, { "name": "WPExplorer", "id": "wpexplorer", "unicode": "f2de", "created": 4.7, "url": "wpexplorer.com", "categories": [ "Brand Icons" ] }, { "name": "Meetup", "id": "meetup", "unicode": "f2e0", "created": 4.7, "categories": [ "Brand Icons" ] } ] } kirki-packages/field-fontawesome/src/Field/FontAwesome.php000064400000002276147177211530017632 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); ob_start(); include 'fontawesome.json'; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude $font_awesome_json = ob_get_clean(); $fa_array = (array) json_decode( $font_awesome_json, true ); $args['choices'] = []; foreach ( $fa_array['icons'] as $icon ) { if ( ! isset( $icon['id'] ) || ! isset( $icon['name'] ) ) { continue; } $args['choices'][ $icon['id'] ] = $icon['name']; } } return $args; } } kirki-packages/control-sortable/LICENSE000064400000002060147177211530013735 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/control-sortable/src/control.js000064400000002301147177211530015533 0ustar00import "./control.scss"; wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend({ // When we're finished loading continue processing ready: function() { var control = this; // Init sortable. jQuery( control.container.find( 'ul.sortable' ).first() ).sortable({ // Update value when we stop sorting. update: function() { control.setting.set( control.getNewVal() ); } }).disableSelection().find( 'li' ).each( function() { // Enable/disable options when we click on the eye of Thundera. jQuery( this ).find( 'i.visibility' ).click( function() { jQuery( this ).toggleClass( 'dashicons-visibility-faint' ).parents( 'li:eq(0)' ).toggleClass( 'invisible' ); }); }).click( function() { // Update value on click. control.setting.set( control.getNewVal() ); }); }, /** * Getss thhe new vvalue. * * @since 3.0.35 * @returns {Array} - Returns the value as an array. */ getNewVal: function() { var items = jQuery( this.container.find( 'li' ) ), newVal = []; _.each( items, function( item ) { if ( ! jQuery( item ).hasClass( 'invisible' ) ) { newVal.push( jQuery( item ).data( 'value' ) ); } }); return newVal; } }); kirki-packages/control-sortable/src/control.scss000064400000000711147177211530016075 0ustar00.customize-control-kirki-sortable { ul.ui-sortable { li { padding: 5px 10px; border: 1px solid #333; background: #fff; .dashicons { &.dashicons-menu { float: right; } &.visibility { margin-right: 10px; } } &.invisible { color: #aaa; border: 1px dashed #aaa; .dashicons.visibility { color: #aaa; } } } } } kirki-packages/control-sortable/src/Field/Sortable.php000064400000004362147177211530017035 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = [ $this, 'sanitize' ]; } } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-sortable'; } return $args; } /** * Sanitizes sortable values. * * @static * @access public * @since 1.0 * @param array $value The checkbox value. * @return array */ public function sanitize( $value = [] ) { $value = (array) $value; foreach ( $value as $key => $sub_value ) { $value[ $key ] = sanitize_text_field( $sub_value ); } return $value; } } kirki-packages/control-sortable/src/Control/Sortable.php000064400000005241147177211530017427 0ustar00

    kirki-packages/settings/templates/metaboxes/clear-font-cache.php000064400000001667147177211530021104 0ustar00


    kirki-packages/settings/templates/metaboxes/documentation.php000064400000002142147177211530020647 0ustar00

    kirki-packages/settings/src/utils.ts000064400000001672147177211530013606 0ustar00export const emptyElement = (el: HTMLElement) => { while (el.firstChild) { el.removeChild(el.firstChild); } }; export const getClosest = ( el: HTMLElement, selector: string, depth?: number ): HTMLElement | undefined => { if (el.matches(selector)) { return el; } if (el.tagName === "BODY" || el.tagName === "HTML") { return undefined; } let closest = undefined; depth = depth ? depth : 20; for (let i = 0; i < depth; i++) { const parentNode = el.parentNode as HTMLElement; if ( !parentNode || parentNode.tagName === "BODY" || parentNode.tagName === "HTML" ) { break; } if (parentNode.matches(selector)) { return parentNode; } el = parentNode; } return closest; }; export const startLoading = (button: HTMLButtonElement | HTMLElement) => { button.classList.add("is-loading"); }; export const stopLoading = (button: HTMLButtonElement | HTMLElement) => { button.classList.remove("is-loading"); }; kirki-packages/settings/src/settings.scss000064400000014154147177211530014632 0ustar00// Vars .kirki-settings-page { --kirki-brand-color: #2764F1; --kirki-danger-color: #47D87C; } // Loading animation @-webkit-keyframes loadingSpinAround { from { transform: rotate(0); } to { transform: rotate(359deg); } } @keyframes loadingSpinAround { from { transform: rotate(0); } to { transform: rotate(359deg); } } .kirki-settings-page { // Button .button.is-loading { display: inline-flex; align-items: center; justify-content: center; color: transparent !important; pointer-events: none; &::after { content: ""; position: absolute; width: 1em; display: block; height: 1em; border: 2px solid #dbdbdb; border-color: transparent transparent #fff #fff !important; border-radius: 290486px; -webkit-animation: loadingSpinAround 0.5s infinite linear; animation: loadingSpinAround 0.5s infinite linear; } } .button-link { border-width: 0; background-color: transparent; font-size: 17px; text-decoration: underline; &:focus, &:active { outline: none; box-shadow: none; border-width: 0; } &.is-disabled { color: #ddd; } &.is-right-side { float: right; &.is-loading { justify-content: flex-end; } } &.is-loading { display: inline-flex; align-items: center; justify-content: center; color: transparent !important; pointer-events: none; &::after { content: ""; position: absolute; width: 1em; display: block; height: 1em; border: 2px solid #7ab4e3; border-color: transparent transparent #2271b1 #2271b1 !important; border-radius: 290486px; -webkit-animation: loadingSpinAround 0.5s infinite linear; animation: loadingSpinAround 0.5s infinite linear; } } } .submission-status { margin-left: 15px; line-height: 39px; } .submission-status.is-hidden { display: none; } .submission-status.is-success { color: #0fa953; } .submission-status.is-error { color: tomato; } } // Featured products .featured-products-banner { img { border: 1px solid #ddd; max-width: 100%; } } .kirki-featured-products { > h2 { text-align: center; margin-bottom: 50px; font-size: 24px; } .products { display: flex; justify-content: space-between; li { width: 32%; } .subheadline { font-weight: 600; margin-top: -6px; } img { max-width: 100%; } } .credit { margin-top: 20px; text-align: center; opacity: 0.5; } } // Heatbox adjustment .heatbox { position: relative; .checkbox-label { .is-disabled { opacity: 0.6; } } .heatbox-overlay.is-hidden { display: none; } .heatbox-overlay { position: absolute; top: 0; left: 0; background-color: rgba(0, 0, 0, 0.1); width: 100%; height: 100%; z-index: 100; } } // Kirki PRO .pro-extensions-banner-link { display: block; margin-bottom: 20px; box-shadow: none !important; } .pro-extensions-banner { max-width: 100%; border: 1px solid #ddd; } .pro-extensions-list { margin: 0; li { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 25px 20px; border-bottom: 1px solid #ddd; &:last-child { border: none; background: #f9f9f9; h3 { margin-bottom: 10px; } p { margin-bottom: 0; } } div { flex: 0 50%; } h3 { display: inline-block; margin-bottom: 0; font-weight: 400; } p { font-size: 16px; } } .tooltip { position: relative; display: inline-block; cursor: pointer; color: #ccc; margin-left: 8px; &:hover { color: #0073aa; p { opacity: 1; z-index: 1; } } p { z-index: -1; opacity: 0; position: absolute; bottom: 15px; left: -40px; width: 250px; background: #fff; padding: 15px; border: 1px solid #ddd; color: initial; -webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15); box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15); border-radius: 4px; } } } .pro-extensions-list-icon { text-align: right; color: #47d87c; left: 0; bottom: 0; i { margin-right: 20px; position: relative; } strong { padding: 2px 4px; border-radius: 4px; background: #47d87c; color: #fff; line-height: 1; margin: 0 10px; font-size: 12px; } .button-larger { padding: 10px 30px; } } // Recommended plugins .kirki-recommended-list { display: flex; flex-wrap: wrap; margin: 0; li { display: flex; flex-direction: column; flex: 0 49%; margin-right: 2%; &:nth-child(even) { margin-right: 0; } & > a { box-shadow: none; } } img { max-width: 100%; } } .kirki-recommended-content { padding: 20px; flex: 1 0 auto; min-height: 150px; p { font-size: 16px; } } .kirki-recommended-status { display: flex; align-items: center; padding: 20px; background: #f9f9f9; border-top: 1px solid #ddd; div { flex: 0 50%; } } .kirki-recommended-status-icon { text-align: right; color: #aaa; &.green { color: #47d87c; } i { font-size: 22px !important; } } // Instant installation progress .installation-progress-metabox { &.is-hidden { display: none; } } .installation-info { font-size: 14px; font-weight: 700; } .installation-progress { display: flex; align-items: center; margin-bottom: 10px; .progress-icon { position: relative; margin-right: 4px; width: 20px; height: 20px; } &.is-loading { .progress-icon { display: inline-flex; align-items: center; justify-content: center; color: transparent !important; pointer-events: none; &::after { content: ""; position: absolute; width: 1em; display: block; height: 1em; border: 2px solid #7ab4e3; border-color: transparent transparent #2271b1 #2271b1 !important; border-radius: 290486px; -webkit-animation: loadingSpinAround 0.5s infinite linear; animation: loadingSpinAround 0.5s infinite linear; } } } &.is-done { .progress-icon::before { content: "\f147"; font-family: dashicons; color: #47d87c; font-size: 20px; } } &.is-failed { .progress-icon::before { content: "\f158"; font-family: dashicons; color: tomato; font-size: 20px; } } .progress-text { flex: 1 1 auto; } } kirki-packages/settings/src/Notice.php000064400000007304147177211530014026 0ustar00id ? true : false ); } /** * Check if we should show the a notice. * * @param string $type The notice type. * @return bool */ public function should_show_notice( $type = 'discount' ) { $notices = get_option( 'kirki_notices', [] ); // Stop here if notice has been dismissed. if ( isset( $notices[ $type . '_notice' ] ) ) { return false; } // Stop here if we're on our settings page. if ( $this->is_settings_page() ) { return false; } // Stop here if current user can't manage options. if ( ! current_user_can( 'manage_options' ) ) { return false; } return true; } /** * Discount notice. */ public function discount_notice() { // Stop here if the notice shouldn't be shown. if ( ! $this->should_show_notice( 'discount' ) ) { return; } ?>

    Font Display Issues? Clear the Font Cache in Kirki

    New! Easily resolve font display issues by clearing the Font Cache in Kirki. This one-click solution fixes problems caused by domain name changes or site migrations.

    Learn more

    should_show_notice( 'discount' ) ) { return; } wp_enqueue_style( 'kirki-admin-notice', KIRKI_PLUGIN_URL . '/kirki-packages/settings/dist/admin-notice.css', array(), KIRKI_VERSION ); wp_enqueue_script( 'kirki-discount-notice', KIRKI_PLUGIN_URL . '/kirki-packages/settings/dist/discount-notice.js', array( 'jquery' ), KIRKI_VERSION, true ); } /** * Dismiss discount notice. */ public function dismiss_discount_notice() { $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( $_POST['nonce'] ) : ''; if ( ! wp_verify_nonce( $nonce, 'Kirki_Dismiss_Discount_Notice' ) ) { wp_send_json_error( __( 'Invalid nonce', 'kirki' ) ); } if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( __( "You don't have capability to run this action", 'kirki' ) ); } $notices = get_option( 'kirki_notices', [] ); $notices['discount_notice'] = 1; update_option( 'kirki_notices', $notices ); wp_send_json_success( __( 'Discount notice has been dismissed', 'kirki' ) ); } } kirki-packages/settings/src/setup-udb.ts000064400000015760147177211530014361 0ustar00import { emptyElement, getClosest, startLoading, stopLoading } from "./utils"; import jQuery from "jquery"; declare var wp: any; declare var kirkiSettings: any; declare var ajaxurl: any; export default function setupUdb() { const adminPage: HTMLElement | null = document.querySelector( ".kirki-settings-page" ); if (!adminPage) return; const progressBox: HTMLElement | null = adminPage.querySelector( ".installation-progress-metabox" ); if (!progressBox) return; const progressList: HTMLElement | null = progressBox.querySelector( ".installation-progress-list" ); if (!progressList) return; let doingAjax = false; const udbData = kirkiSettings.recommendedPlugins.udb; document.addEventListener("click", handleDocumentClick); function handleDocumentClick(e: Event) { const button = getClosest(e.target as HTMLElement, ".kirki-install-udb"); if (!button) return; e.preventDefault(); prepareUdb(button); } function prepareUdb(button: HTMLElement) { if (!adminPage) return; if (doingAjax) return; startProcessing(button); addProgress("Preparing...", "loading"); const nonce = adminPage.dataset.setupUdbNonce ? adminPage.dataset.setupUdbNonce : ""; jQuery .ajax({ url: ajaxurl, method: "POST", data: { action: "kirki_prepare_install_udb", nonce: nonce, }, }) .done(function (response) { if (!response.success) { modifyPreviousProgress(response.data, "failed"); stopProcessing(button, ""); return; } if (response.data.finished) { modifyPreviousProgress( "Ultimate Dashboard has already been installed.", "done" ); addProgress(response.data.message, "done"); addProgress("All done! Redirecting...", "loading"); stopProcessing(button, udbData.redirectUrl); return; } modifyPreviousProgress(response.data.message, "done"); doingAjax = false; installUdb(button); }) .fail(function (jqXHR) { let errorMessage: string = "Something went wrong. Please try again later."; if (jqXHR.responseJSON && jqXHR.responseJSON.data) { errorMessage = jqXHR.responseJSON.data; } modifyPreviousProgress(errorMessage, "failed"); stopProcessing(button, ""); }); } function installUdb(button: HTMLElement) { if (doingAjax) return; doingAjax = true; addProgress("Installing Ultimate Dashboard", "loading"); wp.updates.installPlugin({ slug: udbData.slug, success: function () { modifyPreviousProgress( "Ultimate Dashboard has been installed successfully", "done" ); doingAjax = false; activateUdb(button); }, error: function (jqXHR: any) { let abort = true; if (jqXHR.errorCode && jqXHR.errorMessage) { if (jqXHR.errorCode === "folder_exists") { modifyPreviousProgress( "Ultimate Dashboard has already been installed.", "done" ); doingAjax = false; abort = false; // Since the plugin has already installed since before, let's activate it. activateUdb(button); } else { modifyPreviousProgress(jqXHR.errorMessage, "failed"); } } else { if (jqXHR.responseJSON && jqXHR.responseJSON.data) { modifyPreviousProgress(jqXHR.responseJSON.data, "failed"); } else { modifyPreviousProgress( "Something went wrong. Please try again later.", "failed" ); } } if (abort) stopProcessing(button, ""); }, }); } function activateUdb(button: HTMLElement) { if (doingAjax) return; doingAjax = true; addProgress("Activating Ultimate Dashboard", "loading"); jQuery.ajax({ async: true, type: "GET", url: udbData.activationUrl, success: function () { modifyPreviousProgress( "Ultimate Dashboard has been activated successfully.", "done" ); addProgress("All done! Redirecting...", "loading"); stopProcessing(button, udbData.redirectUrl); }, error: function (jqXHR: any) { if (jqXHR.errorCode && jqXHR.errorMessage) { modifyPreviousProgress(jqXHR.errorMessage, "failed"); } else { if (jqXHR.responseJSON && jqXHR.responseJSON.data) { modifyPreviousProgress(jqXHR.responseJSON.data, "failed"); } else { modifyPreviousProgress( "Something went wrong. Please try again later.", "failed" ); } } stopProcessing(button, ""); }, }); } function addProgress(text: string, status: string) { if (!progressList) return; const li = document.createElement("li"); li.className = "installation-progress"; if (status === "done") { li.classList.add("is-done"); } else if (status === "failed") { li.classList.add("is-failed"); } else { li.classList.add("is-loading"); } const iconDiv = document.createElement("div"); iconDiv.className = "progress-icon"; li.appendChild(iconDiv); const textDiv = document.createElement("div"); textDiv.className = "progress-text"; textDiv.innerHTML = text; li.appendChild(textDiv); progressList.appendChild(li); } function modifyPreviousProgress(text: string, status: string) { if (!progressList) return; const li = progressList.querySelector(".installation-progress:last-child"); if (!li) return; if (status === "done") { li.classList.remove("is-loading"); li.classList.add("is-done"); } else if (status === "failed") { li.classList.remove("is-loading"); li.classList.add("is-failed"); } else { li.classList.remove("is-done"); li.classList.remove("is-failed"); li.classList.add("is-loading"); } if (text) { const textDiv = li.querySelector(".progress-text"); if (!textDiv) return; textDiv.innerHTML = text; } } function disableOrEnableOtherButtons( actionType: string, currentButton: HTMLElement | HTMLButtonElement ) { const buttons = document.querySelectorAll(".kirki-install-udb"); if (!buttons.length) return; buttons.forEach((button) => { if (actionType === "disable") { if (currentButton && button === currentButton) return; } if (button.tagName.toLowerCase() === "button") { if (actionType === "disable") { // button.setAttribute("disabled", "disabled"); button.classList.add("is-loading"); } else { // button.removeAttribute("disabled"); button.classList.remove("is-loading"); } } else { if (actionType === "disable") { // button.classList.add("is-disabled"); button.classList.add("is-loading"); } else { // button.classList.remove("is-disabled"); button.classList.remove("is-loading"); } } }); } function startProcessing(button: HTMLElement) { if (progressBox && progressList) { emptyElement(progressList); progressBox.classList.remove("is-hidden"); } doingAjax = true; disableOrEnableOtherButtons("disable", button); startLoading(button); } function stopProcessing(button: HTMLElement, redirectUrl: string) { if (redirectUrl) { window.setTimeout(() => { window.location.replace(redirectUrl); }, 1000); } stopLoading(button); doingAjax = false; disableOrEnableOtherButtons("enable", button); } } kirki-packages/settings/src/tabs.ts000064400000002571147177211530013376 0ustar00import jQuery from "jquery"; export default function setupTabsNavigation() { jQuery(".heatbox-tab-nav-item").on("click", function () { jQuery(".heatbox-tab-nav-item").removeClass("active"); jQuery(this).addClass("active"); const link = this.querySelector("a"); if (!link) return; if (link.href.indexOf("#") === -1) return; const hashValue = link.href.substring(link.href.indexOf("#") + 1); jQuery(".heatbox-panel-wrapper .heatbox-admin-panel").css( "display", "none" ); jQuery(".heatbox-panel-wrapper .kirki-" + hashValue + "-panel").css( "display", "block" ); }); window.addEventListener("load", function () { let hashValue = window.location.hash.substring(1); let currentActiveTabMenu: HTMLElement | null = null; if (!hashValue) { currentActiveTabMenu = document.querySelector( ".heatbox-tab-nav-item.active" ); if (currentActiveTabMenu && currentActiveTabMenu.dataset.tab) { hashValue = currentActiveTabMenu.dataset.tab; } hashValue = hashValue ? hashValue : "settings"; } jQuery(".heatbox-tab-nav-item").removeClass("active"); jQuery(".heatbox-tab-nav-item.kirki-" + hashValue + "-panel").addClass( "active" ); jQuery(".heatbox-panel-wrapper .heatbox-admin-panel").css( "display", "none" ); jQuery(".heatbox-panel-wrapper .kirki-" + hashValue + "-panel").css( "display", "block" ); }); } kirki-packages/settings/src/settings.ts000064400000003345147177211530014305 0ustar00import "./settings.scss"; import setupUdb from "./setup-udb"; import setupTabsNavigation from "./tabs"; declare var ajaxurl: string; (function () { setupTabsNavigation(); setupUdb(); const metabox = document.querySelector(".kirki-clear-font-cache-metabox"); if (!metabox) return; var notice = metabox.querySelector(".submission-status"); if (!notice) return; const button = metabox.querySelector(".kirki-clear-font-cache"); if (!button) return; button.addEventListener("click", clearFontCache); let doingAjax = false; let timeoutId: number = 0; function clearFontCache(e: Event) { if (doingAjax) return; doingAjax = true; const button = this as HTMLButtonElement; button.classList.add("is-loading"); if (timeoutId) { window.clearTimeout(timeoutId); } timeoutId = 0; var data = { action: "kirki_clear_font_cache", nonce: button.dataset.nonce, }; jQuery .ajax({ url: ajaxurl, type: "POST", data: data, }) .done(function (r) { showNotice(r.success ? "success" : "error", r.data); }) .fail(function (r) { showNotice("error", "Something went wrong."); }) .always(function (r) { doingAjax = false; button.classList.remove("is-loading"); timeoutId = window.setTimeout(function () { hideNotice(); }, 4000); }); } function showNotice(status: string, textContent: string) { if (!notice) return; notice.textContent = textContent; notice.classList.add(status === "success" ? "is-success" : "is-error"); notice.classList.remove("is-hidden"); } function hideNotice() { if (!notice) return; notice.textContent = ""; notice.classList.remove("is-success"); notice.classList.remove("is-error"); notice.classList.add("is-hidden"); } })(); kirki-packages/settings/src/discount-notice.ts000064400000001276147177211530015555 0ustar00import { getClosest } from "./utils"; import jQuery from "jquery"; declare var ajaxurl: string; (function () { function init() { jQuery(document).on( "click", ".kirki-discount-notice.is-dismissible .notice-dismiss", dismiss ); } function dismiss(e: JQuery.ClickEvent) { const notice = getClosest(this, ".kirki-discount-notice"); if (!notice) return; let nonce = notice.dataset.dismissNonce; nonce = nonce ? nonce : ""; jQuery .ajax({ url: ajaxurl, type: "post", data: { action: "kirki_dismiss_discount_notice", nonce: nonce, dismiss: 1, }, }) .always(function (r) { if (r.success) console.log(r.data); }); } init(); })(); kirki-packages/settings/src/SetupSettings.php000064400000010760147177211530015426 0ustar00id ? true : false ); } /** * Enqueue admin styles. */ public function admin_styles() { if ( ! $this->is_settings_page() ) { return; } wp_enqueue_style( 'heatbox', KIRKI_PLUGIN_URL . '/kirki-packages/settings/dist/heatbox.css', array(), KIRKI_VERSION ); wp_enqueue_style( 'kirki-settings', KIRKI_PLUGIN_URL . '/kirki-packages/settings/dist/settings.css', array(), KIRKI_VERSION ); } /** * Enqueue admin scripts. */ public function admin_scripts() { if ( ! $this->is_settings_page() ) { return; } wp_enqueue_script( 'updates' ); wp_enqueue_script( 'kirki-settings', KIRKI_PLUGIN_URL . '/kirki-packages/settings/dist/settings.js', array( 'jquery', 'wp-polyfill' ), KIRKI_VERSION, true ); $udb_name = ''; $udb_slug = ''; $udb_file = ''; $udb_basename = $udb_slug . '/' . $udb_file; $udb_activation_url = add_query_arg( array( 'action' => 'activate', 'plugin' => rawurlencode( $udb_basename ), 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $udb_basename ), ), network_admin_url( 'plugins.php' ) ); $js_objects = array( 'recommendedPlugins' => [ 'udb' => [ 'name' => $udb_name, 'slug' => $udb_slug, 'basename' => $udb_basename, 'activationUrl' => $udb_activation_url, 'redirectUrl' => admin_url( 'edit.php?post_type=udb_widgets&page=udb_plugin_onboarding' ), ], ], ); wp_localize_script( 'kirki-settings', 'kirkiSettings', $js_objects ); } /** * Admin body class. * * @param string $classes The existing body classes. * @return string The body classes. */ public function admin_body_class( $classes ) { if ( ! $this->is_settings_page() ) { return $classes; } $classes .= ' heatbox-admin has-header'; return $classes; } /** * Ajax handler to clear font cache directory. */ public function clear_font_cache() { $nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( $_POST['nonce'] ) : ''; if ( ! wp_verify_nonce( $nonce, 'Kirki_Clear_Font_Cache' ) ) { wp_send_json_error( 'Invalid nonce' ); } $capability = apply_filters( 'kirki_settings_capability', 'manage_options' ); if ( ! current_user_can( $capability ) ) { wp_send_json_error( "You don't have capability to run this action" ); } include_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'; include_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php'; $file_system = new WP_Filesystem_Direct( false ); $fonts_dir = WP_CONTENT_DIR . '/fonts'; if ( is_dir( $fonts_dir ) ) { // Delete fonts directory. $file_system->rmdir( $fonts_dir, true ); } else { wp_send_json_error( 'No local fonts found.', 'kirki' ); } wp_send_json_success( 'Font cache cleared.', 'kirki' ); } } kirki-packages/settings/src/admin-notice.scss000064400000001026147177211530015333 0ustar00.kirki-admin-notice { padding: 25px 20px; } .kirki-admin-notice .notice-body { display: flex; } .kirki-admin-notice .notice-icon { padding-right: 25px; } .kirki-admin-notice .notice-icon img { max-width: 55px; } .kirki-admin-notice .notice-content { width: 100%; } .kirki-admin-notice .notice-content h2 { margin-top: 0; margin-bottom: 10px; font-weight: 700; } .kirki-admin-notice .notice-content > p { margin-top: 0; margin-bottom: 10px; } .kirki-admin-notice .notice-content > p:last-child { margin-bottom: 0; } kirki-packages/settings/dist/discount-notice.js.map000064400000006240147177211530016467 0ustar00{"mappings":"6DAAO,MAMMA,EAAa,CACzBC,EACAC,EACAC,KAEA,GAAIF,EAAGG,QAAQF,GACd,OAAOD,EAGR,GAAmB,SAAfA,EAAGI,SAAqC,SAAfJ,EAAGI,QAC/B,OAGD,IAAIC,EACJH,EAAQA,GAAgB,GAExB,IAAK,IAAII,EAAI,EAAGA,EAAIJ,EAAOI,IAAK,CAC/B,MAAMC,EAAaP,EAAGO,WAEtB,IACEA,GACsB,SAAvBA,EAAWH,SACY,SAAvBG,EAAWH,QAEX,MAGD,GAAIG,EAAWJ,QAAQF,GACtB,OAAOM,EAGRP,EAAKO,CACN,CAEA,OAAOF,CAAA,E,MCxCRG,EAAeC,OCKd,WASA,SAASC,EAAQC,GAChB,MAAMC,EAASb,EAAWc,KAAM,0BAChC,IAAKD,EAAQ,OACb,IAAIE,EAAQF,EAAOG,QAAQC,aAC3BF,EAAQA,GAAgB,GAExBG,EAAAT,GACEU,KAAK,CACLC,IAAKC,QACLC,KAAM,OACNC,KAAM,CACLC,OAAQ,gCACRT,MAAOA,EACPJ,QAAS,KAGVc,QAAO,SAAUC,GACbA,EAAEC,SAASC,QAAQC,IAAIH,EAAEH,KAC9B,GACF,CA1BCL,EAAAT,EAAA,CAAOqB,UAAUC,GAChB,QACA,wDACApB,EA0BH,CA/BC,E","sources":["kirki-packages/settings/src/utils.ts","jQuery.js","kirki-packages/settings/src/discount-notice.ts"],"sourcesContent":["export const emptyElement = (el: HTMLElement) => {\n\twhile (el.firstChild) {\n\t\tel.removeChild(el.firstChild);\n\t}\n};\n\nexport const getClosest = (\n\tel: HTMLElement,\n\tselector: string,\n\tdepth?: number\n): HTMLElement | undefined => {\n\tif (el.matches(selector)) {\n\t\treturn el;\n\t}\n\n\tif (el.tagName === \"BODY\" || el.tagName === \"HTML\") {\n\t\treturn undefined;\n\t}\n\n\tlet closest = undefined;\n\tdepth = depth ? depth : 20;\n\n\tfor (let i = 0; i < depth; i++) {\n\t\tconst parentNode = el.parentNode as HTMLElement;\n\n\t\tif (\n\t\t\t!parentNode ||\n\t\t\tparentNode.tagName === \"BODY\" ||\n\t\t\tparentNode.tagName === \"HTML\"\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (parentNode.matches(selector)) {\n\t\t\treturn parentNode;\n\t\t}\n\n\t\tel = parentNode;\n\t}\n\n\treturn closest;\n};\n\nexport const startLoading = (button: HTMLButtonElement | HTMLElement) => {\n\tbutton.classList.add(\"is-loading\");\n};\n\nexport const stopLoading = (button: HTMLButtonElement | HTMLElement) => {\n\tbutton.classList.remove(\"is-loading\");\n};\n","module.exports=jQuery;","import { getClosest } from \"./utils\";\r\nimport jQuery from \"jquery\";\r\n\r\ndeclare var ajaxurl: string;\r\n\r\n(function () {\r\n\tfunction init() {\r\n\t\tjQuery(document).on(\r\n\t\t\t\"click\",\r\n\t\t\t\".kirki-discount-notice.is-dismissible .notice-dismiss\",\r\n\t\t\tdismiss\r\n\t\t);\r\n\t}\r\n\r\n\tfunction dismiss(e: JQuery.ClickEvent) {\r\n\t\tconst notice = getClosest(this, \".kirki-discount-notice\");\r\n\t\tif (!notice) return;\r\n\t\tlet nonce = notice.dataset.dismissNonce;\r\n\t\tnonce = nonce ? nonce : \"\";\r\n\r\n\t\tjQuery\r\n\t\t\t.ajax({\r\n\t\t\t\turl: ajaxurl,\r\n\t\t\t\ttype: \"post\",\r\n\t\t\t\tdata: {\r\n\t\t\t\t\taction: \"kirki_dismiss_discount_notice\",\r\n\t\t\t\t\tnonce: nonce,\r\n\t\t\t\t\tdismiss: 1,\r\n\t\t\t\t},\r\n\t\t\t})\r\n\t\t\t.always(function (r) {\r\n\t\t\t\tif (r.success) console.log(r.data);\r\n\t\t\t});\r\n\t}\r\n\r\n\tinit();\r\n})();\r\n"],"names":["$f448701b1a546a82$export$211731fc355e9121","el","selector","depth","matches","tagName","closest","i","parentNode","$0a2eb9defebd2c69$exports","jQuery","dismiss","e","notice","this","nonce","dataset","dismissNonce","$parcel$interopDefault","ajax","url","ajaxurl","type","data","action","always","r","success","console","log","document","on"],"version":3,"file":"discount-notice.js.map"}kirki-packages/settings/dist/discount-notice.js000064400000001322147177211530015707 0ustar00!function(){function t(t){return t&&t.__esModule?t.default:t}const i=(t,i,e)=>{if(t.matches(i))return t;if("BODY"===t.tagName||"HTML"===t.tagName)return;let n;e=e||20;for(let n=0;n p {\n margin-top: 0;\n margin-bottom: 10px;\n}\n\n.kirki-admin-notice .notice-content > p:last-child {\n margin-bottom: 0;\n}\n\n/*# sourceMappingURL=admin-notice.css.map */\n",".kirki-admin-notice {\r\n\tpadding: 25px 20px;\r\n}\r\n\r\n.kirki-admin-notice .notice-body {\r\n\tdisplay: flex;\r\n}\r\n\r\n.kirki-admin-notice .notice-icon {\r\n\tpadding-right: 25px;\r\n}\r\n\r\n.kirki-admin-notice .notice-icon img {\r\n\tmax-width: 55px;\r\n}\r\n\r\n.kirki-admin-notice .notice-content {\r\n\twidth: 100%;\r\n}\r\n\r\n.kirki-admin-notice .notice-content h2 {\r\n\tmargin-top: 0;\r\n\tmargin-bottom: 10px;\r\n\tfont-weight: 700;\r\n}\r\n\r\n.kirki-admin-notice .notice-content > p {\r\n\tmargin-top: 0;\r\n\tmargin-bottom: 10px;\r\n}\r\n\r\n.kirki-admin-notice .notice-content > p:last-child {\r\n\tmargin-bottom: 0;\r\n}\r\n"],"names":[],"version":3,"file":"admin-notice.css.map"}kirki-packages/settings/dist/settings.js.map000064400000047316147177211530015231 0ustar00{"mappings":"6DAAO,MAAMA,EAAgBC,IAC5B,KAAOA,EAAGC,YACTD,EAAGE,YAAYF,EAAGC,WAAU,EAIjBE,EAAa,CACzBH,EACAI,EACAC,KAEA,GAAIL,EAAGM,QAAQF,GACd,OAAOJ,EAGR,GAAmB,SAAfA,EAAGO,SAAqC,SAAfP,EAAGO,QAC/B,OAGD,IAAIC,EACJH,EAAQA,GAAgB,GAExB,IAAK,IAAII,EAAI,EAAGA,EAAIJ,EAAOI,IAAK,CAC/B,MAAMC,EAAaV,EAAGU,WAEtB,IACEA,GACsB,SAAvBA,EAAWH,SACY,SAAvBG,EAAWH,QAEX,MAGD,GAAIG,EAAWJ,QAAQF,GACtB,OAAOM,EAGRV,EAAKU,CACN,CAEA,OAAOF,CAAA,EAGKG,EAAgBC,IAC5BA,EAAOC,UAAUC,IAAI,eAGTC,EAAeH,IAC3BA,EAAOC,UAAUG,OAAO,e,MCzCV,SAAAC,IACd,MAAMC,EAAgCC,SAASC,cAC9C,wBAED,IAAKF,EAAW,OAEhB,MAAMG,EAAkCH,EAAUE,cACjD,kCAED,IAAKC,EAAa,OAElB,MAAMC,EAAmCD,EAAYD,cACpD,+BAED,IAAKE,EAAc,OAEnB,IAAIC,GAAY,EAChB,MAAMC,EAAUC,cAAcC,mBAAmBC,IAmHjD,SAASC,EAAYhB,GAChBW,IACJA,GAAY,EACZM,EAAY,gCAAiC,WAE7CC,EAAAC,GAAOC,KAAK,CACXC,OAAO,EACPC,KAAM,MACNC,IAAKX,EAAQY,cACbC,QAAS,WACRC,EACC,sDACA,QAGDT,EAAY,2BAA4B,WACxCU,EAAe3B,EAAQY,EAAQgB,YAChC,EACAC,MAAO,SAAUC,GACZA,EAAMC,WAAaD,EAAME,aAC5BN,EAAuBI,EAAME,aAAc,UAEvCF,EAAMG,cAAgBH,EAAMG,aAAaC,KAC5CR,EAAuBI,EAAMG,aAAaC,KAAM,UAEhDR,EACC,gDACA,UAKHC,EAAe3B,EAAQ,GACxB,IAEF,CAEA,SAASiB,EAAYkB,EAAcC,GAClC,IAAK1B,EAAc,OACnB,MAAM2B,EAAK9B,SAAS+B,cAAc,MAClCD,EAAGE,UAAY,wBAEA,SAAXH,EACHC,EAAGpC,UAAUC,IAAI,WACI,WAAXkC,EACVC,EAAGpC,UAAUC,IAAI,aAEjBmC,EAAGpC,UAAUC,IAAI,cAGlB,MAAMsC,EAAUjC,SAAS+B,cAAc,OACvCE,EAAQD,UAAY,gBACpBF,EAAGI,YAAYD,GAEf,MAAME,EAAUnC,SAAS+B,cAAc,OACvCI,EAAQH,UAAY,gBACpBG,EAAQC,UAAYR,EACpBE,EAAGI,YAAYC,GAEfhC,EAAa+B,YAAYJ,EAC1B,CAEA,SAASX,EAAuBS,EAAcC,GAC7C,IAAK1B,EAAc,OACnB,MAAM2B,EAAK3B,EAAaF,cAAc,qCACtC,GAAK6B,IAEU,SAAXD,GACHC,EAAGpC,UAAUG,OAAO,cACpBiC,EAAGpC,UAAUC,IAAI,YACI,WAAXkC,GACVC,EAAGpC,UAAUG,OAAO,cACpBiC,EAAGpC,UAAUC,IAAI,eAEjBmC,EAAGpC,UAAUG,OAAO,WACpBiC,EAAGpC,UAAUG,OAAO,aACpBiC,EAAGpC,UAAUC,IAAI,eAGdiC,GAAM,CACT,MAAMO,EAAUL,EAAG7B,cAAc,kBACjC,IAAKkC,EAAS,OACdA,EAAQC,UAAYR,CACrB,CACD,CAEA,SAASS,EACRC,EACAC,GAEA,MAAMC,EAAUxC,SAASyC,iBAAiB,sBACrCD,EAAQE,QAEbF,EAAQG,SAASlD,IACG,YAAf6C,GACCC,GAAiB9C,IAAW8C,IAG7B9C,EAAOL,QAAQwD,cACC,YAAfN,EAEH7C,EAAOC,UAAUC,IAAI,cAGrBF,EAAOC,UAAUG,OAAO,cAQA,GAI5B,CAaA,SAASuB,EAAe3B,EAAqB4B,GACxCA,GACHwB,OAAOC,YAAW,KACjBD,OAAOE,SAASC,QAAQ3B,EAAA,GACtB,KAGJzB,EAAYH,GACZW,GAAY,EACZiC,EAA4B,SAAU5C,EACvC,CA5PAO,SAASiD,iBAAiB,SAE1B,SAA6BC,GAC5B,MAAMzD,EAAST,EAAWkE,EAAEC,OAAuB,sBACnD,IAAK1D,EAAQ,OAEbyD,EAAEE,iBAIH,SAAoB3D,GACnB,IAAKM,EAAW,OAChB,GAAIK,EAAW,QA2NhB,SAAyBX,GACpBS,GAAeC,IAClBvB,EAAauB,GACbD,EAAYR,UAAUG,OAAO,cAG9BO,GAAY,EACZiC,EAA4B,UAAW5C,GACvCD,EAAaC,EACd,EAnOC4D,CAAgB5D,GAChBiB,EAAY,eAAgB,WAE5B,MAAM4C,EAAQvD,EAAUwD,QAAQC,cAC7BzD,EAAUwD,QAAQC,cAClB,GAEH7C,EAAAC,GACEC,KAAK,CACLG,IAAKyC,QACLC,OAAQ,OACR/B,KAAM,CACLgC,OAAQ,4BACRL,MAAOA,KAGRM,MAAK,SAAUC,GACf,OAAKA,EAAS3C,QAMV2C,EAASlC,KAAKmC,UACjB3C,EACC,iDACA,QAEDT,EAAYmD,EAASlC,KAAKoC,QAAS,QACnCrD,EAAY,2BAA4B,gBACxCU,EAAe3B,EAAQY,EAAQgB,eAIhCF,EAAuB0C,EAASlC,KAAKoC,QAAS,QAC9C3D,GAAY,OAgBf,SAAoBX,GACnB,GAAIW,EAAW,OACfA,GAAY,EACZM,EAAY,gCAAiC,WAE7CsD,GAAGC,QAAQC,cAAc,CACxBC,KAAM9D,EAAQ8D,KACdjD,QAAS,WACRC,EACC,qDACA,QAEDf,GAAY,EACZK,EAAYhB,EACb,EACA6B,MAAO,SAAUC,GAChB,IAAI6C,GAAQ,EAER7C,EAAMC,WAAaD,EAAME,aACJ,kBAApBF,EAAMC,WACTL,EACC,iDACA,QAGDf,GAAY,EACZgE,GAAQ,EAGR3D,EAAYhB,IAEZ0B,EAAuBI,EAAME,aAAc,UAGxCF,EAAMG,cAAgBH,EAAMG,aAAaC,KAC5CR,EAAuBI,EAAMG,aAAaC,KAAM,UAEhDR,EACC,gDACA,UAKCiD,GAAOhD,EAAe3B,EAAQ,GACnC,GAEF,CA9DG4E,CAAW5E,KAlBV0B,EAAuB0C,EAASlC,KAAM,eACtCP,EAAe3B,EAAQ,IAkBzB,IACC6E,MAAK,SAAU/C,GACf,IAAIE,EACH,gDAEGF,EAAMG,cAAgBH,EAAMG,aAAaC,OAC5CF,EAAeF,EAAMG,aAAaC,MAGnCR,EAAuBM,EAAc,UACrCL,EAAe3B,EAAQ,GACxB,GACF,CAvDC8E,CAAW9E,EACZ,GAqPD,CCvRAmB,EAAe4D,OCMd,WCHA7D,EAAAC,EAAA,CAAO,yBAAyB6D,GAAG,SAAS,WAC3C9D,EAAAC,EAAA,CAAO,yBAAyB8D,YAAY,UAC5C/D,EAAAC,EAAA,CAAO+D,MAAMC,SAAS,UAEtB,MAAMC,EAAOF,KAAK1E,cAAc,KAChC,IAAK4E,EAAM,OAEX,IAA+B,IAA3BA,EAAKC,KAAKC,QAAQ,KAAa,OAEnC,MAAMC,EAAYH,EAAKC,KAAKG,UAAUJ,EAAKC,KAAKC,QAAQ,KAAO,GAE/DpE,EAAAC,EAAA,CAAO,+CAA+CsE,IACrD,UACA,QAGDvE,EAAAC,EAAA,CAAO,iCAAmCoE,EAAY,UAAUE,IAC/D,UACA,QAEF,IAEArC,OAAOI,iBAAiB,QAAQ,WAC/B,IAAI+B,EAAYnC,OAAOE,SAASoC,KAAKF,UAAU,GAC3CG,EAA2C,KAE1CJ,IACJI,EAAuBpF,SAASC,cAC/B,gCAGGmF,GAAwBA,EAAqB7B,QAAQ8B,MACxDL,EAAYI,EAAqB7B,QAAQ8B,KAG1CL,EAAYA,GAAwB,YAGrCrE,EAAAC,EAAA,CAAO,yBAAyB8D,YAAY,UAC5C/D,EAAAC,EAAA,CAAO,+BAAiCoE,EAAY,UAAUJ,SAC7D,UAGDjE,EAAAC,EAAA,CAAO,+CAA+CsE,IACrD,UACA,QAGDvE,EAAAC,EAAA,CAAO,iCAAmCoE,EAAY,UAAUE,IAC/D,UACA,QAEF,ID/CApF,IAEA,MAAMwF,EAAUtF,SAASC,cAAc,mCACvC,IAAKqF,EAAS,OAEd,IAAIC,EAASD,EAAQrF,cAAc,sBACnC,IAAKsF,EAAQ,OAEb,MAAM9F,EAAS6F,EAAQrF,cAAc,2BACrC,IAAKR,EAAQ,OAEbA,EAAOwD,iBAAiB,SAKxB,SAAwBC,GACvB,GAAI9C,EAAW,OACfA,GAAY,EAEZ,MAAMX,EAASkF,KACflF,EAAOC,UAAUC,IAAI,cAEjB6F,GACH3C,OAAO4C,aAAaD,GAGrBA,EAAY,EAEZ,IAAI7D,EAAO,CACVgC,OAAQ,yBACRL,MAAO7D,EAAO8D,QAAQD,OAGvBkB,OACE3D,KAAK,CACLG,IAAKyC,QACL1C,KAAM,OACNY,KAAMA,IAENiC,MAAK,SAAU8B,GACfC,EAAWD,EAAExE,QAAU,UAAY,QAASwE,EAAE/D,KAC/C,IACC2C,MAAK,SAAUoB,GACfC,EAAW,QAAS,wBACrB,IACCC,QAAO,SAAUF,GACjBtF,GAAY,EACZX,EAAOC,UAAUG,OAAO,cAExB2F,EAAY3C,OAAOC,YAAW,YAajC,WACC,IAAKyC,EAAQ,OACbA,EAAOM,YAAc,GACrBN,EAAO7F,UAAUG,OAAO,cACxB0F,EAAO7F,UAAUG,OAAO,YACxB0F,EAAO7F,UAAUC,IAAI,YACtB,CAlBImG,EACD,GAAG,IACJ,GACF,IAzCA,IAAI1F,GAAY,EACZoF,EAAoB,EA0CxB,SAASG,EAAW9D,EAAgBgE,GAC9BN,IACLA,EAAOM,YAAcA,EACrBN,EAAO7F,UAAUC,IAAe,YAAXkC,EAAuB,aAAe,YAC3D0D,EAAO7F,UAAUG,OAAO,aACzB,CASD,CAxEC,E","sources":["kirki-packages/settings/src/utils.ts","kirki-packages/settings/src/setup-udb.ts","jQuery.js","kirki-packages/settings/src/settings.ts","kirki-packages/settings/src/tabs.ts"],"sourcesContent":["export const emptyElement = (el: HTMLElement) => {\n\twhile (el.firstChild) {\n\t\tel.removeChild(el.firstChild);\n\t}\n};\n\nexport const getClosest = (\n\tel: HTMLElement,\n\tselector: string,\n\tdepth?: number\n): HTMLElement | undefined => {\n\tif (el.matches(selector)) {\n\t\treturn el;\n\t}\n\n\tif (el.tagName === \"BODY\" || el.tagName === \"HTML\") {\n\t\treturn undefined;\n\t}\n\n\tlet closest = undefined;\n\tdepth = depth ? depth : 20;\n\n\tfor (let i = 0; i < depth; i++) {\n\t\tconst parentNode = el.parentNode as HTMLElement;\n\n\t\tif (\n\t\t\t!parentNode ||\n\t\t\tparentNode.tagName === \"BODY\" ||\n\t\t\tparentNode.tagName === \"HTML\"\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (parentNode.matches(selector)) {\n\t\t\treturn parentNode;\n\t\t}\n\n\t\tel = parentNode;\n\t}\n\n\treturn closest;\n};\n\nexport const startLoading = (button: HTMLButtonElement | HTMLElement) => {\n\tbutton.classList.add(\"is-loading\");\n};\n\nexport const stopLoading = (button: HTMLButtonElement | HTMLElement) => {\n\tbutton.classList.remove(\"is-loading\");\n};\n","import { emptyElement, getClosest, startLoading, stopLoading } from \"./utils\";\nimport jQuery from \"jquery\";\n\ndeclare var wp: any;\ndeclare var kirkiSettings: any;\ndeclare var ajaxurl: any;\n\nexport default function setupUdb() {\n\tconst adminPage: HTMLElement | null = document.querySelector(\n\t\t\".kirki-settings-page\"\n\t);\n\tif (!adminPage) return;\n\n\tconst progressBox: HTMLElement | null = adminPage.querySelector(\n\t\t\".installation-progress-metabox\"\n\t);\n\tif (!progressBox) return;\n\n\tconst progressList: HTMLElement | null = progressBox.querySelector(\n\t\t\".installation-progress-list\"\n\t);\n\tif (!progressList) return;\n\n\tlet doingAjax = false;\n\tconst udbData = kirkiSettings.recommendedPlugins.udb;\n\n\tdocument.addEventListener(\"click\", handleDocumentClick);\n\n\tfunction handleDocumentClick(e: Event) {\n\t\tconst button = getClosest(e.target as HTMLElement, \".kirki-install-udb\");\n\t\tif (!button) return;\n\n\t\te.preventDefault();\n\t\tprepareUdb(button);\n\t}\n\n\tfunction prepareUdb(button: HTMLElement) {\n\t\tif (!adminPage) return;\n\t\tif (doingAjax) return;\n\t\tstartProcessing(button);\n\t\taddProgress(\"Preparing...\", \"loading\");\n\n\t\tconst nonce = adminPage.dataset.setupUdbNonce\n\t\t\t? adminPage.dataset.setupUdbNonce\n\t\t\t: \"\";\n\n\t\tjQuery\n\t\t\t.ajax({\n\t\t\t\turl: ajaxurl,\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tdata: {\n\t\t\t\t\taction: \"kirki_prepare_install_udb\",\n\t\t\t\t\tnonce: nonce,\n\t\t\t\t},\n\t\t\t})\n\t\t\t.done(function (response) {\n\t\t\t\tif (!response.success) {\n\t\t\t\t\tmodifyPreviousProgress(response.data, \"failed\");\n\t\t\t\t\tstopProcessing(button, \"\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (response.data.finished) {\n\t\t\t\t\tmodifyPreviousProgress(\n\t\t\t\t\t\t\"Ultimate Dashboard has already been installed.\",\n\t\t\t\t\t\t\"done\"\n\t\t\t\t\t);\n\t\t\t\t\taddProgress(response.data.message, \"done\");\n\t\t\t\t\taddProgress(\"All done! Redirecting...\", \"loading\");\n\t\t\t\t\tstopProcessing(button, udbData.redirectUrl);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tmodifyPreviousProgress(response.data.message, \"done\");\n\t\t\t\tdoingAjax = false;\n\t\t\t\tinstallUdb(button);\n\t\t\t})\n\t\t\t.fail(function (jqXHR) {\n\t\t\t\tlet errorMessage: string =\n\t\t\t\t\t\"Something went wrong. Please try again later.\";\n\n\t\t\t\tif (jqXHR.responseJSON && jqXHR.responseJSON.data) {\n\t\t\t\t\terrorMessage = jqXHR.responseJSON.data;\n\t\t\t\t}\n\n\t\t\t\tmodifyPreviousProgress(errorMessage, \"failed\");\n\t\t\t\tstopProcessing(button, \"\");\n\t\t\t});\n\t}\n\n\tfunction installUdb(button: HTMLElement) {\n\t\tif (doingAjax) return;\n\t\tdoingAjax = true;\n\t\taddProgress(\"Installing Ultimate Dashboard\", \"loading\");\n\n\t\twp.updates.installPlugin({\n\t\t\tslug: udbData.slug,\n\t\t\tsuccess: function () {\n\t\t\t\tmodifyPreviousProgress(\n\t\t\t\t\t\"Ultimate Dashboard has been installed successfully\",\n\t\t\t\t\t\"done\"\n\t\t\t\t);\n\t\t\t\tdoingAjax = false;\n\t\t\t\tactivateUdb(button);\n\t\t\t},\n\t\t\terror: function (jqXHR: any) {\n\t\t\t\tlet abort = true;\n\n\t\t\t\tif (jqXHR.errorCode && jqXHR.errorMessage) {\n\t\t\t\t\tif (jqXHR.errorCode === \"folder_exists\") {\n\t\t\t\t\t\tmodifyPreviousProgress(\n\t\t\t\t\t\t\t\"Ultimate Dashboard has already been installed.\",\n\t\t\t\t\t\t\t\"done\"\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tdoingAjax = false;\n\t\t\t\t\t\tabort = false;\n\n\t\t\t\t\t\t// Since the plugin has already installed since before, let's activate it.\n\t\t\t\t\t\tactivateUdb(button);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmodifyPreviousProgress(jqXHR.errorMessage, \"failed\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (jqXHR.responseJSON && jqXHR.responseJSON.data) {\n\t\t\t\t\t\tmodifyPreviousProgress(jqXHR.responseJSON.data, \"failed\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmodifyPreviousProgress(\n\t\t\t\t\t\t\t\"Something went wrong. Please try again later.\",\n\t\t\t\t\t\t\t\"failed\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (abort) stopProcessing(button, \"\");\n\t\t\t},\n\t\t});\n\t}\n\n\tfunction activateUdb(button: HTMLElement) {\n\t\tif (doingAjax) return;\n\t\tdoingAjax = true;\n\t\taddProgress(\"Activating Ultimate Dashboard\", \"loading\");\n\n\t\tjQuery.ajax({\n\t\t\tasync: true,\n\t\t\ttype: \"GET\",\n\t\t\turl: udbData.activationUrl,\n\t\t\tsuccess: function () {\n\t\t\t\tmodifyPreviousProgress(\n\t\t\t\t\t\"Ultimate Dashboard has been activated successfully.\",\n\t\t\t\t\t\"done\"\n\t\t\t\t);\n\n\t\t\t\taddProgress(\"All done! Redirecting...\", \"loading\");\n\t\t\t\tstopProcessing(button, udbData.redirectUrl);\n\t\t\t},\n\t\t\terror: function (jqXHR: any) {\n\t\t\t\tif (jqXHR.errorCode && jqXHR.errorMessage) {\n\t\t\t\t\tmodifyPreviousProgress(jqXHR.errorMessage, \"failed\");\n\t\t\t\t} else {\n\t\t\t\t\tif (jqXHR.responseJSON && jqXHR.responseJSON.data) {\n\t\t\t\t\t\tmodifyPreviousProgress(jqXHR.responseJSON.data, \"failed\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmodifyPreviousProgress(\n\t\t\t\t\t\t\t\"Something went wrong. Please try again later.\",\n\t\t\t\t\t\t\t\"failed\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstopProcessing(button, \"\");\n\t\t\t},\n\t\t});\n\t}\n\n\tfunction addProgress(text: string, status: string) {\n\t\tif (!progressList) return;\n\t\tconst li = document.createElement(\"li\");\n\t\tli.className = \"installation-progress\";\n\n\t\tif (status === \"done\") {\n\t\t\tli.classList.add(\"is-done\");\n\t\t} else if (status === \"failed\") {\n\t\t\tli.classList.add(\"is-failed\");\n\t\t} else {\n\t\t\tli.classList.add(\"is-loading\");\n\t\t}\n\n\t\tconst iconDiv = document.createElement(\"div\");\n\t\ticonDiv.className = \"progress-icon\";\n\t\tli.appendChild(iconDiv);\n\n\t\tconst textDiv = document.createElement(\"div\");\n\t\ttextDiv.className = \"progress-text\";\n\t\ttextDiv.innerHTML = text;\n\t\tli.appendChild(textDiv);\n\n\t\tprogressList.appendChild(li);\n\t}\n\n\tfunction modifyPreviousProgress(text: string, status: string) {\n\t\tif (!progressList) return;\n\t\tconst li = progressList.querySelector(\".installation-progress:last-child\");\n\t\tif (!li) return;\n\n\t\tif (status === \"done\") {\n\t\t\tli.classList.remove(\"is-loading\");\n\t\t\tli.classList.add(\"is-done\");\n\t\t} else if (status === \"failed\") {\n\t\t\tli.classList.remove(\"is-loading\");\n\t\t\tli.classList.add(\"is-failed\");\n\t\t} else {\n\t\t\tli.classList.remove(\"is-done\");\n\t\t\tli.classList.remove(\"is-failed\");\n\t\t\tli.classList.add(\"is-loading\");\n\t\t}\n\n\t\tif (text) {\n\t\t\tconst textDiv = li.querySelector(\".progress-text\");\n\t\t\tif (!textDiv) return;\n\t\t\ttextDiv.innerHTML = text;\n\t\t}\n\t}\n\n\tfunction disableOrEnableOtherButtons(\n\t\tactionType: string,\n\t\tcurrentButton: HTMLElement | HTMLButtonElement\n\t) {\n\t\tconst buttons = document.querySelectorAll(\".kirki-install-udb\");\n\t\tif (!buttons.length) return;\n\n\t\tbuttons.forEach((button) => {\n\t\t\tif (actionType === \"disable\") {\n\t\t\t\tif (currentButton && button === currentButton) return;\n\t\t\t}\n\n\t\t\tif (button.tagName.toLowerCase() === \"button\") {\n\t\t\t\tif (actionType === \"disable\") {\n\t\t\t\t\t// button.setAttribute(\"disabled\", \"disabled\");\n\t\t\t\t\tbutton.classList.add(\"is-loading\");\n\t\t\t\t} else {\n\t\t\t\t\t// button.removeAttribute(\"disabled\");\n\t\t\t\t\tbutton.classList.remove(\"is-loading\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (actionType === \"disable\") {\n\t\t\t\t\t// button.classList.add(\"is-disabled\");\n\t\t\t\t\tbutton.classList.add(\"is-loading\");\n\t\t\t\t} else {\n\t\t\t\t\t// button.classList.remove(\"is-disabled\");\n\t\t\t\t\tbutton.classList.remove(\"is-loading\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction startProcessing(button: HTMLElement) {\n\t\tif (progressBox && progressList) {\n\t\t\temptyElement(progressList);\n\t\t\tprogressBox.classList.remove(\"is-hidden\");\n\t\t}\n\n\t\tdoingAjax = true;\n\t\tdisableOrEnableOtherButtons(\"disable\", button);\n\t\tstartLoading(button);\n\t}\n\n\tfunction stopProcessing(button: HTMLElement, redirectUrl: string) {\n\t\tif (redirectUrl) {\n\t\t\twindow.setTimeout(() => {\n\t\t\t\twindow.location.replace(redirectUrl);\n\t\t\t}, 1000);\n\t\t}\n\n\t\tstopLoading(button);\n\t\tdoingAjax = false;\n\t\tdisableOrEnableOtherButtons(\"enable\", button);\n\t}\n}\n","module.exports=jQuery;","import \"./settings.scss\";\r\nimport setupUdb from \"./setup-udb\";\r\nimport setupTabsNavigation from \"./tabs\";\r\n\r\ndeclare var ajaxurl: string;\r\n\r\n(function () {\r\n\tsetupTabsNavigation();\r\n\tsetupUdb();\r\n\r\n\tconst metabox = document.querySelector(\".kirki-clear-font-cache-metabox\");\r\n\tif (!metabox) return;\r\n\r\n\tvar notice = metabox.querySelector(\".submission-status\");\r\n\tif (!notice) return;\r\n\r\n\tconst button = metabox.querySelector(\".kirki-clear-font-cache\");\r\n\tif (!button) return;\r\n\r\n\tbutton.addEventListener(\"click\", clearFontCache);\r\n\r\n\tlet doingAjax = false;\r\n\tlet timeoutId: number = 0;\r\n\r\n\tfunction clearFontCache(e: Event) {\r\n\t\tif (doingAjax) return;\r\n\t\tdoingAjax = true;\r\n\r\n\t\tconst button = this as HTMLButtonElement;\r\n\t\tbutton.classList.add(\"is-loading\");\r\n\r\n\t\tif (timeoutId) {\r\n\t\t\twindow.clearTimeout(timeoutId);\r\n\t\t}\r\n\r\n\t\ttimeoutId = 0;\r\n\r\n\t\tvar data = {\r\n\t\t\taction: \"kirki_clear_font_cache\",\r\n\t\t\tnonce: button.dataset.nonce,\r\n\t\t};\r\n\r\n\t\tjQuery\r\n\t\t\t.ajax({\r\n\t\t\t\turl: ajaxurl,\r\n\t\t\t\ttype: \"POST\",\r\n\t\t\t\tdata: data,\r\n\t\t\t})\r\n\t\t\t.done(function (r) {\r\n\t\t\t\tshowNotice(r.success ? \"success\" : \"error\", r.data);\r\n\t\t\t})\r\n\t\t\t.fail(function (r) {\r\n\t\t\t\tshowNotice(\"error\", \"Something went wrong.\");\r\n\t\t\t})\r\n\t\t\t.always(function (r) {\r\n\t\t\t\tdoingAjax = false;\r\n\t\t\t\tbutton.classList.remove(\"is-loading\");\r\n\r\n\t\t\t\ttimeoutId = window.setTimeout(function () {\r\n\t\t\t\t\thideNotice();\r\n\t\t\t\t}, 4000);\r\n\t\t\t});\r\n\t}\r\n\r\n\tfunction showNotice(status: string, textContent: string) {\r\n\t\tif (!notice) return;\r\n\t\tnotice.textContent = textContent;\r\n\t\tnotice.classList.add(status === \"success\" ? \"is-success\" : \"is-error\");\r\n\t\tnotice.classList.remove(\"is-hidden\");\r\n\t}\r\n\r\n\tfunction hideNotice() {\r\n\t\tif (!notice) return;\r\n\t\tnotice.textContent = \"\";\r\n\t\tnotice.classList.remove(\"is-success\");\r\n\t\tnotice.classList.remove(\"is-error\");\r\n\t\tnotice.classList.add(\"is-hidden\");\r\n\t}\r\n})();\r\n","import jQuery from \"jquery\";\n\nexport default function setupTabsNavigation() {\n\tjQuery(\".heatbox-tab-nav-item\").on(\"click\", function () {\n\t\tjQuery(\".heatbox-tab-nav-item\").removeClass(\"active\");\n\t\tjQuery(this).addClass(\"active\");\n\n\t\tconst link = this.querySelector(\"a\");\n\t\tif (!link) return;\n\n\t\tif (link.href.indexOf(\"#\") === -1) return;\n\n\t\tconst hashValue = link.href.substring(link.href.indexOf(\"#\") + 1);\n\n\t\tjQuery(\".heatbox-panel-wrapper .heatbox-admin-panel\").css(\n\t\t\t\"display\",\n\t\t\t\"none\"\n\t\t);\n\n\t\tjQuery(\".heatbox-panel-wrapper .kirki-\" + hashValue + \"-panel\").css(\n\t\t\t\"display\",\n\t\t\t\"block\"\n\t\t);\n\t});\n\n\twindow.addEventListener(\"load\", function () {\n\t\tlet hashValue = window.location.hash.substring(1);\n\t\tlet currentActiveTabMenu: HTMLElement | null = null;\n\n\t\tif (!hashValue) {\n\t\t\tcurrentActiveTabMenu = document.querySelector(\n\t\t\t\t\".heatbox-tab-nav-item.active\"\n\t\t\t);\n\n\t\t\tif (currentActiveTabMenu && currentActiveTabMenu.dataset.tab) {\n\t\t\t\thashValue = currentActiveTabMenu.dataset.tab;\n\t\t\t}\n\n\t\t\thashValue = hashValue ? hashValue : \"settings\";\n\t\t}\n\n\t\tjQuery(\".heatbox-tab-nav-item\").removeClass(\"active\");\n\t\tjQuery(\".heatbox-tab-nav-item.kirki-\" + hashValue + \"-panel\").addClass(\n\t\t\t\"active\"\n\t\t);\n\n\t\tjQuery(\".heatbox-panel-wrapper .heatbox-admin-panel\").css(\n\t\t\t\"display\",\n\t\t\t\"none\"\n\t\t);\n\n\t\tjQuery(\".heatbox-panel-wrapper .kirki-\" + hashValue + \"-panel\").css(\n\t\t\t\"display\",\n\t\t\t\"block\"\n\t\t);\n\t});\n}\n"],"names":["$f448701b1a546a82$export$ae6de35c16b306df","el","firstChild","removeChild","$f448701b1a546a82$export$211731fc355e9121","selector","depth","matches","tagName","closest","i","parentNode","$f448701b1a546a82$export$fea330ef6103f535","button","classList","add","$f448701b1a546a82$export$4dabcd056c1d895c","remove","$4fab253fa82d62c5$export$2e2bcd8739ae039","adminPage","document","querySelector","progressBox","progressList","doingAjax","udbData","kirkiSettings","recommendedPlugins","udb","activateUdb","addProgress","$parcel$interopDefault","$0a2eb9defebd2c69$exports","ajax","async","type","url","activationUrl","success","modifyPreviousProgress","stopProcessing","redirectUrl","error","jqXHR","errorCode","errorMessage","responseJSON","data","text","status","li","createElement","className","iconDiv","appendChild","textDiv","innerHTML","disableOrEnableOtherButtons","actionType","currentButton","buttons","querySelectorAll","length","forEach","toLowerCase","window","setTimeout","location","replace","addEventListener","e","target","preventDefault","startProcessing","nonce","dataset","setupUdbNonce","ajaxurl","method","action","done","response","finished","message","wp","updates","installPlugin","slug","abort","installUdb","fail","prepareUdb","jQuery","on","removeClass","this","addClass","link","href","indexOf","hashValue","substring","css","hash","currentActiveTabMenu","tab","metabox","notice","timeoutId","clearTimeout","r","showNotice","always","textContent","hideNotice"],"version":3,"file":"settings.js.map"}kirki-packages/settings/dist/heatbox.css000064400000014574147177211530014423 0ustar00/* Init */ .heatbox-wrap, .heatbox-wrap * { -webkit-box-sizing: border-box; box-sizing: border-box; } .heatbox-admin.has-header .update-nag { display: none; } .heatbox-admin.has-header #wpcontent { padding-left: 0 !important; padding-right: 0 !important; } .heatbox-admin.has-header .wrap { margin: 0; } /* Tab navigation */ .heatbox-tab-nav { padding: 20px 0; margin: 10px 0 0 0; } .heatbox-tab-nav li { display: inline-flex; padding: 10px 30px 10px 0; font-weight: 600; font-size: 20px; } .heatbox-tab-nav li a { color: #23282d; text-decoration: none; } .heatbox-tab-nav li.active a { color: #0073aa; } /* Divider */ .heatbox-divider { width: 100%; height: 1px; margin: 40px 0; background: #ccc; } @media screen and (max-width: 991px) { .heatbox-divider { margin: 20px 0; } } /* Container */ .heatbox-container { max-width: 1200px; padding: 0 20px; } .heatbox-container-wide { max-width: 1400px; } .heatbox-container-center { margin: 0 auto; } /* Header */ .heatbox-header { background: #fff; padding-top: 40px; border-bottom: 1px solid #ddd; } .heatbox-header.heatbox-has-tab-nav .logo-container { margin-bottom: 0; } .heatbox-header .logo-container { display: flex; align-items: center; margin-bottom: 40px; } .heatbox-header .logo-container div { width: 50%; } .heatbox-header .logo-container .heatbox-logo-wide img { width: 180px; } .heatbox-header .logo-container img { width: 100px; height: auto; float: right; } .heatbox-header .tab-navigation { margin: -20px 0 20px 0; padding: 0; } .heatbox-header .tab-navigation li { display: inline-flex; padding: 10px 30px 10px 0; font-weight: 600; font-size: 20px; } .heatbox-header .tab-navigation li a { color: #23282d; text-decoration: none; } .heatbox-header .tab-navigation li.active a { color: #0073aa; } /* Title */ .heatbox-wrap .title { margin: 0; padding: 0; font-size: 34px; font-weight: 700; line-height: 1; } .heatbox-wrap .subtitle { margin: 20px 0 0 0; padding: 0; font-size: 20px; line-height: 1; } /* Version */ .heatbox-wrap .version { font-size: 50%; opacity: 0.6; font-weight: 600; background: #ccc; border-radius: 5px; padding: 5px 12px; line-height: 1; } /* 2 Column Layout - Wrapper */ .heatbox-column-container { display: flex; flex-wrap: wrap; } /* 2 Column Layout - Main Content */ .heatbox-main { width: 73%; margin-right: 2%; } /* 2 Column Layout - Sidebar */ .heatbox-sidebar { width: 25%; } /* 2 Column Layout - Responsiveness */ @media screen and (max-width: 991px) { .heatbox-main, .heatbox-sidebar { width: 100%; } .heatbox-main { margin-right: 0; } } /* Panels */ .heatbox-admin-panel { display: none; } /* Heatbox */ .heatbox { background: #fff; margin-bottom: 20px; border: 1px solid #ddd; } .heatbox h2 { border-bottom: 1px solid #ddd; margin: 0; padding: 20px; } .heatbox.is-grouped h2 { border-top: 1px solid #ddd; } .heatbox.is-grouped h2:first-child { border-top: none; } .heatbox h3 { margin: 0 0 10px 0; } .heatbox p { margin: 0 0 20px 0; } .heatbox-content { margin: 0; padding: 20px; } .heatbox-content p:first-child { margin-top: 0; } /* Margins */ .heatbox-margin-top { margin-top: 20px; } .heatbox-margin-bottom { margin-bottom: 20px; } /* Paddings */ .heatbox-margin-top { margin-top: 20px; } .heatbox-margin-bottom { margin-bottom: 20px; } /* Buttons */ .heatbox-wrap .button-larger { padding: 5px 20px; } /* Settings */ .heatbox .form-table { margin: 0; } .heatbox .form-table th, .heatbox .form-table td { padding: 20px; vertical-align: top; } .heatbox .form-table th .description { margin-top: 10px; } .heatbox .setting-fields { } .heatbox .setting-fields .setting-field { margin-bottom: 7px; } .heatbox .setting-fields .setting-field:last-of-type { margin-bottom: 0; } /* Submit button */ .heatbox-wrap p.submit { margin: 20px 0; padding: 0; } /** * Checkboxes & Radio Buttons * Copied & modified from https://codepen.io/KenanYusuf/pen/PZKEKd/ */ .heatbox .label { display: inline-block; position: relative; cursor: pointer; } .heatbox .label input { position: absolute; z-index: -1; opacity: 0; } .heatbox .label .indicator { position: absolute; top: 0; left: 0; height: 20px; width: 20px; background-color: #e6e6e6; -webkit-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .heatbox .radio-label .indicator { border-radius: 50%; } .heatbox .label:hover input ~ .indicator, .heatbox .label input:focus ~ .indicator { background-color: #ccc; } .heatbox .label input:checked ~ .indicator { background-color: #007cba; } .heatbox .label:hover input:not([disabled]):checked ~ .indicator, .heatbox .label input:checked:focus ~ .indicator { background-color: #00669b; } .heatbox .label input:disabled ~ .indicator { background-color: #e6e6e6; opacity: 0.6; pointer-events: none; } .heatbox .label .indicator::after { display: none; position: absolute; content: ""; } .heatbox .label input:checked ~ .indicator::after { display: block; } .heatbox .checkbox-label { padding-left: 30px; } .heatbox .checkbox-label .indicator::after { left: 8px; top: 4px; width: 3px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); } .heatbox .checkbox-label input:disabled ~ .indicator::after { border-color: #7b7b7b; } .heatbox .radio-label .indicator::after { left: 7px; top: 7px; height: 6px; width: 6px; border-radius: 50%; background-color: #fff; } .heatbox .radio-label input:disabled ~ .indicator::after { background-color: #7b7b7b; } /* Call to action */ .heatbox-cta-container.is-attached { padding: 20px; background: #fff; margin-top: -20px; margin-bottom: 20px; border: 1px solid #ddd; border-top: none; } .heatbox-cta { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 20px; font-weight: 700; border: 1px solid #ddd; background: #fff; } .heatbox-cta > * { margin: 0 !important; } .heatbox-cta .button { padding: 5px 15px !important; } .heatbox-cta.primary { background: #197cff; color: #fff; border: none; } .heatbox-cta.secondary { background: #f1f1f1; } .heatbox-cta.primary .button { background: rgba(0, 45, 96, 0.5); } .heatbox-cta.primary .button:hover { background: rgba(0, 45, 96, 0.6); } /* RTL */ .rtl .heatbox-header .logo-container img { float: left; } .rtl .heatbox-main { margin-right: 0; margin-left: 2%; } .rtl .heatbox .label .indicator { left: auto; right: -30px; } kirki-packages/settings/dist/settings.css000064400000012675147177211530014631 0ustar00.kirki-settings-page{--kirki-brand-color:#2764f1;--kirki-danger-color:#47d87c}@keyframes loadingSpinAround{0%{transform:rotate(0)}to{transform:rotate(359deg)}}.kirki-settings-page .button.is-loading{pointer-events:none;justify-content:center;align-items:center;display:inline-flex;color:#0000!important}.kirki-settings-page .button.is-loading:after{content:"";width:1em;height:1em;border:2px solid #dbdbdb;border-radius:290486px;animation:.5s linear infinite loadingSpinAround;display:block;position:absolute;border-color:#0000 #0000 #fff #fff!important}.kirki-settings-page .button-link{background-color:#0000;border-width:0;font-size:17px;text-decoration:underline}.kirki-settings-page .button-link:focus,.kirki-settings-page .button-link:active{box-shadow:none;border-width:0;outline:none}.kirki-settings-page .button-link.is-disabled{color:#ddd}.kirki-settings-page .button-link.is-right-side{float:right}.kirki-settings-page .button-link.is-right-side.is-loading{justify-content:flex-end}.kirki-settings-page .button-link.is-loading{pointer-events:none;justify-content:center;align-items:center;display:inline-flex;color:#0000!important}.kirki-settings-page .button-link.is-loading:after{content:"";width:1em;height:1em;border:2px solid #7ab4e3;border-radius:290486px;animation:.5s linear infinite loadingSpinAround;display:block;position:absolute;border-color:#0000 #0000 #2271b1 #2271b1!important}.kirki-settings-page .submission-status{margin-left:15px;line-height:39px}.kirki-settings-page .submission-status.is-hidden{display:none}.kirki-settings-page .submission-status.is-success{color:#0fa953}.kirki-settings-page .submission-status.is-error{color:tomato}.featured-products-banner img{max-width:100%;border:1px solid #ddd}.kirki-featured-products>h2{text-align:center;margin-bottom:50px;font-size:24px}.kirki-featured-products .products{justify-content:space-between;display:flex}.kirki-featured-products .products li{width:32%}.kirki-featured-products .products .subheadline{margin-top:-6px;font-weight:600}.kirki-featured-products .products img{max-width:100%}.kirki-featured-products .credit{text-align:center;opacity:.5;margin-top:20px}.heatbox{position:relative}.heatbox .checkbox-label .is-disabled{opacity:.6}.heatbox .heatbox-overlay.is-hidden{display:none}.heatbox .heatbox-overlay{width:100%;height:100%;z-index:100;background-color:#0000001a;position:absolute;top:0;left:0}.pro-extensions-banner-link{margin-bottom:20px;display:block;box-shadow:none!important}.pro-extensions-banner{max-width:100%;border:1px solid #ddd}.pro-extensions-list{margin:0}.pro-extensions-list li{border-bottom:1px solid #ddd;flex-wrap:wrap;align-items:center;margin:0;padding:25px 20px;display:flex}.pro-extensions-list li:last-child{background:#f9f9f9;border:none}.pro-extensions-list li:last-child h3{margin-bottom:10px}.pro-extensions-list li:last-child p{margin-bottom:0}.pro-extensions-list li div{flex:0 50%}.pro-extensions-list li h3{margin-bottom:0;font-weight:400;display:inline-block}.pro-extensions-list li p{font-size:16px}.pro-extensions-list .tooltip{cursor:pointer;color:#ccc;margin-left:8px;display:inline-block;position:relative}.pro-extensions-list .tooltip:hover{color:#0073aa}.pro-extensions-list .tooltip:hover p{opacity:1;z-index:1}.pro-extensions-list .tooltip p{z-index:-1;opacity:0;width:250px;color:initial;background:#fff;border:1px solid #ddd;border-radius:4px;padding:15px;position:absolute;bottom:15px;left:-40px;box-shadow:0 0 20px #00000026}.pro-extensions-list-icon{text-align:right;color:#47d87c;bottom:0;left:0}.pro-extensions-list-icon i{margin-right:20px;position:relative}.pro-extensions-list-icon strong{color:#fff;background:#47d87c;border-radius:4px;margin:0 10px;padding:2px 4px;font-size:12px;line-height:1}.pro-extensions-list-icon .button-larger{padding:10px 30px}.kirki-recommended-list{flex-wrap:wrap;margin:0;display:flex}.kirki-recommended-list li{flex-direction:column;flex:0 49%;margin-right:2%;display:flex}.kirki-recommended-list li:nth-child(2n){margin-right:0}.kirki-recommended-list li>a{box-shadow:none}.kirki-recommended-list img{max-width:100%}.kirki-recommended-content{min-height:150px;flex:1 0 auto;padding:20px}.kirki-recommended-content p{font-size:16px}.kirki-recommended-status{background:#f9f9f9;border-top:1px solid #ddd;align-items:center;padding:20px;display:flex}.kirki-recommended-status div{flex:0 50%}.kirki-recommended-status-icon{text-align:right;color:#aaa}.kirki-recommended-status-icon.green{color:#47d87c}.kirki-recommended-status-icon i{font-size:22px!important}.installation-progress-metabox.is-hidden{display:none}.installation-info{font-size:14px;font-weight:700}.installation-progress{align-items:center;margin-bottom:10px;display:flex}.installation-progress .progress-icon{width:20px;height:20px;margin-right:4px;position:relative}.installation-progress.is-loading .progress-icon{pointer-events:none;justify-content:center;align-items:center;display:inline-flex;color:#0000!important}.installation-progress.is-loading .progress-icon:after{content:"";width:1em;height:1em;border:2px solid #7ab4e3;border-radius:290486px;animation:.5s linear infinite loadingSpinAround;display:block;position:absolute;border-color:#0000 #0000 #2271b1 #2271b1!important}.installation-progress.is-done .progress-icon:before{content:"";color:#47d87c;font-family:dashicons;font-size:20px}.installation-progress.is-failed .progress-icon:before{content:"";color:tomato;font-family:dashicons;font-size:20px}.installation-progress .progress-text{flex:auto} /*# sourceMappingURL=settings.css.map */ kirki-packages/settings/dist/admin-notice.css000064400000000767147177211530015337 0ustar00.kirki-admin-notice{padding:25px 20px}.kirki-admin-notice .notice-body{display:flex}.kirki-admin-notice .notice-icon{padding-right:25px}.kirki-admin-notice .notice-icon img{max-width:55px}.kirki-admin-notice .notice-content{width:100%}.kirki-admin-notice .notice-content h2{margin-top:0;margin-bottom:10px;font-weight:700}.kirki-admin-notice .notice-content>p{margin-top:0;margin-bottom:10px}.kirki-admin-notice .notice-content>p:last-child{margin-bottom:0} /*# sourceMappingURL=admin-notice.css.map */ kirki-packages/settings/dist/settings.js000064400000012771147177211530014452 0ustar00!function(){function e(e){return e&&e.__esModule?e.default:e}const t=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},a=(e,t,a)=>{if(e.matches(t))return e;if("BODY"===e.tagName||"HTML"===e.tagName)return;let s;a=a||20;for(let s=0;s{e.classList.add("is-loading")},n=e=>{e.classList.remove("is-loading")};var i;function r(){const r=document.querySelector(".kirki-settings-page");if(!r)return;const o=r.querySelector(".installation-progress-metabox");if(!o)return;const l=o.querySelector(".installation-progress-list");if(!l)return;let d=!1;const c=kirkiSettings.recommendedPlugins.udb;function u(t){d||(d=!0,f("Activating Ultimate Dashboard","loading"),e(i).ajax({async:!0,type:"GET",url:c.activationUrl,success:function(){m("Ultimate Dashboard has been activated successfully.","done"),f("All done! Redirecting...","loading"),p(t,c.redirectUrl)},error:function(e){e.errorCode&&e.errorMessage?m(e.errorMessage,"failed"):e.responseJSON&&e.responseJSON.data?m(e.responseJSON.data,"failed"):m("Something went wrong. Please try again later.","failed"),p(t,"")}}))}function f(e,t){if(!l)return;const a=document.createElement("li");a.className="installation-progress","done"===t?a.classList.add("is-done"):"failed"===t?a.classList.add("is-failed"):a.classList.add("is-loading");const s=document.createElement("div");s.className="progress-icon",a.appendChild(s);const n=document.createElement("div");n.className="progress-text",n.innerHTML=e,a.appendChild(n),l.appendChild(a)}function m(e,t){if(!l)return;const a=l.querySelector(".installation-progress:last-child");if(a&&("done"===t?(a.classList.remove("is-loading"),a.classList.add("is-done")):"failed"===t?(a.classList.remove("is-loading"),a.classList.add("is-failed")):(a.classList.remove("is-done"),a.classList.remove("is-failed"),a.classList.add("is-loading")),e)){const t=a.querySelector(".progress-text");if(!t)return;t.innerHTML=e}}function g(e,t){const a=document.querySelectorAll(".kirki-install-udb");a.length&&a.forEach((a=>{"disable"===e&&t&&a===t||(a.tagName.toLowerCase(),"disable"===e?a.classList.add("is-loading"):a.classList.remove("is-loading"))}))}function p(e,t){t&&window.setTimeout((()=>{window.location.replace(t)}),1e3),n(e),d=!1,g("enable",e)}document.addEventListener("click",(function(n){const h=a(n.target,".kirki-install-udb");if(!h)return;n.preventDefault(),function(a){if(!r)return;if(d)return;(function(e){o&&l&&(t(l),o.classList.remove("is-hidden"));d=!0,g("disable",e),s(e)})(a),f("Preparing...","loading");const n=r.dataset.setupUdbNonce?r.dataset.setupUdbNonce:"";e(i).ajax({url:ajaxurl,method:"POST",data:{action:"kirki_prepare_install_udb",nonce:n}}).done((function(e){return e.success?e.data.finished?(m("Ultimate Dashboard has already been installed.","done"),f(e.data.message,"done"),f("All done! Redirecting...","loading"),void p(a,c.redirectUrl)):(m(e.data.message,"done"),d=!1,void function(e){if(d)return;d=!0,f("Installing Ultimate Dashboard","loading"),wp.updates.installPlugin({slug:c.slug,success:function(){m("Ultimate Dashboard has been installed successfully","done"),d=!1,u(e)},error:function(t){let a=!0;t.errorCode&&t.errorMessage?"folder_exists"===t.errorCode?(m("Ultimate Dashboard has already been installed.","done"),d=!1,a=!1,u(e)):m(t.errorMessage,"failed"):t.responseJSON&&t.responseJSON.data?m(t.responseJSON.data,"failed"):m("Something went wrong. Please try again later.","failed"),a&&p(e,"")}})}(a)):(m(e.data,"failed"),void p(a,""))})).fail((function(e){let t="Something went wrong. Please try again later.";e.responseJSON&&e.responseJSON.data&&(t=e.responseJSON.data),m(t,"failed"),p(a,"")}))}(h)}))}i=jQuery,function(){e(i)(".heatbox-tab-nav-item").on("click",(function(){e(i)(".heatbox-tab-nav-item").removeClass("active"),e(i)(this).addClass("active");const t=this.querySelector("a");if(!t)return;if(-1===t.href.indexOf("#"))return;const a=t.href.substring(t.href.indexOf("#")+1);e(i)(".heatbox-panel-wrapper .heatbox-admin-panel").css("display","none"),e(i)(".heatbox-panel-wrapper .kirki-"+a+"-panel").css("display","block")})),window.addEventListener("load",(function(){let t=window.location.hash.substring(1),a=null;t||(a=document.querySelector(".heatbox-tab-nav-item.active"),a&&a.dataset.tab&&(t=a.dataset.tab),t=t||"settings"),e(i)(".heatbox-tab-nav-item").removeClass("active"),e(i)(".heatbox-tab-nav-item.kirki-"+t+"-panel").addClass("active"),e(i)(".heatbox-panel-wrapper .heatbox-admin-panel").css("display","none"),e(i)(".heatbox-panel-wrapper .kirki-"+t+"-panel").css("display","block")})),r();const t=document.querySelector(".kirki-clear-font-cache-metabox");if(!t)return;var a=t.querySelector(".submission-status");if(!a)return;const s=t.querySelector(".kirki-clear-font-cache");if(!s)return;s.addEventListener("click",(function(e){if(n)return;n=!0;const t=this;t.classList.add("is-loading"),o&&window.clearTimeout(o);o=0;var s={action:"kirki_clear_font_cache",nonce:t.dataset.nonce};jQuery.ajax({url:ajaxurl,type:"POST",data:s}).done((function(e){l(e.success?"success":"error",e.data)})).fail((function(e){l("error","Something went wrong.")})).always((function(e){n=!1,t.classList.remove("is-loading"),o=window.setTimeout((function(){!function(){if(!a)return;a.textContent="",a.classList.remove("is-success"),a.classList.remove("is-error"),a.classList.add("is-hidden")}()}),4e3)}))}));let n=!1,o=0;function l(e,t){a&&(a.textContent=t,a.classList.add("success"===e?"is-success":"is-error"),a.classList.remove("is-hidden"))}}()}(); //# sourceMappingURL=settings.js.map kirki-packages/settings/dist/settings.css.map000064400000035124147177211530015377 0ustar00{"mappings":"ACCA,8EAMA,iFAoBC,gJAOC,2PAcD,iHAMC,6HAOA,yDAIA,4DAGC,oFAKD,qJAOC,sQAeF,0EAKA,+DAIA,iEAIA,8DAOA,mEAOA,gFAMA,8EAIC,gDAIA,gFAKA,sDAKD,8EAQD,2BAIE,iDAKD,iDAIA,uHAYD,uFAMA,4DAKA,8BAGC,+HAQC,kEAIC,yDAIA,qDAKD,uCAIA,gFAMA,yCAKD,+GAOC,kDAGC,0DAMD,2NAmBF,yEAMC,gEAKA,4IASA,2DAMD,6DAKC,yFAMC,wDAIA,6CAKD,2CAKD,uEAKC,4CAKD,oHAOC,yCAKD,2DAIC,mDAIA,0DAOA,sDAKD,kDAKA,0EAKC,gGAQC,yJAOC,0QAgBD,sHASA,uHAQD","sources":["settings.css","kirki-packages/settings/src/settings.scss"],"sourcesContent":[".kirki-settings-page {\n --kirki-brand-color: #2764f1;\n --kirki-danger-color: #47d87c;\n}\n\n@keyframes loadingSpinAround {\n from {\n transform: rotate(0);\n }\n\n to {\n transform: rotate(359deg);\n }\n}\n\n.kirki-settings-page .button.is-loading {\n pointer-events: none;\n justify-content: center;\n align-items: center;\n display: inline-flex;\n color: #0000 !important;\n}\n\n.kirki-settings-page .button.is-loading:after {\n content: \"\";\n width: 1em;\n height: 1em;\n border: 2px solid #dbdbdb;\n border-radius: 290486px;\n animation: .5s linear infinite loadingSpinAround;\n display: block;\n position: absolute;\n border-color: #0000 #0000 #fff #fff !important;\n}\n\n.kirki-settings-page .button-link {\n background-color: #0000;\n border-width: 0;\n font-size: 17px;\n text-decoration: underline;\n}\n\n.kirki-settings-page .button-link:focus, .kirki-settings-page .button-link:active {\n box-shadow: none;\n border-width: 0;\n outline: none;\n}\n\n.kirki-settings-page .button-link.is-disabled {\n color: #ddd;\n}\n\n.kirki-settings-page .button-link.is-right-side {\n float: right;\n}\n\n.kirki-settings-page .button-link.is-right-side.is-loading {\n justify-content: flex-end;\n}\n\n.kirki-settings-page .button-link.is-loading {\n pointer-events: none;\n justify-content: center;\n align-items: center;\n display: inline-flex;\n color: #0000 !important;\n}\n\n.kirki-settings-page .button-link.is-loading:after {\n content: \"\";\n width: 1em;\n height: 1em;\n border: 2px solid #7ab4e3;\n border-radius: 290486px;\n animation: .5s linear infinite loadingSpinAround;\n display: block;\n position: absolute;\n border-color: #0000 #0000 #2271b1 #2271b1 !important;\n}\n\n.kirki-settings-page .submission-status {\n margin-left: 15px;\n line-height: 39px;\n}\n\n.kirki-settings-page .submission-status.is-hidden {\n display: none;\n}\n\n.kirki-settings-page .submission-status.is-success {\n color: #0fa953;\n}\n\n.kirki-settings-page .submission-status.is-error {\n color: tomato;\n}\n\n.featured-products-banner img {\n max-width: 100%;\n border: 1px solid #ddd;\n}\n\n.kirki-featured-products > h2 {\n text-align: center;\n margin-bottom: 50px;\n font-size: 24px;\n}\n\n.kirki-featured-products .products {\n justify-content: space-between;\n display: flex;\n}\n\n.kirki-featured-products .products li {\n width: 32%;\n}\n\n.kirki-featured-products .products .subheadline {\n margin-top: -6px;\n font-weight: 600;\n}\n\n.kirki-featured-products .products img {\n max-width: 100%;\n}\n\n.kirki-featured-products .credit {\n text-align: center;\n opacity: .5;\n margin-top: 20px;\n}\n\n.heatbox {\n position: relative;\n}\n\n.heatbox .checkbox-label .is-disabled {\n opacity: .6;\n}\n\n.heatbox .heatbox-overlay.is-hidden {\n display: none;\n}\n\n.heatbox .heatbox-overlay {\n width: 100%;\n height: 100%;\n z-index: 100;\n background-color: #0000001a;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.pro-extensions-banner-link {\n margin-bottom: 20px;\n display: block;\n box-shadow: none !important;\n}\n\n.pro-extensions-banner {\n max-width: 100%;\n border: 1px solid #ddd;\n}\n\n.pro-extensions-list {\n margin: 0;\n}\n\n.pro-extensions-list li {\n border-bottom: 1px solid #ddd;\n flex-wrap: wrap;\n align-items: center;\n margin: 0;\n padding: 25px 20px;\n display: flex;\n}\n\n.pro-extensions-list li:last-child {\n background: #f9f9f9;\n border: none;\n}\n\n.pro-extensions-list li:last-child h3 {\n margin-bottom: 10px;\n}\n\n.pro-extensions-list li:last-child p {\n margin-bottom: 0;\n}\n\n.pro-extensions-list li div {\n flex: 0 50%;\n}\n\n.pro-extensions-list li h3 {\n margin-bottom: 0;\n font-weight: 400;\n display: inline-block;\n}\n\n.pro-extensions-list li p {\n font-size: 16px;\n}\n\n.pro-extensions-list .tooltip {\n cursor: pointer;\n color: #ccc;\n margin-left: 8px;\n display: inline-block;\n position: relative;\n}\n\n.pro-extensions-list .tooltip:hover {\n color: #0073aa;\n}\n\n.pro-extensions-list .tooltip:hover p {\n opacity: 1;\n z-index: 1;\n}\n\n.pro-extensions-list .tooltip p {\n z-index: -1;\n opacity: 0;\n width: 250px;\n color: initial;\n background: #fff;\n border: 1px solid #ddd;\n border-radius: 4px;\n padding: 15px;\n position: absolute;\n bottom: 15px;\n left: -40px;\n box-shadow: 0 0 20px #00000026;\n}\n\n.pro-extensions-list-icon {\n text-align: right;\n color: #47d87c;\n bottom: 0;\n left: 0;\n}\n\n.pro-extensions-list-icon i {\n margin-right: 20px;\n position: relative;\n}\n\n.pro-extensions-list-icon strong {\n color: #fff;\n background: #47d87c;\n border-radius: 4px;\n margin: 0 10px;\n padding: 2px 4px;\n font-size: 12px;\n line-height: 1;\n}\n\n.pro-extensions-list-icon .button-larger {\n padding: 10px 30px;\n}\n\n.kirki-recommended-list {\n flex-wrap: wrap;\n margin: 0;\n display: flex;\n}\n\n.kirki-recommended-list li {\n flex-direction: column;\n flex: 0 49%;\n margin-right: 2%;\n display: flex;\n}\n\n.kirki-recommended-list li:nth-child(2n) {\n margin-right: 0;\n}\n\n.kirki-recommended-list li > a {\n box-shadow: none;\n}\n\n.kirki-recommended-list img {\n max-width: 100%;\n}\n\n.kirki-recommended-content {\n min-height: 150px;\n flex: 1 0 auto;\n padding: 20px;\n}\n\n.kirki-recommended-content p {\n font-size: 16px;\n}\n\n.kirki-recommended-status {\n background: #f9f9f9;\n border-top: 1px solid #ddd;\n align-items: center;\n padding: 20px;\n display: flex;\n}\n\n.kirki-recommended-status div {\n flex: 0 50%;\n}\n\n.kirki-recommended-status-icon {\n text-align: right;\n color: #aaa;\n}\n\n.kirki-recommended-status-icon.green {\n color: #47d87c;\n}\n\n.kirki-recommended-status-icon i {\n font-size: 22px !important;\n}\n\n.installation-progress-metabox.is-hidden {\n display: none;\n}\n\n.installation-info {\n font-size: 14px;\n font-weight: 700;\n}\n\n.installation-progress {\n align-items: center;\n margin-bottom: 10px;\n display: flex;\n}\n\n.installation-progress .progress-icon {\n width: 20px;\n height: 20px;\n margin-right: 4px;\n position: relative;\n}\n\n.installation-progress.is-loading .progress-icon {\n pointer-events: none;\n justify-content: center;\n align-items: center;\n display: inline-flex;\n color: #0000 !important;\n}\n\n.installation-progress.is-loading .progress-icon:after {\n content: \"\";\n width: 1em;\n height: 1em;\n border: 2px solid #7ab4e3;\n border-radius: 290486px;\n animation: .5s linear infinite loadingSpinAround;\n display: block;\n position: absolute;\n border-color: #0000 #0000 #2271b1 #2271b1 !important;\n}\n\n.installation-progress.is-done .progress-icon:before {\n content: \"\";\n color: #47d87c;\n font-family: dashicons;\n font-size: 20px;\n}\n\n.installation-progress.is-failed .progress-icon:before {\n content: \"\";\n color: tomato;\n font-family: dashicons;\n font-size: 20px;\n}\n\n.installation-progress .progress-text {\n flex: auto;\n}\n\n/*# sourceMappingURL=settings.css.map */\n","// Vars\n.kirki-settings-page {\n\t--kirki-brand-color: #2764F1;\n\t--kirki-danger-color: #47D87C;\n}\n\n// Loading animation\n@-webkit-keyframes loadingSpinAround {\n\tfrom {\n\t\ttransform: rotate(0);\n\t}\n\tto {\n\t\ttransform: rotate(359deg);\n\t}\n}\n\n@keyframes loadingSpinAround {\n\tfrom {\n\t\ttransform: rotate(0);\n\t}\n\tto {\n\t\ttransform: rotate(359deg);\n\t}\n}\n\n.kirki-settings-page {\n\t// Button\n\t.button.is-loading {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tcolor: transparent !important;\n\t\tpointer-events: none;\n\n\t\t&::after {\n\t\t\tcontent: \"\";\n\t\t\tposition: absolute;\n\t\t\twidth: 1em;\n\t\t\tdisplay: block;\n\t\t\theight: 1em;\n\t\t\tborder: 2px solid #dbdbdb;\n\t\t\tborder-color: transparent transparent #fff #fff !important;\n\t\t\tborder-radius: 290486px;\n\t\t\t-webkit-animation: loadingSpinAround 0.5s infinite linear;\n\t\t\tanimation: loadingSpinAround 0.5s infinite linear;\n\t\t}\n\t}\n\n\t.button-link {\n\t\tborder-width: 0;\n\t\tbackground-color: transparent;\n\t\tfont-size: 17px;\n\t\ttext-decoration: underline;\n\n\t\t&:focus,\n\t\t&:active {\n\t\t\toutline: none;\n\t\t\tbox-shadow: none;\n\t\t\tborder-width: 0;\n\t\t}\n\n\t\t&.is-disabled {\n\t\t\tcolor: #ddd;\n\t\t}\n\n\t\t&.is-right-side {\n\t\t\tfloat: right;\n\n\t\t\t&.is-loading {\n\t\t\t\tjustify-content: flex-end;\n\t\t\t}\n\t\t}\n\n\t\t&.is-loading {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcolor: transparent !important;\n\t\t\tpointer-events: none;\n\n\t\t\t&::after {\n\t\t\t\tcontent: \"\";\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: 1em;\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 1em;\n\t\t\t\tborder: 2px solid #7ab4e3;\n\t\t\t\tborder-color: transparent transparent #2271b1 #2271b1 !important;\n\t\t\t\tborder-radius: 290486px;\n\t\t\t\t-webkit-animation: loadingSpinAround 0.5s infinite linear;\n\t\t\t\tanimation: loadingSpinAround 0.5s infinite linear;\n\t\t\t}\n\t\t}\n\t}\n\n\t.submission-status {\n\t\tmargin-left: 15px;\n\t\tline-height: 39px;\n\t}\n\n\t.submission-status.is-hidden {\n\t\tdisplay: none;\n\t}\n\n\t.submission-status.is-success {\n\t\tcolor: #0fa953;\n\t}\n\n\t.submission-status.is-error {\n\t\tcolor: tomato;\n\t}\n}\n\n// Featured products\n.featured-products-banner {\n\timg {\n\t\tborder: 1px solid #ddd;\n\t\tmax-width: 100%;\n\t}\n}\n\n.kirki-featured-products {\n\t> h2 {\n\t\ttext-align: center;\n\t\tmargin-bottom: 50px;\n\t\tfont-size: 24px;\n\t}\n\n\t.products {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\n\t\tli {\n\t\t\twidth: 32%;\n\t\t}\n\n\t\t.subheadline {\n\t\t\tfont-weight: 600;\n\t\t\tmargin-top: -6px;\n\t\t}\n\n\t\timg {\n\t\t\tmax-width: 100%;\n\t\t}\n\t}\n\n\t.credit {\n\t\tmargin-top: 20px;\n\t\ttext-align: center;\n\t\topacity: 0.5;\n\t}\n}\n\n// Heatbox adjustment\n.heatbox {\n\tposition: relative;\n\n\t.checkbox-label {\n\t\t.is-disabled {\n\t\t\topacity: 0.6;\n\t\t}\n\t}\n\n\t.heatbox-overlay.is-hidden {\n\t\tdisplay: none;\n\t}\n\n\t.heatbox-overlay {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbackground-color: rgba(0, 0, 0, 0.1);\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tz-index: 100;\n\t}\n}\n\n// Kirki PRO\n.pro-extensions-banner-link {\n\tdisplay: block;\n\tmargin-bottom: 20px;\n\tbox-shadow: none !important;\n}\n\n.pro-extensions-banner {\n\tmax-width: 100%;\n\tborder: 1px solid #ddd;\n}\n\n.pro-extensions-list {\n\tmargin: 0;\n\n\tli {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tmargin: 0;\n\t\tpadding: 25px 20px;\n\t\tborder-bottom: 1px solid #ddd;\n\n\t\t&:last-child {\n\t\t\tborder: none;\n\t\t\tbackground: #f9f9f9;\n\n\t\t\th3 {\n\t\t\t\tmargin-bottom: 10px;\n\t\t\t}\n\n\t\t\tp {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t}\n\n\t\tdiv {\n\t\t\tflex: 0 50%;\n\t\t}\n\n\t\th3 {\n\t\t\tdisplay: inline-block;\n\t\t\tmargin-bottom: 0;\n\t\t\tfont-weight: 400;\n\t\t}\n\n\t\tp {\n\t\t\tfont-size: 16px;\n\t\t}\n\t}\n\n\t.tooltip {\n\t\tposition: relative;\n\t\tdisplay: inline-block;\n\t\tcursor: pointer;\n\t\tcolor: #ccc;\n\t\tmargin-left: 8px;\n\n\t\t&:hover {\n\t\t\tcolor: #0073aa;\n\n\t\t\tp {\n\t\t\t\topacity: 1;\n\t\t\t\tz-index: 1;\n\t\t\t}\n\t\t}\n\n\t\tp {\n\t\t\tz-index: -1;\n\t\t\topacity: 0;\n\t\t\tposition: absolute;\n\t\t\tbottom: 15px;\n\t\t\tleft: -40px;\n\t\t\twidth: 250px;\n\t\t\tbackground: #fff;\n\t\t\tpadding: 15px;\n\t\t\tborder: 1px solid #ddd;\n\t\t\tcolor: initial;\n\t\t\t-webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);\n\t\t\t-moz-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);\n\t\t\tbox-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.15);\n\t\t\tborder-radius: 4px;\n\t\t}\n\t}\n}\n\n.pro-extensions-list-icon {\n\ttext-align: right;\n\tcolor: #47d87c;\n\tleft: 0;\n\tbottom: 0;\n\n\ti {\n\t\tmargin-right: 20px;\n\t\tposition: relative;\n\t}\n\n\tstrong {\n\t\tpadding: 2px 4px;\n\t\tborder-radius: 4px;\n\t\tbackground: #47d87c;\n\t\tcolor: #fff;\n\t\tline-height: 1;\n\t\tmargin: 0 10px;\n\t\tfont-size: 12px;\n\t}\n\t.button-larger {\n\t\tpadding: 10px 30px;\n\t}\n}\n\n// Recommended plugins\n.kirki-recommended-list {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin: 0;\n\n\tli {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tflex: 0 49%;\n\t\tmargin-right: 2%;\n\n\t\t&:nth-child(even) {\n\t\t\tmargin-right: 0;\n\t\t}\n\n\t\t& > a {\n\t\t\tbox-shadow: none;\n\t\t}\n\t}\n\n\timg {\n\t\tmax-width: 100%;\n\t}\n}\n\n.kirki-recommended-content {\n\tpadding: 20px;\n\tflex: 1 0 auto;\n\tmin-height: 150px;\n\n\tp {\n\t\tfont-size: 16px;\n\t}\n}\n\n.kirki-recommended-status {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 20px;\n\tbackground: #f9f9f9;\n\tborder-top: 1px solid #ddd;\n\n\tdiv {\n\t\tflex: 0 50%;\n\t}\n}\n\n.kirki-recommended-status-icon {\n\ttext-align: right;\n\tcolor: #aaa;\n\n\t&.green {\n\t\tcolor: #47d87c;\n\t}\n\n\ti {\n\t\tfont-size: 22px !important;\n\t}\n}\n\n// Instant installation progress\n.installation-progress-metabox {\n\t&.is-hidden {\n\t\tdisplay: none;\n\t}\n}\n\n.installation-info {\n\tfont-size: 14px;\n\tfont-weight: 700;\n}\n\n.installation-progress {\n\tdisplay: flex;\n\talign-items: center;\n\tmargin-bottom: 10px;\n\n\t.progress-icon {\n\t\tposition: relative;\n\t\tmargin-right: 4px;\n\t\twidth: 20px;\n\t\theight: 20px;\n\t}\n\n\t&.is-loading {\n\t\t.progress-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcolor: transparent !important;\n\t\t\tpointer-events: none;\n\n\t\t\t&::after {\n\t\t\t\tcontent: \"\";\n\t\t\t\tposition: absolute;\n\t\t\t\twidth: 1em;\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 1em;\n\t\t\t\tborder: 2px solid #7ab4e3;\n\t\t\t\tborder-color: transparent transparent #2271b1 #2271b1 !important;\n\t\t\t\tborder-radius: 290486px;\n\t\t\t\t-webkit-animation: loadingSpinAround 0.5s infinite linear;\n\t\t\t\tanimation: loadingSpinAround 0.5s infinite linear;\n\t\t\t}\n\t\t}\n\t}\n\n\t&.is-done {\n\t\t.progress-icon::before {\n\t\t\tcontent: \"\\f147\";\n\t\t\tfont-family: dashicons;\n\t\t\tcolor: #47d87c;\n\t\t\tfont-size: 20px;\n\t\t}\n\t}\n\n\t&.is-failed {\n\t\t.progress-icon::before {\n\t\t\tcontent: \"\\f158\";\n\t\t\tfont-family: dashicons;\n\t\t\tcolor: tomato;\n\t\t\tfont-size: 20px;\n\t\t}\n\t}\n\n\t.progress-text {\n\t\tflex: 1 1 auto;\n\t}\n}\n"],"names":[],"version":3,"file":"settings.css.map"}kirki-packages/control-repeater/LICENSE000064400000002060147177211530013731 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/control-repeater/src/Settings/Repeater.php000064400000003511147177211530017575 0ustar00id}", [ $this, 'sanitize_repeater_setting' ], 10, 1 ); } /** * Fetch the value of the setting. * * @access public * @since 1.0 * @return mixed The value. */ public function value() { return (array) parent::value(); } /** * Convert the JSON encoded setting coming from Customizer to an Array. * * @access public * @since 1.0 * @param string $value URL Encoded JSON Value. * @return array */ public function sanitize_repeater_setting( $value ) { if ( ! is_array( $value ) ) { $value = json_decode( urldecode( $value ) ); } if ( empty( $value ) || ! is_array( $value ) ) { $value = []; } // Make sure that every row is an array, not an object. foreach ( $value as $key => $val ) { $value[ $key ] = (array) $val; if ( empty( $val ) ) { unset( $value[ $key ] ); } } // Reindex array. if ( is_array( $value ) ) { $value = array_values( $value ); } return $value; } } kirki-packages/control-repeater/src/control.js000064400000065304147177211530015543 0ustar00import "./control.scss"; /* global kirkiControlLoader */ /* eslint max-depth: 0 */ /* eslint no-useless-escape: 0 */ var RepeaterRow = function (rowIndex, container, label, control) { var self = this; this.rowIndex = rowIndex; this.container = container; this.label = label; this.header = this.container.find(".repeater-row-header"); this.header.on("click", function () { self.toggleMinimize(); }); this.container.on("click", ".repeater-row-remove", function () { self.remove(); }); this.header.on("mousedown", function () { self.container.trigger("row:start-dragging"); }); this.container.on("keyup change", "input, select, textarea", function (e) { self.container.trigger("row:update", [ self.rowIndex, jQuery(e.target).data("field"), e.target, ]); }); this.setRowIndex = function (rowNum) { this.rowIndex = rowNum; this.container.attr("data-row", rowNum); this.container.data("row", rowNum); this.updateLabel(); }; this.toggleMinimize = function () { // Store the previous state. this.container.toggleClass("minimized"); this.header .find(".dashicons") .toggleClass("dashicons-arrow-up") .toggleClass("dashicons-arrow-down"); }; this.remove = function () { this.container.slideUp(300, function () { jQuery(this).detach(); }); this.container.trigger("row:remove", [this.rowIndex]); }; this.updateLabel = function () { var rowLabelField, rowLabel, rowLabelSelector; if ("field" === this.label.type) { rowLabelField = this.container.find( '.repeater-field [data-field="' + this.label.field + '"]' ); if (_.isFunction(rowLabelField.val)) { rowLabel = rowLabelField.val(); if ("" !== rowLabel) { if (!_.isUndefined(control.params.fields[this.label.field])) { if (!_.isUndefined(control.params.fields[this.label.field].type)) { if ("select" === control.params.fields[this.label.field].type) { if ( !_.isUndefined( control.params.fields[this.label.field].choices ) && !_.isUndefined( control.params.fields[this.label.field].choices[ rowLabelField.val() ] ) ) { rowLabel = control.params.fields[this.label.field].choices[ rowLabelField.val() ]; } } else if ( "radio" === control.params.fields[this.label.field].type || "radio-image" === control.params.fields[this.label.field].type ) { rowLabelSelector = control.selector + ' [data-row="' + this.rowIndex + '"] .repeater-field [data-field="' + this.label.field + '"]:checked'; rowLabel = jQuery(rowLabelSelector).val(); } } } this.header.find(".repeater-row-label").text(rowLabel); return; } } } this.header .find(".repeater-row-label") .text(this.label.value + " " + (this.rowIndex + 1)); }; this.updateLabel(); }; wp.customize.controlConstructor.repeater = wp.customize.Control.extend({ // When we're finished loading continue processing ready: function () { var control = this; // Init the control. if ( !_.isUndefined(window.kirkiControlLoader) && _.isFunction(kirkiControlLoader) ) { kirkiControlLoader(control); } else { control.initKirkiControl(); } }, initKirkiControl: function (control) { var limit, theNewRow, settingValue; control = control || this; // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function) settingValue = control.params.value; // The hidden field that keeps the data saved (though we never update it) control.settingField = control.container .find("[data-customize-setting-link]") .first(); // Set the field value for the first time, we'll fill it up later control.setValue([], false); // The DIV that holds all the rows control.repeaterFieldsContainer = control.container .find(".repeater-fields") .first(); // Set number of rows to 0 control.currentIndex = 0; // Save the rows objects control.rows = []; // Default limit choice limit = false; if (!_.isUndefined(control.params.choices.limit)) { limit = 0 >= control.params.choices.limit ? false : parseInt(control.params.choices.limit, 10); } control.container.on("click", "button.repeater-add", function (e) { e.preventDefault(); if (!limit || control.currentIndex < limit) { theNewRow = control.addRow(); theNewRow.toggleMinimize(); control.initColorPicker(); control.initSelect(theNewRow); } else { jQuery(control.selector + " .limit").addClass("highlight"); } }); control.container.on("click", ".repeater-row-remove", function () { control.currentIndex--; if (!limit || control.currentIndex < limit) { jQuery(control.selector + " .limit").removeClass("highlight"); } }); control.container.on( "click keypress", ".repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button", function (e) { e.preventDefault(); control.$thisButton = jQuery(this); control.openFrame(e); } ); control.container.on( "click keypress", ".repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button", function (e) { e.preventDefault(); control.$thisButton = jQuery(this); control.removeImage(e); } ); control.container.on( "click keypress", ".repeater-field-upload .remove-button", function (e) { e.preventDefault(); control.$thisButton = jQuery(this); control.removeFile(e); } ); /** * Function that loads the Mustache template */ control.repeaterTemplate = _.memoize(function () { var compiled, /* * Underscore's default ERB-style templates are incompatible with PHP * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax. * * @see trac ticket #22344. */ options = { evaluate: /<#([\s\S]+?)#>/g, interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, escape: /\{\{([^\}]+?)\}\}(?!\})/g, variable: "data", }; return function (data) { compiled = _.template( control.container .find(".customize-control-repeater-content") .first() .html(), null, options ); return compiled(data); }; }); // When we load the control, the fields have not been filled up // This is the first time that we create all the rows if (settingValue.length) { _.each(settingValue, function (subValue) { theNewRow = control.addRow(subValue); control.initColorPicker(); control.initSelect(theNewRow, subValue); }); } control.repeaterFieldsContainer.sortable({ handle: ".repeater-row-header", update: function () { control.sort(); }, }); }, /** * Open the media modal. * * @param {Object} event - The JS event. * @returns {void} */ openFrame: function (event) { if (wp.customize.utils.isKeydownButNotEnterEvent(event)) { return; } if ( this.$thisButton .closest(".repeater-field") .hasClass("repeater-field-cropped_image") ) { this.initCropperFrame(); } else { this.initFrame(); } this.frame.open(); }, initFrame: function () { var libMediaType = this.getMimeType(); this.frame = wp.media({ states: [ new wp.media.controller.Library({ library: wp.media.query({ type: libMediaType }), multiple: false, date: false, }), ], }); // When a file is selected, run a callback. this.frame.on("select", this.onSelect, this); }, /** * Create a media modal select frame, and store it so the instance can be reused when needed. * This is mostly a copy/paste of Core api.CroppedImageControl in /wp-admin/js/customize-control.js * * @returns {void} */ initCropperFrame: function () { // We get the field id from which this was called var currentFieldId = this.$thisButton .siblings("input.hidden-field") .attr("data-field"), attrs = ["width", "height", "flex_width", "flex_height"], // A list of attributes to look for libMediaType = this.getMimeType(); // Make sure we got it if (_.isString(currentFieldId) && "" !== currentFieldId) { // Make fields is defined and only do the hack for cropped_image if ( _.isObject(this.params.fields[currentFieldId]) && "cropped_image" === this.params.fields[currentFieldId].type ) { //Iterate over the list of attributes attrs.forEach( function (el) { // If the attribute exists in the field if (!_.isUndefined(this.params.fields[currentFieldId][el])) { // Set the attribute in the main object this.params[el] = this.params.fields[currentFieldId][el]; } }.bind(this) ); } } this.frame = wp.media({ button: { text: "Select and Crop", close: false, }, states: [ new wp.media.controller.Library({ library: wp.media.query({ type: libMediaType }), multiple: false, date: false, suggestedWidth: this.params.width, suggestedHeight: this.params.height, }), new wp.media.controller.CustomizeImageCropper({ imgSelectOptions: this.calculateImageSelectOptions, control: this, }), ], }); this.frame.on("select", this.onSelectForCrop, this); this.frame.on("cropped", this.onCropped, this); this.frame.on("skippedcrop", this.onSkippedCrop, this); }, onSelect: function () { var attachment = this.frame.state().get("selection").first().toJSON(); if ( this.$thisButton .closest(".repeater-field") .hasClass("repeater-field-upload") ) { this.setFileInRepeaterField(attachment); } else { this.setImageInRepeaterField(attachment); } }, /** * After an image is selected in the media modal, switch to the cropper * state if the image isn't the right size. */ onSelectForCrop: function () { var attachment = this.frame.state().get("selection").first().toJSON(); if ( this.params.width === attachment.width && this.params.height === attachment.height && !this.params.flex_width && !this.params.flex_height ) { this.setImageInRepeaterField(attachment); } else { this.frame.setState("cropper"); } }, /** * After the image has been cropped, apply the cropped image data to the setting. * * @param {object} croppedImage Cropped attachment data. * @returns {void} */ onCropped: function (croppedImage) { this.setImageInRepeaterField(croppedImage); }, /** * Returns a set of options, computed from the attached image data and * control-specific data, to be fed to the imgAreaSelect plugin in * wp.media.view.Cropper. * * @param {wp.media.model.Attachment} attachment - The attachment from the WP API. * @param {wp.media.controller.Cropper} controller - Media controller. * @returns {Object} - Options. */ calculateImageSelectOptions: function (attachment, controller) { var control = controller.get("control"), flexWidth = !!parseInt(control.params.flex_width, 10), flexHeight = !!parseInt(control.params.flex_height, 10), realWidth = attachment.get("width"), realHeight = attachment.get("height"), xInit = parseInt(control.params.width, 10), yInit = parseInt(control.params.height, 10), ratio = xInit / yInit, xImg = realWidth, yImg = realHeight, x1, y1, imgSelectOptions; controller.set( "canSkipCrop", !control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) ); if (xImg / yImg > ratio) { yInit = yImg; xInit = yInit * ratio; } else { xInit = xImg; yInit = xInit / ratio; } x1 = (xImg - xInit) / 2; y1 = (yImg - yInit) / 2; imgSelectOptions = { handles: true, keys: true, instance: true, persistent: true, imageWidth: realWidth, imageHeight: realHeight, x1: x1, y1: y1, x2: xInit + x1, y2: yInit + y1, }; if (false === flexHeight && false === flexWidth) { imgSelectOptions.aspectRatio = xInit + ":" + yInit; } if (false === flexHeight) { imgSelectOptions.maxHeight = yInit; } if (false === flexWidth) { imgSelectOptions.maxWidth = xInit; } return imgSelectOptions; }, /** * Return whether the image must be cropped, based on required dimensions. * * @param {bool} flexW - The flex-width. * @param {bool} flexH - The flex-height. * @param {int} dstW - Initial point distance in the X axis. * @param {int} dstH - Initial point distance in the Y axis. * @param {int} imgW - Width. * @param {int} imgH - Height. * @returns {bool} - Whether the image must be cropped or not based on required dimensions. */ mustBeCropped: function (flexW, flexH, dstW, dstH, imgW, imgH) { return !( (true === flexW && true === flexH) || (true === flexW && dstH === imgH) || (true === flexH && dstW === imgW) || (dstW === imgW && dstH === imgH) || imgW <= dstW ); }, /** * If cropping was skipped, apply the image data directly to the setting. * * @returns {void} */ onSkippedCrop: function () { var attachment = this.frame.state().get("selection").first().toJSON(); this.setImageInRepeaterField(attachment); }, /** * Updates the setting and re-renders the control UI. * * @param {object} attachment - The attachment object. * @returns {void} */ setImageInRepeaterField: function (attachment) { var $targetDiv = this.$thisButton.closest( ".repeater-field-image,.repeater-field-cropped_image" ); $targetDiv .find(".kirki-image-attachment") .html('') .hide() .slideDown("slow"); $targetDiv.find(".hidden-field").val(attachment.id); this.$thisButton.text(this.$thisButton.data("alt-label")); $targetDiv.find(".remove-button").show(); //This will activate the save button $targetDiv.find("input, textarea, select").trigger("change"); this.frame.close(); }, /** * Updates the setting and re-renders the control UI. * * @param {object} attachment - The attachment object. * @returns {void} */ setFileInRepeaterField: function (attachment) { var $targetDiv = this.$thisButton.closest(".repeater-field-upload"); $targetDiv .find(".kirki-file-attachment") .html( ' ' + attachment.filename + "" ) .hide() .slideDown("slow"); $targetDiv.find(".hidden-field").val(attachment.id); this.$thisButton.text(this.$thisButton.data("alt-label")); $targetDiv.find(".upload-button").show(); $targetDiv.find(".remove-button").show(); //This will activate the save button $targetDiv.find("input, textarea, select").trigger("change"); this.frame.close(); }, getMimeType: function () { // We get the field id from which this was called var currentFieldId = this.$thisButton .siblings("input.hidden-field") .attr("data-field"); // Make sure we got it if (_.isString(currentFieldId) && "" !== currentFieldId) { // Make fields is defined and only do the hack for cropped_image if ( _.isObject(this.params.fields[currentFieldId]) && "upload" === this.params.fields[currentFieldId].type ) { // If the attribute exists in the field if (!_.isUndefined(this.params.fields[currentFieldId].mime_type)) { // Set the attribute in the main object return this.params.fields[currentFieldId].mime_type; } } } return "image"; }, removeImage: function (event) { var $targetDiv, $uploadButton; if (wp.customize.utils.isKeydownButNotEnterEvent(event)) { return; } $targetDiv = this.$thisButton.closest( ".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload" ); $uploadButton = $targetDiv.find(".upload-button"); $targetDiv.find(".kirki-image-attachment").slideUp("fast", function () { jQuery(this).show().html(jQuery(this).data("placeholder")); }); $targetDiv.find(".hidden-field").val(""); $uploadButton.text($uploadButton.data("label")); this.$thisButton.hide(); $targetDiv.find("input, textarea, select").trigger("change"); }, removeFile: function (event) { var $targetDiv, $uploadButton; if (wp.customize.utils.isKeydownButNotEnterEvent(event)) { return; } $targetDiv = this.$thisButton.closest(".repeater-field-upload"); $uploadButton = $targetDiv.find(".upload-button"); $targetDiv.find(".kirki-file-attachment").slideUp("fast", function () { jQuery(this).show().html(jQuery(this).data("placeholder")); }); $targetDiv.find(".hidden-field").val(""); $uploadButton.text($uploadButton.data("label")); this.$thisButton.hide(); $targetDiv.find("input, textarea, select").trigger("change"); }, /** * Get the current value of the setting * * @returns {Object} - Returns the value. */ getValue: function () { // The setting is saved in JSON return JSON.parse(decodeURI(this.setting.get())); }, /** * Set a new value for the setting * * @param {Object} newValue - The new value. * @param {bool} refresh - If we want to refresh the previewer or not * @param {bool} filtering - If we want to filter or not. * @returns {void} */ setValue: function (newValue, refresh, filtering) { // We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB var filteredValue = newValue, filter = []; if (filtering) { jQuery.each(this.params.fields, function (index, value) { if ( "image" === value.type || "cropped_image" === value.type || "upload" === value.type ) { filter.push(index); } }); jQuery.each(newValue, function (index, value) { jQuery.each(filter, function (ind, field) { if (!_.isUndefined(value[field]) && !_.isUndefined(value[field].id)) { filteredValue[index][field] = value[field].id; } }); }); } this.setting.set(encodeURI(JSON.stringify(filteredValue))); if (refresh) { // Trigger the change event on the hidden field so // previewer refresh the website on Customizer this.settingField.trigger("change"); } }, /** * Add a new row to repeater settings based on the structure. * * @param {Object} data - (Optional) Object of field => value pairs (undefined if you want to get the default values) * @returns {Object} - Returns the new row. */ addRow: function (data) { var control = this, template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ). settingValue = this.getValue(), // Get the current setting value. newRowSetting = {}, // Saves the new setting data. templateData, // Data to pass to the template newRow, i; if (template) { // The control structure is going to define the new fields // We need to clone control.params.fields. Assigning it // ould result in a reference assignment. templateData = jQuery.extend(true, {}, control.params.fields); // But if we have passed data, we'll use the data values instead if (data) { for (i in data) { if (data.hasOwnProperty(i) && templateData.hasOwnProperty(i)) { templateData[i].default = data[i]; } } } templateData.index = this.currentIndex; // Append the template content template = template(templateData); // Create a new row object and append the element newRow = new RepeaterRow( control.currentIndex, jQuery(template).appendTo(control.repeaterFieldsContainer), control.params.row_label, control ); newRow.container.on("row:remove", function (e, rowIndex) { control.deleteRow(rowIndex); }); newRow.container.on( "row:update", function (e, rowIndex, fieldName, element) { control.updateField.call(control, e, rowIndex, fieldName, element); // eslint-disable-line no-useless-call newRow.updateLabel(); } ); // Add the row to rows collection this.rows[this.currentIndex] = newRow; for (i in templateData) { if (templateData.hasOwnProperty(i)) { newRowSetting[i] = templateData[i].default; } } settingValue[this.currentIndex] = newRowSetting; this.setValue(settingValue, true); this.currentIndex++; return newRow; } }, sort: function () { var control = this, $rows = this.repeaterFieldsContainer.find(".repeater-row"), newOrder = [], settings = control.getValue(), newRows = [], newSettings = []; $rows.each(function (i, element) { newOrder.push(jQuery(element).data("row")); }); jQuery.each(newOrder, function (newPosition, oldPosition) { newRows[newPosition] = control.rows[oldPosition]; newRows[newPosition].setRowIndex(newPosition); newSettings[newPosition] = settings[oldPosition]; }); control.rows = newRows; control.setValue(newSettings); }, /** * Delete a row in the repeater setting * * @param {int} index - Position of the row in the complete Setting Array * @returns {void} */ deleteRow: function (index) { var currentSettings = this.getValue(), row, prop; if (currentSettings[index]) { // Find the row row = this.rows[index]; if (row) { // Remove the row settings delete currentSettings[index]; // Remove the row from the rows collection delete this.rows[index]; // Update the new setting values this.setValue(currentSettings, true); } } // Remap the row numbers for (prop in this.rows) { if (this.rows.hasOwnProperty(prop) && this.rows[prop]) { this.rows[prop].updateLabel(); } } }, /** * Update a single field inside a row. * Triggered when a field has changed * * @param {Object} e - Event Object * @param {int} rowIndex - The row's index as an integer. * @param {string} fieldId - The field ID. * @param {string|Object} element - The element's identifier, or jQuery Object of the element. * @returns {void} */ updateField: function (e, rowIndex, fieldId, element) { var type, row, currentSettings; if (!this.rows[rowIndex]) { return; } if (!this.params.fields[fieldId]) { return; } type = this.params.fields[fieldId].type; row = this.rows[rowIndex]; currentSettings = this.getValue(); element = jQuery(element); if (_.isUndefined(currentSettings[row.rowIndex][fieldId])) { return; } if ("checkbox" === type) { currentSettings[row.rowIndex][fieldId] = element.is(":checked"); } else { // Update the settings currentSettings[row.rowIndex][fieldId] = element.val(); } this.setValue(currentSettings, true); }, /** * Init the color picker on color fields * Called after AddRow * * @returns {void} */ initColorPicker: function () { var control = this; var colorPicker = control.container.find(".kirki-classic-color-picker"); var fieldId = colorPicker.data("field"); var options = {}; // We check if the color palette parameter is defined. if ( !_.isUndefined(fieldId) && !_.isUndefined(control.params.fields[fieldId]) && !_.isUndefined(control.params.fields[fieldId].palettes) && _.isObject(control.params.fields[fieldId].palettes) ) { options.palettes = control.params.fields[fieldId].palettes; } // When the color picker value is changed we update the value of the field options.change = function (event, ui) { var currentPicker = jQuery(event.target); var row = currentPicker.closest(".repeater-row"); var rowIndex = row.data("row"); var currentSettings = control.getValue(); var value = ui.color._alpha < 1 ? ui.color.to_s() : ui.color.toString(); currentSettings[rowIndex][currentPicker.data("field")] = value; control.setValue(currentSettings, true); // By default if the alpha is 1, the input will be rgb. // We setTimeout to 50ms to prevent race value set. setTimeout(function() { event.target.value = value; }, 50); }; // Init the color picker if (colorPicker.length && 0 !== colorPicker.length) { colorPicker.wpColorPicker(options); } }, /** * Init the dropdown-pages field. * Called after AddRow * * @param {object} theNewRow the row that was added to the repeater * @param {object} data the data for the row if we're initializing a pre-existing row * @returns {void} */ initSelect: function (theNewRow, data) { var control = this, dropdown = theNewRow.container.find(".repeater-field select"), dataField; if (0 === dropdown.length) { return; } dataField = dropdown.data("field"); multiple = jQuery(dropdown).data("multiple"); data = data || {}; data[dataField] = data[dataField] || ""; jQuery(dropdown).val(data[dataField] || jQuery(dropdown).val()); this.container.on("change", ".repeater-field select", function (event) { var currentDropdown = jQuery(event.target), row = currentDropdown.closest(".repeater-row"), rowIndex = row.data("row"), currentSettings = control.getValue(); currentSettings[rowIndex][currentDropdown.data("field")] = jQuery(this).val(); control.setValue(currentSettings); }); }, }); kirki-packages/control-repeater/src/control.scss000064400000007650147177211530016102 0ustar00.customize-control-repeater { position: relative; } .customize-control-repeater .repeater-fields .repeater-row { border: 1px solid #e5e5e5; margin-top: 0.5rem; background: #eee; position: relative; } .customize-control-repeater .repeater-fields .repeater-row.minimized { border: 1px solid #dfdfdf; padding: 0; } .customize-control-repeater .repeater-fields .repeater-row.minimized:hover { border: 1px solid #e5e5e5; } .customize-control-repeater .repeater-fields .repeater-row.minimized .repeater-row-content { display: none; } .customize-control-repeater .repeater-fields .repeater-row label { margin-bottom: 12px; clear: both; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field- { display: none; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input { display: none; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img { border: 1px solid transparent; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked + label img { -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25); border: 1px solid #3498db; } .customize-control-repeater .repeater-fields .repeater-row .repeater-field:last-child { border-bottom: none; padding-bottom: 0; } .customize-control-repeater button.repeater-add { margin-top: 1rem; } .customize-control-repeater .repeater-row-content { padding: 10px 15px; background: #fff; } .customize-control-repeater .repeater-field { margin-bottom: 12px; width: 100%; clear: both; padding-bottom: 12px; border-bottom: 1px dotted #ccc; } .customize-control-repeater .repeater-field .customize-control-title { font-size: 13px; line-height: initial; } .customize-control-repeater .repeater-field .customize-control-description { font-size: 13px; line-height: initial; } .customize-control-repeater .repeater-field.repeater-field-hidden { margin: 0; padding: 0; border: 0; } .customize-control-repeater .repeater-field-select select { margin-left: 0; } .customize-control-repeater .repeater-field-checkbox label { line-height: 28px; } .customize-control-repeater .repeater-field-checkbox input { line-height: 28px; margin-right: 5px; } .customize-control-repeater .repeater-field-textarea textarea { width: 100%; resize: vertical; } .customize-control-repeater .repeater-row-header { background: white; border-bottom: 1px solid #dfdfdf; position: relative; padding: 10px 15px; height: auto; min-height: 20px; line-height: 30px; overflow: hidden; word-wrap: break-word; } .customize-control-repeater .repeater-row-header:hover { cursor: move; } .customize-control-repeater .repeater-row-header .dashicons { font-size: 18px; position: absolute; right: 12px; top: 2px; color: #a0a5aa; } .customize-control-repeater .repeater-row-label { font-size: 13px; font-weight: 600; line-height: 20px; display: block; width: 90%; overflow: hidden; height: 18px; } .customize-control-repeater .repeater-row-remove { color: #a00; } .customize-control-repeater .repeater-row-remove:hover { color: #f00; } .customize-control-repeater .repeater-minimize { line-height: 36px; } .customize-control-repeater .remove-button, .customize-control-repeater .upload-button { width: 48%; } .kirki-image-attachment { margin: 0; text-align: center; margin-bottom: 10px; } .kirki-image-attachment img { display: inline-block; } .kirki-file-attachment { margin: 0; text-align: center; margin-bottom: 10px; } .kirki-file-attachment .file { display: block; padding: 10px 5px; border: 1px dotted #c3c3c3; background: #f9f9f9; } .limit { padding: 3px; border-radius: 3px; } .limit.highlight { background: #d32f2f; color: #fff; } kirki-packages/control-repeater/src/Field/Repeater.php000064400000011246147177211530017024 0ustar00type = 'repeater'; } /** * Sets the $transport * * @access protected * @since 1.0 * @return void */ protected function set_transport() { // Force using refresh mode. // Currently the repeater control does not support postMessage. $this->transport = 'refresh'; } /** * Sets the $sanitize_callback * * @access protected * @since 1.0 * @return void */ protected function set_sanitize_callback() { if ( empty( $this->sanitize_callback ) ) { $this->sanitize_callback = [ $this, 'sanitize' ]; } } /** * The sanitize method that will be used as a falback * * @access public * @since 1.0 * @param string|array $value The control's value. */ public function sanitize( $value ) { // is the value formatted as a string? if ( is_string( $value ) ) { $value = rawurldecode( $value ); $value = json_decode( $value, true ); } // Nothing to sanitize if we don't have fields. if ( empty( $this->fields ) ) { return $value; } foreach ( $value as $row_id => $row_value ) { // Make sure the row is formatted as an array. if ( ! is_array( $row_value ) ) { $value[ $row_id ] = []; continue; } // Start parsing sub-fields in rows. foreach ( $row_value as $subfield_id => $subfield_value ) { // Make sure this is a valid subfield. // If it's not, then unset it. if ( ! isset( $this->fields[ $subfield_id ] ) ) { unset( $value[ $row_id ][ $subfield_id ] ); } // Get the subfield-type. if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) { continue; } $subfield = $this->fields[ $subfield_id ]; $subfield_type = $subfield['type']; // Allow using a sanitize-callback on a per-field basis. if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) { $subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value ); } else { switch ( $subfield_type ) { case 'image': case 'cropped_image': case 'upload': $save_as = isset( $subfield['choices'] ) && isset( $subfield['choices']['save_as'] ) ? $subfield['choices']['save_as'] : 'url'; $subfield_value = Upload::sanitize( $subfield_value, $save_as ); break; case 'dropdown-pages': $subfield_value = (int) $subfield_value; break; case 'color': if ( $subfield_value ) { $subfield_value = \Kirki\Field\ReactColorful::sanitize( $subfield_value ); } break; case 'text': $subfield_value = sanitize_text_field( $subfield_value ); break; case 'url': case 'link': $subfield_value = esc_url_raw( $subfield_value ); break; case 'email': $subfield_value = filter_var( $subfield_value, FILTER_SANITIZE_EMAIL ); break; case 'tel': $subfield_value = sanitize_text_field( $subfield_value ); break; case 'checkbox': $subfield_value = (bool) $subfield_value; break; case 'select': if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) { if ( true === $this->fields[ $subfield_id ]['multiple'] ) { $multiple = 2; } $multiple = (int) $this->fields[ $subfield_id ]['multiple']; if ( 1 < $multiple ) { $subfield_value = (array) $subfield_value; foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) { $subfield_value[ $sub_subfield_key ] = sanitize_text_field( $sub_subfield_value ); } } else { $subfield_value = sanitize_text_field( $subfield_value ); } } break; case 'radio': case 'radio-image': $subfield_value = sanitize_text_field( $subfield_value ); break; case 'textarea': $subfield_value = html_entity_decode( wp_kses_post( $subfield_value ) ); } } $value[ $row_id ][ $subfield_id ] = $subfield_value; } } return $value; } } kirki-packages/control-repeater/src/Control/Repeater.php000064400000050055147177211530017422 0ustar00row_label = [ 'type' => 'text', 'value' => esc_attr__( 'row', 'kirki' ), 'field' => false, ]; // Validate row-labels. $this->row_label( $args ); if ( empty( $this->button_label ) ) { /* translators: %s represents the label of the row. */ $this->button_label = sprintf( esc_html__( 'Add new %s', 'kirki' ), $this->row_label['value'] ); } if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) { $args['fields'] = []; } // An array to store keys of fields that need to be filtered. $media_fields_to_filter = []; foreach ( $args['fields'] as $key => $value ) { if ( ! isset( $value['default'] ) ) { $args['fields'][ $key ]['default'] = ''; } if ( ! isset( $value['label'] ) ) { $args['fields'][ $key ]['label'] = ''; } $args['fields'][ $key ]['id'] = $key; // We check if the filed is an uploaded media ( image , file, video, etc.. ). if ( isset( $value['type'] ) ) { switch ( $value['type'] ) { case 'image': case 'cropped_image': case 'upload': // We add it to the list of fields that need some extra filtering/processing. $media_fields_to_filter[ $key ] = true; break; case 'dropdown-pages': // If the field is a dropdown-pages field then add it to args. $dropdown = wp_dropdown_pages( [ 'name' => '', 'echo' => 0, 'show_option_none' => esc_html__( 'Select a Page', 'kirki' ), 'option_none_value' => '0', 'selected' => '', ] ); // Hackily add in the data link parameter. $dropdown = str_replace( 'get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment $args['fields'][ $key ]['dropdown'] = $dropdown; break; } } } $this->fields = $args['fields']; // Now we are going to filter the fields. // First we create a copy of the value that would be used otherwise. $this->filtered_value = $this->value(); if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) { // We iterate over the list of fields. foreach ( $this->filtered_value as &$filtered_value_field ) { if ( is_array( $filtered_value_field ) && ! empty( $filtered_value_field ) ) { // We iterate over the list of properties for this field. foreach ( $filtered_value_field as $key => &$value ) { // We check if this field was marked as requiring extra filtering (in this case image, cropped_images, upload). if ( array_key_exists( $key, $media_fields_to_filter ) ) { // What follows was made this way to preserve backward compatibility. // The repeater control use to store the URL for images instead of the attachment ID. // We check if the value look like an ID (otherwise it's probably a URL so don't filter it). if ( is_numeric( $value ) ) { // "sanitize" the value. $attachment_id = (int) $value; // Try to get the attachment_url. $url = wp_get_attachment_url( $attachment_id ); $filename = basename( get_attached_file( $attachment_id ) ); // If we got a URL. if ( $url ) { // 'id' is needed for form hidden value, URL is needed to display the image. $value = [ 'id' => $attachment_id, 'url' => $url, 'filename' => $filename, ]; } } } } } } } } /** * Enqueue control related scripts/styles. * * @access public * @since 1.0 * @return void */ public function enqueue() { parent::enqueue(); // Enqueue the style. wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_style( 'kirki-control-repeater-style', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.css' ), [], self::$control_ver ); // Enqueue the script. wp_enqueue_script( 'wp-color-picker-alpha', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/wp-color-picker-alpha.min.js' ), array( 'jquery', 'customize-base', 'wp-color-picker' ), self::$control_ver, false ); wp_enqueue_script( 'kirki-control-repeater', URL::get_from_path( dirname( dirname( __DIR__ ) ) . '/dist/control.js' ), [ 'wp-color-picker-alpha' ], self::$control_ver, false ); } /** * Refresh the parameters passed to the JavaScript via JSON. * * @access public * @since 1.0 * @return void */ public function to_json() { parent::to_json(); $fields = $this->fields; $this->json['fields'] = $fields; $this->json['row_label'] = $this->row_label; // If filtered_value has been set and is not empty we use it instead of the actual value. if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) { $this->json['value'] = $this->filtered_value; } $this->json['value'] = apply_filters( "kirki_controls_repeater_value_{$this->id}", $this->json['value'] ); } /** * Render the control's content. * Allows the content to be overriden without having to rewrite the wrapper in $this->render(). * * @access protected * @since 1.0 * @return void */ protected function render_content() { ?>
      choices['limit'] ) ) : ?>

      choices['limit'] ) ); ?>

      repeater_js_template(); } /** * An Underscore (JS) template for this control's content (but not its container). * Class variables for this control class are available in the `data` JS object. * * @access public * @since 1.0 * @return void */ public function repeater_js_template() { ?> row_label['type'] = $args['row_label']['type']; } // Validating row label type. if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) { $this->row_label['value'] = esc_html( $args['row_label']['value'] ); } // Validating row label field. if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ sanitize_key( $args['row_label']['field'] ) ] ) ) { $this->row_label['field'] = esc_html( $args['row_label']['field'] ); } else { // If from field is not set correctly, making sure standard is set as the type. $this->row_label['type'] = 'text'; } } } } kirki-packages/control-repeater/dist/control.js000064400000026267147177211530015724 0ustar00!function(){var e=function(e,t,i,a){var r=this;this.rowIndex=e,this.container=t,this.label=i,this.header=this.container.find(".repeater-row-header"),this.header.on("click",(function(){r.toggleMinimize()})),this.container.on("click",".repeater-row-remove",(function(){r.remove()})),this.header.on("mousedown",(function(){r.container.trigger("row:start-dragging")})),this.container.on("keyup change","input, select, textarea",(function(e){r.container.trigger("row:update",[r.rowIndex,jQuery(e.target).data("field"),e.target])})),this.setRowIndex=function(e){this.rowIndex=e,this.container.attr("data-row",e),this.container.data("row",e),this.updateLabel()},this.toggleMinimize=function(){this.container.toggleClass("minimized"),this.header.find(".dashicons").toggleClass("dashicons-arrow-up").toggleClass("dashicons-arrow-down")},this.remove=function(){this.container.slideUp(300,(function(){jQuery(this).detach()})),this.container.trigger("row:remove",[this.rowIndex])},this.updateLabel=function(){var e,t,i;if("field"===this.label.type&&(e=this.container.find('.repeater-field [data-field="'+this.label.field+'"]'),_.isFunction(e.val)&&""!==(t=e.val())))return _.isUndefined(a.params.fields[this.label.field])||_.isUndefined(a.params.fields[this.label.field].type)||("select"===a.params.fields[this.label.field].type?_.isUndefined(a.params.fields[this.label.field].choices)||_.isUndefined(a.params.fields[this.label.field].choices[e.val()])||(t=a.params.fields[this.label.field].choices[e.val()]):"radio"!==a.params.fields[this.label.field].type&&"radio-image"!==a.params.fields[this.label.field].type||(i=a.selector+' [data-row="'+this.rowIndex+'"] .repeater-field [data-field="'+this.label.field+'"]:checked',t=jQuery(i).val())),void this.header.find(".repeater-row-label").text(t);this.header.find(".repeater-row-label").text(this.label.value+" "+(this.rowIndex+1))},this.updateLabel()};wp.customize.controlConstructor.repeater=wp.customize.Control.extend({ready:function(){!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(e){var t,i,a;a=(e=e||this).params.value,e.settingField=e.container.find("[data-customize-setting-link]").first(),e.setValue([],!1),e.repeaterFieldsContainer=e.container.find(".repeater-fields").first(),e.currentIndex=0,e.rows=[],t=!1,_.isUndefined(e.params.choices.limit)||(t=!(0>=e.params.choices.limit)&&parseInt(e.params.choices.limit,10)),e.container.on("click","button.repeater-add",(function(a){a.preventDefault(),!t||e.currentIndex/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(i){return _.template(e.container.find(".customize-control-repeater-content").first().html(),null,t)(i)}})),a.length&&_.each(a,(function(t){i=e.addRow(t),e.initColorPicker(),e.initSelect(i,t)})),e.repeaterFieldsContainer.sortable({handle:".repeater-row-header",update:function(){e.sort()}})},openFrame:function(e){wp.customize.utils.isKeydownButNotEnterEvent(e)||(this.$thisButton.closest(".repeater-field").hasClass("repeater-field-cropped_image")?this.initCropperFrame():this.initFrame(),this.frame.open())},initFrame:function(){var e=this.getMimeType();this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1})]}),this.frame.on("select",this.onSelect,this)},initCropperFrame:function(){var e=this.$thisButton.siblings("input.hidden-field").attr("data-field"),t=this.getMimeType();_.isString(e)&&""!==e&&_.isObject(this.params.fields[e])&&"cropped_image"===this.params.fields[e].type&&["width","height","flex_width","flex_height"].forEach(function(t){_.isUndefined(this.params.fields[e][t])||(this.params[t]=this.params.fields[e][t])}.bind(this)),this.frame=wp.media({button:{text:"Select and Crop",close:!1},states:[new wp.media.controller.Library({library:wp.media.query({type:t}),multiple:!1,date:!1,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelectForCrop,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var e=this.frame.state().get("selection").first().toJSON();this.$thisButton.closest(".repeater-field").hasClass("repeater-field-upload")?this.setFileInRepeaterField(e):this.setImageInRepeaterField(e)},onSelectForCrop:function(){var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):this.setImageInRepeaterField(e)},onCropped:function(e){this.setImageInRepeaterField(e)},calculateImageSelectOptions:function(e,t){var i,a,r,n=t.get("control"),s=!!parseInt(n.params.flex_width,10),o=!!parseInt(n.params.flex_height,10),l=e.get("width"),d=e.get("height"),h=parseInt(n.params.width,10),p=parseInt(n.params.height,10),c=h/p,u=l,f=d;return t.set("canSkipCrop",!n.mustBeCropped(s,o,h,p,l,d)),u/f>c?h=(p=f)*c:p=(h=u)/c,r={handles:!0,keys:!0,instance:!0,persistent:!0,imageWidth:l,imageHeight:d,x1:i=(u-h)/2,y1:a=(f-p)/2,x2:h+i,y2:p+a},!1===o&&!1===s&&(r.aspectRatio=h+":"+p),!1===o&&(r.maxHeight=p),!1===s&&(r.maxWidth=h),r},mustBeCropped:function(e,t,i,a,r,n){return!(!0===e&&!0===t||!0===e&&a===n||!0===t&&i===r||i===r&&a===n||r<=i)},onSkippedCrop:function(){var e=this.frame.state().get("selection").first().toJSON();this.setImageInRepeaterField(e)},setImageInRepeaterField:function(e){var t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image");t.find(".kirki-image-attachment").html('').hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},setFileInRepeaterField:function(e){var t=this.$thisButton.closest(".repeater-field-upload");t.find(".kirki-file-attachment").html(' '+e.filename+"").hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".upload-button").show(),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},getMimeType:function(){var e=this.$thisButton.siblings("input.hidden-field").attr("data-field");return _.isString(e)&&""!==e&&_.isObject(this.params.fields[e])&&"upload"===this.params.fields[e].type&&!_.isUndefined(this.params.fields[e].mime_type)?this.params.fields[e].mime_type:"image"},removeImage:function(e){var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload")).find(".upload-button"),t.find(".kirki-image-attachment").slideUp("fast",(function(){jQuery(this).show().html(jQuery(this).data("placeholder"))})),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},removeFile:function(e){var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-upload")).find(".upload-button"),t.find(".kirki-file-attachment").slideUp("fast",(function(){jQuery(this).show().html(jQuery(this).data("placeholder"))})),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},getValue:function(){return JSON.parse(decodeURI(this.setting.get()))},setValue:function(e,t,i){var a=e,r=[];i&&(jQuery.each(this.params.fields,(function(e,t){"image"!==t.type&&"cropped_image"!==t.type&&"upload"!==t.type||r.push(e)})),jQuery.each(e,(function(e,t){jQuery.each(r,(function(i,r){_.isUndefined(t[r])||_.isUndefined(t[r].id)||(a[e][r]=t[r].id)}))}))),this.setting.set(encodeURI(JSON.stringify(a))),t&&this.settingField.trigger("change")},addRow:function(t){var i,a,r,n=this,s=n.repeaterTemplate(),o=this.getValue(),l={};if(s){if(i=jQuery.extend(!0,{},n.params.fields),t)for(r in t)t.hasOwnProperty(r)&&i.hasOwnProperty(r)&&(i[r].default=t[r]);for(r in i.index=this.currentIndex,s=s(i),(a=new e(n.currentIndex,jQuery(s).appendTo(n.repeaterFieldsContainer),n.params.row_label,n)).container.on("row:remove",(function(e,t){n.deleteRow(t)})),a.container.on("row:update",(function(e,t,i,r){n.updateField.call(n,e,t,i,r),a.updateLabel()})),this.rows[this.currentIndex]=a,i)i.hasOwnProperty(r)&&(l[r]=i[r].default);return o[this.currentIndex]=l,this.setValue(o,!0),this.currentIndex++,a}},sort:function(){var e=this,t=this.repeaterFieldsContainer.find(".repeater-row"),i=[],a=e.getValue(),r=[],n=[];t.each((function(e,t){i.push(jQuery(t).data("row"))})),jQuery.each(i,(function(t,i){r[t]=e.rows[i],r[t].setRowIndex(t),n[t]=a[i]})),e.rows=r,e.setValue(n)},deleteRow:function(e){var t,i=this.getValue();for(t in i[e]&&this.rows[e]&&(delete i[e],delete this.rows[e],this.setValue(i,!0)),this.rows)this.rows.hasOwnProperty(t)&&this.rows[t]&&this.rows[t].updateLabel()},updateField:function(e,t,i,a){var r,n,s;this.rows[t]&&this.params.fields[i]&&(r=this.params.fields[i].type,n=this.rows[t],s=this.getValue(),a=jQuery(a),_.isUndefined(s[n.rowIndex][i])||(s[n.rowIndex][i]="checkbox"===r?a.is(":checked"):a.val(),this.setValue(s,!0)))},initColorPicker:function(){var e=this,t=e.container.find(".kirki-classic-color-picker"),i=t.data("field"),a={};_.isUndefined(i)||_.isUndefined(e.params.fields[i])||_.isUndefined(e.params.fields[i].palettes)||!_.isObject(e.params.fields[i].palettes)||(a.palettes=e.params.fields[i].palettes),a.change=function(t,i){var a=jQuery(t.target),r=a.closest(".repeater-row").data("row"),n=e.getValue(),s=i.color._alpha<1?i.color.to_s():i.color.toString();n[r][a.data("field")]=s,e.setValue(n,!0),setTimeout((function(){t.target.value=s}),50)},t.length&&0!==t.length&&t.wpColorPicker(a)},initSelect:function(e,t){var i,a=this,r=e.container.find(".repeater-field select");0!==r.length&&(i=r.data("field"),multiple=jQuery(r).data("multiple"),(t=t||{})[i]=t[i]||"",jQuery(r).val(t[i]||jQuery(r).val()),this.container.on("change",".repeater-field select",(function(e){var t=jQuery(e.target),i=t.closest(".repeater-row").data("row"),r=a.getValue();r[i][t.data("field")]=jQuery(this).val(),a.setValue(r)})))}})}(); //# sourceMappingURL=control.js.map kirki-packages/control-repeater/dist/control.css.map000064400000022646147177211530016651 0ustar00{"mappings":"AAAA,4BACE,iBCCF,CDEA,2DAGE,eAAA,CAFA,wBAAA,CACA,gBAAA,CAEA,iBCCF,CDEA,qEACE,wBAAA,CACA,SCCF,CDEA,2EACE,wBCCF,CDEA,2FAIE,YCFF,CDKA,iEAEE,UAAA,CADA,kBCDF,CDYA,uMAKE,YCTF,CDYA,gHAME,4BCdF,CDiBA,8HASE,wBAAA,CAFA,8CAAA,CACA,sCCnBF,CDuBA,sFAIE,kBAAA,CACA,gBCvBF,CD0BA,gDACE,eCvBF,CD0BA,kDAEE,eAAA,CADA,iBCtBF,CD0BA,4CAKE,6BAAA,CAFA,UAAA,CAFA,kBAAA,CAGA,mBAAA,CAFA,UCpBF,CD+BA,gJACE,cAAA,CACA,kBCvBF,CD0BA,kEAGE,QAAA,CAFA,QAAA,CACA,SCtBF,CD0BA,0DACE,aCvBF,CD0BA,2DACE,gBCvBF,CD0BA,2DACE,gBAAA,CACA,gBCvBF,CD0BA,8DAEE,eAAA,CADA,UCtBF,CD0BA,iDASE,oBAAA,CARA,eAAA,CACA,+BAAA,CAGA,WAAA,CAEA,gBAAA,CADA,eAAA,CAEA,eAAA,CAJA,iBAAA,CADA,iBCjBF,CD0BA,uDACE,WCvBF,CD0BA,4DAKE,aAAA,CAJA,cAAA,CACA,iBAAA,CACA,UAAA,CACA,OCtBF,CD0BA,gDAIE,aAAA,CAHA,cAAA,CACA,eAAA,CAKA,WAAA,CAJA,gBAAA,CAGA,eAAA,CADA,SCrBF,CD0BA,iDACE,UCvBF,CD0BA,uDACE,SCvBF,CD0BA,+CACE,gBCvBF,CD0BA,sFAEE,SCvBF,CD0BA,wBAGE,eAAA,CADA,iBCtBF,CD0BA,4BACE,oBCvBF,CD0BA,uBAGE,eAAA,CADA,iBCtBF,CD0BA,6BAIE,kBAAA,CADA,yBAAA,CAFA,aAAA,CACA,gBCrBF,CD0BA,OAEE,iBAAA,CADA,WCtBF,CD0BA,iBACE,kBAAA,CACA,UCvBF","sources":["packages/kirki-framework/control-repeater/src/control.scss","%3Cinput%20css%209hCl6T%3E"],"sourcesContent":[".customize-control-repeater {\n position: relative;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row {\n border: 1px solid #e5e5e5;\n margin-top: 0.5rem;\n background: #eee;\n position: relative;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row.minimized {\n border: 1px solid #dfdfdf;\n padding: 0;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row.minimized:hover {\n border: 1px solid #e5e5e5;\n}\n\n.customize-control-repeater\n .repeater-fields\n .repeater-row.minimized\n .repeater-row-content {\n display: none;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row label {\n margin-bottom: 12px;\n clear: both;\n}\n\n.customize-control-repeater\n .repeater-fields\n .repeater-row\n .repeater-field.repeater-field- {\n display: none;\n}\n\n.customize-control-repeater\n .repeater-fields\n .repeater-row\n .repeater-field.repeater-field-radio-image\n input {\n display: none;\n}\n\n.customize-control-repeater\n .repeater-fields\n .repeater-row\n .repeater-field.repeater-field-radio-image\n input\n img {\n border: 1px solid transparent;\n}\n\n.customize-control-repeater\n .repeater-fields\n .repeater-row\n .repeater-field.repeater-field-radio-image\n input:checked\n + label\n img {\n -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n border: 1px solid #3498db;\n}\n\n.customize-control-repeater\n .repeater-fields\n .repeater-row\n .repeater-field:last-child {\n border-bottom: none;\n padding-bottom: 0;\n}\n\n.customize-control-repeater button.repeater-add {\n margin-top: 1rem;\n}\n\n.customize-control-repeater .repeater-row-content {\n padding: 10px 15px;\n background: #fff;\n}\n\n.customize-control-repeater .repeater-field {\n margin-bottom: 12px;\n width: 100%;\n clear: both;\n padding-bottom: 12px;\n border-bottom: 1px dotted #ccc;\n}\n\n.customize-control-repeater .repeater-field .customize-control-title {\n font-size: 13px;\n line-height: initial;\n}\n\n.customize-control-repeater .repeater-field .customize-control-description {\n font-size: 13px;\n line-height: initial;\n}\n\n.customize-control-repeater .repeater-field.repeater-field-hidden {\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n.customize-control-repeater .repeater-field-select select {\n margin-left: 0;\n}\n\n.customize-control-repeater .repeater-field-checkbox label {\n line-height: 28px;\n}\n\n.customize-control-repeater .repeater-field-checkbox input {\n line-height: 28px;\n margin-right: 5px;\n}\n\n.customize-control-repeater .repeater-field-textarea textarea {\n width: 100%;\n resize: vertical;\n}\n\n.customize-control-repeater .repeater-row-header {\n background: white;\n border-bottom: 1px solid #dfdfdf;\n position: relative;\n padding: 10px 15px;\n height: auto;\n min-height: 20px;\n line-height: 30px;\n overflow: hidden;\n word-wrap: break-word;\n}\n\n.customize-control-repeater .repeater-row-header:hover {\n cursor: move;\n}\n\n.customize-control-repeater .repeater-row-header .dashicons {\n font-size: 18px;\n position: absolute;\n right: 12px;\n top: 2px;\n color: #a0a5aa;\n}\n\n.customize-control-repeater .repeater-row-label {\n font-size: 13px;\n font-weight: 600;\n line-height: 20px;\n display: block;\n width: 90%;\n overflow: hidden;\n height: 18px;\n}\n\n.customize-control-repeater .repeater-row-remove {\n color: #a00;\n}\n\n.customize-control-repeater .repeater-row-remove:hover {\n color: #f00;\n}\n\n.customize-control-repeater .repeater-minimize {\n line-height: 36px;\n}\n\n.customize-control-repeater .remove-button,\n.customize-control-repeater .upload-button {\n width: 48%;\n}\n\n.kirki-image-attachment {\n margin: 0;\n text-align: center;\n margin-bottom: 10px;\n}\n\n.kirki-image-attachment img {\n display: inline-block;\n}\n\n.kirki-file-attachment {\n margin: 0;\n text-align: center;\n margin-bottom: 10px;\n}\n\n.kirki-file-attachment .file {\n display: block;\n padding: 10px 5px;\n border: 1px dotted #c3c3c3;\n background: #f9f9f9;\n}\n\n.limit {\n padding: 3px;\n border-radius: 3px;\n}\n\n.limit.highlight {\n background: #d32f2f;\n color: #fff;\n}\n",".customize-control-repeater {\n position: relative;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row {\n border: 1px solid #e5e5e5;\n margin-top: 0.5rem;\n background: #eee;\n position: relative;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row.minimized {\n border: 1px solid #dfdfdf;\n padding: 0;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row.minimized:hover {\n border: 1px solid #e5e5e5;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row.minimized .repeater-row-content {\n display: none;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row label {\n margin-bottom: 12px;\n clear: both;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field- {\n display: none;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input {\n display: none;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img {\n border: 1px solid transparent;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked + label img {\n -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);\n border: 1px solid #3498db;\n}\n\n.customize-control-repeater .repeater-fields .repeater-row .repeater-field:last-child {\n border-bottom: none;\n padding-bottom: 0;\n}\n\n.customize-control-repeater button.repeater-add {\n margin-top: 1rem;\n}\n\n.customize-control-repeater .repeater-row-content {\n padding: 10px 15px;\n background: #fff;\n}\n\n.customize-control-repeater .repeater-field {\n margin-bottom: 12px;\n width: 100%;\n clear: both;\n padding-bottom: 12px;\n border-bottom: 1px dotted #ccc;\n}\n\n.customize-control-repeater .repeater-field .customize-control-title {\n font-size: 13px;\n line-height: initial;\n}\n\n.customize-control-repeater .repeater-field .customize-control-description {\n font-size: 13px;\n line-height: initial;\n}\n\n.customize-control-repeater .repeater-field.repeater-field-hidden {\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n.customize-control-repeater .repeater-field-select select {\n margin-left: 0;\n}\n\n.customize-control-repeater .repeater-field-checkbox label {\n line-height: 28px;\n}\n\n.customize-control-repeater .repeater-field-checkbox input {\n line-height: 28px;\n margin-right: 5px;\n}\n\n.customize-control-repeater .repeater-field-textarea textarea {\n width: 100%;\n resize: vertical;\n}\n\n.customize-control-repeater .repeater-row-header {\n background: white;\n border-bottom: 1px solid #dfdfdf;\n position: relative;\n padding: 10px 15px;\n height: auto;\n min-height: 20px;\n line-height: 30px;\n overflow: hidden;\n word-wrap: break-word;\n}\n\n.customize-control-repeater .repeater-row-header:hover {\n cursor: move;\n}\n\n.customize-control-repeater .repeater-row-header .dashicons {\n font-size: 18px;\n position: absolute;\n right: 12px;\n top: 2px;\n color: #a0a5aa;\n}\n\n.customize-control-repeater .repeater-row-label {\n font-size: 13px;\n font-weight: 600;\n line-height: 20px;\n display: block;\n width: 90%;\n overflow: hidden;\n height: 18px;\n}\n\n.customize-control-repeater .repeater-row-remove {\n color: #a00;\n}\n\n.customize-control-repeater .repeater-row-remove:hover {\n color: #f00;\n}\n\n.customize-control-repeater .repeater-minimize {\n line-height: 36px;\n}\n\n.customize-control-repeater .remove-button,\n.customize-control-repeater .upload-button {\n width: 48%;\n}\n\n.kirki-image-attachment {\n margin: 0;\n text-align: center;\n margin-bottom: 10px;\n}\n\n.kirki-image-attachment img {\n display: inline-block;\n}\n\n.kirki-file-attachment {\n margin: 0;\n text-align: center;\n margin-bottom: 10px;\n}\n\n.kirki-file-attachment .file {\n display: block;\n padding: 10px 5px;\n border: 1px dotted #c3c3c3;\n background: #f9f9f9;\n}\n\n.limit {\n padding: 3px;\n border-radius: 3px;\n}\n\n.limit.highlight {\n background: #d32f2f;\n color: #fff;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}kirki-packages/control-repeater/dist/control.js.map000064400000122225147177211530016467 0ustar00{"mappings":"YAKA,IAAIA,EAAc,SAAUC,EAAUC,EAAWC,EAAOC,GACtD,IAAIC,EAAOC,KACXA,KAAKL,SAAWA,EAChBK,KAAKJ,UAAYA,EACjBI,KAAKH,MAAQA,EACbG,KAAKC,OAASD,KAAKJ,UAAUM,KAAK,wBAElCF,KAAKC,OAAOE,GAAG,SAAS,WACtBJ,EAAKK,oBAGPJ,KAAKJ,UAAUO,GAAG,QAAS,wBAAwB,WACjDJ,EAAKM,YAGPL,KAAKC,OAAOE,GAAG,aAAa,WAC1BJ,EAAKH,UAAUU,QAAQ,yBAGzBN,KAAKJ,UAAUO,GAAG,eAAgB,2BAA2B,SAAUI,GACrER,EAAKH,UAAUU,QAAQ,aAAc,CACnCP,EAAKJ,SACLa,OAAOD,EAAEE,QAAQC,KAAK,SACtBH,EAAEE,YAINT,KAAKW,YAAc,SAAUC,GAC3BZ,KAAKL,SAAWiB,EAChBZ,KAAKJ,UAAUiB,KAAK,WAAYD,GAChCZ,KAAKJ,UAAUc,KAAK,MAAOE,GAC3BZ,KAAKc,eAGPd,KAAKI,eAAiB,WAEpBJ,KAAKJ,UAAUmB,YAAY,aAC3Bf,KAAKC,OACFC,KAAK,cACLa,YAAY,sBACZA,YAAY,yBAGjBf,KAAKK,OAAS,WACZL,KAAKJ,UAAUoB,QAAQ,KAAK,WAC1BR,OAAOR,MAAMiB,YAEfjB,KAAKJ,UAAUU,QAAQ,aAAc,CAACN,KAAKL,YAG7CK,KAAKc,YAAc,WACjB,IAAII,EAAeC,EAAUC,EAE7B,GAAI,UAAYpB,KAAKH,MAAMwB,OACzBH,EAAgBlB,KAAKJ,UAAUM,KAC7B,gCAAkCF,KAAKH,MAAMyB,MAAQ,MAEnDC,EAAEC,WAAWN,EAAcO,MAEzB,MADJN,EAAWD,EAAcO,QAoCvB,OAlCKF,EAAEG,YAAY5B,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,SAC7CC,EAAEG,YAAY5B,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOD,QACrD,WAAavB,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOD,KAEpDE,EAAEG,YACD5B,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOO,UAEzCN,EAAEG,YACD5B,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOO,QACtCX,EAAcO,UAIlBN,EACErB,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOO,QACtCX,EAAcO,QAIpB,UAAY3B,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOD,MACpD,gBAAkBvB,EAAQ6B,OAAOC,OAAO5B,KAAKH,MAAMyB,OAAOD,OAE1DD,EACEtB,EAAQgC,SACR,eACA9B,KAAKL,SACL,mCACAK,KAAKH,MAAMyB,MACX,aACFH,EAAWX,OAAOY,GAAkBK,aAI1CzB,KAAKC,OAAOC,KAAK,uBAAuB6B,KAAKZ,GAKnDnB,KAAKC,OACFC,KAAK,uBACL6B,KAAK/B,KAAKH,MAAMmC,MAAQ,KAAOhC,KAAKL,SAAW,KAEpDK,KAAKc,eAGPmB,GAAGC,UAAUC,mBAAmBC,SAAWH,GAAGC,UAAUG,QAAQC,OAAO,CAErEC,MAAO,YAKFhB,EAAEG,YAAYc,OAAOC,qBACtBlB,EAAEC,WAAWiB,oBAEbA,mBAPYzC,MAAAA,KASJ0C,oBAIZA,iBAAkB,SAAU5C,GAC1B,IAAI6C,EAAOC,EAAWC,EAItBA,GAHA/C,EAAUA,GAAWE,MAGE2B,OAAOK,MAG9BlC,EAAQgD,aAAehD,EAAQF,UAC5BM,KAAK,iCACL6C,QAGHjD,EAAQkD,SAAS,IAAI,GAGrBlD,EAAQmD,wBAA0BnD,EAAQF,UACvCM,KAAK,oBACL6C,QAGHjD,EAAQoD,aAAe,EAGvBpD,EAAQqD,KAAO,GAGfR,GAAQ,EACHpB,EAAEG,YAAY5B,EAAQ6B,OAAOE,QAAQc,SACxCA,IACE,GAAK7C,EAAQ6B,OAAOE,QAAQc,QAExBS,SAAStD,EAAQ6B,OAAOE,QAAQc,MAAO,KAG/C7C,EAAQF,UAAUO,GAAG,QAAS,uBAAuB,SAAUI,GAC7DA,EAAE8C,kBACGV,GAAS7C,EAAQoD,aAAeP,IACnCC,EAAY9C,EAAQwD,UACVlD,iBACVN,EAAQyD,kBACRzD,EAAQ0D,WAAWZ,IAEnBpC,OAAOV,EAAQgC,SAAW,WAAW2B,SAAS,gBAIlD3D,EAAQF,UAAUO,GAAG,QAAS,wBAAwB,WACpDL,EAAQoD,iBACHP,GAAS7C,EAAQoD,aAAeP,IACnCnC,OAAOV,EAAQgC,SAAW,WAAW4B,YAAY,gBAIrD5D,EAAQF,UAAUO,GAChB,iBACA,2HACA,SAAUI,GACRA,EAAE8C,iBACFvD,EAAQ6D,YAAcnD,OAAOR,MAC7BF,EAAQ8D,UAAUrD,MAItBT,EAAQF,UAAUO,GAChB,iBACA,qFACA,SAAUI,GACRA,EAAE8C,iBACFvD,EAAQ6D,YAAcnD,OAAOR,MAC7BF,EAAQ+D,YAAYtD,MAIxBT,EAAQF,UAAUO,GAChB,iBACA,yCACA,SAAUI,GACRA,EAAE8C,iBACFvD,EAAQ6D,YAAcnD,OAAOR,MAC7BF,EAAQgE,WAAWvD,MAOvBT,EAAQiE,iBAAmBxC,EAAEyC,SAAQ,WACnC,IAOEC,EAAU,CACRC,SAAQ,kBACRC,YAAW,0BACXC,OAAM,2BACNC,SAAU,QAGd,OAAO,SAAU3D,GASf,OARWa,EAAE+C,SACXxE,EAAQF,UACLM,KAAK,uCACL6C,QACAwB,OACH,KACAN,EAEKO,CAAS9D,OAMhBmC,EAAa4B,QACflD,EAAEmD,KAAK7B,GAAc,SAAU8B,GAC7B/B,EAAY9C,EAAQwD,OAAOqB,GAC3B7E,EAAQyD,kBACRzD,EAAQ0D,WAAWZ,EAAW+B,MAIlC7E,EAAQmD,wBAAwB2B,SAAS,CACvCC,OAAQ,uBACRC,OAAQ,WACNhF,EAAQiF,WAWdnB,UAAW,SAAUoB,GACf/C,GAAGC,UAAU+C,MAAMC,0BAA0BF,KAK/ChF,KAAK2D,YACFwB,QAAQ,mBACRC,SAAS,gCAEZpF,KAAKqF,mBAELrF,KAAKsF,YAGPtF,KAAKuF,MAAMC,SAGbF,UAAW,WACT,IAAIG,EAAezF,KAAK0F,cAExB1F,KAAKuF,MAAQtD,GAAG0D,MAAM,CACpBC,OAAQ,CACN,IAAI3D,GAAG0D,MAAME,WAAWC,QAAQ,CAC9BC,QAAS9D,GAAG0D,MAAMK,MAAM,CAAE3E,KAAMoE,IAChCQ,UAAU,EACVC,MAAM,OAMZlG,KAAKuF,MAAMpF,GAAG,SAAUH,KAAKmG,SAAUnG,OASzCqF,iBAAkB,WAEhB,IAAIe,EAAiBpG,KAAK2D,YACrB0C,SAAS,sBACTxF,KAAK,cAER4E,EAAezF,KAAK0F,cAGlBnE,EAAE+E,SAASF,IAAmB,KAAOA,GAGrC7E,EAAEgF,SAASvG,KAAK2B,OAAOC,OAAOwE,KAC9B,kBAAoBpG,KAAK2B,OAAOC,OAAOwE,GAAgB/E,MARjD,CAAC,QAAS,SAAU,aAAc,eAWlCmF,QAAO,SACDC,GAEHlF,EAAEG,YAAY1B,KAAK2B,OAAOC,OAAOwE,GAAgBK,MAEpDzG,KAAK2B,OAAO8E,GAAMzG,KAAK2B,OAAOC,OAAOwE,GAAgBK,KAEvDC,KAAK1G,OAKbA,KAAKuF,MAAQtD,GAAG0D,MAAM,CACpBgB,OAAQ,CACN5E,KAAM,kBACN6E,OAAO,GAEThB,OAAQ,CACN,IAAI3D,GAAG0D,MAAME,WAAWC,QAAQ,CAC9BC,QAAS9D,GAAG0D,MAAMK,MAAM,CAAE3E,KAAMoE,IAChCQ,UAAU,EACVC,MAAM,EACNW,eAAgB7G,KAAK2B,OAAOmF,MAC5BC,gBAAiB/G,KAAK2B,OAAOqF,SAE/B,IAAI/E,GAAG0D,MAAME,WAAWoB,sBAAsB,CAC5CC,iBAAkBlH,KAAKmH,4BACvBrH,QAASE,UAKfA,KAAKuF,MAAMpF,GAAG,SAAUH,KAAKoH,gBAAiBpH,MAC9CA,KAAKuF,MAAMpF,GAAG,UAAWH,KAAKqH,UAAWrH,MACzCA,KAAKuF,MAAMpF,GAAG,cAAeH,KAAKsH,cAAetH,OAGnDmG,SAAU,WACR,IAAIoB,EAAavH,KAAKuF,MAAMiC,QAAQC,IAAI,aAAa1E,QAAQ2E,SAG3D1H,KAAK2D,YACFwB,QAAQ,mBACRC,SAAS,yBAEZpF,KAAK2H,uBAAuBJ,GAE5BvH,KAAK4H,wBAAwBL,IASjCH,gBAAiB,WACf,IAAIG,EAAavH,KAAKuF,MAAMiC,QAAQC,IAAI,aAAa1E,QAAQ2E,SAG3D1H,KAAK2B,OAAOmF,QAAUS,EAAWT,OACjC9G,KAAK2B,OAAOqF,SAAWO,EAAWP,QACjChH,KAAK2B,OAAOkG,YACZ7H,KAAK2B,OAAOmG,YAIb9H,KAAKuF,MAAMwC,SAAS,WAFpB/H,KAAK4H,wBAAwBL,IAYjCF,UAAW,SAAUW,GACnBhI,KAAK4H,wBAAwBI,IAY/Bb,4BAA6B,SAAUI,EAAY1B,GACjD,IAUEoC,EACAC,EACAhB,EAZEpH,EAAU+F,EAAW4B,IAAI,WAC3BU,IAAc/E,SAAStD,EAAQ6B,OAAOkG,WAAY,IAClDO,IAAehF,SAAStD,EAAQ6B,OAAOmG,YAAa,IACpDO,EAAYd,EAAWE,IAAI,SAC3Ba,EAAaf,EAAWE,IAAI,UAC5Bc,EAAQnF,SAAStD,EAAQ6B,OAAOmF,MAAO,IACvC0B,EAAQpF,SAAStD,EAAQ6B,OAAOqF,OAAQ,IACxCyB,EAAQF,EAAQC,EAChBE,EAAOL,EACPM,EAAOL,EAmDT,OA9CAzC,EAAW+C,IACT,eACC9I,EAAQ+I,cACPV,EACAC,EACAG,EACAC,EACAH,EACAC,IAIAI,EAAOC,EAAOF,EAEhBF,GADAC,EAAQG,GACQF,EAGhBD,GADAD,EAAQG,GACQD,EAMlBvB,EAAmB,CACjB4B,SAAS,EACTC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,WAAYb,EACZc,YAAab,EACbL,GAVFA,GAAMS,EAAOH,GAAS,EAWpBL,GAVFA,GAAMS,EAAOH,GAAS,EAWpBY,GAAIb,EAAQN,EACZoB,GAAIb,EAAQN,IAGV,IAAUE,IAAc,IAAUD,IACpCjB,EAAiBoC,YAAcf,EAAQ,IAAMC,IAE3C,IAAUJ,IACZlB,EAAiBqC,UAAYf,IAE3B,IAAUL,IACZjB,EAAiBsC,SAAWjB,GAGvBrB,GAcT2B,cAAe,SAAUY,EAAOC,EAAOC,EAAMC,EAAMC,EAAMC,GACvD,SACG,IAASL,IAAS,IAASC,IAC3B,IAASD,GAASG,IAASE,IAC3B,IAASJ,GAASC,IAASE,GAC3BF,IAASE,GAAQD,IAASE,GAC3BD,GAAQF,IASZrC,cAAe,WACb,IAAIC,EAAavH,KAAKuF,MAAMiC,QAAQC,IAAI,aAAa1E,QAAQ2E,SAC7D1H,KAAK4H,wBAAwBL,IAS/BK,wBAAyB,SAAUL,GACjC,IAAIwC,EAAa/J,KAAK2D,YAAYwB,QAChC,uDAGF4E,EACG7J,KAAK,2BACLqE,KAAK,aAAegD,EAAWyC,IAAM,MACrCC,OACAC,UAAU,QAEbH,EAAW7J,KAAK,iBAAiBuB,IAAI8F,EAAW4C,IAChDnK,KAAK2D,YAAY5B,KAAK/B,KAAK2D,YAAYjD,KAAK,cAC5CqJ,EAAW7J,KAAK,kBAAkBkK,OAGlCL,EAAW7J,KAAK,2BAA2BI,QAAQ,UACnDN,KAAKuF,MAAMqB,SASbe,uBAAwB,SAAUJ,GAChC,IAAIwC,EAAa/J,KAAK2D,YAAYwB,QAAQ,0BAE1C4E,EACG7J,KAAK,0BACLqE,KACC,8EACEgD,EAAW8C,SACX,WAEHJ,OACAC,UAAU,QAEbH,EAAW7J,KAAK,iBAAiBuB,IAAI8F,EAAW4C,IAChDnK,KAAK2D,YAAY5B,KAAK/B,KAAK2D,YAAYjD,KAAK,cAC5CqJ,EAAW7J,KAAK,kBAAkBkK,OAClCL,EAAW7J,KAAK,kBAAkBkK,OAGlCL,EAAW7J,KAAK,2BAA2BI,QAAQ,UACnDN,KAAKuF,MAAMqB,SAGblB,YAAa,WAEX,IAAIU,EAAiBpG,KAAK2D,YACvB0C,SAAS,sBACTxF,KAAK,cAGR,OAAIU,EAAE+E,SAASF,IAAmB,KAAOA,GAGrC7E,EAAEgF,SAASvG,KAAK2B,OAAOC,OAAOwE,KAC9B,WAAapG,KAAK2B,OAAOC,OAAOwE,GAAgB/E,OAG3CE,EAAEG,YAAY1B,KAAK2B,OAAOC,OAAOwE,GAAgBkE,WAE7CtK,KAAK2B,OAAOC,OAAOwE,GAAgBkE,UAIzC,SAGTzG,YAAa,SAAUmB,GACrB,IAAI+E,EAAYQ,EAEZtI,GAAGC,UAAU+C,MAAMC,0BAA0BF,KAOjDuF,GAHAR,EAAa/J,KAAK2D,YAAYwB,QAC5B,+EAEyBjF,KAAK,kBAEhC6J,EAAW7J,KAAK,2BAA2Bc,QAAQ,QAAQ,WACzDR,OAAOR,MAAMoK,OAAO7F,KAAK/D,OAAOR,MAAMU,KAAK,mBAE7CqJ,EAAW7J,KAAK,iBAAiBuB,IAAI,IACrC8I,EAAcxI,KAAKwI,EAAc7J,KAAK,UACtCV,KAAK2D,YAAYsG,OAEjBF,EAAW7J,KAAK,2BAA2BI,QAAQ,YAGrDwD,WAAY,SAAUkB,GACpB,IAAI+E,EAAYQ,EAEZtI,GAAGC,UAAU+C,MAAMC,0BAA0BF,KAKjDuF,GADAR,EAAa/J,KAAK2D,YAAYwB,QAAQ,2BACXjF,KAAK,kBAEhC6J,EAAW7J,KAAK,0BAA0Bc,QAAQ,QAAQ,WACxDR,OAAOR,MAAMoK,OAAO7F,KAAK/D,OAAOR,MAAMU,KAAK,mBAE7CqJ,EAAW7J,KAAK,iBAAiBuB,IAAI,IACrC8I,EAAcxI,KAAKwI,EAAc7J,KAAK,UACtCV,KAAK2D,YAAYsG,OAEjBF,EAAW7J,KAAK,2BAA2BI,QAAQ,YAQrDkK,SAAU,WAER,OAAOC,KAAKC,MAAMC,UAAU3K,KAAK4K,QAAQnD,SAW3CzE,SAAU,SAAU6H,EAAUC,EAASC,GAErC,IAAIC,EAAgBH,EAClBI,EAAS,GAEPF,IACFvK,OAAOkE,KAAK1E,KAAK2B,OAAOC,QAAQ,SAAUsJ,EAAOlJ,GAE7C,UAAYA,EAAMX,MAClB,kBAAoBW,EAAMX,MAC1B,WAAaW,EAAMX,MAEnB4J,EAAOE,KAAKD,MAGhB1K,OAAOkE,KAAKmG,GAAU,SAAUK,EAAOlJ,GACrCxB,OAAOkE,KAAKuG,GAAQ,SAAUG,EAAK9J,GAC5BC,EAAEG,YAAYM,EAAMV,KAAYC,EAAEG,YAAYM,EAAMV,GAAO6I,MAC9Da,EAAcE,GAAO5J,GAASU,EAAMV,GAAO6I,WAMnDnK,KAAK4K,QAAQhC,IAAIyC,UAAUZ,KAAKa,UAAUN,KAEtCF,GAGF9K,KAAK8C,aAAaxC,QAAQ,WAU9BgD,OAAQ,SAAU5C,GAChB,IAIE6K,EACAC,EACAC,EANE3L,EAAUE,KACZsE,EAAWxE,EAAQiE,mBACnBlB,EAAe7C,KAAKwK,WACpBkB,EAAgB,GAKlB,GAAIpH,EAAU,CAOZ,GAHAiH,EAAe/K,OAAO8B,QAAO,EAAM,GAAIxC,EAAQ6B,OAAOC,QAGlDlB,EACF,IAAK+K,KAAK/K,EACJA,EAAKiL,eAAeF,IAAMF,EAAaI,eAAeF,KACxDF,EAAaE,GAAGG,QAAUlL,EAAK+K,IAiCrC,IAAKA,KA5BLF,EAAaL,MAAQlL,KAAKkD,aAG1BoB,EAAWA,EAASiH,IAGpBC,EAAS,IAAI9L,EACXI,EAAQoD,aACR1C,OAAO8D,GAAUuH,SAAS/L,EAAQmD,yBAClCnD,EAAQ6B,OAAOmK,UACfhM,IAGKF,UAAUO,GAAG,cAAc,SAAUI,EAAGZ,GAC7CG,EAAQiM,UAAUpM,MAGpB6L,EAAO5L,UAAUO,GACf,cACA,SAAUI,EAAGZ,EAAUqM,EAAWC,GAChCnM,EAAQoM,YAAYC,KAAKrM,EAASS,EAAGZ,EAAUqM,EAAWC,GAC1DT,EAAO1K,iBAKXd,KAAKmD,KAAKnD,KAAKkD,cAAgBsI,EAErBD,EACJA,EAAaI,eAAeF,KAC9BC,EAAcD,GAAKF,EAAaE,GAAGG,SASvC,OALA/I,EAAa7C,KAAKkD,cAAgBwI,EAClC1L,KAAKgD,SAASH,GAAc,GAE5B7C,KAAKkD,eAEEsI,IAIXzG,KAAM,WACJ,IAAIjF,EAAUE,KACZoM,EAAQpM,KAAKiD,wBAAwB/C,KAAK,iBAC1CmM,EAAW,GACXC,EAAWxM,EAAQ0K,WACnB+B,EAAU,GACVC,EAAc,GAEhBJ,EAAM1H,MAAK,SAAU+G,EAAGQ,GACtBI,EAASlB,KAAK3K,OAAOyL,GAASvL,KAAK,WAGrCF,OAAOkE,KAAK2H,GAAU,SAAUI,EAAaC,GAC3CH,EAAQE,GAAe3M,EAAQqD,KAAKuJ,GACpCH,EAAQE,GAAa9L,YAAY8L,GAEjCD,EAAYC,GAAeH,EAASI,MAGtC5M,EAAQqD,KAAOoJ,EACfzM,EAAQkD,SAASwJ,IASnBT,UAAW,SAAUb,GACnB,IAEEyB,EAFEC,EAAkB5M,KAAKwK,WAoB3B,IAAKmC,KAhBDC,EAAgB1B,IAEZlL,KAAKmD,KAAK+H,YAGP0B,EAAgB1B,UAGhBlL,KAAKmD,KAAK+H,GAGjBlL,KAAKgD,SAAS4J,GAAiB,IAKtB5M,KAAKmD,KACZnD,KAAKmD,KAAKwI,eAAegB,IAAS3M,KAAKmD,KAAKwJ,IAC9C3M,KAAKmD,KAAKwJ,GAAM7L,eAetBoL,YAAa,SAAU3L,EAAGZ,EAAUkN,EAASZ,GAC3C,IAAI5K,EAAMyL,EAAKF,EAEV5M,KAAKmD,KAAKxD,IAIVK,KAAK2B,OAAOC,OAAOiL,KAIxBxL,EAAOrB,KAAK2B,OAAOC,OAAOiL,GAASxL,KACnCyL,EAAM9M,KAAKmD,KAAKxD,GAChBiN,EAAkB5M,KAAKwK,WAEvByB,EAAUzL,OAAOyL,GAEb1K,EAAEG,YAAYkL,EAAgBE,EAAInN,UAAUkN,MAK9CD,EAAgBE,EAAInN,UAAUkN,GAD5B,aAAexL,EACwB4K,EAAQc,GAAG,YAGXd,EAAQxK,MAEnDzB,KAAKgD,SAAS4J,GAAiB,MASjCrJ,gBAAiB,WACf,IAAIzD,EAAUE,KACVgN,EAAclN,EAAQF,UAAUM,KAAK,+BACrC2M,EAAUG,EAAYtM,KAAK,SAC3BuD,EAAU,GAIX1C,EAAEG,YAAYmL,IACdtL,EAAEG,YAAY5B,EAAQ6B,OAAOC,OAAOiL,KACpCtL,EAAEG,YAAY5B,EAAQ6B,OAAOC,OAAOiL,GAASI,YAC9C1L,EAAEgF,SAASzG,EAAQ6B,OAAOC,OAAOiL,GAASI,YAE1ChJ,EAAQgJ,SAAWnN,EAAQ6B,OAAOC,OAAOiL,GAASI,UAIpDhJ,EAAQiJ,OAAS,SAAUlI,EAAOmI,GAChC,IAAIC,EAAgB5M,OAAOwE,EAAMvE,QAE7Bd,EADMyN,EAAcjI,QAAQ,iBACbzE,KAAK,OACpBkM,EAAkB9M,EAAQ0K,WAC1BxI,EAAQmL,EAAGE,MAAMC,OAAS,EAAIH,EAAGE,MAAME,OAASJ,EAAGE,MAAMG,WAE7DZ,EAAgBjN,GAAUyN,EAAc1M,KAAK,UAAYsB,EACzDlC,EAAQkD,SAAS4J,GAAiB,GAIrCa,YAAW,WACVzI,EAAMvE,OAAOuB,MAAQA,IACnB,KAIEgL,EAAYvI,QAAU,IAAMuI,EAAYvI,QAC1CuI,EAAYU,cAAczJ,IAY9BT,WAAY,SAAUZ,EAAWlC,GAC/B,IAEEiN,EAFE7N,EAAUE,KACZ4N,EAAWhL,EAAUhD,UAAUM,KAAK,0BAGlC,IAAM0N,EAASnJ,SAInBkJ,EAAYC,EAASlN,KAAK,SAC1BuF,SAAWzF,OAAOoN,GAAUlN,KAAK,aAEjCA,EAAOA,GAAQ,IACViN,GAAajN,EAAKiN,IAAc,GAErCnN,OAAOoN,GAAUnM,IAAIf,EAAKiN,IAAcnN,OAAOoN,GAAUnM,OAEzDzB,KAAKJ,UAAUO,GAAG,SAAU,0BAA0B,SAAU6E,GAC9D,IAAI6I,EAAkBrN,OAAOwE,EAAMvE,QAEjCd,EADMkO,EAAgB1I,QAAQ,iBACfzE,KAAK,OACpBkM,EAAkB9M,EAAQ0K,WAE5BoC,EAAgBjN,GAAUkO,EAAgBnN,KAAK,UAC7CF,OAAOR,MAAMyB,MACf3B,EAAQkD,SAAS4J","sources":["packages/kirki-framework/control-repeater/src/control.js"],"sourcesContent":["import \"./control.scss\";\n\n/* global kirkiControlLoader */\n/* eslint max-depth: 0 */\n/* eslint no-useless-escape: 0 */\nvar RepeaterRow = function (rowIndex, container, label, control) {\n var self = this;\n this.rowIndex = rowIndex;\n this.container = container;\n this.label = label;\n this.header = this.container.find(\".repeater-row-header\");\n\n this.header.on(\"click\", function () {\n self.toggleMinimize();\n });\n\n this.container.on(\"click\", \".repeater-row-remove\", function () {\n self.remove();\n });\n\n this.header.on(\"mousedown\", function () {\n self.container.trigger(\"row:start-dragging\");\n });\n\n this.container.on(\"keyup change\", \"input, select, textarea\", function (e) {\n self.container.trigger(\"row:update\", [\n self.rowIndex,\n jQuery(e.target).data(\"field\"),\n e.target,\n ]);\n });\n\n this.setRowIndex = function (rowNum) {\n this.rowIndex = rowNum;\n this.container.attr(\"data-row\", rowNum);\n this.container.data(\"row\", rowNum);\n this.updateLabel();\n };\n\n this.toggleMinimize = function () {\n // Store the previous state.\n this.container.toggleClass(\"minimized\");\n this.header\n .find(\".dashicons\")\n .toggleClass(\"dashicons-arrow-up\")\n .toggleClass(\"dashicons-arrow-down\");\n };\n\n this.remove = function () {\n this.container.slideUp(300, function () {\n jQuery(this).detach();\n });\n this.container.trigger(\"row:remove\", [this.rowIndex]);\n };\n\n this.updateLabel = function () {\n var rowLabelField, rowLabel, rowLabelSelector;\n\n if (\"field\" === this.label.type) {\n rowLabelField = this.container.find(\n '.repeater-field [data-field=\"' + this.label.field + '\"]'\n );\n if (_.isFunction(rowLabelField.val)) {\n rowLabel = rowLabelField.val();\n if (\"\" !== rowLabel) {\n if (!_.isUndefined(control.params.fields[this.label.field])) {\n if (!_.isUndefined(control.params.fields[this.label.field].type)) {\n if (\"select\" === control.params.fields[this.label.field].type) {\n if (\n !_.isUndefined(\n control.params.fields[this.label.field].choices\n ) &&\n !_.isUndefined(\n control.params.fields[this.label.field].choices[\n rowLabelField.val()\n ]\n )\n ) {\n rowLabel =\n control.params.fields[this.label.field].choices[\n rowLabelField.val()\n ];\n }\n } else if (\n \"radio\" === control.params.fields[this.label.field].type ||\n \"radio-image\" === control.params.fields[this.label.field].type\n ) {\n rowLabelSelector =\n control.selector +\n ' [data-row=\"' +\n this.rowIndex +\n '\"] .repeater-field [data-field=\"' +\n this.label.field +\n '\"]:checked';\n rowLabel = jQuery(rowLabelSelector).val();\n }\n }\n }\n this.header.find(\".repeater-row-label\").text(rowLabel);\n return;\n }\n }\n }\n this.header\n .find(\".repeater-row-label\")\n .text(this.label.value + \" \" + (this.rowIndex + 1));\n };\n this.updateLabel();\n};\n\nwp.customize.controlConstructor.repeater = wp.customize.Control.extend({\n // When we're finished loading continue processing\n ready: function () {\n var control = this;\n\n // Init the control.\n if (\n !_.isUndefined(window.kirkiControlLoader) &&\n _.isFunction(kirkiControlLoader)\n ) {\n kirkiControlLoader(control);\n } else {\n control.initKirkiControl();\n }\n },\n\n initKirkiControl: function (control) {\n var limit, theNewRow, settingValue;\n control = control || this;\n\n // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)\n settingValue = control.params.value;\n\n // The hidden field that keeps the data saved (though we never update it)\n control.settingField = control.container\n .find(\"[data-customize-setting-link]\")\n .first();\n\n // Set the field value for the first time, we'll fill it up later\n control.setValue([], false);\n\n // The DIV that holds all the rows\n control.repeaterFieldsContainer = control.container\n .find(\".repeater-fields\")\n .first();\n\n // Set number of rows to 0\n control.currentIndex = 0;\n\n // Save the rows objects\n control.rows = [];\n\n // Default limit choice\n limit = false;\n if (!_.isUndefined(control.params.choices.limit)) {\n limit =\n 0 >= control.params.choices.limit\n ? false\n : parseInt(control.params.choices.limit, 10);\n }\n\n control.container.on(\"click\", \"button.repeater-add\", function (e) {\n e.preventDefault();\n if (!limit || control.currentIndex < limit) {\n theNewRow = control.addRow();\n theNewRow.toggleMinimize();\n control.initColorPicker();\n control.initSelect(theNewRow);\n } else {\n jQuery(control.selector + \" .limit\").addClass(\"highlight\");\n }\n });\n\n control.container.on(\"click\", \".repeater-row-remove\", function () {\n control.currentIndex--;\n if (!limit || control.currentIndex < limit) {\n jQuery(control.selector + \" .limit\").removeClass(\"highlight\");\n }\n });\n\n control.container.on(\n \"click keypress\",\n \".repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button\",\n function (e) {\n e.preventDefault();\n control.$thisButton = jQuery(this);\n control.openFrame(e);\n }\n );\n\n control.container.on(\n \"click keypress\",\n \".repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button\",\n function (e) {\n e.preventDefault();\n control.$thisButton = jQuery(this);\n control.removeImage(e);\n }\n );\n\n control.container.on(\n \"click keypress\",\n \".repeater-field-upload .remove-button\",\n function (e) {\n e.preventDefault();\n control.$thisButton = jQuery(this);\n control.removeFile(e);\n }\n );\n\n /**\n * Function that loads the Mustache template\n */\n control.repeaterTemplate = _.memoize(function () {\n var compiled,\n /*\n * Underscore's default ERB-style templates are incompatible with PHP\n * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.\n *\n * @see trac ticket #22344.\n */\n options = {\n evaluate: /<#([\\s\\S]+?)#>/g,\n interpolate: /\\{\\{\\{([\\s\\S]+?)\\}\\}\\}/g,\n escape: /\\{\\{([^\\}]+?)\\}\\}(?!\\})/g,\n variable: \"data\",\n };\n\n return function (data) {\n compiled = _.template(\n control.container\n .find(\".customize-control-repeater-content\")\n .first()\n .html(),\n null,\n options\n );\n return compiled(data);\n };\n });\n\n // When we load the control, the fields have not been filled up\n // This is the first time that we create all the rows\n if (settingValue.length) {\n _.each(settingValue, function (subValue) {\n theNewRow = control.addRow(subValue);\n control.initColorPicker();\n control.initSelect(theNewRow, subValue);\n });\n }\n\n control.repeaterFieldsContainer.sortable({\n handle: \".repeater-row-header\",\n update: function () {\n control.sort();\n },\n });\n },\n\n /**\n * Open the media modal.\n *\n * @param {Object} event - The JS event.\n * @returns {void}\n */\n openFrame: function (event) {\n if (wp.customize.utils.isKeydownButNotEnterEvent(event)) {\n return;\n }\n\n if (\n this.$thisButton\n .closest(\".repeater-field\")\n .hasClass(\"repeater-field-cropped_image\")\n ) {\n this.initCropperFrame();\n } else {\n this.initFrame();\n }\n\n this.frame.open();\n },\n\n initFrame: function () {\n var libMediaType = this.getMimeType();\n\n this.frame = wp.media({\n states: [\n new wp.media.controller.Library({\n library: wp.media.query({ type: libMediaType }),\n multiple: false,\n date: false,\n }),\n ],\n });\n\n // When a file is selected, run a callback.\n this.frame.on(\"select\", this.onSelect, this);\n },\n\n /**\n * Create a media modal select frame, and store it so the instance can be reused when needed.\n * This is mostly a copy/paste of Core api.CroppedImageControl in /wp-admin/js/customize-control.js\n *\n * @returns {void}\n */\n initCropperFrame: function () {\n // We get the field id from which this was called\n var currentFieldId = this.$thisButton\n .siblings(\"input.hidden-field\")\n .attr(\"data-field\"),\n attrs = [\"width\", \"height\", \"flex_width\", \"flex_height\"], // A list of attributes to look for\n libMediaType = this.getMimeType();\n\n // Make sure we got it\n if (_.isString(currentFieldId) && \"\" !== currentFieldId) {\n // Make fields is defined and only do the hack for cropped_image\n if (\n _.isObject(this.params.fields[currentFieldId]) &&\n \"cropped_image\" === this.params.fields[currentFieldId].type\n ) {\n //Iterate over the list of attributes\n attrs.forEach(\n function (el) {\n // If the attribute exists in the field\n if (!_.isUndefined(this.params.fields[currentFieldId][el])) {\n // Set the attribute in the main object\n this.params[el] = this.params.fields[currentFieldId][el];\n }\n }.bind(this)\n );\n }\n }\n\n this.frame = wp.media({\n button: {\n text: \"Select and Crop\",\n close: false,\n },\n states: [\n new wp.media.controller.Library({\n library: wp.media.query({ type: libMediaType }),\n multiple: false,\n date: false,\n suggestedWidth: this.params.width,\n suggestedHeight: this.params.height,\n }),\n new wp.media.controller.CustomizeImageCropper({\n imgSelectOptions: this.calculateImageSelectOptions,\n control: this,\n }),\n ],\n });\n\n this.frame.on(\"select\", this.onSelectForCrop, this);\n this.frame.on(\"cropped\", this.onCropped, this);\n this.frame.on(\"skippedcrop\", this.onSkippedCrop, this);\n },\n\n onSelect: function () {\n var attachment = this.frame.state().get(\"selection\").first().toJSON();\n\n if (\n this.$thisButton\n .closest(\".repeater-field\")\n .hasClass(\"repeater-field-upload\")\n ) {\n this.setFileInRepeaterField(attachment);\n } else {\n this.setImageInRepeaterField(attachment);\n }\n },\n\n /**\n * After an image is selected in the media modal, switch to the cropper\n * state if the image isn't the right size.\n */\n\n onSelectForCrop: function () {\n var attachment = this.frame.state().get(\"selection\").first().toJSON();\n\n if (\n this.params.width === attachment.width &&\n this.params.height === attachment.height &&\n !this.params.flex_width &&\n !this.params.flex_height\n ) {\n this.setImageInRepeaterField(attachment);\n } else {\n this.frame.setState(\"cropper\");\n }\n },\n\n /**\n * After the image has been cropped, apply the cropped image data to the setting.\n *\n * @param {object} croppedImage Cropped attachment data.\n * @returns {void}\n */\n onCropped: function (croppedImage) {\n this.setImageInRepeaterField(croppedImage);\n },\n\n /**\n * Returns a set of options, computed from the attached image data and\n * control-specific data, to be fed to the imgAreaSelect plugin in\n * wp.media.view.Cropper.\n *\n * @param {wp.media.model.Attachment} attachment - The attachment from the WP API.\n * @param {wp.media.controller.Cropper} controller - Media controller.\n * @returns {Object} - Options.\n */\n calculateImageSelectOptions: function (attachment, controller) {\n var control = controller.get(\"control\"),\n flexWidth = !!parseInt(control.params.flex_width, 10),\n flexHeight = !!parseInt(control.params.flex_height, 10),\n realWidth = attachment.get(\"width\"),\n realHeight = attachment.get(\"height\"),\n xInit = parseInt(control.params.width, 10),\n yInit = parseInt(control.params.height, 10),\n ratio = xInit / yInit,\n xImg = realWidth,\n yImg = realHeight,\n x1,\n y1,\n imgSelectOptions;\n\n controller.set(\n \"canSkipCrop\",\n !control.mustBeCropped(\n flexWidth,\n flexHeight,\n xInit,\n yInit,\n realWidth,\n realHeight\n )\n );\n\n if (xImg / yImg > ratio) {\n yInit = yImg;\n xInit = yInit * ratio;\n } else {\n xInit = xImg;\n yInit = xInit / ratio;\n }\n\n x1 = (xImg - xInit) / 2;\n y1 = (yImg - yInit) / 2;\n\n imgSelectOptions = {\n handles: true,\n keys: true,\n instance: true,\n persistent: true,\n imageWidth: realWidth,\n imageHeight: realHeight,\n x1: x1,\n y1: y1,\n x2: xInit + x1,\n y2: yInit + y1,\n };\n\n if (false === flexHeight && false === flexWidth) {\n imgSelectOptions.aspectRatio = xInit + \":\" + yInit;\n }\n if (false === flexHeight) {\n imgSelectOptions.maxHeight = yInit;\n }\n if (false === flexWidth) {\n imgSelectOptions.maxWidth = xInit;\n }\n\n return imgSelectOptions;\n },\n\n /**\n * Return whether the image must be cropped, based on required dimensions.\n *\n * @param {bool} flexW - The flex-width.\n * @param {bool} flexH - The flex-height.\n * @param {int} dstW - Initial point distance in the X axis.\n * @param {int} dstH - Initial point distance in the Y axis.\n * @param {int} imgW - Width.\n * @param {int} imgH - Height.\n * @returns {bool} - Whether the image must be cropped or not based on required dimensions.\n */\n mustBeCropped: function (flexW, flexH, dstW, dstH, imgW, imgH) {\n return !(\n (true === flexW && true === flexH) ||\n (true === flexW && dstH === imgH) ||\n (true === flexH && dstW === imgW) ||\n (dstW === imgW && dstH === imgH) ||\n imgW <= dstW\n );\n },\n\n /**\n * If cropping was skipped, apply the image data directly to the setting.\n *\n * @returns {void}\n */\n onSkippedCrop: function () {\n var attachment = this.frame.state().get(\"selection\").first().toJSON();\n this.setImageInRepeaterField(attachment);\n },\n\n /**\n * Updates the setting and re-renders the control UI.\n *\n * @param {object} attachment - The attachment object.\n * @returns {void}\n */\n setImageInRepeaterField: function (attachment) {\n var $targetDiv = this.$thisButton.closest(\n \".repeater-field-image,.repeater-field-cropped_image\"\n );\n\n $targetDiv\n .find(\".kirki-image-attachment\")\n .html('')\n .hide()\n .slideDown(\"slow\");\n\n $targetDiv.find(\".hidden-field\").val(attachment.id);\n this.$thisButton.text(this.$thisButton.data(\"alt-label\"));\n $targetDiv.find(\".remove-button\").show();\n\n //This will activate the save button\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n this.frame.close();\n },\n\n /**\n * Updates the setting and re-renders the control UI.\n *\n * @param {object} attachment - The attachment object.\n * @returns {void}\n */\n setFileInRepeaterField: function (attachment) {\n var $targetDiv = this.$thisButton.closest(\".repeater-field-upload\");\n\n $targetDiv\n .find(\".kirki-file-attachment\")\n .html(\n ' ' +\n attachment.filename +\n \"\"\n )\n .hide()\n .slideDown(\"slow\");\n\n $targetDiv.find(\".hidden-field\").val(attachment.id);\n this.$thisButton.text(this.$thisButton.data(\"alt-label\"));\n $targetDiv.find(\".upload-button\").show();\n $targetDiv.find(\".remove-button\").show();\n\n //This will activate the save button\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n this.frame.close();\n },\n\n getMimeType: function () {\n // We get the field id from which this was called\n var currentFieldId = this.$thisButton\n .siblings(\"input.hidden-field\")\n .attr(\"data-field\");\n\n // Make sure we got it\n if (_.isString(currentFieldId) && \"\" !== currentFieldId) {\n // Make fields is defined and only do the hack for cropped_image\n if (\n _.isObject(this.params.fields[currentFieldId]) &&\n \"upload\" === this.params.fields[currentFieldId].type\n ) {\n // If the attribute exists in the field\n if (!_.isUndefined(this.params.fields[currentFieldId].mime_type)) {\n // Set the attribute in the main object\n return this.params.fields[currentFieldId].mime_type;\n }\n }\n }\n return \"image\";\n },\n\n removeImage: function (event) {\n var $targetDiv, $uploadButton;\n\n if (wp.customize.utils.isKeydownButNotEnterEvent(event)) {\n return;\n }\n\n $targetDiv = this.$thisButton.closest(\n \".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload\"\n );\n $uploadButton = $targetDiv.find(\".upload-button\");\n\n $targetDiv.find(\".kirki-image-attachment\").slideUp(\"fast\", function () {\n jQuery(this).show().html(jQuery(this).data(\"placeholder\"));\n });\n $targetDiv.find(\".hidden-field\").val(\"\");\n $uploadButton.text($uploadButton.data(\"label\"));\n this.$thisButton.hide();\n\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n },\n\n removeFile: function (event) {\n var $targetDiv, $uploadButton;\n\n if (wp.customize.utils.isKeydownButNotEnterEvent(event)) {\n return;\n }\n\n $targetDiv = this.$thisButton.closest(\".repeater-field-upload\");\n $uploadButton = $targetDiv.find(\".upload-button\");\n\n $targetDiv.find(\".kirki-file-attachment\").slideUp(\"fast\", function () {\n jQuery(this).show().html(jQuery(this).data(\"placeholder\"));\n });\n $targetDiv.find(\".hidden-field\").val(\"\");\n $uploadButton.text($uploadButton.data(\"label\"));\n this.$thisButton.hide();\n\n $targetDiv.find(\"input, textarea, select\").trigger(\"change\");\n },\n\n /**\n * Get the current value of the setting\n *\n * @returns {Object} - Returns the value.\n */\n getValue: function () {\n // The setting is saved in JSON\n return JSON.parse(decodeURI(this.setting.get()));\n },\n\n /**\n * Set a new value for the setting\n *\n * @param {Object} newValue - The new value.\n * @param {bool} refresh - If we want to refresh the previewer or not\n * @param {bool} filtering - If we want to filter or not.\n * @returns {void}\n */\n setValue: function (newValue, refresh, filtering) {\n // We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB\n var filteredValue = newValue,\n filter = [];\n\n if (filtering) {\n jQuery.each(this.params.fields, function (index, value) {\n if (\n \"image\" === value.type ||\n \"cropped_image\" === value.type ||\n \"upload\" === value.type\n ) {\n filter.push(index);\n }\n });\n jQuery.each(newValue, function (index, value) {\n jQuery.each(filter, function (ind, field) {\n if (!_.isUndefined(value[field]) && !_.isUndefined(value[field].id)) {\n filteredValue[index][field] = value[field].id;\n }\n });\n });\n }\n\n this.setting.set(encodeURI(JSON.stringify(filteredValue)));\n\n if (refresh) {\n // Trigger the change event on the hidden field so\n // previewer refresh the website on Customizer\n this.settingField.trigger(\"change\");\n }\n },\n\n /**\n * Add a new row to repeater settings based on the structure.\n *\n * @param {Object} data - (Optional) Object of field => value pairs (undefined if you want to get the default values)\n * @returns {Object} - Returns the new row.\n */\n addRow: function (data) {\n var control = this,\n template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).\n settingValue = this.getValue(), // Get the current setting value.\n newRowSetting = {}, // Saves the new setting data.\n templateData, // Data to pass to the template\n newRow,\n i;\n\n if (template) {\n // The control structure is going to define the new fields\n // We need to clone control.params.fields. Assigning it\n // ould result in a reference assignment.\n templateData = jQuery.extend(true, {}, control.params.fields);\n\n // But if we have passed data, we'll use the data values instead\n if (data) {\n for (i in data) {\n if (data.hasOwnProperty(i) && templateData.hasOwnProperty(i)) {\n templateData[i].default = data[i];\n }\n }\n }\n\n templateData.index = this.currentIndex;\n\n // Append the template content\n template = template(templateData);\n\n // Create a new row object and append the element\n newRow = new RepeaterRow(\n control.currentIndex,\n jQuery(template).appendTo(control.repeaterFieldsContainer),\n control.params.row_label,\n control\n );\n\n newRow.container.on(\"row:remove\", function (e, rowIndex) {\n control.deleteRow(rowIndex);\n });\n\n newRow.container.on(\n \"row:update\",\n function (e, rowIndex, fieldName, element) {\n control.updateField.call(control, e, rowIndex, fieldName, element); // eslint-disable-line no-useless-call\n newRow.updateLabel();\n }\n );\n\n // Add the row to rows collection\n this.rows[this.currentIndex] = newRow;\n\n for (i in templateData) {\n if (templateData.hasOwnProperty(i)) {\n newRowSetting[i] = templateData[i].default;\n }\n }\n\n settingValue[this.currentIndex] = newRowSetting;\n this.setValue(settingValue, true);\n\n this.currentIndex++;\n\n return newRow;\n }\n },\n\n sort: function () {\n var control = this,\n $rows = this.repeaterFieldsContainer.find(\".repeater-row\"),\n newOrder = [],\n settings = control.getValue(),\n newRows = [],\n newSettings = [];\n\n $rows.each(function (i, element) {\n newOrder.push(jQuery(element).data(\"row\"));\n });\n\n jQuery.each(newOrder, function (newPosition, oldPosition) {\n newRows[newPosition] = control.rows[oldPosition];\n newRows[newPosition].setRowIndex(newPosition);\n\n newSettings[newPosition] = settings[oldPosition];\n });\n\n control.rows = newRows;\n control.setValue(newSettings);\n },\n\n /**\n * Delete a row in the repeater setting\n *\n * @param {int} index - Position of the row in the complete Setting Array\n * @returns {void}\n */\n deleteRow: function (index) {\n var currentSettings = this.getValue(),\n row,\n prop;\n\n if (currentSettings[index]) {\n // Find the row\n row = this.rows[index];\n if (row) {\n // Remove the row settings\n delete currentSettings[index];\n\n // Remove the row from the rows collection\n delete this.rows[index];\n\n // Update the new setting values\n this.setValue(currentSettings, true);\n }\n }\n\n // Remap the row numbers\n for (prop in this.rows) {\n if (this.rows.hasOwnProperty(prop) && this.rows[prop]) {\n this.rows[prop].updateLabel();\n }\n }\n },\n\n /**\n * Update a single field inside a row.\n * Triggered when a field has changed\n *\n * @param {Object} e - Event Object\n * @param {int} rowIndex - The row's index as an integer.\n * @param {string} fieldId - The field ID.\n * @param {string|Object} element - The element's identifier, or jQuery Object of the element.\n * @returns {void}\n */\n updateField: function (e, rowIndex, fieldId, element) {\n var type, row, currentSettings;\n\n if (!this.rows[rowIndex]) {\n return;\n }\n\n if (!this.params.fields[fieldId]) {\n return;\n }\n\n type = this.params.fields[fieldId].type;\n row = this.rows[rowIndex];\n currentSettings = this.getValue();\n\n element = jQuery(element);\n\n if (_.isUndefined(currentSettings[row.rowIndex][fieldId])) {\n return;\n }\n\n if (\"checkbox\" === type) {\n currentSettings[row.rowIndex][fieldId] = element.is(\":checked\");\n } else {\n // Update the settings\n currentSettings[row.rowIndex][fieldId] = element.val();\n }\n this.setValue(currentSettings, true);\n },\n\n /**\n * Init the color picker on color fields\n * Called after AddRow\n *\n * @returns {void}\n */\n initColorPicker: function () {\n var control = this;\n var colorPicker = control.container.find(\".kirki-classic-color-picker\");\n var fieldId = colorPicker.data(\"field\");\n var options = {};\n\n // We check if the color palette parameter is defined.\n if (\n !_.isUndefined(fieldId) &&\n !_.isUndefined(control.params.fields[fieldId]) &&\n !_.isUndefined(control.params.fields[fieldId].palettes) &&\n _.isObject(control.params.fields[fieldId].palettes)\n ) {\n options.palettes = control.params.fields[fieldId].palettes;\n }\n\n // When the color picker value is changed we update the value of the field\n options.change = function (event, ui) {\n var currentPicker = jQuery(event.target);\n var row = currentPicker.closest(\".repeater-row\");\n var rowIndex = row.data(\"row\");\n var currentSettings = control.getValue();\n var value = ui.color._alpha < 1 ? ui.color.to_s() : ui.color.toString();\n\n currentSettings[rowIndex][currentPicker.data(\"field\")] = value;\n control.setValue(currentSettings, true);\n\n\t\t\t// By default if the alpha is 1, the input will be rgb.\n\t\t\t// We setTimeout to 50ms to prevent race value set.\n\t\t\tsetTimeout(function() {\n\t\t\t\tevent.target.value = value;\n\t\t\t}, 50);\n };\n\n // Init the color picker\n if (colorPicker.length && 0 !== colorPicker.length) {\n colorPicker.wpColorPicker(options);\n }\n },\n\n /**\n * Init the dropdown-pages field.\n * Called after AddRow\n *\n * @param {object} theNewRow the row that was added to the repeater\n * @param {object} data the data for the row if we're initializing a pre-existing row\n * @returns {void}\n */\n initSelect: function (theNewRow, data) {\n var control = this,\n dropdown = theNewRow.container.find(\".repeater-field select\"),\n dataField;\n\n if (0 === dropdown.length) {\n return;\n }\n\n dataField = dropdown.data(\"field\");\n multiple = jQuery(dropdown).data(\"multiple\");\n\n data = data || {};\n data[dataField] = data[dataField] || \"\";\n\n jQuery(dropdown).val(data[dataField] || jQuery(dropdown).val());\n\n this.container.on(\"change\", \".repeater-field select\", function (event) {\n var currentDropdown = jQuery(event.target),\n row = currentDropdown.closest(\".repeater-row\"),\n rowIndex = row.data(\"row\"),\n currentSettings = control.getValue();\n\n currentSettings[rowIndex][currentDropdown.data(\"field\")] =\n jQuery(this).val();\n control.setValue(currentSettings);\n });\n },\n});\n"],"names":["$c32ddecb66401709$var$RepeaterRow","rowIndex","container","label","control","self","this","header","find","on","toggleMinimize","remove","trigger","e","jQuery","target","data","setRowIndex","rowNum","attr","updateLabel","toggleClass","slideUp","detach","rowLabelField","rowLabel","rowLabelSelector","type","field","_","isFunction","val","isUndefined","params","fields","choices","selector","text","value","wp","customize","controlConstructor","repeater","Control","extend","ready","window","kirkiControlLoader","initKirkiControl","limit","theNewRow","settingValue","settingField","first","setValue","repeaterFieldsContainer","currentIndex","rows","parseInt","preventDefault","addRow","initColorPicker","initSelect","addClass","removeClass","$thisButton","openFrame","removeImage","removeFile","repeaterTemplate","memoize","options","evaluate","interpolate","escape","variable","template","html","compiled","length","each","subValue","sortable","handle","update","sort","event","utils","isKeydownButNotEnterEvent","closest","hasClass","initCropperFrame","initFrame","frame","open","libMediaType","getMimeType","media","states","controller","Library","library","query","multiple","date","onSelect","currentFieldId","siblings","isString","isObject","forEach","el","bind","button","close","suggestedWidth","width","suggestedHeight","height","CustomizeImageCropper","imgSelectOptions","calculateImageSelectOptions","onSelectForCrop","onCropped","onSkippedCrop","attachment","state","get","toJSON","setFileInRepeaterField","setImageInRepeaterField","flex_width","flex_height","setState","croppedImage","x1","y1","flexWidth","flexHeight","realWidth","realHeight","xInit","yInit","ratio","xImg","yImg","set","mustBeCropped","handles","keys","instance","persistent","imageWidth","imageHeight","x2","y2","aspectRatio","maxHeight","maxWidth","flexW","flexH","dstW","dstH","imgW","imgH","$targetDiv","url","hide","slideDown","id","show","filename","mime_type","$uploadButton","getValue","JSON","parse","decodeURI","setting","newValue","refresh","filtering","filteredValue","filter","index","push","ind","encodeURI","stringify","templateData","newRow","i","newRowSetting","hasOwnProperty","default","appendTo","row_label","deleteRow","fieldName","element","updateField","call","$rows","newOrder","settings","newRows","newSettings","newPosition","oldPosition","prop","currentSettings","fieldId","row","is","colorPicker","palettes","change","ui","currentPicker","color","_alpha","to_s","toString","setTimeout","wpColorPicker","dataField","dropdown","currentDropdown"],"version":3,"file":"control.js.map"}kirki-packages/control-repeater/dist/wp-color-picker-alpha.min.js000064400000015273147177211530021121 0ustar00/**! * wp-color-picker-alpha * * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker * Only run in input and is defined data alpha in true * * Version: 3.0.0 * https://github.com/kallookoo/wp-color-picker-alpha * Licensed under the GPLv2 license or later. */ !function(e,a){var l,o={version:300};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var t=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(t)&&o.version<=t)return}Color.fn.hasOwnProperty("to_s")||(Color.fn.to_s=function(o){"hex"===(o=o||"hex")&&this._alpha<1&&(o="rgba");var a="";return"hex"===o?a=this.toString():this.error||(a=this.toCSS(o).replace(/\(\s+/,"(").replace(/\s+\)/,")")),a},window.wpColorPickerAlpha=o,l="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==",e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(o){return o===a&&(o=this._color),this.alphaOptions.alphaEnabled?(o=o.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(o=o.replace(/\s+/g,"")),o):o.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(o){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(i){function o(o){var a=i.val(),t=new Color(a),a=a.replace(/^(#|(rgb|hsl)a?)/,""),r=l.alphaOptions.alphaColorType;i.removeClass("iris-error"),t.error?""!==a&&i.addClass("iris-error"):"hex"===r&&"keyup"===o.type&&a.match(/^[0-9a-fA-F]{3}$/)||t.toIEOctoHex()!==l._color.toIEOctoHex()&&l._setOption("color",l._getColor(t))}var l=this;i.on("change",o).on("keyup",l._debounce(o,100)),l.options.hide&&i.one("focus",function(){l.show()})},_initControls:function(){var t,o,a,r;this._super(),this.alphaOptions.alphaEnabled&&(a=(o=(t=this).controls.strip.clone(!1,!1)).find(".iris-slider-offset"),r={stripAlpha:o,stripAlphaSlider:a},o.addClass("iris-strip-alpha"),a.addClass("iris-slider-offset-alpha"),o.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,function(o,a){t.controls[o]=a}),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(o,a){t.active="strip",t._color._alpha=parseFloat(a.value/100),t._change.apply(t,arguments)}}))},_dimensions:function(o){if(this._super(o),this.alphaOptions.alphaEnabled){for(var a=this,t=a.options,r=a.controls.square,o=a.picker.find(".iris-strip"),i=Math.round(a.picker.outerWidth(!0)-(t.border?22:0)),l=Math.round(r.outerWidth()),e=Math.round((i-l)/2),s=Math.round(e/2),n=Math.round(l+2*e+2*s);i'):t.toggler.append(''),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":r.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),r.iris({change:function(o,a){t.colorAlpha.css({"background-color":a.color.to_s(t.alphaOptions.alphaColorType)}),e.isFunction(t.options.change)&&t.options.change.call(this,o,a)}}),t.wrap.on("click.wpcolorpicker",function(o){o.stopPropagation()}),t.toggler.click(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()}),r.change(function(o){var a=e(this).val();(r.hasClass("iris-error")||""===a||a.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o))}),t.button.click(function(o){e(this).hasClass("wp-picker-default")?r.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(r.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),e.isFunction(t.options.clear)&&t.options.clear.call(this,o),r.trigger("change"))})}}))}(jQuery);kirki-packages/control-repeater/dist/control.css000064400000006530147177211530016067 0ustar00.customize-control-repeater{position:relative}.customize-control-repeater .repeater-fields .repeater-row{background:#eee;border:1px solid #e5e5e5;margin-top:.5rem;position:relative}.customize-control-repeater .repeater-fields .repeater-row.minimized{border:1px solid #dfdfdf;padding:0}.customize-control-repeater .repeater-fields .repeater-row.minimized:hover{border:1px solid #e5e5e5}.customize-control-repeater .repeater-fields .repeater-row.minimized .repeater-row-content{display:none}.customize-control-repeater .repeater-fields .repeater-row label{clear:both;margin-bottom:12px}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-,.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input{display:none}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img{border:1px solid transparent}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked+label img{border:1px solid #3498db;-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25)}.customize-control-repeater .repeater-fields .repeater-row .repeater-field:last-child{border-bottom:none;padding-bottom:0}.customize-control-repeater button.repeater-add{margin-top:1rem}.customize-control-repeater .repeater-row-content{background:#fff;padding:10px 15px}.customize-control-repeater .repeater-field{border-bottom:1px dotted #ccc;clear:both;margin-bottom:12px;padding-bottom:12px;width:100%}.customize-control-repeater .repeater-field .customize-control-description,.customize-control-repeater .repeater-field .customize-control-title{font-size:13px;line-height:normal}.customize-control-repeater .repeater-field.repeater-field-hidden{border:0;margin:0;padding:0}.customize-control-repeater .repeater-field-select select{margin-left:0}.customize-control-repeater .repeater-field-checkbox label{line-height:28px}.customize-control-repeater .repeater-field-checkbox input{line-height:28px;margin-right:5px}.customize-control-repeater .repeater-field-textarea textarea{resize:vertical;width:100%}.customize-control-repeater .repeater-row-header{word-wrap:break-word;background:#fff;border-bottom:1px solid #dfdfdf;height:auto;line-height:30px;min-height:20px;overflow:hidden;padding:10px 15px;position:relative}.customize-control-repeater .repeater-row-header:hover{cursor:move}.customize-control-repeater .repeater-row-header .dashicons{color:#a0a5aa;font-size:18px;position:absolute;right:12px;top:2px}.customize-control-repeater .repeater-row-label{display:block;font-size:13px;font-weight:600;height:18px;line-height:20px;overflow:hidden;width:90%}.customize-control-repeater .repeater-row-remove{color:#a00}.customize-control-repeater .repeater-row-remove:hover{color:red}.customize-control-repeater .repeater-minimize{line-height:36px}.customize-control-repeater .remove-button,.customize-control-repeater .upload-button{width:48%}.kirki-image-attachment{margin:0 0 10px;text-align:center}.kirki-image-attachment img{display:inline-block}.kirki-file-attachment{margin:0 0 10px;text-align:center}.kirki-file-attachment .file{background:#f9f9f9;border:1px dotted #c3c3c3;display:block;padding:10px 5px}.limit{border-radius:3px;padding:3px}.limit.highlight{background:#d32f2f;color:#fff} /*# sourceMappingURL=control.css.map */ kirki-packages/control-color-palette/src/KirkiColorPaletteControl.js000064400000006216147177211530021753 0ustar00import KirkiColorPaletteForm from './KirkiColorPaletteForm'; /** * KirkiColorPaletteControl. * * Global objects brought: * - wp * - jQuery * - React * - ReactDOM * * @class * @augments wp.customize.Control * @augments wp.customize.Class */ const KirkiColorPaletteControl = wp.customize.Control.extend({ /** * Initialize. * * @param {string} id - Control ID. * @param {object} params - Control params. */ initialize: function (id, params) { const control = this; // Bind functions to this control context for passing as React props. control.setNotificationContainer = control.setNotificationContainer.bind(control); wp.customize.Control.prototype.initialize.call(control, id, params); // The following should be eliminated with . function onRemoved(removedControl) { if (control === removedControl) { control.destroy(); control.container.remove(); wp.customize.control.unbind('removed', onRemoved); } } wp.customize.control.bind('removed', onRemoved); }, /** * Set notification container and render. * * This is called when the React component is mounted. * * @param {Element} element - Notification container. * @returns {void} */ setNotificationContainer: function setNotificationContainer(element) { const control = this; control.notifications.container = jQuery(element); control.notifications.render(); }, /** * Render the control into the DOM. * * This is called from the Control#embed() method in the parent class. * * @returns {void} */ renderContent: function renderContent() { const control = this; ReactDOM.render( , control.container[0] ); if (false !== control.params.choices.allowCollapse) { control.container.addClass('allowCollapse'); } }, /** * After control has been first rendered, start re-rendering when setting changes. * * React is able to be used here instead of the wp.customize.Element abstraction. * * @returns {void} */ ready: function ready() { const control = this; /** * Update component value's state when customizer setting's value is changed. */ control.setting.bind((val) => { control.updateComponentState(val); }); }, /** * This method will be overriden by the rendered component. */ updateComponentState: (val) => { }, /** * Handle removal/de-registration of the control. * * This is essentially the inverse of the Control#embed() method. * * @link https://core.trac.wordpress.org/ticket/31334 * @returns {void} */ destroy: function destroy() { const control = this; // Garbage collection: undo mounting that was done in the embed/renderContent method. ReactDOM.unmountComponentAtNode(control.container[0]); // Call destroy method in parent if it exists (as of #31334). if (wp.customize.Control.prototype.destroy) { wp.customize.Control.prototype.destroy.call(control); } } }); export default KirkiColorPaletteControl; kirki-packages/control-color-palette/src/KirkiColorPaletteForm.js000064400000003476147177211530021243 0ustar00import { useState } from "react"; const KirkiColorPaletteForm = (props) => { const { control, customizerSetting, choices } = props; const [selectedItem, setSelectedItem] = useState(props.value); control.updateComponentState = (val) => { setSelectedItem(val); }; const handleSelect = (e) => { customizerSetting.set(e.target.title); }; const handleReset = () => { if ("" !== props.default && "undefined" !== typeof props.default) { customizerSetting.set(props.default); } else { customizerSetting.set(props.value); } }; const size = choices.size + 2; // 2 here is 1px border on each side. return (
        {choices.colors.map((color, index) => { const itemClassName = color === selectedItem ? "kirki-color is-selected" : "kirki-color"; return (
      • ); })}
      ); }; export default KirkiColorPaletteForm; kirki-packages/control-color-palette/src/control.js000064400000000333147177211530016475 0ustar00import "./control.scss"; import KirkiColorPaletteControl from './KirkiColorPaletteControl'; // Register control type with Customizer. wp.customize.controlConstructor['kirki-color-palette'] = KirkiColorPaletteControl; kirki-packages/control-color-palette/src/control.scss000064400000003722147177211530017041 0ustar00// Color palette control. .customize-control-kirki-color-palette, .customize-control-kirki-color-palette * { box-sizing: border-box; } .customize-control-kirki-color-palette { .kirki-control-label { position: relative; display: block; } .kirki-control-form { position: relative; margin-bottom: 6px; &:hover { .kirki-control-reset { opacity: 1; } } } .kirki-control-reset { display: flex; align-items: center; justify-content: center; right: 0; top: 0; position: absolute; padding: 0; width: 20px; height: 20px; color: #50575e; background-color: transparent; border-radius: 50%; border-width: 0; opacity: 0; cursor: pointer; transition: all 0.3s; z-index: 3; // a11y: support tab focus. &:focus { opacity: 1; } } .kirki-control-reset:hover i { color: #f00; transform: rotate(-45deg); } .kirki-control-reset i { font-size: 12px; width: auto; height: auto; transform: rotate(45deg); transition: transform 0.3s; } .kirki-colors { display: flex; align-items: center; flex-wrap: wrap; width: 100%; margin: 0; padding: 0; list-style: none; &.kirki-round-colors { .kirki-color { div { border-radius: 50%; } } } } .kirki-color { position: relative; display: block; margin: 0 11px 11px 0; padding: 0; &:last-child { padding-right: 0; } > div { display: flex; align-items: center; justify-content: center; position: absolute; width: 100%; height: 100%; border-radius: 4px; border: 1px solid #dedede; transform: scale(1); cursor: pointer; transition: transform 0.2s; &:hover { transform: scale(1.2); } } &.is-selected { > div { border-color: #2271b1; border-width: 4px; } } } } kirki-packages/control-color-palette/src/Field/Color_Palette.php000064400000007714147177211530020761 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize_callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = [ __CLASS__, 'sanitize' ]; } } return $args; } /** * Filter arguments before creating the control. * * @param array $args The field arguments. * @param \WP_Customize_Manager $wp_customize The customizer instance. * * @return array $args The maybe-filtered arguments. */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-color-palette'; } return $args; } /** * Sanitize colors. * * @static * @access public * @since 1.0.2 * @param string $value The color. * @return string */ public static function sanitize( $value ) { /** * This pattern will check and match 3/6/8-character hex, rgb, rgba, hsl, hsla, hsv, and hsva colors. * * RGB regex: * @link https://stackoverflow.com/questions/9585973/javascript-regular-expression-for-rgb-values#answer-9586045 * * For testing it, you can use these links: * * @link https://regex101.com/ * @link https://regexr.com/ * @link https://www.regextester.com/ * * How to test it? * * Paste the following code to the test field (of course without the asterisks and spaces in front of them): * rgba(255, 255, 0, 0.9) * rgb(255, 255, 0) * #ff0 * #ffff00 * hsl(150, 25%, 25%) * hsla(250, 25%, 25%, 0.7) * hsv(125, 15%, 30%) * hsva(125, 15%, 30%, 0.5) * * And then paste the regex `$pattern` below (without the single quote's start and end) to the regular expression box. * Set the flag to use "global" and "multiline". */ $pattern = '/^(\#[\da-f]{3}|\#[\da-f]{6}|\#[\da-f]{8}|rgba\(((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*,\s*){2}((\d{1,2}|1\d\d|2([0-4]\d|5[0-5]))\s*)(,\s*(0\.\d+|1))\)|rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)|hsla\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)(,\s*(0\.\d+|1))\)|hsl\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)\)|hsva\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)(,\s*(0\.\d+|1))\)|hsv\(\s*((\d{1,2}|[1-2]\d{2}|3([0-5]\d|60)))\s*,\s*((\d{1,2}|100)\s*%)\s*,\s*((\d{1,2}|100)\s*%)\))$/'; \preg_match( $pattern, $value, $matches ); // Return the 1st match found. if ( isset( $matches[0] ) ) { if ( is_string( $matches[0] ) ) { return $matches[0]; } if ( is_array( $matches[0] ) && isset( $matches[0][0] ) ) { return $matches[0][0]; } } // If no match was found, return an empty string. return ''; } } kirki-packages/control-color-palette/src/Control/Color_Palette.php000064400000005422147177211530021350 0ustar00json['label'] ) ) { $this->json['label'] = html_entity_decode( $this->json['label'] ); } if ( isset( $this->json['description'] ) ) { $this->json['description'] = html_entity_decode( $this->json['description'] ); } $this->json['value'] = strtolower( $this->json['value'] ); $choices = $this->json['choices']; $this->json['choices'] = wp_parse_args( $choices, [ 'shape' => 'square', 'size' => 28, 'colors' => [], ] ); $this->json['choices']['colors'] = array_map( 'strtolower', $this->json['choices']['colors'] ); if ( isset( $choices['style'] ) && ! empty( $choices['style'] ) ) { if ( ! isset( $choices['shape'] ) || empty( $choices['shape'] ) ) { $this->json['choices']['shape'] = $choices['style']; } unset( $this->json['choices']['style'] ); } if ( ! is_numeric( $this->json['choices']['size'] ) ) { $this->json['choices']['size'] = 28; } $this->json['choices']['shape'] = 'circle' === $this->json['choices']['shape'] ? 'round' : $this->json['choices']['shape']; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Control::to_json(). * * @see WP_Customize_Control::print_template() * * @since 1.0 */ protected function content_template() {} } kirki-packages/control-color-palette/dist/control.js000064400000004722147177211530016657 0ustar00(()=>{var t={};t=React;var e=e=>{const{control:o,customizerSetting:n,choices:i}=e,[a,c]=t.useState(e.value);o.updateComponentState=t=>{c(t)};const r=t=>{n.set(t.target.title)},s=i.size+2;return React.createElement("div",{className:"kirki-control-form",tabIndex:"1"},React.createElement("label",{className:"kirki-control-label"},React.createElement("span",{className:"customize-control-title"},e.label),React.createElement("span",{className:"customize-control-description description",dangerouslySetInnerHTML:{__html:e.description}})),React.createElement("div",{className:"customize-control-notifications-container",ref:e.setNotificationContainer}),React.createElement("button",{type:"button",className:"kirki-control-reset",onClick:()=>{""!==e.default&&void 0!==e.default?n.set(e.default):n.set(e.value)}},React.createElement("i",{className:"dashicons dashicons-image-rotate"})),React.createElement("ul",{className:"kirki-colors kirki-"+i.shape+"-colors"},i.colors.map(((t,e)=>{const o=t===a?"kirki-color is-selected":"kirki-color";return React.createElement("li",{key:e.toString(),className:o,style:{width:s+"px",height:s+"px"}},React.createElement("div",{title:t,style:{backgroundColor:t},onClick:r}))}))))};function o(){return o=Object.assign||function(t){for(var e=1;e{t.updateComponentState(e)}))},updateComponentState:t=>{},destroy:function(){ReactDOM.unmountComponentAtNode(this.container[0]),wp.customize.Control.prototype.destroy&&wp.customize.Control.prototype.destroy.call(this)}});wp.customize.controlConstructor["kirki-color-palette"]=n})(); //# sourceMappingURL=control.js.map kirki-packages/control-color-palette/dist/control.css.map000064400000012653147177211530017611 0ustar00{"mappings":"AACA,gFAEE,qBCAF,CDIE,4DAEE,aAAA,CADA,iBCAJ,CDIE,2DAEE,iBAAA,CADA,iBCDJ,CDKM,sFACE,SCHR,CDQE,4DAEE,kBAAA,CASA,4BAAA,CACA,iBAAA,CACA,cAAA,CAHA,aAAA,CAKA,cAAA,CAdA,YAAA,CAQA,WAAA,CANA,sBAAA,CAWA,SAAA,CAPA,SAAA,CADA,iBAAA,CAFA,OAAA,CACA,KAAA,CAWA,kBAAA,CARA,UAAA,CASA,SCNJ,CDSI,kEACE,SCPN,CDWE,oEACE,SAAA,CACA,wBCTJ,CDYE,8DACE,cAAA,CAEA,WAAA,CACA,uBAAA,CACA,wBAAA,CAHA,UCPJ,CDaE,qDAEE,kBAAA,CADA,YAAA,CAEA,cAAA,CAIA,eAAA,CAFA,QAAA,CACA,SAAA,CAFA,UCRJ,CDeQ,yFACE,iBCbV,CDmBE,oDAEE,aAAA,CACA,oBAAA,CACA,SAAA,CAHA,iBCdJ,CDmBI,+DACE,eCjBN,CDoBI,wDAEE,kBAAA,CAMA,wBAAA,CADA,iBAAA,CAGA,cAAA,CATA,YAAA,CAKA,WAAA,CAHA,sBAAA,CACA,iBAAA,CAKA,kBAAA,CAEA,wBAAA,CANA,UCZN,CDoBM,8DACE,oBClBR,CDuBM,oEACE,oBAAA,CACA,gBCrBR","sources":["src/control.scss","%3Cinput%20css%20jyGyju%3E"],"sourcesContent":["// Color palette control.\r\n.customize-control-kirki-color-palette,\r\n.customize-control-kirki-color-palette * {\r\n box-sizing: border-box;\r\n}\r\n\r\n.customize-control-kirki-color-palette {\r\n .kirki-control-label {\r\n position: relative;\r\n display: block;\r\n }\r\n\r\n .kirki-control-form {\r\n position: relative;\r\n margin-bottom: 6px;\r\n\r\n &:hover {\r\n .kirki-control-reset {\r\n opacity: 1;\r\n }\r\n }\r\n }\r\n\r\n .kirki-control-reset {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n right: 0;\r\n top: 0;\r\n position: absolute;\r\n padding: 0;\r\n width: 20px;\r\n height: 20px;\r\n color: #50575e;\r\n background-color: transparent;\r\n border-radius: 50%;\r\n border-width: 0;\r\n opacity: 0;\r\n cursor: pointer;\r\n transition: all 0.3s;\r\n z-index: 3;\r\n\r\n // a11y: support tab focus.\r\n &:focus {\r\n opacity: 1;\r\n }\r\n }\r\n\r\n .kirki-control-reset:hover i {\r\n color: #f00;\r\n transform: rotate(-45deg);\r\n }\r\n\r\n .kirki-control-reset i {\r\n font-size: 12px;\r\n width: auto;\r\n height: auto;\r\n transform: rotate(45deg);\r\n transition: transform 0.3s;\r\n }\r\n\r\n .kirki-colors {\r\n display: flex;\r\n align-items: center;\r\n flex-wrap: wrap;\r\n width: 100%;\r\n margin: 0;\r\n padding: 0;\r\n list-style: none;\r\n\r\n &.kirki-round-colors {\r\n .kirki-color {\r\n div {\r\n border-radius: 50%;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .kirki-color {\r\n position: relative;\r\n display: block;\r\n margin: 0 11px 11px 0;\r\n padding: 0;\r\n\r\n &:last-child {\r\n padding-right: 0;\r\n }\r\n\r\n > div {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n position: absolute;\r\n width: 100%;\r\n height: 100%;\r\n border-radius: 4px;\r\n border: 1px solid #dedede;\r\n transform: scale(1);\r\n cursor: pointer;\r\n transition: transform 0.2s;\r\n\r\n &:hover {\r\n transform: scale(1.2);\r\n }\r\n }\r\n\r\n &.is-selected {\r\n > div {\r\n border-color: #2271b1;\r\n border-width: 4px;\r\n }\r\n }\r\n }\r\n}\r\n",".customize-control-kirki-color-palette,\n.customize-control-kirki-color-palette * {\n box-sizing: border-box;\n}\n\n.customize-control-kirki-color-palette .kirki-control-label {\n position: relative;\n display: block;\n}\n.customize-control-kirki-color-palette .kirki-control-form {\n position: relative;\n margin-bottom: 6px;\n}\n.customize-control-kirki-color-palette .kirki-control-form:hover .kirki-control-reset {\n opacity: 1;\n}\n.customize-control-kirki-color-palette .kirki-control-reset {\n display: flex;\n align-items: center;\n justify-content: center;\n right: 0;\n top: 0;\n position: absolute;\n padding: 0;\n width: 20px;\n height: 20px;\n color: #50575e;\n background-color: transparent;\n border-radius: 50%;\n border-width: 0;\n opacity: 0;\n cursor: pointer;\n transition: all 0.3s;\n z-index: 3;\n}\n.customize-control-kirki-color-palette .kirki-control-reset:focus {\n opacity: 1;\n}\n.customize-control-kirki-color-palette .kirki-control-reset:hover i {\n color: #f00;\n transform: rotate(-45deg);\n}\n.customize-control-kirki-color-palette .kirki-control-reset i {\n font-size: 12px;\n width: auto;\n height: auto;\n transform: rotate(45deg);\n transition: transform 0.3s;\n}\n.customize-control-kirki-color-palette .kirki-colors {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n width: 100%;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.customize-control-kirki-color-palette .kirki-colors.kirki-round-colors .kirki-color div {\n border-radius: 50%;\n}\n.customize-control-kirki-color-palette .kirki-color {\n position: relative;\n display: block;\n margin: 0 11px 11px 0;\n padding: 0;\n}\n.customize-control-kirki-color-palette .kirki-color:last-child {\n padding-right: 0;\n}\n.customize-control-kirki-color-palette .kirki-color > div {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 4px;\n border: 1px solid #dedede;\n transform: scale(1);\n cursor: pointer;\n transition: transform 0.2s;\n}\n.customize-control-kirki-color-palette .kirki-color > div:hover {\n transform: scale(1.2);\n}\n.customize-control-kirki-color-palette .kirki-color.is-selected > div {\n border-color: #2271b1;\n border-width: 4px;\n}\n/*# sourceMappingURL=control.css.map */\n"],"names":[],"version":3,"file":"control.css.map"}kirki-packages/control-color-palette/dist/control.js.map000064400000020717147177211530017435 0ustar00{"mappings":"eAAAA,EAAeC,UC6EfC,EA3E+BC,IAC7B,MAAAC,QAAQA,EAAFC,kBAAWA,EAAXC,QAA8BA,GAAYH,GAEzCI,EAAcC,GAAmBC,EAAAA,SAASN,EAAMO,OAEvDN,EAAQO,qBAAwBC,IAC9BJ,EAAgBI,IAGlB,MAAMC,EAAgBC,IACpBT,EAAkBU,IAAID,EAAEE,OAAOC,QAW3BC,EAAOZ,EAAQY,KAAO,EAE5B,OACEjB,MADFkB,cAAA,MAAA,CACOC,UAAU,qBAAqBC,SAAS,KAC3CpB,MADFkB,cAAA,QAAA,CACSC,UAAU,uBACfnB,MADFkB,cAAA,OAAA,CACQC,UAAU,2BAA2BjB,EAAMmB,OACjDrB,MADAkB,cAAA,OAAA,CAEEC,UAAU,4CACVG,wBAAyB,CAAEC,OAAQrB,EAAMsB,gBAI7CxB,MANEkB,cAAA,MAAA,CAOAC,UAAU,4CACVM,IAAKvB,EAAMwB,2BAGb1B,MALAkB,cAAA,SAAA,CAMES,KAAK,SACLR,UAAU,sBACVS,QA5BW,KACX,KAAO1B,EAAM2B,cAAW,IAAuB3B,EAAM2B,QACvDzB,EAAkBU,IAAIZ,EAAM2B,SAE5BzB,EAAkBU,IAAIZ,EAAMO,SA0B1BT,MALFkB,cAAA,IAAA,CAKKC,UAAU,sCAGfnB,MAHEkB,cAAA,KAAA,CAGEC,UAAW,sBAAwBd,EAAQyB,MAAQ,WACpDzB,EAAQ0B,OAAOC,KAAf,CAAoBC,EAAOC,KAC1B,MAAMC,EACJF,IAAU3B,EAAe,0BAA4B,cAEvD,OACEN,MADFkB,cAAA,KAAA,CAEIkB,IAAKF,EAAMG,WACXlB,UAAWgB,EACXG,MAAO,CACLC,MAAOtB,EAAO,KACduB,OAAQvB,EAAO,OAGjBjB,MARFkB,cAAA,MAAA,CASIF,MAAOiB,EACPK,MAAO,CACLG,gBAAiBR,GAEnBL,QAAShB,iOC5BvB8B,GAAAC,UAAAC,QAAAC,OAAA,CAxB2DC,WAAA,SAAAC,EAAAC,GAgD7D,MAAA7C,EAAA8C,KAEE9C,EAAMA,yBAANA,EAAAuB,yBAAAwB,KAAA/C,GAEAgD,GAAAA,UAASC,QACRC,UAAAP,WAAAQ,KAAAnD,EAAC4C,EAAAC,GArDyDN,GAAAC,UAAAxC,QAAA+C,KAAA,WAqD1D,SACK/C,EAFNgD,GAGEhD,IAFDoD,IAGCpD,EAAAqD,UACArD,EAAAsD,UAAAC,SACAhB,GAAOvC,UAAQ6C,QAAOvC,OAAtB,UAAAkD,QAwCJjC,yBAAA,SAAAkC,GAEkBX,KAGRY,cAACC,UAAuB3D,OAAQsD,GAHxBR,KAMTN,cAAUC,gkBCpHnBF,GAAGC,UAAUoB,mBAAmB,uBAAyBC","sources":["React.js","src/KirkiColorPaletteForm.js","src/KirkiColorPaletteControl.js","src/control.js"],"sourcesContent":["module.exports=React;","import { useState } from \"react\";\n\nconst KirkiColorPaletteForm = (props) => {\n const { control, customizerSetting, choices } = props;\n\n const [selectedItem, setSelectedItem] = useState(props.value);\n\n control.updateComponentState = (val) => {\n setSelectedItem(val);\n };\n\n const handleSelect = (e) => {\n customizerSetting.set(e.target.title);\n };\n\n const handleReset = () => {\n if (\"\" !== props.default && \"undefined\" !== typeof props.default) {\n customizerSetting.set(props.default);\n } else {\n customizerSetting.set(props.value);\n }\n };\n\n const size = choices.size + 2; // 2 here is 1px border on each side.\n\n return (\n
      \n \n\n
      \n\n \n \n \n\n
        \n {choices.colors.map((color, index) => {\n const itemClassName =\n color === selectedItem ? \"kirki-color is-selected\" : \"kirki-color\";\n\n return (\n \n
      \n \n );\n })}\n \n \n );\n};\n\nexport default KirkiColorPaletteForm;\n","import KirkiColorPaletteForm from './KirkiColorPaletteForm';\r\n\r\n/**\r\n * KirkiColorPaletteControl.\r\n *\r\n * Global objects brought:\r\n * - wp\r\n * - jQuery\r\n * - React\r\n * - ReactDOM\r\n *\r\n * @class\r\n * @augments wp.customize.Control\r\n * @augments wp.customize.Class\r\n */\r\nconst KirkiColorPaletteControl = wp.customize.Control.extend({\r\n\r\n\t/**\r\n\t * Initialize.\r\n\t *\r\n\t * @param {string} id - Control ID.\r\n\t * @param {object} params - Control params.\r\n\t */\r\n\tinitialize: function (id, params) {\r\n\t\tconst control = this;\r\n\r\n\t\t// Bind functions to this control context for passing as React props.\r\n\t\tcontrol.setNotificationContainer = control.setNotificationContainer.bind(control);\r\n\r\n\t\twp.customize.Control.prototype.initialize.call(control, id, params);\r\n\r\n\t\t// The following should be eliminated with .\r\n\t\tfunction onRemoved(removedControl) {\r\n\t\t\tif (control === removedControl) {\r\n\t\t\t\tcontrol.destroy();\r\n\t\t\t\tcontrol.container.remove();\r\n\t\t\t\twp.customize.control.unbind('removed', onRemoved);\r\n\t\t\t}\r\n\t\t}\r\n\t\twp.customize.control.bind('removed', onRemoved);\r\n\t},\r\n\r\n\t/**\r\n\t * Set notification container and render.\r\n\t *\r\n\t * This is called when the React component is mounted.\r\n\t *\r\n\t * @param {Element} element - Notification container.\r\n\t * @returns {void}\r\n\t */\r\n\tsetNotificationContainer: function setNotificationContainer(element) {\r\n\t\tconst control = this;\r\n\r\n\t\tcontrol.notifications.container = jQuery(element);\r\n\t\tcontrol.notifications.render();\r\n\t},\r\n\r\n\t/**\r\n\t * Render the control into the DOM.\r\n\t *\r\n\t * This is called from the Control#embed() method in the parent class.\r\n\t *\r\n\t * @returns {void}\r\n\t */\r\n\trenderContent: function renderContent() {\r\n\t\tconst control = this;\r\n\r\n\t\tReactDOM.render(\r\n\t\t\t,\r\n\t\t\tcontrol.container[0]\r\n\t\t);\r\n\r\n\t\tif (false !== control.params.choices.allowCollapse) {\r\n\t\t\tcontrol.container.addClass('allowCollapse');\r\n\t\t}\r\n\t},\r\n\r\n\t/**\r\n\t * After control has been first rendered, start re-rendering when setting changes.\r\n\t *\r\n\t * React is able to be used here instead of the wp.customize.Element abstraction.\r\n\t *\r\n\t * @returns {void}\r\n\t */\r\n\tready: function ready() {\r\n\t\tconst control = this;\r\n\r\n\t\t/**\r\n\t\t * Update component value's state when customizer setting's value is changed.\r\n\t\t */\r\n\t\tcontrol.setting.bind((val) => {\r\n\t\t\tcontrol.updateComponentState(val);\r\n\t\t});\r\n\t},\r\n\r\n\t/**\r\n\t * This method will be overriden by the rendered component.\r\n\t */\r\n\tupdateComponentState: (val) => { },\r\n\r\n\t/**\r\n\t * Handle removal/de-registration of the control.\r\n\t *\r\n\t * This is essentially the inverse of the Control#embed() method.\r\n\t *\r\n\t * @link https://core.trac.wordpress.org/ticket/31334\r\n\t * @returns {void}\r\n\t */\r\n\tdestroy: function destroy() {\r\n\t\tconst control = this;\r\n\r\n\t\t// Garbage collection: undo mounting that was done in the embed/renderContent method.\r\n\t\tReactDOM.unmountComponentAtNode(control.container[0]);\r\n\r\n\t\t// Call destroy method in parent if it exists (as of #31334).\r\n\t\tif (wp.customize.Control.prototype.destroy) {\r\n\t\t\twp.customize.Control.prototype.destroy.call(control);\r\n\t\t}\r\n\t}\r\n});\r\n\r\nexport default KirkiColorPaletteControl;\r\n","import \"./control.scss\";\r\nimport KirkiColorPaletteControl from './KirkiColorPaletteControl';\r\n\r\n\r\n// Register control type with Customizer.\r\nwp.customize.controlConstructor['kirki-color-palette'] = KirkiColorPaletteControl;\r\n"],"names":["module","React","$1a969aa9e5f28e8b$export$2e2bcd8739ae039","props","control","customizerSetting","choices","selectedItem","setSelectedItem","useState","value","updateComponentState","val","handleSelect","e","set","target","title","size","createElement","className","tabIndex","label","dangerouslySetInnerHTML","__html","description","ref","setNotificationContainer","type","onClick","default","shape","colors","map","color","index","itemClassName","key","toString","style","width","height","backgroundColor","wp","customize","Control","extend","initialize","id","params","this","bind","ReactDOM","render","prototype","call","removedControl","destroy","container","remove","onRemoved","element","notifications","unmountComponentAtNode","controlConstructor","KirkiColorPaletteControl"],"version":3,"file":"control.js.map"}kirki-packages/control-color-palette/dist/control.css000064400000003642147177211530017033 0ustar00.customize-control-kirki-color-palette,.customize-control-kirki-color-palette *{box-sizing:border-box}.customize-control-kirki-color-palette .kirki-control-label{display:block;position:relative}.customize-control-kirki-color-palette .kirki-control-form{margin-bottom:6px;position:relative}.customize-control-kirki-color-palette .kirki-control-form:hover .kirki-control-reset{opacity:1}.customize-control-kirki-color-palette .kirki-control-reset{align-items:center;background-color:transparent;border-radius:50%;border-width:0;color:#50575e;cursor:pointer;display:flex;height:20px;justify-content:center;opacity:0;padding:0;position:absolute;right:0;top:0;transition:all .3s;width:20px;z-index:3}.customize-control-kirki-color-palette .kirki-control-reset:focus{opacity:1}.customize-control-kirki-color-palette .kirki-control-reset:hover i{color:red;transform:rotate(-45deg)}.customize-control-kirki-color-palette .kirki-control-reset i{font-size:12px;height:auto;transform:rotate(45deg);transition:transform .3s;width:auto}.customize-control-kirki-color-palette .kirki-colors{align-items:center;display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0;width:100%}.customize-control-kirki-color-palette .kirki-colors.kirki-round-colors .kirki-color div{border-radius:50%}.customize-control-kirki-color-palette .kirki-color{display:block;margin:0 11px 11px 0;padding:0;position:relative}.customize-control-kirki-color-palette .kirki-color:last-child{padding-right:0}.customize-control-kirki-color-palette .kirki-color>div{align-items:center;border:1px solid #dedede;border-radius:4px;cursor:pointer;display:flex;height:100%;justify-content:center;position:absolute;transform:scale(1);transition:transform .2s;width:100%}.customize-control-kirki-color-palette .kirki-color>div:hover{transform:scale(1.2)}.customize-control-kirki-color-palette .kirki-color.is-selected>div{border-color:#2271b1;border-width:4px} /*# sourceMappingURL=control.css.map */ kirki-packages/control-checkbox/LICENSE000064400000002060147177211530013710 0ustar00MIT License Copyright (c) 2019 kirki-framework 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. kirki-packages/control-checkbox/src/scss/_vars.scss000064400000010713147177211530016460 0ustar00// See https://make.wordpress.org/design/handbook/design-guide/foundations/colors/ // Colors copied from https://codepen.io/hugobaeta/pen/RNOzoV $color-wp-blue: #0073aa; $color-medium-blue: #00a0d2; $color-light-blue: #00b9eb; $color-ultra-dark-gray: #191e23; $color-dark-gray: #23282d; $color-base-gray: #32373c; $color-dark-medium-gray: lighten($color-base-gray,15%); $color-dark-silver-gray: #82878c; $color-silver-gray: #a0a5aa; $color-light-silver-gray: #b4b9be; // $color-medium-gray: mix($color-base-gray,$color-dark-silver-gray,20%); $color-medium-gray: #999; $color-gray-900: $color-ultra-dark-gray; $color-gray-800: $color-dark-gray; $color-gray-700: $color-base-gray; $color-gray-600: lighten($color-base-gray,6%); $color-gray-500: lighten($color-base-gray,15%); $color-gray-400: lighten($color-base-gray,20%); $color-gray-300: lighten($color-base-gray,25%); $color-gray-200: lighten($color-base-gray,32%); $color-gray-100: lighten($color-base-gray,38%); $color--gray-light-900: lighten($color-base-gray,45%); $color--gray-light-800: lighten($color-base-gray,52%); $color--gray-light-700: lighten($color-base-gray,60%); $color--gray-light-600: lighten($color-base-gray,64%); $color--gray-light-500: lighten($color-base-gray,68%); $color--gray-light-400: lighten($color-base-gray,70%); $color--gray-light-300: lighten($color-base-gray,72%); $color--gray-light-200: lighten($color-base-gray,74%); $color--gray-light-100: lighten($color-base-gray,77%); $color-accent-red: #dc3232; $color-accent-fire-orange: #d54e21; $color-accent-orange: #f56e28; $color-accent-yellow: #ffb900; $color-accent-green: #46b450; //old #64b450; $color-accent-blue: $color-medium-blue; $color-accent-purple: #826eb4; //Tints and Tones and Shades - Oh My! $color-accent-red-shade30: shade($color-accent-red,30%); $color-accent-red-shade20: shade($color-accent-red,20%); $color-accent-red-shade10: shade($color-accent-red,10%); $color-accent-red-tint20: tint($color-accent-red,20%); $color-accent-red-tint40: tint($color-accent-red,40%); $color-accent-red-tint60: tint($color-accent-red,60%); $color-accent-red-tint90: tint($color-accent-red,90%); $color-accent-fire-orange-shade10: shade($color-accent-fire-orange,10%); $color-accent-fire-orange-shade5: shade($color-accent-fire-orange,5%); $color-accent-orange-tint20: tint($color-accent-orange,20%); $color-accent-orange-tint40: tint($color-accent-orange,40%); $color-accent-orange-tint60: tint($color-accent-orange,60%); $color-accent-orange-tint90: tint($color-accent-orange,90%); $color-accent-yellow-tonefire40: mix($color-accent-fire-orange,$color-accent-yellow,40%); $color-accent-yellow-tonefire20: mix($color-accent-fire-orange,$color-accent-yellow,20%); $color-accent-yellow-tint20: tint($color-accent-yellow,20%); $color-accent-yellow-tint40: tint($color-accent-yellow,40%); $color-accent-yellow-tint60: tint($color-accent-yellow,60%); $color-accent-yellow-tint90: tint($color-accent-yellow,90%); $color-accent-green-toneblue5shade25: shade(mix($color-wp-blue, $color-accent-green,5%),25%); $color-accent-green-toneblue5shade15: shade(mix($color-wp-blue, $color-accent-green,5%),15%); $color-accent-green-tint20: tint($color-accent-green,20%); $color-accent-green-tint40: tint($color-accent-green,40%); $color-accent-green-tint60: tint($color-accent-green,60%); $color-accent-green-tint70: tint($color-accent-green,70%); $color-accent-green-tint90: tint($color-accent-green,90%); $color-accent-wp-blue-shade10: shade($color-wp-blue,10%); $color-accent-blue-toneblue80: mix($color-wp-blue,$color-accent-blue,80%); $color-accent-blue-toneblue60: mix($color-wp-blue,$color-accent-blue,60%); $color-accent-blue-toneblue40: mix($color-wp-blue,$color-accent-blue,40%); $color-accent-blue-tint20: tint($color-accent-blue,20%); $color-accent-blue-tint40: tint($color-accent-blue,40%); $color-accent-blue-tint60: tint($color-accent-blue,60%); $color-accent-blue-tint75: tint($color-accent-blue,75%); $color-accent-blue-tint90: tint($color-accent-blue,90%); $color-accent-purple-shade40: shade($color-accent-purple,40%); $color-accent-purple-shade20: shade($color-accent-purple,20%); $color-accent-purple-tint20: tint($color-accent-purple,20%); $color-accent-purple-tint40: tint($color-accent-purple,40%); $color-accent-purple-tint60: tint($color-accent-purple,60%); $color-accent-purple-tint90: tint($color-accent-purple,90%); //Text Colors $textcolor-dark: rgba($color-base-gray,.8); $textcolor-dark-mid: rgba($color-base-gray,.5); $textcolor-light: rgba(#fff,.8); $textcolor-light-mid: rgba(#fff,.5); kirki-packages/control-checkbox/src/control.js000064400000001132147177211530015507 0ustar00import "./control.scss"; var kirkiCheckboxScript = { initKirkiControl: function( control ) { control = control || this; control.container.on( 'change', 'input', function() { control.setting.set( jQuery( this ).is( ':checked' ) ); } ); } }; wp.customize.controlConstructor['kirki-checkbox'] = wp.customize.kirkiDynamicControl.extend( kirkiCheckboxScript ); wp.customize.controlConstructor['kirki-switch'] = wp.customize.kirkiDynamicControl.extend( kirkiCheckboxScript ); wp.customize.controlConstructor['kirki-toggle'] = wp.customize.kirkiDynamicControl.extend( kirkiCheckboxScript ); kirki-packages/control-checkbox/src/control.scss000064400000004347147177211530016061 0ustar00@import "scss/vars"; .customize-control-kirki-toggle { .kirki-toggle { display: flex; align-items: flex-start; justify-content: space-between; .kirki-control-label { width: 80%; } .kirki-control-form { text-align: right; width: 20%; } .kirki-toggle-switch-label { width: 100%; &::before { right: 0; } &::after { right: 18px; } } } } .customize-control-kirki-switch { .kirki-switch { .kirki-toggle-switch-label { padding: 10px 0 12px 44px; text-align: left; &::before { left: 0; } &::after { left: 0; } } .toggle-on, .toggle-off { position: relative; bottom: -2px; padding-left: 5px; } .toggle-on { display: none; color: $color-wp-blue; } .toggle-off { display: inline-block; color: $color-dark-silver-gray; } } } .kirki-toggle-switch-label { position: relative; display: inline-block; cursor: pointer; &::before, &::after { box-sizing: border-box; content: ""; position: absolute; margin: 0; outline: 0; top: 50%; transform: translate3d(0, -50%, 0); transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background-color 150ms ease; } &::before { width: 37px; height: 14px; // background-color: $color-silver-gray; background-color: $color-light-silver-gray; border: 1px solid $color-light-silver-gray; border-radius: 8px; } &::after { width: 22px; height: 22px; background-color: $color-medium-gray; border-radius: 50%; // box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 2px 2px 0 rgba(0, 0, 0, 0.098), 0 1px 5px 0 rgba(0, 0, 0, 0.084); border: 1px solid rgba(0, 0, 0, 0.1); } } .kirki-toggle-switch-input { opacity: 0; &:checked { + .kirki-toggle-switch-label { &::before { // background-color: desaturate(lighten($color-wp-blue, 40%), 40%); } &::after { background-color: $color-wp-blue; transform: translate3d(100%, -50%, 0); } .toggle-on { display: inline-block; } .toggle-off { display: none; } } } } kirki-packages/control-checkbox/src/Field/Checkbox.php000064400000004427147177211530016765 0ustar00args['settings'] ) { $args = parent::filter_setting_args( $args, $wp_customize ); // Set the sanitize-callback if none is defined. if ( ! isset( $args['sanitize_callback'] ) || ! $args['sanitize_callback'] ) { $args['sanitize_callback'] = function( $value ) { return ( '0' === $value || 'false' === $value ) ? false : (bool) $value; }; } $args['default'] = isset( $args['default'] ) ? $args['default'] : false; // Make sure the default is formatted as boolean. $args['default'] = (bool) ( 1 === $args['default'] || '1' === $args['default'] || true === $args['default'] || 'true' === $args['default'] || 'on' === $args['default'] ); } return $args; } /** * Filter arguments before creating the control. * * @access public * @since 0.1 * @param array $args The field arguments. * @param WP_Customize_Manager $wp_customize The customizer instance. * @return array */ public function filter_control_args( $args, $wp_customize ) { if ( $args['settings'] === $this->args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-checkbox'; } return $args; } } kirki-packages/control-checkbox/src/Field/Checkbox_Toggle.php000064400000001744147177211530020265 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-toggle'; } return $args; } } kirki-packages/control-checkbox/src/Field/Checkbox_Switch.php000064400000002100147177211530020270 0ustar00args['settings'] ) { $args = parent::filter_control_args( $args, $wp_customize ); $args['type'] = 'kirki-switch'; } return $args; } } kirki-packages/control-checkbox/src/Control/Checkbox.php000064400000004303147177211530017353 0ustar00 aria-describedby="_customize-description-{{ data.id }}"<# } #> <# if ( data.value ) { #>checked="checked"<# } #> /> <# if ( data.description ) { #> {{{ data.description }}} <# } #> json['checkboxType'] = str_ireplace( 'kirki-', '', $this->type ); $this->json['defaultChoices'] = [ 'on' => __( 'On', 'kirki' ), 'off' => __( 'Off', 'kirki' ), ]; } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() * * @access protected * @since 1.0 * @return void */ protected function content_template() { ?>
      <# if ( data.label || data.description ) { #>
      <# if ( data.label ) { #> <# } #> <# if ( data.description ) { #> {{{ data.description }}} <# } #>
      <# } #>
      checked<# } #> />
      { const { selectProps } = props; const optionSelectedLength = props.getValue().length || 0; return ( {optionSelectedLength < selectProps.maxSelectionNumber ? ( props.children ) : (
      {selectProps.messages.maxLimitReached}
      )}
      ); }; const KirkiSelectForm = (props) => { /** * Pass-on the value to the customizer object to save. * * @param {Object} val - The selected option. */ const handleChangeComplete = (val, type) => { let newValue; if ("clear" === type) { newValue = ""; } else { if (Array.isArray(val)) { newValue = val.map((item) => item.value); } else { newValue = val.value; } } wp.customize(props.customizerSetting.id).set(newValue); }; /** * Change the color-scheme using WordPress colors. * * @param {Object} theme */ const theme = (theme) => ({ ...theme, colors: { ...theme.colors, primary: "#0073aa", primary75: "#33b3db", primary50: "#99d9ed", primary24: "#e5f5fa", }, }); const customStyles = { control: (base, state) => ({ ...base, minHeight: "30px", }), valueContainer: (base) => ({ ...base, padding: "0 6px", }), input: (base) => ({ ...base, margin: "0px", }), }; /** * Allow rendering HTML in select labels. * * @param {Object} props - Object { label: foo, value: bar }. */ const getLabel = (props) => { return
      ; }; const inputId = props.inputId ? props.inputId : "kirki-react-select-input--" + props.customizerSetting.id; const label = props.label ? (